The .xml Template File

 <  Day Day Up  >  

The .xml Template File

All unpacked InfoPath form templates have a template.xml file. The template.xml file is, essentially , a sample XML instance document that provides an example of how a permitted XML document can look.

AVOIDING FILE CONFLICTS

When you want to open individual form files, make sure the InfoPath client does not have the form template open in design mode. If the form template is open in InfoPath, the file will be locked and you will be unable to edit it.


Let's look in more detail at the template.xml file extracted from SimpleControls.xsn , shown in Listing 15.1. I have broken the code into short lines for ease of printing.

template.xml IS A SAMPLE DOCUMENT

The template.xml file is only a sample document. So, if the W3C XML Schema document specifies that an element can occur from one to three times in an XML instance document, you might find that the template.xml file contains that element once.


Listing 15.1. The template.xml File Extracted from SimpleControls.xsn
 <?xml version="1.0" encoding="UTF-8"?> <?mso-infoPathSolution  solutionVersion="1.0.0.2"  href="manifest.xsf"  productVersion="11.0.5531"  PIVersion="1.0.0.0" ?> <?mso-application progid="InfoPath.Document"?> <my:myFields  xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD/2003-12-13T15:12:34">  <my:field1></my:field1>  <my:field2></my:field2> </my:myFields> 

The file contains an XML declaration in its first line. Then there are two Microsoft-specific processing instructions: Notice the href pseudo-attribute in the mso-infoPathSolution processing instruction. The value of the href pseudo-attribute indicates the location of the .xsf file for the form template, which is manifest.xsf by default.

The mso-application processing instruction indicates that the XML is an InfoPath form. This means, for example, that if there is a link to a form in Internet Explorer, the InfoPath client opens the form, overriding any association between another application and .xml files.

Following the processing instructions, a nested hierarchy of XML elements corresponds to the hierarchy of the group (s) and field(s) in the InfoPath data source.

 <  Day Day Up  >  


Microsoft Office InfoPath 2003 Kick Start
Microsoft Office InfoPath 2003 Kick Start
ISBN: 067232623X
EAN: 2147483647
Year: 2004
Pages: 206

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net