tei-xml
将文档转换为HTML。
在XQuery中,我创建了一个变量
$docdate
要存储HTML跨度,请执行以下操作:
<span><a href="somefoosite.com">2018-12-10</a></span>
然后我将其传递给XSLT样式表中的一个参数,然后使用该参数:
let $stylesheet :=
<xsl:stylesheet>
[....]
<xsl:param name="paramDocdate" as="element()*">{$docdate}</xsl:param>
[....]
<xsl:apply-templates select="$paramDocdate" mode="date"/>
[....]
</xsl:stylesheet>
xsl:apply-templates
2018-12-10
text()
.
或者,我设想在XQuery中创建变量时,可以以某种方式将HTML序列化为字符串(作为长字符串传递到参数中)?
我宁愿避免在创建HTML时直接将HTML手动编写为字符串
…如果有可能通过编程来实现这一点。
编辑:下面这个模板输出了参数的HTML,但是我想听听其他的方法来解决这个问题。。。
<xsl:template match="span" mode="date">
<xsl:copy-of select="."/>
</xsl:template>