Quantcast
Channel: SCN : Unanswered Discussions - Process Integration (PI) & SOA Middleware
Viewing all articles
Browse latest Browse all 6719

XPath expression to check 2 fields in the same grandparents node

$
0
0

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.


Viewing all articles
Browse latest Browse all 6719

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>