Superseded by RELAX NG Grammars for XSLT 1.0, 2.0, 3.0…, 20 Feb 2012.  Supersedes XSLT 2.0 RELAX NG Grammar, 19 Apr 2005.

XSLT 2.0 RELAX NG Grammar

Volume 9, Issue 66; 12 Jul 2006; last modified 08 Oct 2010

Yet more bug fixes for my XSLT 2.0 RELAX NG Grammar. This version validates stylesheets conforming to the 8 June 2006 draft of XSLT 2.0.

In the year or so since I last published this schema, I've made a few fixes (and most recently

<foaf:name>David Carlisle</foaf:name>
offered a few more). Specifically:

  • The mode attribute on xsl:apply-templates may have the value “#current” but not “#all”. Also, the mode attribute on xsl:template may be either “#all” or a list of QNames (that may include “#default”).

  • The attribute “normalize-unicode” is now spelled “normalization-form”. And the values “NKFC” and “NKFD” are now spelled correctly: “NFKC” and “NFKD”.

  • The name attribute on xsl:namespace is now properly described as an AVT.

The new xslt20.rnc is available. It still works with the (unmodified) xslt10.rnc and xslt.rnc grammars.

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

Comments

maybe it's the XDM-spec syndrome biting again but The rnc linked from this page seems to be

# $Id: xslt20.rnc,v 1.3 2005/04/19 11:51:35 ndw Exp $

ie a version from last year, without the changes described.

—Posted by David Carlisle on 12 Jul 2006 @ 02:17 UTC #

In fact, I think the RNC was correct but, (a) I forgot to tell Subversion to update the $Id$ keyword and, (b) I forgot to update the Change Log. Both fixed now.

—Posted by Norman Walsh on 12 Jul 2006 @ 02:28 UTC #

> both fixed now.

and it validates my current stylesheet, thanks. (and for making comments visible)

—Posted by David Carlisle on 12 Jul 2006 @ 02:37 UTC #

Hi Norman... Thanks for these schemas! Excuse me for pimping my software, but I've just released a free Cocoa app called XML Nanny that will graphically validate your instance docs against RNC, RNG, DTD, WXS and Schematron. I thought you mightl like to try it with your RNCs, I just did. It was fun :)

—Posted by Todd Ditchendorf on 13 Jul 2006 @ 05:53 UTC #

Woopsie... XML Nanny

—Posted by Todd Ditchendorf on 13 Jul 2006 @ 04:59 UTC #

Thank you for these schema, Norman! I've been using NXML mode for a while with my XSLT 1.0 docs, but I was annoyed with the inability to validate XSLT 2.0 on the fly.

—Posted by Ben Norman on 04 Jun 2007 @ 03:35 UTC #

I found an error in your XSLT 2.0 schema. In xsl:number it says that the select attribute is mandatory but the XSLT spec says it is optional. Actually when you use the value attribute, select isn't even allowed. I added a ? after "attribute select { expression.datatype }" in element number.

—Posted by Piet van Oostrum on 28 Oct 2010 @ 11:21 UTC #

I'm confused, Piet. The "?" is clearly in the xslt20.rnc file linked from this page, so I'm not sure what you changed.

There were earlier versions of xslt20.rnc that might have had that bug, do you possibly have one of them?

—Posted by Norman Walsh on 08 Nov 2010 @ 12:05 UTC #