Re: [xslt] XPath weirdness

 >Removing the parentheses around the second version doesn't solve the
 >problem, though :( Adding parens in the first version doesn't solve
 >anything either.

Oke, it seems that changing '(parent::*)' in the XSLT examples to
'parent::*' solves the problem.

This code now produces both XXX and YYY, what I needed:

<xsl:variable name="catid" select="'1'"/>

<xsl:template match="categorynode[@catid = $catid]">
  <xsl:if test="generate-id((parent::*//categorynode[@catid = $catid])[1]) = generate-id(.)">
    XXX: <xsl:value-of select="categorytext"/>
  <xsl:variable name="test" select="parent::*//categorynode[@catid = $catid]"/>
  <xsl:if test="generate-id($test[1]) = generate-id(.)">
    YYY: <xsl:value-of select="categorytext"/>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]