[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: A really easy (hopefully) question

Subject: Re: A really easy (hopefully) question
From: Jeni Tennison <mail@xxxxxxxxxxxxxxxx>
Date: Fri, 9 Feb 2001 09:11:11 +0000
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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.