[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: A really easy (hopefully) question
Evan Lenz wrote: > Technically, you don't even need the current() function in XSLT, > because you can always declare a variable bound to the current node > and then reference it in the XPath expression. Not *quite* always. There are a few situations where it's impossible to define the current node in a variable before using it. Ones I can think of immediately are: (a) within the use attribute's expression on xsl:key - the current node is counted as the node matched by the match pattern. (b) within the select attribute's expression on xsl:sort - the current node is the node that's being sorted (selected by the surrounding xsl:for-each or xsl:apply-templates). (c) within the name attribute's AVT on xsl:attribute within an xsl:attribute-set - the current node is the current node at the point when the attribute set is used (with xsl:use-attribute-sets). You cannot define variables to store the current node in any of these situations. I can't quite come up with examples when you need to use these, but I am sure that there are some :) Cheers, Jeni --- Jeni Tennison http://www.jenitennison.com/ 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
|