# XForms/Print version

The current, editable version of this book is available in Wikibooks, the open-content textbooks collection, at
https://en.wikibooks.org/wiki/XForms

# Guest Registry

We would like to know who is using this cookbook. Please tell us all little about yourself:

## Template Organization-Name

* Contact Name:
* Organization:
* Location:
* Use: How are you using the book?
* Like: What did you like the most about the XForms Tutorial and Cookbook? What samples were the most useful?
* Improve: What would you like to see improved in the book? What new examples would you like?

## County Community College

* Name: County Community College
* Location: New Jersey
* Use: Teaching yourself, teaching others, college classroom, high school etc.
* Like:
I am looking for a working examples that my students could use to build their own XForms applications. I will be using the example in this book to help my students learn about XForms.

## US Federal Agency

* Name: Federal Agancy
* Location: Washington DC
* Use: Teaching our staff how to build XRX applications and manage TEI documents
* Like: Working progams
* Improve: More sample document workflow application

## Minnesota Department of Revenue - Property Tax Division

* Name: Dan McCreary
* Location: St. Paul Minnesota
* Use: We are using the cookbook to learn XForms and build property taxation form.
* Like: We like XForms because we can generate them from XML Schemas and we don't need any Java or C# or VB to when we use the eXist native XML database
* Would Like: We would like more examples that use XML Binding (XBL)

## A Financial Institution

* Location: Minneapolis Minnesota
* Use: We use the cookbook to teach internal staff how to build an maintain forms
* Like: Small working examples. The links are great.
* Would Like: Examples of process management forms and Schematron rules engines using XForms

## ZheJiang, China

* Name: zhouliyi
* Location: ZheJiang,China
* Use: We are using the cookbook to share XForms examples and document our best practices.
* Like: XForms is great for creating prototypes of our forms.
* Would like: How you create XForms by transforming a source XML Schema information would be very nice.
* Example: Examples that integrate with databases would be great.

## NIC - Open Technology Centre

* Contact Name: Rajamani M
* Organization: NIC - Open Technology Centre
* Location: India
* Use: We are using the cookbook to share XForms , XRX examples and
developing sample applications.
* Like: We like the XRX sample with Database connected
* Improve: More examples to expand the concept in each element and functions

## Drybridge Consulting

* Contact Name: Arthur Colman
* Organization: Drybridge Consulting
* Location: Boston, MA USA
* Use: Using the cookbook to upgrade our implementation of XForms and to share examples.
* Like: The broad range of examples.

## Xerox

* Contact Name: Jacob Woodworth
* Organization: Xerox
* Location: Rochester, NY
* Use: Implementation using XForms.
* Like: The examples I've seen here are the best I've found on the Web.
* Improve: TBD

## Grant Solutions

* Organization: Grant Solutions
* Location: Rockville Maryland
* Use: Teaching developers and BAs to use XForms (Orbeon)
* Like: Beginning guides
* Improve: more materials on binds and submission

## Send us a Postcard!

If you really like the book please send a postcard to:
It would be very much appreciated!

# Naming Conventions

Here are some naming conventions used for this WikiBook. These naming conventions are designed to be consistent across the sample programs, allowing our students to be able to copy and paste blocks of code from the sample programs with a minimum amount of reformatting. So even though it may be a little bit annoying to have the xf: prefix on the XForms data elements, it does make it easy for students to quickly build new applications from the samples.
The audiences for much of this material are state and federal agencies that are converting paper forms to electronic forms. As a result we tend to use the XML Naming and Design Guidelines used by these organizations. Since these standards are built around ISO/IEC-11179 and other ebXML standards, they should not be too strange to most business developers.
There are over 150 of "Naming and Design Rule" guidelines but we don't need to use them all. A web site that discusses them is the Component Organization and Registration Environment web site.
Here are some guide lines to start out with:

## Indentation

Please use three space characters to indent your examples. MediaWiki does not allow us to set tab stops and by default they are 8 characters.

## Wrap XML Code in Source Tags

Please enclose all your sample XML code with the source tags with the lang="xml" attribute like this:

## Namespace Standards

Namespaces are core to XForms today and essential for our examples to work under a large number of diverse platforms. Please take some time to think carefully about namespaces and namespace prefixes.
Please use the following template at the head of your example:
Note that the first line:
indicates that the file uses XHTML as its default namespace. Any tags that do not have a namespace prefix are by default elements in the xhtml namespace.
We feel that keeping the examples in this default namespace will make students familiar with HTML more at home with XForms. Standard tags such as <h1>, <p>, <b> and <i> can be freely used in all our examples.
You can optionally add the XML processing instruction before the <html> tag:
but most XForms systems do not need this. Any file that has a file extension of ".xhtml" implicitly implies that it is an XML file.

## Warnings about DOCTYPE

Please do not put the !DOCTYPE tag in the header for xhtml1-strict.dtd. This specifically states that the file ONLY contains XHTML and most systems will not allow XForms tags when they see this. Many example programs have this and it should be removed to be correct.

## XForms Player Specific Markup

Please do not put any player-specific markup in the examples. This book is about W3C standards, specifically XForms, CSS, XML Schema and XHTML. These examples should not require a specific implementation of a client forms player. If you are working with a specific player that does require special HTML tags, they can be automatically inserted by the web application server using an XML transform. This allows these examples to be used in a wide variety of classroom environments and by a large number of server and client XForms players.
For a general template see XForms/Template
For player specific instructions see Player Specific Instructions.

## List of Example Program Naming Conventions

* Use a separate namespace for HTML, XForms controls and Data.
* Give HTML the default namespace. This makes it easy to take existing XHTML code and use it in the examples
** If it is not possible to give HTML a default namespace, give it a namespace prefix that is short, such as "h".
* Use the "xf" namespace prefix for XForm elements. I find about 3/4 of the examples use this already but some use the full "xform" or "xforms" prefix. I suggest avoiding the confusion and just use "xf" since it is short and in common use already.

## Examples for US State and Federal Agencies

It is our hope that many US state and federal agencies may integrate this material into their training programs. This is an important audience for XForms since much of the XForms standards were promoted by agencies that did not allow JavaScript to be executed on their desktops for security reasons.
The namespace that we are using for most of our federal data model examples is the NIEM. The namespace prefix is "u" for "Universal" data elements for things like Address, Contact, Activity, Documents, Organizations, Person. The NIEM also has a very nice sub-schema generator that works very well with the process of building forms. See the niem.gov web site for more information on this. If you have any suggestions on any better tools then the NIEM tools, please let us know.

# Examples Wanted

Here are some examples were are still looking for:

## Examples Wanted

Here is list of the example progams we are looking for in rough order of priority (highest priority examples are first)
* Example to format currency - We would like an example that formats based on numeric picture formats such as "$#,###.##".
* Validate Field by Character Set - We would like to validate a field base on a pattern character set. So for example we would like to mark a field invalid if it has special characters such as non-alpha or non-numerics. How do you specify this in a binding rule? Can you bind it to an XML Schema data type?
* Full CRUD Example on dynamic file Demonstrate the full create, read, update delete (CRUD) cycle for some form data selected from a file local file system. The example load the form data from a file (use the upload control) into an instance document and (similar to using the src="" attribute), view the data, edit the data and save the data back to a file using a submit to a file. For doing this on a static file see Read and write with get and put
* Display required elements from Schema - A XML Schema file can tell you exactly what fields are required (if the minOccurs is not zero). Demonstrate how these fields can be automatically be displayed using CSS and the :required pseudo element
* Instance validation - An example based on an external XML schema. Validate an instance using the XML Schema file. Validate
* XMLEvents Demonstrate how XML Events work with event propagation. Show how events bubble up the event responder tree.
* Use industry standard forms (IRS tax forms, ACORD insurance forms etc).
* A XForms example incorporating XML Signing in XHTML preferably with digital filters too.
* Full CRUD Example using any Database Demonstrate the full create, read, update delete (CRUD) cycle for some form data selected from a database. The example load the form data from a database into an instance document and (similar to using the src="" attribute), view the data, edit the data and save the data back to a database using a submit

## Non FireFox Examples

FireFox does not have Pseudo_element_support for ::value, ::repeat-item, and ::repeat-index. See Pseudo element support in FireFox Are their any other systems that will support this that we can get examples from?

## Finished Examples

* Get information from an XHTML web page - use the instance src to extract a value from an XHTML file. See Read and write with get and put
* Web Service Examples using REST - Examples of calling a web service using the simplified REST protocol where web service arguments are just passed in a URL. See XForms/Search flickr and XForms/Search Amazon
* Call a web service from a form using the submit command. We would like an example that does not require the students to register to use a web service. See Web service
* XForms/Load from XML Schema - Load an XML Schema and use the data types in the XML Schema to validate data types in a form.
* Facet Validation - We would like to have a family of example programs that validate based on the facets of an XML Schema file but it appears that the FireFox extension does not yet support facet validation (restrictions based on length, minLength, maxLength, etc) so this is somewhat difficult to demonstrate easily in a classroom setting when the students are just running the FireFox browser.
* Set textarea size. Use the CSS to set the area of a textarea size differently of many boxes. See Textarea with style

# Book Statistics

Here is a link that has some statistics on this Wikibook:
XForms Book Statistics

## Current Stats
### December 2010

162 chapters, 885 edits, size 1.2 kB, 39906 words, 71 registered authors

## Past Statistics
### October 2009

147 chapters, 1133 edits, size 1.2 kB, 38664 words, 76 registered authors

### April of 2009

141 chapters, 885 edits, size 3.2 kB, 34874 words, 62 registered authors

### In March of 2008

116 chapters, 626 edits, size 214 , 28811 words, 29 registered authors

### 2006

Book Created

# Introduction
## Introduction to XForms

XForms is a standardized set of HTML form elements, designed to be integrated with other world-wide-web standards.
XForms has many advantages over traditional HTML web forms that use complex JavaScript. These advantages include:
* an elegant Model-View-Controller (MVC) architecture
* a movement toward declarative programming which is easier to learn, maintain and debug
* a rich set of user interface controls for handling complex things such as dates, numbers and ranges
* compatibility with XML standards such as Cascading Style Sheets (CSS), XML Schema and XPath
* extensibility
XForms can be run today from almost any web browser by either using an downloadable plugin or extension (such as the Firefox extension) or by loading a JavaScript file. For more information see the Benefits section of this book.

## About this book

This book is intended to be a tutorial and cookbook with many complete running XForms examples. The initial examples are designed to teach the fundamental concepts of XForms. The more advanced examples are designed to solve specific tasks and reduce the amount of JavaScript necessary to write high-quality forms.
We would like to have the examples ordered from simple to complex. At the end of the cookbook there are integration examples of how to extend and integrate XForms with other systems such as web services.
The philosophy behind this book centers around the fact that people often learn best by taking a fully-functioning program and making slight modifications to it to understand how it works.

## Guidelines for contributors

Please feel free to add your own examples to this tutorial and cookbook! Here are a few suggestions for contributors:

### Focus on Tutorial Examples

The first set of examples should focus on new XForms users. Please keep tutorials on foundational concepts (XPath and XML Schema) in a separate area so that users already familiar with these concepts can skip these sections.

### Focus on Reducing JavaScript

One of the goals of this book is to help forms developers move away from hard-to-maintain scripting languages such as JavaScript. Any examples that focus on getting rid of commonly used JavaScript functions are very much appreciated.

### Testing

Please tell us what XForms systems you have used to test your examples. If you can, we recommend testing using the major browsers (Internet Explorer and Firefox) using either an extension, plug-in or a JavaScript translator such as FormFaces. See also the Installing XForms in Firefox.
We would like to eventually have a small box in the upper right corner that tells what systems each example was tested under.

### Avoid Duplication

Try to avoid duplication with other example programs in this cookbook and other Wikibooks on CSS, XML Schemas and XPath. That being said, sometimes the cookbook needs small samples of CSS and XPath to demonstrate how they are integrated with XForms.

### Naming Conventions

Our first goal is to get as many complete working examples installed for new users of XForms. After they are working, they should hopefully be made as consistent as possible. This document describes an initial attempt at some of the naming conventions used in previous examples.

# Background
## Background

The XForms standard arose from the desire of many people to use the web for more than just linking documents. The original design of the world wide web standard introduced many innovative concepts including the URL, the HTML markup language and the HTTP protocol.
But innovation aside, elegant form processing was not one of the design goals of the initial HTML language. In fact, many of the advanced input fields were added to the HTML specification after it became popular.
One thing is clear: the introduction of clean MVC concepts were never part of the original HTML specification. Many attempts were made to introduce better controls into browsers and the HTML language, but most of these additions fell short for four reasons:
* They were either browser or vendor specific solutions to a specific problem
* They did not integrate mainstream developments in XML Schema, XPath and CSS
* They did not take into account the need for clear separation-of-concerns
* They did not meet the rigorous needs of application architects that understood the benefits of MVC architectures
As a result, many of these point-solutions have been discarded or have seen only niche use by some vendors.
Around 1997 the W3C started to address the concerns of these users and studied how web forms could be processed in a better way. They realized that validating data elements was a large concern and that re-inventing the validation tools already present in XML Schema would only duplicate efforts.
The first XForms draft specification was published on April 6, 2000. Since then it has been revised with the most recent version (1.1) appearing in March of 2006.
Today the XForms standard addresses several web forms development issues:
* Model-View-Binding architecture
* Advanced functionality
* Precise specification for all browsers to integrate
* Extensibility without resorting to JavaScript programming
* Built-in assumptions about how form elements get updated

## The Dependency Graph

Embedded within every XForms application is the ability to automatically recalculate values when a form element changes. If you have a complex form with calculation rules then this feature becomes critical for avoiding writing manual recalculation code. Most JavaScript forms libraries require the author to specify not only form rules, the order these rules must be executed. This slow and painful form-author-specified recalculation order is replaced in XForms by an automated method to determine the order of recalculation.
The way XForms applications do this is by doing automated determination of recalculation order based on optimal graph algorithms.
One of the most important papers about how XForms is designed come from the following paper:
The XForms Computation Engine: Rationale, Theory and Implementation Experience html version
If you have a simple form with just a few elements and no calculation rules, HTML forms might be a good solution for you. If you have forms with rules such as sum and total calculations in a purchase order, then XForms might be the ideal fit for your web form.
For the current working draft of the XForms specification you can go to the w3 web site:
W3C Candidate Recommendation 29 November 2007

# Benefits
## Why XForms?

There are many benefits to using XForms over traditional HTML forms. Some of the most frequently mentioned benefits are:

## Benefits of XForms

* Web Standard - XForms is a W3C standard and allows web applications to be created without lockin to any specific vendor such as Microsoft, Adobe or Apple
* Consistency with Other Standards - XForms was designed to be very consistent with other web standards such as CSS, XML Schema and XPath. If you know CSS then you can quickly learn how to style your XForms.
* Declarative - XForms is considered a declarative system in that it allows users to declare what they want the forms to do, not how to do it. Movement away from highly complex and primitive procedural JavaScript to advanced declarative styles is the principal way that non-programmers can participate in the forms development process.
* Less JavaScript - XForms allows the movement away from hard-to-maintain, difficult to debug and potentially insecure JavaScript
* Fewer "round trips" of pages being transferred from web server to web browser. This means that fewer web servers are needed in your DMZ and smaller bandwidth is needed between the client and the servers
* Clean and consistent use of MVC architectures
* Forms are easier to create, debug and maintain
* Forms can accommodate multiple languages and multiple currencies
* Forms have clear Separation of Concerns, meaning all your forms can share a common style sheet, model, bindings and presentation.
* Advanced user interface controls such as the XForms/Range control
* Extensibility of XForms (see XForms/Custom Controls)
* Allows the designer to focus on concrete business models and abstract user interfaces (attributed to Joern Turner)
The last point is very critical since business models are designed to be consistent with the business area that tend to be more constant over time. User interface technology on the other hand changes rapidly and must be highly contextual to a browser, browser version mobile device or tablet. This core philosophy of Separation of Concerns is one of the key elements to the philosophy of XForms and good human-machine interactions.

## Disadvantages of XForms

Just to be fair, we should also mention the disadvantages. Most of these problems are related to the newness of XForms and will be mitigated over time:
* Web browser limitations have made it difficult for XForms tools vendors to support all XForms tags in all browsers
* Slow performance on very-large forms - forms with over 200 fields sometimes can be slow to load on some older browsers
* Using non-native browser forms players such as XSLTForms require an initial download of around 100K of JavaScript, CSS and XSL files that can be slow, especially over slower dial-up lines. Note that these files are usually cached on the local hard drive so that the second time a form package is used the files do not have to be re-downloaded.
* Lack of understanding of XML - Many traditional HTML/JavaScript forms developers are not familiar with XML standards
* Few complete working XForms examples and applications exist (a problem which we are trying to correct with this book)
* Few high-quality and low-cost GUI forms builder tools exist today (with the exception of IBM's Workplace forms, OpenOffice Forms, Onyx Forms and few other tools)
You will note that most of the disadvantages of XForms are related to limitations of XForms clients, current browser shortcomings, or skills and training issues. There are few fundamental architectural disadvantages with XForms.

## Analysis of XForms Nay-sayers

When there is negative discussion about XForms we have found that most of the negative comments about XForms usually comes from people with one or more of the following attributes:
* They don't understand the role that standards play in lowering the cost of software development
* They are trying to promote a vendor-specific proprietary technology
* They have very little actual real-world XForms experience or have not had strong mentorship by an experienced XForms consultant
* They do not appreciate the architectural advantages of MVC-based systems and the use of dependency graphs
* They are focused on the limitations of one or more specific browsers or XForms products
* They are comparing XForms with a problem domain outside of the scope of XForms charter such as graphics or complex navigation controls

# XForms Client Options

There are several ways to get started using XForms. But we must first understand that running XForms within a web browser has several security-related issues that prevent software from saving to your local hard drive. There are several workarounds for this.
There are several XForms systems that can be used to build XForms. For example:
XSLTForms is a XForms implementation that can run within your browser or on the server. The client-based system run an XSLT transform within your browser.
BetterFORM is a server-side implementation of XForms that comes bundled with a native XML database (eXist-db).
There are JavaScript-based solutions and other plugins as well as web-server solutions available. See the Player Specific Instructions or the wikipedia page on XForms for more details. Note that these XForm solutions usually require you to download a web server and install Java Web Archive Files (War files) in the correct directory or add player-specific code to your examples.

## FireFox Plugin

The FireFox plugin has limited support on the Mac and may not be supported in current versions of FireFox.
One of the most common today is Installing XForms in Firefox. This takes only about a minute to install so it is used by many of our students. Most of these exercises have been tested with the Firefox 0.7 extension on both Firefox 1.5 and Firefox 2.0.
Firefox 3.6 plugin: xForms 0.8.7
Firefox 2.0 plugin: FireFox 2.0 for the Mac

## XForms Processors

XSLTForms uses XSLT and JavaScript in the browser to transform an XForms into HTML.
betterFORM processes XForms on the server with Java.
Orbeon Forms processes XForms on the server with Java.
All can be used with the eXist Native XML Database.
See also the Wikipedia article on XForms

# Naming Conventions

Here are some naming conventions used for this WikiBook. These naming conventions are designed to be consistent across the sample programs, allowing our students to be able to copy and paste blocks of code from the sample programs with a minimum amount of reformatting. So even though it may be a little bit annoying to have the xf: prefix on the XForms data elements, it does make it easy for students to quickly build new applications from the samples.
The audiences for much of this material are state and federal agencies that are converting paper forms to electronic forms. As a result we tend to use the XML Naming and Design Guidelines used by these organizations. Since these standards are built around ISO/IEC-11179 and other ebXML standards, they should not be too strange to most business developers.
There are over 150 of "Naming and Design Rule" guidelines but we don't need to use them all. A web site that discusses them is the Component Organization and Registration Environment web site.
Here are some guide lines to start out with:

## Indentation

Please use three space characters to indent your examples. MediaWiki does not allow us to set tab stops and by default they are 8 characters.

## Wrap XML Code in Source Tags

Please enclose all your sample XML code with the source tags with the lang="xml" attribute like this:

## Namespace Standards

Namespaces are core to XForms today and essential for our examples to work under a large number of diverse platforms. Please take some time to think carefully about namespaces and namespace prefixes.
Please use the following template at the head of your example:
Note that the first line:
indicates that the file uses XHTML as its default namespace. Any tags that do not have a namespace prefix are by default elements in the xhtml namespace.
We feel that keeping the examples in this default namespace will make students familiar with HTML more at home with XForms. Standard tags such as <h1>, <p>, <b> and <i> can be freely used in all our examples.
You can optionally add the XML processing instruction before the <html> tag:
but most XForms systems do not need this. Any file that has a file extension of ".xhtml" implicitly implies that it is an XML file.

## Warnings about DOCTYPE

Please do not put the !DOCTYPE tag in the header for xhtml1-strict.dtd. This specifically states that the file ONLY contains XHTML and most systems will not allow XForms tags when they see this. Many example programs have this and it should be removed to be correct.

## XForms Player Specific Markup

Please do not put any player-specific markup in the examples. This book is about W3C standards, specifically XForms, CSS, XML Schema and XHTML. These examples should not require a specific implementation of a client forms player. If you are working with a specific player that does require special HTML tags, they can be automatically inserted by the web application server using an XML transform. This allows these examples to be used in a wide variety of classroom environments and by a large number of server and client XForms players.
For a general template see XForms/Template
For player specific instructions see Player Specific Instructions.

## List of Example Program Naming Conventions

* Use a separate namespace for HTML, XForms controls and Data.
* Give HTML the default namespace. This makes it easy to take existing XHTML code and use it in the examples
** If it is not possible to give HTML a default namespace, give it a namespace prefix that is short, such as "h".
* Use the "xf" namespace prefix for XForm elements. I find about 3/4 of the examples use this already but some use the full "xform" or "xforms" prefix. I suggest avoiding the confusion and just use "xf" since it is short and in common use already.

## Examples for US State and Federal Agencies

It is our hope that many US state and federal agencies may integrate this material into their training programs. This is an important audience for XForms since much of the XForms standards were promoted by agencies that did not allow JavaScript to be executed on their desktops for security reasons.
The namespace that we are using for most of our federal data model examples is the NIEM. The namespace prefix is "u" for "Universal" data elements for things like Address, Contact, Activity, Documents, Organizations, Person. The NIEM also has a very nice sub-schema generator that works very well with the process of building forms. See the niem.gov web site for more information on this. If you have any suggestions on any better tools then the NIEM tools, please let us know.

# Comparison of XForms Products
## Motivation

You want to compare XForms browser products and understand each systems strengths and weaknesses.

## Method

We first identify key attributes of each product and justify why an attribute is relevant in a high-level comparison. We then present a table of the products with one column for each attribute.

### Key Attributes of XForms Product
#### License

What type of license is being used? Common options are Commercial (with link), Apache 2.0, LGPL, GPL or other. The column should always provide a URL to the exact license.

#### Cost Per 10 or 100 or 1,000 or 10,000 Users

What is the typical estimated costs for this product for between 10 and 10,000 users. Assume 10 medium-complexity forms used per person per day.

#### Client/Server/Both

Does the product convert the XForms code into browser-specific structures (HTML/JavaScript) on the client or the server?

#### Browsers Supported

What browsers are supported? Common items are All, C, F, I, O, S for Chrome, FireFox, IE, Opera and Safari.

#### XForms 1.1 Compatibility Tests

The W3C does provide a test suite for compatibility with the 1.1 specification. These test are rerun on a periodic basis.
Currently only a subset of products are being tested. The current test results are here

#### Version of XForms Supported

Options would be 1.0, 1.1

#### Status of XForms Compatibility Test

Did this product undergo a third party test of all of the features of XForms? If so, what percentage of the test pass. Provide a link to the test results.

## Comparison Table
### Client Side Applications

| Product (Version) | License | Cost | Implementation | Architecture | Browsers | Test Results | Strength | Weakness | Notes |
| EMC/Documentum | Commercial | See Documentum | Google Web Toolkit | Client | All | EMC Results | | |
| Chiba (3.0.0b2) | liberal BSD and Apache 2 | free | Client DOJO with DWR | | | 96% Chiba Results | | | |
| Ubiquity | Apache 2.0 | free | JavaScript | | All | Test Results | | Not mature | |
| Firefox Plugin | Open source | Free | Browser Plugin | Client | Firefox 3.5 and earlier only | | Very compliant with standard | Firefox only, Limited Table Support, Limited Support, No Mac Version | Innovative Product, Ideal for quick prototyping, Fast form loads for forms that do not have long selection lists |
| Formfaces | Commercial | | JScript and HTML - No plugin required | Client | | | | Very slow load times for medium forms, No large user base | No updates to product since 2007 |
| XSLTForms | LGPL | Free | XSLT Tranformation | Client or Server | All | | Transform works on either server or client, Bundled with eXist and MarkLogic | Not yet mature | See XRX Wikibook |
| Picoforms | Commercial | See Picoforms | IE Plugin | Client | Internet Explorer Only | | Ideal for internal forms for IE only sites | Support not clear, Required Admin rights to install Limited Community Support | |

### Server-Side Applications

(No XForms elements are sent to the client)
| Product (Version) | License | Cost | Implementation | Architecture | Browsers | Test Results | Strength | Weakness | Notes |
| XSLTForms | LGPL | Free | XSLT Tranformation | Client or Server | All | | Bundled with eXist and MarkLogic | Not yet mature |
| Orbeon Forms | Open source | Free | Server-side transforms | Server | All | | Very Mature, Many Extensions, Excellent Support, Active Community | Many examples require Orbeon Pipeline Language | |
| BetterFORM | BSD, Apache 2 | Free | Server-side transforms all written in Java | Server | All | Test Results | Very Mature, bundled with eXist, support for subforms, commercial support, active community, comes with graphical installer | | successor of Chiba Project |
| IBM Lotus Forms | Commercial | See IBM | Server-side transform | Server | All | | Full Implementation, Very Mature, IBM Supported | Price. Proprietary markup. | |

# HelloWorld
## Background and Motivation

Since K&R wrote the first book on C programming, it has become tradition for programming books to begin with a "Hello World" program. Running this program will indicate if you have XForms installed correctly.
Here is a sample "hello world" program in XForms. It uses one input, one variable in the model, and one output. You should be able to just copy and paste the text into a program such as Notepad and save it to a file such as hello.htm. This will tell you if you have the Firefox or other browser extension installed correctly.

## Screen Image

(Note that this is only a .jpg and NOT an actual form!)

## Link to Working Example

Hello World
Hosted *hello world* example

## Program

To run this program, just copy the following text into a file "hello.xhtml" and open it with your web browser with the appropriate XForms extension loaded.

## Problems

If this program does not work, you may not have the extension or plug-in installed in your browser.
For help see Installing XForms in FireFox.
Note that if you have the NoScript Firefox extension installed, you may need to configure NoScript to allow scripts from the location from which you are loading HelloWorld.
Also note, in Firefox the file has to be saved with a xhtml or xml extension. A file with a .html exension won't show the XForms.

## Discussion

Note that the file looks much like a standard HTML file with a few exceptions.
* there is a namespace declaration at the beginning of the file and there are two elements with a xf: prefix in front of them.
* there is something called a model inside the HTML <head> element
* There are some new elements: input and output.
The two important lines are:
and
As the user types, this line takes the input that the user types in and copies it to the instance variable "PersonGivenName". Each time you type a character this program updates the output and using the XPath concat function to wrap the string "Hello " in front of the name and the string ". We hope you like XForms!" after it.
You should also note that there is not a single line of JavaScript required to run this program. Getting rid of JavaScript is one of the biggest reasons people are migrating their applications to XForms.

## Experiment

Try changing the input attribute incremental from:
to:
The output should update only after you enter "Tab" or press the "Enter" (Return) key.

# Simple Message
## Motivation

This is a simple message in XForms. The user presses a button and they see an alert panel. This is an example of a modal message, which the user must respond to in order to continue using the form. We will cover two other types of message later.

## Screen Image

Here is a screen image with the ephemeral message showing:

## Link to working XForms Application

Simple Messages

## Discussion

The data for the first and last message come from the body of the document. The modeless message is taken directly from the body by using an XPath expression into the model.
Note that the first event happens when you start to enter data in an input field. This is the DOMFocusIn event. The other two use the DOMActivate event which happens when you enter a return on the second example and press the button on the last example.
--the above explanation does not appear to refer to the Simple Message example ! --EXAMPLE FIXED
Example not working in my environment. eXist, jetty, betterFORM, Firefox. Result is a betterFORM message: xforms-binding-exception: model 'myModel' not found XPath: /html[1]/body[1]/xf:input[2]/xf:message[1]
This above error was because the id of the element was not set. partly fixed now with <xf:model id="myModel">, but still not getting modeless message—FIXED

# XForms Architecture
## The XForms Architecture

Unlike some technologies, e.g. AJAX, XForms is much more than a collection of languages and techniques. XForms has a fully developed architecture and a complete set of design patterns.
To start with let's look at the heart of XForms architecture: The Model-View-Controller design pattern.
Most people that have studied MVC architecture agree on two aspects: The Model and the View. The model is where you store your data or your business objects. The View is what the user sees. But many variations of MVC have very different implementations of a controller. In the early days of SmallTalk at Xerox PARC the controller was related to user events and how they are gathered and dispatched. Today our input controls have much of the heavy lifting of events "baked into" them, so the form designers don't have to worry too much about handling mouse events and redirecting them unless they want specific behaviors. Many forms can be created without any knowledge of how events work.
To understand how XForms work you must understand that XForms has two trees in the browser.
The model is a tree that is not presented to the user directly and holds one or more instances and optionally some binding rules and some named events.
The view is a tree of presentation elements that the user sees. To build an XForms application you simply wire the two trees together using binding statements. And there are several ways to do this.

# Input Example
## Basic Form Input

One of the most common user interface controls in a web form is a simple, one-line text field. In this example we have a very simple form with two input fields. Each input has its own label to the left of the input field.

## Link to XForms Application

Input Fields

## Program Structure

Our program has two parts, a model and a view. The model has instance data in it to store the values that the user enters in the form. The view is part of the presentation in the body of the HTML document.

## Hints

You can also provide the user with data entry hints using the <xf:hint> element.

## Discussion

Notice that as you type, the output gets immediately updated. This is because the XForms input control has an incremental="true" attribute.
Our model is simple, just the first and last name of a person.
Note that the label and hint tags are nested INSIDE the input tags.

## References

W3C XForms specification for input control

# Incremental Many to One
## Motivation

Sometimes a single input field will be used to create a new output. Not only does the input field need to be updated, but other fields that depend on this input also need to change.
Here is an example program that has three input fields. As an example, it uses a data dictionary entry (called a Data Element). The name of the Data Element is a concatenation of three fields: the Object Class Name, the Property Name and the Representation Term. The first two are text fields and the third is a value that is picked from a list.
This form creates a single output based on the values of the input fields. This shows that the model can take many different inputs and create a single output.

## Link to working XForms Application

Load XForms Application

## Discussion

How can you then take that output and put it back into the model? This will be covered later in the tutorial.

# Spreadsheet-like Updating
## Updating the Model

Many developers of traditional JavaScript-based forms are not accustomed to variables automatically updating for them. With XForms, you can easily create a complex system where XForms automatically figures out what cells to update. This is similar to using a spreadsheet. A dependency graph is automatically created for you and the appropriate cells are automatically updated if an input they depend upon changes.
Here is an example program that demonstrates this.

## Screen Image

Here is a screen capture of the application:
Note that top grid is actually just unlabeled input cells. Below that is a sample output inside a table. You should be able to change any of the input cells, enter a tab, and see the output and the footer calculations change.

## Link to Working XForms Application

Spreadsheet-like Updating

## Discussion

Due to limitations with some of the XForms implementations this example does not use the "repeat" command but just addresses each cell directly by its address.

## Suggested Improvements

This example could be a lot simpler if we used the repeat-nodeset statement in a table. This currently does not work with input cells using FormFaces.

# Bind
## Motivation

There are three core concepts that you will learn in building XForms applications:
* The model is a tree of data elements
* The presentation is a tree of data elements
* To build your form, these two trees need to be wired together - this is called "binding"
Many of the exercises in this cookbook give examples of this binding. This process is a small example of how this can work. In practice there are many ways to bind the user interface to the model.

## Screen Image

The screen image is similar to input programs from a prior example. This example has two input fields for a person's first and last name and two output controls.

## Discussion

Here are the two lines in the model that bind the data element paths to identifiers:
Note that bind uses nodeset, not ref to specify the path name to the leaf element in the instance document.
After this is done, each user interface element that inputs or outputs the data elements just adds the bind attribute:
We should also note that in this case there is a single input and a single output for each data element. This does not need to be the case. A single input can be bound to many outputs and an output could also depend on many inputs. An example of this would be using the "calculate" attribute of the bind statement.

## Bind attributes

Here are the following attributes of the bind element and a short description of how they are used:
type
* Associate an instance variable with a specific XML Schema data type
* Extend or restrict schema type definitions
relevant
* Enabling or disable controls based on the values of data elements in the model
required
* Conditionally make fields required based on the values of data elements in the model
readonly
* Disable editing of fields based on model data elements such as role
constraint
* Create complex schema constraints between two or more data elements
* Set the limits of minimum or maximum values of a node-set
calculate
* Creating computational dependency among data elements
* Compute the value of new data elements based on other data elements
* Enable spread-sheet like calculations within XForms

# Adder
## Motivation

This program demonstrates several different ways to call a web service from a sample XForms application. The example uses both HTTP POST and HTTP GET methods and shows how the results are returned into an instance in the model and how the page can be replaced with the results. The web service it calls is a simple web service that adds two numbers together.

## Link to XForms Application

For the results to be put in the model using FireFox, make sure to add www.sa.kw.ua.sa and xforms-examples.google.com to your XForms white list using the Tools/Options/Security/Allowed Sites menu of FireFox. This is required since our web forms are hosted at one domain but the web services are hosted on another domain.
Load XForms Application

## Discussion
# Input
## Basic Form Input

One of the most common user interface controls in a web form is a simple, one-line text area. In this example we have a very simple form with two input fields. Each input has its own label to the left of the input field.

## Link to XForms Application

Input Fields

## Program Structure

Our program has two parts, a model and a view. The model has instance data in it to store the values that the user enters in the form. The view is part of the presentation in the body of the HTML document.

## Hints

You can also provide the user with data entry hints using the <xf:hint> element.

## Discussion

Notice that as you type, the output gets immediately updated. This is because the XForms input control has an incremental="true" attribute.
Our model is simple, just the first and last name of a person.
Note that the label and hint tags are nested INSIDE the input tags.

## References

W3C XForms specification for input control

# Address

Here is a simple address form. Note that HTML is the default namespace. We interleave both XForms and HTML tags but the XForms tags have xf as a prefix. We use the HTML fieldset and legend tags to put related form elements in a group. We use the XForms group element to tell us where in the model to get our instance data.

## Link to XForms Application

Load XForms Application

## Discussion

The form labels are not lined up very nicely. This can be done by adding a few lines of cascading style sheet to the program.
Note that the data uses an upper camel case naming convention used in ebXML, ACORD, UBL, GMXDM, NIEM and other US federal naming and design conventions.

# Address Aligned
## Using CSS to Align Form Fields

Forms are much easier to use if they are aligned. This example uses CSS table structures to align our form. It turns groups into tables, inputs into rows and labels and values into cells.

## Link to XForms Application

Address Aligned

## Discussion

This style sheet only covers the XForms <xf:input> tags. It will need additions if you want to align select, select1, textarea and other controls. A full CSS file for doing this is described later on in this cookbook.
Note that you MUST put inputs inside of a group element for this stylesheet to work.
Also note that the table can grow if the labels get too long.
Note that the display: table properties work in FireFox but may not work in older browsers that do not support table layout.

## Alternative layout strategy using float:left

You can control the width of the label column by the odd interaction of the float:left CSS control and the block display. Basically if you try to control the width of a block it may not work unless you also add the float:left to label.
Here is the CSS that works for this:
Note that some older browsers do not support the child (greater than) selector correctly.

# Input Field Width
## Motivation

Sometimes you want to be able to control the field width, even though the default input text scrolls. This can be done for the entire form or for on a field-by-field basis for all input fields within a form. For example if you have three places that a person's last name occurs they can all be controlled by changing a single CSS file that is imported into the form. This CSS file can also be generated directly from an XML Schema or metadata registry using XML transforms.

## Discussion

There are many tradeoffs as to where to put form width information. Ideally it would be generated by a script from a metadata registry. One of the questions concerns if a data element length should only have a default recommended value in a semantic registry and the actual constraints be stored in a constraint schema. We all know that zip codes should be 5 or 9 digits and that a 12 digit zip code may only have meaning in a specific context.
This example has been tested using the FireFox browser. The use of the .xf-value class selector may not work on other systems.

# Secret
## The XForms secret control

People that are sitting near you should not be able to see your password as you enter it. The secret control echos a "*" to the screen for each character you type.

## Screen Image

Here is what the user interface would look like:

## Testing

The login characters should be echoed back but the password field should just echo a "*" character for every character the user types.

## Discussion

The values for the login and password are stored directly in the model.
This example uses a CSS style sheet to put the labels and fieldset legend in bold and align the login and password labels.
By default the fieldset box stretches the entire width of the page. You can make it static by adding a style attribute with the width set to 250 pixels like this:

# Message Types
## Motivation

With JavaScript you did not have much choice in how intrusive you were about alerting a user. The JavaScript alert function required the user to acknowledge a message before they proceeded in filling out a form. With XForms there are now three ways to proceed. Each has a different level of intrusiveness. There are three message options:
* ephemeral - a message that just appears briefly and goes away by itself
* modeless - a message you can ignore for now
* modal - a message the user must acknowledge before you go on

## Screen Image

Here is a sceen image with the ephemeral message showing:

## Link to working XForms Application

Simple Messages

## Discussion

The data for the first and last message come from the body of the document. The modeless message is taken directly from the body by using an XPath expression into the model.
Note that the first event happens when you start to enter data in an input field. This is the DOMFocusIn event. The other two use the DOMActivate event which happens when you enter a return on the second example and press the button on the last example.

# Textarea
## Motivation

The user may enter more text than used in a typical single line input field and/or the programmer wants to use a large block of multi-line text to capture user input.

## Method

When you have text input that spans multiple lines you can use the <textarea> control. The format of the textarea control is the following:

# IBM DB2 and XForms

IBM DB2 version 9 (also known as the "PureXML" release) supports both the XQuery language as well as an XML datatype. This makes it an ideal candidate for storing and retreiving your XForms instance data.
Unfortunately as of March of 2007 there is no pre-written REST interface to DB2 or a web-based administration tool for setting up and configuring DB2 XML collections.. To save your form data you will have to write some Java middleware to take the data in an HTTP POST and save it to a table in DB2 that has an XML datatype.
Here is an example from the IBM DeveloperWorks web on how to use Java to send XML data to DB2:
IBM DB2 XML Article
The good news is that once the data has been saved into DB2 you can query it using standard XQuery tools.

# Form Generators
## Motivation

You want to generate a user interface form directly from a model.

## Method

Because XForms is a declarative XML file it can be generated by transforming a model of your data directly into a form. The most common way to store a model of hierarchical data is using an XML Schema. A server-side program will scan the XML Schema document and for each element found it will create the appropriate XForms elements.
Generated forms have the advantage over hand-crafted forms in that they can can be generated with the same set of transforms. If you change your form standards all the forms can be quickly be regenerated. Many of these advantage can be gained by pushing the formatting and layout functionality of a form into CSS style sheets. But there are also many aspects of a form that are not governed by a style sheet.
If you using a consistent naming convention in your forms you can also use this naming convention to decide what types of input controls to generate based on the information in the element name. For example simple names and amounts will map to input controls, boolean true/false values will map to inputs formatted as checkboxes, dates will use calendar selectors, text objects will use textarea controls and codes will use select or select1 controls.
Here is a sample of how ISO Data element Representation Terms map to XForms controls:
| Representation Term | XForms Control |
| Amount, Name | input |
| Indicator | input with type="xs:boolean" |
| Date | input with type="xs:date" |
| Text | Textarea |

## Discussion
# NIEM to XForms
## Motivation

You want to convert a constraint XML Schema that uses subsets generated by the US National Information Exchange Model (NIEM) directly into an XForm

## References

Article by Dan McCreary on IBM Developerworks

# Form Designers

<html xmlns='http://www.w3.org/1999/xhtml' xmlns:xf='http://www.w3.org/2002/xforms' xmlns:ev='http://www.w3.org/2001/xml-events' xmlns:xs='http://www.w3.org/2001/XMLSchema'>
<xf:range bind="input-one-bind" start="1" end="5" step="1" incremental="true"> <xf:label>Input: </xf:label> </xf:range>
<xf:range bind="input-two-bind" start="1" end="5" step="1" incremental="true"> <xf:label>Input: </xf:label> </xf:range>
<xf:output bind="input-one-bind"/> * <xf:output bind="input-two-bind"/> = <xf:output bind="output-bind"/>
</html>

# Debugging XForms

If you are a newcomer to XForms and you are having problems debugging XForms you are not alone. XForms debugging can be tricky especially for newcomers. If you follow the newsgroups on XForms you will see several problems come up frequently.

## Common Problems

These problems, roughly sorted in terms of frequency include the following:
* Make sure to name your files with the .xhtml extension. Many browsers including FireFox do not look for XML tags in files with the .htm or .html extension.
* Problems related to forgetting to associate instance data with a namespace or the default namespace. This can be fixed by adding the xmlns="" parameter to your instance variable
* Incorrect or missing namespaces in the body of a document. For example, if the default namespace is html the tag <input /> is valid but the browser will look at it as <html:input> not <xf:input>. This happens frequently when users copy XForms example code from places that use XForms as the default namespace. This is a good reason that tutorial and training developers should not use XForms as the default namespace.
* Incorrect binding between the model and the view. This usually occurs because the "ref" or "nodeset" attributes are not correctly defined or that the group or repeat changes the path prefix of a data element.
* Failure to bind to the form to the instance because the XForms processor cannot find one or more instance specific namespaces. If you have customised your XForm with an XSLT or an XQuery before streaming it to your user, the processor might relegated the declaration of some of your namespaces to the instance where they first occur because it treats the contents of the ref and bind attributes on your xform as just content. However, your XForms processor probably expects the definition of the namespaces in your ref attributes to be on the parent axis and may not look in the model instances for any declarations. When this happens you will need to manually construct the root xhtml:html node, explicitly declaring any namespaces that appear in your form.

## Using an XForms Validator

Some people have found this XForms validator helpful:
http://xformsinstitute.com/validator
This program will find common errors in XForms examples.

## Using Eclipse to validate XPath

There is a nice eclipse plugin for XSLT providing also an XPath validation "view". See: http://wiki.eclipse.org/XSLT_Project

## Debugging Tools for Firefox

One of the most useful Firefox extensions is the XForms Buddy debugger. This tool allows you to visually inspect all of the instances in the model while the XForms are running in the Firefox browser. This is especially useful for ensuring that instance values that are dynamically configured are correctly set by the XForms. The link to the site is: here

## Printing your Bindings Using JavaScript

There is also a way to visually view your binding from within your JavaScript code.
These interfaces are documented here:
nsIXFormsAccessors

## Mozilla Debugging Tips

Here are some suggestions for people that are debugging XForms:
Mozilla XForms Troubleshooting page

## Testing Submissions

Sometimes when you are creating complex submissions to web services you need to make sure that what the XForms application is generating is exactly what the web service is expecting. Sometimes a web service vendor will provide a sample web forms client that correctly calls their service but the documentation on calling that service is somewhat lacking. One solution to this problem it to watch the HTTP packets leave the working application and compare them with the HTTP packets with your XForms. This can be done using an HTTP proxy tools such as Charles which also runs as a Firefox extension.
The "network" tab of standard web development debuggers, like Firebug and Google Chrome Javascript Console can be used to watch incoming and outgoing network traffic to and from the browser, allowing you to verify that the content of submissions, their methods, and HTTP error codes are what would be expected.

## Using an HTTP Proxy With Firefox

A Proxy is a tools that "stands in" for a web server. It puts itself in between your web browser and the server and tells you what the browser just sent to the web server. To do this you have to set your web browser to use the proxy (by telling it to forward everything to another IP address) and the proxy then forwards it to the service.
When you are finished using the proxy, make sure you remember to disable the proxy by going to the Firefox Tools/Options/General/Connection Settings and click the Direction Connection to the Internet. If you do not your web browser will no longer function when Charles or Tamper Data shuts down.

## Debugging WebDAV and Subversion

There are some XForms that are designed to use HTTP put, HTTP post and [w:WebDAV:WebDAV]. The WebDAV allows you to store not just the first version of a form but go back and see prior versions. Subversion FAQ suggests you run the Wireshark packet sniffer and look at the data in the HTTP messages.

## Verifiying that a file is well-formed

To verify that a data file is well formed, you can use the RUWF (Are you well-formed)? The XML Syntax Checker

## Setting Mime-type in Internet Explorer Version 6.0

Some versions of IE 6.0 do not have the correct mime-type set for IE6. TO fix this you must add an entry to the Microsoft Windows Registry:
Open the Command Shell Enter the command "regedit"

## Discussion
# Best practice

This cookbook identifies example programs that demonstrate best practices. An XForms Best Practice is a specific way of solving a general problem that has been selected from among posible solutions by various authors. There are a variety of reasons for best practices but in general best practices increase program modularity, maintainability and flexibility.
The following logo will appear next to sample programs that constitute a best practice: .
These should also be some reason in each example why this solution is usually preferred by developers over other solutions as well as give some indication of why this may not be appropriate in some situations.
Although a best practice is usually the preferred way of solving a given problem, it is not always the right choice for all circumstances. For example developers frequently put a style sheet in an external file but if you are doing training and want the example to contain the CSS file, there are good reasons to put the CSS file directly in the html header.

# References

The following are some references to XForms
* Wikipedia XForms page
* Go to IBM Alphaworks and then try: demo/flash/display/cxde3 IBM GUI Demo
* Here is a nice intro from the IBM developer works. The Wikibook spam filter does not allow the direct link so you will have to put in the link to the IBM developer works web site and add "xml/library/x-xformsintro1/?ca=dnw-732"

# Debugging Tips

If you are a newcomer to XForms and you are having problems debugging XForms you are not alone. XForms debugging can be tricky especially for newcomers. If you follow the newsgroups on XForms you will see several problems come up frequently.

## Common Problems

These problems, roughly sorted in terms of frequency include the following:
* Make sure to name your files with the .xhtml extension. Many browsers including FireFox do not look for XML tags in files with the .htm or .html extension.
* Problems related to forgetting to associate instance data with a namespace or the default namespace. This can be fixed by adding the xmlns="" parameter to your instance variable
* Incorrect or missing namespaces in the body of a document. For example, if the default namespace is html the tag <input /> is valid but the browser will look at it as <html:input> not <xf:input>. This happens frequently when users copy XForms example code from places that use XForms as the default namespace. This is a good reason that tutorial and training developers should not use XForms as the default namespace.
* Incorrect binding between the model and the view. This usually occurs because the "ref" or "nodeset" attributes are not correctly defined or that the group or repeat changes the path prefix of a data element.
* Failure to bind to the form to the instance because the XForms processor cannot find one or more instance specific namespaces. If you have customised your XForm with an XSLT or an XQuery before streaming it to your user, the processor might relegated the declaration of some of your namespaces to the instance where they first occur because it treats the contents of the ref and bind attributes on your xform as just content. However, your XForms processor probably expects the definition of the namespaces in your ref attributes to be on the parent axis and may not look in the model instances for any declarations. When this happens you will need to manually construct the root xhtml:html node, explicitly declaring any namespaces that appear in your form.

## Using an XForms Validator

Some people have found this XForms validator helpful:
http://xformsinstitute.com/validator
This program will find common errors in XForms examples.

## Using Eclipse to validate XPath

There is a nice eclipse plugin for XSLT providing also an XPath validation "view". See: http://wiki.eclipse.org/XSLT_Project

## Debugging Tools for Firefox

One of the most useful Firefox extensions is the XForms Buddy debugger. This tool allows you to visually inspect all of the instances in the model while the XForms are running in the Firefox browser. This is especially useful for ensuring that instance values that are dynamically configured are correctly set by the XForms. The link to the site is: here

## Printing your Bindings Using JavaScript

There is also a way to visually view your binding from within your JavaScript code.
These interfaces are documented here:
nsIXFormsAccessors

## Mozilla Debugging Tips

Here are some suggestions for people that are debugging XForms:
Mozilla XForms Troubleshooting page

## Testing Submissions

Sometimes when you are creating complex submissions to web services you need to make sure that what the XForms application is generating is exactly what the web service is expecting. Sometimes a web service vendor will provide a sample web forms client that correctly calls their service but the documentation on calling that service is somewhat lacking. One solution to this problem it to watch the HTTP packets leave the working application and compare them with the HTTP packets with your XForms. This can be done using an HTTP proxy tools such as Charles which also runs as a Firefox extension.
The "network" tab of standard web development debuggers, like Firebug and Google Chrome Javascript Console can be used to watch incoming and outgoing network traffic to and from the browser, allowing you to verify that the content of submissions, their methods, and HTTP error codes are what would be expected.

## Using an HTTP Proxy With Firefox

A Proxy is a tools that "stands in" for a web server. It puts itself in between your web browser and the server and tells you what the browser just sent to the web server. To do this you have to set your web browser to use the proxy (by telling it to forward everything to another IP address) and the proxy then forwards it to the service.
When you are finished using the proxy, make sure you remember to disable the proxy by going to the Firefox Tools/Options/General/Connection Settings and click the Direction Connection to the Internet. If you do not your web browser will no longer function when Charles or Tamper Data shuts down.

## Debugging WebDAV and Subversion

There are some XForms that are designed to use HTTP put, HTTP post and [w:WebDAV:WebDAV]. The WebDAV allows you to store not just the first version of a form but go back and see prior versions. Subversion FAQ suggests you run the Wireshark packet sniffer and look at the data in the HTTP messages.

## Verifiying that a file is well-formed

To verify that a data file is well formed, you can use the RUWF (Are you well-formed)? The XML Syntax Checker

## Setting Mime-type in Internet Explorer Version 6.0

Some versions of IE 6.0 do not have the correct mime-type set for IE6. TO fix this you must add an entry to the Microsoft Windows Registry:
Open the Command Shell Enter the command "regedit"