O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

XForms: XML Powered Web Forms

Book Description

Praise for XForms: XML Powered Web Forms

“XForms is an exciting new technology for designing Web forms in an elegant and accessible way. Raman’s book provides strong motivations for flexibility in the design of human-machine interactions, and explains how to use XForms to this end in crystal-clear prose.”

         —Eve Maler
             XML Standards Architect, Sun Microsystems

“Interactive forms technology is the logical evolution of Web user interface design. XForms represents a significant leap forward in that evolution.”

         —Sean McGrath
             CTO, Propylon

“The greatest strength of this book is the skill with which T. V. Raman links the XForms technology with the larger context of the Web. The limitations of HTML forms, the ways in which XForms provides a better foundation for Web and Web service user interfaces, and the opportunities for an XForms-powered Web that is accessible to all users and devices are outlined and brought together in a compelling way.”

         —Michael Champion
             Advisory Research and Development Specialist, Software AG

“Raman’s book gives the reader an excellent explanation of the emerging W3C XForms recommendation. It’s a well-organized and well-written book that begins with a gentle introduction to the concepts that motivated the development of XForms and then provides a reasonable overview of the relevant XML technology related to XForms. Most of the book covers XForms components: user interface controls, model properties, functions, actions, and events. It concludes with XForms as a Web service, offering multi-modal access and accessibility. In light of the October 2003 deadline for U.S. federal agencies to comply with the mandate of the Government Paperwork Elimination Act (GPEA) to give citizens the opportunity to provide information online, this important technical work comes none too soon. As T. V. masterfully elucidates, XForms provides the ‘last mile’ in ‘connecting users to their data.’ Insightfully, he also observes ‘the document is the human interface’ to data—an understanding without which the challenge to make eGov services ‘citizen-centered’ simply cannot and will not be met.”

         —Owen Ambur
             Cofounder and Cochair, XML Working Group, U.S. CIO Council

“I found the author’s straightforward style quite comfortable and informative. I heartily recommend this book, especially for government XML developers interested in the broader area of E-Forms. Understanding XForms is key to developing robust and flexible E-Forms solutions that separate content, logic, validation, and presentation. You’ll never look at (X)HTML forms the same way after reading Raman’s book.”

         —Kenneth Sall
             GSA eGov Technical Architect/XML Specialist, SiloSmashers

“Reusable components such as E-Forms are at the heart of the U.S. Federal Enterprise Architecture and E-Government, and XML standards-based solutions are starting to appear for use across the government. T. V. Raman’s book meticulously explains how XForms leverage the power of using XML for E-Forms and have been designed to abstract much of XML’s functionality into a set of components referred to as MVC (Model, View, Controller), which separates the model from its final presentation. This XForms component architecture serves as an excellent roadmap for the reader. T. V. eloquently shows how XForms make the original promise of ‘the document is the interface’ a reality so the collected data can be directly submitted to a Web service—thus putting a human face on Web services!”

—Brand Niemann, Ph.D., Chair, XML Web Services Working Group, U.S. CIO Council

XForms—XML-powered Web forms—are set to replace HTML forms as the backbone of electronic commerce. XForms enable the creation and editing of structured XML content within a familiar Web browser environment, which is likely to play a key role in enabling simple browser-based access to Web services. XForms leverage the power of XML in modeling, collecting, and serializing user input. In this book, World Wide Web Consortium (W3C) XForms specification editor T. V. Raman explains how programmers can create durable and dependable feature-rich forms accessible from multiple platforms and devices and available in multiple languages and modes.

XForms play a key role in connecting humans to information technologies, deployed as Web services. This book begins by providing an overview of the XForms technology and the set of XML standards on which it is built, including XML Path Language (XPath), Dom2 events, XML events, XML namespaces, and XML Schema. Part II profiles the XForms architecture and its components. An introduction to the available user interface controls leads into a guide to creating complex user interfaces. The following chapters describe XForms model properties, functions, actions, and events. Each chapter’s increasingly complex examples illustrate the concepts discussed. The final part of the book details how XForms will be used to create a new generation of human-centric, multimodal, accessible Web transactions.

Readers will learn:

  • Why XForms can deliver better user interaction at less cost

  • How the XForms technology works

  • What comprises the XForms architecture

  • How to use XForms to connect users to Web services

  • How XForms can accommodate spoken and visual interaction

  • How to ensure universal accessibility to Web content with XForms

  • XForms will transform the way companies and consumers handle Web transactions. XForms: XML Powered Web Forms provides Web developers, IT professionals, and Web server administrators with a firm grasp of this standard, how it will shape emerging solutions, and how it will change the nature of their day-to-day work.

    Table of Contents

    1. Copyright
      1. Dedication
    2. Praise for XForms: XML Powered Web Forms
    3. List of Figures
    4. List of Tables
    5. Preface
    6. Acknowledgments
    7. How to Read This Book
      1. Welcome to XForms
      2. XForms Components
      3. XForms and the Next Generation Web
      4. Typographical Conventions
    8. I. Welcome to XForms
      1. 1. XML Powered Web Forms
        1. 1.1. Background
        2. 1.2. A Simple Web Application
          1. 1.2.1. Questionnaire Form
          2. 1.2.2. Developing the Web Application
          3. 1.2.3. Developing the User Interface
          4. 1.2.4. A More Sophisticated Implementation
        3. 1.3. XForms Components
          1. 1.3.1. XForms Overview
          2. 1.3.2. XForms Model
          3. 1.3.3. XForms User Interface
          4. UI Control Input
          5. UI Control select1
          6. 1.3.4. XForms Submit
          7. 1.3.5. The Complete XForms Questionnaire
          8. 1.3.6. Deploying the XForms Questionnaire
        4. 1.4. Summary of XForms Benefits
          1. 1.4.1. XForms Features
        5. 1.5. XForms at a Glance
      2. 2. Standard Building Blocks
        1. 2.1. Introduction
        2. 2.2. XPath: XML Path Language
          1. 2.2.1. Location Paths
          2. 2.2.2. Location Path Syntax
          3. 2.2.3. Variables, Functions, and Expression Evaluation
        3. 2.3. DOM2 Events
          1. 2.3.1. Introduction to DOM Events
          2. 2.3.2. XML Events
        4. 2.4. XML: Extensible Markup Language
          1. 2.4.1. Encapsulating Structured Data Using XML
          2. 2.4.2. Namespaces for Compartmentalizing XML Data
        5. 2.5. XML Schema
          1. 2.5.1. Schema Built-in Types
          2. 2.5.2. Extending Built-in Types
          3. 2.5.3. Defining Aggregations Using Complex Types
        6. 2.6. XForms Implementations
          1. 2.6.1. X-Smiles: An Open Source XML Browser
          2. 2.6.2. Novell XForms Preview
          3. 2.6.3. FormsPlayer—XForms for Internet Explorer
          4. 2.6.4. IBM XForms Preview
        7. 2.7. XML Standards at a Glance
    9. II. XForms Components
      1. 3. XForms User Interface Controls
        1. 3.1. XForms User Interface Design
        2. 3.2. Common Aspects of XForms Controls
          1. 3.2.1. Anatomy of a User Interface Control
          2. 3.2.2. Binding Controls to the Model
          3. 3.2.3. Rendering User Interface Controls
            1. Common Presentation Attributes
            2. Common Presentation Child Elements
          4. 3.2.4. Interaction Behavior of Form Controls
            1. Common Interaction Attributes
            2. Common Interaction Child Element
        3. 3.3. Collecting Text Input
          1. 3.3.1. Customizing Input Controls
        4. 3.4. Selecting from a Set of Values
          1. 3.4.1. Types of Selection Controls
          2. 3.4.2. Open and Closed Selections
          3. 3.4.3. Default Selection
          4. 3.4.4. Selections Using Static Choices
          5. 3.4.5. Dynamic Selections
          6. 3.4.6. Selecting XML Structures
          7. 3.4.7. Grouping Available Choices
          8. 3.4.8. Rendering Selection Controls
        5. 3.5. Selecting from a Range of Values
        6. 3.6. Uploading Data
        7. 3.7. Triggering Actions
          1. 3.7.1. Anatomy of Element 〈trigger〉
        8. 3.8. Submitting Data
          1. 3.8.1. Anatomy of Control 〈submit〉
          2. 3.8.2. Modeling What, How, and Where to Submit
          3. 3.8.3. Anatomy of Element 〈submission〉
            1. What to Submit
            2. Where to Submit
            3. How to Submit
          4. 3.8.4. Using Element 〈submission〉
          5. 3.8.5. Submit Round-up
        9. 3.9. XForms Controls at a Glance
      2. 4. Creating Complex User Interfaces
        1. 4.1. Aggregation Using 〈group〉
          1. 4.1.1. Labeling Groups
          2. 4.1.2. Navigating among Groups
          3. 4.1.3. Groups and Binding Expressions
        2. 4.2. Dynamic User Interaction with 〈switch〉
          1. 4.2.1. Anatomy of Construct 〈switch〉
          2. 4.2.2. A Simple Example of 〈switch〉
          3. 4.2.3. Model and Interaction-Based Switching
          4. 4.2.4. Creating Multipage Tab Dialogs Using 〈switch〉
          5. 4.2.5. Creating Wizards Using 〈switch〉
        3. 4.3. Repeating Structures with 〈repeat〉
          1. 4.3.1. Designing Construct 〈repeat〉
          2. 4.3.2. Anatomy of Construct 〈repeat〉
            1. Attributes of Construct 〈repeat〉
            2. Child Elements of 〈repeat〉
          3. 4.3.3. Shopping Cart Using Construct 〈repeat〉
            1. Shopping Cart Model
            2. Shopping Cart User Interface
          4. 4.3.4. Adding Controls to the Shopping Cart
            1. Event Handlers for Use with 〈repeat〉
            2. Add, Delete, and Scroll Controls
          5. 4.3.5. User Interaction with Construct 〈repeat〉
          6. 4.3.6. Using Construct 〈repeat〉 within XHTML Tables
          7. 4.3.7. Summary of Construct 〈repeat〉
        4. 4.4. Complete Example of an XForms User Interface
          1. 4.4.1. Defining the Structure of the Task List
          2. 4.4.2. Declaring the Task List Instance
          3. 4.4.3. Declaring the Data Model within XHTML 〈head〉
          4. 4.4.4. Creating the User Interface Via Nested Repeats
          5. 4.4.5. Binding User Interface Controls to the Task List
          6. 4.4.6. Adding a Toolbar for Navigation
          7. 4.4.7. Putting It Together inside an XHTML Page
          8. 4.4.8. Submitting the Task List
        5. 4.5. XForms User Interface at a Glance
      3. 5. XForms Model Properties
        1. 5.1. Introduction
          1. 5.1.1. Model Properties and CSS Style
          2. 5.2. Attaching Constraints Via Element 〈bind〉
        2. 5.3. Property relevant for Model-based Switching
          1. 5.3.1. Insurance Form Using Model-based Switching
        3. 5.4. Property required for Mandatory Fields
          1. 5.4.1. Extending Insurance Form with Property required
        4. 5.5. Property readonly for Controlling Changes
          1. 5.5.1. Conditional Editing Using readonly
        5. 5.6. Property constraint for Dynamic Validation
          1. 5.6.1. Constraining Travel Dates Using constraint
        6. 5.7. Constraining the Number of Permitted Entries
        7. 5.8. Property calculate for Dynamic Computation
          1. 5.8.1. Examples of Property calculate
        8. 5.9. Augmenting Schemas with Type Constraints
        9. 5.10. Declaring Privacy Level Via P3P
        10. 5.11. XForms Model Properties at a Glance
      4. 6. XForms Functions
        1. 6.1. Introduction
        2. 6.2. Boolean Functions
          1. 6.2.1. Function boolean-from-string
          2. 6.2.2. Function if
        3. 6.3. Number Functions
          1. 6.3.1. Computing Minimum, Maximum, and Average
          2. 6.3.2. Function index for Addressing 〈repeat〉 Structures
          3. 6.3.3. Function count-non-empty
        4. 6.4. String Functions
        5. 6.5. Date-time Functions
          1. 6.5.1. Function now
        6. 6.6. Node-set Functions
          1. 6.6.1. Binding Expressions: The Full Story
        7. 6.7. XForms Functions at a Glance
      5. 7. XForms Actions
        1. 7.1. Introduction
        2. 7.2. Declarative Event Handlers
          1. 7.2.1. Action 〈setfocus〉
          2. 7.2.2. Action 〈setvalue〉
          3. 7.2.3. Action 〈load〉
          4. 7.2.4. Action 〈send〉
          5. 7.2.5. Action 〈reset〉
          6. 7.2.6. Action 〈message〉
          7. 7.2.7. Action 〈action〉
          8. 7.2.8. Action 〈dispatch〉
          9. 7.2.9. Invoking XForms Processing
          10. 7.2.10. Actions 〈insert〉, 〈delete〉, and 〈setindex〉
        3. 7.3. XForms Actions at a Glance
      6. 8. XForms Events
        1. 8.1. Introduction
        2. 8.2. Initialization Events
        3. 8.3. Interaction Events
          1. 8.3.1. XForms Processing Events
          2. 8.3.2. Navigation Events
          3. 8.3.3. Help Events
          4. 8.3.4. Submit and Reset
        4. 8.4. Notification Events
          1. 8.4.1. Setting Values
          2. 8.4.2. Select and Deselect Notifications
          3. 8.4.3. Interacting with Repeat Collections
          4. 8.4.4. Listening for Changes in State
          5. 8.4.5. Submit Notifications
        5. 8.5. XForms Events at a Glance
    10. III. XForms and the Next Generation Web
      1. 9. Connecting the User to Web Services
        1. 9.1. A Human-centric View of Web Services
          1. 9.1.1. XForms Access to Weather Service
        2. 9.2. Connecting Users to Their Data
          1. 9.2.1. Leveraging XML for Collecting Information
          2. 9.2.2. XForms Collect Structured Data
        3. 9.3. Creating Personalized Information Views
          1. 9.3.1. What Is a Portal?
          2. 9.3.2. Content Syndication Using RSS
          3. 9.3.3. UI Syndication Using WSRP
        4. 9.4. XForms Web Services at a Glance
      2. 10. Multimodal Access
        1. 10.1. Multimodal Interaction for Ubiquitous Access
          1. 10.1.1. Multimodal Access
        2. 10.2. Multimodal User Interface Principles
          1. 10.2.1. Multiple Modalities Need to Be Synchronized
          2. 10.2.2. Multimodal Interaction Should Degrade Gracefully
          3. 10.2.3. Multiple Modalities Should Share a Common Interaction State
          4. 10.2.4. Multimodal Interfaces Should Be Predictable
          5. 10.2.5. Multimodal Interfaces Should Adapt to Users Environment
        3. 10.3. Creating Multimodal Interfaces Using XForms
          1. 10.3.1. One Model to Bind Them All
          2. 10.3.2. Abstract Controls Enable Flexible Access
          3. 10.3.3. XForms UI Creates Synchronized Views
          4. 10.3.4. XML Events Enable Rich Behavior
        4. 10.4. Multimodal Interaction at a Glance
      3. 11. XForms and Accessibility
        1. 11.1. XForms Enables Universal Access
        2. 11.2. Design Principles for Accessible Interfaces
          1. 11.2.1. Content Should Encapsulate Relevant Metadata
          2. 11.2.2. Separate Content from Layout and Presentation
          3. 11.2.3. Ensure That Content Can Be Refactored
          4. 11.2.4. Ensure That Rich Content Degrades Gracefully
          5. 11.2.5. Avoid Device-specific Events
          6. 11.2.6. User Interfaces Should Exhibit Predictable Behavior
          7. 11.2.7. Allow for Late Binding of Interaction Behavior
          8. 11.2.8. Enable Centralized Event Handling
          9. 11.2.9. Raise Notification Events for Key State Changes
          10. 11.2.10. Provide Hooks for Attaching Special Behavior
          11. 11.2.11. Use Declarative Handlers in Favor of Scripts
        3. 11.3. Leveraging XForms Accessibility Features
          1. 11.3.1. XForms Creates Accessible Content
          2. 11.3.2. Accessibility in Style
          3. 11.3.3. Accessibility through Eventing
          4. 11.3.4. User Agent Guidelines for Leveraging XForms Accessibility
          5. 11.3.5. Accessing XForms Features from Adaptive Technologies
        4. 11.4. XForms Accessibility at a Glance
    11. Colophon
    12. Bibliography
    13. CD-ROM Warranty