【发布时间】:2017-12-07 12:21:48
【问题描述】:
我想选择在 Addl_Information 部分中出现 Plan 子节点的 Worker 节点
<xsl:mode streamable="yes"/>
<xsl:template match="Worker[Addl_Information/Plan]">
当我使用上述代码时,我收到来自 Saxon-EE 9.6.0.5 处理器的错误提示
XTSE3430: Template rule is declared streamable but it does not satisfy the streamability rules. * The match pattern is not motionless
我做错了什么?
我在w3c site 中看到了(类似)静止模式的示例,但它对我不起作用,请指教。
更新:这是我的样式表。我试图只包括在他们的工人数据中记录了某个计划的人。请注意,下面的patth 变量是我试图评估的另一个角度 - 基本上在剩余代码周围有一个 IF 条件。这也行不通。
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="3.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:mode streamable="yes"/>
<xsl:template match="Worker_Sync">
<File>
<xsl:apply-templates select="Worker"/>
</File>
</xsl:template>
<xsl:template match="Worker">
<xsl:variable name="ThisPerson" select="copy-of()"/>
<xsl:variable name="patth" select="Additional_Information/ws:plan"/>
<xsl:if test="$ThisPerson/$patth">
<Row>
<A1_Account_Number><xsl:value-of select="$ThisPerson/Additional_Information/Account_Number"/></A1_Account_Number>
<A2_Employee_Number>...</A2_Employee_Number>
</Row>
</xsl:if>
</xsl:template>
</xsl:stylesheet>
【问题讨论】:
-
您的模式类似于
p[b],其中规范说“谓词不是静止的”。 -
嗯,我想我开始掌握这种语言了。第一次制作流式 xslt。关于如何实现我的逻辑的任何想法?