This chapter introduces the file format of INFOPATH. The examples used in the previous sections generate an xsn file after the release of both the client version and the WEB version. This file extension is the extension of the INFOPATH file, but we can open it like other software. Let's take a look at what is there.
First, change the extension name to. Zip. Use any decompression tool to decompress the package, as shown in the following figure:
Let's look at it one by one,
Manifest. xsf: as the name suggests, it is a list. Let's first check what is in it. After Opening this file, apart from the declaration information in the header, the file information in the package will be followed:
,
]; html-script: false; light: false; ruler: false; smart-tabs: true; tab-size: 4; toolbar: true;"><xsf:package><xsf:files><xsf:file name="myschema.xsd"><xsf:fileProperties><xsf:property name="namespace" type="string" value="http://schemas.microsoft.com/office/infopath/2003/myXSD/2010-05-17T14:43:28"></xsf:property><xsf:property name="editability" type="string" value="full"></xsf:property><xsf:property name="rootElement" type="string" value="Form"></xsf:property><xsf:property name="useOnDemandAlgorithm" type="string" value="yes"></xsf:property></xsf:fileProperties></xsf:file><xsf:file name="template.xml"></xsf:file><xsf:file name="sampledata.xml"><xsf:fileProperties><xsf:property name="fileType" type="string" value="sampleData"></xsf:property></xsf:fileProperties></xsf:file><xsf:file name="view1.xsl"><xsf:fileProperties><xsf:property name="lang" type="string" value="2052"></xsf:property><xsf:property name="mode" type="string" value="1"></xsf:property><xsf:property name="componentId" type="string" value="31"></xsf:property><xsf:property name="xmlToEditName" type="string" value="11"></xsf:property></xsf:fileProperties></xsf:file></xsf:files></xsf:package>
The declared file can be seen in the above list. This part is used to declare the composition of the xsn file. Next, we will introduce some extended information, such as the view information, publish information, cache information, and xsn file information of xsn. The Code is as follows:
<Xsf: extensions> <xsf: extension name = "SolutionDefinitionExtensions"> <xsf2: solutionDefinition runtimeCompatibility = "client server" allowClientOnlyCode = "no"> <xsf2: offline openIfQueryFails = "yes" cacheQueries = "yes"> </xsf2: offline> <xsf2: viewsExtension> <xsf2: viewExtension ref = "View 1" designMode = "normal" clientOnly = "no"> <xsf2: xmlToEditExtension ref = "field1_1" allowLinkedImages = "yes" excludeEmbeddedImages = "yes"> </xsf2: xmlToEditExtension> <xsf2: xmlToEditExtension ref = "field2_2" allowLinkedImages = "yes" excludeEmbeddedImages = "yes"> </xsf2: xmlToEditExtension> <xsf2: xmlToEditExtension ref = "LeaderComnts_5" allowLinkedImages = "yes" excludeEmbeddedImages = "yes"> </xsf2: xmlToEditExtension> <xsf2: xmlToEditExtension ref = "comment" allowLinkedImages = "yes" comment = "yes"> </xsf2: xmlToEditExtension> </xsf2: viewExtension> </xsf2: viewsExtension> <xsf2: server formLocale = "zh-CN" isPreSubmitPostBackEnabled = "no" isMobileEnabled = "no"> </xsf2: server> <xsf2: solutionPropertiesExtension branch = "share"> <xsf2: share formName = "Leave Application Form Publish" path = "C: \ Users \ Weiwei \ Desktop \ infopath \ leave application form Publish. xsn "accessPath =" C: \ Users \ Weiwei \ Desktop \ infopath \ leave application form Publish. xsn "> </xsf2: share> </xsf2: solutionPropertiesExtension> </xsf2: solutionDefinition> </xsf: extension> </xsf: extensions>
The following is a detailed description of the View information defined above. The bound and unbound controls are defined here, And mainpane is directed to the xsl file. The interface can be displayed through the xsl file.
<Xsf: views default = "view 1"> <xsf: view name = "view 1" caption = "view 1"> <xsf: editing> <xsf: xmlToEdit name = "field1_1" item = "/my: Form/my: Reason"> <xsf: editWith type = "rich" maxLength = "1" component = "xField"> </xsf: editWith> </xsf: xmlToEdit> <xsf: xmlToEdit name = "field2_2" item = "/my: Form/my: WhereToGo"> <xsf: editWith type = "rich" maxLength = "1" component = "xField"> </xsf: editWith> </xsf: xmlToEdit> <xsf: xmlToEdit name = "LeaderComnts_5" item = "/my: Form/my: LeaderComnts"> <xsf: editWith type = "rich" maxLength = "1" component = "xField"> </xsf: editWith> </xsf: xmlToEdit> <xsf: xmlToEdit name = "EndDate_11" item = "/my: Form/my: EndDate"> <xsf: editWith proofing = "no" autoComplete = "no" component = "xField"> </xsf: editWith> </xsf: xmlToEdit> <xsf: xmlToEdit name = "StartDate_10" item = "/my: Form/my: StartDate"> <xsf: editWith proofing = "no" autoComplete = "no" component = "xField"> </xsf: editWith> </xsf: xmlToEdit> <xsf: xmlToEdit name = "ManagerComnts_6" item = "/my: Form/my: ManagerComnts"> <xsf: editWith type = "rich" maxLength = "1" component = "xField"> </xsf: editWith> </xsf: xmlToEdit> </xsf: editing> <xsf: mainpane transform = "view1.xsl"> </xsf: mainpane> <xsf: unboundControls> <xsf: button name = "CTRL31_5"> </xsf: button> </xsf: unboundControls> </xsf: view> </xsf: views>
UnboundControls defines controls that are not bound to data, that is, the submit button in the form.
The following two items are about schema and namespace settings:
<xsf:applicationParameters application="InfoPath Design Mode"><xsf:solutionProperties lastOpenView="view1.xsl" fullyEditableNamespace="http://schemas.microsoft.com/office/infopath/2003/myXSD/2010-05-17T14:43:28"></xsf:solutionProperties></xsf:applicationParameters><xsf:documentSchemas><xsf:documentSchema rootSchema="yes" location="http://schemas.microsoft.com/office/infopath/2003/myXSD/2010-05-17T14:43:28 myschema.xsd"></xsf:documentSchema></xsf:documentSchemas>
Then the initialization data settings, that is, the status of the data source when a new form is opened. The following settings show that the initialization data is directed to the template. xml file.
<Xsf: fileNew> <xsf: initialXmlDocument caption = "Leave Application Form Publish" href = "template. xml"> </xsf: initialXmlDocument> </xsf: fileNew>
The last is the definition of the submission option. I wonder if you still remember the setting items about submission in the previous form. You can refer to the previous blog to view the definition of the submission item.
<Xsf: submit caption = "submit" disableMenuItem = "no" onAfterSubmit = "close" showStatusDialog = "yes"> <xsf: successMessage> your application for leave has been submitted. Please wait for approval. </Xsf: successMessage> <xsf: errorMessage> the form cannot be submitted due to an error. </Xsf: errorMessage> <xsf: davAdapter name = "" submitAllowed = "yes" overwriteAllowed = "no"> <xsf: folderURL value = "http: // 172.17.9.168/Shared % 20 Documents/"> </xsf: folderURL> <xsf: fileName value =" concat (my: Department, & quot;-& quot;, my: fullName, & quot; leave application form & quot;) "valueType =" expression "> </xsf: fileName> </xsf: davAdapter> </xsf: submit>
Through the above understanding, we found that the XSN file is actually a ZIP package, the elements and form settings used in the form are compressed into this package, and manifest is the directory of these resources, it is also a form configuration file. In the next article, I will explain the role of several other files. Thank you for your support. Please stay tuned to my blog. Thank you.
Author: Super radish
Source: http://www.cnblogs.com/infop
The copyright of this article is shared by the author and the blog Park. You are welcome to repost this article. However, you must retain this statement without the author's consent and provide a clear link to the original article on the article page. Otherwise, you will be held legally liable.