[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Difference between current(), node() and self ??
> Until now, I thought that > <xsl:value-of select="self"/>, <xsl:value-of > select="node()"/> and <xsl:value-of select="current()"/> > would print out the same values, but found out that this is not true. They are completely different. select="current()" (or select=".", or select="self::node()") selects the context node. select="node()" selects the children of the context node. select="self" selects a child element called self. > > It seems that current() prints out all the values including > its child... current() doesn't "print out" anything. It selects a node. If anything is printed, that's done by whoever it is that selects the node. For example, <xsl:value-of select="current()"/> creates a text node whose content is the string value of the current node (if it's an element, this will be the concatenation of all its descendant text nodes); and if you choose to print out this text node on paper, that's what you will see. Michael Kay http://www.saxonica.com/
|
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
|