An EXPath module for schematron?

31 views
Skip to first unread message

Andy Bunce

unread,
Jan 7, 2015, 6:00:30 AM1/7/15
to exp...@googlegroups.com
Hi,

I wonder if there would be value in defining a EXPath module for schematron validation. 
Norman Walsh's ML-Schematron https://github.com/ndw/ML-Schematron ,which has minor Marklogic dependencies, could serve as a model for the XQuery implementation.

/Andy
 

Joe Wicentowski

unread,
Jan 7, 2015, 9:06:56 AM1/7/15
to exp...@googlegroups.com
Hi Andy,

Sounds like a good idea, but I have one question.  It looks like Norm's library is a wrapper for the Schematron XSLT libraries.  How are you planning to deal with the need for an XSLT processor?

Joe

Sent from my iPhone
--
You received this message because you are subscribed to the Google Groups "EXPath" group.
To unsubscribe from this group and stop receiving emails from it, send an email to expath+un...@googlegroups.com.
To post to this group, send email to exp...@googlegroups.com.
Visit this group at http://groups.google.com/group/expath.
For more options, visit https://groups.google.com/d/optout.

Adam Retter

unread,
Jan 7, 2015, 10:17:09 AM1/7/15
to exp...@googlegroups.com
I am not particularly interested in Schematron, but I am interested in
abstraction. The 3 function signatures in Norm's library of interest
appear to be:

1) declare function sch:compile-schema($schema as node(), $params as
map:map?) as document-node(element(xsl:stylesheet))

2) declare function sch:validate-document($document, $schema)

3) declare function sch:validate-document($document as node(), $schema
as node(), $params as map:map?) as
document-node(element(svrl:schematron-output))?

(1) at the moment is of no use by itself, and is only a utility of
(3), and (2) is a shorted convenience function for (3).

I don't think you need to worry about XSLT as it is an implementation
concern, instead it is better to focus of defining generic and
re-useable function signatures. The only implementation concern in the
signatures above is the return type of (1) which you could abstract
away by using higher-order-functions.

Looking at the above, and thinking about it, there are two stages to
any validation:

1) Compiling the validation grammar
2) Validating a document with the validation grammar.

A question here is, should (1) and (2) be separate public functions so
that the user can choose how to re-use/store compiled grammars, with
the result of (1) feeding into (2),, or should (1) and (2) be a single
validate function, and it is up to the implementation to automatically
optimise for the reuse of compiled grammars?

Another question is scope. Is this just about Schematron, or do you
want a general XML Validation module, I am thinking Schematron,
RelaxNG, XML Schema and DTD?
--
Adam Retter

eXist Developer
{ United Kingdom }
ad...@exist-db.org
irc://irc.freenode.net/existdb

Claudius Teodorescu

unread,
Jan 7, 2015, 10:58:26 AM1/7/15
to exp...@googlegroups.com
Hi,

An XML Validation module is a very nice idea!

There can also be functions for conversions from a schema format to another, exporting grammars to visual formats (HTML, SVG), etc.


Claudius

Claudius Teodorescu

unread,
Jan 7, 2015, 11:01:01 AM1/7/15
to exp...@googlegroups.com
Grammar checking, too ...
Reply all
Reply to author
Forward
0 new messages