cancel
Showing results for 
Search instead for 
Did you mean: 

Problems with Xpath

0 Kudos

Hi All,

i'm new in XI-Xpath, i read the main blogs here in SDN community but i still have some problems with my condition.

My scenario is the following, i have the following messagge and i need to send it to different systems according to the "sender" field

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

<TrainRunningInformationMessage>

<MessageHeader>

<MessageStatus/>

<MessageReference>

<MessageType MessageTypeCode=""/>

<MessageNumber/>

<MessageDateTime/>

</MessageReference>

<Sender>

<Recipient/>

I need that the receveir is system A if the sender='a' and 'recipient='b', i can do it using the equal and AND condition but i need to use the EX operator (beacuse this is just a part of a bigger condition).

I tried with

(/p1:TrainRunningInformationMessage/MessageHeader/Sender = 'a' and /p1:TrainRunningInformationMessage/MessageHeader/Recipient = 'b' EX ) but it's not working, can anyone help me?

Thz a lot

Accepted Solutions (0)

Answers (2)

Answers (2)

Shabarish_Nair
Active Contributor
0 Kudos

make this blog as your reference - /people/shabarish.vijayakumar/blog/2006/06/07/customise-your-xpath-expressions-in-receiver-determination

former_member200962
Active Contributor
0 Kudos

a bit confused about your requirement...

/p1:TrainRunningInformationMessage/MessageHeader/Recipient = 'b' EX

You cannot have this declaration.....you need to define it separately if you want to check if Recipient = b and if Recipient node exists then use the EX function.....cannot be clubbed in the same line

0 Kudos

Sorry,

i forgot (), my condition is ((/p1:TrainRunningInformationMessage/MessageHeader/Sender = 'a' and /p1:TrainRunningInformationMessage/MessageHeader/Recipient = 'b' ) EX )

former_member200962
Active Contributor
0 Kudos

can you tell me why for you have used EX and what is it supposed to do in your scenario.....

0 Kudos

I need the following:

if (sender = 'a' and receiver = 'b') or (sender = 'a1' and receiver = 'b1') the messagge has to be sent to system A

if (sender != 'a' or receiver != 'b') and (sender != 'a1' or receiver != 'b1') the messagge has to be sent to

system B

I'm able to create the first condition with standard condition editior functions but i cannot to do the second one so i want to use xpath expression.

thanks for the help

former_member200962
Active Contributor
0 Kudos
if (sender != 'a' or receiver != 'b') and (sender != 'a1' or receiver != 'b1')

for this you need to refer the blog by Shabarish...it deals with these conditions...

Former Member
0 Kudos

Hi Aldo,

very easy.

Just use the first condition!

In your receiver determination you will see on the bottom a checkbox:

"If no Receiver is Found, Proceed as Follows"

Enter: "Select the Following Receiver"

Thats it.

Regards Mario

0 Kudos

I solved the problem, i wrote a / where it was not needed (before [).

I could not use "Error Messagge" in the case of "If no receiver is found Procedd as follows-->error messagge" because in the case that the first condition is not satisfied i need to send a messagge created by myself and not a standard one.

Thanks all of you for the support

Bye Aldo