Page 3 of 22PREVNEXT

Design a form based on an XML schema

Relationship between form controls and elements in XML schema

When you base a form on a schema, elements of the schema become the controls in your form.
Callout 1 Elements in the schema
Callout 2 Schema elements as form controls

An XML schema controls the data structure and data types of XML files attached to it. It specifies the sequence, names, and allowed content of data elements — kinds of information such as those shown in the illustration. When you use a schema, you have to enter data according to the kinds and organization of data that the schema uses. So, the schema standardizes how the data is collected and used. If data is collected in the same way across an organization, it can be shared, even if one department uses invoices and another uses inventories.

When you base a form on a schema, elements in the schema, such as customer ID, customer name, and address, translate into controls on the form: labels, text boxes, and such. The form controls follow the structure of the schema elements, and the data that can be entered into the form follows the types and organization of the schema. So the schema validates data as it's entered into the form, preventing errors.

Using an existing schema also helps you create a form quickly, because the schema provides the data types you can choose from, and it has a defined structure that you must work within.

Note     Every form in InfoPath is based on a schema. If you don't base the form on an existing schema, but instead create a form from scratch, InfoPath builds a schema from the form as you add controls. Of course, that isn't a schema that anyone else is using already.

Important     If the XML schema that you have based a form on changes later, can you update the form? This article addresses the issue:

Page 3 of 22PREVNEXT