Highlighted

Compare String

_jerome_dinnat_

28-07-2008

Hi,



I want to compare strings in a route condition.



I have two strings /process_data/@string1 and /process_data/@string2



I fill the box of the properties route conditions like that :



/process_data/@string1 = /process_data/@string2



I try many other ways but it doesn't work so I think I'm wrong



I use a variable logger in the process with the strings length and the strings :



string1 :



/process_data/@tailleCourrant - java.lang.Integer: 10

/process_data/@nplusunEnCours - String: AALBERTEAU



string2 :



/process_data/@tailleEntree - java.lang.Integer: 10

/process_data/@nplusUnEntree - String: AALBERTEAU



The only difference I see is the blank before the strings but I can't erase them and the length are the same so I think there is no matter of that.



Edit : I try this in condition :



"test" = "test" and It works fine so I suppose my two string are different but I know there are the same and the logger say that. I don't understand the spaces before the string. I try normalize-space but It doesn't work to.



Thanks

Replies

Highlighted

pguerett

28-07-2008

I think the issue is with XPath. You will have to explicitly state that they are strings in your XPath statement.
Highlighted

_jerome_dinnat_

28-07-2008

I try string(/process_data/@string1) and the same for string2 but I didn't work to. I try to use serialize when I take the string in the xml but It didn't change anything.



But finally It works. The string1 variable is a input variable but I can retrieve this value in the process so I delete it and create an other string but not input this time. And this time it's work without serialise() or string(), I don't understand.
Highlighted

HowardTreisman

28-07-2008

Could it be that the order of execution of your routes is the wrong way around, so that it's always executing another route before this one?

Howard

http://www.avoka.com