on 05-23-2011 8:36 PM
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.
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>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.