[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: XSLT 4: map serialization
> As for this particular example, I suspect that building an XML document incrementally from a sequence of single elements will have performance implications -- similar to concatenating to a string many times. > It's true that bottom-up construction of a tree can be very expensive because of the need for copy operations. However, the copying can be avoided with careful optimization. For example with inline construction like element('A', (element('B', ()), element('C', ())) you can avoid copying B and C when attaching them to A either by recognising this pattern statically, or by some kind of run-time laziness. On the Java side I've produced an API called the "sapling" model where the functions such as element() here don't construct a full XPath-navigable tree, but just a skeletal tree, whose construction is completed lazily the first time it is used for XPath navigation; this avoids the repeated copying of intermediate subtrees during construction. (I believe Javascript processor use a similar approach to avoid string copying for repetitive string concatenation). Michael Kay Saxonica
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|