嗨,我正在通过将 xsl 应用于 xml 输入来生成 xml。我需要没有这部分的输出"<?xml version="1.0" encoding="utf-16"?>"
输入--xml
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<CreateResponse xmlns="http://jerseytelecom.com/">
<CreateResult>
<ISD_XMLGateway>
<Entity>RIM_BPS</Entity>
</ISD_XMLGateway>
</CreateResult>
</CreateResponse>
</soap:Body>
</soap:Envelope>
我的 xsl
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:JT="http://jerseytelecom.com/" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" exclude-result-prefixes="JT">
<xsl:output method="xml" indent="yes"/>
<xsl:template match="/">
<xsl:element name="Entity">
<xsl:value-of select="soap:Envelope/soap:Body/JT:CreateResponse/JT:CreateResult/JT:ISD_XMLGateway/JT:Entity"/>
</xsl:element>
</xsl:template>
</xsl:stylesheet>
电流输出
<?xml version="1.0" encoding="utf-16"?>
<Entity>RIM_BPS</Entity>
预期产出
<Entity>RIM_BPS</Entity>