]> granicus.if.org Git - docbook-dsssl/commitdiff
Added system.head template; support stylesheet PIs; use role attribute to get body...
authorNorman Walsh <ndw@nwalsh.com>
Sun, 29 Dec 2002 14:58:32 +0000 (14:58 +0000)
committerNorman Walsh <ndw@nwalsh.com>
Sun, 29 Dec 2002 14:58:32 +0000 (14:58 +0000)
slides/xsl/html/slides-common.xsl

index f4151bee4a9e06965a9d80bb991168ab44aa342d..190fd68a6f9ac6022daeb6f8d8fc589db4adaf91 100644 (file)
         <head>
           <title><xsl:value-of select="title"/></title>
 
-          <!-- Links -->
+          <xsl:call-template name="system.head.content">
+            <xsl:with-param name="node" select=".."/>
+          </xsl:call-template>
 
-          <link type="text/css" rel="stylesheet">
-            <xsl:attribute name="href">
-              <xsl:call-template name="css.stylesheet"/>
-            </xsl:attribute>
-          </link>
+          <!-- Links -->
+          <xsl:if test="$css.stylesheet != ''">
+            <link type="text/css" rel="stylesheet" href="{$css.stylesheet}"/>
+          </xsl:if>
+          <xsl:apply-templates select="/processing-instruction('dbhtml')" mode="css.pi"/>
 
           <xsl:call-template name="links">
             <xsl:with-param name="home" select="/slides"/>
               <xsl:with-param name="language" select="'JavaScript'"/>
             </xsl:call-template>
           </xsl:if>
+
+          <xsl:call-template name="user.head.content">
+            <xsl:with-param name="node" select=".."/>
+          </xsl:call-template>
         </head>
-        <body class="titlepage">
+        <body>
+          <xsl:attribute name="class">
+            <xsl:text>titlepage</xsl:text>
+            <xsl:if test="@role">
+              <xsl:text>-</xsl:text>
+              <xsl:value-of select="@role"/>
+            </xsl:if>
+          </xsl:attribute>
+
           <xsl:call-template name="body.attributes"/>
           <xsl:if test="$overlay != 0">
             <xsl:attribute name="onload">
         <head>
           <title><xsl:value-of select="slidesinfo/title"/></title>
 
-          <!-- Links -->
+          <xsl:call-template name="system.head.content"/>
 
-          <link type="text/css" rel="stylesheet">
-            <xsl:attribute name="href">
-              <xsl:call-template name="css.stylesheet"/>
-            </xsl:attribute>
-          </link>
+          <!-- Links -->
+          <xsl:if test="$css.stylesheet != ''">
+            <link type="text/css" rel="stylesheet" href="{$css.stylesheet}"/>
+          </xsl:if>
+          <xsl:apply-templates select="/processing-instruction('dbhtml')" mode="css.pi"/>
 
           <xsl:call-template name="links">
             <xsl:with-param name="home" select="$home"/>
               <xsl:with-param name="language" select="'JavaScript'"/>
             </xsl:call-template>
           </xsl:if>
+
+          <xsl:call-template name="user.head.content"/>
         </head>
 
         <body class="tocpage">
               <xsl:call-template name="toc-body"/>
             </div>
 
-            <xsl:call-template name="toc-bottom-nav">
-              <xsl:with-param name="home" select="$home"/>
-              <xsl:with-param name="up" select="$up"/>
-              <xsl:with-param name="next" select="$next"/>
-              <xsl:with-param name="tocfile" select="$tocfile"/>
-            </xsl:call-template>
+            <div id="overlayDiv">
+              <xsl:call-template name="overlayDiv.attributes"/>
+              <xsl:call-template name="toc-bottom-nav">
+                <xsl:with-param name="home" select="$home"/>
+                <xsl:with-param name="up" select="$up"/>
+                <xsl:with-param name="next" select="$next"/>
+                <xsl:with-param name="tocfile" select="$tocfile"/>
+              </xsl:call-template>
+            </div>
           </div>
         </body>
       </html>
         <head>
           <title><xsl:value-of select="title"/></title>
 
-          <!-- Links -->
+          <xsl:call-template name="system.head.content"/>
 
-          <link type="text/css" rel="stylesheet">
-            <xsl:attribute name="href">
-              <xsl:call-template name="css.stylesheet"/>
-            </xsl:attribute>
-          </link>
+          <!-- Links -->
+          <xsl:if test="$css.stylesheet != ''">
+            <link type="text/css" rel="stylesheet" href="{$css.stylesheet}"/>
+          </xsl:if>
+          <xsl:apply-templates select="/processing-instruction('dbhtml')" mode="css.pi"/>
 
           <xsl:call-template name="links">
             <xsl:with-param name="home" select="$home"/>
               <xsl:with-param name="language" select="'JavaScript'"/>
             </xsl:call-template>
           </xsl:if>
+
+          <xsl:call-template name="user.head.content"/>
         </head>
-        <body class="foil">
+        <body>
+          <xsl:attribute name="class">
+            <xsl:value-of select="local-name(.)"/>
+            <xsl:if test="@role">
+              <xsl:text>-</xsl:text>
+              <xsl:value-of select="@role"/>
+            </xsl:if>
+          </xsl:attribute>
+
           <xsl:call-template name="body.attributes"/>
           <xsl:if test="$overlay != 0">
             <xsl:attribute name="onload">
         <head>
           <title><xsl:value-of select="title"/></title>
 
-          <!-- Links -->
+          <xsl:call-template name="system.head.content"/>
 
-          <link type="text/css" rel="stylesheet">
-            <xsl:attribute name="href">
-              <xsl:call-template name="css.stylesheet"/>
-            </xsl:attribute>
-          </link>
+          <!-- Links -->
+          <xsl:if test="$css.stylesheet != ''">
+            <link type="text/css" rel="stylesheet" href="{$css.stylesheet}"/>
+          </xsl:if>
+          <xsl:apply-templates select="/processing-instruction('dbhtml')" mode="css.pi"/>
 
           <xsl:call-template name="links">
             <xsl:with-param name="home" select="$home"/>
               <xsl:with-param name="language" select="'JavaScript'"/>
             </xsl:call-template>
           </xsl:if>
+
+          <xsl:call-template name="user.head.content"/>
         </head>
-        <body class="foilgroup">
+        <body>
+          <xsl:attribute name="class">
+            <xsl:value-of select="local-name(.)"/>
+            <xsl:if test="@role">
+              <xsl:text>-</xsl:text>
+              <xsl:value-of select="@role"/>
+            </xsl:if>
+          </xsl:attribute>
+
           <xsl:call-template name="body.attributes"/>
           <xsl:if test="$overlay != 0">
             <xsl:attribute name="onload">
 
 <xsl:template name="css.stylesheet">
   <!-- danger will robinson: template shadows parameter -->
+  <xsl:message>Warning: css.stylesheet has been deprecated.</xsl:message>
   <xsl:variable name="source.css.stylesheet">
     <xsl:call-template name="dbhtml-attribute">
       <xsl:with-param name="pis" select="/processing-instruction('dbhtml')"/>
   </xsl:choose>
 </xsl:template>
 
+<xsl:template match="processing-instruction('dbhtml')" mode="css.pi">
+  <xsl:variable name="href">
+    <xsl:call-template name="dbhtml-attribute">
+      <xsl:with-param name="pis" select="."/>
+      <xsl:with-param name="attribute" select="'css-stylesheet'"/>
+    </xsl:call-template>
+  </xsl:variable>
+
+  <xsl:if test="$href != ''">
+    <link type="text/css" rel="stylesheet" href="{$href}"/>
+  </xsl:if>
+</xsl:template>
+
 <!-- ====================================================================== -->
 
 <xsl:template match="foil" mode="number">