Tomas Studva wrote:
Hi Dave,
what is an iterative stylesheet execution model? I can look into Xalan-C
code, but it is time consuming (so I won't look) and I need java xslt
processor. I have explored Xalan-J, Saxon and hmm I don't remember the
third. The main problem with implementation of incremental one based on any
XSLT processor is their internal document model. I can work with DOM style
document models only. Xalan has clear architecture, but optimization are
everywhere, so there is DTM and special cases. Also Xalan supports so many
format, I will only DOM. I've made design of Darwin based on Xalan but
special case like two mentioned, breaks my design.

Xalan-C does not rely on recursion and the processor stack to execute stylesheets. Instead, it simply walks the stylesheet tree iteratively, figuring out what needs to be executed next. If it does need to save some small bit of context, it does that on a "stack" that's kept in dynamically allocated memory.

This has a number of advantages:

1. There's a much smaller chance that stylesheet execution will consume the entire processor stack. 2. Because there is only a small amount of context to be saved, and it's not saved all of the time, execution is faster and consumes less memory. For example, just the overhead of the C++ stack frame is often greater than than any local context that needs to be saved. 3. Execution can be interrupted at any time by simply breaking out of a loop, rather than unwinding a large number of stack frames. 4. It's trivial to restart execution at the point it was interrupted by just re-entering the loop starting with the last template executed.

I'm not sure what you mean by "incremental," because I don't see how it relates to the data model, unless you mean building the source tree incrementally, which is a very different thing from executing the transformation incrementally.

Dave

Reply via email to