You are reading O'Reilly XForms Essentials by Micah Dubinko. (What is this?) - Buy XForms Essentials Online

XForms Essentials


Table of Contents

Preface
Who Should Read This Book?
Who Should Not Read This Book?
If You're Still Reading This...
About the Examples
Organization of This Book
Conventions Used in This Book
How to Contact Us
Acknowledgments
1. Introduction to Web Forms
The Past, Present, and Future of Web Forms
A Brief Review of HTML Forms
Single-Line Text Input
Multi-Line Text Input
Password Text Input
Submit and Reset
Buttons
Radio Buttons
Checkboxes
Single-Select Menus
Multiple-Select Menus
File Select
Hidden Controls
Object Controls
Labels and Legends
Access and Navigation
Readonly and Disabled
Initialization
Submit
Limitations of HTML Forms, Advantages of XForms
The History of XForms
The Revenge of the Simple Syntax
2. XForms Building Blocks
More Than Forms
A Real-World Example
Host Language Issues
Combined Document Types
Linking Attributes
3. XPath in XForms
Getting Up to Speed with XPath
Going Deep: The XPath Data Model
Location Paths
Context
Axes
Predicates
Computed Expressions
Operators
Functions
How XPath is Used in XForms
Context Nodes
Model Binding Expressions
UI Binding Expressions
Computations
4. XML Schema in XForms
Wide Open (Value) Spaces
Derivation
Useful Datatypes
Other Datatypes
An Email Datatype for XForms
Using the Email Datatype
Complex Types
xsi:type
5. The XForms Model
Will the Real Data Model Step Forward?
Structural Elements
Common Attributes
Binding Attributes—Single Node and Node-set
Model Item Properties
Making the Connection—Binding
With IDREFs
With XPath
Multiple Models
Multiple Instances
6. The XForms User Interface
Form Controls
input
secret
textarea
output
upload
range
trigger
submit
select1
select
Complex Lists
Common Markup
Interaction with Instance Data
Incremental
Grouping
Dynamic Presentation
switch and case
Repeating Line Items
repeat
Attribute Syntax
7. Actions and Events
XML Events
The Old Way
Listeners, Observers, and Handlers
Declarative Actions, Displacing Script
XForms Actions
XForms Events
Stages of XForms Processing
Useful Events
Less-Useful Events
Error Handling
8. Submit
When to Submit
What to Submit
Where and How to Submit
URI Scheme and Method
Serialization Formats for Data Submission
What Happens After Submit?
The submission Element
Review: Submission Options
Security and Privacy Concerns
9. Styling XForms
CSS, Level 3
The Appearance Property
Aligning Form Controls and Labels
Styling Invalid Form Controls
Styling Required Form Controls
Styling Alert Messages
Styling Repeating Items
Styling Non-Visible Items
10. Form Accessibility, Design, and Troubleshooting
Basics of Accessibility
W3C Accessibility Guidelines
Form Design Patterns
Stepwise XPath
Design by Buddy System
XML Localization
XForms-specific Design Hints
Always Include Keyboard Navigation Hints
Always Use P3P Datatypes
Don't Use a Form for Navigation
Concatenating a Currency Symbol or Special Character
Server-Side Database Lookups
Reliably Submitting the Form with Enter
Refresh-on-Demand
Troubleshooting
Stubborn Read-only Controls
Context Node Problems
XForms Portion of Document Not Recognized
Schema or Validation Errors
Making the Switch to XForms
Client-Side and Server-Side XForms
The Featherweight Client
The Scriptable Client
The Modern Browser Client
Client-Side Options
11. Extending XForms
The Cost of Extensibility
Extension and mustUnderstand
Ways to Extend
With Script
With New Datatypes and Libraries
With XPath Extension Functions
With New Form Controls
With XForms Actions
With Custom Events
With New Serialization Formats
A. Examining Microsoft InfoPath
How Does It Work?
Similar, Different
A Real-World Example
Conclusion
B. The GNU Free Documentation License
GNU Free Documentation License
0. Preamble
1. APPLICABILITY AND DEFINITIONS
2. VERBATIM COPYING
3. COPYING IN QUANTITY
4. MODIFICATIONS
5. COMBINING DOCUMENTS
6. COLLECTIONS OF DOCUMENTS
7. AGGREGATION WITH INDEPENDENT WORKS
8. TRANSLATION
9. TERMINATION
10. FUTURE REVISIONS OF THIS LICENSE
Addendum: How to use this License for your documents

List of Figures

1.1. Rendering of a single-line text input
1.2. Rendering of a multi-line text control
1.3. Rendering of a password control
1.4. Rendering of submit and reset controls
1.5. Rendering of a button control
1.6. Rendering of a radio button group
1.7. Rendering of a checkbox group
1.8. Rendering of a single-select control
1.9. Rendering of a multiple-select control
1.10. Rendering of a file select control
1.11. Rendering of a fieldset
1.12. Rendering of a typical XHTML form
2.1. An XML purchase order being created with XForms
2.2. The user interface rendered for date, currency type, and total amount
2.3. The user interface for the XForms switch element, collapsed
2.4. The user interface for the XForms switch element, expanded
2.5. The user interface for repeating line items
2.6. The user interface to finalize the purchase order
3.1. A basic XML document, represented as nodes in the XPath data model
3.2. Location paths and steps
3.3. Node-set filtering with predicates
6.1. Input form controls rendered with X-Smiles
6.2. Secret form control rendered with OXF
6.3. Textarea form control rendered with the IBM XML Forms Package
6.4. Output form control rendered with DENG
6.5. Upload form control rendered with FormsPlayer
6.6. Range form control rendered with FormsPlayer
6.7. Submit form control rendered with Xero
6.8. Select1 form control rendered with nForms
6.9. Select form control rendered with Novell XForms Technology Preview
6.10. Tabbed interface demonstrating the switch element
6.11. Repeating line items in X-Smiles
7.1. Event propagation
7.2. XForms Action: message
7.3. Stages of XForms processing
9.1. The CSS box model
9.2. Styling a form control with a pseudo-element
9.3. Form control alignment
9.4. Invalid form control
9.5. Invalid form control, with pseudo-element styling
9.6. Required form control
9.7. Alert messages
9.8. Repeating items, with one active
9.9. Controlling display of non-relevant form controls
10.1. The unreliable effects of the Enter key
A.1. InfoPath design-time
A.2. Completing an InfoPath form

List of Examples

1.1. XHTML code for a single-line text control
1.2. XHTML code for a multi-line text control
1.3. XHTML code for a password control
1.4. XHTML code for submit and reset controls
1.5. XHTML code for a button control
1.6. XHTML code for a radio button group
1.7. XHTML code for a checkbox group
1.8. XHTML code for a single-select control
1.9. XHTML code for a multiple-select control
1.10. XHTML code for a file select control
1.11. XHTML code for a hidden control
1.12. XHTML code for a fieldset
1.13. XHTML code for a typical XHTML form
1.14. A poll form implemented in XForms,"lazy author" style
2.1. An XML purchase order using UBL
2.2. Opening lines of an XForms document
2.3. Starting the XForms Model
2.4. The rest of the XForms Model
2.5. XForms markup for date, currency type, and total amount
2.6. XForms markup for addresses
2.7. Using XForms to create an expandable list.
2.8. XForms markup to submit the data
3.1. Some XPath expressions
3.2. A basic XML document, represented as text
6.1. Sample markup for an input control
6.2. Sample markup for a secret control
6.3. Sample markup for a textarea control
6.4. Sample markup for an output control
6.5. Sample markup for the upload control
6.6. Sample markup for a range control
6.7. Sample markup for a trigger control
6.8. Sample markup for the submit control
6.9. Sample markup for the select1 control
6.10. Sample markup for the select control
8.1. Submit processing of relevant nodes
8.2. Serialization of namespace nodes
9.1. Sample CSS from the XForms specification
9.2. Using the appearance attribute to fine-tune how form controls render
9.3. CSS to align form controls and labels
9.4. Aligned form controls and labels
9.5. Style rule for invalid form controls
9.6. Improved style rule for invalid form controls
9.7. Style rule for required form controls
9.8. Style rules to selectively display an error message
9.9. Style rules for repeating items
9.10. Style rule for the current repeat item