on 01-13-2015 4:05 PM
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.
Hi Paul,
your mapping of evidence_links should be
file -->>remove context-->>evidence_links
regards,
Harish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Harish,
Thanks for your reply. As advised I now have:
with:
file -->>remove context-->>evidence_links
file -->>Split By Value (Each Value)-->>link_url
However, this is no better. When mapping:
<reports>
<report>
<id>111</id>
<evidence></evidence>
</report>
<report>
<id>222</id>
<evidence>
<file>file1</file>
<file>file2</file>
</evidence>
</report>
</reports>
I now get:
<reports>
<report>
<id>111</id>
<evidence>
<evidence_links></evidence_links>
<evidence_links>
<link_url>file1</link_url>
</evidence_links>
</evidence>
</report>
<report>
<id>222</id>
<evidence></evidence>
</report>
</reports>
i.e. same as before except the evidence is now against the wrong reports.
Any ideas?
Cheers,
PaulC.
Make sure that you don't change the context of file, so set the context to original if you chagned it before and then try...
file ---->>MapWithDefault ---->>evidence_links
If above doesn't work then try with this one as well...
file ---->>MapWithDefault ----->>SplitByValue(each value) ----->>evidence_links
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.
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.