]> granicus.if.org Git - docbook-dsssl/commitdiff
Add make.component.tocs to support lists of tables, etc. for
authorBob Stayton <bobs@sagehill.net>
Mon, 19 Mar 2012 20:02:49 +0000 (20:02 +0000)
committerBob Stayton <bobs@sagehill.net>
Mon, 19 Mar 2012 20:02:49 +0000 (20:02 +0000)
article and other components.  Added component.list.of.tables to
titlepage.templates.xml to format the title.

xsl/fo/autotoc.xsl
xsl/fo/component.xsl
xsl/fo/titlepage.templates.xml

index 6261e157c55ce72a1ce2ff3e027105569a6a69f4..75b56b54c68436fe953dc3c610e523ad3fb64242 100644 (file)
   </xsl:if>
 </xsl:template>
 
+<xsl:template name="component.list.of.titles">
+  <xsl:param name="titles" select="'table'"/>
+  <xsl:param name="nodes" select=".//table"/>
+  <xsl:param name="toc-context" select="."/>
+
+  <xsl:variable name="id">
+    <xsl:call-template name="object.id"/>
+  </xsl:variable>
+
+  <xsl:if test="$nodes">
+    <fo:block id="lot...{$titles}...{$id}">
+      <xsl:choose>
+        <xsl:when test="$titles='table'">
+          <xsl:call-template name="component.list.of.tables.titlepage"/>
+        </xsl:when>
+        <xsl:when test="$titles='figure'">
+          <xsl:call-template name="component.list.of.figures.titlepage"/>
+        </xsl:when>
+        <xsl:when test="$titles='equation'">
+          <xsl:call-template name="component.list.of.equations.titlepage"/>
+        </xsl:when>
+        <xsl:when test="$titles='example'">
+          <xsl:call-template name="component.list.of.examples.titlepage"/>
+        </xsl:when>
+        <xsl:when test="$titles='procedure'">
+          <xsl:call-template name="component.list.of.procedures.titlepage"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:call-template name="component.list.of.unknowns.titlepage"/>
+        </xsl:otherwise>
+      </xsl:choose>
+      <xsl:apply-templates select="$nodes" mode="toc">
+        <xsl:with-param name="toc-context" select="$toc-context"/>
+      </xsl:apply-templates>
+    </fo:block>
+  </xsl:if>
+</xsl:template>
+
 <xsl:template match="figure|table|example|equation|procedure" mode="toc">
   <xsl:param name="toc-context" select="."/>
   <xsl:call-template name="toc.line">
index ac53746add8d962964511f9ad35b342760b74c26..81dc7049b426798136fce4ccf10e155df3a25c2e 100644 (file)
         <xsl:call-template name="preface.titlepage"/>
       </fo:block>
 
-      <xsl:variable name="toc.params">
-        <xsl:call-template name="find.path.params">
-          <xsl:with-param name="table" 
-                          select="normalize-space($generate.toc)"/>
-        </xsl:call-template>
-      </xsl:variable>
-      <xsl:if test="contains($toc.params, 'toc')">
-        <xsl:call-template name="component.toc">
-          <xsl:with-param name="toc.title.p" 
-                          select="contains($toc.params, 'title')"/>
-        </xsl:call-template>
-        <xsl:call-template name="component.toc.separator"/>
-      </xsl:if>
+      <xsl:call-template name="make.component.tocs"/>
 
       <xsl:apply-templates/>
     </fo:flow>
         <xsl:call-template name="chapter.titlepage"/>
       </fo:block>
 
-      <xsl:variable name="toc.params">
-        <xsl:call-template name="find.path.params">
-          <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
-        </xsl:call-template>
-      </xsl:variable>
-      <xsl:if test="contains($toc.params, 'toc')">
-        <xsl:call-template name="component.toc">
-          <xsl:with-param name="toc.title.p" 
-                          select="contains($toc.params, 'title')"/>
-        </xsl:call-template>
-        <xsl:call-template name="component.toc.separator"/>
-      </xsl:if>
+      <xsl:call-template name="make.component.tocs"/>
+
       <xsl:apply-templates/>
     </fo:flow>
   </fo:page-sequence>
         <xsl:call-template name="appendix.titlepage"/>
       </fo:block>
 
-      <xsl:variable name="toc.params">
-        <xsl:call-template name="find.path.params">
-          <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
-        </xsl:call-template>
-      </xsl:variable>
-
-      <xsl:if test="contains($toc.params, 'toc')">
-        <xsl:call-template name="component.toc">
-          <xsl:with-param name="toc.title.p" 
-                          select="contains($toc.params, 'title')"/>
-        </xsl:call-template>
-        <xsl:call-template name="component.toc.separator"/>
-      </xsl:if>
+      <xsl:call-template name="make.component.tocs"/>
+
       <xsl:apply-templates/>
     </fo:flow>
   </fo:page-sequence>
         <xsl:call-template name="article.titlepage"/>
       </fo:block>
 
-      <xsl:variable name="toc.params">
-        <xsl:call-template name="find.path.params">
-          <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
-        </xsl:call-template>
-      </xsl:variable>
-
-      <xsl:if test="contains($toc.params, 'toc')">
-        <xsl:call-template name="component.toc">
-          <xsl:with-param name="toc.title.p" 
-                          select="contains($toc.params, 'title')"/>
-        </xsl:call-template>
-        <xsl:call-template name="component.toc.separator"/>
-      </xsl:if>
+      <xsl:call-template name="make.component.tocs"/>
+
       <xsl:apply-templates/>
     </fo:flow>
   </fo:page-sequence>
       <xsl:copy-of select="$title"/>
     </fo:block>
 
-    <xsl:variable name="toc.params">
-        <xsl:call-template name="find.path.params">
-          <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
-        </xsl:call-template>
-      </xsl:variable>
-
-      <xsl:if test="contains($toc.params, 'toc')">
-        <xsl:call-template name="component.toc">
-          <xsl:with-param name="toc.title.p" 
-                          select="contains($toc.params, 'title')"/>
-        </xsl:call-template>
-        <xsl:call-template name="component.toc.separator"/>
-      </xsl:if>
+    <xsl:call-template name="make.component.tocs"/>
 
     <xsl:apply-templates/>
   </fo:block>
   </fo:page-sequence>
 </xsl:template>
 
+<xsl:template name="make.component.tocs">
+
+  <xsl:variable name="toc.params">
+    <xsl:call-template name="find.path.params">
+      <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
+    </xsl:call-template>
+  </xsl:variable>
+
+  <xsl:if test="contains($toc.params, 'toc')">
+    <xsl:call-template name="component.toc">
+      <xsl:with-param name="toc.title.p" 
+                      select="contains($toc.params, 'title')"/>
+    </xsl:call-template>
+  </xsl:if>
+
+  <xsl:if test="contains($toc.params,'figure') and .//figure">
+    <xsl:call-template name="component.list.of.titles">
+      <xsl:with-param name="titles" select="'figure'"/>
+      <xsl:with-param name="nodes" select=".//figure"/>
+    </xsl:call-template>
+  </xsl:if>
+
+  <xsl:if test="contains($toc.params,'table') and .//table">
+    <xsl:call-template name="component.list.of.titles">
+      <xsl:with-param name="titles" select="'table'"/>
+      <xsl:with-param name="nodes" select=".//table[not(@tocentry = 0)]"/>
+    </xsl:call-template>
+  </xsl:if>
+
+  <xsl:if test="contains($toc.params,'example') and .//example">
+    <xsl:call-template name="component.list.of.titles">
+      <xsl:with-param name="titles" select="'example'"/>
+      <xsl:with-param name="nodes" select=".//example"/>
+    </xsl:call-template>
+  </xsl:if>
+
+  <xsl:if test="contains($toc.params,'equation') and 
+                 .//equation[title or info/title]">
+    <xsl:call-template name="component.list.of.titles">
+      <xsl:with-param name="titles" select="'equation'"/>
+      <xsl:with-param name="nodes" 
+                      select=".//equation[title or info/title]"/>
+    </xsl:call-template>
+  </xsl:if>
+
+  <xsl:if test="contains($toc.params,'procedure') and 
+                 .//procedure[title or info/title]">
+    <xsl:call-template name="component.list.of.titles">
+      <xsl:with-param name="titles" select="'procedure'"/>
+      <xsl:with-param name="nodes" 
+                      select=".//procedure[title or info/title]"/>
+    </xsl:call-template>
+  </xsl:if>
+
+  <xsl:choose>
+    <xsl:when test="$toc.params = ''">
+    </xsl:when>
+    <xsl:when test="$toc.params = 'nop'">
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:call-template name="component.toc.separator"/>
+    </xsl:otherwise>
+  </xsl:choose>
+
+</xsl:template>
+
 </xsl:stylesheet>
 
index 4915dc198ddf1a5e0a62bbbb3f58e968ebe530d9..c928c835b6e45cc73f912f91c6eb5ade947665d2 100644 (file)
     </t:titlepage-before>
   </t:titlepage>
 
+  <t:titlepage t:element="component.list.of.tables" t:wrapper="fo:block">
+    <t:titlepage-content t:side="recto">
+      <title
+            t:force="1"
+            t:named-template="gentext"
+            param:key="'ListofTables'"
+             space-before.minimum="1em"
+             space-before.optimum="1em"
+             space-before.maximum="1em"
+            space-after="0.5em"
+            margin-left="{$title.margin.left}"
+            font-size="&hsize1;"
+            font-weight="bold"
+            font-family="{$title.fontset}"/>
+    </t:titlepage-content>
+
+    <t:titlepage-content t:side="verso">
+    </t:titlepage-content>
+
+    <t:titlepage-separator>
+    </t:titlepage-separator>
+
+    <t:titlepage-before t:side="recto">
+    </t:titlepage-before>
+
+    <t:titlepage-before t:side="verso">
+    </t:titlepage-before>
+  </t:titlepage>
+
+  <t:titlepage t:element="component.list.of.figures" t:wrapper="fo:block">
+    <t:titlepage-content t:side="recto">
+      <title
+            t:force="1"
+            t:named-template="gentext"
+            param:key="'ListofFigures'"
+             space-before.minimum="1em"
+             space-before.optimum="1em"
+             space-before.maximum="1em"
+            space-after="0.5em"
+            margin-left="{$title.margin.left}"
+            font-size="&hsize1;"
+            font-weight="bold"
+            font-family="{$title.fontset}"/>
+    </t:titlepage-content>
+
+    <t:titlepage-content t:side="verso">
+    </t:titlepage-content>
+
+    <t:titlepage-separator>
+    </t:titlepage-separator>
+
+    <t:titlepage-before t:side="recto">
+    </t:titlepage-before>
+
+    <t:titlepage-before t:side="verso">
+    </t:titlepage-before>
+  </t:titlepage>
+
+  <t:titlepage t:element="component.list.of.examples" t:wrapper="fo:block">
+    <t:titlepage-content t:side="recto">
+      <title
+            t:force="1"
+            t:named-template="gentext"
+            param:key="'ListofExamples'"
+             space-before.minimum="1em"
+             space-before.optimum="1em"
+             space-before.maximum="1em"
+            space-after="0.5em"
+            margin-left="{$title.margin.left}"
+            font-size="&hsize1;"
+            font-weight="bold"
+            font-family="{$title.fontset}"/>
+    </t:titlepage-content>
+
+    <t:titlepage-content t:side="verso">
+    </t:titlepage-content>
+
+    <t:titlepage-separator>
+    </t:titlepage-separator>
+
+    <t:titlepage-before t:side="recto">
+    </t:titlepage-before>
+
+    <t:titlepage-before t:side="verso">
+    </t:titlepage-before>
+  </t:titlepage>
+
+  <t:titlepage t:element="component.list.of.equations" t:wrapper="fo:block">
+    <t:titlepage-content t:side="recto">
+      <title
+            t:force="1"
+            t:named-template="gentext"
+            param:key="'ListofEquations'"
+             space-before.minimum="1em"
+             space-before.optimum="1em"
+             space-before.maximum="1em"
+            space-after="0.5em"
+            margin-left="{$title.margin.left}"
+            font-size="&hsize1;"
+            font-weight="bold"
+            font-family="{$title.fontset}"/>
+    </t:titlepage-content>
+
+    <t:titlepage-content t:side="verso">
+    </t:titlepage-content>
+
+    <t:titlepage-separator>
+    </t:titlepage-separator>
+
+    <t:titlepage-before t:side="recto">
+    </t:titlepage-before>
+
+    <t:titlepage-before t:side="verso">
+    </t:titlepage-before>
+  </t:titlepage>
+
+  <t:titlepage t:element="component.list.of.procedures" t:wrapper="fo:block">
+    <t:titlepage-content t:side="recto">
+      <title
+            t:force="1"
+            t:named-template="gentext"
+            param:key="'ListofProcedures'"
+             space-before.minimum="1em"
+             space-before.optimum="1em"
+             space-before.maximum="1em"
+            space-after="0.5em"
+            margin-left="{$title.margin.left}"
+            font-size="&hsize1;"
+            font-weight="bold"
+            font-family="{$title.fontset}"/>
+    </t:titlepage-content>
+
+    <t:titlepage-content t:side="verso">
+    </t:titlepage-content>
+
+    <t:titlepage-separator>
+    </t:titlepage-separator>
+
+    <t:titlepage-before t:side="recto">
+    </t:titlepage-before>
+
+    <t:titlepage-before t:side="verso">
+    </t:titlepage-before>
+  </t:titlepage>
+
+  <t:titlepage t:element="component.list.of.unknowns" t:wrapper="fo:block">
+    <t:titlepage-content t:side="recto">
+      <title
+            t:force="1"
+            t:named-template="gentext"
+            param:key="'ListofUnknown'"
+             space-before.minimum="1em"
+             space-before.optimum="1em"
+             space-before.maximum="1em"
+            space-after="0.5em"
+            margin-left="{$title.margin.left}"
+            font-size="&hsize1;"
+            font-weight="bold"
+            font-family="{$title.fontset}"/>
+    </t:titlepage-content>
+
+    <t:titlepage-content t:side="verso">
+    </t:titlepage-content>
+
+    <t:titlepage-separator>
+    </t:titlepage-separator>
+
+    <t:titlepage-before t:side="recto">
+    </t:titlepage-before>
+
+    <t:titlepage-before t:side="verso">
+    </t:titlepage-before>
+  </t:titlepage>
+
 <!-- ==================================================================== -->
 
 </t:templates>