on 05-10-2006 5:23 PM
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?
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Matt,
Good, I'm glad it worked. If you need to check the end of a string, there's not an ends-with function until XPath 2.0 (XI 3.0 only support XPath 1.0) so you can use a combination of the substring and string-length functions:
/p1:PRODUCT/MATNR[not(substring(.,string-length(.) - 2) = '123')]
Thanks,
Jesse
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!
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.