OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
Re: [xml-dev] The awesome power of Schematron: using user-defined XSLT functions in Schematron

At 2016-06-17 14:43 +0000, Costello, Roger L. wrote:
Did you know that Schematron rules and assertions can call user-defined XSLT functions?
Only when the Schematron expression is implemented using XSLT.

That capability enormously enhances the power of Schematron.
Only when the Schematron expression is implemented using XSLT.

It brings the power of a programming language to the task of validating XML instances.
Only when the Schematron expression is implemented using XSLT.

There are many implementations of Schematron, Roger. Not all of them are in XSLT:


The implementations in C++, Python, Java and Perl that are listed there will not have access to a user-defined XSLT function that you define.

And when Schematron with XSLT is deployed in environments where there are a lot of users, it can be a burden on the servers. This isn't always made public, but I am privy to situations where this is a big concern.

Accessing a user-defined XSLT function goes beyond the declaration you are making in the query language binding. You are not creating portable ISO/IEC 19757-3 when you use a user-defined XSLT function.

Section 3.17 defines the query language binding as:

named set, specified in a document called a Query Language Binding, of the languages and conventions used for assertion tests, rule-context expressions and so on, by a particular Schematron implementation

The first note does allow for other query language bindings, but section 6.4 lists only: stx, xslt, xslt1.1, exslt, xslt2, xpath, xpath2, xquery. Annex C specifies the default query language bind to be XSLT.

When you use a user-defined XSLT function, then you aren't using any of those query language bindings. So if you are not declaring your custom use of XSLT, then your Schematron expression is not conformant.

There will be better and faster implementations of Schematron and they won't necessarily be implemented using an XSLT base that provides for user-defined XSLT functions. They will have to support the default query language binding of the XSLT/XPath function library, but that does not include user-defined functions.

So I think you should temper your enthusiasm about this. Yes, what you want to do can work in an isolated non-conformant implementation of Schematron using an XSLT basis that has user-defined functions defined. Sure. The spec allows you to have any query language binding you want, and you want a custom one that is not one of the standard ones ... so you better declare that in your Schematron. Looking at your Schematron you declare:


... and you are lying about that. Your Schematron is not conformant.

So please don't tell the world that this non-conformant behaviour is built in to Schematron, because it isn't.

. . . . . . . . Ken

Check our site for free XML, XSLT, XSL-FO and UBL developer resources |
Streaming hands-on XSLT/XPath 2 training @US$45: http://goo.gl/Dd9qBK |
Crane Softwrights Ltd. _ _ _ _ _ _ http://www.CraneSoftwrights.com/x/ |
G Ken Holman _ _ _ _ _ _ _ _ _ _ mailto:gkholman@CraneSoftwrights.com |
Google+ blog _ _ _ _ _ http://plus.google.com/+GKenHolman-Crane/posts |
Legal business disclaimers: _ _ http://www.CraneSoftwrights.com/legal |

This email has been checked for viruses by Avast antivirus software.

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS