random.xsl
.
其输出符合浏览器中的要求。
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" version="4.0" encoding="UTF-8" indent="yes"/>
<xsl:template match="/RootName/RandomRootNode/RandomNode">
<table border="1">
<th width="50">ID</th><th>name</th><th>total</th>
<xsl:for-each select="Identity">
<xsl:variable name="curID" select="@sid" />
<tr>
<td align="center"><xsl:value-of select="$curID" /></td>
<td align="center"><xsl:value-of select="text()" /></td>
<td align="center"><xsl:value-of select="sum(/RootName/SeriesRootNode/Series/Ran[@dustId=$curID]/text())" /></td>
</tr>
</xsl:for-each>
</table>
</xsl:template>
<xsl:template match="text()" />
</xsl:stylesheet>