私が尋ねた以前の質問から分岐して、どうすればexample/one/field
とexample/three/field
が CDATA に囲まれていることを確認example/two/field
できますか?
入力:
<?xml version="1.0"?>
<example>
<one>
<field>CDATA required here</field>
</one>
<two>
<field>No CDATA thanks</field>
</two>
<three>
<field>More CDATA please</field>
</three>
</example>
必要な出力:
<?xml version="1.0"?>
<example>
<one>
<field><![CDATA[CDATA required here]]></field>
</one>
<two>
<field>No CDATA thanks</field>
</two>
<three>
<field><![CDATA[More CDATA please]]></field>
</three>
</example>
指定できます<xsl:output cdata-section-elements="field"/>
が、これも影響example/two/field
します。のようなパスを入力しようとしました<xsl:output cdata-section-elements="example/one/field example/three/field"/>
が、これによりエラーが発生します (エラー XTSE0280: 無効な要素名。無効な QName {example/one/field} )。どこが間違っていますか?