1
我试图从XML中的两个节点集合创建一个HTML表格,然后通过@AD
对它进行排序。创建后在xsl中对表格进行排序
我可以使用<xsl:sort select="@AD" order="ascending" />
在单个for循环中进行排序,但是我想对整个表进行排序。
<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>
你能展示一个你的XML的样本,以及你期望的(排序的)输出吗?谢谢! –
感谢您检查Tim,但Tomalak向我提供了我一直在寻找的信息。 – Snath