About the form definition file

Microsoft Office InfoPath

Show All Show All

About the form definition file

The Microsoft Office InfoPath 2003 form definition (.xsf) file, commonly referred to as the .xsf file, serves as the manifest of an InfoPath form. The .xsf file is automatically created by InfoPath when a new form template is created and saved in design mode. As form designers and developers change the form template or add new features to it, InfoPath updates the .xsf file to reflect those changes.

Note  The .xsf file can also be modified directly by using any text or XML editor, such as Microsoft Notepad. However, care should be taken when making modifications to the .xsf file: if an invalid entry is made, the form that the file is associated with may be left in an unusable state. However, some customizations can be made to the .xsf file that cannot be generated in design mode.

The .xsf file is the core file of an InfoPath form because it contains information about the form as a whole. Some of the data it contains includes processing metadata, user interface customizations, schema definitions, views, business logic declarations, event handlers, and deployment information.

The following are some of the items that the .xsf file contains:

  • A unique identifier for the form
  • Global metadata information about the form, including deployment and publishing information
  • The XML Schema definitions for the XML document that the form produces
  • Definition of views and their associated user interface components (menus, toolbars, and buttons)
  • Definition of editing actions that are made available using user interface components, and how their availability will be determined contextually
  • Workflow and routing information
  • Event handlers, data validation, and business logic that is associated with individual XML nodes of the form's underlying XML document, or with the XML document itself
  • Event handlers associated with the form as a whole
  • Packaging information about all of the files contained within the form template

The .xsf file is based on the xsf namespace. Its root element is the xDocumentClass element.

Note  A complete reference to the .xsf file, including all of its elements, attributes, and other entities, can be found in the InfoPath XSF Reference that is part of the InfoPath Developer's Reference, available in the InfoPath Help system and the Microsoft Script Editor (MSE) Help system.