Show All

# InfoPath Schema Overview

Unique to InfoPath is the form definition (.xsf) file. The .xsf file is an XML file with an .xsf extension that serves as the manifest of an InfoPath form. The manifest.xsf file can be considered the glue that holds together information about how the form is constructed, used, and deployed. The .xsf file is automatically created by InfoPath when you design a form, and it is packaged with the other form files into an .xsn file.

In general, the information that the .xsf files contains should only be created by InfoPath; however, you can make some modifications directly to the .xsf file to extend the functionality of a form. Because the format of the .xsf file is standard XML, it can be directly modified by any type of standard text editor such as Microsoft Notepad.

Note The InfoPath form definition file is discussed in more detail later in this article.

### The Form Files

An InfoPath form is implemented by using a variety of different file types, collectively known as the form files. The form files include all of the files used to construct an InfoPath form template, which is an InfoPath file with an .xsn extension. The form files include the .xsf file, XML Schemas, XML templates, and view, presentation, script, and custom business logic files.

The following table describes the form files and lists their extensions.

Name | Extension | Description
--- | --- | ---
Form definition | .xsf | An InfoPath-generated file that contains information about all of the other files and components used in a form. This file serves as the manifest for the form.
XML Schema | .xsd | The XML Schema files that are used to constrain and validate a form's underlying XML document files.
View | .xsl | The presentation style sheet files that are used to present, view, and transform the data contained in a form's underlying XML document files.
XML template | .xml | The .xml file that contains the default data that is displayed in a view when a new form is created.
Presentation | .htm, .gif, .bmp, and others | The files used to create custom user interface elements.
Business logic | .js, .vbs | The script files (JScript and VBScript) that contain programming code used to implement specific editing behavior, data validation, event handlers, control of data flow, and other custom business logic.
Binary | .dll, .exe | The custom Component Object Model (COM) components that provide additional business logic. These files are external to the form template file and must be registered separately.
Form template | .xsn | The compressed file format (.cab) that packages all the form files into one file.

Note InfoPath automatically packages the InfoPath form files as an .xsn file, which is simply a CAB file that uses an .xsn extension. You can extract these files to a folder on your hard disk by clicking Extract Form Files on the File menu when designing a form.

## Overview of the InfoPath Form Definition File

The InfoPath form definition (.xsf) file is the central file of a form: it contains information about how a form is put together, including the XML Schemas that it uses, the resource files that it contains, the event handlers that it implements, and a variety of other aspects related to its general operation and appearance.

### Form Definition File Customizations

The .xsf file is an XML file that is created by InfoPath when you design a form and then continually updated as you make modifications to the form. For most tasks related to form design and development, it is best to let InfoPath create and maintain the .xsf file. However, to extend the functionality of a form, you can make some modifications to the .xsf file that are not available in InfoPath design mode.

The following are some of the more common modifications that you can make to the .xsf file:

- Extending the user interface by adding submenus to the menu bar and toolbars
- Adding multiple script files
- Creating fully trusted forms
- Overriding default error messages
- Adding extra print settings
- Adding extra toolbars
- Adding extra top-level menus
- Creating buttons on menus and toolbars that call scripting functions

### Form Definition File Key Elements

The .xsf file contains a number of key elements that are used by InfoPath to store information about a form, and many of these key elements have other elements nested within them. The following table details some of these elements.

Element | Description
--- | ---
applicationParameters | Contains form-specific properties that describe how a form should be used in InfoPath design mode
customValidation | Defines rule-based custom validation on top of all validation enforced through the XML Schema
dataObjects | Defines all secondary data objects used in a form
documentSchemas | Defines the XML Schemas that the form is designed to use
documentSignatures | Defines the location of the digital signature XML DOM node within the form's underlying XML document
documentVersionUpgrade | Defines how forms created with an older version of the form template can be upgraded to the latest version of the form template
domEventHandlers | Contains pointers to various script-based event handlers that react to changes in the XML DOM nodes of a form's underlying XML document
fileNew | Provides a reference to an .xml file containing sample data to be loaded when a user chooses to design a new form based on the form template
importParameters | Contains all the parameters that define how the merge forms (import) feature works for the form
listProperties | Identifies the properties that should be on a list view of all forms belonging to the form template
package | Contains information about all of the files used in a form
query | Associates a data adapter with a data object or a form's underlying XML document
schemaErrorMessages | Contains custom error messages used to override XML Schema data type errors
scripts | Defines the source of all business logic scripts used at the document level in the form
submit | Contains information about the submission functionality of a form
taskpane | Defines a custom task pane to be used in a form
views | Defines all of the views that have been implemented in a form

### Legal notice

© 2003 Microsoft Corp. All rights reserved.

The information contained in this document represents the current view of Microsoft Corp. on the issues discussed as of the date of publication. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information presented after the date of publication.

This document is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED, OR STATUTORY AS TO THE INFORMATION IN THIS DOCUMENT.

Complying with all applicable copyright laws is the responsibility of the user. Without limiting the rights under copyright, no part of this document may be reproduced, stored in or introduced into a retrieval system, or transmitted in any form or by any means (electronic, mechanical, photocopying, recording or otherwise), or for any purpose, without the express written permission of Microsoft Corp.

Microsoft may have patents, patent applications, trademarks, copyrights or other intellectual property rights covering subject matter in this document. Except as expressly provided in any written license agreement from Microsoft, the furnishing of this document does not give you any license to these patents, trademarks, copyrights or other intellectual property.

Microsoft, InfoPath, and the Office Logo are either registered trademarks or trademarks of Microsoft Corp. in the United States and/or other countries. The names of actual companies and products mentioned herein may be the trademarks of their respective owners.

Microsoft Corp.• One Microsoft Way • Redmond, WA 98052-6399 • USA

©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