XFORMS in minutes - PowerPoint PPT Presentation

About This Presentation
Title:

XFORMS in minutes

Description:

FORM is dead all hail the XFORM ! XForms offers a higher level approach to ... DHTML. HTTP. Javascript. Ajax... What you (as the developer) need to know ... – PowerPoint PPT presentation

Number of Views:122
Avg rating:3.0/5.0
Slides: 21
Provided by: cmc3
Category:
Tags: xforms | dhtml | minutes

less

Transcript and Presenter's Notes

Title: XFORMS in minutes


1
XFORMS in minutes
  • Chris Bailey

2
Presentation overview
  • Introduction
  • What Why
  • How XFORM works
  • Code examples
  • Specific features
  • Problems Issues
  • References

3
ltFORMgt is dead all hail the ltXFORMgt!
  • XForms offers a higher level approach to writing
    traditional XHTML form-based input.
  • Became a W3C recommendation in 2003
  • Second edition of the spec released in Sept 2006
  • XForms WG currently working on 1.1

4
Why use Xforms?
  • Clearer design
  • Implements separation of concerns via a MVC
    approach
  • data model independent from presentation
  • logic easier to code
  • Less code
  • No javascript! ltscript/gt
  • Works with existing technologies
  • Designed with AJAX in mind

5
Underpinning technologies
  • XML
  • XML Schema
  • XPath
  • DHTML
  • HTTP
  • Javascript
  • Ajax

What you (as the developer) need to know What
the xform handling code uses
6
How to do I produce XFORMS?
  • XFORMS are all written in XML
  • When executedXFORMS (D)HTMLJavascript
  • Pre-compile source code ?
  • Dynamic compilation on server ?
  • Dynamic compilation on client (browser) ?

7
XFORM implementations
  • Pre-compilation
  • AJAXForms
  • XFormation
  • Server support
  • Orbeon
  • IBM Workplace Forms
  • Browser support
  • X-Smiles
  • Browser addons/extensions
  • Mozilla XForms
  • MozzIE
  • FormsPlayer
  • FormFaces

8
Quotes
  • XForms is the most-implemented W3C specification
    ever at this stage in its life-cycle. W3C
    XForms FAQ
  • British Government's e-government
    interoperability framework current guidance is to
    use the XForms standards as defined by W3C

9
XFORMS MVC Approach
Model Define the format of the data
Controller Specify constraints and relationships
View Simply reference parts of the model
ltpatientgt lttitle/gt ltsex/gt ltdob/gt ltchildren/gt lt
/patientgt
10
XFORMS MVC Approach
Model Define the format of the data
Controller Specify constraints and relationships
View Simply reference parts of the model
No empty nodes allowed String, max length 50
chars Enumeration (MaleFemale) Date
value Integer range0 lt x lt 10
ltpatientgt lttitle/gt ltsex/gt ltdob/gt ltchildren/gt lt
/patientgt
11
XFORMS MVC Approach
Model Define the format of the data
Controller Specify constraints and relationships
View Simply reference parts of the model
No empty nodes allowed String, max length 50
chars Enumeration (MaleFemale) Date
value Integer range0 lt x lt 10
ltpatientgt lttitle/gt ltsex/gt ltdob/gt ltchildren/gt lt
/patientgt
12
Show me some XFORMs!
  • lthtmlgt
  • ltheadgt
  • ltxformsmodelgt
  • ltxformsinstancegt
  • ltpersongt
  • ltname/gt
  • lt/persongt
  • lt/xformsinstancegt
  • ltxformsbind nodeset"/person/name"
    type"xsstring"

  • constraintstring-length(.) lt 50"/gt
  • lt/xformsmodelgt
  • lt/headgt
  • ltbodygt
  • ltpgtHello world. Please enter your name
    here
  • ltxformsinput ref"/person/name/gtlt/pgt
  • ltbodygt
  • lt/htmlgt

13
Show me some XFORMs!
  • lthtmlgt
  • ltheadgt
  • ltxformsmodelgt
  • ltxformsinstancegt
  • ltpersongt
  • ltname/gt
  • lt/persongt
  • lt/xformsinstancegt
  • ltxformsbind nodeset"/person/name"
    type"xsstring"

  • constraintstring-length(.) lt 50"/gt
  • lt/xformsmodelgt
  • lt/headgt
  • ltbodygt
  • ltpgtHello world. Please enter your name
    here
  • ltxformsinput ref"/person/name/gtlt/pgt
  • ltbodygt
  • lt/htmlgt

14
Referencing data with XPATH
  • View and controllers reference data model with
    XPATH expressionse.g.
  • ltxformsbind nodeset"" required"true" /gt
  • /credit-card/number
  • /credit-card/position() 1
  • /credit-card/starts-with(local-name(),expiratio
    n)
  • /credit-card/

15
Binding attributes (validation)
  • typeltxformsbind nodeset"/credit-card/expiration
    -month" type"xsinteger" /gt
  • constraintltxformsbind nodeset"/credit-card/expi
    ration-month" constraint". gt 1 and 12 gt
    ."/gt
  • requiredltxformsbind nodeset"/credit-card/expira
    tion-month" required"true" /gt

16
Binding attributes (cont)
  • calculateltxformsbind nodeset"/person/age"
    calculate"year-from-date (current-date()) -
    year-from-date(../dob)" /gt
  • readonlyltxformsbind nodeset"/person/age"
    readonly"if (../dob ) then false else
    true" /gt
  • relevantltxformsbind nodeset"/person/password"
    relevant"false" /gt

17
View attributes
  • ltxformsselect1 ref"/moving-details/my-delivery-c
    ompany" appearance""gt ltxformsitemset nodeset"
    /companies/delivery"gt ltxformslabel 
    ref"label"/gt ltxformsvalue ref"_at_value"/gt lt/xf
    ormsitemsetgt
  • lt/xformsselect1gt

appearance"full" appearance"compact" appearance"minimal"

18
Disadvantages of XFORMS
  • Enhanced accessibility ?
  • The abstraction that xforms offers means that you
    need not worry so much about the presentation
    issues
  • Reduced accessibility ?
  • At the mercy of the xforms handler
  • Can AJAX ever be made accessible?

19
Did I mention its all XML?
  • OH MY GOSH ITS ALL XML!!!!!!
  • Not for the faint hearted (or people without a CS
    degree!)
  • Editors should make this easier when they arrive
    ?
  • OpenOffice.org 2.0 already here

20
References
  • XForms 1.0 (Second Edition) W3C Recommendation 14
    March 2006
  • http//www.w3.org/TR/xforms/
  • XForms 1.1 W3C Working Draft
  • http//www.w3.org/TR/xforms11/
  • Orbeon Forms
  • http//www.orbeon.com/
Write a Comment
User Comments (0)
About PowerShow.com