在xml文档上执行xsl转换时,我需要将以下代码段添加到xml输出中:
<?mso-infoPathSolution name="urn:schemas-microsoft-com:office:infopath:ResourceForm:-myXSD-2010-08-09T08-39-43" solutionVersion="1.0.0.68" productVersion="14.0.0.0" PIVersion="1.0.0.0" href="http://somewhere.com/ResourceForm.xsn"?>
<?mso-application progid="InfoPath.Document" versionProgid="InfoPath.Document.3"?>
<?mso-infoPath-file-attachment-present?>
谁能告诉我怎么做?
答案 0 :(得分:2)
<xsl:processing-instruction name="mso-infoPathSolution"
select="('name="urn:schemas-microsoft-com:office:infopath:ResourceForm:-myXSD-2010-08-09T08-39-43"', 'solutionVersion="1.0.0.68"','productVersion="14.0.0.0"','PIVersion="1.0.0.0"','href="http://somewhere.com/ResourceForm.xsn"')"/>
应该为你做第一个,其余的应该是显而易见的。
答案 1 :(得分:0)
如果您需要XSLT 1.0解决方案,可以采用以下方法:
<xsl:processing-instruction name="mso-infoPathSolution">name="urn:schemas-microsoft-com:office:infopath:ResourceForm:-myXSD-2010-08-09T08-39-43" solutionVersion="1.0.0.68" productVersion="14.0.0.0" PIVersion="1.0.0.0" href="http://somewhere.com/ResourceForm.xsn"</xsl:processing-instruction>
将输出:
<?mso-infoPathSolution name="urn:schemas-microsoft-com:office:infopath:ResourceForm:-myXSD-2010-08-09T08-39-43" solutionVersion="1.0.0.68" productVersion="14.0.0.0" PIVersion="1.0.0.0" href="http://somewhere.com/ResourceForm.xsn"?>
指令xsl:processing-instruction
的内容是可选的。对于只有名称的PI,只需跳过内容:
<xsl:processing-instruction name="mso-infoPath-file-attachment-present"/>
将产生:
<?mso-infoPath-file-attachment-present?>