xsl-list
[Top] [All Lists]

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

2006-06-08 07:10:42
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 sollicités 
http://mail.yahoo.fr Yahoo! Mail 

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