在XQuery 3.1中,我有一个输出HTML代码段的函数。此功能:
declare function document:doc-citation($currentdoc as xs:string)
{
let $citation :=
(<div>
<p class="cite-document">To cite this document: </span>
<p>{common:cite-doc($currentdoc,"html")}</p>
</div>)
return $citation
};
输出以下内容:
<div>
<p class="cite-document"><span>To cite this document: </span></p>
<p><span>Fooname. <i>Foo title</i>. Foopublisher. 2018.</span></p>
</div>
现在,我想将此完整的HTML传递给XSLT的参数。因此,在XQuery函数transform:transform()
中,该函数对于其他(字符串)参数也可以正常工作,我尝试像这样传递HTML:
<param name="paramCitation" value="{document:doc-citation($mydoc)}"/>
哪个XSLT 2.0应该通过以下方式获取:
<xsl:param name="paramCitation"/>
并通过此XSLT输出HTML:
<xsl:value-of select="paramCitation"/>
我以前从未尝试过通过XQuery / XSLT参数传递HTML。
我认为我在某个地方不能正确处理XQuery参数中的HTML,或者不能正确处理XSLT中的参数输出(HTML /字符串转换问题)?
谢谢。