xpath in orbeon form

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

xpath in orbeon form

Romek
Hello

I have one field type email (name:email) and second is string (name:numer).
I'd like to populate third one but only after both are not empty and first
one is correct email address.

This is how I try to join two fields
if ($numer!='' and  matches($email,'not(starts-with(., '@')) and
not(ends-with(., '@')) and count(tokenize(., '@'))=2 and
string-length(.)<=50)') then concat($numer,'#',$email) else .

but it doesnt work. xpath is not valid. Do You know why?

Best regards
Romek Mendaluk




--
Sent from: http://discuss.orbeon.com/

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Reply | Threaded
Open this post in threaded view
|

Re: xpath in orbeon form

Alessandro  Vernet
Administrator
Hi Romek,

You could use `xxf:valid()` to figure if the provided email address is
valid. I think this would make more sense, so that email isn't checked, in
the same form, with 2 different set of rules. Then maybe something along the
lines of the expression below could work. Also, note that `matches()`
expects a regex as the second argument (not an XPath expression).

if ($numer != '' and  xxf:valid($email)) then concat($numer, '#', $email)
else .

You'll let me know if this helps.

Alex

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

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: xpath in orbeon form

Alessandro  Vernet
Administrator
Hi Romek,

If this is still a current issue, did you get a chance to try using
`xxf:valid()`?

Alex

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

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet