Skip to Content
Former Member
Nov 18, 2011 at 10:41 AM

delete root node and content of node via XSLT


Is it possible to delete a root node and contents, but leave the remaining xml via xslt??

i receive this:

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> 
 XML Validation Inbound Channel Response 
 <ser-root:createContractResponse xmlns:ser-root="http://host/ws/createContract" xmlns:SOAP-ENC="" xmlns:SOAP-ENV="" xmlns:xsd="" xmlns:xsi="">
<ns:BBP_ES_OA_UPDATE.Response xmlns:ns="urn:sap-com:document:sap:rfc:functions">
  <ES_MA_NAME>Test 1611-a</ES_MA_NAME> 


but want to delete the ser-root:createContractResponse and namespaces within and leave the ns:BBP_ES_OA_UPDATE...

i had come up with this.,,,

<xsl:stylesheet version="1.0" xmlns:xsl="">

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

    <xsl:template match="results">
            <xsl:apply-templates select="ser-root:createContractResponse /*"/>


but this does not work for me! any ideas?