the fall and rise of xforms
play

The fall and rise of XForms @StianSigvartsen - PowerPoint PPT Presentation

The fall and rise of XForms @StianSigvartsen http://metaphorm.wordpress.com Overview A history of W3C XForms specifications XForms explained by example The future of XForms W3C XForms 1.0 August 2000 Working Draft for 2 years


  1. The fall and rise of XForms @StianSigvartsen http://metaphorm.wordpress.com

  2. Overview ➲ A history of W3C XForms specifications ➲ XForms explained by example ➲ The future of XForms

  3. W3C XForms 1.0 ➲ August 2000 – Working Draft for 2 years ➲ November 2002 – Candidate Recommendation ➲ August 2003 - Proposed Recommendation ➲ 14 October 2003 – Recommendation ➲ Interoperability with XML Schema datatypes ➲ But required a browser plug-in in most cases ➲ M$ had other plans: Xdocs (a.k.a. InfoPath)

  4. W3C XForms 1.1 ➲ July 2006 - Working Draft ➲ November 2007 – Candidate Recommendation ➲ August 2009 – Proposed Recommendation ➲ 20 October 2009 – Recommendation ➲ Shift towards server side implementations ➲ Access SOAP, REST, ATOM, non-XML services ➲ Generalised XML insert & delete actions

  5. W3C XForms 1.1 Implementations ➲ Client side ➲ Server side FormFaces Chiba ● ● Ubiquity XForms Smartsite Forms ● ● XSLTForms BetterFORM ● ● AJAXForms ● Orbeon ● Many, many more... http://www.w3.org/community/xformsusers/wiki/XForms_Implementations

  6. Some related specifications ➲ XML (!) ➲ XML Schema ➲ XPath ➲ HTTP ➲ SOAP ➲ REST (ok, not really a specification)

  7. Example HTML form <html> <head>...</head> <body> <form name=”exampleform” action=” submit.jsp ” method=”post”> <label for=”ageinput”>Please enter your age</label> <input id=”ageinput” name=”age”> <input type=”submit” value=”Go”/> </form> </body> </html> ➲ Cannot submit to a XML REST service ➲ No real-time validation, and...

  8. Complexity in submit.jsp ✔ Read the “age” request parameter ✔ Validate as a number ✔ Transform into XML format ✔ Send to REST service ✔ Interpret REST service response ✔ Produce HTML response ✔ … or write JQuery script to make client-side AJAX submissions to the REST service

  9. The same example as an XForm...

  10. <html xmlns=”http://www.w3.org/1999/xhtml” xmlns:xf=”http://www.w3.org/2002/xforms” xmlns:anyns=”http://anyns.org” xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xsd=”http://www.w3.org/2001/XMLSchema”> <head> <xf:model> <xf:instance id=”details”> <anyns:details> <anyns:age/> </anyns:details> </xf:instance> <xf:bind id=”age” ref=”anyns:age” type=”xsd:numeric” /> <xf:submission id=”process” ref=”instance('details')” method=”post” action=”service.jsp” /> </xf:model> </head> <body> <xf:input bind=”age” > <xf:label>Please enter your age</xf:label> </xf:input> <xf:trigger> <xf:label>Go</xf:label> <xf:send ev:event=”DOMActivate” submission=”process” /> </xf:trigger> </body> </html>

  11. REST service.jsp receives... <anyns:details xmlns:anyns=”http://anyns.org”> <anyns:age> 42 </anyns:age> </anyns:details> ➲ No submit.jsp script needed ➲ Service might respond with... <anyns:result xmlns:anyns=”http://anyns.org”> <anyns:message> The older, the wiser! </anyns:message> </anyns:result>

  12. Rendering response to user ... <head> <xf:model> ... <xf:instance id=” response ”> <anyns:result> <anyns:message/> </anyns:result> </xf:instance> ... <xf:submission id=”process” ref=”instance('details')” action=”process.jsp” method=”post” replace=”instance” instance=”response” /> <xf:bind id=”servmsg” ref=”instance('response')/anyns:message” /> </xf:model> </head> <body> ... <xf:output bind=”servmsg” /> ... </body> ...

  13. W3C XForms 2.0 ➲ June 2011 – Editor's Draft (Wiki) ➲ Custom functions ➲ Variable support ➲ Pluggable expression language ➲ JSON, CSV and other external instance data formats

  14. Thanks! Questions? @StianSigvartsen http://metaphorm.wordpress.com

Recommend


More recommend