[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Variables
> <xsl:variable name="n">2</xsl:variable> > ... > <xsl:value-of select="item[$n]"/> > (See chapter 11.2) > > What is the reason for outputing the value of only the first item element ? <xsl:value-of select="?"/> always returns the first value when the select returns a node-set so this behavior is not exceptional. Nor is it difficult to understand that the particular form of <xsl:variable ...> returns a result tree fragment. But what I find difficult myself is why the result tree fragment can be placed in the predicate since chapter 11.1 specifically prohibits this: "In particular, it is not permitted to use the /, // and [] operators on result tree fragments" My guess is that the predicate [$n] is being converted to a boolean value of true and the predicate therefore selects all items. The <xsl:value-of> is merely returning the first item in the node set. Thats my theory. Regards, Dan __________________________________________________ Do You Yahoo!? Yahoo! Auctions - buy the things you want at great prices http://auctions.yahoo.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
|