将 document() 参数传递给 XProc 管道中的 xslt [英] Passing document() parameter to an xslt in XProc pipeline
问题描述
我已经建立了一个 XProc 管道,其中我有一个
步骤.在这个样式表的参数中,我有一个参数,它是一个 document() 节点:
I've set up an XProc pipeline wherein I have a <p:xslt>
step. Amoung the parameters of this stylesheet, I have an parameter which is a document() node:
这是 km_to_dita.xsl 样式表:
This is the km_to_dita.xsl stylesheet:
<?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>
但它旨在绑定到一步):
Thus I am calling this XSLT in my pipeline with the following step (for demonstration purpose it is set with a <p:inline>
but it is aimed to be bound to the result port of a step):
<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 Calabash(在 oXygenXML 中)运行它时失败了,引发的错误是(对不起,伙计们,这是我拥有的所有信息)但是已经确定它是 <p:with-param name=导致此错误的graphics-reference-names">
:
But it fails when running it with XML Calabash (in oXygenXML), the error being raised is (sorry folks it's all the information I have) however have determined that it's the <p:with-param name="graphics-reference-names">
that causes this error):
空
有什么想法吗?
推荐答案
如果你使用
<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"
然后
in XProc 1 with p:xslt version="2.0"
and then
<xsl:param name="graphics-reference-names" as="document-node()*" select="subsequence(collection(), 2)" />
在 XSLT 代码中,我认为应该可以将另一个步骤的结果用作辅助输入文档(作为默认集合的一部分访问).
in the XSLT code I think it should work to have the result of another step available as a secondary input document (accessed as part of the default collection).
这篇关于将 document() 参数传递给 XProc 管道中的 xslt的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!