html5/markup/tools generate-spec-source.xsl,1.266,1.267 specgen.xsl,1.70,1.71 toc.xsl,1.17,1.18

Update of /sources/public/html5/markup/tools
In directory hutz:/tmp/cvs-serv31532/tools

Modified Files:
	generate-spec-source.xsl specgen.xsl toc.xsl 
Log Message:
fixed spec links for event-handler attributes, and make some tweaks to speed up the build a bit


Index: generate-spec-source.xsl
===================================================================
RCS file: /sources/public/html5/markup/tools/generate-spec-source.xsl,v
retrieving revision 1.266
retrieving revision 1.267
diff -u -d -r1.266 -r1.267
--- generate-spec-source.xsl	15 Jul 2010 16:49:47 -0000	1.266
+++ generate-spec-source.xsl	22 Jul 2010 05:48:27 -0000	1.267
@@ -10,9 +10,13 @@
   <xsl:output method="xml"/>
   <xsl:param name="show-content-models" select="0"/>
   <xsl:param name="aria" select="0"/>
-  <xsl:param name="rnc-html">../schema.html</xsl:param>
-  <xsl:param name="head">../src/head.html</xsl:param>
-  <xsl:param name="header">../src/header.src.html</xsl:param>
+  <xsl:param name="rnc-html" select="document('../schema.html')"/>
+  <xsl:param name="attributes" select="document('../src/attributes.html')"/>
+  <xsl:param name="head" select="document('../src/head.html')"/>
+  <xsl:param name="header" select="document('../src/header.src.html')"/>
+  <xsl:key name="elements" match="*" use="@id"/>
+  <xsl:key name="filename-map" match="ul" use="li"/>
+  <xsl:key name="interface-name" match="pre[@class='idl']" use="dfn"/>
   <xsl:variable name="assertions">
     <!-- * FIXME: really should be doing this with keys... -->
     <xsl:for-each
@@ -61,10 +65,10 @@
   <xsl:template match="/">
     <html xml:lang="en">
       <xsl:text>&#10;  </xsl:text>
-      <xsl:copy-of select="document($head)"/>
+      <xsl:copy-of select="$head"/>
       <xsl:text>&#10;  </xsl:text>
       <body>
-        <xsl:copy-of select="document($header)//*[local-name() = 'body']/node()"/>
+        <xsl:copy-of select="$header//*[local-name() = 'body']/node()"/>
         <div id="this_sections">
           <xsl:text>&#10;      </xsl:text>
           <xsl:copy-of select="document('../src/intro-scope.html')"/>
@@ -102,7 +106,7 @@
               <a href="#elements">HTML elements</a>
               section.</p>
             <xsl:for-each
-              select="document($rnc-html)//*[@class='pattern']
+              select="$rnc-html//*[@class='pattern']
               [starts-with(@id,'common.elem.')]">
               <xsl:sort select="@id"/>
               <xsl:variable name="type">
@@ -167,7 +171,7 @@
               <xsl:text>&#10;        </xsl:text>
               <div class="attr-content-models">
                   <xsl:for-each
-                    select="document($rnc-html)//h:*[@id='common.attrs']/node()">
+                    select="$rnc-html//h:*[@id='common.attrs']/node()">
                     <xsl:variable name="ref" select="substring-after(@href,'#')"/>
                     <xsl:variable name="type">
                       <xsl:call-template name="substring-after-last">
@@ -193,7 +197,7 @@
               <xsl:text>&#10;        </xsl:text>
             </div>
             <xsl:text>&#10;      </xsl:text>
-            <xsl:for-each select="document($rnc-html)//h:*
+            <xsl:for-each select="$rnc-html//h:*
               [@id='common.attrs']/h:a[not(.='common.attrs.other')][not(@class='rnc-symbol')]">
               <xsl:variable name="ref" select="substring-after(@href,'#')"/>
               <xsl:variable name="type">
@@ -235,7 +239,7 @@
                           <!-- * <xsl:value-of select="."/> -->
                       <!-- * </a></span> -->
                       <!-- * <xsl:text> = </xsl:text> -->
-                      <xsl:for-each select="document($rnc-html)//*[@id=$ref]/node()">
+                      <xsl:for-each select="$rnc-html//*[@id=$ref]/node()">
                         <xsl:choose>
                           <xsl:when test="@href='#common.attrs.xmlbase'">
                             <xsl:copy>
@@ -269,7 +273,7 @@
                 <div class="no-number no-toc">
                   <xsl:text>&#10;        </xsl:text>
                   <dl class="attr-defs">
-                    <xsl:for-each select="document($rnc-html)//h:*[@id=$ref]/h:a[not(@class='rnc-symbol')]">
+                    <xsl:for-each select="$rnc-html//h:*[@id=$ref]/h:a[not(@class='rnc-symbol')]">
                       <xsl:call-template name="make.attribute.definition"/>
                     </xsl:for-each>
                     <xsl:text>&#10;        </xsl:text>
@@ -277,7 +281,7 @@
                 </div>
               </section>
             </xsl:for-each>
-            <xsl:for-each select="document($rnc-html)//h:*
+            <xsl:for-each select="$rnc-html//h:*
               [@id='common.attrs.other']/h:a">
               <xsl:variable name="ref" select="substring-after(@href,'#')"/>
               <xsl:variable name="type">
@@ -322,7 +326,7 @@
                           <xsl:value-of select="."/>
                       </a></span>
                       <xsl:text> = </xsl:text>
-                      <xsl:for-each select="document($rnc-html)//*[@id=$ref]/node()">
+                      <xsl:for-each select="$rnc-html//*[@id=$ref]/node()">
                         <xsl:copy-of select="."/>
                       </xsl:for-each>
                       <xsl:text>&#10;            </xsl:text>
@@ -336,7 +340,7 @@
                   <div class="no-number no-toc">
                     <xsl:text>&#10;        </xsl:text>
                     <dl class="attr-defs">
-                      <xsl:for-each select="document($rnc-html)//h:*[@id=$ref]/h:a">
+                      <xsl:for-each select="$rnc-html//h:*[@id=$ref]/h:a">
                         <xsl:call-template name="make.attribute.definition"/>
                       </xsl:for-each>
                       <xsl:text>&#10;        </xsl:text>
@@ -359,10 +363,10 @@
             <dl class="attr-defs">
               <xsl:text>&#10;        </xsl:text>
               <xsl:for-each select="
-                (document($rnc-html)//h:span[@class='pattern']
+                ($rnc-html//h:span[@class='pattern']
                 [starts-with(@id,'common-form.attrs.')])
                 |
-                (document($rnc-html)//h:span[@class='pattern']
+                ($rnc-html//h:span[@class='pattern']
                 [starts-with(@id,'shared-form.attrs') or starts-with(@id,'input.attrs')]
                 [not(@id='shared-form.attrs.formmethod.data')]
                 [not(@id='shared-form.attrs.formenctype.data')])
@@ -393,7 +397,7 @@
                           or @href='#shared-form.attrs.formenctype.data'
                           ">
                           <xsl:variable name="ref" select="substring-after(@href,'#')"/>
-                          <xsl:for-each select="document($rnc-html)//*[@id=$ref]/node()">
+                          <xsl:for-each select="$rnc-html//*[@id=$ref]/node()">
                             <xsl:call-template name="process.datatype.reference"/>
                           </xsl:for-each>
                         </xsl:when>
@@ -405,17 +409,17 @@
                   </span>
                   <xsl:text> </xsl:text>
                   <xsl:variable name="ref" select="@id"/>
-                  <xsl:if test="document('../src/attributes.html')//*[@id=$ref][contains(@class,'new')]">
+                  <xsl:if test="$attributes//*[@id=$ref][contains(@class,'new')]">
                     <span class="new-feature"
                       title="This markup feature is newly added in HTML5."
                       >NEW</span>
                   </xsl:if>
-                  <xsl:if test="document('../src/attributes.html')//*[@id=$ref][contains(@class,'changed')]">
+                  <xsl:if test="$attributes//*[@id=$ref][contains(@class,'changed')]">
                     <span class="changed-feature"
                       title="The meaning, structure, or purpose of this markup feature has changed in HTML5."
                       >CHANGED</span>
                   </xsl:if>
-                  <xsl:if test="document('../src/attributes.html')//*[@id=$ref][contains(@class,'obsolete')]">
+                  <xsl:if test="$attributes//*[@id=$ref][contains(@class,'obsolete')]">
                     <span class="obsoleted-feature"
                       title="This markup feature has been obsoleted in HTML5."
                       >OBSOLETE</span>
@@ -425,9 +429,9 @@
                 <xsl:variable name="ref" select="@id"/>
                 <xsl:choose>
                   <xsl:when
-                    test="document('../src/attributes.html')//*[@id=$ref]">
+                    test="$attributes//*[@id=$ref]">
                     <xsl:copy-of
-                      select="document('../src/attributes.html')//h:dd[preceding-sibling::h:dt[@id=$ref]]"/>
+                      select="$attributes//h:dd[preceding-sibling::h:dt[@id=$ref]]"/>
                   </xsl:when>
                   <xsl:otherwise>
                     <xsl:message>Missing description for:<xsl:text> </xsl:text><xsl:value-of select="@id"/></xsl:message>
@@ -455,7 +459,7 @@
             <xsl:copy-of
               select="document('../src/datatypes.html')//h:section[ancestor::h:section]"/>
             <xsl:for-each
-              select="document($rnc-html)//*[@class='pattern']
+              select="$rnc-html//*[@class='pattern']
               [starts-with(@id,'common.data.')
               or starts-with(@id,'form.data.')]">
               <xsl:variable name="pattern">
@@ -643,7 +647,7 @@
                     </dt>
                     <dd>
                       <xsl:for-each
-                        select="document($rnc-html)//h:*[@id='common.attrs.aria']/node()">
+                        select="$rnc-html//h:*[@id='common.attrs.aria']/node()">
                         <xsl:copy-of select="."/>
                       </xsl:for-each>
                       <xsl:text>&#10;            </xsl:text>
@@ -652,7 +656,7 @@
                   </dl>
                   <xsl:text>&#10;        </xsl:text>
                 </div>
-                <xsl:for-each select="document($rnc-html)//h:*
+                <xsl:for-each select="$rnc-html//h:*
                   [@id='common.attrs.aria']/h:a[not(@class='rnc-symbol')]">
                   <xsl:variable name="ref" select="substring-after(@href,'#')"/>
                   <xsl:variable name="type">
@@ -688,7 +692,7 @@
                           <xsl:text> = </xsl:text>
                         </dt>
                         <dd>
-                          <xsl:for-each select="document($rnc-html)//*[@id=$ref]/node()">
+                          <xsl:for-each select="$rnc-html//*[@id=$ref]/node()">
                             <xsl:copy-of select="."/>
                           </xsl:for-each>
                           <xsl:text>&#10;            </xsl:text>
@@ -710,7 +714,7 @@
                 <div id="common.attrs.aria.implicit-mdl">
                   <xsl:text>&#10;        </xsl:text>
                   <xsl:for-each
-                    select="document($rnc-html)//h:*[@class='pattern'][starts-with(@id,'common.attrs.aria.implicit')]">
+                    select="$rnc-html//h:*[@class='pattern'][starts-with(@id,'common.attrs.aria.implicit')]">
                     <dl class="content-models">
                       <xsl:text>&#10;            </xsl:text>
                       <dt class="content-model">
@@ -744,7 +748,7 @@
                 <div id="common.attrs.aria.landmark-mdl">
                   <xsl:text>&#10;        </xsl:text>
                   <xsl:for-each
-                    select="document($rnc-html)//h:*[@class='pattern'][starts-with(@id,'common.attrs.aria.landmark')]">
+                    select="$rnc-html//h:*[@class='pattern'][starts-with(@id,'common.attrs.aria.landmark')]">
                     <dl class="content-models">
                       <xsl:text>&#10;            </xsl:text>
                       <dt class="content-model">
@@ -781,7 +785,7 @@
                 <div class="no-number no-toc">
                   <xsl:text>&#10;        </xsl:text>
                   <div class="attr-defs">
-                    <xsl:for-each select="document($rnc-html)//h:*[@class='define']
+                    <xsl:for-each select="$rnc-html//h:*[@class='define']
                       [starts-with(@id,'aria-')]/*[@class='patternname']/h:a
                       ">
                       <xsl:sort select="@href"/>
@@ -931,7 +935,11 @@
       </xsl:variable>
       <xsl:choose>
         <xsl:when test="$name='button.submit'">
-          <xsl:variable name="filename" select="document('../fragment-links.html')//*[preceding-sibling::*='#the-button-element']"/>
+          <xsl:variable name="filename">
+            <xsl:call-template name="get-spec-filename">
+              <xsl:with-param name="ref">#the-button-element</xsl:with-param>
+            </xsl:call-template>
+          </xsl:variable>
           <xsl:text>&#10;    </xsl:text>
           <section id="button" class="no-number">
             <xsl:text>&#10;      </xsl:text>
@@ -940,14 +948,14 @@
               <xsl:text> </xsl:text>
               <span class="spec-link">
                 <a title="Read about the button element in the HTML5 spec"
-                  href="http://dev.w3.org/html5/spec-author-view/{$filename}.html#the-button-element">&#9432;</a>
+                  href="{$filename}.html#the-button-element">&#9432;</a>
               </span>
             </h2>
             <xsl:text>&#10;      </xsl:text>
             <div>
               <xsl:text>&#10;      </xsl:text>
               <xsl:for-each
-                select="document($rnc-html)
+                select="$rnc-html
                 //h:span[@id='button']
                 ">
                 <xsl:call-template name="make.special.context"/>
@@ -964,7 +972,11 @@
           </section>
         </xsl:when>
         <xsl:when test="$name='command.command'">
-          <xsl:variable name="filename" select="document('../fragment-links.html')//*[preceding-sibling::*='#the-command']"/>
+          <xsl:variable name="filename">
+            <xsl:call-template name="get-spec-filename">
+              <xsl:with-param name="ref">#the-command</xsl:with-param>
+            </xsl:call-template>
+          </xsl:variable>
           <xsl:text>&#10;    </xsl:text>
           <section id="command" class="no-number">
             <xsl:text>&#10;      </xsl:text>
@@ -973,7 +985,7 @@
               <xsl:text> </xsl:text>
               <span class="spec-link">
                 <a title="Read about the command element in the HTML5 spec"
-                  href="http://dev.w3.org/html5/spec-author-view/{$filename}.html#the-command">&#9432;</a>
+                  href="{$filename}.html#the-command">&#9432;</a>
               </span>
               <xsl:text> </xsl:text>
               <span class="new-feature" title="This markup feature is newly added in HTML5.">NEW</span>
@@ -982,7 +994,7 @@
             <div>
               <xsl:text>&#10;      </xsl:text>
               <xsl:for-each
-                select="document($rnc-html)
+                select="$rnc-html
                 //h:span[@id='command']
                 ">
                 <xsl:call-template name="make.special.context"/>
@@ -997,7 +1009,11 @@
           </section>
         </xsl:when>
         <xsl:when test="$name='input.text'">
-          <xsl:variable name="filename" select="document('../fragment-links.html')//*[preceding-sibling::*='#the-input-element']"/>
+          <xsl:variable name="filename">
+            <xsl:call-template name="get-spec-filename">
+              <xsl:with-param name="ref">#the-input-element</xsl:with-param>
+            </xsl:call-template>
+          </xsl:variable>
           <xsl:text>&#10;    </xsl:text>
           <section id="input" class="no-number">
             <xsl:text>&#10;      </xsl:text>
@@ -1006,14 +1022,14 @@
               <xsl:text> </xsl:text>
               <span class="spec-link">
                 <a title="Read about the input element in the HTML5 spec"
-                  href="http://dev.w3.org/html5/spec-author-view/{$filename}.html#the-input-element">&#9432;</a>
+                  href="{$filename}.html#the-input-element">&#9432;</a>
               </span>
             </h2>
             <xsl:text>&#10;      </xsl:text>
             <div>
               <xsl:text>&#10;      </xsl:text>
               <xsl:for-each
-                select="document($rnc-html)
+                select="$rnc-html
                 //h:span[@id='input']
                 ">
                 <xsl:call-template name="make.special.context"/>
@@ -1028,7 +1044,11 @@
           </section>
         </xsl:when>
         <xsl:when test="$name='meta.name'">
-          <xsl:variable name="filename" select="document('../fragment-links.html')//*[preceding-sibling::*='#meta']"/>
+          <xsl:variable name="filename">
+            <xsl:call-template name="get-spec-filename">
+              <xsl:with-param name="ref">#meta</xsl:with-param>
+            </xsl:call-template>
+          </xsl:variable>
           <xsl:text>&#10;    </xsl:text>
           <section id="meta" class="no-number">
             <xsl:text>&#10;      </xsl:text>
@@ -1037,7 +1057,7 @@
               <xsl:text> </xsl:text>
               <span class="spec-link">
                 <a title="Read about the meta element in the HTML5 spec"
-                  href="http://dev.w3.org/html5/spec-author-view/{$filename}.html#meta">&#9432;</a>
+                  href="{$filename}.html#meta">&#9432;</a>
               </span>
             </h2>
             <xsl:text>&#10;      </xsl:text>
@@ -1061,9 +1081,9 @@
           </section>
         </xsl:when>
       </xsl:choose>
-      <xsl:message>
-        <xsl:value-of select="$short-name"/>
-      </xsl:message>
+      <!-- * <xsl:message> -->
+        <!-- * <xsl:value-of select="$short-name"/> -->
+      <!-- * </xsl:message> -->
       <section>
         <xsl:attribute name="id">
           <xsl:value-of select="$name"/>
@@ -1207,15 +1227,19 @@
               </xsl:choose>
             </xsl:variable>
             <xsl:text> </xsl:text>
-            <xsl:message>
-              <xsl:text>  </xsl:text>
-              <xsl:value-of select="$target"/>
-            </xsl:message>
-            <xsl:variable name="filename" select="document('../fragment-links.html')//*[preceding-sibling::*=$target]"/>
+            <!-- * <xsl:message> -->
+              <!-- * <xsl:text>  </xsl:text> -->
+              <!-- * <xsl:value-of select="$target"/> -->
+            <!-- * </xsl:message> -->
+            <xsl:variable name="filename">
+              <xsl:call-template name="get-spec-filename">
+                <xsl:with-param name="ref" select="$target"/>
+              </xsl:call-template>
+            </xsl:variable>
             <span class="spec-link">
               <xsl:text> </xsl:text>
               <a title="Read about the {$name} element in the HTML5 spec"
-                href="http://dev.w3.org/html5/spec-author-view/{$filename}.html{$target}">&#9432;</a>
+                href="{$filename}.html{$target}">&#9432;</a>
             </span>
           <xsl:text> </xsl:text>
           <xsl:if test='not($obsoleted="")'>
@@ -1461,7 +1485,7 @@
           <xsl:when test="$name='li'">1</xsl:when>
           <xsl:otherwise>
             <xsl:value-of
-              select="count(document($rnc-html)//*[@id=$name
+              select="count($rnc-html//*[@id=$name
               or (starts-with(@id,$name-dot) and
               child::h:span[@class='type']='element ')]/*[@class =
               'model'])"/>
@@ -1492,7 +1516,7 @@
         <xsl:choose>
           <!-- * <xsl:when test="$name='meta'"> -->
             <!-- * <xsl:for-each -->
-              <!-- * select="document($rnc-html)//*[@id=$name -->
+              <!-- * select="$rnc-html//*[@id=$name -->
               <!-- * or (starts-with(@id,$name-dot) and child::h:span[@class='type']='element ')]/*[@class = 'model']"> -->
               <!-- * <xsl:variable name="pname" select="../@id"/> -->
               <!-- * <xsl:call-template name="make.content.model"> -->
@@ -1502,7 +1526,7 @@
               <!-- * </xsl:call-template> -->
             <!-- * </xsl:for-each> -->
             <!-- * <xsl:for-each -->
-              <!-- * select="document($rnc-html)//*[@id='meta.elem.encoding']"> -->
+              <!-- * select="$rnc-html//*[@id='meta.elem.encoding']"> -->
               <!-- * <xsl:call-template name="make.content.model"> -->
                 <!-- * <xsl:with-param name="count" select="$count"/> -->
                 <!-- * <xsl:with-param name="name" select="$name"/> -->
@@ -1514,7 +1538,7 @@
             <p class="elem-mdl"><span>empty (<a href="#void-element">void element</a>)</span></p>
           </xsl:when>
           <xsl:when test="$name='li'">
-            <xsl:for-each select="document($rnc-html)//*[@id='li']/*[@class = 'model']">
+            <xsl:for-each select="$rnc-html//*[@id='li']/*[@class = 'model']">
               <xsl:variable name="pname" select="../@id"/>
               <xsl:call-template name="make.content.model">
                 <xsl:with-param name="count" select="$count"/>
@@ -1524,7 +1548,7 @@
             </xsl:for-each>
           </xsl:when>
           <xsl:when test="$name='style'">
-            <xsl:for-each select="document($rnc-html)//*[@id='style']/*[@class = 'model']">
+            <xsl:for-each select="$rnc-html//*[@id='style']/*[@class = 'model']">
               <xsl:variable name="pname" select="../@id"/>
               <xsl:call-template name="make.content.model">
                 <xsl:with-param name="count" select="$count"/>
@@ -1534,7 +1558,7 @@
             </xsl:for-each>
           </xsl:when>
           <xsl:when test="$name='script'">
-            <xsl:for-each select="document($rnc-html)//*[@id='script.elem.embedded']/*[@class = 'model']">
+            <xsl:for-each select="$rnc-html//*[@id='script.elem.embedded']/*[@class = 'model']">
               <xsl:variable name="pname" select="../@id"/>
               <xsl:call-template name="make.content.model">
                 <xsl:with-param name="count" select="$count"/>
@@ -1545,7 +1569,7 @@
           </xsl:when>
           <xsl:otherwise>
             <xsl:for-each
-              select="document($rnc-html)//*[@id=$name
+              select="$rnc-html//*[@id=$name
               or (starts-with(@id,$name-dot) and child::h:span[@class='type']='element ')]/*[@class = 'model']">
               <xsl:variable name="pname" select="../@id"/>
               <xsl:call-template name="make.content.model">
@@ -1709,7 +1733,7 @@
           <xsl:choose>
             <xsl:when test="$name='li'">
               <xsl:for-each
-                select="document($rnc-html)//h:span[@class
+                select="$rnc-html//h:span[@class
                 = 'pattern'][child::h:a[@href = '#li'
                 or @href = '#mli'
                 or @href = '#oli'
@@ -1742,7 +1766,7 @@
                   or $name='command'
                   ">
                   <xsl:for-each
-                    select="document($rnc-html)//h:span[@class
+                    select="$rnc-html//h:span[@class
                     = 'pattern'][child::h:a[@href = concat('#',$name)
                     or starts-with(@href,concat('#',$name,'.elem.'))
                     ]]">
@@ -1754,7 +1778,7 @@
                 </xsl:when>
                 <xsl:otherwise>
                   <xsl:for-each
-                    select="document($rnc-html)//h:span[@class
+                    select="$rnc-html//h:span[@class
                     = 'pattern'][descendant::h:a[@href = concat('#',$full-name)
                     or starts-with(@href,concat('#',$full-name,'.elem.'))
                     ]][not(@id='script')]">
@@ -1787,28 +1811,26 @@
       <xsl:choose>
         <xsl:when test="document(concat('../elements/',$name,'.html'))//h:div[@id='dom-interface']">
           <xsl:variable name="interface" select="document(concat('../elements/',$name,'.html'))//h:div[@id='dom-interface']"/>
-          <xsl:choose>
-            <xsl:when test="document('../webapps.html')//*[@class='idl'][dfn=$interface]">
-              <pre class="idl">
-                <xsl:for-each select="document('../webapps.html')//*[@class='idl'][dfn=$interface]/node()">
-                  <xsl:choose>
-                    <xsl:when test="self::dfn">
-                      <b><xsl:value-of select="."/></b>
-                    </xsl:when>
-                    <xsl:when test="self::a">
-                      <a href="{$spec-url}{@href}" title="{@title}"><xsl:value-of select="."/></a>
-                    </xsl:when>
-                    <xsl:otherwise>
-                      <xsl:copy-of select="."/>
-                    </xsl:otherwise>
-                  </xsl:choose>
-                </xsl:for-each>
-              </pre>
-            </xsl:when>
-            <xsl:otherwise>
-              <xsl:message>ERROR: interface <xsl:value-of select="$interface"/> not found</xsl:message>
-            </xsl:otherwise>
-          </xsl:choose>
+          <xsl:variable name="idl-section">
+            <xsl:call-template name="get-idl">
+              <xsl:with-param name="interface" select="$interface"/>
+            </xsl:call-template>
+          </xsl:variable>
+          <pre class="idl">
+            <xsl:for-each select="exsl:node-set($idl-section)/pre[@class='idl']/node()">
+              <xsl:choose>
+                <xsl:when test="self::dfn">
+                  <b><xsl:value-of select="."/></b>
+                </xsl:when>
+                <xsl:when test="self::a">
+                  <a href="{$spec-url}{@href}" title="{@title}"><xsl:value-of select="."/></a>
+                </xsl:when>
+                <xsl:otherwise>
+                  <xsl:copy-of select="."/>
+                </xsl:otherwise>
+              </xsl:choose>
+            </xsl:for-each>
+          </pre>
         </xsl:when>
         <xsl:otherwise>
           <p class="dom-interface">Uses
@@ -2048,7 +2070,7 @@
       <h2 class="element-subhead">Permitted attributes</h2>
       <xsl:text>&#10;        </xsl:text>
       <xsl:choose>
-        <xsl:when test="document($rnc-html)//*[(starts-with(@id,$name-dot)
+        <xsl:when test="$rnc-html//*[(starts-with(@id,$name-dot)
           and substring(@id,string-length(@id)-4)='attrs')]">
           <xsl:choose>
             <xsl:when test="@name='embed'">
@@ -2062,7 +2084,7 @@
                     <!-- * </a> -->
                     <!-- * <xsl:text> = </xsl:text> -->
                   <xsl:for-each
-                    select="document($rnc-html)//*[@class='pattern']
+                    select="$rnc-html//*[@class='pattern']
                     [@id='embed.attrs']/node()">
                     <xsl:choose>
                       <xsl:when test="contains(@class,'zeroormore')"/>
@@ -2106,12 +2128,12 @@
                   <span
                     class="pattern" id="area.attrs">
                     <xsl:for-each
-                      select="document($rnc-html)//*[@id='area.attrs']/node()">
+                      select="$rnc-html//*[@id='area.attrs']/node()">
                       <xsl:choose>
                         <xsl:when
                           test="@href='#area.attrs.shape'">
                           <xsl:copy-of
-                            select="document($rnc-html)//*[@id='area.attrs.shape']/node()"/>
+                            select="$rnc-html//*[@id='area.attrs.shape']/node()"/>
                         </xsl:when>
                         <xsl:otherwise>
                           <xsl:copy-of select="."/>
@@ -2138,7 +2160,7 @@
             <xsl:otherwise>
               <div>
                 <xsl:attribute name="class">attr-content-models</xsl:attribute>
-                <xsl:for-each select="document($rnc-html)//*[starts-with(@id,$name-dot)
+                <xsl:for-each select="$rnc-html//*[starts-with(@id,$name-dot)
                   and substring(@id,string-length(@id)-4)='attrs']">
                   <xsl:text>&#10;          </xsl:text>
                   <p>
@@ -2170,16 +2192,16 @@
                               </xsl:choose>
                             </xsl:for-each>
                           </xsl:when>
-                          <xsl:when test="document($rnc-html)//h:*[@id = $ref]//h:a[@href='#common-form.attrs']">
+                          <xsl:when test="$rnc-html//h:*[@id = $ref]//h:a[@href='#common-form.attrs']">
                             <span class="pattern" id="{@id}">
-                              <xsl:for-each select="document($rnc-html)//h:*[@id = $ref]/node()">
+                              <xsl:for-each select="$rnc-html//h:*[@id = $ref]/node()">
                                 <xsl:choose>
                                   <xsl:when test="@class='agroupof'">
                                     <xsl:for-each select="node()">
                                       <xsl:choose>
                                         <xsl:when test="@href='#common-form.attrs'">
                                           <xsl:for-each
-                                            select="document($rnc-html)//h:*[@id = 'common-form.attrs']/node()">
+                                            select="$rnc-html//h:*[@id = 'common-form.attrs']/node()">
                                             <xsl:copy-of select="."/>
                                           </xsl:for-each>
                                         </xsl:when>
@@ -2193,7 +2215,7 @@
                                     <xsl:choose>
                                       <xsl:when test="@href='#common-form.attrs'">
                                         <xsl:for-each
-                                          select="document($rnc-html)//h:*[@id = 'common-form.attrs']/node()">
+                                          select="$rnc-html//h:*[@id = 'common-form.attrs']/node()">
                                           <xsl:copy-of select="."/>
                                         </xsl:for-each>
                                       </xsl:when>
@@ -2231,10 +2253,10 @@
             </xsl:otherwise>
           </xsl:choose>
         </xsl:when>
-        <xsl:when test="document($rnc-html)//*[@id = 'script.attrs.embedded'
+        <xsl:when test="$rnc-html//*[@id = 'script.attrs.embedded'
           or @id = 'script.attrs.imported']">
           <div class="attr-content-models">
-            <xsl:for-each select="document($rnc-html)//*[@id = 'script.attrs.embedded'
+            <xsl:for-each select="$rnc-html//*[@id = 'script.attrs.embedded'
               or @id = 'script.attrs.imported']">
               <xsl:text>&#10;          </xsl:text>
               <!-- * <dt class="attr-content-model"> -->
@@ -2259,7 +2281,7 @@
   <xsl:template name="make.attribute.definitions.section">
     <xsl:param name="name"/>
     <xsl:param name="name-dot" select="concat($name, '.')"/>
-    <xsl:if test="document($rnc-html)//*[(starts-with(@id,$name-dot)
+    <xsl:if test="$rnc-html//*[(starts-with(@id,$name-dot)
       and substring(@id,string-length(@id)-4)='attrs')]//h:a[not(starts-with(.,'common'))
       and not(starts-with(.,'media.'))
       and not(starts-with(@href,'#common-form.attrs.'))
@@ -2280,7 +2302,7 @@
         <dl class="attr-defs">
           <xsl:choose>
             <xsl:when test="@name='video'">
-              <xsl:for-each select="document($rnc-html)//h:a[starts-with(@href,'#video.attrs.')]
+              <xsl:for-each select="$rnc-html//h:a[starts-with(@href,'#video.attrs.')]
                 ">
                 <xsl:call-template name="make.attribute.definition">
                   <xsl:with-param name="name" select="$name"/>
@@ -2288,7 +2310,7 @@
               </xsl:for-each>
             </xsl:when>
             <xsl:when test="@name='audio'">
-              <xsl:for-each select="document($rnc-html)//h:a[starts-with(@href,'#audio.attrs.')]
+              <xsl:for-each select="$rnc-html//h:a[starts-with(@href,'#audio.attrs.')]
                 ">
                 <xsl:call-template name="make.attribute.definition">
                   <xsl:with-param name="name" select="$name"/>
@@ -2296,7 +2318,7 @@
               </xsl:for-each>
             </xsl:when>
             <xsl:when test="@name='embed'">
-              <xsl:for-each select="document($rnc-html)//h:a[starts-with(@href,'#embed.attrs.')]
+              <xsl:for-each select="$rnc-html//h:a[starts-with(@href,'#embed.attrs.')]
                 [not(@href='#embed.attrs.other')]
                 ">
                 <xsl:call-template name="make.attribute.definition">
@@ -2306,7 +2328,7 @@
             </xsl:when>
             <xsl:when test="@name='area'">
               <xsl:for-each
-                select="document($rnc-html)//h:a[starts-with(@href,'#area.attrs.')]
+                select="$rnc-html//h:a[starts-with(@href,'#area.attrs.')]
                 [not(@href='#area.attrs.shape')]
                 [not(@href='#area.attrs.shape')]
                 [not(starts-with(@href,'#area.attrs.shape.'))]
@@ -2318,7 +2340,7 @@
                 </xsl:call-template>
               </xsl:for-each>
               <xsl:for-each
-                select="document($rnc-html)//h:a
+                select="$rnc-html//h:a
                 [starts-with(@href,'#area.attrs.shape.')]
                 ">
                 <xsl:call-template
@@ -2328,14 +2350,14 @@
               </xsl:for-each>
             </xsl:when>
             <xsl:when test="@name='colgroup'">
-              <xsl:for-each select="document($rnc-html)//*[@id = 'colgroup.inner']/h:a[contains(@href,'attrs')]">
+              <xsl:for-each select="$rnc-html//*[@id = 'colgroup.inner']/h:a[contains(@href,'attrs')]">
                 <xsl:call-template name="make.attribute.definition">
                   <xsl:with-param name="name" select="$name"/>
                 </xsl:call-template>
               </xsl:for-each>
             </xsl:when>
             <xsl:when test="@name='li'">
-              <xsl:for-each select="document($rnc-html)//*[@id = 'li.attrs'
+              <xsl:for-each select="$rnc-html//*[@id = 'li.attrs'
                 or @id = 'oli.attrs' or @id = 'mli.attrs']/h:a[not(contains(.,'common.'))]">
                 <xsl:call-template name="make.attribute.definition">
                   <xsl:with-param name="name" select="$name"/>
@@ -2343,7 +2365,7 @@
               </xsl:for-each>
             </xsl:when>
             <xsl:when test="@name='script'">
-              <xsl:for-each select="document($rnc-html)//*[@id = 'script.attrs.embedded'
+              <xsl:for-each select="$rnc-html//*[@id = 'script.attrs.embedded'
                 or @id = 'script.attrs.imported']/h:a">
                 <xsl:call-template name="make.attribute.definition">
                   <xsl:with-param name="name" select="$name"/>
@@ -2351,7 +2373,7 @@
               </xsl:for-each>
             </xsl:when>
             <xsl:otherwise>
-              <xsl:for-each select="document($rnc-html)//*[starts-with(@id,$name-dot)
+              <xsl:for-each select="$rnc-html//*[starts-with(@id,$name-dot)
                 and substring(@id,string-length(@id)-4)='attrs']//h:a[not(contains(.,'common'))
                 and not(@href = '#media.attrs')
                 and not(starts-with(@href,'#common-form.attrs.'))
@@ -2488,14 +2510,14 @@
             </xsl:choose>
           <xsl:variable name="model">
             <xsl:copy-of
-              select="//*[@id=$ref]//*[@class='model']"/>
+              select="key('elements',$ref)//*[@class='model']"/>
           </xsl:variable>
           <xsl:text> = </xsl:text>
           <span class="attr-values">
             <xsl:choose>
               <xsl:when test="$ref='form.attrs.method' or $ref='form.attrs.enctype'">
                 <xsl:variable name="datatype" select="concat($ref,'.data')"/>
-                <xsl:for-each select="document($rnc-html)//*[@id=$datatype]/node()">
+                <xsl:for-each select="$rnc-html//*[@id=$datatype]/node()">
                   <xsl:call-template name="process.datatype.reference"/>
                 </xsl:for-each>
               </xsl:when>
@@ -2504,7 +2526,7 @@
               </xsl:when>
               <xsl:when
                 test="not(//*[@id=$ref]//*[@class='model']/h:a)">
-                <xsl:for-each select="//*[@id=$ref]//*[@class='model']/node()">
+                <xsl:for-each select="key('elements',$ref)//*[@class='model']/node()">
                   <xsl:choose>
                     <xsl:when test="name()=''">
                       <xsl:call-template name="string.subst">
@@ -2521,7 +2543,7 @@
               </xsl:when>
               <xsl:otherwise>
                 <xsl:for-each
-                  select="//*[@id=$ref]//*[@class='model']/node()">
+                  select="key('elements',$ref)//*[@class='model']/node()">
                   <xsl:choose>
                     <xsl:when test="name()=''">
                       <xsl:call-template name="string.subst">
@@ -2634,6 +2656,9 @@
           </span>
           <xsl:variable name="spec-target">
             <xsl:choose>
+              <xsl:when test="starts-with($href,'#scripting.attr.on')">
+                <xsl:value-of select="concat('#handler-',substring-after($href,'#scripting.attr.'))"/>
+              </xsl:when>
               <xsl:when test="not($name='') and document('../src/map-attributes.html')//*[preceding-sibling::*=$ref]">
                 <xsl:value-of select="concat('#',document('../src/map-attributes.html')//*[preceding-sibling::*=$ref])"/>
               </xsl:when>
@@ -2643,25 +2668,29 @@
             </xsl:choose>
           </xsl:variable>
           <xsl:text> </xsl:text>
-          <xsl:message>
-            <xsl:text>  </xsl:text>
-            <xsl:value-of select="$spec-target"/>
-          </xsl:message>
-          <xsl:variable name="filename" select="document('../fragment-links.html')//*[preceding-sibling::*=$spec-target]"/>
+          <!-- * <xsl:message> -->
+            <!-- * <xsl:text>  </xsl:text> -->
+            <!-- * <xsl:value-of select="$spec-target"/> -->
+          <!-- * </xsl:message> -->
+          <xsl:variable name="filename">
+            <xsl:call-template name="get-spec-filename">
+              <xsl:with-param name="ref" select="$spec-target"/>
+            </xsl:call-template>
+          </xsl:variable>
           <span class="spec-link">
             <a title="Read about this attribute in the HTML5 spec"
-              href="http://dev.w3.org/html5/spec-author-view/{$filename}.html{$spec-target}">&#9432;</a>
+              href="{$filename}.html{$spec-target}">&#9432;</a>
           </span>
           <xsl:text> </xsl:text>
           <xsl:if test="not($name='') and document(concat('../elements/',$name,'.html'))//*[@id=$ref][contains(@class,'new')]
-            or document('../src/attributes.html')//*[@id=$ref][contains(@class,'new')]
+            or $attributes//*[@id=$ref][contains(@class,'new')]
             ">
             <span class="new-feature"
               title="This markup feature is newly added in HTML5."
               >NEW</span>
           </xsl:if>
           <xsl:if test="not($name='') and document(concat('../elements/',$name,'.html'))//*[@id=$ref][contains(@class,'changed')]
-            or document('../src/attributes.html')//*[@id=$ref][contains(@class,'changed')]
+            or $attributes//*[@id=$ref][contains(@class,'changed')]
             ">
             <span class="changed-feature"
               title="The meaning, structure, or purpose of this markup feature has changed in HTML5."
@@ -2681,9 +2710,9 @@
               <xsl:copy-of select="document(concat('../elements/',$name,'.html'))//h:dd[preceding-sibling::h:dt[@id=$ref]]"/>
             </xsl:when>
             <xsl:when
-              test="document('../src/attributes.html')//*[@id=$ref]">
+              test="$attributes//*[@id=$ref]">
               <xsl:copy-of
-                select="document('../src/attributes.html')//h:dd[preceding-sibling::h:dt[@id=$ref]]"/>
+                select="$attributes//h:dd[preceding-sibling::h:dt[@id=$ref]]"/>
             </xsl:when>
             <xsl:otherwise>
               <dd>
@@ -2739,7 +2768,7 @@
       <xsl:text> = </xsl:text>
       <span class="attr-values">
         <xsl:variable name="model">
-          <xsl:copy-of select="//*[@id=$ref]//*[@class='model']"/>
+          <xsl:copy-of select="key('elements',$ref)//*[@class='model']"/>
         </xsl:variable>
         <xsl:call-template name="string.subst">
           <xsl:with-param name="string" select="$model"/>
@@ -2806,10 +2835,10 @@
       and not($name='meta.http-equiv.refresh')
       and not($name='meta.http-equiv.default-style')
       ">
-    <xsl:choose>
-      <xsl:when
-        test="exsl:node-set($assertions)/s:rule[child::s:context = $short-name]
-        |document(concat('../elements/',$name,'.html'))//h:*[@id='constraints']
+      <xsl:choose>
+        <xsl:when
+          test="exsl:node-set($assertions)/s:rule[child::s:context = $short-name]
+          |document(concat('../elements/',$name,'.html'))//h:*[@id='constraints']
         ">
         <xsl:text>&#10;      </xsl:text>
         <div class="no-number no-toc" id="{$name}-constraints">
@@ -3171,4 +3200,36 @@
   <xsl:template match="node()[normalize-space(.)='empty']">
     <span>empty (<a href="#void-element">void element</a>)</span>
   </xsl:template>
+  <xsl:template name="get-spec-filename">
+    <xsl:param name="ref"/>
+    <xsl:for-each select="document('../fragment-links.html')">
+      <xsl:choose>
+        <xsl:when test="key('filename-map',$ref)">
+          <xsl:value-of select="concat('http://dev.w3.org/html5/spec-author-view/',key('filename-map',$ref)/*[2])"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:for-each select="document('../fragment-links-full.html')">
+            <xsl:choose>
+              <xsl:when test="key('filename-map',$ref)">
+                <xsl:value-of select="concat('http://dev.w3.org/html5/spec/',key('filename-map',$ref)/*[2])"/>
+              </xsl:when>
+              <xsl:otherwise>
+                <xsl:value-of select="concat('http://dev.w3.org/html5/spec-author-view/',key('filename-map',$ref)/*[2])"/>
+                <xsl:message>
+                  <xsl:text>    NOT FOUND: </xsl:text>
+                  <xsl:value-of select="$ref"/>
+                </xsl:message>
+              </xsl:otherwise>
+            </xsl:choose>
+          </xsl:for-each>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:for-each>
+  </xsl:template>
+  <xsl:template name="get-idl">
+    <xsl:param name="interface"/>
+    <xsl:for-each select="document('../webapps.html')">
+      <xsl:copy-of select="key('interface-name',$interface)"/>
+    </xsl:for-each>
+  </xsl:template>
 </xsl:stylesheet>

Index: specgen.xsl
===================================================================
RCS file: /sources/public/html5/markup/tools/specgen.xsl,v
retrieving revision 1.70
retrieving revision 1.71
diff -u -d -r1.70 -r1.71
--- specgen.xsl	15 Jul 2010 16:49:47 -0000	1.70
+++ specgen.xsl	22 Jul 2010 05:48:27 -0000	1.71
@@ -14,7 +14,7 @@
   <xsl:param name="chunk" select="0"/>
   <xsl:param name="TOC-file"/>
   <xsl:param name="aria" select="0"/>
-  <xsl:key name="id" match="*" use="@id"/>
+  <xsl:key name="elements" match="*" use="@id"/>
   <xsl:key name="chunk" match="*[@id='elements']/h:section
     |//h:section[count(ancestor::h:section)=0]
     [not(@id='abstract')][not(@id='status')][not(@id='toc')]" use="@id"/>
@@ -22,16 +22,16 @@
   <xsl:variable name='appendicesID'>appendices</xsl:variable>
   <xsl:variable name='id' select='/*/h:head/h:meta[@name="revision"]/@content'/>
   <xsl:variable name='rev' select='substring-before(substring-after(substring-after($id, " "), " "), " ")'/>
-  <xsl:variable name='toc-marker' select='//h:*[@id = "toc"][1]'/>
-  <xsl:variable name='info' select="/*/h:body/h:*[@id = 'info']"/>
-  <xsl:variable name="maturity" select="$info/h:*[@id = 'maturity']"/>
-  <xsl:variable name="normativity" select="$info/h:*[@id = 'normativity']"/>
-  <xsl:variable name="source" select="$info/h:*[@id = 'versions']/h:*[@id = 'source']"/>
-  <xsl:variable name="this" select="$info/h:*[@id = 'versions']/h:*[@id = 'this']"/>
-  <xsl:variable name="latest" select="$info/h:*[@id = 'versions']/h:*[@id = 'latest']"/>
-  <xsl:variable name="previous-nodeset" select="$info/h:*[@id = 'versions']/h:*[contains(@class,'previous')]"/>
-  <xsl:variable name="person-nodeset" select='$info/h:*[@id="editors"]/h:*[@ class="person"]'/>
-  <xsl:variable name="groupinfo-nodeset" select="$info/h:*[@id = 'groupinfo']"/>
+  <xsl:variable name='toc-marker' select='key("elements","toc")[1]'/>
+  <xsl:variable name='info' select="key('elements','info')"/>
+  <xsl:variable name="maturity" select="key('elements','maturity')"/>
+  <xsl:variable name="normativity" select="key('elements','normativity')"/>
+  <xsl:variable name="source" select="key('elements','source')"/>
+  <xsl:variable name="this" select="key('elements','this')"/>
+  <xsl:variable name="latest" select="key('elements','latest')"/>
+  <xsl:variable name="previous-nodeset" select="key('elements','versions')/*[contains(@class,'previous')]"/>
+  <xsl:variable name="person-nodeset" select='key("elements","editors")/*[@ class="person"]'/>
+  <xsl:variable name="groupinfo-nodeset" select="key('elements','groupinfo')"/>
   <xsl:template match='/'>
     <!-- * <xsl:if test='$maturity = "ED"'> -->
       <!-- * <xsl:comment> * </xsl:comment> -->
@@ -126,8 +126,8 @@
       </xsl:when>
       </xsl:choose>
       <h1><xsl:value-of select='/*/h:head/h:title'/></h1>
-      <xsl:if test='//*[@id="subtitle"]'>
-        <h3 id="subtitle"><xsl:value-of select='//*[@id="subtitle"]'/></h3>
+      <xsl:if test='key("elements","subtitle")'>
+        <h3 id="subtitle"><xsl:value-of select='key("elements","subtitle")'/></h3>
       </xsl:if>
       <h2>
       <xsl:if test="$site = 'W3C'">W3C </xsl:if>
@@ -479,7 +479,7 @@
   </xsl:template>
   <xsl:template match='processing-instruction("sref")'>
     <xsl:variable name='id' select='string(.)'/>
-    <xsl:variable name='s' select='//*[@id=$id]/self::h:section'/>
+    <xsl:variable name='s' select='key("elements",$id)/self::h:section'/>
     <xsl:choose>
       <xsl:when test='$s'>
         <xsl:call-template name='section-number'>
@@ -500,8 +500,8 @@
   <xsl:template match='processing-instruction()|comment()'/>
   <xsl:template name='section-number'>
     <xsl:param name='section'/>
-    <xsl:param name='sections' select="//*[@id = $sectionsID]"/>
-    <xsl:param name='appendices' select="//*[@id = $appendicesID]"/>
+    <xsl:param name='sections' select="key('elements',$sectionsID)"/>
+    <xsl:param name='appendices' select="key('elements',$appendicesID)"/>
     <xsl:choose>
       <xsl:when test='$section/ancestor::* = $sections'>
         <xsl:for-each select='$section/ancestor-or-self::h:section'>
@@ -735,8 +735,8 @@
       <xsl:when test="not($chunk=0)">
         <xsl:variable name="href" select="substring-after(@href,'#')"/>
         <xsl:variable name="section"
-          select="key('id',$href)/ancestor-or-self::h:section[child::h:h2[@class='element-head']]
-          |key('id',$href)/ancestor::h:section[(count(ancestor::h:section)=0 and not(@id='elements'))]
+          select="key('elements',$href)/ancestor-or-self::h:section[child::h:h2[@class='element-head']]
+          |key('elements',$href)/ancestor::h:section[(count(ancestor::h:section)=0 and not(@id='elements'))]
           "/>
         <xsl:choose>
           <xsl:when test="$href='syntax'">

Index: toc.xsl
===================================================================
RCS file: /sources/public/html5/markup/tools/toc.xsl,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- toc.xsl	29 Mar 2010 15:08:01 -0000	1.17
+++ toc.xsl	22 Jul 2010 05:48:27 -0000	1.18
@@ -4,12 +4,12 @@
                 version='1.0' id='xslt'>
   <xsl:template name='toc'>
     <xsl:param name="unexpanded" select="0"/>
-    <xsl:for-each select='//*[@id=$sectionsID]'>
+    <xsl:for-each select='key("elements",$sectionsID)'>
       <xsl:call-template name='toc1'>
         <xsl:with-param name="unexpanded" select="$unexpanded"/>
       </xsl:call-template>
     </xsl:for-each>
-    <xsl:for-each select='//*[@id=$appendicesID]'>
+    <xsl:for-each select='key("elements",$appendicesID)'>
       <xsl:call-template name='toc1'>
         <xsl:with-param name="unexpanded" select="$unexpanded"/>
         <xsl:with-param name='alpha' select='true()'/>
@@ -50,8 +50,8 @@
               <xsl:when test='$chunk=0'/>
               <xsl:otherwise>
                 <xsl:value-of select="
-                  key('id',$frag)[ancestor-or-self::h:section[@id='elements']]/@id
-                  |key('id',$frag)/ancestor-or-self::h:section[count(ancestor::h:section)=0 and not(@id='elements')]/@id
+                  key('elements',$frag)[ancestor-or-self::h:section[@id='elements']]/@id
+                  |key('elements',$frag)/ancestor-or-self::h:section[count(ancestor::h:section)=0 and not(@id='elements')]/@id
                   "/>
               </xsl:otherwise>
             </xsl:choose>

Received on Thursday, 22 July 2010 05:48:32 UTC