Hi
I am trying to filter a for-each loop with the filter being the category from the outer for-each loop. See code below:
This code doesn't work - can anybody help?
In case I haven't explained myself very well, the xml file looks like:
I am trying to filter a for-each loop with the filter being the category from the outer for-each loop. See code below:
Code:
<xsl:for-each select="/page/doccats">
<b><xsl:value-of select="." /></b><br />
<xsl:for-each select="/page/document[category=/page/doccats]">
<i><xsl:value-of select="title" /></i><br />
</xsl:for-each>
</xsl:for-each>
This code doesn't work - can anybody help?
In case I haven't explained myself very well, the xml file looks like:
Code:
<page>
<doccats>Test</doccats>
<doccats>Welcome</doccats>
<document>
<docid>2</docid>
<date>11/06/02</date>
<title>Beck Test</title>
<category>Test</category>
<internal/>
</document>
<document>
<docid>3</docid>
<date>12/06/02</date>
<title>Rhubarb</title>
<category>Test</category>
<internal/>
</document>
<document>
<docid>4</docid>
<date>12/06/02</date>
<title>Welcome to the site</title>
<category>Welcome</category>
<internal/>
</document>
</page>