【发布时间】:2019-03-28 06:41:46
【问题描述】:
我是 schematron 的新手,并且 试图编写一个断言来验证 @Origin 和 @end of 'tests' 节点的值在 @Origin 和 @end of 'bases' 的范围内
我已经尝试过如下断言,但它不起作用。
<sch:rule context="test">
<sch:assert test="End[*]/@value > ancestor::bases/bound/End/@value and Origin[*]/@value < ancestor::bases/bound/Origin/@value " >values are within range. </sch:assert>
</sch:rule>
<tests_root>
<bases>
<bound x="-276.724" xEnd="-276.193">
<Origin value="1"/>
<End value="20"/>
</bound>
</bases>
<tests>
<test x="-276.724" xEnd="-276.193">
<Origin value="1"/>
<End value="2"/>
</test>
<test x="-276.193" xEnd="-260.29">
<Origin value="2"/>
<End value="5"/>
</test>
<test x="-260.29" xEnd="-240.194">
<Origin value="5"/>
<End value="10"/>
</test>
<test x="-240.194" xEnd="-220.046">
<Origin value="10"/>
<End value="19"/>
</test>
<test x="-220.046" xEnd="-200.09">
<Origin value="19"/>
<End value="20"/>
</test>
</tests>
</tests_root>
【问题讨论】:
标签: xml xsd schematron