Re: xf:date vs xs:date

Posted by Alessandro Vernet on
URL: https://discuss.orbeon.com/xf-date-vs-xs-date-tp4661172p4661176.html

Hi Martin,

The difference is that `xf:date` allows for no date to be provided. Without that, you wouldn't be able to have a non-required date field in XForms.

In XPath, to cast a static date to the "date type", I would write `xs:date('2010-01-01')`. And thus if you want to have a constraint on the current field, which is either an `xf:date` or `xs:date`, you can write `, <= xs:date('2010-01-01')`.

Finally, when using Form Builder, you should be shielded from having to know about this ;), and should just be able to add a date field, make it required or not, and if named `my-date` refer to it in XPath expressions as `$my-date`.

Alex
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet