xsl-list
[Top] [All Lists]

Re: [xsl] XSLT2, select nodes inside a tokenize()'d variable

2006-12-20 07:06:30
James Cummings wrote:

  Hi

<xsl:for-each select="$ana">
  <xsl:value-of select="."/><xsl:text>:</xsl:text>
  <xsl:value-of select="//category[(_at_)id = .]/catDesc"/>
</xsl:for-each>

However, I'm rightly told that I cannot select a node here
because the context is an atomic value.

  You have to save the document node you want to use into a variable:

    <xsl:variable name="root" select="/"/>
    <xsl:for-each select="$ana">
      <xsl:value-of select="."/>
      <xsl:text>:</xsl:text>
      <xsl:value-of select="$root//category[(_at_)id = .]/catDesc"/>
    </xsl:for-each>

  BTW, such kind of XPath expression is in general good candidate for
XSLT keys.

  Regards,

--drkm





















        

        
                
___________________________________________________________________________ 
Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions ! 
Profitez des connaissances, des opinions et des expériences des internautes sur 
Yahoo! Questions/Réponses 
http://fr.answers.yahoo.com

--~------------------------------------------------------------------
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>
--~--