0

xml データにノードを追加し、CDATA 形式を変更できないようにしたい xml ファイルを持っています。このファイルには、shablon xml にコピーする必要がある xml コンテンツが記述されています。ここに、shablon.xml に追加する必要がある xml contetn があります。

<?xml version="1.0" encoding="UTF-8"?><Data>
<RawData Format="Text">
<organizationNameEng>fgfgfg</organizationNameEng>
<organizationNameGeo>dfdfdf</organizationNameGeo>
<organizationIdentifier>123456789</organizationIdentifier>
<cardNumber>dfdfdf</cardNumber></RawData>
<response>
<id>0123</id>
<content>her  is  content</content>
</response>
</Data>

here  is  my  shablon xml 
<?xml version="1.0" encoding="UTF-8"?><DataPrep xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Lcid="String">
<Job Name="CompleteJob" Type="Normal" Priority="1">
<JobDetails>![CDATA[ here is  job  details ]]</JobDetails>
<DetailData>
<Information>
<RawData Format="Text"><</RawData>
</Data>
<response>
...
</response>
</Information>
</DetailData>
</Job>

ここに私のxlstがあります

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="xml" version="1.0"
encoding="UTF-8" indent="yes" cdata-section-elements="RawData"/>
    <xsl:strip-space elements="*"/>

    <xsl:template match="node()|@*">
        <xsl:copy>
            <xsl:apply-templates select="node()|@*"/>
        </xsl:copy>
    </xsl:template>

    <xsl:template match="Detaildata/information">
        <xsl:copy>
            <xsl:copy-of select="document('content.xml')"/>
    </xsl:template>
        </xsl:copy>

</xsl:stylesheet>

次のような応答が返されます。

<?xml version="1.0" encoding="UTF-8"?><DataPrep xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Lcid="String">
<Job Name="CompleteJob" Type="Normal" Priority="1">
<JobDetails>&lt here is  job  details &gt</JobDetails>
<DetailData>
<Information>
<RawData Format="Text"><![CDATA[
<organizationName>fgfgfg</organizationNameEn>
<organizationIdentifier>123456789</organizationIdentifier>
<cardNumber>dfdfdf</cardNumber>
]]></RawData>
</Data>
</Information>
</DetailData>
</Job>
</DataPrep>

タグを..]]内に貼り付けることができるxsltファイルを変更するにはどうすればよいですか?また、xsltの応答タグが ここで<CDATA> フォーマットを 変更しない状況を回避するにはどうすればよいですか?&gt &lt

<JobDetails>&lt here is  job  details &gt</JobDetails>
4

0 に答える 0