Superseded by XSLT 2.0 RELAX NG Grammar, 19 Apr 2005.  Supersedes Validating XSLT 2.0, 25 Jul 2004.

XSLT 2.0 RELAX NG Grammar

Volume 8, Issue 51; 07 Apr 2005; last modified 08 Oct 2010

I've fixed a few bugs in my XSLT 2.0 RELAX NG Grammar.

A few months ago, I wrote about validating XSLT 2.0 with RELAX NG. I provided a RELAX NG Grammar that validates both XSLT 1.0 and XSLT 2.0 by using the externalRef feature of RELAX NG.

That grammar has served me well in the intervening months, but a few bugs have been reported:

  • #all isn't allowed in exclude-result-prefixes.

  • Neither #all nor #default is allowed in mode.

  • The separator attribute isn't allowed on xsl:value-of.

  • Content isn't allowed in xsl:value-of (as an alternative to select).

  • collation isn't allowed on xsl:sort.

I think I've fixed those bugs in xslt20.rnc which works with the (unmodified) xslt10.rnc and xslt.rnc.

Please report any bugs that you find. Share and enjoy!



—Posted by Tobi Reif on 08 Apr 2005 @ 11:03 UTC #

Interesting. Have you considered writing a custom type library that can properly validate expressions, sequences, and patterns? You could probably do this by calling Saxon's XPath parser. I'm tempted to do this with Jaxen, but that only supports XPath 1.0.

—Posted by Elliotte Rusty Harold on 08 Apr 2005 @ 03:42 UTC #

Yes. Next time I crack open the Saxon sources (I've got to update rdftwig it turns out), I'm going to poke around and see how hard it would be to do that.

Truth is, though, that I mostly use the XSLT 2.0 stylesheets with nxml-mode and I don't plan to write a custom type library in Emacs any time soon. :-)

—Posted by Norman Walsh on 08 Apr 2005 @ 03:57 UTC #

I just noticed that this schema doesn't allow some of the recent additions that have been made by the Working Group. I'll try to update it again sometime soon.

—Posted by Norman Walsh on 08 Apr 2005 @ 07:20 UTC #