Skip to Content
0
Former Member
Mar 21, 2013 at 02:41 PM

XPath Expression at Condition Editor in Receiver Determination

1184 Views

Hi,

I have a fixed length flat file coming in into which I have to look at the first line's 4th to 7th positions. Based on that if it is "1234" then I need to route it to the receiver else I will ignore in the receiver determination.

Example input file -

M 0123456789ABCDEFGHIJKL

PR0123456789JIDFJDIFJD0244

PA0123456789JFDJF9384384K

We have module configuration where we are converting this to a line value pair something like this -

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

<ns:GMTLog xmlns:ns="http://sap.com/xi/GMStoreConnectivity">

<Line>

<Value>M 0123456789ABCDEFGHIJKL

</Value>

</Line>

<Line>

<Value>PR0123456789JIDFJDIFJD0244

</Value>

</Line>

<Line>

<Value>PA0123456789JFDJF9384384K

</Value>

</Line>

</ns:GMTLog>

When I tried to test my xpath in xpath tester it is working fine with the below xpath expressions -

1. /ns:GMTLog/Line[Value][1] --> This returned the first record completely

2. substring(/ns:GMTLog/Line[Value][1], 4, 4) --> This returned exactly what I am expecting "1234"

But the above 2 are not working in condition editor.

May I know the exact xpath expression to be used in this case to route the message to receiver when 4th to 7th position is "1234".

Thanks a lot in advance.

Regards,

Sarat