on 01-08-2007 11:23 AM
Hi,
I have following Problem.
with a source message like:
<main>
<element>
<id>Z10</id>
<value>Test10</value>
<value>Test11</value>
</element>
<element>
<id>Z20</id>
<value>Test20</value>
<value>Test21</value>
<value>Test22</value>
</element>
<element>
<id>Z30</id>
<value>Test30</value>
</element>
<element>
<id>Z40</id>
<value>Test40</value>
<value>Test41</value>
<value>Test42</value>
</element>
</main>
I want to select only the value of the element with ID = Z30.
In my message Mapping i have a customer function where loop over ID and than i select the value where ID equals "Z30".
But because i have several value tags the queues have different length.
That means the third entry in ID queue is "Z30" but the third entry in value queue is "Test20".
So i get the wrong value. Any Idea how i can synchronise the queues.. so that the ID and the values all on the right position ?
Regards,
Robin
Hi Robin,
I would'nt use a UDF.
I would use a condition (if) for
- <id>
- <value>
This should work
Regards Mario
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mario,
but than i have the same problem with this different queues because the value queue is longer.
I try to do this:
ID = "Z30" -> than i become a queue like ... false, false, false, true.
Than i use the condition IfwithoutElse and on THEN i put the VALUE queue but this one is much longer so on position 4, where i get true in ID queue is not the VALUE entry i want.
Regards,
Robin
Hi,
Here you want your ELEMENT tag to be created only if id is Z30
<element>
<id>Z10</id>
<value>Test10</value>
<value>Test11</value>
</element>
<element>check if id = Z30 then CREATEIF node else don't do anything<element>
The CREATEIF standard function creates the node of the segment . So if the value is true the node will be created else not.
I think the rest will work with one to one mapping ro u might try with just context change.
Regards
Vijaya
Mine works OK:
/ns0:mt_test1/element=/ns0:mt_test1/element= /ns0:mt_test1/element/id=ifWithoutElse([keepss=false]stringEquals(/ns0:mt_test1/element/id=, const([value=Z30])), /ns0:mt_test1/element/id=) /ns0:mt_test1/element/value=ifWithoutElse([keepss=false]stringEquals(/ns0:mt_test1/element/id=, const([value=Z30])), /ns0:mt_test1/element/value=)
Regards Mario
Hi,
this works but i dont get the value.
i have one target field which should fill with the value of the Z30 element.
There is always only one Z30 Element with has the value i need.
I just have to find the right value from the source structure over the ID.
But when i map the value field i always get a queue with all values.
i want a target structure like:
<main>
<status>AN HERE THE VALUE FROM Z30</status>
<...rest of the document..>
<...rest of the document..>
<...rest of the document..>
</main>
Regards,
Robin
User | Count |
---|---|
92 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.