Issue when using multiple then statements

24 views
Skip to first unread message

Dylan Strachan

unread,
Sep 14, 2020, 5:20:09 PM9/14/20
to Orbeon Forms
When I try to use a statement such as this: 
if ("xpath") then (action1 then action2) else action3 . 

I get an xpath error in orbeon, however if I change the second then to an or such as this:
if ("xpath") then (action1 or action2) else action3

The error goes away.  Why am I running into this xpath error?

Best,
Dylan


Alessandro Vernet

unread,
Sep 15, 2020, 1:26:57 AM9/15/20
to orb...@googlegroups.com
Hi Dylan,

The first expression looks correct, but often the devil is in the details.
Could you give us a concrete example of the process you are using, and also
give the exact error you are getting?

‑Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: http://discuss.orbeon.com/

Dylan Strachan

unread,
Sep 15, 2020, 11:01:31 AM9/15/20
to orb...@googlegroups.com
Hello Alessandro,

here is an example

if($Control1[contains(text(), 'someText1')] or
$Control1   [contains(text(), 'someText2')])
then (
replace($ Control1," someText1 ","newText1") then
replace($ Control1," someText2 ","newText2")
)
else $Control1    

Best,
Dylan

--
You received this message because you are subscribed to a topic in the Google Groups "Orbeon Forms" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/orbeon/GQulo_d0rTo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to orbeon+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/1600147614322-0.post%40n4.nabble.com.

Alessandro Vernet

unread,
Sep 15, 2020, 9:09:04 PM9/15/20
to orb...@googlegroups.com
Hi Dylan,

The following is not valid:

replace($Control1, "someText1", "newText1") then
replace($Control1, "someText2", "newText2")

Instead, I think you want to have:

replace(
replace($Control1, "someText1", "newText1"),
"someText2", "newText2")

You let me know if this indeed does what you had in mind.

Alessandro Vernet

unread,
Sep 22, 2020, 3:13:51 PM9/22/20
to orb...@googlegroups.com
Hi Dylan,

Did you get a chance to try the expression with the nested calls to
`replace()`? If so did that work for you?
Reply all
Reply to author
Forward
0 new messages