Infopath入门到精通系列-3 Infopath manifest.xsf文件 解析

Posted 分享牛

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Infopath入门到精通系列-3 Infopath manifest.xsf文件 解析相关的知识,希望对你有一定的参考价值。

1、Infopath 介绍

Infopath工具保存后默认生成xsn格式的文件。

将上图中的文件后缀名修改为全国面上广告申请.zip 并进行解压。如下图所示:

效果图如下:

2、manifest.xsf文件说明

manifest.xsf文件内容如下:

<?xml version="1.0" encoding="UTF-8"?>
<!--
此文件由 Microsoft InfoPath 自动创建和修改。
如果在 InfoPath 中修改表单模板,则在 InfoPath 以外对文件所做的更改可能会丢失。
-->
<xsf:xDocumentClass trustSetting="automatic" trustLevel="restricted" solutionFormatVersion="15.0.0.0" publishUrl="C:\\Users\\Administrator\\Desktop\\全国面上广告申请.xsn" solutionVersion="1.0.0.10" name="urn:schemas-microsoft-com:office:infopath:XmR-o-cg:-myXSD-2021-08-11T07-06-00" productVersion="15.0.0" xmlns:xsf="http://schemas.microsoft.com/office/infopath/2003/solutionDefinition" xmlns:xsf2="http://schemas.microsoft.com/office/infopath/2006/solutionDefinition/extensions" xmlns:xsf3="http://schemas.microsoft.com/office/infopath/2009/solutionDefinition/extensions" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:xd="http://schemas.microsoft.com/office/infopath/2003" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xdUtil="http://schemas.microsoft.com/office/infopath/2003/xslt/Util" xmlns:xdXDocument="http://schemas.microsoft.com/office/infopath/2003/xslt/xDocument" xmlns:xdMath="http://schemas.microsoft.com/office/infopath/2003/xslt/Math" xmlns:xdDate="http://schemas.microsoft.com/office/infopath/2003/xslt/Date" xmlns:xdExtension="http://schemas.microsoft.com/office/infopath/2003/xslt/extension" xmlns:xdEnvironment="http://schemas.microsoft.com/office/infopath/2006/xslt/environment" xmlns:xdUser="http://schemas.microsoft.com/office/infopath/2006/xslt/User" xmlns:xdServerInfo="http://schemas.microsoft.com/office/infopath/2009/xslt/ServerInfo" xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD/2021-08-11T07:06:00">
	<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/2021-08-11T07:06:00"></xsf:property>
					<xsf:property name="editability" type="string" value="full"></xsf:property>
					<xsf:property name="rootElement" type="string" value="myFields"></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="componentId" type="string" value="46"></xsf:property>
					<xsf:property name="xmlToEditName" type="string" value="46"></xsf:property>
				</xsf:fileProperties>
			</xsf:file>
			<xsf:file name="upgrade.xsl"></xsf:file>
		</xsf:files>
	</xsf:package>
	<xsf:importParameters enabled="yes"></xsf:importParameters>
	<xsf:documentVersionUpgrade>
		<xsf:useTransform transform="upgrade.xsl" minVersionToUpgrade="0.0.0.0" maxVersionToUpgrade="1.0.0.9"></xsf:useTransform>
	</xsf:documentVersionUpgrade>
	<xsf:extensions>
		<xsf:extension name="SolutionDefinitionExtensions">
			<xsf2:solutionDefinition runtimeCompatibility="client server">
				<xsf2:offline openIfQueryFails="yes" cacheQueries="yes"></xsf2:offline>
				<xsf2:server formLocale="zh-CN" isPreSubmitPostBackEnabled="no" isMobileEnabled="no"></xsf2:server>
			</xsf2:solutionDefinition>
		</xsf:extension>
	</xsf:extensions>
	<xsf:views default="视图 1">
		<xsf:view name="视图 1" caption="视图 1">
			<xsf:mainpane transform="view1.xsl"></xsf:mainpane>
			<xsf:editing>
				<xsf:xmlToEdit name="组2_46" item="/my:myFields/my:组1/my:组2" container="/my:myFields">
					<xsf:editWith caption="组2" xd:autogeneration="template" component="xCollection">
						<xsf:fragmentToInsert>
							<xsf:chooseFragment innerFragment="my:组1/my:组2">
								<my:组1>
									<my:组2>
										<my:行项目号></my:行项目号>
										<my:费用类型></my:费用类型>
										<my:媒体大类></my:媒体大类>
										<my:媒体小类></my:媒体小类>
										<my:活动形式></my:活动形式>
										<my:推广品牌id></my:推广品牌id>
										<my:推广品牌></my:推广品牌>
										<my:数量></my:数量>
										<my:单位></my:单位>
										<my:申请金额></my:申请金额>
										<my:厂方支持比例></my:厂方支持比例>
										<my:考核大区></my:考核大区>
										<my:考核比例></my:考核比例>
										<my:考核金额></my:考核金额>
										<my:审核金额></my:审核金额>
									</my:组2>
								</my:组1>
							</xsf:chooseFragment>
						</xsf:fragmentToInsert>
					</xsf:editWith>
				</xsf:xmlToEdit>
			</xsf:editing>
			<xsf:menuArea name="msoStructuralEditingContextMenu">
				<xsf:button action="xCollection::insertBefore" xmlToEdit="组2_46" caption="在前面插入 组2" showIf="immediate"></xsf:button>
				<xsf:button action="xCollection::insertAfter" xmlToEdit="组2_46" caption="在后面插入 组2" showIf="immediate"></xsf:button>
				<xsf:button action="xCollection::remove" xmlToEdit="组2_46" caption="删除 组2" showIf="immediate"></xsf:button>
				<xsf:button action="xCollection::insert" xmlToEdit="组2_46" caption="插入 组2" showIf="immediate"></xsf:button>
			</xsf:menuArea>
		</xsf:view>
	</xsf:views>
	<xsf:applicationParameters application="InfoPath Design Mode">
		<xsf:solutionProperties lastOpenView="view1.xsl" fullyEditableNamespace="http://schemas.microsoft.com/office/infopath/2003/myXSD/2021-08-11T07:06:00" lastVersionNeedingTransform="1.0.0.9"></xsf:solutionProperties>
	</xsf:applicationParameters>
	<xsf:documentSchemas>
		<xsf:documentSchema rootSchema="yes" location="http://schemas.microsoft.com/office/infopath/2003/myXSD/2021-08-11T07:06:00 myschema.xsd"></xsf:documentSchema>
	</xsf:documentSchemas>
	<xsf:fileNew>
		<xsf:initialXmlDocument caption="全国面上广告申请" href="template.xml"></xsf:initialXmlDocument>
	</xsf:fileNew>
</xsf:xDocumentClass>

3、manifest.xsf文件属性

manifest.xsf文件内容有如下几个标签构成:
xDocumentClass 标签,记录如下几个比较核心的属性:

solutionVersion: 方案版本
name:名称
productVersion: infopath客户端的版本15.0.0 是infpth2010后的版本。
publishUrl:发布地址
xmlns:my: 命名空间,系统自动生成。http://schemas.microsoft.com/office/infopath/2003/myXSD/+保存的时间

4、manifest.xsf文件 package标签

package维其他文件的路径,包含files和file。
记录myschema.xsd、template.xml、sampledata.xml、view1.xsl(可能是多个视图)、upgrade.xsl

  <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/2021-08-11T07:06:00"></xsf:property>
                    <xsf:property name="editability" type="string" value="full"></xsf:property>
                    <xsf:property name="rootElement" type="string" value="myFields"></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="componentId" type="string" value="46"></xsf:property>
                    <xsf:property name="xmlToEditName" type="string" value="46">Infopath入门到精通系列-2 Infopath 文件内容查看

Infopath入门到精通系列-6 Infopath xsl文件解析校验

Infopath入门到精通系列-4 Infopath myschema.xsd文件 解析

Infopath入门到精通系列-5 Infopath xsl文件解析

Java之Spring AOP入门到精通IDEA版(一篇文章精通系列)

OpenCV | OpenCV实战从入门到精通系列三 --canny边缘检测