cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping query

Former Member
0 Kudos

Hi folks ,

I am facing a mapping challenge :

My source XML is like :

<source>

     <header1>

          <itemgrp>

           <fld1>X <fld1>

            <fld2>Yfld2>

             <item>

               <id>ID1</id>

              </item>

          </itemgrp>

     </header>

<header2>

          <itemgrp>

           <fld1>S</fld1>

           <fld2>T</fld2>

            <item>

              <id>ID2</id>

             </item>

          </itemgrp>

</source>

My req is :

1. Can I generate unique ID's for every <itemgrp> and later on refer the id's generated in mapping for other target fields

2. Can I merge content of field id of <item> nodes in the document . and later on pass all in a string  .

I am working on PI 7.0 . and would prefer going by standard functionality of XI , if possible would try to avoid Java / XSLT mapping

Kindly suggest ?

Regards ,

Nayan

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

As you are on PI 7.0 you cannot use the standard functionality/variables to acheive your unique id requirement..ofcourse its possible in PI 7.0 but you need to use global container variables and have to use UDF to achieve the same..unlike PI 7.1 where an intermediate varaibles can be used to acheive..

Coming to the concating of the item node data yes that can be done with the standard node functions (play around with context node functions...)

HTH

Rajesh

Former Member
0 Kudos

Hi  ,

My Src struct :

<source>

     <header1>

          <itemgrp>

           <fld1>X <fld1>

            <fld2>Yfld2>

             <item>

               <id>06414404756</id>

              </item>

          </itemgrp>

     </header>

<header2>

          <itemgrp>

           <fld1>S</fld1>

           <fld2>T</fld2>

            <item>

              <id>06414404702</id>

             </item>

          </itemgrp>

</source>

Target Struct :

<Target>

     <header1>

          <itemgrp>

           <fld1>X <fld1>

            <fld2>Yfld2>

             <item>

               <id>06414404756</id>

              </item>

          </itemgrp>

     </header>

<header2>

          <itemgrp>

           <fld1>S</fld1>

           <fld2>T</fld2>

            <item>

              <id>06414404702</id>

             </item>

          </itemgrp>

<All>

<ids> 

<![CDATA[06414404756, 1

06414404702, 1

06414404709, 1

06414404717, 1

06414404730, 1

06414404713, 1

06414404707, 1

06414404965, 1]]

</ids>

</All>

</Target>

I want all Id from source to come in target node of IDS as shown inside CDATA .

regards ,

nayan

Former Member
0 Kudos

Hi,

Do you have two target structures ?

if so use two mappings one graphical mapping and another xslt mapping

HTH

Rajesh

Former Member
0 Kudos

Hi Rajesh ,

Thanks for the reply..

I have 1 source structure and two target structure . One an XSD other an wsdl . I have to convert the source into tgt Xsd and than pass the target XSD as an XML into one of the field of wsdl..

For this I am going to use 2 mapping as you correctly pointed 1. graphical

2. XSLT/JAVA for XML streaming .

My query is as below :

Suppose I have source structure :

<source>

<X>

<T>

<P1>A</P1>

<P1>B</P1>

<P1>C</P1>

</T>

</X>

<Y>

<Z>

<P1>A</P1>

<P1>B</P1>

<P1>C</P1>

</Z>

</Y>

</source >

1. Can I compare the content of two nodes like X and Y given above using node functions .

2. using UDF , if yes ,how to proceed ? any sample code ?

3. I don't have to pass the content of nodes having similar content to target structure .

Regards ,

Nayan

Answers (1)

Answers (1)

markangelo_dihiansan
Active Contributor
0 Kudos

Hello,

1. Can I generate unique ID's for every <itemgrp> and later on refer the id's generated in mapping for other target fields

2. Can I merge content of field id of <item> nodes in the document . and later on pass all in a string  .

Please provide the target structure so that we could advise you further. With regards to passing all your data as a string, I'm afraid there is no workaround in PI 7.0 but to use either Java/XSLT since it does not support the Return As XML function in message mapping.

Hope this helps,

Mark