Skip to Content

XSLT mapping to remove namespace prefix

Hi experts,

I have one requrement where I need to remove the prefix ns0 from the xml (given below) getting generated in message mapping.

<?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:xsd="" xmlns:xsi="" xmlns:soap=""><soap:Body><ns0:ExecuteRequest xmlns:ns0="http://test/">


I am usimg the below xslt and it is now adding one ns0 prefix in the tag <inteflow>.

<?xml version="1.0" encoding="UTF-8"?>

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

<xsl:template match="/">

<ExecuteRequest xmlns="http://test/">



<xsl:copy-of select="//inteflow"/>






Result after using xslt.

<?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:xsd="" xmlns:xsi="" xmlns:soap=""><soap:Body><ExecuteRequest xmlns="http://test/"><_sRequestXML>

<inteflow xmlns:ns0=""></inteflow></_sRequestXML></ExecuteRequest></soap:Body></soap:Envelope>

Can you please help. What is wrong in the xslt and how I can get the desired result.

Thanks & Regards,

Pratyus Ganguly


Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Apr 22, 2015 at 07:47 AM

    Hi Pratyus

    If you just want to remove prefix ns0 and the corresponding namespace, you can try using XMLAnonymizerBean

    Handling namespaces in PI using XMLAnonymizerBean - Important factors


    Eng Swee

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Apr 22, 2015 at 05:40 PM

    I agree with Eng, XMLAnonymizer is best approach but if you want to try XSL here is an example:

    Add comment
    10|10000 characters needed characters exceeded