xforms: bringing the power of xml to everyone 田 micah dubinko editor, xforms 1.0

45
XForms: Bringing the XForms: Bringing the Power of XML to Power of XML to Everyone Everyone Micah Dubinko Micah Dubinko Editor, XForms 1.0 Editor, XForms 1.0 http://dubinko.info/writing/xfor http://dubinko.info/writing/xfor ms/ ms/

Upload: kelly-moody

Post on 29-Jan-2016

224 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: XForms: Bringing the Power of XML to Everyone 田 Micah Dubinko Editor, XForms 1.0

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

Page 2: XForms: Bringing the Power of XML to Everyone 田 Micah Dubinko Editor, XForms 1.0

Brought to you by the letters Brought to you by the letters XFEXFE

http://dubinko.info/writing/xforms/http://dubinko.info/writing/xforms/

Page 3: XForms: Bringing the Power of XML to Everyone 田 Micah Dubinko Editor, XForms 1.0

IntroductionIntroduction

“In the beginning…the earth was without form and void”

--Genesis 1:1,2

Page 4: XForms: Bringing the Power of XML to Everyone 田 Micah Dubinko Editor, XForms 1.0

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

Page 5: XForms: Bringing the Power of XML to Everyone 田 Micah Dubinko Editor, XForms 1.0

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…

Page 6: XForms: Bringing the Power of XML to Everyone 田 Micah Dubinko Editor, XForms 1.0

Scripting Closes DoorsScripting Closes Doors

Page 7: XForms: Bringing the Power of XML to Everyone 田 Micah Dubinko Editor, XForms 1.0

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

Page 8: XForms: Bringing the Power of XML to Everyone 田 Micah Dubinko Editor, XForms 1.0

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

Page 9: XForms: Bringing the Power of XML to Everyone 田 Micah Dubinko Editor, XForms 1.0

Example:Example:

<input ref=“q”> <label><html:img src=“images/google.jpg” alt=“Google Search:”/></label> <send ev:event=“DOMActivate”/></input>

Page 10: XForms: Bringing the Power of XML to Everyone 田 Micah Dubinko Editor, XForms 1.0

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

Page 11: XForms: Bringing the Power of XML to Everyone 田 Micah Dubinko Editor, XForms 1.0

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]

Page 12: XForms: Bringing the Power of XML to Everyone 田 Micah Dubinko Editor, XForms 1.0

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

Page 13: XForms: Bringing the Power of XML to Everyone 田 Micah Dubinko Editor, XForms 1.0

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

Page 14: XForms: Bringing the Power of XML to Everyone 田 Micah Dubinko Editor, XForms 1.0

XForms ArchitectureXForms Architecture

XHTML 2.0

SVG FO ?SMILForm Controls

XML Schema

XPath

XML EventsXML

XForms Model

XForms Actions

Page 15: XForms: Bringing the Power of XML to Everyone 田 Micah Dubinko Editor, XForms 1.0

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

Page 16: XForms: Bringing the Power of XML to Everyone 田 Micah Dubinko Editor, XForms 1.0

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

Page 17: XForms: Bringing the Power of XML to Everyone 田 Micah Dubinko Editor, XForms 1.0

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

Page 18: XForms: Bringing the Power of XML to Everyone 田 Micah Dubinko Editor, XForms 1.0

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

Page 19: XForms: Bringing the Power of XML to Everyone 田 Micah Dubinko Editor, XForms 1.0

XForms ArchitectureXForms Architecture

XHTML 2.0

SVG FO ?SMILForm Controls

XML Schema

XPath

XML EventsXML

XForms Model

XForms Actions

Page 20: XForms: Bringing the Power of XML to Everyone 田 Micah Dubinko Editor, XForms 1.0

XForms ModelXForms Model

ARTHUR: Camelot!GALAHAD: Camelot!LANCELOT: Camelot!PATSY: It’s only a model.Arthur: Shhh!

--Monty Python and the Holy Grail

Page 21: XForms: Bringing the Power of XML to Everyone 田 Micah Dubinko Editor, XForms 1.0

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

Page 22: XForms: Bringing the Power of XML to Everyone 田 Micah Dubinko Editor, XForms 1.0

XForms ConstraintsXForms Constraints

• Static (from Schema) and dynamicStatic (from Schema) and dynamic– DatatypesDatatypes– RelevantRelevant– RequiredRequired– ReadOnlyReadOnly– ValidationValidation– CalculationCalculation– Minimum/maximum occurrencesMinimum/maximum occurrences

Page 23: XForms: Bringing the Power of XML to Everyone 田 Micah Dubinko Editor, XForms 1.0

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

Page 24: XForms: Bringing the Power of XML to Everyone 田 Micah Dubinko Editor, XForms 1.0

User InterfaceUser Interface

• Describes intent, not presentationDescribes intent, not presentation

<upload>

<trigger><submit>

<select><select1>

<input><secret>

<range><output>Total: $300.00

Page 25: XForms: Bringing the Power of XML to Everyone 田 Micah Dubinko Editor, XForms 1.0

Advanced User InterfaceAdvanced User Interface

• GroupingGrouping

• Dynamic PresentationDynamic Presentation– Multiple pagesMultiple pages

• Repeating TablesRepeating Tables

Page 26: XForms: Bringing the Power of XML to Everyone 田 Micah Dubinko Editor, XForms 1.0

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

Page 27: XForms: Bringing the Power of XML to Everyone 田 Micah Dubinko Editor, XForms 1.0

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

Page 28: XForms: Bringing the Power of XML to Everyone 田 Micah Dubinko Editor, XForms 1.0

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

Page 29: XForms: Bringing the Power of XML to Everyone 田 Micah Dubinko Editor, XForms 1.0

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

Page 30: XForms: Bringing the Power of XML to Everyone 田 Micah Dubinko Editor, XForms 1.0

SubmitSubmit

“This element encodes how, where, and what to submit.”

--XForms Candidate Rec, 12 Nov 2002

Page 31: XForms: Bringing the Power of XML to Everyone 田 Micah Dubinko Editor, XForms 1.0

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

Page 32: XForms: Bringing the Power of XML to Everyone 田 Micah Dubinko Editor, XForms 1.0

StyleStyle

“Never offend people with style when you can offend them with substance.”

--Sam Brown

Page 33: XForms: Bringing the Power of XML to Everyone 田 Micah Dubinko Editor, XForms 1.0

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.

Page 34: XForms: Bringing the Power of XML to Everyone 田 Micah Dubinko Editor, XForms 1.0

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

Page 35: XForms: Bringing the Power of XML to Everyone 田 Micah Dubinko Editor, XForms 1.0

UsabilityUsability

hintalert

help

Page 36: XForms: Bringing the Power of XML to Everyone 田 Micah Dubinko Editor, XForms 1.0

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

Page 37: XForms: Bringing the Power of XML to Everyone 田 Micah Dubinko Editor, XForms 1.0

……on any Deviceon any Device

• appearance= “full” | “compact” | “minimal”appearance= “full” | “compact” | “minimal”

“full”(always visible)

“compact”(scroll bars)

“minimal” (popup)

Page 38: XForms: Bringing the Power of XML to Everyone 田 Micah Dubinko Editor, XForms 1.0

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

Page 39: XForms: Bringing the Power of XML to Everyone 田 Micah Dubinko Editor, XForms 1.0

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

Page 40: XForms: Bringing the Power of XML to Everyone 田 Micah Dubinko Editor, XForms 1.0

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/

Page 41: XForms: Bringing the Power of XML to Everyone 田 Micah Dubinko Editor, XForms 1.0

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

Page 42: XForms: Bringing the Power of XML to Everyone 田 Micah Dubinko Editor, XForms 1.0

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

Page 43: XForms: Bringing the Power of XML to Everyone 田 Micah Dubinko Editor, XForms 1.0

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

Page 44: XForms: Bringing the Power of XML to Everyone 田 Micah Dubinko Editor, XForms 1.0

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/

Page 45: XForms: Bringing the Power of XML to Everyone 田 Micah Dubinko Editor, XForms 1.0

Thank You!Thank You!

• Please fill out an evaluation formPlease fill out an evaluation form