Hi,
XForms officially uses XPath 1.0. This seems rather unexpressive. I'd like to express things like ('foo' was chosen in mylistbox AND ((an integer below 18 was entered in myinputfield AND mycheckbox was true) OR myinputfield has not been filled in yet) (just making something up here, ad-hoc pseudocode). I heard OPS can use XPath 2 instead of XPath 1 - does this mean I could specify expressions like that for the "relevant" attribute of XForms elements when I used OPS? Does anyone by chance know nice examples of more complex XPath expressions like this? Kind regards, Arnout -- 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 ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Arnout Engelen schreef:
> I'd like to express things like ('foo' was chosen in mylistbox AND > ((an integer below 18 was entered in myinputfield AND mycheckbox was > true) OR myinputfield has not been filled in yet) On a related note: how can I add additional namespaces (like xmlns:fn="http://www.w3.org/2005/xpath-functions") to the XPath Sandbox? Arnout -- 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 ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Administrator
|
In reply to this post by Arnout Engelen
Arnout,
The most useful aspects of XPath 2.0 IMO are the if() and for() constructs, support for types (even simple types are very useful), and the vastly expanded function library. Some of our examples use XPath 2.0 expressions, in particular we use XPath 2.0's if() construct instead of the XForms 1.0 if() function. The condition you express below can, BTW, be expressed with XPath 1.0 and the extension if() function: it is not a particularly difficult one. But XPath 2.0 makes it easier to check on the integer, and I would go about it like this: <instance> <listbox/> <myinputfield/> <mycheckbox/> </instance> listbox = 'foo' and ((myinputfield castable as xs:integer and mychebox = 'true') or myinputfield = '') Google will find for you articles about XPath 2.0, for example: http://www.developer.com/xml/article.php/3344421 Also, the spec is of course your friend: http://www.w3.org/TR/xpath20/ as is Michael Kay's book: http://www.amazon.com/gp/product/0764569104/ -Erik Arnout Engelen wrote: > Hi, > > XForms officially uses XPath 1.0. This seems rather unexpressive. > > I'd like to express things like > > ('foo' was chosen in mylistbox AND ((an integer below 18 was entered in > myinputfield AND mycheckbox was true) OR myinputfield has not been > filled in yet) > > (just making something up here, ad-hoc pseudocode). I heard OPS can use > XPath 2 instead of XPath 1 - does this mean I could specify expressions > like that for the "relevant" attribute of XForms elements when I used > OPS? Does anyone by chance know nice examples of more complex XPath > expressions like this? > > > Kind regards, > > Arnout > > > ------------------------------------------------------------------------ > > > -- > 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 > ObjectWeb mailing lists service home page: http://www.objectweb.org/wws -- Orbeon - XForms Everywhere: http://www.orbeon.com/blog/ -- 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 ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Administrator
|
In reply to this post by Arnout Engelen
Arnout Engelen wrote:
> On a related note: how can I add additional namespaces (like > xmlns:fn="http://www.w3.org/2005/xpath-functions") to the XPath Sandbox? I don't think you can with the current XPath Sandbox. This said, you don't need to add the namespace above to use the XPath function library. -Erik -- Orbeon - XForms Everywhere: http://www.orbeon.com/blog/ -- 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 ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Free forum by Nabble | Edit this page |