0
实际上,我需要将xml文件转换为DITA,并将某些实例的属性删除。即使我用 “排除对结果的前缀=” #所有 “” 在一个XSL,需要删除特定实例的属性
我输入XML文件是:
<LearningStandardItem xml:lang="en" RefID="CA9EE2E34F384E95A5FA26769C5864B8">
<RefURI>http://corestandards.org/Math/Content/K/CC/A/1/</RefURI>
</LearningStandardItem>
XSL我用其中:
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" exclude-result-prefixes="#all" >
<xsl:template match="node()|@*">
<xsl:copy>
<xsl:apply-templates select="node()|@*"/>
</xsl:copy>
</xsl:template>
<xsl:template match="LearningStandardItem">
<bodydiv outputclass="LearningStandardItem">
<xsl:apply-templates select="@*|node()"/>
</bodydiv>
</xsl:template>
</xsl:stylesheet>
我得到的输出为:
<bodydiv outputclass="LearningStandardItem"
**xml:lang="en"**
id="CA9EE2E34F384E95A5FA26769C5864B8">
<p outputclass="RefURI">http://corestandards.org/Math/Content/K/CC/A/1/</p>
</bodydiv>
但是我需要在输出中删除xml:lang =“en”作为li ke如下:
<bodydiv outputclass="LearningStandardItem"
id="CA9EE2E34F384E95A5FA26769C5864B8">
<p outputclass="RefURI">http://corestandards.org/Math/Content/K/CC/A/1/</p>
</bodydiv>
请提供相关建议。先谢谢你。
Thanks @Martin。它的工作正常 – User501