【发布时间】:2017-03-23 09:27:48
【问题描述】:
我们想使用一个 xslt 中介器来转换一个 xml。 我们有这个肥皂信息。
<?xml version = "1.0" encoding="ISO-8859-1"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://ws.es">
<soapenv:Header/>
<soapenv:Body>
<ws:reception>
<ws:xml>
<message>Data messsage to send</message>
</ws:xml>
</ws:reception>
</soapenv:Body>
</soapenv:Envelope>
我们想要这条消息作为结果。
<?xml version = "1.0" encoding="ISO-8859-1"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://ws.es">
<soapenv:Header/>
<soapenv:Body>
<ws:reception>
<ws:xml>
<![CDATA[<message>Data messsage to send]]></message>
</ws:xml>
</ws:reception>
</soapenv:Body>
</soapenv:Envelope>
我们正在使用这个 xslt 模板
<?xml version = "1.0" encoding = "ISO-8859-1"?>
<xsl:stylesheet version = "1.0" xmlns:xsl = "http://www.w3.org/1999/XSL/Transform">
<xsl:template match = "//ws:xml">
<xsl:copy>
<xsl:text disable-output-escaping="yes"> <![CDATA[</xsl:text>
<xsl:copy-of select="*"/>
<xsl:text disable-output-escaping="yes"> ]]></xsl:text>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
但它不起作用。
谁能帮助我们??
提前致谢。
【问题讨论】: