xsl-list
[Top] [All Lists]

Re: Using absolute path when context item is an atomic value xslt 2.0

2005-10-18 09:05:45
On 10/18/05, Michael Kay <mike(_at_)saxonica(_dot_)com> wrote:
Because "absolute paths" are not absolute at all: they select relative to
the root of the tree containing the context node. You've got to know which
document to look in.

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"/>

This seems cumbersome, so I'm probably not using "1 to 10" in the correct way.

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... (I haven't got around to learning about
processing atomic values just yet so maybe it will become clear later
:)

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--