如何删除与属性关联的 Soap 名称空间

How to remove Soap namespace associated with attribute

我必须删除与 ConfigR(属性)关联的 soap 名称 space。

在 XSLT 内部,我正在使用 XSL 复制,因此排除前缀不起作用。

下面我试过了,但是不行working.Please谁能推荐一下。

     <?xml version="1.0" encoding="UTF-8"?>
      <xsl:stylesheet version="1.0" 
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
    xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" >
     <xsl:output indent="yes"/>
     <xsl:template match="@* | node()">
    <xsl:copy>
    <xsl:apply-templates select="@* | node()"/>
      </xsl:copy>
     </xsl:template>
      <xsl:template match="soapenv:*">
   <xsl:apply-templates select="@* | node()"/>
       </xsl:template>
       </xsl:stylesheet>

输入 -

              <soapenv:Envelope 
           xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
         <soapenv:Body>
      <ConfigR>
        Inside I have some more input.
      </ConfigR>
        </soapenv:Body>
         </soapenv:Envelope>   




     Now in Output I am getting:
         <ConfigR xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> 

您可以替换现有模板:

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

以下内容:

<xsl:template match="*">
    <xsl:element name="{local-name(.)}">
        <xsl:apply-templates select="@* | node()" />
    </xsl:element>
</xsl:template>
<xsl:template match="@*">
    <xsl:attribute name="{local-name(.)}">
        <xsl:value-of select="." />
    </xsl:attribute>
</xsl:template>

你可以找到它here