Skip to Content

XSLT To Remove Soap Envelope...


I'm trying to use XSLT mapping to remove SOAP envelope from a soap response message. Facing some issues.

This is my response message(with soap envelope):

<?xml version="1.0" encoding="UTF-8"?>" xmlns:xsd="" xmlns:soapenv="">



false> aaaaaaaaaaaaaaa







This is my xsl program:

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>" xmlns:soapenv="">

<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>

<xsl:template match="soapenv:Body">

<xsl:copy-of select="soapenv:Body"/>




Where am I going wrong here?



Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Aug 25, 2006 at 04:02 PM

    This is wrong:

    <xsl:template match="soapenv:Body">

    <xsl:copy-of select="soapenv:Body"/>

    When you have template match="node", you can only work with sub nodes. So your XSLT searches for sub nodes of <i>Body</i> with the name <i>Body</i>.

    You could use select=".", but you want to remove the SOAP envelope, so you have to remove the tag Body as well:

    <xsl:template match="soapenv:Body">

    <xsl:copy-of select="child::node()"/>



    Add comment
    10|10000 characters needed characters exceeded

    • Hi Harsh,

      standard is the Altovas XMLSpy, you can use a freeware home version. You can test as well with IE (yes, Microsofts Internet Explorer). Just put

      <?xml-stylesheet type="text/xsl"  href="C:myFoldermyStyle.xsl"?>

      to the top (behind the declaration) of your XML document.