xforms: bringing the power of xml to everyone 田 micah dubinko editor, xforms 1.0
TRANSCRIPT
XForms: Bringing XForms: Bringing the Power of XML the Power of XML
to Everyoneto Everyone田田
Micah Dubinko Micah Dubinko Editor, XForms 1.0Editor, XForms 1.0
http://dubinko.info/writing/xformshttp://dubinko.info/writing/xforms//
Brought to you by the letters Brought to you by the letters XFEXFE
http://dubinko.info/writing/xforms/http://dubinko.info/writing/xforms/
IntroductionIntroduction
“In the beginning…the earth was without form and void”
--Genesis 1:1,2
Long time comingLong time coming
• Pre-Web:Pre-Web: Proprietary; binary Proprietary; binary formatsformats
• 1993:1993: HTML formsHTML forms
• 1994–2002:1994–2002: Nothing newNothing new
• Today:Today: XForms & proprietaryXForms & proprietary
Limitations of HTML FormsLimitations of HTML Forms
• Need Script to do anything…Need Script to do anything…– ValidationsValidations– CalculationsCalculations– Dynamic FormsDynamic Forms
• Some Assembly RequiredSome Assembly Required– <input value=“initial value”><input value=“initial value”>
• Primitive Data RepresentationPrimitive Data Representation– Name=Micah&Title=Chief+XML…Name=Micah&Title=Chief+XML…
Scripting Closes DoorsScripting Closes Doors
Key Design Factors in Key Design Factors in XFormsXForms
•XML In; XML OutXML In; XML Out
•80/2080/20
•Embrace existing practiceEmbrace existing practice
• Integration with Web Services; ToolsIntegration with Web Services; Tools
•Leverage XPath, XML Schema, XSLTLeverage XPath, XML Schema, XSLT
•Any Time, Any Place, Any DeviceAny Time, Any Place, Any Device
Implementation StrategiesImplementation Strategies
Server … Zero-install client … Application
•Chiba•OXF•IBM(1)
•DENG
•Ripcord•nForms
•FormsPlayer•XFE
•Oracle(1)
•X-Smiles•Novell
•Oracle(2)
•MobiForm
•IBM(2)•jXForms•Xero
Example:Example:
<input ref=“q”> <label><html:img src=“images/google.jpg” alt=“Google Search:”/></label> <send ev:event=“DOMActivate”/></input>
More QuotesMore 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 ExamplesMore Examples
• Working Group ExamplesWorking Group Examples– http://www.w3.org/MarkUp/Forms/2002/http://www.w3.org/MarkUp/Forms/2002/
Examples/Examples/
• Test SuiteTest Suite– http://www.w3.org/MarkUp/Forms/Testhttp://www.w3.org/MarkUp/Forms/Test
– Of course, [email protected] course, [email protected]
Benefit: Unify Client and Benefit: Unify Client and ServerServer
Server Client
XForms Processor
XForms Processor
XForms
Model
•Server process for “data double check”
•Client process for optimal data entry
•Less CGI hacks = better security
Foundations: XPathFoundations: 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 ArchitectureXForms Architecture
XHTML 2.0
SVG FO ?SMILForm Controls
XML Schema
XPath
XML EventsXML
XForms Model
XForms Actions
XForms InstanceXForms Instance
• Based on XPathBased on XPath
• Provides template for your dataProvides template for your data
• Provides default or partially Provides default or partially submitted datasubmitted data
• Can be inline or referenced Can be inline or referenced externallyexternally
• Full support for XML SchemaFull support for XML Schema
BindingBinding
<head>
</head>
<body>
</body>
XForms Model
<bind id=“xyz” nodeset=“memo/cc” required=“1”/>
<input bind=“xyz”…>
<input ref=“memo/cc”…>
Insert LOTR joke here
Form Building BlocksForm Building Blocks
• XForms lives in multiple locations XForms lives in multiple locations within a single “containing document”within a single “containing document”
<html>
</html>
<head>
</head>
<body>
</body>
XForms Model
Purpose(non-visible)
PresentationForm controls
Fundaments: XML SchemaFundaments: 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 ArchitectureXForms Architecture
XHTML 2.0
SVG FO ?SMILForm Controls
XML Schema
XPath
XML EventsXML
XForms Model
XForms Actions
XForms ModelXForms Model
ARTHUR: Camelot!GALAHAD: Camelot!LANCELOT: Camelot!PATSY: It’s only a model.Arthur: Shhh!
--Monty Python and the Holy Grail
XForms ModelXForms Model
• Single, device-Single, device-independent XML form independent XML form definitiondefinition
• Works with standard or Works with standard or proprietary user proprietary user interfacesinterfaces
• Defines the ‘Purpose’ Defines the ‘Purpose’ of the formof the form
XForms ConstraintsXForms Constraints
• Static (from Schema) and dynamicStatic (from Schema) and dynamic– DatatypesDatatypes– RelevantRelevant– RequiredRequired– ReadOnlyReadOnly– ValidationValidation– CalculationCalculation– Minimum/maximum occurrencesMinimum/maximum occurrences
User InterfaceUser 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 InterfaceUser Interface
• Describes intent, not presentationDescribes intent, not presentation
<upload>
<trigger><submit>
<select><select1>
<input><secret>
<range><output>Total: $300.00
Advanced User InterfaceAdvanced User Interface
• GroupingGrouping
• Dynamic PresentationDynamic Presentation– Multiple pagesMultiple pages
• Repeating TablesRepeating Tables
Actions & EventsActions & 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 ActionsXForms Actions
• Defines common set of behaviorsDefines common set of behaviors
• Based on XML EventsBased on XML Events
• No JavaScript requiredNo JavaScript required– MessageMessage– SendSend– SetvalueSetvalue– SetfocusSetfocus– ToggleToggle– LoadLoad
More ExamplesMore Examples• <message level=“ephemeral”>Please enter the <message level=“ephemeral”>Please enter the
number…</message>number…</message>• <message level=“modeless”>Have you forgotten your <message level=“modeless”>Have you forgotten your
password</message>password</message>• <message level=“modal”>This field is required <message level=“modal”>This field is required
(Street)</message>(Street)</message>
ephemeral
modeless
modal
XML EventsXML Events
• Event-drivenEvent-driven– modelInitializemodelInitialize– Focus/blur, next/previousFocus/blur, next/previous– valueChangedvalueChanged– Help/hint/alertHelp/hint/alert– Submit/resetSubmit/reset– Error conditionsError conditions
SubmitSubmit
“This element encodes how, where, and what to submit.”
--XForms Candidate Rec, 12 Nov 2002
Data SubmissionData Submission
• XML in/XML out; or legacy format…XML in/XML out; or legacy format…– Including Binary dataIncluding Binary data
• GET, PUT, or POSTGET, PUT, or POST
• File system, HTTP, or e-mailFile system, HTTP, or e-mail
Submit
StyleStyle
“Never offend people with style when you can offend them with substance.”
--Sam Brown
CSS, Level 3CSS, Level 3
• New styles for form controls; basic UINew styles for form controls; basic UI
• Ability to apply style to readonly, Ability to apply style to readonly, required, relevant, etc.required, relevant, etc.
Accessibility, Design, Accessibility, Design, TroubleshootingTroubleshooting
“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
UsabilityUsability
hintalert
help
Section 508 AccessibilitySection 508 Accessibility
• Accessible web forms for everybodyAccessible web forms for everybody– Not keyboard-centricNot keyboard-centric– Events for focus, navigationEvents for focus, navigation– Script not requiredScript not required– Captions/metadataCaptions/metadata
• Multimodal formsMultimodal forms
……on any Deviceon any Device
• appearance= “full” | “compact” | “minimal”appearance= “full” | “compact” | “minimal”
“full”(always visible)
“compact”(scroll bars)
“minimal” (popup)
Extending XFormsExtending 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?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
GFDLGFDL
• Full text and graphics available Full text and graphics available under open content licenseunder open content license
• http://dubinko.info/writing/xforms/http://dubinko.info/writing/xforms/
Help Make XForms Better!Help Make XForms Better!
• Vote For XForms in Mozilla!Vote For XForms in Mozilla!• http://bugzilla.mozilla.org/show_bug.cgi?id=9780http://bugzilla.mozilla.org/show_bug.cgi?id=9780
66
• Even better: help Even better: help implementimplement XForms XForms in Mozillain Mozilla
Try Out XFormsTry Out XForms
• Implementations:Implementations:• Novell Novell http://www.novell.com/xforms/http://www.novell.com/xforms/ • X-Smiles X-Smiles http://www.xsmiles.orghttp://www.xsmiles.org• FormsPlayer FormsPlayer http://www.formsplayer.comhttp://www.formsplayer.com • Mozquito Mozquito http://webaccess.mozquito.comhttp://webaccess.mozquito.com• Oracle Oracle http://http://
otn.oracle.com/tech/wireless/mobilebrowser.htmotn.oracle.com/tech/wireless/mobilebrowser.htm• IBM IBM http://http://www.alphaworks.ibm.com/tech/xmlformswww.alphaworks.ibm.com/tech/xmlforms
Making the TransitionMaking the Transition
• Deploy XML data (Web Services)Deploy XML data (Web Services)– RPC-style bad; Document-style betterRPC-style bad; Document-style better– Plain-old XML even betterPlain-old XML even better
• Don’t assume browser-only accessDon’t assume browser-only access
• Avoid dependence on HTML processingAvoid dependence on HTML processing
• Think beyond client-serverThink beyond client-server
• Embrace open standardsEmbrace open standards
For More Information…For More Information…
• [email protected]@w3.org (subj: (subj: “Subscribe”)“Subscribe”)
• http://www.w3.org/TR/xforms/http://www.w3.org/TR/xforms/
• http://www.w3.org/MarkUp/Formshttp://www.w3.org/MarkUp/Forms
• http://dubinko.info/blog/http://dubinko.info/blog/
• http://www.xml.com/http://www.xml.com/
• http://dubinko.info/writing/xforms/http://dubinko.info/writing/xforms/
Thank You!Thank You!
• Please fill out an evaluation formPlease fill out an evaluation form