html5/markup/tools chunker.xsl,1.10,1.11 generate-spec-source.xsl,1.275,1.276 toc.xsl,1.19,1.20

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

Modified Files:
	chunker.xsl generate-spec-source.xsl toc.xsl 
Log Message:
added index of elements by function http://dev.w3.org/html5/markup/elements-by-function.html


Index: generate-spec-source.xsl
===================================================================
RCS file: /sources/public/html5/markup/tools/generate-spec-source.xsl,v
retrieving revision 1.275
retrieving revision 1.276
diff -u -d -r1.275 -r1.276
--- generate-spec-source.xsl	27 Jul 2010 13:20:20 -0000	1.275
+++ generate-spec-source.xsl	28 Jul 2010 16:07:34 -0000	1.276
@@ -79,6 +79,11 @@
           <xsl:text>&#10;    </xsl:text>
           <xsl:copy-of select="document('../src/syntax.html')"/>
           <xsl:text>&#10;        </xsl:text>
+          <section id="elements-by-function">
+            <xsl:text>&#10;</xsl:text>
+            <xsl:call-template name="make.elements.by.function"/>
+            <xsl:text>&#10;</xsl:text>
+          </section>
           <section id="elements">
             <xsl:text>&#10;        </xsl:text>
             <h2>HTML elements</h2>
@@ -945,6 +950,68 @@
   </xsl:template>
 
   <!-- * ***************************************************************** -->
+  <!-- * * MAKE ELEMENTS-BY-FUNCTION SECTION -->
+  <!-- * ***************************************************************** -->
+  <xsl:template name="make.elements.by.function">
+    <xsl:apply-templates select="document('../src/elements-by-function.html')/node()"/>
+  </xsl:template>
+
+  <xsl:template match="h:section[@id='elements-by-function']/*[not(h:section)]">
+    <xsl:copy-of select="."/>
+  </xsl:template>
+
+  <xsl:template match="h:section[@id='elements-by-function']/h:section">
+    <section class="no-toc" id="{@id}">
+      <xsl:text>&#10;</xsl:text>
+      <xsl:apply-templates/>
+    </section>
+  </xsl:template>
+
+  <xsl:template match="h:section[@id='elements-by-function']/h:section/*[not(h:ul)]">
+    <xsl:copy-of select="."/>
+  </xsl:template>
+
+  <xsl:template match="h:section[@id='elements-by-function']/h:section/h:ul">
+    <ul>
+      <xsl:text>&#10;</xsl:text>
+      <xsl:for-each select="h:li">
+        <xsl:variable name="element-name" select="normalize-space(.)"/>
+        <xsl:variable name="target">
+          <xsl:call-template name="get-spec-target">
+            <xsl:with-param name="name" select="$element-name"/>
+          </xsl:call-template>
+        </xsl:variable>
+        <xsl:variable name="filename">
+          <xsl:call-template name="get-spec-filename">
+            <xsl:with-param name="ref" select="$target"/>
+          </xsl:call-template>
+        </xsl:variable>
+        <li>
+          <xsl:call-template name="make-element-spec-link">
+            <xsl:with-param name="element-name" select="$element-name"/>
+            <xsl:with-param name="filename" select="$filename"/>
+            <xsl:with-param name="target" select="$target"/>
+          </xsl:call-template>
+          <xsl:text> </xsl:text>
+          <a href="#{$element-name}">
+            <span class="element">
+              <xsl:value-of select="$element-name"/>
+            </span>
+            <xsl:text> – </xsl:text>
+            <xsl:call-template name="get-shortdesc">
+              <xsl:with-param name="element-name" select="$element-name"/>
+            </xsl:call-template>
+          </a>
+          <xsl:call-template name="make-markup-feature-flags">
+            <xsl:with-param name="element-name" select="$element-name"/>
+          </xsl:call-template>
+        </li>
+      </xsl:for-each>
+      <xsl:text>&#10;</xsl:text>
+    </ul>
+  </xsl:template>
+
+  <!-- * ***************************************************************** -->
   <!-- * * MAKE ELEMENT SECTION -->
   <!-- * ***************************************************************** -->
   <xsl:template match="*[local-name() = 'element'][@name]">
@@ -971,32 +1038,37 @@
       [not(@name='meta')]
       )"
       >
-      <xsl:variable name="obsoleted">
-        <xsl:if test="document(concat('../elements/',$name,'.html'))//*[@id='shortdesc'][@class[contains(.,'obsoleted')]]"> obsoleted</xsl:if>
-      </xsl:variable>
-      <xsl:variable name="changed">
-        <xsl:if test="document(concat('../elements/',$name,'.html'))//*[@id='shortdesc'][@class[contains(.,'changed')]]"> changed</xsl:if>
+      <xsl:variable name="target">
+        <xsl:call-template name="get-spec-target">
+          <xsl:with-param name="name" select="$name"/>
+        </xsl:call-template>
       </xsl:variable>
-      <xsl:variable name="new">
-        <xsl:if test="document(concat('../elements/',$name,'.html'))//*[@id='shortdesc'][@class[contains(.,'new')]]"> new</xsl:if>
+      <xsl:variable name="filename">
+        <xsl:call-template name="get-spec-filename">
+          <xsl:with-param name="ref" select="$target"/>
+        </xsl:call-template>
       </xsl:variable>
       <xsl:choose>
         <xsl:when test="$name='button.submit'">
-          <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>
             <h2 class="element-head">
-              <span class="spec-link">
-                <a title="Read about the button element in the HTML5 spec"
-                  href="{$filename}.html#the-button-element">&#9432;</a>
-              </span>
+              <xsl:call-template name="make-element-spec-link">
+                <xsl:with-param name="element-name">button</xsl:with-param>
+                <xsl:with-param name="filename">
+                  <xsl:call-template name="get-spec-filename">
+                    <xsl:with-param name="ref">#the-button-element</xsl:with-param>
+                  </xsl:call-template>
+                </xsl:with-param>
+                <xsl:with-param name="target">#the-button-element</xsl:with-param>
+              </xsl:call-template>
               <xsl:text> </xsl:text>
               <span class="element">button</span>
+              <xsl:text> – </xsl:text>
+              <xsl:call-template name="get-shortdesc">
+                <xsl:with-param name="element-name">button</xsl:with-param>
+              </xsl:call-template>
             </h2>
             <xsl:text>&#10;      </xsl:text>
             <div>
@@ -1019,23 +1091,29 @@
           </section>
         </xsl:when>
         <xsl:when test="$name='command.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>
             <h2 class="element-head">
-              <span class="spec-link">
-                <a title="Read about the command element in the HTML5 spec"
-                  href="{$filename}.html#the-command">&#9432;</a>
-              </span>
+              <xsl:call-template name="make-element-spec-link">
+                <xsl:with-param name="element-name">command</xsl:with-param>
+                <xsl:with-param name="filename">
+                  <xsl:call-template name="get-spec-filename">
+                    <xsl:with-param name="ref">#the-command</xsl:with-param>
+                  </xsl:call-template>
+                </xsl:with-param>
+                <xsl:with-param name="target">#the-command</xsl:with-param>
+              </xsl:call-template>
               <xsl:text> </xsl:text>
               <span class="element">command</span>
+              <xsl:text> – </xsl:text>
+              <xsl:call-template name="get-shortdesc">
+                <xsl:with-param name="element-name">command</xsl:with-param>
+              </xsl:call-template>
               <xsl:text> </xsl:text>
-              <span class="new-feature" title="This markup feature is newly added in HTML5.">NEW</span>
+              <xsl:call-template name="make-markup-feature-flags">
+                <xsl:with-param name="element-name">command</xsl:with-param>
+              </xsl:call-template>
             </h2>
             <xsl:text>&#10;      </xsl:text>
             <div>
@@ -1056,21 +1134,29 @@
           </section>
         </xsl:when>
         <xsl:when test="$name='input.text'">
-          <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>
             <h2 class="element-head">
-              <span class="spec-link">
-                <a title="Read about the input element in the HTML5 spec"
-                  href="{$filename}.html#the-input-element">&#9432;</a>
-              </span>
+              <xsl:call-template name="make-element-spec-link">
+                <xsl:with-param name="element-name">input</xsl:with-param>
+                <xsl:with-param name="filename">
+                  <xsl:call-template name="get-spec-filename">
+                    <xsl:with-param name="ref">#the-input-element</xsl:with-param>
+                  </xsl:call-template>
+                </xsl:with-param>
+                <xsl:with-param name="target">#the-input-element</xsl:with-param>
+              </xsl:call-template>
               <xsl:text> </xsl:text>
               <span class="element">input</span>
+              <xsl:text> – </xsl:text>
+              <xsl:call-template name="get-shortdesc">
+                <xsl:with-param name="element-name">input</xsl:with-param>
+              </xsl:call-template>
+              <xsl:text> </xsl:text>
+              <xsl:call-template name="make-markup-feature-flags">
+                <xsl:with-param name="element-name">input</xsl:with-param>
+              </xsl:call-template>
             </h2>
             <xsl:text>&#10;      </xsl:text>
             <div>
@@ -1091,21 +1177,29 @@
           </section>
         </xsl:when>
         <xsl:when test="$name='meta.name'">
-          <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>
             <h2 class="element-head">
-              <span class="spec-link">
-                <a title="Read about the meta element in the HTML5 spec"
-                  href="{$filename}.html#meta">&#9432;</a>
-              </span>
+              <xsl:call-template name="make-element-spec-link">
+                <xsl:with-param name="element-name">meta</xsl:with-param>
+                <xsl:with-param name="filename">
+                  <xsl:call-template name="get-spec-filename">
+                    <xsl:with-param name="ref">#meta</xsl:with-param>
+                  </xsl:call-template>
+                </xsl:with-param>
+                <xsl:with-param name="target">#meta</xsl:with-param>
+              </xsl:call-template>
               <xsl:text> </xsl:text>
               <span class="element">meta</span>
+              <xsl:text> – </xsl:text>
+              <xsl:call-template name="get-shortdesc">
+                <xsl:with-param name="element-name">meta</xsl:with-param>
+              </xsl:call-template>
+              <xsl:text> </xsl:text>
+              <xsl:call-template name="make-markup-feature-flags">
+                <xsl:with-param name="element-name">meta</xsl:with-param>
+              </xsl:call-template>
             </h2>
             <xsl:text>&#10;      </xsl:text>
             <p>The <span class="element">meta</span> element is
@@ -1135,69 +1229,14 @@
         <xsl:attribute name="id">
           <xsl:value-of select="$name"/>
         </xsl:attribute>
-        <xsl:attribute name="class">
-          <xsl:value-of select="concat('no-number',$obsoleted,$changed,$new)"/>
-        </xsl:attribute>
+        <xsl:attribute name="class">no-number</xsl:attribute>
         <xsl:text>&#10;      </xsl:text>
         <h2 class="element-head">
-          <xsl:variable name="target">
-            <xsl:choose>
-              <xsl:when test="$name = 'input.text'">#text-state-and-search-state</xsl:when>
-              <xsl:when test="$name = 'input.search'">#text-state-and-search-state</xsl:when>
-              <xsl:when test="$name = 'input.radio'">#radio-button-state</xsl:when>
-              <xsl:when test="$name = 'input.submit'">#submit-button-state</xsl:when>
-              <xsl:when test="$name = 'input.reset'">#reset-button-state</xsl:when>
-              <xsl:when test="$name = 'input.tel'">#telephone-state</xsl:when>
-              <xsl:when test="$name = 'input.datetime'">#date-and-time-state</xsl:when>
-              <xsl:when test="$name = 'input.datetime-local'">#local-date-and-time-state</xsl:when>
-              <xsl:when test="$name = 'input.file'">#file-upload-state</xsl:when>
-              <xsl:when test="$name = 'input.image'">#image-button-state</xsl:when>
-              <xsl:when test="$name = 'input.email'">#e-mail-state</xsl:when>
-              <xsl:when test="starts-with($name,'input.')">
-                <xsl:value-of select="concat('#',substring-after($name,'input.'),'-state')"/>
-              </xsl:when>
-              <xsl:when test="starts-with($name,'button')">#the-button-element</xsl:when>
-              <xsl:when test="starts-with($name,'command')">#the-command</xsl:when>
-              <xsl:when test="$name = 'meta.http-equiv.content-language'">#attr-meta-http-equiv-content-language</xsl:when>
-              <xsl:when test="$name = 'meta.http-equiv.content-type'">#attr-meta-http-equiv-content-type</xsl:when>
-              <xsl:when test="$name = 'meta.http-equiv.default-style'">#attr-meta-http-equiv-default-style</xsl:when>
-              <xsl:when test="$name = 'meta.http-equiv.refresh'">#attr-meta-http-equiv-refresh</xsl:when>
-              <xsl:when test="$name = 'meta.charset'">#attr-meta-charset</xsl:when>
-              <xsl:when test="$name = 'meta.name'">#attr-meta-name</xsl:when>
-              <xsl:when test="$name = 'meta'">#meta</xsl:when>
-              <xsl:when test="$name = 'audio'">#audio</xsl:when>
-              <xsl:when test="$name = 'body'">#the-body-element-0</xsl:when>
-              <xsl:when test="$name = 'command'">#the-command</xsl:when>
-              <xsl:when test="$name = 'h1'">#the-h1-h2-h3-h4-h5-and-h6-elements</xsl:when>
-              <xsl:when test="$name = 'h2'">#the-h1-h2-h3-h4-h5-and-h6-elements</xsl:when>
-              <xsl:when test="$name = 'h3'">#the-h1-h2-h3-h4-h5-and-h6-elements</xsl:when>
-              <xsl:when test="$name = 'h4'">#the-h1-h2-h3-h4-h5-and-h6-elements</xsl:when>
-              <xsl:when test="$name = 'h5'">#the-h1-h2-h3-h4-h5-and-h6-elements</xsl:when>
-              <xsl:when test="$name = 'h6'">#the-h1-h2-h3-h4-h5-and-h6-elements</xsl:when>
-              <xsl:when test="$name = 'head'">#the-head-element-0</xsl:when>
-              <xsl:when test="$name = 'html'">#the-html-element-0</xsl:when>
-              <xsl:when test="$name = 'menu'">#menus</xsl:when>
-              <xsl:when test="$name = 'script'">#script</xsl:when>
-              <xsl:when test="$name = 'sub'">#the-sub-and-sup-elements</xsl:when>
-              <xsl:when test="$name = 'sup'">#the-sub-and-sup-elements</xsl:when>
-              <xsl:when test="$name = 'title'">#the-title-element-0</xsl:when>
-              <xsl:when test="$name = 'video'">#video</xsl:when>
-              <xsl:otherwise>
-                <xsl:value-of select="concat('#the-',$name,'-element')"/>
-              </xsl:otherwise>
-            </xsl:choose>
-          </xsl:variable>
-          <xsl:text> </xsl:text>
-          <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 {$short-name} element in the HTML5 spec"
-              href="{$filename}.html{$target}">&#9432;</a>
-          </span>
+          <xsl:call-template name="make-element-spec-link">
+            <xsl:with-param name="element-name" select="$short-name"/>
+            <xsl:with-param name="filename" select="$filename"/>
+            <xsl:with-param name="target" select="$target"/>
+          </xsl:call-template>
           <xsl:choose>
             <xsl:when test="contains($name,'.notype')">
               <span class="element"><xsl:value-of select="substring-before($name,'.')"/></span>
@@ -1257,71 +1296,12 @@
             </xsl:otherwise>
           </xsl:choose>
           <xsl:text> – </xsl:text>
-          <span class="shortdesc">
-            <xsl:choose>
-              <xsl:when test="document(concat('../elements/',$name,'.html'))//h:div[@id='shortdesc']/node()">
-                <xsl:copy-of select="document(concat('../elements/',$name,'.html'))//h:div[@id='shortdesc']/node()"/>
-              </xsl:when>
-              <xsl:otherwise>
-            <xsl:variable name="element.shortdesc">
-              <xsl:choose>
-                <xsl:when test="$name = 'li'">
-                  <xsl:text>list item</xsl:text>
-                </xsl:when>
-                <xsl:when
-                  test="preceding-sibling::*[local-name() = 'documentation']
-                  and not(preceding-sibling::*[local-name() = 'documentation'][1] = '')">
-                  <xsl:value-of
-                    select="preceding-sibling::*[local-name() = 'documentation'][1]"/>
-                </xsl:when>
-                <xsl:when
-                  test="ancestor::*[local-name() = 'define']/*[local-name() = 'documentation']
-                  and not(ancestor::*[local-name() = 'define']/*[local-name() = 'documentation'] = '')">
-                  <xsl:value-of
-                    select="ancestor::*[local-name() = 'define']/*[local-name() = 'documentation'][1]"/>
-                </xsl:when>
-                <xsl:when test="$name = 'code'">
-                  <xsl:text>code fragment</xsl:text>
-                </xsl:when>
-                <xsl:otherwise>
-                  <xsl:text>@@ FIXME @@</xsl:text>
-                </xsl:otherwise>
-              </xsl:choose>
-            </xsl:variable>
-            <xsl:choose>
-              <xsl:when test="contains($element.shortdesc,':')">
-                <xsl:value-of
-                  select="translate(substring-before($element.shortdesc,':'),
-                  'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')"/>
-              </xsl:when>
-              <xsl:otherwise>
-                <xsl:value-of
-                  select="translate($element.shortdesc,
-                  'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')"/>
-              </xsl:otherwise>
-            </xsl:choose>
-          </xsl:otherwise>
-        </xsl:choose>
-          </span>
-          <xsl:text> </xsl:text>
-          <xsl:if test='not($obsoleted="")'>
-            <xsl:text> </xsl:text>
-            <span class="obsoleted-feature"
-              title="This markup feature has been obsoleted in HTML5."
-              >OBSOLETE</span>
-          </xsl:if>
-          <xsl:if test='not($changed="")'>
-            <xsl:text> </xsl:text>
-            <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='not($new="")'>
-            <xsl:text> </xsl:text>
-            <span class="new-feature"
-              title="This markup feature is newly added in HTML5."
-              >NEW</span>
-          </xsl:if>
+          <xsl:call-template name="get-shortdesc">
+            <xsl:with-param name="element-name" select="$name"/>
+          </xsl:call-template>
+          <xsl:call-template name="make-markup-feature-flags">
+            <xsl:with-param name="element-name" select="$name"/>
+          </xsl:call-template>
         </h2>
         <xsl:text>&#10;      </xsl:text>
         <xsl:variable name="space-name">
@@ -3068,6 +3048,200 @@
     </xsl:choose>
   </xsl:template>
 
+  <!-- * ***************************************************************** -->
+  <!-- * * GET ELEMENT SHORTDESC -->
+  <!-- * ***************************************************************** -->
+  <xsl:template name="get-shortdesc">
+    <xsl:param name="element-name"/>
+    <span class="shortdesc">
+      <xsl:choose>
+        <xsl:when test="$element-name = 'meta'">
+          <xsl:text>document metadata</xsl:text>
+        </xsl:when>
+        <xsl:when test="$element-name = 'input'">
+          <xsl:text>input control</xsl:text>
+        </xsl:when>
+        <xsl:when test="$element-name = 'button'">
+          <xsl:text>button</xsl:text>
+        </xsl:when>
+        <xsl:when test="$element-name = 'command'">
+          <xsl:text>command</xsl:text>
+        </xsl:when>
+        <xsl:when test="document(concat('../elements/',$element-name,'.html'))//h:div[@id='shortdesc']/node()">
+          <xsl:copy-of select="document(concat('../elements/',$element-name,'.html'))//h:div[@id='shortdesc']/node()"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:variable name="element.shortdesc">
+            <xsl:choose>
+              <xsl:when test="$element-name = 'li'">
+                <xsl:text>list item</xsl:text>
+              </xsl:when>
+              <xsl:when
+                test="preceding-sibling::*[local-name() = 'documentation']
+                and not(preceding-sibling::*[local-name() = 'documentation'][1] = '')">
+                <xsl:value-of
+                  select="preceding-sibling::*[local-name() = 'documentation'][1]"/>
+              </xsl:when>
+              <xsl:when
+                test="ancestor::*[local-name() = 'define']/*[local-name() = 'documentation']
+                and not(ancestor::*[local-name() = 'define']/*[local-name() = 'documentation'] = '')">
+                <xsl:value-of
+                  select="ancestor::*[local-name() = 'define']/*[local-name() = 'documentation'][1]"/>
+              </xsl:when>
+              <xsl:when test="$element-name = 'code'">
+                <xsl:text>code fragment</xsl:text>
+              </xsl:when>
+              <xsl:otherwise>
+                <xsl:text>@@ FIXME @@</xsl:text>
+              </xsl:otherwise>
+            </xsl:choose>
+          </xsl:variable>
+          <xsl:choose>
+            <xsl:when test="contains($element.shortdesc,':')">
+              <xsl:value-of
+                select="translate(substring-before($element.shortdesc,':'),
+                'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')"/>
+            </xsl:when>
+            <xsl:otherwise>
+              <xsl:value-of
+                select="translate($element.shortdesc,
+                'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')"/>
+            </xsl:otherwise>
+          </xsl:choose>
+        </xsl:otherwise>
+      </xsl:choose>
+    </span>
+  </xsl:template>
+  <!-- * ***************************************************************** -->
+  <!-- * * MAKE OBSOLETE/CHANGED/NEW FLAGS -->
+  <!-- * ***************************************************************** -->
+  <xsl:template name="make-markup-feature-flags">
+    <xsl:param name="element-name"/>
+    <xsl:choose>
+      <xsl:when test="$element-name='button'"/>
+      <xsl:when test="$element-name='input' or $element-name='meta'">
+        <xsl:text> </xsl:text>
+        <span class="changed-feature"
+          title="The meaning, structure, or purpose of this markup feature has changed in HTML5."
+          >CHANGED</span>
+      </xsl:when>
+      <xsl:when test="$element-name='command'">
+        <xsl:text> </xsl:text>
+        <span class="new-feature" title="This markup feature is newly added in HTML5.">NEW</span>
+      </xsl:when>
+      <xsl:when test="document(concat('../elements/',$element-name,'.html'))//*[@id='shortdesc'][@class[contains(.,'obsoleted')]]">
+        <xsl:text> </xsl:text>
+        <span class="obsoleted-feature"
+          title="This markup feature has been obsoleted in HTML5."
+          >OBSOLETE</span>
+      </xsl:when>
+      <xsl:when test="document(concat('../elements/',$element-name,'.html'))//*[@id='shortdesc'][@class[contains(.,'changed')]]">
+        <xsl:text> </xsl:text>
+        <span class="changed-feature"
+          title="The meaning, structure, or purpose of this markup feature has changed in HTML5."
+          >CHANGED</span>
+      </xsl:when>
+      <xsl:when test="document(concat('../elements/',$element-name,'.html'))//*[@id='shortdesc'][@class[contains(.,'new')]]">
+        <xsl:text> </xsl:text>
+        <span class="new-feature"
+          title="This markup feature is newly added in HTML5."
+          >NEW</span>
+      </xsl:when>
+    </xsl:choose>
+  </xsl:template>
+  <!-- * ***************************************************************** -->
+  <!-- * * MAKE ELEMENT LINK TO HTML5 SPEC -->
+  <!-- * ***************************************************************** -->
+  <xsl:template name="make-element-spec-link">
+    <xsl:param name="element-name"/>
+    <xsl:param name="filename"/>
+    <xsl:param name="target"/>
+    <span class="spec-link">
+      <a title="Read about the {$element-name} element in the HTML5 spec"
+        href="{$filename}.html{$target}">&#9432;</a>
+    </span>
+    <xsl:text> </xsl:text>
+  </xsl:template>
+  <xsl:template name="get-spec-target">
+    <xsl:param name="name"/>
+    <xsl:choose>
+      <xsl:when test="$name = 'input'">#the-input-element</xsl:when>
+      <xsl:when test="$name = 'input.text'">#text-state-and-search-state</xsl:when>
+      <xsl:when test="$name = 'input.search'">#text-state-and-search-state</xsl:when>
+      <xsl:when test="$name = 'input.radio'">#radio-button-state</xsl:when>
+      <xsl:when test="$name = 'input.submit'">#submit-button-state</xsl:when>
+      <xsl:when test="$name = 'input.reset'">#reset-button-state</xsl:when>
+      <xsl:when test="$name = 'input.tel'">#telephone-state</xsl:when>
+      <xsl:when test="$name = 'input.datetime'">#date-and-time-state</xsl:when>
+      <xsl:when test="$name = 'input.datetime-local'">#local-date-and-time-state</xsl:when>
+      <xsl:when test="$name = 'input.file'">#file-upload-state</xsl:when>
+      <xsl:when test="$name = 'input.image'">#image-button-state</xsl:when>
+      <xsl:when test="$name = 'input.email'">#e-mail-state</xsl:when>
+      <xsl:when test="starts-with($name,'input.')">
+        <xsl:value-of select="concat('#',substring-after($name,'input.'),'-state')"/>
+      </xsl:when>
+      <xsl:when test="starts-with($name,'button')">#the-button-element</xsl:when>
+      <xsl:when test="starts-with($name,'command')">#the-command</xsl:when>
+      <xsl:when test="$name = 'meta.http-equiv.content-language'">#attr-meta-http-equiv-content-language</xsl:when>
+      <xsl:when test="$name = 'meta.http-equiv.content-type'">#attr-meta-http-equiv-content-type</xsl:when>
+      <xsl:when test="$name = 'meta.http-equiv.default-style'">#attr-meta-http-equiv-default-style</xsl:when>
+      <xsl:when test="$name = 'meta.http-equiv.refresh'">#attr-meta-http-equiv-refresh</xsl:when>
+      <xsl:when test="$name = 'meta.charset'">#attr-meta-charset</xsl:when>
+      <xsl:when test="$name = 'meta.name'">#attr-meta-name</xsl:when>
+      <xsl:when test="$name = 'meta'">#meta</xsl:when>
+      <xsl:when test="$name = 'audio'">#audio</xsl:when>
+      <xsl:when test="$name = 'body'">#the-body-element-0</xsl:when>
+      <xsl:when test="$name = 'command'">#the-command</xsl:when>
+      <xsl:when test="$name = 'h1'">#the-h1-h2-h3-h4-h5-and-h6-elements</xsl:when>
+      <xsl:when test="$name = 'h2'">#the-h1-h2-h3-h4-h5-and-h6-elements</xsl:when>
+      <xsl:when test="$name = 'h3'">#the-h1-h2-h3-h4-h5-and-h6-elements</xsl:when>
+      <xsl:when test="$name = 'h4'">#the-h1-h2-h3-h4-h5-and-h6-elements</xsl:when>
+      <xsl:when test="$name = 'h5'">#the-h1-h2-h3-h4-h5-and-h6-elements</xsl:when>
+      <xsl:when test="$name = 'h6'">#the-h1-h2-h3-h4-h5-and-h6-elements</xsl:when>
+      <xsl:when test="$name = 'head'">#the-head-element-0</xsl:when>
+      <xsl:when test="$name = 'html'">#the-html-element-0</xsl:when>
+      <xsl:when test="$name = 'menu'">#menus</xsl:when>
+      <xsl:when test="$name = 'script'">#script</xsl:when>
+      <xsl:when test="$name = 'sub'">#the-sub-and-sup-elements</xsl:when>
+      <xsl:when test="$name = 'sup'">#the-sub-and-sup-elements</xsl:when>
+      <xsl:when test="$name = 'title'">#the-title-element-0</xsl:when>
+      <xsl:when test="$name = 'video'">#video</xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="concat('#the-',$name,'-element')"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </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: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>
 <!-- * ***************************************************************** -->
 <!-- * * UTILITY TEMPLATES -->
 <!-- * ***************************************************************** -->
@@ -3266,7 +3440,7 @@
             <xsl:with-param name="replacement" select="$replacement"/>
           </xsl:call-template>
         </xsl:variable>
-        <xsl:value-of select="concat(substring-before($string, $target),                                    $replacement,                                    $rest)"/>
+        <xsl:value-of select="concat(substring-before($string, $target),$replacement,$rest)"/>
       </xsl:when>
       <xsl:otherwise>
         <xsl:value-of select="$string"/>
@@ -3291,35 +3465,4 @@
   <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: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: toc.xsl
===================================================================
RCS file: /sources/public/html5/markup/tools/toc.xsl,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- toc.xsl	24 Jul 2010 17:15:29 -0000	1.19
+++ toc.xsl	28 Jul 2010 16:07:34 -0000	1.20
@@ -70,14 +70,6 @@
                 <xsl:value-of select="concat($frag,'-toc')"/>
               </xsl:attribute>
             </xsl:if>
-            <span class="toc-section-number">
-              <xsl:if test="
-                count($subsections) > 9 and 10 > $number
-                and not(contains(@class,'no-number'))
-                and not($prefix)">
-                <xsl:text>&#x2007;</xsl:text>
-              </xsl:if>
-            </span>
             <xsl:for-each select='(h:h2|h:h3|h:h4|h:h5|h:h6)/node()
               [@class="spec-link"]
               '>
@@ -88,18 +80,23 @@
               <span class="toc-section-number">
                 <xsl:if test="not(contains(@class,'no-number'))">
                   <xsl:value-of select='$number'/>
-                  <xsl:text>.</xsl:text>
+                  <xsl:text>. </xsl:text>
                 </xsl:if>
               </span>
-              <xsl:for-each select='(h:h2|h:h3|h:h4|h:h5|h:h6)/node()
-                [not(normalize-space(.)="")]
-                [not(contains(@class,"obsoleted-feature"))]
-                [not(contains(@class,"changed-feature"))]
-                [not(contains(@class,"new-feature"))]
-                [not(@class="spec-link")]
-                '>
-                <xsl:copy-of select='.'/>
-              </xsl:for-each>
+              <span class="toc-section-name">
+                <xsl:if test="not(contains(@class,'no-number'))">
+                  <xsl:text>&#xa0;</xsl:text>
+                </xsl:if>
+                <xsl:for-each select='(h:h2|h:h3|h:h4|h:h5|h:h6)/node()
+                  [not(normalize-space(.)="")]
+                  [not(contains(@class,"obsoleted-feature"))]
+                  [not(contains(@class,"changed-feature"))]
+                  [not(contains(@class,"new-feature"))]
+                  [not(@class="spec-link")]
+                  '>
+                  <xsl:copy-of select='.'/>
+                </xsl:for-each>
+              </span>
             </a>
             <xsl:if test='(h:h2|h:h3|h:h4|h:h5|h:h6)/node()[contains(@class,"obsoleted-feature")]'>
               <xsl:text> </xsl:text>

Index: chunker.xsl
===================================================================
RCS file: /sources/public/html5/markup/tools/chunker.xsl,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- chunker.xsl	5 Mar 2010 02:19:42 -0000	1.10
+++ chunker.xsl	28 Jul 2010 16:07:33 -0000	1.11
@@ -144,7 +144,13 @@
           </xsl:choose>
         </xsl:when>
         <xsl:when test="contains($prev/@id,'-')">
-          <xsl:value-of select="concat(substring-before($prev/@id,'-'),' ',substring-after($prev/@id,'-'))"/>
+          <xsl:call-template name="string.subst">
+            <xsl:with-param name="string" select="$prev/@id"/>
+            <xsl:with-param name="target">-</xsl:with-param>
+            <xsl:with-param name="replacement">
+              <xsl:text> </xsl:text>
+            </xsl:with-param>
+          </xsl:call-template>
         </xsl:when>
         <xsl:otherwise>
           <xsl:value-of select="$prev/@id"/>
@@ -170,7 +176,13 @@
           </xsl:choose>
         </xsl:when>
         <xsl:when test="contains($next/@id,'-')">
-          <xsl:value-of select="concat(substring-before($next/@id,'-'),' ',substring-after($next/@id,'-'))"/>
+          <xsl:call-template name="string.subst">
+            <xsl:with-param name="string" select="$next/@id"/>
+            <xsl:with-param name="target">-</xsl:with-param>
+            <xsl:with-param name="replacement">
+              <xsl:text> </xsl:text>
+            </xsl:with-param>
+          </xsl:call-template>
         </xsl:when>
         <xsl:otherwise>
           <xsl:value-of select="$next/@id"/>
@@ -220,7 +232,13 @@
           </xsl:choose>
         </xsl:when>
         <xsl:when test="contains($prev/@id,'-')">
-          <xsl:value-of select="concat(substring-before($prev/@id,'-'),' ',substring-after($prev/@id,'-'))"/>
+          <xsl:call-template name="string.subst">
+            <xsl:with-param name="string" select="$prev/@id"/>
+            <xsl:with-param name="target">-</xsl:with-param>
+            <xsl:with-param name="replacement">
+              <xsl:text> </xsl:text>
+            </xsl:with-param>
+          </xsl:call-template>
         </xsl:when>
         <xsl:otherwise>
           <xsl:value-of select="$prev/@id"/>
@@ -246,7 +264,13 @@
           </xsl:choose>
         </xsl:when>
         <xsl:when test="contains($next/@id,'-')">
-          <xsl:value-of select="concat(substring-before($next/@id,'-'),' ',substring-after($next/@id,'-'))"/>
+          <xsl:call-template name="string.subst">
+            <xsl:with-param name="string" select="$next/@id"/>
+            <xsl:with-param name="target">-</xsl:with-param>
+            <xsl:with-param name="replacement">
+              <xsl:text> </xsl:text>
+            </xsl:with-param>
+          </xsl:call-template>
         </xsl:when>
         <xsl:otherwise>
           <xsl:value-of select="$next/@id"/>
@@ -395,6 +419,26 @@
     </xsl:for-each>
   </xsl:template>
 
+  <xsl:template name="string.subst">
+    <xsl:param name="string"/>
+    <xsl:param name="target"/>
+    <xsl:param name="replacement"/>
+    <xsl:choose>
+      <xsl:when test="contains($string, $target)">
+        <xsl:variable name="rest">
+          <xsl:call-template name="string.subst">
+            <xsl:with-param name="string" select="substring-after($string, $target)"/>
+            <xsl:with-param name="target" select="$target"/>
+            <xsl:with-param name="replacement" select="$replacement"/>
+          </xsl:call-template>
+        </xsl:variable>
+        <xsl:value-of select="concat(substring-before($string, $target),$replacement,$rest)"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="$string"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
   <!-- * ***************************************************************** -->
   <!-- *                                 Acknowledgements  -->
   <!-- * ***************************************************************** -->

Received on Wednesday, 28 July 2010 16:07:39 UTC