W3C home > Mailing lists > Public > public-html-commits@w3.org > May 2009

html5/markup/tools chunker.xsl,1.1,1.2 generate-spec-source.xsl,1.168,1.169 specgen.xsl,1.28,1.29

From: Michael Smith via cvs-syncmail <cvsmail@w3.org>
Date: Sat, 02 May 2009 09:24:25 +0000
To: public-html-commits@w3.org
Message-Id: <E1M0BSL-00088S-0w@lionel-hutz.w3.org>
Update of /sources/public/html5/markup/tools
In directory hutz:/tmp/cvs-serv30992/tools

Modified Files:
	chunker.xsl generate-spec-source.xsl specgen.xsl 
Log Message:
h:html chunked version now how headers and footer with links to previous and next pages. 


Index: generate-spec-source.xsl
===================================================================
RCS file: /sources/public/html5/markup/tools/generate-spec-source.xsl,v
retrieving revision 1.168
retrieving revision 1.169
diff -u -d -r1.168 -r1.169
--- generate-spec-source.xsl	1 May 2009 07:01:21 -0000	1.168
+++ generate-spec-source.xsl	2 May 2009 09:24:22 -0000	1.169
@@ -149,7 +149,7 @@
             <xsl:text>&#10;    </xsl:text>
           </section>
           <xsl:text>&#10;    </xsl:text>
-          <section id="common-attrs">
+          <section id="common-attributes">
             <xsl:text>&#10;        </xsl:text>
             <h2>Common attributes</h2>
             <xsl:text>&#10;        </xsl:text>
@@ -401,7 +401,7 @@
             </xsl:for-each>
           </section>
           <xsl:text>&#10;    </xsl:text>
-          <section id="shared-attrs">
+          <section id="shared-attributes">
             <xsl:text>&#10;        </xsl:text>
             <h2>Other shared attributes</h2>
           <section id="common-command-attrs">

Index: specgen.xsl
===================================================================
RCS file: /sources/public/html5/markup/tools/specgen.xsl,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- specgen.xsl	1 May 2009 13:53:15 -0000	1.28
+++ specgen.xsl	2 May 2009 09:24:22 -0000	1.29
@@ -14,8 +14,9 @@
   <xsl:param name="chunk" select="0"/>
   <xsl:param name="TOC-file"/>
   <xsl:key name="id" match="*" use="@id"/>
-  <xsl:key name="chunk-for-id" match="*[@id]" use="ancestor::h:section[child::h:h2[@class='element-head']]
-    |ancestor::h:section[(count(ancestor::h:section)=0 and not(@id='elements'))]"/>
+  <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"/>
   <xsl:variable name='sectionsID'>this_sections</xsl:variable>
   <xsl:variable name='appendicesID'>appendices</xsl:variable>
   <xsl:variable name='id' select='/*/h:head/h:meta[@name="revision"]/@content'/>
@@ -535,6 +536,14 @@
             <xsl:value-of select="@id"/>
             <xsl:text>.html</xsl:text>
           </xsl:with-param>
+          <xsl:with-param name="prev" select="(key('chunk',@id)/preceding-sibling::h:section[1]
+            |key('chunk',@id)/parent::*[self::h:section]
+            |key('chunk',@id)/../preceding-sibling::*[@id=$sectionsID]/h:section[last()]
+            )[last()]"/>
+          <xsl:with-param name="next" select="(key('chunk',@id)/following-sibling::h:section[1]
+            |key('chunk',@id)/parent::*[self::h:section]/following-sibling::*[self::h:section]
+            |key('chunk',@id)/../following-sibling::*[@id=$appendicesID]/h:section[1]
+            )[1]"/>
         </xsl:call-template>
       </xsl:when>
       <xsl:otherwise>

Index: chunker.xsl
===================================================================
RCS file: /sources/public/html5/markup/tools/chunker.xsl,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- chunker.xsl	1 May 2009 09:26:11 -0000	1.1
+++ chunker.xsl	2 May 2009 09:24:22 -0000	1.2
@@ -6,11 +6,9 @@
                 exclude-result-prefixes='h date'
                 extension-element-prefixes="exsl"
                 version='1.0' id='xslt'>
-
   <!-- * This stylesheet is based on code from stylesheets in the DocBook -->
   <!-- * XSL Stylesheets distribution; for details, see the -->
   <!-- * "Acknowledgements" comment at the end of this file. -->
-
   <xsl:template name="write.chunk">
     <xsl:param name="filename" select="''"/>
     <xsl:param name="quiet" select="0"/>
@@ -24,6 +22,8 @@
     <xsl:param name="cdata-section-elements"></xsl:param>
     <xsl:param name="content"/>
     <xsl:param name="title"/>
+    <xsl:param name="prev"/>
+    <xsl:param name="next"/>
     <xsl:if test="$quiet = 0">
       <xsl:message>
         <xsl:text>Writing </xsl:text>
@@ -44,8 +44,10 @@
       doctype-system="{$doctype-system}"
       >
       <xsl:call-template name="build.chunk">
-        <xsl:with-param name="content" select="$content"/>
         <xsl:with-param name="title" select="$title"/>
+        <xsl:with-param name="prev" select="$prev"/>
+        <xsl:with-param name="next" select="$next"/>
+        <xsl:with-param name="content" select="$content"/>
       </xsl:call-template>
     </exsl:document>
   </xsl:template>
@@ -53,37 +55,91 @@
     <xsl:param name="title"/>
     <xsl:param name="prev"/>
     <xsl:param name="next"/>
-    <xsl:param name="nav.context"/>
     <xsl:param name="content">
       <xsl:apply-imports/>
     </xsl:param>
     <html xmlns="http://www.w3.org/1999/xhtml">
+      <xsl:text>&#10;</xsl:text>
       <head>
+        <xsl:text>&#10;</xsl:text>
         <title>
           <xsl:value-of select="$title"/>
         </title>
-        <xsl:copy-of select="//h:link[@rel='stylesheet']"/>
+        <xsl:for-each select="//h:link[@rel='stylesheet']">
+          <xsl:text>&#10;</xsl:text>
+          <xsl:copy-of select="."/>
+        </xsl:for-each>
         <!-- * <xsl:call-template name="head.nav.links"> -->
           <!-- * <xsl:with-param name="title" select="$title"/> -->
           <!-- * <xsl:with-param name="prev" select="$prev"/> -->
           <!-- * <xsl:with-param name="next" select="$next"/> -->
-        <!-- * </xsl:call-template> -->
+          <!-- * </xsl:call-template> -->
+        <xsl:text>&#10;</xsl:text>
       </head>
+      <xsl:text>&#10;</xsl:text>
       <body>
-        <!-- * <xsl:call-template name="header.navigation"> -->
-          <!-- * <xsl:with-param name="prev" select="$prev"/> -->
-          <!-- * <xsl:with-param name="next" select="$next"/> -->
-          <!-- * <xsl:with-param name="nav.context" select="$nav.context"/> -->
-        <!-- * </xsl:call-template> -->
+        <xsl:call-template name="header.navigation">
+          <xsl:with-param name="prev" select="$prev"/>
+          <xsl:with-param name="next" select="$next"/>
+        </xsl:call-template>
         <xsl:copy-of select="$content"/>
-        <!-- * <xsl:call-template name="footer.navigation"> -->
-          <!-- * <xsl:with-param name="prev" select="$prev"/> -->
-          <!-- * <xsl:with-param name="next" select="$next"/> -->
-          <!-- * <xsl:with-param name="nav.context" select="$nav.context"/> -->
-        <!-- * </xsl:call-template> -->
+        <xsl:call-template name="footer.navigation">
+          <xsl:with-param name="prev" select="$prev"/>
+          <xsl:with-param name="next" select="$next"/>
+          </xsl:call-template>
+        <xsl:text>&#10;</xsl:text>
       </body>
+      <xsl:text>&#10;</xsl:text>
     </html>
   </xsl:template>
+  <xsl:template name="header.navigation">
+    <xsl:param name="prev" select="preceding-sibling::*"/>
+    <xsl:param name="next" select="following-sibling::*"/>
+    <xsl:text>&#10;</xsl:text>
+    <h2 class="chunkpagetitle"><a
+        href="{$TOC-file}">HTML5: The Markup Language</a></h2>
+    <xsl:text>&#10;</xsl:text>
+    <div class="nav">
+      <xsl:text>&#10;</xsl:text>
+      <xsl:if test="$prev">
+        <span class="nav-prev">
+          <a href="{$prev/@id}.html">« <xsl:value-of select="$prev/@id"/></a>
+        </span>
+      </xsl:if>
+      <xsl:if test="$next">
+        <xsl:text>&#10;</xsl:text>
+        <span class="nav-next">
+          <a href="{$next/@id}.html"><xsl:value-of select="$next/@id"/> »</a>
+        </span>
+      </xsl:if>
+      <xsl:text>&#10;</xsl:text>
+    </div>
+    <xsl:text>&#10;</xsl:text>
+  </xsl:template>
+  <xsl:template name="footer.navigation">
+    <xsl:param name="prev" select="preceding-sibling::*"/>
+    <xsl:param name="next" select="following-sibling::*"/>
+    <xsl:text>&#10;</xsl:text>
+    <hr class="footerbreak"/>
+    <xsl:text>&#10;</xsl:text>
+    <div class="nav">
+      <xsl:text>&#10;</xsl:text>
+      <xsl:if test="$prev">
+        <span class="nav-prev">
+          <a href="{$prev/@id}.html">« <xsl:value-of select="$prev/@id"/></a>
+        </span>
+      </xsl:if>
+      <xsl:if test="$next">
+        <xsl:text>&#10;</xsl:text>
+        <span class="nav-next">
+          <a href="{$next/@id}.html"><xsl:value-of select="$next/@id"/> »</a>
+        </span>
+      </xsl:if>
+      <xsl:text>&#10;</xsl:text>
+    </div>
+    <xsl:text>&#10;</xsl:text>
+  </xsl:template>
+
   <xsl:template name="head.navs.links">
     <xsl:param name="title"/>
     <xsl:param name="prev" select="/foo"/>
@@ -205,211 +261,6 @@
       </link>
     </xsl:for-each>
   </xsl:template>
-  <xsl:template name="header.navigation">
-    <xsl:param name="prev" select="preceding-sibling::*"/>
-    <xsl:param name="next" select="following-sibling::*"/>
-    <xsl:param name="nav.context"/>
-    <xsl:variable name="home" select="/*[1]"/>
-    <xsl:variable name="up" select="parent::*"/>
-    <xsl:variable name="row1" select="1"/>
-    <xsl:variable name="row2" select="1"/>
-    <!-- * <xsl:variable name="row2" select="count($prev) &gt; 0 -->
-      <!-- * or (count($up) &gt; 0  -->
-      <!-- * and generate-id($up) != generate-id($home)) -->
-      <!-- * or count($next) &gt; 0"/> -->
-      <div class="navheader">
-        <xsl:if test="$row1 or $row2">
-          <table width="100%" summary="Navigation header">
-            <xsl:if test="$row1">
-              <tr>
-                <th colspan="3" align="center">
-                  <xsl:apply-templates select="." mode="object.title.markup"/>
-                </th>
-              </tr>
-            </xsl:if>
-
-            <xsl:if test="$row2">
-              <tr>
-                <td width="20%" align="left">
-                  <xsl:if test="count($prev)>0">
-                    <a accesskey="p">
-                      <xsl:attribute name="href">
-                        <xsl:call-template name="href.target">
-                          <xsl:with-param name="object" select="$prev"/>
-                        </xsl:call-template>
-                      </xsl:attribute>
-                      <xsl:call-template name="navig.content">
-                        <xsl:with-param name="direction" select="'prev'"/>
-                      </xsl:call-template>
-                    </a>
-                  </xsl:if>
-                  <xsl:text>&#160;</xsl:text>
-                </td>
-                <th width="60%" align="center">
-                  <xsl:choose>
-                    <xsl:when test="count($up) > 0
-                      and generate-id($up) != generate-id($home)
-                      and $navig.showtitles != 0">
-                      <xsl:apply-templates select="$up" mode="object.title.markup"/>
-                    </xsl:when>
-                    <xsl:otherwise>&#160;</xsl:otherwise>
-                  </xsl:choose>
-                </th>
-                <td width="20%" align="{$direction.align.end}">
-                  <xsl:text>&#160;</xsl:text>
-                  <xsl:if test="count($next)>0">
-                    <a accesskey="n">
-                      <xsl:attribute name="href">
-                        <xsl:call-template name="href.target">
-                          <xsl:with-param name="object" select="$next"/>
-                        </xsl:call-template>
-                      </xsl:attribute>
-                      <xsl:call-template name="navig.content">
-                        <xsl:with-param name="direction" select="'next'"/>
-                      </xsl:call-template>
-                    </a>
-                  </xsl:if>
-                </td>
-              </tr>
-            </xsl:if>
-          </table>
-        </xsl:if>
-        <hr/>
-      </div>
-  </xsl:template>
-  <xsl:template name="footer.navigation">
-    <xsl:param name="prev" select="/foo"/>
-    <xsl:param name="next" select="/foo"/>
-    <xsl:param name="nav.context"/>
-    <xsl:variable name="home" select="/*[1]"/>
-    <xsl:variable name="up" select="parent::*"/>
-    <xsl:variable name="row1" select="count($prev) &gt; 0
-      or count($up) &gt; 0
-      or count($next) &gt; 0"/>
-    <xsl:variable name="row2" select="($prev and $navig.showtitles != 0)
-      or (generate-id($home) != generate-id(.)
-      or $nav.context = 'toc')
-      or ($chunk.tocs.and.lots != 0
-      and $nav.context != 'toc')
-      or ($next and $navig.showtitles != 0)"/>
-    <xsl:if test="$suppress.navigation = '0' and $suppress.footer.navigation = '0'">
-      <div class="navfooter">
-        <xsl:if test="$footer.rule != 0">
-          <hr/>
-        </xsl:if>
-
-        <xsl:if test="$row1 or $row2">
-          <table width="100%" summary="Navigation footer">
-            <xsl:if test="$row1">
-              <tr>
-                <td width="40%" align="left">
-                  <xsl:if test="count($prev)>0">
-                    <a accesskey="p">
-                      <xsl:attribute name="href">
-                        <xsl:call-template name="href.target">
-                          <xsl:with-param name="object" select="$prev"/>
-                        </xsl:call-template>
-                      </xsl:attribute>
-                      <xsl:call-template name="navig.content">
-                        <xsl:with-param name="direction" select="'prev'"/>
-                      </xsl:call-template>
-                    </a>
-                  </xsl:if>
-                  <xsl:text>&#160;</xsl:text>
-                </td>
-                <td width="20%" align="center">
-                  <xsl:choose>
-                    <xsl:when test="count($up)&gt;0
-                      and generate-id($up) != generate-id($home)">
-                      <a accesskey="u">
-                        <xsl:attribute name="href">
-                          <xsl:call-template name="href.target">
-                            <xsl:with-param name="object" select="$up"/>
-                          </xsl:call-template>
-                        </xsl:attribute>
-                        <xsl:call-template name="navig.content">
-                          <xsl:with-param name="direction" select="'up'"/>
-                        </xsl:call-template>
-                      </a>
-                    </xsl:when>
-                    <xsl:otherwise>&#160;</xsl:otherwise>
-                  </xsl:choose>
-                </td>
-                <td width="40%" align="{$direction.align.end}">
-                  <xsl:text>&#160;</xsl:text>
-                  <xsl:if test="count($next)>0">
-                    <a accesskey="n">
-                      <xsl:attribute name="href">
-                        <xsl:call-template name="href.target">
-                          <xsl:with-param name="object" select="$next"/>
-                        </xsl:call-template>
-                      </xsl:attribute>
-                      <xsl:call-template name="navig.content">
-                        <xsl:with-param name="direction" select="'next'"/>
-                      </xsl:call-template>
-                    </a>
-                  </xsl:if>
-                </td>
-              </tr>
-            </xsl:if>
-
-            <xsl:if test="$row2">
-              <tr>
-                <td width="40%" align="left" valign="top">
-                  <xsl:if test="$navig.showtitles != 0">
-                    <xsl:apply-templates select="$prev" mode="object.title.markup"/>
-                  </xsl:if>
-                  <xsl:text>&#160;</xsl:text>
-                </td>
-                <td width="20%" align="center">
-                  <xsl:choose>
-                    <xsl:when test="$home != . or $nav.context = 'toc'">
-                      <a accesskey="h">
-                        <xsl:attribute name="href">
-                          <xsl:call-template name="href.target">
-                            <xsl:with-param name="object" select="$home"/>
-                          </xsl:call-template>
-                        </xsl:attribute>
-                        <xsl:call-template name="navig.content">
-                          <xsl:with-param name="direction" select="'home'"/>
-                        </xsl:call-template>
-                      </a>
-                      <xsl:if test="$chunk.tocs.and.lots != 0 and $nav.context != 'toc'">
-                        <xsl:text>&#160;|&#160;</xsl:text>
-                      </xsl:if>
-                    </xsl:when>
-                    <xsl:otherwise>&#160;</xsl:otherwise>
-                  </xsl:choose>
-
-                  <xsl:if test="$chunk.tocs.and.lots != 0 and $nav.context != 'toc'">
-                    <a accesskey="t">
-                      <xsl:attribute name="href">
-                        <xsl:apply-templates select="/*[1]"
-                          mode="recursive-chunk-filename">
-                          <xsl:with-param name="recursive" select="true()"/>
-                        </xsl:apply-templates>
-                        <xsl:text>-toc</xsl:text>
-                        <xsl:value-of select="$html.ext"/>
-                      </xsl:attribute>
-                      <xsl:call-template name="gentext">
-                        <xsl:with-param name="key" select="'nav-toc'"/>
-                      </xsl:call-template>
-                    </a>
-                  </xsl:if>
-                </td>
-                <td width="40%" align="{$direction.align.end}" valign="top">
-                  <xsl:text>&#160;</xsl:text>
-                  <xsl:if test="$navig.showtitles != 0">
-                    <xsl:apply-templates select="$next" mode="object.title.markup"/>
-                  </xsl:if>
-                </td>
-              </tr>
-            </xsl:if>
-          </table>
-        </xsl:if>
-      </div>
-    </xsl:if>
-  </xsl:template>
 
   <!-- * ***************************************************************** -->
   <!-- *                                 Acknowledgements  -->
Received on Saturday, 2 May 2009 09:24:35 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Saturday, 2 May 2009 09:24:35 GMT