【发布时间】:2019-06-06 21:04:29
【问题描述】:
当用户尝试使用 schematron 规则应用快速修复并将值用作替换操作中的变量时,我想从用户那里获取两个整数。但是我收到错误消息“尚未声明变量”
我有这个 schematron 规则,它在一个步骤中找到第一个空选择元素并提示用户应用快速修复。当用户应用快速修复时,会出现一个对话框并提示用户提供两个整数。用户输入将用于计算步骤元素的范围。
schematron 规则
<sch:rule context="choice[1][not(normalize-space())]">
<sch:assert test="choice[1][not(normalize-space())]" sqf:fix='editchoice'>great
</sch:assert>
</sch:rule>
修复
<sqf:fix id="editchoice">
<sqf:description>
<sqf:title>Enter the last step number</sqf:title>
</sqf:description>
<sqf:user-entry name="step1" type="xs:integer" >
<sqf:description>
<sqf:title>Enter the first step to be converted to choice</sqf:title>
</sqf:description>
</sqf:user-entry>
<sqf:user-entry name="laststep" type="xs:integer">
<sqf:description>
<sqf:title>Enter the last step to be converted</sqf:title>
</sqf:description>
</sqf:user-entry>
<sqf:replace match="./ancestor::steps/step[position()>$step1 and not(position()>=$laststep)]" target='choice' node-type='keep'></sqf:replace>
</sqf:fix>
预期结果
$step1 和 $laststep 应替换为用户输入值。
实际结果
变量step1没有被声明(或者它的声明不在范围内)
【问题讨论】:
标签: schematron schematron-quickfix