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

RE: Using absolute path when context item is an atomic

Subject: RE: Using absolute path when context item is an atomic value xslt 2.0
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Tue, 18 Oct 2005 17:11:43 +0100
RE:  Using absolute path when context item is an atomic
> Ok.... but when you do:
> 
> <xsl:for-each select="1 to 10">
> 
> The "context node" is an atomic value - how do you anything useful
> here?  Do you need to do:
> 
> <xsl:variable name="currentElem" select="."/>
> <xsl:for-each select="1 to 10">
>    <xsl:value-of select="$currentElem/whatever"/>
> 

Yes, I'm afraid so.

> 
> Actually, I can't see why '/' would ever select anything when the
> context item is an atomic value, so why doesn't it keep it's pointer
> to the original root... 

We looked very early on at a design where there was a "context document" as
well as a "context node", and the context document changed when the context
item was set to a node but not when it was changed to an atomic value; we
decided it was so complicated to explain that it was better to take the
simple approach, at the cost of making users do what you illustrate above.

Michael Kay
http://www.saxonica.com/

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.