cancel
Showing results for 
Search instead for 
Did you mean: 

XPath expression

Former Member
0 Kudos

Hi,

Can you please help on the XPath expression for the below case in receiver determination. I want to compare the count to the number of Records node in the XPath in receiver determination. Basically need to check if these two are equal.

So if the count is 3 the no of Record nodes will be 3 . Is there a way to achieve this in Xpath.

Header

  Count    2

Records

  Name

  Age

Records

Name

  Age

Accepted Solutions (0)

Answers (4)

Answers (4)

former_member190293
Active Contributor
0 Kudos

Hi Amit!

Assuming that your message should have the root element like this:

<?xml version="1.0" encoding="UTF-8"?>

<ns0:MT_Message xmlns:ns0="urn://your_ns">

     <Header>

          <Count>2</Count>

     </Header>

     <Records>

          <Name>Name1</Name>

          <Age>Age1</Age>

     </Records>

     <Records>

          <Name>Name2</Name>

          <Age>Age2</Age>

     </Records>

</ns0:MT_Message>

You could use the following condition:

/*[Header/Count=count(Records)] EX

Regards, Evgeniy.

Snavi
Active Participant
0 Kudos

Hi Amit,

try with condition /header/count=count(/header/records)

former_member187587
Contributor
0 Kudos

Do you want to rout the message to different destinations based on the count?

Former Member
0 Kudos

Yes its kind of similar to that. Actually this interface has multiple operations within one service interface. And for one of the conditions I need to have this checked.

anupam_ghosh2
Active Contributor
0 Kudos

Hi Amit,

              do you decide the receiver depending on value of the count or if the count equals no of record nodes?

Regards

Anupam

Former Member
0 Kudos

Hi Anupam,

It will be based on the condition count should be equal to no of record nodes.

0 Kudos

Hi Amit,

Please check the below thread if this solves your query,

https://scn.sap.com/thread/1606794

Regards,

Praloy