on 05-27-2016 2:29 PM
Hi,
I need help with XSLT mapping for the below requirement:
Current:
<?xml version="1.0" encoding="UTF-8"?>
<StudyDetails>
<Name>
<Age>
</StudyDetails>
Required :
<?xml version="1.0" encoding="UTF-8"?>
<ns0:StudyDetails xmlns:ns0="urn:sap:com">
<Name>
<Age>
<ns0:StudyDetails>
I want the namespace to be added in the existing node.
I don't want an extra node to be added.
Please help me with this requirement.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Anuradha!
<xsl:template match="/StudyDetails">
<xsl:element name="ns0:{local-name(.)}" namespace="urn:sap:com">
<xsl:copy-of select="*"/>
</xsl:element>
</xsl:template>
Regards, Evgeniy.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Anuradha,
You can use below xslt code for adding namespace .
-------------------------------------------------------------------------
<?xml version='1.0' encoding='utf-8'?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" encoding="UTF-8"/>
<xsl:template match="/">
<ns0:StudyDetails xmlns:ns0="urn:sap:com">
<xsl:copy-of select="." />
</ns0:StudyDetails>
</xsl:template>
</xsl:stylesheet>
----------------------------------------------------------------------------
Kind Regards,
Sarojkanta Parida
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.