on 06-28-2007 9:15 AM
Hi guys!
I have following source msg
....
<tag1>
<action>A1</action> --is attribute
<val>xxxx</val> --is attribute
</tag1>
<tag1>
<action>A2</action>
<val>yyyyy</val>
</tag1>
I need to map to target field value of val, but from the tag1, where value of action is A2. Remember pls, that the order of tag1 can be different, so one time can be tag1 with action=A2 on the 1st place, another time on 2nd.
How to achieve it?
Thanx a lot guys, points are 4 sure 4 u
Olian
Hi Olian
try this out
check with ifWithoutElse function
if action = A2 then transfer value from val to val
action = A2(check with ifWithoutElse graphical function)
this condition will be first input to ifWithoutElse function
pass val to ifWithoutElse function as second parameter. and then map output of ifWithoutElse to the target field
Hope this helps
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Olian,
As friends suggested above. It will work perfectly.
Please follow the below URL to find the same.(Note: Please consider my reply as last, coz already Mugdha, Varun has suggested the same).
I'm giving this juz for reference.
Structure
http://www.flickr.com/photo_zoom.gne?id=653508576&size=o
Results
http://www.flickr.com/photo_zoom.gne?id=653750648&size=o
Best regards,
raj.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Bring down action and val tags in 2 your mapping editor. Use the SF equals of string type to check for A1. use an if witout else boolean function and assign the value of val to the then node...
It should work
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi;
Write a UDF for the same.
for(int i=0;i<action.length;i++)
{
if(action<i>.equals("A2"))
result.addValue(val<i>);
}
Input to this function will be action and length
Mapping
action---- Remove Context -
UDF -
target
val -
Remove Context -
Mudit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.