SQF XInclude problem
Posted: Tue Jun 02, 2015 9:19 am
Hi,
I just made the following experiment with sqf in combination with xinclude:
main.xml:
included.xml:
schematron with sqf:
When all "Element" elements are in the same file the quickfixes work fine. But when executing the QuickFix "Adjust previous value to 1" for the file main.xml from above it is crippled to:
Regards,
Patrik
I just made the following experiment with sqf in combination with xinclude:
main.xml:
Code: Select all
<Root xmlns:xi="http://www.w3.org/2001/XInclude">
<xi:include href="included.xml"/>
<Element>2</Element>
</Root>
Code: Select all
<Element>3</Element>
Code: Select all
<sch:pattern>
<sch:rule context="Element[preceding-sibling::Element]">
<sch:let name="ThisValue" value="number(.)"/>
<sch:let name="PrevValue" value="number(preceding-sibling::Element[1])"/>
<sch:assert test="$ThisValue > $PrevValue" sqf:fix="AdjustThisValue AdjustPrevValue">
The value (<sch:value-of select="$ThisValue"/>) should be gerater then the previous value (<sch:value-of select="$PrevValue"/>).
</sch:assert>
<sqf:fix id="AdjustThisValue">
<sch:let name="NewValue" value="$PrevValue + 1"/>
<sqf:description>
<sqf:title>Adjust this value to <sch:value-of select="$NewValue"/></sqf:title>
</sqf:description>
<sqf:replace match="text()" select="$NewValue"/>
</sqf:fix>
<sqf:fix id="AdjustPrevValue">
<sch:let name="NewValue" value="$ThisValue - 1"/>
<sqf:description>
<sqf:title>Adjust previous value to <sch:value-of select="$NewValue"/></sqf:title>
</sqf:description>
<sqf:replace match="preceding-sibling::Element[1]/text()" select="$NewValue"/>
</sqf:fix>
</sch:rule>
</sch:pattern>
Code: Select all
<Root1>
<xi:include href="Included.xml"/>
<Element>2</Element>
</Root>
Patrik