No Slide Title

Download Report

Transcript No Slide Title

XForms: Bringing
the Power of XML
to Everyone
田
Micah Dubinko
Editor, XForms 1.0
http://dubinko.info/writing/xforms/
Brought to you by the letters XFE
http://dubinko.info/writing/xforms/
Introduction
“In the beginning…the earth was without
form and void”
--Genesis 1:1,2
Long time coming
• Pre-Web:
• 1993:
• 1994–2002:
• Today:
Proprietary; binary formats
HTML forms
Nothing new
XForms & proprietary
Limitations of HTML Forms
• Need Script to do anything…
– Validations
– Calculations
– Dynamic Forms
• Some Assembly Required
– <input value=“initial value”>
• Primitive Data Representation
– Name=Micah&Title=Chief+XML…
Scripting Closes Doors
Key Design Factors in XForms
• XML In; XML Out
• 80/20
• Embrace existing practice
• Integration with Web Services; Tools
• Leverage XPath, XML Schema, XSLT
• Any Time, Any Place, Any Device
Implementation Strategies
•Chiba
•OXF
•IBM(1)
•jXForms
•DENG •FormsPlayer
•X-Smiles
•XFE
•Ripcord
•Novell
•nForms •Oracle(1)
•Oracle(2)
•IBM(2)
•Xero
•MobiForm
Server … Zero-install client … Application
Example:
<input ref=“q”>
<label><html:img src=“images/google.jpg”
alt=“Google Search:”/></label>
<send ev:event=“DOMActivate”/>
</input>
More Quotes
“What the world really needs is more love
and less paperwork.”
--Pearl Bailey
“XML lets organizations benefit from
structured, predictable documents. Thus,
XML breeds forms. QED.
--David Weinberger
More Examples
• Working Group Examples
– http://www.w3.org/MarkUp/Forms/2002/Exa
mples/
• Test Suite
– http://www.w3.org/MarkUp/Forms/Test
– Of course, [email protected]
Benefit: Unify Client and Server
Server
Client
XForms
Processor
XForms
Processor
•Server process for
“data double check”
XForms
Model
•Client process for
optimal data entry
•Less CGI hacks = better security
Foundations: XPath
“Nobody trips over mountains. It is the
small pebble that causes you to stumble.
Pass all the pebbles in your path, and you
will find you have crossed the mountain.”
--Traditional Proverb
XForms Architecture
XHTML 2.0
SVG
FO
SMIL
?
Form Controls
XForms Model
XML Schema
XForms Actions
XPath
XML
XML Events
XForms Instance
• Based on XPath
• Provides template for your data
• Provides default or partially submitted
data
• Can be inline or referenced externally
• Full support for XML Schema
Binding
<head>
XForms Model
</head>
<bind id=“xyz”
nodeset=“memo/cc”
required=“1”/>
<body>
Insert
LOTR
joke
here
<input bind=“xyz”…>
</body>
<input ref=“memo/cc”…>
Form Building Blocks
• XForms lives in multiple locations within a
single “containing document”
<head>
<html>
</html>
XForms Model
</head>
<body>
</body>
Purpose
(non-visible)
Presentation
Form controls
Fundaments: XML Schema
“Knowledge is of two kinds. We can know
a subject ourselves, or we can know where
to find information on it.”
--Samuel Johnson
XForms Architecture
XHTML 2.0
SVG
FO
SMIL
?
Form Controls
XForms Model
XML Schema
XForms Actions
XPath
XML
XML Events
XForms Model
ARTHUR: Camelot!
GALAHAD: Camelot!
LANCELOT: Camelot!
PATSY: It’s only a model.
Arthur: Shhh!
--Monty Python and the Holy Grail
XForms Model
• Single, device-
independent XML form
definition
• Works with standard or
proprietary user interfaces
• Defines the ‘Purpose’ of
the form
XForms Constraints
• Static (from Schema) and dynamic
– Datatypes
– Relevant
– Required
– ReadOnly
– Validation
– Calculation
– Minimum/maximum occurrences
User Interface
“A human being should be able to change
a diaper, plan an invasion, butcher a hog,
conn a ship, design a building, write a
sonnet, balance accounts, build a wall, set
a bone, comfort the dying, take orders,
give orders, cooperate, act alone, solve
equations, analyze a new problem, pitch
manure, program a computer, cook a tasty
meal, fight efficiently, and die gallantly.
Specialization is for insects.”
--Robert A. Heinlein
User Interface
<input>
<secret>
<trigger>
<submit>
<select>
<select1>
Total: $300.00
<upload>
<output>
<range>
• Describes intent, not presentation
Advanced User Interface
• Grouping
• Dynamic Presentation
– Multiple pages
• Repeating Tables
Actions & Events
“While we are free to choose our actions,
we are not free to choose the
consequences of our actions”
--Stephen Covey
“We are not ready for any unforeseen
event that may or may not occur.”
--Dan Quayle
XForms Actions
• Defines common set of behaviors
• Based on XML Events
• No JavaScript required
–
–
–
–
–
–
Message
Send
Setvalue
Setfocus
Toggle
Load
More Examples
• <message level=“ephemeral”>Please enter the number…</message>
• <message level=“modeless”>Have you forgotten your
password</message>
• <message level=“modal”>This field is required (Street)</message>
modeless
ephemeral
modal
XML Events
• Event-driven
– modelInitialize
– Focus/blur, next/previous
– valueChanged
– Help/hint/alert
– Submit/reset
– Error conditions
Submit
“This element encodes how, where, and
what to submit.”
--XForms Candidate Rec, 12 Nov 2002
Data Submission
Submit
• XML in/XML out; or legacy format…
– Including Binary data
• GET, PUT, or POST
• File system, HTTP, or e-mail
Style
“Never offend people with style when you
can offend them with substance.”
--Sam Brown
CSS, Level 3
• New styles for form controls; basic UI
• Ability to apply style to readonly, required,
relevant, etc.
Accessibility, Design,
Troubleshooting
“There are two ways of constructing a
software design: One way is to make it so
simple that there are obviously no
deficiencies, and the other way is to make
it so complicated that there are no obvious
deficiencies.”
--C. A. R. Hoare
Usability
help
hint
alert
Section 508 Accessibility
• Accessible web forms for everybody
– Not keyboard-centric
– Events for focus, navigation
– Script not required
– Captions/metadata
• Multimodal forms
…on any Device
• appearance= “full” | “compact” | “minimal”
“full”
(always visible)
“compact”
(scroll bars)
“minimal”
(popup)
Extending XForms
“Still, what an arm! and I could alter it: But
all the play, the insight and the stretch—
Out of me, out of me!”
--Robert Browning
What about InfoPath?
“Do not go where the path may lead; go
instead where there is no path and leave a
trail.”
--Ralph Waldo Emerson
GFDL
• Full text and graphics available under
open content license
• http://dubinko.info/writing/xforms/
Help Make XForms Better!
• Vote For XForms in Mozilla!
• http://bugzilla.mozilla.org/show_bug.cgi?id=97806
• Even better: help implement XForms in
Mozilla
Try Out XForms
• Implementations:
•
•
•
•
•
•
Novell http://www.novell.com/xforms/
X-Smiles http://www.xsmiles.org
FormsPlayer http://www.formsplayer.com
Mozquito http://webaccess.mozquito.com
Oracle http://otn.oracle.com/tech/wireless/mobilebrowser.htm
IBM http://www.alphaworks.ibm.com/tech/xmlforms
Making the Transition
• Deploy XML data (Web Services)
– RPC-style bad; Document-style better
– Plain-old XML even better
• Don’t assume browser-only access
• Avoid dependence on HTML processing
• Think beyond client-server
• Embrace open standards
For More Information…
• [email protected] (subj: “Subscribe”)
• http://www.w3.org/TR/xforms/
• http://www.w3.org/MarkUp/Forms
• http://dubinko.info/blog/
• http://www.xml.com/
• http://dubinko.info/writing/xforms/
Thank You!
• Please fill out an evaluation form