cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping issue..

Former Member
0 Kudos

As per requirement ,I have done some changes to response mapping which is coming from 3rd party (SOAP) by using XSLT mapping.Now i need to add URL to root node of the Response mapping by using XSLT mapping .

for above requirement : i have tried below code but it's not success

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

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

    <!-- This XLST extracts the authorities' web service response into the expected proxy structure. -->

       <!--    <xsl:variable name="test" select="local-name(//*[local-name()='Body']/*[1])"/>  -->

  

        <xsl:template match="*">

<ns0:InResponse xmlns:ns0="http://sankar.com/xi/isankar/SD">

                        <xsl:element name="{local-name()}">

              

             <!--       <xsl:copy copy-namespaces="no">     -->

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

             <!--      </xsl:copy>  -->

                        </xsl:element>

               

              

</ns0:InResponse>

</xsl:template>

          

</xsl:stylesheet>

Could you pls share related links or give me some approaches to resolve the issue?

Thanks,

Sankar

Accepted Solutions (1)

Accepted Solutions (1)

former_member182412
Active Contributor
0 Kudos

Hi Sankar,

Please use below XSLT mapping to add the namespace to the root node.


<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:vbs="http://www.w3.org/1999/XSL/Transform">  

    <xsl:template match="node()|@*">

        <xsl:copy>

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

        </xsl:copy>

    </xsl:template>

    <xsl:template match="/*">

        <xsl:element name="ns:{local-name()}" namespace="http://sankar.com/xi/isankar/SD">

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

        </xsl:element>

    </xsl:template>

</xsl:stylesheet>

Regards,

Praveen.

Former Member
0 Kudos

Thank you Praveen for you help .
now i am getting new issue with definition which is coming from payload.

Could you please let me know how to remove definition from payload ?

thanks,

Sankar.S

Former Member
0 Kudos

Issue Solved..

JL23
Active Contributor
0 Kudos

"Issue solved"  is the correct answer? Really?

Unfortunately this does not even have any information how it was solved and will not help anybody who is coming to this discussion with the same issue hoping to find a solution.

Please update it with a real correct answer.

Answers (1)

Answers (1)

iaki_vila
Active Contributor
0 Kudos

Hi Bhavani,

If you want to add a namespace to root node, you can find some links about this:

XSLT : Add a namespace declaration to the root element - Stack Overflow

XSLT: Add namespace to root element - Stack Overflow

The trikc is simple, you map directly your root element with all the desired namespaces and the rest you can use a xsl:copy-of-select

Regards.