<?xml version="1.0" encoding="UTF-8"?>
<essay xml:lang="en" version="pto" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:gal="http://norman.walsh.name/rdf/gallery#">
<info>
    
    
    
    
    
    
    
    
<title>XSLT 2.0 RELAX NG Grammar</title><biblioid class="uri">http://norman.walsh.name/2005/04/19/xslt20</biblioid>
<volumenum>8</volumenum>
<issuenum>60</issuenum>
<pubdate>2005-04-19T06:56:31-04:00</pubdate>
<date>$Date: 2005-09-11 10:27:02 -0400 (Sun, 11 Sep 2005) $</date>
<author>
      <personname>
<firstname>Norman</firstname>
	<surname>Walsh</surname>
</personname>
    </author>
<copyright>
      <year>2005</year>
      <holder>Norman Walsh</holder>
    </copyright>
<abstract>
<para>A few more bug fixes for my XSLT 2.0 RELAX NG Grammar. This version
validates stylesheets conforming to the 4 Apr 2005 draft of XSLT 2.0.</para>
</abstract>
<dcterms:replaces>http://norman.walsh.name/2005/04/07/xslt20</dcterms:replaces>
<dc:subject rdf:resource="http://norman.walsh.name/knows/taxonomy#RELAXNG"/>
<dc:subject rdf:resource="http://norman.walsh.name/knows/taxonomy#XSLT2"/>
</info>

<para xml:id="p1">After
<link xlink:href="/2005/04/07/xslt20">fixing a few bugs</link>, I found
a few more. Last night, when I discovered that 
<tag class="attribute">use-when</tag> wasn't supported,
I decided that what was really needed was a thorough check against
the most recent specification. That resulted in the following changes:</para>

<itemizedlist>
<listitem>
<para xml:id="p2">Allow <tag class="attribute">xsl:version</tag>
on literal result elements (LREs) to have any value (not just “2.0”).
</para>
</listitem>
<listitem>
<para xml:id="p3">Allow <tag class="attribute">xsl:xpath-default-namespace</tag>,
<tag class="attribute">xsl:default-collation</tag>,
<tag class="attribute">xsl:type</tag>,
<tag class="attribute">xsl:validation</tag>, and
<tag class="attribute">xsl:use-when</tag> to appear on LREs.
</para>
</listitem>
<listitem>
<para xml:id="p4">Allow <tag class="attribute">version</tag>,
<tag class="attribute">exclude-result-prefixes</tag>,
<tag class="attribute">extension-element-prefixes</tag>,
<tag class="attribute">xpath-default-namespace</tag>,
<tag class="attribute">default-collation</tag>, and
<tag class="attribute">use-when</tag>
to appear on all XSL elements.
</para>
</listitem>
<listitem>
<para xml:id="p5">Allow <tag>xs:schema</tag> to appear inside <tag>xsl:schema-import</tag>.
</para>
</listitem>
<listitem>
<para xml:id="p6">
Only allow <tag class="attribute">mode</tag> on <tag>xsl:template</tag>
elements with a <tag class="attribute">match</tag>.
</para>
</listitem>
<listitem>
<para xml:id="p7">Allow content <emphasis>or</emphasis> <tag class="attribute">select</tag>
on <tag>xsl:processing-instruction</tag>, not both. Ditto for
<tag>xsl:comment</tag>.
</para>
</listitem>
<listitem>
<para xml:id="p8">Improve co-constraints on attributes on <tag>xsl:number</tag>
and <tag>xsl:for-each-group</tag>.
</para>
</listitem>
<listitem>
<para xml:id="p9">Allow <tag>xsl:sort</tag> to contain content.
</para>
</listitem>
<listitem>
<para xml:id="p10">On <tag>xsl:output</tag>, it's 
<tag class="attribute">escape-uri-attributes</tag> (with an “s”)
and <tag class="attribute">normalize-unicode</tag> is
not a simple boolean.
</para>
</listitem>
<listitem>
<para xml:id="p11">The <tag class="attribute">name</tag> attribute is required on
<tag>xsl:namespace</tag>.
</para>
</listitem>
<listitem>
<para xml:id="p12">All of the <tag>xsl:output</tag> attributes are allowed on
<tag>xsl:result-document</tag>, where they are AVTs.
</para>
</listitem>
<listitem>
<para xml:id="p13">The <tag>xsl:sequence</tag> element only contains <tag>xsl:fallback</tag>.
</para>
</listitem>
<listitem>
<para xml:id="p14">Added <tag>xsl:document</tag>.
</para>
</listitem>
</itemizedlist>

<para xml:id="p15">I also renamed and reordered some of the patterns and used the
AVT pattern in a bunch of attributes where it had been overlooked.</para>

<para xml:id="p16">The new
<link xlink:href="examples/xslt20.rnc">xslt20.rnc</link> is available.
It still works
with the (unmodified) 
<link xlink:href="examples/xslt10.rnc">xslt10.rnc</link> and
<link xlink:href="examples/xslt.rnc">xslt.rnc</link> grammars.</para>

<para xml:id="p17">Please report any bugs that you find. Share and enjoy!</para>

</essay>

