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

RE: "fetching" elements by name with a tokenized list

Subject: RE: "fetching" elements by name with a tokenized list of names
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Fri, 16 Feb 2007 09:54:36 -0000
RE:  "fetching" elements by name with a tokenized list
The context changes inside a predicate, so "." inside [] is not normally the
same thing as "." outside the []. "*[name()=.]" selects elements whose name
is the same as their string-value.

Michael Kay

> -----Original Message-----
> From: Georges Schmitz [mailto:georges.schmitz@xxxxxxxxx] 
> Sent: 16 February 2007 09:47
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  "fetching" elements by name with a tokenized 
> list of names
> I don't have a clue why this one works:
>   <xsl:for-each select="tokenize($extract.element,';')">
>     <xsl:variable name="name" select="."/>
>     <xsl:copy-of select="$annex/*[name()=$name]"/>
>   </xsl:for-each>
> and this one not:
>   <xsl:for-each select="tokenize($extract.element,';')">
>     <xsl:copy-of select="$annex/*[name()=.]"/>
>   </xsl:for-each>
> tokenize() delivers a sequence of string tokens, so what 
> makes the difference between referring to a string token in 
> <xsl:for-each> by "."
> directly (the latter) or by using an intermediary variable 
> (the first case)?
> Thanks for clearing this to me,
> Georges

Current Thread


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.
First Name
Last Name
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.