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

Re: Variables

Subject: Re: Variables
From: Dan Diebolt <dandiebolt@xxxxxxxxx>
Date: Thu, 17 May 2001 07:26:32 -0700 (PDT)
are variables difficult to understand
> <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


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.