我已经设置了一个XProc管道,其中有一个<p:xslt>步骤。在这个样式表的参数中,我有一个参数,它是document()节点:
这是km_to_dita.xsl样式表:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:dctm="http://www.documentum.com" xmlns:ale="http://www.amplexor.com/alcatel"
exclude-result-prefixes="xs dctm ale" version="2.0">
<xsl:param name="conf-base" select="'file:/D:/Temp/ALE_config/'" />
<xsl:param name="output-base" select="''"/>
<xsl:param name="lang" select="/element()[1]/@language"/>
<xsl:param name="graphics-reference-names" as="document-node()*" />
<!-- my templates stuff... -->
</xsl:stylesheet>因此,我使用以下步骤调用管道中的XSLT (为演示目的,使用一个<p:inline>设置它,但它的目标是绑定到步骤的结果端口):
<p:xslt name="km-dm-to-dita">
<p:input port="source">
<p:pipe port="list-dm" step="list-csv"/>
</p:input>
<p:input port="stylesheet">
<p:document href="km_to_dita.xsl"/>
</p:input>
<p:with-param name="output-base" select="$dita.data-dir"/>
<p:with-param name="conf-base" select="$config-dir"/>
<!--<p:with-param name="graphics-reference-names">
<p:pipe port="result" step="get-figure-references"/>
</p:with-param>-->
<p:with-param name="graphics-reference-names">
<p:inline>
<graphic-ids>
<reference type="symbol" document="dm09011b0281121ef3.xml#G4" filename="g09011b0281d9c449.gif"/>
<reference type="symbol" document="dm09011b0281121ef3.xml#G3" filename="g09011b0281d9c449.gif"/>
<reference type="figure" document="dm09011b0281121ef3.xml#F33" filename="g09011b0281d9c44d.gif"/>
<reference type="symbol" document="dm09011b0281121ef3.xml#G5" filename="g09011b0281d9c451.gif"/>
<reference type="figure" document="dm09011b0281121ef5.xml#F116" filename="g09011b0281d9c458.gif"/>
</graphic-ids>
</p:inline>
</p:with-param>
<p:with-option name="output-base-uri" select="$dita.data-dir"/>
</p:xslt>但是,当使用XML (在oXygenXML中)运行它时,它失败了,引发的错误是(对不起,伙计们,这是我掌握的全部信息),但是确定是<p:with-param name="graphics-reference-names">导致了这个错误):
空
有什么想法吗?
发布于 2016-11-15 15:19:31
我终于找到了问题所在.首先,正如前面提到的,<p:with-param>缺少所需的@select属性,但奇怪的是,oXygen没有为我的管道引发任何验证错误。
因此,管道可以这样固定:
<p:with-param name="graphics-reference-names" select="/">
<p:inline>
<graphic-ids>
<reference type="symbol" document="dm09011b0281121ef3.xml#G4" filename="g09011b0281d9c449.gif"/>
<reference type="symbol" document="dm09011b0281121ef3.xml#G3" filename="g09011b0281d9c449.gif"/>
<reference type="figure" document="dm09011b0281121ef3.xml#F33" filename="g09011b0281d9c44d.gif"/>
<reference type="symbol" document="dm09011b0281121ef3.xml#G5" filename="g09011b0281d9c451.gif"/>
<reference type="figure" document="dm09011b0281121ef5.xml#F116" filename="g09011b0281d9c458.gif"/>
</graphic-ids>
</p:inline>
</p:with-param>使用上面的解决方案,XSLT会失败,因为参数被抛到一个字符串中:
变量$图形值的必需项类型-引用-名称是文档-节点();所提供的值具有项目类型xs:string
这是使问题无法解决的另一个问题: XProc只允许将参数设置为原子值,正如在具有XProc参数绑定的所需类型的XSLT中所解释的那样。
发布于 2020-02-27 15:06:38
如果您使用
<p:input port="source">
<p:pipe port="list-dm" step="list-csv"/>
<p:pipe port="result" step="your-other-step"/>
</p:input>在XProc 1中使用p:xslt version="2.0",然后
<xsl:param name="graphics-reference-names" as="document-node()*" select="subsequence(collection(), 2)" />在XSLT代码中,我认为应该将另一个步骤的结果作为辅助输入文档(作为默认集合的一部分访问)。
https://stackoverflow.com/questions/40512887
复制相似问题