难题,请大家帮忙!
xml 文档结构为:
<root>
<subs>
<sub>
<item>
<Doc>
<DocFs>
<f Name= "a "> 1 </f>
<f Name= "b "> 2 </f>
</DocFs>
<DocFs>
<f Name= "c "> 1 </f>
</DocFs>
</Doc>
<Doc>
<DocFs>
<f Name= "a "> 2 </f>
<f Name= "b "> 3 </f>
</DocFs>
<DocFs>
<f Name= "c "> 2 </f>
</DocFs>
</Doc>
</item>
<sub>
</subs>
</root>
我怎么写一个 xsl 对 <f Name= "a "> 进行排序 ? 请大家帮忙
[解决办法]
<xsl:sort select= "@given "/>
[解决办法]
<table border= "1 " cellpadding= "0 " cellspacing= "0 ">
<tbody>
<xsl:for-each select= "//f[@Name= 'a '] ">
<xsl:sort select= ". " order= "ascending " data-type= "number "/>
<tr>
<td> <xsl:value-of select= ". "/> </td>
</tr>
</xsl:for-each>
</tbody>
</table>