cancel
Showing results for 
Search instead for 
Did you mean: 

XSL namespace

Former Member
0 Kudos

Hi,

I want to add xmlns:xsi="http://www.sap.com" to a root element in XSL mapping.we can add the namepsacee directly in the element tag but i want to pass the xmlns:xsi and the URL in the xsl code

for exmaple

<root xmlns:xsi="http://www.sap.com">

<seg1>

<seg2>

</seg3>

</root>

Thanks in advance for you help.

Regards

Sarkar.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Try it.......

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"><xsl:output method="xml" version="1.0" encoding="UTF-8" />

<xsl:template match="*">

<xsl:element name="{local-name()}" namespace="http://www.sap.com">

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

</xsl:element>

</xsl:template>

</xsl:stylesheet>

Former Member
0 Kudos

Hi santosh ,

thanks for your reply. your code is adding me only the namespace. I am looking the output as below.

<root xsi:schemaLocation="http://www.sap.com" xmlns:xsi="http://www.w3.org" xmlns="http://www.sdn.sap.com" att="1.1">

<seg1> </seg1>

....

<segn> </segn>

</root>

with the namespace parameter I can get this xmlns="http://www.sdn.sap.com", along with that I also want to add other two names as shown above and most importantly the segment data should be populate as is.

please let me know if you have any pointers.

Regards

Sarkar

Former Member
0 Kudos

Hi Sarkar,

Using the xsl code, you need to do some additional coding in XMLspy or some XSLT editor.

Paste your output xml below the standard code & fetch the values of inout xml into output xml.

-santosh.

Former Member
0 Kudos

Hi Sarkar,

Please check this:

I hope this will help you.

Thanks & Regards

Praveen K