Background

The existence of a Schematron validator implemented in XQuery has been the subject of periodic enquiry in the community.[29] Respondents on mailing lists typically indicate the existing and highly serviceable XQuery wrappers around an XSLT implementation, such as are available for the main XML databases.[schematron-existdb][schematron-basex][schematron-ML]

While Schematron has been implemented in a range of other languages, apparently the only members of the XML technology stack to fulfil this role so far have been XPath, such as ph-schematron[ph-schematron] (in its "pure" variant) and the author's defunct XMLProbe, later open-sourced as Probatron,[probatron][30] and XSLT.[skeleton][schxslt] Indeed, to many Schematron users, the XSLT implementations are Schematron to all intents and purposes. It is a mark of the success of those implementations that they have come to be regarded in this way.

There may however be advantages to pursuing a native XQuery implementation. The standard itself still defines a range of query language bindings (QLBs)[iso-qlbs], some of which are moribund or of questionable longer-term value[31]. There are QLBs for XPath and XSLT in all their current versions defined normatively, and while the values xquery, xquery3 and xquery31 are all reserved for future use, these are not defined at all.

For the purposes of updating the standard,[32] the present work has obvious benefits in informing what a QLB for XQuery should look like. For the end user, it also gives them options not previously available, most obviously the native integration of a Schematron schema into an XQuery-based validation workflow, e.g. in a native XML database, or, as is the case with ph-schematron[ph-schematron], the possiblity to isolate and address individual schema components. Further potential benefits of this to the XQuery user are discussed in more detail below.

This paper will examine three main areas arising from the work:

Some lessons learned in these attempts will be expanded on below, and some of the remaining work highlighted.



[30] The later updates archived at https://code.google.com/archive/p/probatron4j/ and https://code.google.com/archive/p/probatrondotnet/ are wrappers around the skeleton implementation.

[32] ISO/IEC JTC 1/SC 34 approved a new revision of the standard and convened a new working group to carry this out in September 2022.