Hi all
I have an XML document that looks something like:
I want to display this as:
Home Office
33303
Mobile Users
33302
...etc.
I've got the following XSLT snippet - I'm just having difficulty putting the concept of "select the document that has a group id matches the group id of the current node" in XSLT.
Can anyone help out with this, please? I've commented the line I'm having difficulty with.
Thanks as always
Craftor

I have an XML document that looks something like:
Code:
<results>
<group>
<id>1</id>
<name>Home Office</name>
</group>
<group>
<id>2</id>
<name>Mobile Users</name>
</group>
<group>
<id>3</id>
<name>Contractors</name>
</group>
<doc>
<docid>33301</docid>
<filename>Doc1.doc</filename>
<groupid>3</groupid>
</doc>
<doc>
<docid>33302</docid>
<filename>Doc2.doc</filename>
<groupid>2</groupid>
</docid>
<doc>
<docid>33303</docid>
<filename>Doc3.doc</filename>
<groupid>1</groupid>
</docid>
</results>
I want to display this as:
Home Office
33303
Mobile Users
33302
...etc.
I've got the following XSLT snippet - I'm just having difficulty putting the concept of "select the document that has a group id matches the group id of the current node" in XSLT.
Code:
<xsl:template match="group">
<table>
<tr>
<td>
<xsl:value-of select="name"/>
</td>
</tr>
</table>
<table>
<tr bgcolor="#003399">
<td>#</td>
<td>Name</td>
</tr>
<xsl:apply-templates select="../doc[../doc/groupid=id]"/><!-- Problem here -->
</table>
</xsl:template>
Can anyone help out with this, please? I've commented the line I'm having difficulty with.
Thanks as always
Craftor