How Does It Work?
The InfoPath application, much like an XForms engine, converts user input into new or modified XML, which can then be fed into a back-end system. A single Windows-based application is used for both designing and completing a form.
An InfoPath document is stored and processed as several files, which can be either combined into a single CAB-compressed file with a file extension of .xsn or stored in the same directory. Either way, there are several key components.
manifest.xsf
This file contains a manifest, a listing of all other files in the bundle, called a solution. InfoPath keeps several other details here as well, including metadata, information on toolbars and menus associated with each view, information on external data sources, and error messages.
This file is roughly analogous to an XForms Model in that it contains the central hub a form.
view1.xsl, view2.xsl, view3.xsl, ...
One or more sequentially-numbered XSLT files are always included, each one defining an InfoPath view, which presents an editable view of a portion of the XML data under consideration. Each XSLT accepts the XML instance as input and produces an output format similar to HTML forms, but augmented with several InfoPath-specific features.
This XSLT transformation doesn't have an equivalent in XForms, but the HTML-like format produced by the transformation is conceptually similar to the XForms User Interface specification.
template.xml
This file contains the actual XML data that is edited by InfoPath. When the overall InfoPath form is published to a well-known location, the XML instance can be separately transported, via email or any other supported path. A special pair of processing instructions included in this file help maintain the connection between the form data and the rest of the form:
<?mso-infoPathSolution solutionVersion="1.0.0.1" href="manifest.xsf"
productVersion="11.0.5531" PIVersion="1.0.0.0" ?>
<?mso-application progid="InfoPath.Document"?>
When Internet Explorer encounters any XML document with these processing instructions, it attempts to launch the locally installed InfoPath application, pointing it to the indicated manifest file. Unfortunately, this technique is specific to IE and will not work with other browsers.
myschema.xsd
InfoPath is strongly based on W3C XML Schema (WXS), and the application maintains a WXS instance for the main XML data. InfoPath will refuse to open a form if the template XML is not valid according to the specified schema. A graphical Data Source view in InfoPath, while not a full-fledged editor, allows the designer to make changes to the WXS.
script.js
InfoPath also includes extensive scripting capabilities, in either JScript or VBScript. If an InfoPath document contains any script, it is stored by default in this file.
It's possible for the InfoPath document to contain other user-inserted files as well, including images, XML that can be used as an alternative data source, and even HTML files that can be displayed in a special area called the Task Pane.
Similar, Different
How comparable is InfoPath to XForms? At a high level, both seek to overcome a similar challenge: translating user interaction into XML. Upon closer examination, however, the two technologies differ in focus, target audience, and scope.