I am trying to create a HTML table from two node sets in my XML and then sort it by @AD
.
I can sort within individual for-each loops using <xsl:sort select="@AD" order="ascending" />
, but I want to sort the whole table.
<xsl:template match="*/Sync/AP">
<table border="1">
<tr>
<th>AD</th>
<th>GCD</th>
<th>ClearAttribute</th>
</tr>
<xsl:for-each select="./*">
<tr>
<td><xsl:value-of select="@AD"/></td>
<td><xsl:value-of select="@GCD"/></td>
<td><xsl:value-of select="@ClearAttribute"/></td>
</tr>
</xsl:for-each>
<!-- Also Append the Common attributes to each region -->
<xsl:for-each select="../Common/*">
<tr>
<td><xsl:value-of select="@AD"/></td>
<td><xsl:value-of select="@GCD"/></td>
<td><xsl:value-of select="@ClearAttribute"/></td>
</tr>
</xsl:for-each>
</table>
</xsl:template>