cancel
Showing results for 
Search instead for 
Did you mean: 

Keep namespace tags throughout the message mapping in XI

Former Member
0 Kudos

Hi!

I am facing the following problem:

A backend application sends out XML messages that all have a namespace tag in the element names:

...

<ns1:StandardBusinessDocument xmlns:ns1="http://www.unece.org/cefact/namespaces/SBDH" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:eanucc="urn:ean.ucc:2" xmlns:deliver="urn:ean.ucc:deliver:2" xsi:schemaLocation="http://www.unece.org/cefact/namespaces/SBDH ../Schemas/sbdh/StandardBusinessDocumentHeader.xsd urn:ean.ucc:2 ../Schemas/ReceivingAdviceProxy.xsd">

<ns1:StandardBusinessDocumentHeader>

<ns1:HeaderVersion>2.2</ns1:HeaderVersion>

<ns1:Sender>

<ns1:Identifier Authority="EAN.UCC">1234567890123</ns1:Identifier>

</ns1:Sender>

...

Problem is that the backend expects the reply from XI to look the same (ns0: or ns1: in front of every element name). But when I import the xsd into XI, it removes these tags and the message then looks completely different to the backend:

<ns0:StandardBusinessDocument xmlns:ns0="urn:ean.ucc:2" ns1="http://www.unece.org/cefact/namespaces/SBDH" eanucc="urn:ean.ucc:2" deliver="urn:ean.ucc:deliver:2" schemaLocation="http://www.unece.org/cefact/namespaces/SBDH ../Schemas/sbdh/StandardBusinessDocumentHeader.xsd urn:ean.ucc:2 ../Schemas/ReceivingAdviceProxy.xsd" xsi="http://www.w3.org/2001/XMLSchema-instance"><StandardBusinessDocumentHeader><HeaderVersion>2.2</HeaderVersion><Sender><Identifier Authority="EAN.UCC">1234567890123</Identifier></Sender>

Any help on how to make XI keep the namespace tags is greatly appreciated!

Cheers!

Stefan

Accepted Solutions (1)

Accepted Solutions (1)

udo_martens
Active Contributor
0 Kudos

Hi Stefan,

you achiev that with a XSLT mapping for the response. The interfaces will not be checked during runtime, if you dont use BPM or Message Mapping.

Regards,

Udo

Former Member
0 Kudos

Hi Udo,

could you by any chance provide me with an example of this xslt mapping?

It would be a great help as I am sadly not really familiar with xslt...

Thanks and cheers!

Stefan

udo_martens
Active Contributor
0 Kudos

Hi Stefan,

plz have a look to following german sides:

Stefan Münz: XSLT

Informationen zur Extensible Markup Language

<a href="http://www.xsl-xml.de/xslt.html">Einführung in XSL-Transformation (XSLT)</a>

You have to do a construction like


...
<ns1:Sender>
<ns1:Identifier Authority="EAN.UCC">
<xsl:value-of select="//X-Path expression on my source field"></xsl:value-of></ns1:Identifier>
</ns1:Sender>
...

Regards,

Udo

Answers (0)