简体   繁体   中英

XPATH Expression to determine the receiver in SAP PI

I have a requirement where i need to determine the receiver based on condition in SAP PI XPATH expression. Can someone help please.

  • condition 2:

    <bizTransactionList><bizTransaction type> contains the value " urn:epcglobal:cbv:btt:resadv ”, this is also true but need to validate two more conditions as mentioned below in "Excep't

except: - when the last segment of the value contains the string “.008” in <Biztransaction> and that the <bizStep> contains the word “commissioning “ - or

when the last segment of the value contains the string “.008” in <Biztransaction> and that the <bizStep> contains the word “receiving “

Strictly speaking, the following XPath should work:

//bizTransaction[@type="urn:epcglobal:cbv:btt:prodorder"]|//bizTransaction[@type="urn:epcglobal:cbv:btt:resadv"][contains(.,".008")][preceding::bizStep[1][not(contains(text(),"commissioning") or contains(text(),"receiving"))]]

Output: 2 nodes

We use | operator to "join" 2 expressions. The first part will select "bizTransaction" element regarding 1 condition ("urn:epcglobal:cbv:btt:prodorder"). The second part will select "bizTransaction" element regarding 3 conditions: "urn:epcglobal:cbv:btt:resadv", ".008" and with "bizStep" element which not contains 2 specific keywords ("commissioning" or "receiving").

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM