on 12-02-2013 8:36 AM
Dear Expert,
I need to put a condition at my Receiver Determination.
The coming data element can have structure like this:
<body>
<receiver>
<id>0</id>
</receiver>
<details>
<loc> </loc>
</details>
</body>
The coming file could have more than one body.
Now I need to check, if there exist, in the same body, the id = 0 AND loc is not space " ".
I use the following XPath:
/Message/Body/receive[id = "0"] EX AND
/Message/Body/details[loc != " "]
Now the XPath expression fails for the following condition:
<body>
<receiver>
<id>0</id>
</receiver>
<details>
<loc> </loc>
</details>
</body>
<body>
<receiver>
<id>5</id>
</receiver>
<details>
<loc>A</loc>
</details>
</body>
This is because the expression only checks if there's any posid EQ 0 anywhere, and the location_of_goods equals A anywhere. What I want to achieve is to check if the posid = 0 AND location_of_goods is not space in the same body.
Any advice is appreciated.
Thank you,
Suwandi C.
Hello,
/Message/Body/receive[id = "0"] EX AND
/Message/Body/details[loc != " "]
Now the XPath expression fails for the following condition:
<body>
<receiver>
<id>0</id>
</receiver>
<details>
<loc> </loc>
</details>
</body>
<body>
<receiver>
<id>5</id>
</receiver>
<details>
<loc>A</loc>
</details>
</body>
/Message/Body[(receiver/id = "0") and (details/loc != " ")]
Hope this helps,
Mark
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Suwandi,
Could you please try this logic
/Message/Body[0]/receive[id = "0"] EX AND
/Message/Body[0]/details[loc != " "]
OR
/Message/Body[1]/receive[id = "0"] EX AND
/Message/Body[1]/details[loc != " "]
Regards
Anupam
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Suwandi,
I think there is a misunderstood about the boolean logic,
If you want to send your message when id is equal to zero and loc field is a blank, try with this:
/Message/Body/receive[id = "0"] AND
/Message/Body/details[loc = " "]
Also, you can check this condition in mapping, you could create a dummy field only for PI usage, like /Message/Body/error and to map here the result of the comparative and to make an easy XPATH in the configuration.
Regards.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
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.