cancel
Showing results for 
Search instead for 
Did you mean: 
Subscribe

I have a problem with getting the mapping rigth.

I have the following source message:

<?xml version="1.0" encoding="UTF-8"?>

<ns0:rtptest xmlns:ns0="http://">
   <messNo>123</messNo>
   <P01>
      <radNo>1</radNo>
      <P05>
         <P05data>11</P05data>
      </P05>
      <PXX>
         <PXXdata>111</PXXdata>
      </PXX>
   </P01>
   <P01>
      <radNo>2</radNo>
      <PXX>
         <PXXdata>222</PXXdata>
      </PXX>
   </P01>
   <P01>
      <radNo>3</radNo>
      <P05>
         <P05data>33</P05data>
      </P05>
      <PXX>
         <PXXdata>333</PXXdata>
      </PXX>
   </P01>
</ns0:rtptest>

The result should lokk in this way:

<?xml version="1.0" encoding="UTF-8"?>

<ns0:rtptest xmlns:ns0"http://">
   <messNo>123</messNo>
   <P01>
   <radNo>1</radNo>
      <PXX>
      <PXXdata>111</PXXdata>
      </PXX>
   </P01>
   <P01>
   <radNo>2</radNo>
      <PXX>
      <PXXdata>222</PXXdata>
      </PXX>
   </P01>
   <P01>
   <radNo>3</radNo>
      <PXX>
      <PXXdata>333</PXXdata>
      </PXX>
   </P01>
   <P01>
   <radNo>1</radNo>
      <P05>
      <P05data>11</P05data>
      </P05>
   </P01>
   <P01>
   <radNo>3</radNo>
      <P05>
      <P05data>33</P05data>
      </P05>
   </P01>
</ns0:rtptest>

But we get the following result:

<?xml version="1.0" encoding="UTF-8"?>

<ns0:rtptestxmlns:ns0="http://">
<messNo>123</messNo>
   <P01>
   <radNo>1</radNo>
      <PXX>
      <PXXdata>111</PXXdata>
      </PXX>
   </P01>
   <P01>
   <radNo>2</radNo>
      <PXX>
      <PXXdata>222</PXXdata>
      </PXX>
   </P01>
   <P01>
   <radNo>3</radNo>
      <PXX>
      <PXXdata>333</PXXdata>
      </PXX>
   </P01>
   <P01>
   <radNo>1</radNo>
      <P05>
      <P05data>11</P05data>
      </P05>
   </P01>
   <P01>
   <radNo>2</radNo>
   </P01>
   <P01>
   <radNo>3</radNo>
      <P05>
      <P05data>33</P05data>
      </P05>
   </P01>
</ns0:rtptest>

Ass you sse we get an extra P01 with <radNo>2</radNo> in it.

Thatone should not come. When we get this result we have P01 from the source mapped to P01 in the target.

I've tried to use P05 with the context set to rtptest to push the P01 but then we get the following result.

<?xml version="1.0" encoding="UTF-8"?>

<ns0:rtptest xmlns:ns0="http://">
<messNo>123</messNo>
   <P01>
   <radNo>1</radNo>
      <PXX>
      <PXXdata>111</PXXdata>
      </PXX>
   </P01>
   <P01>
   <radNo>2</radNo>
      <PXX>
      <PXXdata>222</PXXdata>
      </PXX>
   </P01>
   <P01>
   <radNo>3</radNo>
      <PXX>
      <PXXdata>333</PXXdata>
      </PXX>
   </P01>
   <P01>
   <radNo>1</radNo>
      <P05>
      <P05data>11</P05data>
      </P05>
   </P01>
   <P01>
   <radNo>2</radNo>
   </P01>
</ns0:rtptest>

We are still getting the P01 with <radNo>2</radNo> but not the last one.

I want the P01 with <radNo>2</radNo> to not be pushed and the last P01 to be ther when I have data in P05.

Does anybody know how I can solve this?

BR

Kalle

0 Likes
View Entire Topic
Former Member
0 Likes

works this way

/ns0:rtptest/messNo=/ns0:rtptest/messNo

/ns0:rtptest/P01=removeContexts(createIf(exists(/ns0:rtptest/P01/P05/P05data ))) /ns0:rtptest/P01/radNo=/ns0:rtptest/P01/radNo= /ns0:rtptest/P01/PXX=const([value=]) /ns0:rtptest/P01/PXX/PXXdata=/ns0:rtptest/P01/P05/P05data= /ns0:rtptest/P01[1]=removeContexts(createIf(exists(/ns0:rtptest/P01/PXX/PXXdata=))) /ns0:rtptest/P01[1]/radNo=/ns0:rtptest/P01/radNo= /ns0:rtptest/P01[1]/PXX=const([value=]) /ns0:rtptest/P01[1]/PXX/PXXdata=/ns0:rtptest/P01/PXX/PXXdata

P05data and PXXdata are in context of P01

The P01 field on the target field is duplicated.

That's pitty that the forum doesn't allow to attach files. I'd attach the xim mapping project file.

Best regards

Dmitry