I am currently constructing an XPath condition in SAP PI (receiver determination object) which should either route the message to receiver 1 or receiver 2.
The given documentID values that the business sends are as follows.
Receiver 1 receives messages within below documentID range
Range: "F00" to "F99"
Receiver 2 receives messages within below documentID range
Range: "FA0" to "FZ9"
Sample condition that I can think of, but not sure if this will work or if the logic is correct. Follow up question too, does greater/less than signs accept non-numerical characters?
Condition for Receiver 1
(/p1:Upload/ContainerEvent[WorkAssignmentID >= F00] EX AND /p1:Upload/ContainerEvent[WorkAssignmentID <= F99] EX )
Condition for Receiver 2
(/p1:Upload/ContainerEvent[WorkAssignmentID >= FA0] EX AND /p1:Upload/ContainerEvent[WorkAssignmentID <= FZ9] EX )
I am also thinking if substring can be used in XPath. Feel free to provide your inputs. Thanks
Regards, Charles Tan
Answer to your follow-up question ("does greater/less than signs accept non-numerical characters?"): in XPath 1.0, no, greater-than/less-than operate only on numerics. This changes in XPath 2.0.