Schematron -- embedded vs separate schema
This should cover W3C XML Schema, Relax NG and DTD related problems.
-
- Posts: 2
- Joined: Thu Dec 03, 2009 9:19 pm
Schematron -- embedded vs separate schema
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
-
- Site Admin
- Posts: 2095
- Joined: Thu Jan 09, 2003 2:58 pm
Re: Schematron -- embedded vs separate schema
Hi,
If you have an ISO Schematron schema then you can control the XSLT/XPath level with the queryBinding attribute. If you want XSLT/XPath 2.0 then use queryBinding="xslt2":
Best Regards,
George
If you have an ISO Schematron schema then you can control the XSLT/XPath level with the queryBinding attribute. If you want XSLT/XPath 2.0 then use queryBinding="xslt2":
Code: Select all
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
...
</sch:schema>
George
George Cristian Bina
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service