the fall and rise of xforms

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

Upload: others

Post on 12-Sep-2021

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: The fall and rise of XForms

The fall and rise of XForms

@StianSigvartsenhttp://metaphorm.wordpress.com

Page 2: The fall and rise of XForms

Overview

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

Page 3: The fall and rise of XForms

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)

Page 4: The fall and rise of XForms

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

Page 5: The fall and rise of XForms

W3C XForms 1.1 Implementations

➲ Client side

● FormFaces● Ubiquity XForms● XSLTForms

➲ Server side

● Chiba● Smartsite Forms● BetterFORM● AJAXForms● Orbeon

Many, many more...http://www.w3.org/community/xformsusers/wiki/XForms_Implementations

Page 6: The fall and rise of XForms

Some related specifications

➲ XML (!)➲ XML Schema➲ XPath➲ HTTP➲ SOAP

➲ REST (ok, not really a specification)

Page 7: The fall and rise of XForms

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...

Page 8: The fall and rise of XForms

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

Page 9: The fall and rise of XForms

The same example as an XForm...

Page 10: The fall and rise of XForms

<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>

Page 11: The fall and rise of XForms

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>

Page 12: The fall and rise of XForms

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>...

Page 13: The fall and rise of XForms

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

Page 14: The fall and rise of XForms

Thanks!Questions?

@StianSigvartsenhttp://metaphorm.wordpress.com