[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: how to estimate speed of a transformation
> On the other hand, if a template contains a variable > definition that does depend on template's parameters, > > <xsl:template name="footer"> > <xsl:variable name="doctitle" select="/book/descendant::title[1]"/> > > the programmer should expect that the computation takes place > only once. I suspect you meant to say "that *doesn't* depend on template's parameters". But this variable *does* depend on the parameters, in the sense that it depends on the context node (leading "/" selects the root of the tree containing the context node) and the context node is an implicit parameter to every template. This is, however, a case where some simple caching might be appropriate. I said in a previous response that Saxon doesn't do any caching. I just realized another case where it does cache: for xsl:number. Saxon remembers the last result of <xsl:number> and under the right conditions, evaluates it by adding one to the previous result. This makes the performance of numbering a sequence of n nodes O(n) rather than O(n^2). But I would have to look in the source code to tell you exactly what the preconditions for this optimization are. Michael Kay XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
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
|