schematron icon indicating copy to clipboard operation
schematron copied to clipboard

Enhancement: support XSLT3 and XPath3

Open rjelliffe opened this issue 8 years ago • 5 comments

Schematron skeleton should be upgraded to support XSLT3 and XPath3.

There are three levels of support:

  • The implementation should allow a schema/@queryBinding value of xpath3 and converts this to the appropriate xslt:stylesheet/@version="3.0". That then enables the new xpath3 syntax. This can be done immediately, I think.

  • We need to work out a proper Query Language binding for XSLT3. There are quite a few things in XSLT3 that require thought. For example, a big part is type safety. So I think an XSLT3 binding should support sch:let/@xsl:as (in the same way that xsl:key was introduced because it is a query-language-dependent feature.)

  • We may need to figure out what the streaming story is for XSLT3. There is already a STAX QLB available, but would it be useful/necessary to have a query-language-binding subset of for "xslt3-streaming"

rjelliffe avatar Jan 10 '17 04:01 rjelliffe

I would like to get the ability of using sch:let/@xsl:as for XSLT2 binding as well.

My motivation is that in XSLT I'm used to add an @as attribute for every xsl:param and xsk:variable since I consider this to be cleaner code . So I'd like to do the same for my schematron rules.

PStellmann avatar Feb 11 '17 20:02 PStellmann

Sounds reasonable. It would not fit in with the ISO standard's query language binding for XSLT2, but that is not reason not to do it or provide it.

Regards Rick

On Sun, Feb 12, 2017 at 7:05 AM, Patrik Stellmann [email protected] wrote:

I would like to get the ability of using sch:let/@xsl https://github.com/xsl:as for XSLT2 binding as well.

My motivation is that in XSLT I'm used to add an @as https://github.com/as attribute for every xsl:param and xsk:variable since I consider this to be cleaner code . So I'd like to do the same for my schematron rules.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Schematron/schematron/issues/20#issuecomment-279172039, or mute the thread https://github.com/notifications/unsubscribe-auth/AX3VKe6kOvNFzMV0fLVEHX4k9RZDQaqlks5rbhSJgaJpZM4LfCD6 .

rjelliffe avatar Feb 12 '17 03:02 rjelliffe

One difficulty is that I don't know of any open source implementations of XSLT3.

DemiMarie avatar Mar 01 '17 21:03 DemiMarie

Yes. On XML-DEV mainlist I asked Michael Kay of SAXON fame whether the strong typing did in fact allow any optimization, and the impression I got was that it didn't really (though it could in the future... hmmm)

Furthermore, some typing-checking should really be done with assertions. I wonder whether we need assertions on variables?

So really that leaves documentation and XPath checking as the reasons for it, which was what Patrik was asking for. I suppose the easiest way is to just define a foreign namespace and allow for example sch:let/@type:as which could be declared with xpath1, xpath2, xpath3 but only used for implementations that support strong typing.

Rick

On Thu, Mar 2, 2017 at 8:06 AM, Demi Marie Obenour <[email protected]

wrote:

One difficulty is that I don't know of any open source implementations of XSLT3.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Schematron/schematron/issues/20#issuecomment-283469899, or mute the thread https://github.com/notifications/unsubscribe-auth/AX3VKYOGp9phX1SrX5cgFN32T8l6_4I5ks5rhd3DgaJpZM4LfCD6 .

rjelliffe avatar Mar 02 '17 02:03 rjelliffe

I've been working on a solution to the first level of support (first bullet in the first comment from Rick) and am hoping to create a pull request when I've run existing tests and added some new tests.

nigelwhitaker avatar Feb 17 '20 12:02 nigelwhitaker