[xsl] RE : [xsl] "not a node item" inside distinct-values

Subject: [xsl] RE : [xsl] "not a node item" inside distinct-values
From: Florent Georges <darkman_spam@xxxxxxxx>
Date: Thu, 8 Jun 2006 16:10:20 +0200 (CEST)
Rick Roen wrote:

> <xsl:for-each select="distinct-values(//item/@racknum)">
> 	<xsl:variable name="rack-num" select="."/>
> 	<xsl:variable name="pocket-num" select="//item[./@racknum =

> [...]

> I get an error "Error in XPath 2.0 expression Not a node item"

  Within the xsl:for-each, the current item is not a node, but you try
to access its root node (by "//item").  You can use a variable:

    <xsl:variable name="items" select="//item"/>
    <xsl:for-each ...>
      <xsl:variable name="pocket-num" select="$item[...]"/>
      ...

or:

    <xsl:variable name="root" select="/" as="document-node()"/>
    <xsl:for-each ...>
      <xsl:variable name="pocket-num" select="$root//item[...]"/>
      ...

  Regards,

--drkm

































__________________________________________________
Do You Yahoo!?
En finir avec le spam? Yahoo! Mail vous offre la meilleure protection possible contre les messages non sollicitis 
http://mail.yahoo.fr Yahoo! Mail 

Current Thread