Skip to Content
avatar image
Former Member

Using substring in the XPATH expression for Receiver Determination

Hello, I need a little help please. In my receiver determination, I have a condition and I need to do a "not like" check. Basically, if the first three positions of the source field does not start with a specific code, then I need to execute the condition. The condition editor does not support a "not like" operand, so I went to the XPATH expression editor. I tried to used the XPATH substring function to get the first three characters and then do a "not equal" operand, but it doesn't appear to work. There are not any runtime errors, but the condition is not executing. Any ideas on this? Does the XPATH expression support the substring function?

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • Best Answer
    avatar image
    Former Member
    May 10, 2006 at 05:11 PM

    Hi Matt,

    You can use the following method:

    1) Specify an XPath in the Condition Editor. For example if you want to check that there is not a Material that starts with 123.

    /p1:PRODUCT/MATNR[not(starts-with(.,"123"))]

    2) Choose EX (exists) for the Operator and then don't fill in anything for the Right Operand.

    Thanks,

    Jesse

    Add comment
    10|10000 characters needed characters exceeded

    • Hi Jesse,

      Can you please explain what is the meaning of http:// in the statement

      /p1:PRODUCT/MATNRhttp://not(substring(.,string-length(.) - 2) = '123')

      Please explein, I am having same issue. It is not working here.In My case it is

      /p1:ORDERS01/IDOC/E1EDP01/E1EDP19/IDTNR[http://not(starts-with(.,\"D\"))]

      also tried with

      /p1:ORDERS01/IDOC/E1EDP01/E1EDP19/IDTNR[http://not(starts-with(.,'D'))]

      Thanks in advance!

  • avatar image
    Former Member
    May 10, 2006 at 05:35 PM

    Matt

    First collect the first three characters into a variable using <xsl:i="substring(p2:MT_STUD_SORC/Records/Student/test,1,3)"/>. Now you give the value of i to if condition (after checking your characters)in mapping editor. You specify if it is true then go ahead else you dont pass it. For further info. go through the url:

    /people/prasadbabu.nemalikanti3/blog/2006/03/30/xpath-functions-in-xslt-mapping

    ---Satish

    Add comment
    10|10000 characters needed characters exceeded