This is a grouping problem, and can be solved using the Muenchian
technique -
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="html" indent="yes" />
<xsl:key name="by-docSet" match="docSet" use="." />
<xsl:template match="/message">
<html>
<head>
<title/>
</head>
<body>
<table>
<xsl:for-each select="docList/docSet[generate-id(.) =
generate-id(key('by-docSet', .)[1])]">
<tr>
<td>
DocSet
</td>
<td>
<xsl:value-of select="." />
</td>
</tr>
<xsl:for-each select="key('by-docSet', .)">
<tr>
<td>
Doc Tp =
</td>
<td>
<xsl:value-of select="following-sibling::docTp[1]" />
</td>
</tr>
</xsl:for-each>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
Regards,
Mukul
"timothy ma and constance lee" <ti******@shaw.ca> wrote in message news:<qb39d.11924$a41.9354@pd7tw2no>...
Sirs/Madam
I am new to xslt but got a trouble
I get the xml messgae like
<message>
<docList>
<docSet>1</docSet>
<docTp>A1/docTp>
<docSet>1</docSet>
<docTp>B1</docTp>
<docSet>2</docSet>
<docTp>A2</docTp>
<docSet>1</docSet>
<docTp>C1</docTp>
<docSet>2</docSet>
<docTp>B2</docTp>
I need to have xslt to make html like
DocSet 1
Doc Tp = A1
Doct Tp = B1
Doc Tp = C1
DocSet2
DocTp = A2
.....
Please suggest
</docList>