xs types mandatory

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

xs types mandatory

RdeBeijer
Hi,

Can anybody explain why xs:date results in a field also being mandatory
and xforms:date isn't.
Using xforms:date looks like a good alternative but using xforms:date in
xpath expressions when setting a relevance binding fails

_This works:_
<xforms:bind nodeset =
"instance('form-instance')/formcontent/widgetTree/widget/widget[1]/widget[2]/widget[2]"
relevant = "
(((instance('form-instance')/formcontent/prefilleddata/dkdintserv/gensource/Kinderen
castable as xs:integer) and
(xs:integer(instance('form-instance')/formcontent/prefilleddata/dkdintserv/gensource/Kinderen)
&gt; 0)))"/>

_This fails:_
<xforms:bind nodeset =
"instance('form-instance')/formcontent/widgetTree/widget/widget[1]/widget[2]/widget[2]"
relevant = "
(((instance('form-instance')/formcontent/prefilleddata/dkdintserv/gensource/Kinderen
castable as xforms:integer) and
(xforms:integer(instance('form-instance')/formcontent/prefilleddata/dkdintserv/gensource/Kinderen)
&gt; 0)))"/>

Regards Ramon


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: xs types mandatory

Erik Bruchez
Administrator
You can use the xforms:* types on bind/@type. XPath knows nothing  
about those types at the moment.

But in your particular expression, there really is no need to use  
xforms:integer. Just write:

I would write your expression like this:

relevant="for $node in instance('form-instance')/formcontent/
prefilleddata/dkdintserv/gensource/Kinderen
             return $node castable as xs:integer and xs:integer($node)  
 > 0"

-Erik

On Mar 4, 2009, at 5:13 AM, Ramon de Beijer wrote:

> Hi,
>
> Can anybody explain why xs:date results in a field also being  
> mandatory and xforms:date isn't.
> Using xforms:date looks like a good alternative but using  
> xforms:date in xpath expressions when setting a relevance binding  
> fails
>
> _This works:_
> <xforms:bind nodeset = "instance('form-instance')/formcontent/
> widgetTree/widget/widget[1]/widget[2]/widget[2]" relevant =  
> " (((instance('form-instance')/formcontent/prefilleddata/dkdintserv/
> gensource/Kinderen castable as xs:integer) and  
> (xs:integer(instance('form-instance')/formcontent/prefilleddata/
> dkdintserv/gensource/Kinderen) &gt; 0)))"/>
>
> _This fails:_
> <xforms:bind nodeset = "instance('form-instance')/formcontent/
> widgetTree/widget/widget[1]/widget[2]/widget[2]" relevant =  
> " (((instance('form-instance')/formcontent/prefilleddata/dkdintserv/
> gensource/Kinderen castable as xforms:integer) and  
> (xforms:integer(instance('form-instance')/formcontent/prefilleddata/
> dkdintserv/gensource/Kinderen) &gt; 0)))"/>
>
> Regards Ramon
>
> --
> You receive this message as a subscriber of the [hidden email]  
> mailing list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> OW2 mailing lists service home page: http://www.ow2.org/wws
--
Orbeon Forms - Web Forms for the Enterprise Done the Right Way
http://www.orbeon.com/



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws