を接頭辞の名前空間を削除します。XSLT - これは、SOAPヘッダとボディとの私のXMLである特定のノードのXMLに
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<RequestResponse xmlns="http://tempuri.org/">
<a:RequestResult xmlns:a="http://schemas.datacontract.org/2004/07/MockupTesting"
xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<a:Message>Message text testing.</a:Message>
<a:Response>false</a:Response>
</a:RequestResult>
</RequestResponse>
</s:Body>
</s:Envelope>
私はRequestResult
ノードからのみプレフィックスを削除する必要があります。この
<a:RequestResult xmlns:a="http://schemas.datacontract.org/2004/07/MockupTesting"
xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
乃至 :
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output omit-xml-declaration="yes" indent="yes" />
<xsl:template match="node()|@*">
<xsl:copy>
<xsl:apply-templates select="node()|@*" />
</xsl:copy>
</xsl:template>
<xsl:template match="/">
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<xsl:apply-templates />
</s:Body>
</s:Envelope>
</xsl:template>
<xsl:template match="RequestResult |RequestResult//*">
<xsl:element name="a:{name()}"
namespace="http://schemas.datacontract.org/2004/07/Testing">
<xsl:namespace name="a"
select="'http://schemas.datacontract.org/2004/07/MockupTesting'" />
<xsl:namespace name="i"
select="'http://www.w3.org/2001/XMLSchema-instance'" />
<!-- <xsl:copy-of select="namespace::*" /> -->
<xsl:apply-templates select="node()|@*" />
</xsl:element>
</xsl:template>
</xsl:stylesheet>
私は何を追加するか、ということを削除する修正する必要があります。
<RequestResult xmlns:a="http://schemas.datacontract.org/2004/07/MockupTesting"
xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
これは私がバージョン2で使用XSLT
設定ファイルですそのノードの接頭辞?
をあなたは名前空間接頭辞を「削除」することはできません大部分のケースでは、そのようなことをする必要はありません。あなたのケースでそれが必要だと思う理由を説明できますか? – Tomalak
私が消費するWSDLは@Tomalakを必要とするので – gtx911
申し訳ありませんが、それは満足のいく説明ではありません。私は「なぜあなたはそれが必要なのですか?」と尋ねました。あなたは「私はそれが必要だから」と答えました。私はあなたがそれよりも良い理由を与える必要があると思う。 – Tomalak