【发布时间】:2013-12-06 09:30:31
【问题描述】:
我构建了一个 schematron 模式,发现了一个意外错误。
我尝试将字符串(例如“Robinson 1983”)与 xsl 函数的输出进行比较。 我的功能是这样的
<xsl:value-of select="surname"/><xsl:text> </xsl:text><xsl:value-of select="year"/>
所以,在 schematron 中
test="'Robinson 1983' = ...function-call..."
返回“false”,因为函数的输出是由三个文本元素组成的序列。
我可以使用 xslt 解决这个问题
<xsl:variable name="output"><xsl:value-of select="...function-call..."/></xsl:variable>
和
test="'Robinson 1983' = $output"
按预期返回“true”。
但我想知道:如何在“纯”Schematron/XPath 中解决这个问题? 有没有等效于 xsl:value-of 的? IE。把一个序列变成一个字符串,去掉其他内容。 我认为这是您想在 XPath 中做的最重要的事情之一,但我没有找到解决方案。
【问题讨论】:
-
有
fn:string-join()。或者直接使用concat(surname, ' ', year)。
标签: xslt xpath sequence schematron