Skip to content

Instantly share code, notes, and snippets.

@gmic
Created December 22, 2011 14:55
Show Gist options
  • Save gmic/1510575 to your computer and use it in GitHub Desktop.
Save gmic/1510575 to your computer and use it in GitHub Desktop.
XSLT Transform Soapresponse body and strip off namespacing
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" >
<xsl:template match="/">
<xsl:apply-templates select="/env:Envelope/env:Body/*"/>
</xsl:template>
<xsl:template match="@*">
<xsl:attribute name="{local-name()}"><xsl:value-of select="."/></xsl:attribute>
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="*">
<xsl:element name="{local-name()}">
<xsl:apply-templates select="@* | node()"/>
</xsl:element>
</xsl:template>
</xsl:stylesheet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment