r5986 - in trunk/BOOK/stylesheets: . xhtml

manuel at linuxfromscratch.org manuel at linuxfromscratch.org
Mon May 1 02:18:30 PDT 2006


Author: manuel
Date: 2006-05-01 03:18:28 -0600 (Mon, 01 May 2006)
New Revision: 5986

Modified:
   trunk/BOOK/stylesheets/blfs-chunked1.xsl
   trunk/BOOK/stylesheets/xhtml/lfs-navigational.xsl
   trunk/BOOK/stylesheets/xhtml/lfs-sections.xsl
Log:
Prevent creation of dummy HTML files.

Modified: trunk/BOOK/stylesheets/blfs-chunked1.xsl
===================================================================
--- trunk/BOOK/stylesheets/blfs-chunked1.xsl	2006-05-01 00:47:43 UTC (rev 5985)
+++ trunk/BOOK/stylesheets/blfs-chunked1.xsl	2006-05-01 09:18:28 UTC (rev 5986)
@@ -31,4 +31,23 @@
   <xsl:include href="xhtml/lfs-legalnotice.xsl"/>
   <xsl:include href="xhtml/lfs-navigational.xsl"/>
 
+  <!-- Prevent creation of dummy files -->
+  <xsl:template match="sect1|sect2|sect3|sect4|sect5|section">
+    <xsl:variable name="ischunk">
+      <xsl:call-template name="chunk"/>
+    </xsl:variable>
+    <xsl:choose>
+      <xsl:when test="@role = 'dummy'"/>
+      <xsl:when test="not(parent::*)">
+        <xsl:call-template name="process-chunk-element"/>
+      </xsl:when>
+      <xsl:when test="$ischunk = 0">
+        <xsl:apply-imports/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:call-template name="process-chunk-element"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
 </xsl:stylesheet>

Modified: trunk/BOOK/stylesheets/xhtml/lfs-navigational.xsl
===================================================================
--- trunk/BOOK/stylesheets/xhtml/lfs-navigational.xsl	2006-05-01 00:47:43 UTC (rev 5985)
+++ trunk/BOOK/stylesheets/xhtml/lfs-navigational.xsl	2006-05-01 09:18:28 UTC (rev 5986)
@@ -40,60 +40,104 @@
         <ul class="headerlinks">
           <xsl:if test="count($prev)>0 and $prev != $home">
             <li class="prev">
-              <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:attribute name="title">
-                  <xsl:value-of select="$prev/title"/>
-                </xsl:attribute>
-                <xsl:call-template name="navig.content">
-                  <xsl:with-param name="direction" select="'prev'"/>
-                </xsl:call-template>
-              </a>
-              <p>
-                <xsl:value-of select="$prev/title"/>
-              </p>
+              <xsl:choose>
+                <xsl:when test="$prev[@role='dummy']">
+                  <a accesskey="p">
+                    <xsl:attribute name="href">
+                      <xsl:call-template name="href.target">
+                        <xsl:with-param name="object" select="preceding-sibling::sect1[position()=2]"/>
+                      </xsl:call-template>
+                    </xsl:attribute>
+                    <xsl:attribute name="title">
+                      <xsl:value-of select="preceding-sibling::sect1[position()=2]/title"/>
+                    </xsl:attribute>
+                    <xsl:call-template name="navig.content">
+                      <xsl:with-param name="direction" select="'prev'"/>
+                    </xsl:call-template>
+                  </a>
+                  <p>
+                    <xsl:value-of select="preceding-sibling::sect1[position()=2]/title"/>
+                  </p>
+                </xsl:when>
+                <xsl:otherwise>
+                  <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:attribute name="title">
+                      <xsl:value-of select="$prev/title"/>
+                    </xsl:attribute>
+                    <xsl:call-template name="navig.content">
+                      <xsl:with-param name="direction" select="'prev'"/>
+                    </xsl:call-template>
+                  </a>
+                  <p>
+                    <xsl:value-of select="$prev/title"/>
+                  </p>
+                </xsl:otherwise>
+              </xsl:choose>
             </li>
           </xsl:if>
           <xsl:if test="count($next)>0">
             <li class="next">
-              <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:attribute name="title">
-                  <xsl:choose>
-                    <xsl:when test="local-name($next)='index'">
-                      <xsl:call-template name="gentext">
-                        <xsl:with-param name="key">Index</xsl:with-param>
+              <xsl:choose>
+                <xsl:when test="$next[@role='dummy']">
+                  <a accesskey="n">
+                    <xsl:attribute name="href">
+                      <xsl:call-template name="href.target">
+                        <xsl:with-param name="object" select="following-sibling::sect1[position()=2]"/>
                       </xsl:call-template>
-                    </xsl:when>
-                    <xsl:otherwise>
-                      <xsl:value-of select="$next/title"/>
-                    </xsl:otherwise>
-                  </xsl:choose>
-                </xsl:attribute>
-                <xsl:call-template name="navig.content">
-                  <xsl:with-param name="direction" select="'next'"/>
-                </xsl:call-template>
-              </a>
-              <p>
-                <xsl:choose>
-                  <xsl:when test="local-name($next)='index'">
-                    <xsl:call-template name="gentext">
-                      <xsl:with-param name="key">Index</xsl:with-param>
+                    </xsl:attribute>
+                    <xsl:attribute name="title">
+                      <xsl:value-of select="following-sibling::sect1[position()=2]/title"/>
+                    </xsl:attribute>
+                    <xsl:call-template name="navig.content">
+                      <xsl:with-param name="direction" select="'next'"/>
                     </xsl:call-template>
-                  </xsl:when>
-                  <xsl:otherwise>
-                    <xsl:value-of select="$next/title"/>
-                  </xsl:otherwise>
-                </xsl:choose>
-              </p>
+                  </a>
+                  <p>
+                    <xsl:value-of select="following-sibling::sect1[position()=2]/title"/>
+                  </p>
+                </xsl:when>
+                <xsl:otherwise>
+                  <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:attribute name="title">
+                      <xsl:choose>
+                        <xsl:when test="local-name($next)='index'">
+                          <xsl:call-template name="gentext">
+                            <xsl:with-param name="key">Index</xsl:with-param>
+                          </xsl:call-template>
+                        </xsl:when>
+                        <xsl:otherwise>
+                          <xsl:value-of select="$next/title"/>
+                        </xsl:otherwise>
+                      </xsl:choose>
+                    </xsl:attribute>
+                    <xsl:call-template name="navig.content">
+                      <xsl:with-param name="direction" select="'next'"/>
+                    </xsl:call-template>
+                  </a>
+                  <p>
+                    <xsl:choose>
+                      <xsl:when test="local-name($next)='index'">
+                        <xsl:call-template name="gentext">
+                          <xsl:with-param name="key">Index</xsl:with-param>
+                        </xsl:call-template>
+                      </xsl:when>
+                      <xsl:otherwise>
+                        <xsl:value-of select="$next/title"/>
+                      </xsl:otherwise>
+                    </xsl:choose>
+                  </p>
+                </xsl:otherwise>
+              </xsl:choose>
             </li>
           </xsl:if>
             <li class="up">
@@ -150,60 +194,104 @@
         <ul>
           <xsl:if test="count($prev)>0 and $prev != $home">
             <li class="prev">
-              <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:attribute name="title">
-                  <xsl:value-of select="$prev/title"/>
-                </xsl:attribute>
-                <xsl:call-template name="navig.content">
-                  <xsl:with-param name="direction" select="'prev'"/>
-                </xsl:call-template>
-              </a>
-              <p>
-                <xsl:value-of select="$prev/title"/>
-              </p>
+              <xsl:choose>
+                <xsl:when test="$prev[@role='dummy']">
+                  <a accesskey="p">
+                    <xsl:attribute name="href">
+                      <xsl:call-template name="href.target">
+                        <xsl:with-param name="object" select="preceding-sibling::sect1[position()=2]"/>
+                      </xsl:call-template>
+                    </xsl:attribute>
+                    <xsl:attribute name="title">
+                      <xsl:value-of select="preceding-sibling::sect1[position()=2]/title"/>
+                    </xsl:attribute>
+                    <xsl:call-template name="navig.content">
+                      <xsl:with-param name="direction" select="'prev'"/>
+                    </xsl:call-template>
+                  </a>
+                  <p>
+                    <xsl:value-of select="preceding-sibling::sect1[position()=2]/title"/>
+                  </p>
+                </xsl:when>
+                <xsl:otherwise>
+                  <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:attribute name="title">
+                      <xsl:value-of select="$prev/title"/>
+                    </xsl:attribute>
+                    <xsl:call-template name="navig.content">
+                      <xsl:with-param name="direction" select="'prev'"/>
+                    </xsl:call-template>
+                  </a>
+                  <p>
+                    <xsl:value-of select="$prev/title"/>
+                  </p>
+                </xsl:otherwise>
+              </xsl:choose>
             </li>
           </xsl:if>
           <xsl:if test="count($next)>0">
             <li class="next">
-              <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:attribute name="title">
-                  <xsl:choose>
-                    <xsl:when test="local-name($next)='index'">
-                      <xsl:call-template name="gentext">
-                        <xsl:with-param name="key">Index</xsl:with-param>
+              <xsl:choose>
+                <xsl:when test="$next[@role='dummy']">
+                  <a accesskey="n">
+                    <xsl:attribute name="href">
+                      <xsl:call-template name="href.target">
+                        <xsl:with-param name="object" select="following-sibling::sect1[position()=2]"/>
                       </xsl:call-template>
-                    </xsl:when>
-                    <xsl:otherwise>
-                      <xsl:value-of select="$next/title"/>
-                    </xsl:otherwise>
-                  </xsl:choose>
-                </xsl:attribute>
-                <xsl:call-template name="navig.content">
-                  <xsl:with-param name="direction" select="'next'"/>
-                </xsl:call-template>
-              </a>
-              <p>
-                <xsl:choose>
-                  <xsl:when test="local-name($next)='index'">
-                    <xsl:call-template name="gentext">
-                      <xsl:with-param name="key">Index</xsl:with-param>
+                    </xsl:attribute>
+                    <xsl:attribute name="title">
+                      <xsl:value-of select="following-sibling::sect1[position()=2]/title"/>
+                    </xsl:attribute>
+                    <xsl:call-template name="navig.content">
+                      <xsl:with-param name="direction" select="'next'"/>
                     </xsl:call-template>
-                  </xsl:when>
-                  <xsl:otherwise>
-                    <xsl:value-of select="$next/title"/>
-                  </xsl:otherwise>
-                </xsl:choose>
-              </p>
+                  </a>
+                  <p>
+                    <xsl:value-of select="following-sibling::sect1[position()=2]/title"/>
+                  </p>
+                </xsl:when>
+                <xsl:otherwise>
+                  <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:attribute name="title">
+                      <xsl:choose>
+                        <xsl:when test="local-name($next)='index'">
+                          <xsl:call-template name="gentext">
+                            <xsl:with-param name="key">Index</xsl:with-param>
+                          </xsl:call-template>
+                        </xsl:when>
+                        <xsl:otherwise>
+                          <xsl:value-of select="$next/title"/>
+                        </xsl:otherwise>
+                      </xsl:choose>
+                    </xsl:attribute>
+                    <xsl:call-template name="navig.content">
+                      <xsl:with-param name="direction" select="'next'"/>
+                    </xsl:call-template>
+                  </a>
+                  <p>
+                    <xsl:choose>
+                      <xsl:when test="local-name($next)='index'">
+                        <xsl:call-template name="gentext">
+                          <xsl:with-param name="key">Index</xsl:with-param>
+                        </xsl:call-template>
+                      </xsl:when>
+                      <xsl:otherwise>
+                        <xsl:value-of select="$next/title"/>
+                      </xsl:otherwise>
+                    </xsl:choose>
+                  </p>
+                </xsl:otherwise>
+              </xsl:choose>
             </li>
           </xsl:if>
             <li class="up">
@@ -250,5 +338,3 @@
   </xsl:template>
 
 </xsl:stylesheet>
-
-

Modified: trunk/BOOK/stylesheets/xhtml/lfs-sections.xsl
===================================================================
--- trunk/BOOK/stylesheets/xhtml/lfs-sections.xsl	2006-05-01 00:47:43 UTC (rev 5985)
+++ trunk/BOOK/stylesheets/xhtml/lfs-sections.xsl	2006-05-01 09:18:28 UTC (rev 5986)
@@ -4,10 +4,6 @@
                 xmlns="http://www.w3.org/1999/xhtml"
                 version="1.0">
 
-
-  <!-- Dummy sect1 files for TOC hacking -->
-  <xsl:template match="sect1[@role='dummy']"/>
-   
    <!-- Sect1 attributes -->
   <xsl:template match="sect1">
     <div>




More information about the blfs-book mailing list