Skip to Content
avatar image
Former Member

Mapping Query

Hi,

I have asked a very similar question before and I thought it had been answered, but it turns out there is still an issue. What I have is a message structure like:

<reports>

   <report>

      <id>111</id>

      <evidence></evidence>

   </report>

   <report>

      <id>222</id>

      <evidence>

         <file>file1</file>

         <file>file2</file>

      </evidence>

   </report>

</reports>


Which I want to map to:


<reports>

   <report>

      <id>111</id>

      <evidence></evidence>

   </report>

   <report>

      <id>222</id>

      <evidence>

         <evidence_links>

            <link_url>file1</link_url>

         </evidence_links>

         <evidence_links>

            <link_url>file2</link_url>

         </evidence_links>

      </evidence>

   </report>

</reports>


I have tried using:



But this doesn't work and produces:


<reports>

   <report>

      <id>111</id>

      <evidence></evidence>

   </report>

   <report>

      <id>222</id>

      <evidence>

         <evidence_links></evidence_links>

         <evidence_links>

            <link_url>file1</link_url>

         </evidence_links>

      </evidence>

   </report>

</reports>

i.e. only one of the two links shows correctly in the second report node. For info if there was only one report node (the second one) then the mapping would work. The issue seems to be connected to having empty instances of the <evidence> node - they seem to impact following nodes.


Any help would be appreciated.


Cheers,


PaulC.

mq4.JPG (27.7 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Jan 13, 2015 at 06:55 PM

    Hi Paul,

    your mapping of evidence_links should be


    file -->>remove context-->>evidence_links


    regards,

    Harish

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Azhar Shaikh

      Azhar,

      Thanks for the reply.

      Yes, I stumbled upon this earlier this morning. Previous posts had mentioned 'Remove Context' and 'SplitByValue' in separate solutions so I just decided to try and stick them together in the one mapping...and it worked. However, it's good to see that someone has come up with the same solution. Shows it must be indeed be the correct one.

      Cheers,

      PaulC.