Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

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.

Former Member
replied

Hi Paul,

You can achieve it as follows:

Regards,

Azhar

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question