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として削除する必要があります以下のようになります。
<bodydiv outputclass="LearningStandardItem"
id="CA9EE2E34F384E95A5FA26769C5864B8">
<p outputclass="RefURI">http://corestandards.org/Math/Content/K/CC/A/1/</p>
</bodydiv>
これに関する提案をしてください。前もって感謝します。
ありがとう@Martin。その実用的な罰金 – User501