XQS: A Native XQuery Schematron Implementation

Andrew Sales

Abstract

This paper will cover XQuery for Schematron (XQS) (pron. /ɛksˈkjuːz/),[27] a Schematron processor being implemented in native – and naïve – XQuery. To the author's knowledge, there are no complete implementations publicly available at this time.[28] The purpose of the work is at least two-fold: to demonstrate the utility of an XQuery query language binding for arguably the primary quality assurance technology applicable to XML, and to provide a second "reference" implementation while work on the latest revision of the ISO standard proceeds. Although not required by the standardization process, it clearly helps to be able to answer the question standards authors should consider when new features present themselves: How would you implement that?



[28] Though note the experimental work in this area by David Maus: https://github.com/dmj/schematron-xquery.


Table of Contents

Background
Rationale
Design goals
Conformance over performance
Dynamic evaluation
Portability
Caveats
Expansion and inclusion
"Native"?
Mandated XQuery QLB
Approach
Context is everything
Document level
Node level
Assertion level
Implementation
Dynamically evaluated schema
Evaluating patterns
The documents attribute
Rule processing
Advisory notes
Compiled schema
Other features
User-defined functions
Evaluating schema components
Maps, arrays and anonymous functions as variables
Unit testing
Evaluation
Status of the work
The conformance suite
Future work
Bibliography


[28] Though note the experimental work in this area by David Maus: https://github.com/dmj/schematron-xquery.