I am trying to write schematron rule to compare an attribute of a current sub-element (End @value) in a loop with next sub-elements attribute(Origin @value). I am not sure if i am doing the right thing so here is my attempt
Here is my attempt:
<sch:rule context="test">
<sch:assert test="End/@value = following-sibling::test/Origin/@value " >Both the value are not Equal. </sch:assert>
</sch:rule>
This rule is working fine till the last element, the last element is expecting another element which is not present. the problem could be with "following-sibling" .
Here is XML file:
<tests>
<test x="-276.724" xEnd="-276.193">
<Origin value="36.599"/>
<End value="36.6"/>
</test>
<test x="-276.193" xEnd="-260.29">
<Origin value="36.6"/>
<End value="36.603"/>
</test>
<test x="-260.29" xEnd="-240.194">
<Origin value="36.603"/>
<End value="36.601"/>
</test>
<test x="-240.194" xEnd="-220.046">
<Origin value="36.601"/>
<End value="36.601"/>
</test>
<test x="-220.046" xEnd="-200.09">
<Origin value="36.601"/>
<End value="36.602"/>
</test>
Expected result: As current sub-element (End @value) = next sub-elements attribute(Origin @value), the Output should be success.
Actual result.
<test x="-220.046" xEnd="-200.09">
<Origin value="36.601"/>
<End value="36.602"/>
</test>
foe this element i am getting assretion failure