List:Commits« Previous MessageNext Message »
From:paul Date:November 6 2006 5:27pm
Subject:svn commit - mysqldoc@docsrva: r3861 - in trunk: . xsl.d
View as plain text  
Author: paul
Date: 2006-11-06 18:27:20 +0100 (Mon, 06 Nov 2006)
New Revision: 3861

Log:
 r15316@polar:  paul | 2006-11-06 11:14:18 -0600
 TOC-related changes (account for <part>)


Modified:
   trunk/xsl.d/make-toc-entries.xsl
   trunk/xsl.d/make-toc.xsl

Property changes on: trunk
___________________________________________________________________
Name: svk:merge
   - 4767c598-dc10-0410-bea0-d01b485662eb:/mysqldoc-local/mysqldoc/trunk:15311
7d8d2c4e-af1d-0410-ab9f-b038ce55645b:/mysqldoc-local/mysqldoc:11675
b5ec3a16-e900-0410-9ad2-d183a3acac99:/mysqldoc-local/mysqldoc/trunk:14218
bf112a9c-6c03-0410-a055-ad865cd57414:/mysqldoc-local/mysqldoc/trunk:11301
   + 4767c598-dc10-0410-bea0-d01b485662eb:/mysqldoc-local/mysqldoc/trunk:15316
7d8d2c4e-af1d-0410-ab9f-b038ce55645b:/mysqldoc-local/mysqldoc:11675
b5ec3a16-e900-0410-9ad2-d183a3acac99:/mysqldoc-local/mysqldoc/trunk:14218
bf112a9c-6c03-0410-a055-ad865cd57414:/mysqldoc-local/mysqldoc/trunk:11301


Modified: trunk/xsl.d/make-toc-entries.xsl
===================================================================
--- trunk/xsl.d/make-toc-entries.xsl	2006-11-06 16:07:30 UTC (rev 3860)
+++ trunk/xsl.d/make-toc-entries.xsl	2006-11-06 17:27:20 UTC (rev 3861)
Changed blocks: 3, Lines Added: 16, Lines Deleted: 4; 2019 bytes

@@ -19,14 +19,23 @@
 <xsl:output method="xml" omit-xml-declaration="no"/>
 
 <!--
-Determine the section number of the current element
+  Determine the section number of the current element
 
-This numbers chapters (with numbers) and appendixes (with letters).
-It also numbers section and sect[1-5] elements within chapters and appendixes.
+  This numbers chapters (with numbers) and appendixes (with letters).
+  It also numbers section and sect[1-5] elements within chapters and
+  appendixes.
+
+  Chapters are numbered with "any" so that numbering increases across
+  <part> elements.  Section numbering within chapters restarts with
+  each chapter.  (Similar for appendixes.)
 -->
 
 <xsl:template name="cur-sect-num">
   <xsl:choose>
+    <!-- for part, number only top-level element -->
+    <xsl:when test="self::part">
+      <xsl:number count="part" level="any" format="I"/>
+    </xsl:when>
     <!-- preface sections are not numbered -->
     <xsl:when test="ancestor-or-self::preface">
       <!-- no numbering for preface -->

@@ -51,7 +60,7 @@
   <xsl:element name="toc-entries">
     <xsl:text>&#xA;</xsl:text>
     <xsl:for-each
-         select="//preface|//chapter|//appendix|//example
+         select="//part|//preface|//chapter|//appendix|//example
 					|//section|//sect1[@id]|//sect2[@id]|//sect3[@id]|//sect4[@id]|//sect5[@id]">
       <xsl:element name="toc-entry">
         <xsl:attribute name="id">

@@ -60,6 +69,9 @@
         <xsl:text>&#xA;  </xsl:text>
         <xsl:element name="toc-section-type">
           <xsl:choose>
+            <xsl:when test="self::part">
+              <xsl:text>Part</xsl:text>
+            </xsl:when>
             <!-- preface sections are not numbered -->
             <xsl:when test="self::preface">
               <!-- no numbering for preface -->


Modified: trunk/xsl.d/make-toc.xsl
===================================================================
--- trunk/xsl.d/make-toc.xsl	2006-11-06 16:07:30 UTC (rev 3860)
+++ trunk/xsl.d/make-toc.xsl	2006-11-06 17:27:20 UTC (rev 3861)
Changed blocks: 3, Lines Added: 15, Lines Deleted: 1; 1350 bytes

@@ -47,6 +47,9 @@
 </xsl:template>
 
 <xsl:template match="title">
+  <xsl:param name="indent" select="''"/>
+
+  <xsl:value-of select="$indent"/>
   <xsl:variable name="sect-num">
     <xsl:call-template name="cur-sect-num"/>
   </xsl:variable>

@@ -68,6 +71,15 @@
 <xsl:template match="book|article">
   <xsl:value-of select="normalize-space(title)"/>
   <xsl:value-of select="$newline"/>
+  <xsl:apply-templates select="part|preface|chapter|appendix"/>
+</xsl:template>
+
+<!-- A part -->
+
+<xsl:template match="part">
+  <xsl:value-of select="$newline"/>
+  <xsl:text>Part </xsl:text>
+  <xsl:apply-templates select="title"/>
   <xsl:apply-templates select="preface|chapter|appendix"/>
 </xsl:template>
 

@@ -92,7 +104,9 @@
 <!-- Various section levels -->
 
 <xsl:template match="section[@id]|sect1[@id]|sect2[@id]|sect3[@id]|sect4[@id]|sect5[@id]">
-  <xsl:apply-templates select="title"/>
+  <xsl:apply-templates select="title">
+    <xsl:with-param name="indent" select="' '"/>
+  </xsl:apply-templates>
   <!-- work on whatever's beneath -->
   <xsl:apply-templates select="section[@id]|sect2[@id]|sect3[@id]|sect4[@id]|sect5[@id]"/>
 </xsl:template>


Thread
svn commit - mysqldoc@docsrva: r3861 - in trunk: . xsl.dpaul6 Nov