我的XML如何创建属性?
<article>
<section>
<title id="chapter-introduction">Introduction</title>
<para>Some text</para>
</section>
<section>
<title>Problem description</title>
<para>Some text</para>
<para>Please click <link linkend="chapter-introduction">here</link> to
go to the Introduction chapter.</para>
</section>
</article>
我XSL
<xsl:template match="section/title">
<H2>
<xsl:attribute name="id">
<xsl:value-of select="@id" />
</xsl:attribute>
<xsl:value-of select="."/>
</H2>
</xsl:template>
<xsl:template match="link">
<u>
<a style="color:green" href="#{@linkend}">
<xsl:value-of select="."/>
</a>
</u>
</xsl:template>
我想创建输出HTML文档中的内部链接。我的模板是在每个“section/title”属性id中创建的,但我不想获得值为“null”的id属性。 在输出我想要得到<H2 id="chapter-introduction">Introduction</H2>
... <H2>Problem description</H2>