Manage user input with XForms

Manage user input with XForms


XML Developer Tip
(Receive this column in your inbox,
click Edit your Profile to subscribe.)

Manage user input with XForms
Ed Tittel

The comment period on

    Requires Free Membership to View

    When you register, you'll begin receiving targeted emails from my team of award-winning writers. Our goal is to keep you informed on recent service-oriented architecture (SOA) and SOA-related topics such as integration, governance, Web services, Cloud and more.

    Hannah Smalltree, Editorial Director

    By submitting your registration information to SearchSOA.com you agree to receive email communications from TechTarget and TechTarget partners. We encourage you to read our Privacy Policy which contains important disclosures about how we collect and use your registration and other information. If you reside outside of the United States, by submitting this registration information you consent to having your personal data transferred to and processed in the United States. Your use of SearchSOA.com is governed by our Terms of Use. You may contact us at webmaster@TechTarget.com.

the latest working draft of the W3C's XForms 1.0 recommendation is over, so it's just a matter of time now before XForms is finalized and this work becomes available for developers to use in soliciting user input within XML documents. This is great news, because XForms offers a much more straightforward and powerful way to handle user input than the combination of forms-related HTML markup and related JavaScript or other controls used on typical Web pages today. For a look at the latest official information on XForms, please visit www.w3.org/MarkUp/Forms/.

That said, some understanding of how XForms actually works is probably worth providing. A simple bulleted list is all that it takes to tick off the high points:

  • XForms works in concert with XPath to navigate XML source documents
  • XForms also works in concert with XSLT to process forms processing and related instructions
  • XForms includes markup to manage both large and small amounts of input (<input> and <textarea>), to control entry of confidential or private data (<secret>), to manage display of document contents (aka "instance data"; <output>), to handle value selections from a range of inputs (<range>), to upload files or device data (<upload>), to incorporate form events (<trigger>), to submit form data for server-side processing (<submit>), and to select values from a set of one or more legal options (<select1> and <select>).
  • XForms also supports a variety of input modes, to support all kinds of user input, not just from the keyboard but also from telephone keypads or other input devices.
  • XForms uses the XML event model to manage user interaction (for more information on this fascinating subject, see the XML Events page at www.w3.org/TR/xml-events/). These permit managing user focus, display of user messages, navigating within existing or new windows, changing instance data, forcing recalculation, revalidation, or screen refreshes, partial or complete submission of input data, and other display management functions.

When all these facilities are combined, content developers have direct access to all the functions that typically required scripting in the more limited HTML implementation.

This new outlook on managing user input and interaction in XML documents promises to make it much easier and more straightforward for content developers to build and manage dynamic XML documents. Even better, this approach promises to reduce if not eliminate the browser dependencies that have plagued earlier HTML-based implementations—as soon as the majority of Web browsers become fully XML-enabled that is. In the meantime, it's worth taking the time to get to know and learn how to use this powerful new specification, which should help reduce a major cause of Web chaos. Happy XML coding!

For more information on this topic, please check out Micah Dubinko's excellent story "What are XForms" at XML.com at www.xml.com/pub/a/2001/09/05/xforms.html.


About the Author

Ed Tittel is a principal at LANWrights, Inc., a network-oriented writing, training, and consulting firm based in Austin, Texas. He is the creator of the Exam Cram series and has worked on over 30 certification-related books on Microsoft, Novell, and Sun related topics. Ed teaches in the Certified Webmaster Program at Austin Community College and consults. He a member of the NetWorld + Interop faculty, where he specializes in Windows 2000 related courses and presentations.


For More Information:

  • Looking for free research? Browse our comprehensive White Papers section by topic, author or keyword.
  • Are you tired of technospeak? The Web Services Advisor column uses plain talk without the hype.
  • For insightful opinion and commentary from today's industry leaders, read our Guest Commentary columns.
  • Hey Codeheads! Start benefiting from other time-saving XML Developer Tips and .NET Developer Tips.
  • Visit our huge Best Web Links for Web Services collection for the freshest editor-selected resources.
  • Choking on the alphabet soup of industry acronyms? Visit our helpful Glossary for the latest lingo.
  • Visit Ask the Experts for answers to your Web services, SOAP, WSDL, XML, .NET, Java and EAI questions.
  • Discuss this issue, voice your opinion or just talk with your peers in the SearchWebServices Discussion Forums.

This was first published in November 2002

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.