0
有輸入XML的格式如下:XSLT的命名空間元素
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header/>
<s:Body xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ResponseData xmlns="http://testify.com/maxi">
<VALID>true</VALID>
<ERROR_DESC xsi:nil="true"> something gone wrong </ERROR_DESC>
</ResponseData>
</s:Body>
</s:Envelope>
它越來越難以將其轉換成如下由於其複雜的格式,由於命名空間。
我試過了幾個沒有成功的選項。在下面導致沒有數據。
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<xsl:output method="xml" encoding="utf-8" indent="no"/>
<xsl:template match="/">
<xsl:value-of select="s:Envelope//s:Body/s:ResponseData"/>
</xsl:template>
<xsl:template match="s:ResponseData">
<xsl:element name="width">
<xsl:value-of select="s:VALID"/>
</xsl:element>
</xsl:template>
</xsl:stylesheet>
如果你想''作爲包裝,那麼你爲什麼要求''?! –