You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

技术问询:schXSLT是否支持allow-foreign特性?

schXSLT对allow-foreign的支持情况

schXSLT本身原生支持Schematron规范中定义的foreign元素,不需要额外启用类似Skeleton的allow-foreign配置项。

在Schematron规则里,foreign元素允许嵌入任意XML内容,schXSLT会直接处理这些嵌入的XSLT代码(或其他XML兼容的语言元素),将其整合到生成的验证XSLT样式表中,和Skeleton的allow-foreign功能效果完全一致。

举个简单示例,你可以直接在schXSLT的Schematron规则中嵌入XSLT代码:

<sch:rule context="book">
  <sch:assert test="title">图书必须包含标题</sch:assert>
  <sch:foreign>
    <xsl:variable name="bookId" select="@id"/>
    <xsl:message>正在验证图书ID:<xsl:value-of select="$bookId"/></xsl:message>
  </sch:foreign>
</sch:rule>

schXSLT会正确解析并执行这段嵌入的XSLT逻辑,无需额外配置。

内容的提问来源于stack exchange,提问作者Marko Hedler

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.18 21:45:36