0
XML片断如何为这样的代码编写xsl模板?
<para><place>Cape Town</place> Some 150 penguins unaffected by the oil spill began their long swim from Port Elizabeth in the Eastern Cape back to their breeding habitat at Robben Island near Cape Town on Wednesday.</para>
XSLT
<xsl:template match="company">
<xsl:value-of select="text()"/>
</xsl:template>
<xsl:for-each select="para">
<xsl:value-of select="text()"/>
<xsl:if test="place">
<xsl:apply-templates select="place" />
</xsl:if>
</xsl:for-each>
您好我一直在写的.xsl文件.XML和我堆栈。当我运行此代码时,我只看到 place元素中的代码,其余文本被忽略。你能给我一些提示吗?
您可以添加所需的输出并放置更完整的XML吗?例如。公司标签丢失。 – Kokkie 2014-11-05 12:16:06
它应该是地方而不是公司。 XML代码位于顶部。从.xsl文件的代码下面。 – user3607625 2014-11-05 12:22:33