1
我的XSL文件深度更改标题级别:如何通过XSLT基于XML格式
...
<div>
<xsl:choose>
<xsl:when test="count(ancestor::node()) = 1">
<h2>
</xsl:when>
<xsl:when test="count(ancestor::node()) = 2">
<h3>
</xsl:when>
</xsl:choose>
<xsl:attribute name="id">
<xsl:value-of select="@id" />
</xsl:attribute>
<xsl:copy-of select="title/node()"/>
<xsl:choose>
<xsl:when test="count(ancestor::node()) = 1">
</h2>
</xsl:when>
<xsl:when test="count(ancestor::node()) = 2">
</h3>
</xsl:when>
</xsl:choose>
</div>
我知道这是不允许拆标签H2 ....../H2,H3 .../H3喜欢这个。
但是如何正确地做到这一点?
谢谢!我做了像thsi我不知道xsl:element命令:-) –
podeig
2011-05-11 10:43:41