on 07-29-2013 6:09 AM
Hi all,
We are facing one issue in xslt mapping.
We have a requirement where client wants us to use only XSLT mapping, no Graphical/Java mapping.
Now, the issue is we have Proxy(ABAP) to Proxy scenario, where we need to change/replace the namespace coming from source(ECC).
one namespace coming from ECC side, which we need to replace it by another SAP system namespace.
for ex:
urn:mr:pi:interfaces:ecc:ID461:OrderIntegration
it should get replaced by below
urn:mr:pi:interfaces:tm:ID461:OrderIntegration
However messages in PI are getting failed as ECC namespace is not getting replaced by tm namespace.
Please let me know how to handle it in XSLT only. 🙂
appreciate early response for this.
Thanks,
Aman
Aman,
Try the link below.
http://wiki.sdn.sap.com/wiki/display/XI/Changing+Namespaces+and+the+encoding+format+of+XML
There are multiple links on SCN for this.
Ambrish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
if you only want to swap the namespace with an XSLT try this:
http://wiki.sdn.sap.com/wiki/display/XI/Changing+Namespaces+and+the+encoding+format+of+XML
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Barry,
Thanks for the link, I already tried this option but my requirement is to keep the Main Namespaces as is and to replace particular Namespaces(which are at field level)
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="node()|@*">
<xsl:copy>
<xsl:apply-templates select="@*|*|text()" />
</xsl:copy>
</xsl:template>
<xsl:template match="//*[namespace-uri()='urn:mr:pi:interfaces:ecc:ID461:OrderIntegration']">
<xsl:element name="{local-name()}" namespace="urn:mr:pi:interfaces:tm:ID461:OrderIntegration" >
<xsl:apply-templates select="@*|node()" />
</xsl:element>
</xsl:template>
</xsl:stylesheet>
I tried this code, I am able to replace the field level Namespaces but the problem is main Namespaces are not coming in the output.
please help on this.
TIA.
Thanks,
Aman
Hi Barry,
my Input structure is
<?xml version="1.0" encoding="utf-8"?>
<nm:TransportationRequestSUITERequest xmlns:nm="http://sap.com/xi/SAPGlobal20/Global" xmlns:prx="some ns">
<MessageHeader/>
<TransportationRequest>
<Item>
<ne:TMAddnOrderFields xmlns:ne="urn:mr:pi:interfaces:ecc:ID461:OrderIntegration">
<n0:SHIP_TYPE xmlns:n0="urn:mr:pi:interfaces:ecc:ID461:OrderIntegration">LOLO</n0:SHIP_TYPE>
</ne:TMAddnOrderFields>
</Item>
</TransportationRequest>
</nm:TransportationRequestSUITERequest>
I just need to replace the namespace of TMAddnOrderFields and its fields. I am able to do that but main namespaces getting effected.
please let me know what to be edited in this below snippet. 🙂
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="node()|@*">
<xsl:copy>
<xsl:apply-templates select="@*|*|text()" />
</xsl:copy>
</xsl:template>
<xsl:template match="//*[namespace-uri()='urn:mr:pi:interfaces:ecc:ID461:OrderIntegration']">
<xsl:element name="{local-name()}" namespace="urn:mr:pi:interfaces:tm:ID461:OrderIntegration" >
<xsl:apply-templates select="@*|node()" />
</xsl:element>
</xsl:template>
</xsl:stylesheet>
Thanks,
Aman
Hi,
Check this Document.
Regards,
Manigandan.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
82 | |
10 | |
10 | |
9 | |
6 | |
6 | |
5 | |
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.