Show All

# About the Structural Editing developer sample form

The Structural Editing developer sample form demonstrates some of the ways in which the underlying XML document of a Microsoft Office InfoPath 2003 form may be edited using a combination of controls, menu items, toolbar buttons, and script. When filling out a form in InfoPath, users are essentially editing an XML document in an easy-to-use, graphical format. Although the Structural Editing developer sample form is primarily intended to demonstrate structural editing, it is used to illustrate two types of editing that can occur in a form:

- Field editing Editing that modifies the text in a field (an element or attribute in the form's underlying XML document). For example, entering data directly into a text box control changes the underlying data in the element or attribute that the control is bound to.
- Structural editing Editing that changes the structure of the form's underlying XML document. Structural editing allows fragments of XML (elements and their associated child elements, attributes, and content) to be inserted, removed, or replaced in a single operation. For example, adding items to a repeating section, repeating table, or list control creates new elements and attributes within the part of the XML document that the control is bound to.

Both field editing and structural editing are usually implemented by using controls that connect a form to an underlying XML document, allowing users to enter or modify the data that the XML document contains. However, you may also implement field or structural editing by using scripting code in conjunction with the InfoPath object model.

In addition to field and structural editing, InfoPath provides the concept of editing context, which means that editing actions can be dependent on the current selection or insertion point. For example, the Add Part Before Current button on the Part Toolbar custom toolbar of the Structural Editing developer sample form inserts a new row in the Parts table at a position based on the current context. The button is enabled only if the current selection is on or within one of the rows in the table.

To test the features of the sample form, simply type data directly into the fields on the form, or use the Insert menu, the Part Catalog custom task pane, the shortcut menu, or the Part Toolbar custom toolbar to insert or remove rows in the Parts table.

Note To see all of the files that make up the Structural Editing developer sample form, open the form and click Extract Form Files on the File menu while in design mode. This extracts all of the form files from the form template file and saves them to a specified folder on your hard disk.

To learn how editing features are implemented in the Structural Editing developer sample form, see the following topics:

Field editing in the Structural Editing developer sample form

Structural editing in the Structural Editing developer sample form

Editing context in the Structural Editing developer sample form

©2003-2004 Microsoft Corporation. All rights reserved. Permission to copy, display and distribute this document is available at: http://msdn.microsoft.com/library/en-us/odcXMLRef/html/odcXMLRefLegalNotice.asp