on 2007 Jul 18 3:54 AM
Hi,
I'm trying to use a switch in an integration process that relies on XPath for the switching logic and I am having some difficulties getting it to work.
I've tested the following and it is a valid XPath statement, but does not seem to work as I would expect in XI
/p1:BAPI_EQUI_GETDETAIL.Response/DATA_GENERAL_EXP[number(translate(READ_CRDAT, "-", ""))>=20010101]
This should return a node and if the string in READ_CRDAT is greater than 2001-01-01 and thus satisfy the EX condition. However, all of the records are rejected even though there are number of test cases that should pass.
What type should I specify in the expression editor for the XPath? Can you use the number() and translate() functions in XI? Is there a length limit to XPath expressions? Are there other known issues that prevent this kind of logical comparison?
TIA for your help.
Rob
robert,
in the condition editor, when u select ur XPath expression, there is a check box in the bottom right, "Multiline", check that check box and try........
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi robert,
<<I've tested the following and it is a valid XPath statement, but does not seem to work as I would expect in XI
>>
where do u tested it,
i dont know much anything about XPath expressions.....can u guide me
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi sudeep,
I tested the expression on the http://www.whitebeam.org/library/guide/TechNotes/xpathtestbed.rhtm site. You upload your XML and enter in an XPath and it gives you the result. There are plenty of tools available, commercial and free, that can do the same thing (e.g. XML Spy, XPather, etc)
There are a number of good XPath tutorials available online if you want to learn more about syntax and structure.
Rob
Sudeep, you got it. Thanks very much. The key was the multiline check box in the Expression Editor. Reading the documents closely, that selection makes sense for any kind of predicate test in XPath because they return a list of nodes that match the conditions (a list with 0 elements if nothing matches).
Points have been awarded and I've marked the question as answered.
Rob
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey,
In the source structure is the the string of the format 2001-01-01 ? Then probably you can use this deine a constant of type string and the value 2001-01-01.
Then for the xpath expression
/p1:BAPI_EQUI_GETDETAIL.Response/DATA_GENERAL_EXP[number(translate(READ_CRDAT, "-", ""))>=constant]
or you can try this one for the existing condition.
/p1:BAPI_EQUI_GETDETAIL.Response/DATA_GENERAL_EXP[number(translate(READ_CRDAT, "-", ""))>=2001-01-01]
Give it a shot.
Cheers
<b>*RAJ*
*REWARD POINTS IF FOUND USEFULL*</b>
XPath in BPM switch
Posted: Jul 18, 2007 4:54 AM
Hi,
I'm trying to use a switch in an integration process that relies on XPath for the switching logic and I am having some difficulties getting it to work.
I've tested the following and it is a valid XPath statement, but does not seem to work as I would expect in XI
/p1:BAPI_EQUI_GETDETAIL.Response/DATA_GENERAL_EXP[number(translate(READ_CRDAT, "-", ""))>=20010101]
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
70 | |
10 | |
10 | |
7 | |
6 | |
6 | |
6 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.