cancel
Showing results for 
Search instead for 
Did you mean: 

How can I force PI to make all namespace-references in top of output XML?

Former Member
0 Kudos

I have a PI 7.11 scenario with RFC as sender-adapter from SAP-ERP and JMS as receiver-adapter on an MQ-queue. The receiver system wants to manipulate the received XML from the MQ-queue into a legacy mainframe-system with PL/1, DB2 and CICS. The XML is created with a 5-level schema-hierarchy that is imported to PI as External Definitions. I can easily make the scenario to deliver the messages via Integrated Configuration and PUT them onto the MQ-queue.

Here is my question: I wish to make all the namespace-declarations in the XML that is produced in the head of the XML, so the short namespace-references (ns1:, ns2: etc.) can be used in all the tags. Is that somehow possible to make PI do that?

No matter how and where I make the namespace-declarations in the schemas, then PI places the namespace definitions in the tag, where the namespace is used for the 1st. time. And only if tags are children to the tag, where the namespace was defined, then the tags only contains the namespace references (ns1:, ns2: etc.), in all other cases, then the full namespace definition is put in each tag.

Example (with my comments in green):

...

<YdelsesHaendelse>

<ns1:OekoEffektuering xmlns:ns1="oio:kmd:ydelseshaendelse:0.4.0">Here ns1: is defined for the first time in a tag. Can't it be moved to the header?

<ns1:EffektueringID>

<ns2:UUID xmlns:ns2="urn:oio:dkal:1.0.0">00505697-0121-1ed4-92ab-856319e1980d</ns2:UUID>Here ns2: is defined for the first time in a tag. Can't it be moved to the header?

</ns1:EffektueringID>

<ns1:FraTidspunkt>2014-11-10-16.26.13.000000</ns1:FraTidspunkt>Here ns1: is used as a reference without a definition of namespace. This is how we want it to be for all tags.

<ns1:Livscyklus>Oprettet</ns1:Livscyklus>Here ns1: is used again = OK.

<ns1:IT_System>Here ns1: is used again = OK.

<ns3:URNIdentifikator xmlns:ns3="urn:oio:sagdok:2.0.0">OPUSBARSEL</ns3:URNIdentifikator>Here ns3: is defined for the first time in a tag. Can't it be moved to the header?

</ns1:IT_System>

<ns1:OekoEffektueringAttributListe>Here ns1: is used again = OK.

<ns1:Startdato>2014-09-01</ns1:Startdato>Here ns1: is used again = OK.

<ns1:Slutdato>2014-09-21</ns1:Slutdato>Here ns1: is used again = OK.

          ...

</ns1:OekoEffektueringAttributListe>

<ns1:OekoEffektueringRelationsListe>Here ns1: is used again = OK.

<ns1:BevillingID>Here ns1: is used again = OK.

<ns2:UUID xmlns:ns2="urn:oio:dkal:1.0.0">00505697-0121-1ed4-8f99-c784041c4106</ns2:UUID>Here ns2: is defined again. Why that!?.

</ns1:BevillingID>

<ns1:UdbetalingAktoer>Here ns1: is used again = OK.

<ns3:URNIdentifikator xmlns:ns3="urn:oio:sagdok:2.0.0">Udbetaling Danmark</ns3:URNIdentifikator>Here ns3: is defined again. Why that!?.

</ns1:UdbetalingAktoer>

<ns1:OeKoYdelsesEffektuering>Here ns1: is used again = OK.

<ns1:Indeks>00505697-0121-1ee4-9a9d-bd03b38ed7bb</ns1:Indeks>Here ns1: is used again = OK.

<ns1:YdelsesEffektueringID>Here ns1: is used again = OK.

<ns2:UUID xmlns:ns2="urn:oio:dkal:1.0.0">00505697-0121-1ee4-9a9d-bd03b38ed7bb</ns2:UUID>Here ns2: is defined again. Why that!?.

</ns1:YdelsesEffektueringID>

<ns1:OeKoYdelsesEffektueringAttributListe>Here ns1: is used again = OK.

<ns1:YdelsesperiodeStartdato>2014-09-01</ns1:YdelsesperiodeStartdato>Here ns1: is used again = OK.

<ns1:YdelsesperiodeSlutdato>2014-09-21</ns1:YdelsesperiodeSlutdato>Here ns1: is used again = OK.

<ns1:Ydelsesbeloeb>9455.76</ns1:Ydelsesbeloeb>Here ns1: is used again = OK.

<ns1:Aendringsdato>2014-09-15-00.00.00.000000</ns1:Aendringsdato>Here ns1: is used again = OK.

<ns1:Klassifikationsbeskrivelse>Bruttobeloeb</ns1:Klassifikationsbeskrivelse>Here ns1: is used again = OK.

</ns1:OeKoYdelsesEffektueringAttributListe>

</ns1:OeKoYdelsesEffektuering>

...

</ns1:OekoEffektueringRelationsListe>

</ns1:OekoEffektuering>

</YdelsesHaendelse>

Sincerely Tonny Franke

Accepted Solutions (0)

Answers (1)

Answers (1)

Harish
Active Contributor
0 Kudos

Hi Tonny,

AFAIK - The possible solution is to use XSLT mapping or Java mapping. you can also write a UDF in graphical mapping (one to one) and perform the required operation. Please check the below blog

regards,

Harish