Schematron -- embedded vs separate schema
Posted: Thu Dec 03, 2009 9:40 pm
In the 10.3 user manual, section "Validating XML documents against a schema", it says:
I'm attempting to use a separate ISO schematron schema, associated with the document using. However, I get an error:
even though the very same rules don't produce this error when the schematron is embedded in the RelaxNG schema.
The offending schematron rule is:
Any help greatly appreciated,
--
perry
This implies that XPath 2.0 is fine in embedded schematron schemas, but that XPath 2.0 isn't allowed when the schematron schema is in a separate file. Is this correct?Validation of an XML document against a W3C XML Schema or Relax NG Schema with embedded ISO Schematron rules allows XPath 2.0 in the expressions of the ISO Schematron rules. This ensures that both XPath 1.0 and XPath 2.0 expressions are accepted in the embedded ISO Schematron rules and are enforced by the validation operation. For embedded Schematron 1.5 rules the version of XPath is set with a user preference.
I'm attempting to use a separate ISO schematron schema, associated with the document using
Code: Select all
<?oxygen SCHSchema="mei.sch"?>
Code: Select all
Error in expression count(distinct-values(descendant::staffdef/@n)): Unknown system function: distinct-values
The offending schematron rule is:
Code: Select all
<rule context="staffgrp">
<let name="countstaves" value="count(descendant::staffdef)"/>
<let name="countuniqstaves"
value="count(distinct-values(descendant::staffdef/@n))"/>
<assert test="$countstaves eq $countuniqstaves"> When defining
staffgrp(s),each staffdef must have a unique @n value. </assert>
</rule>
--
perry