]> granicus.if.org Git - docbook-dsssl/commitdiff
Add support for make.clean.html setting in block elements.
authorBob Stayton <bobs@sagehill.net>
Fri, 11 Dec 2009 00:07:12 +0000 (00:07 +0000)
committerBob Stayton <bobs@sagehill.net>
Fri, 11 Dec 2009 00:07:12 +0000 (00:07 +0000)
xsl/html/block.xsl
xsl/html/docbook.css.xml

index 802bfaa0a1ea74fe3f1ba16e34539cb2baf3ba05..93bdf75fea9dcd6ae809359036335e2e9f5bc378 100644 (file)
     </xsl:if>
   </xsl:variable>
 
-  <b>
-    <xsl:copy-of select="$titleStr"/>
-    <xsl:if test="$lastChar != ''
-                  and not(contains($runinhead.title.end.punct, $lastChar))">
-      <xsl:value-of select="$runinhead.default.title.end.punct"/>
-    </xsl:if>
-    <xsl:text>&#160;</xsl:text>
-  </b>
+  <xsl:choose>
+    <xsl:when test="$make.clean.html != 0">
+      <span class="formalpara-title">
+        <xsl:copy-of select="$titleStr"/>
+        <xsl:if test="$lastChar != ''
+                      and not(contains($runinhead.title.end.punct, $lastChar))">
+          <xsl:value-of select="$runinhead.default.title.end.punct"/>
+        </xsl:if>
+        <xsl:text>&#160;</xsl:text>
+      </span>
+    </xsl:when>
+    <xsl:otherwise>
+      <b>
+        <xsl:copy-of select="$titleStr"/>
+        <xsl:if test="$lastChar != ''
+                      and not(contains($runinhead.title.end.punct, $lastChar))">
+          <xsl:value-of select="$runinhead.default.title.end.punct"/>
+        </xsl:if>
+        <xsl:text>&#160;</xsl:text>
+      </b>
+    </xsl:otherwise>
+  </xsl:choose>
 </xsl:template>
 
 <xsl:template match="formalpara/para">
 </xsl:template>
 
 <xsl:template match="blockquote/title|blockquote/info/title">
-  <div class="blockquote-title">
-    <p>
-      <b>
+  <xsl:choose>
+    <xsl:when test="$make.clean.html != 0">
+      <div class="blockquote-title">
         <xsl:apply-templates/>
-      </b>
-    </p>
-  </div>
+      </div>
+    </xsl:when>
+    <xsl:otherwise>
+      <div class="blockquote-title">
+        <p>
+          <b>
+            <xsl:apply-templates/>
+          </b>
+        </p>
+      </div>
+    </xsl:otherwise>
+  </xsl:choose>
 </xsl:template>
 
 <!-- Use an em dash per Chicago Manual of Style and https://sourceforge.net/tracker/index.php?func=detail&aid=2793878&group_id=21935&atid=373747 -->
 </xsl:template>
 
 <xsl:template match="msgmain/title">
-  <b><xsl:apply-templates/></b>
+  <xsl:choose>
+    <xsl:when test="$make.clean.html != 0">
+      <span class="msgmain-title">
+        <xsl:apply-templates/>
+      </span>
+    </xsl:when>
+    <xsl:otherwise>
+      <b><xsl:apply-templates/></b>
+    </xsl:otherwise>
+  </xsl:choose>
 </xsl:template>
 
 <xsl:template match="msgsub">
 </xsl:template>
 
 <xsl:template match="msgsub/title">
-  <b><xsl:apply-templates/></b>
+  <xsl:choose>
+    <xsl:when test="$make.clean.html != 0">
+      <span class="msgsub-title">
+        <xsl:apply-templates/>
+      </span>
+    </xsl:when>
+    <xsl:otherwise>
+      <b><xsl:apply-templates/></b>
+    </xsl:otherwise>
+  </xsl:choose>
 </xsl:template>
 
 <xsl:template match="msgrel">
 </xsl:template>
 
 <xsl:template match="msgrel/title">
-  <b><xsl:apply-templates/></b>
+  <xsl:choose>
+    <xsl:when test="$make.clean.html != 0">
+      <span class="msgrel-title">
+        <xsl:apply-templates/>
+      </span>
+    </xsl:when>
+    <xsl:otherwise>
+      <b><xsl:apply-templates/></b>
+    </xsl:otherwise>
+  </xsl:choose>
 </xsl:template>
 
 <xsl:template match="msgtext">
 </xsl:template>
 
 <xsl:template match="msglevel">
-  <p>
-    <b>
-      <xsl:call-template name="gentext.template">
-        <xsl:with-param name="context" select="'msgset'"/>
-        <xsl:with-param name="name" select="'MsgLevel'"/>
-      </xsl:call-template>
-    </b>
-    <xsl:apply-templates/>
-  </p>
+  <xsl:choose>
+    <xsl:when test="$make.clean.html != 0">
+      <div class="msglevel">
+        <span class="msglevel-title">
+          <xsl:call-template name="gentext.template">
+            <xsl:with-param name="context" select="'msgset'"/>
+            <xsl:with-param name="name" select="'MsgLevel'"/>
+          </xsl:call-template>
+        </span>
+        <xsl:apply-templates/>
+      </div>
+    </xsl:when>
+    <xsl:otherwise>
+      <p>
+        <b>
+          <xsl:call-template name="gentext.template">
+            <xsl:with-param name="context" select="'msgset'"/>
+            <xsl:with-param name="name" select="'MsgLevel'"/>
+          </xsl:call-template>
+        </b>
+        <xsl:apply-templates/>
+      </p>
+    </xsl:otherwise>
+  </xsl:choose>
 </xsl:template>
 
 <xsl:template match="msgorig">
-  <p>
-    <b>
-      <xsl:call-template name="gentext.template">
-        <xsl:with-param name="context" select="'msgset'"/>
-        <xsl:with-param name="name" select="'MsgOrig'"/>
-      </xsl:call-template>
-    </b>
-    <xsl:apply-templates/>
-  </p>
+  <xsl:choose>
+    <xsl:when test="$make.clean.html != 0">
+      <div class="msgorig">
+        <span class="msgorig-title">
+          <xsl:call-template name="gentext.template">
+            <xsl:with-param name="context" select="'msgset'"/>
+            <xsl:with-param name="name" select="'MsgOrig'"/>
+          </xsl:call-template>
+        </span>
+        <xsl:apply-templates/>
+      </div>
+    </xsl:when>
+    <xsl:otherwise>
+      <p>
+        <b>
+          <xsl:call-template name="gentext.template">
+            <xsl:with-param name="context" select="'msgset'"/>
+            <xsl:with-param name="name" select="'MsgOrig'"/>
+          </xsl:call-template>
+        </b>
+        <xsl:apply-templates/>
+      </p>
+    </xsl:otherwise>
+  </xsl:choose>
 </xsl:template>
 
 <xsl:template match="msgaud">
-  <p>
-    <b>
-      <xsl:call-template name="gentext.template">
-        <xsl:with-param name="context" select="'msgset'"/>
-        <xsl:with-param name="name" select="'MsgAud'"/>
-      </xsl:call-template>
-    </b>
-    <xsl:apply-templates/>
-  </p>
+  <xsl:choose>
+    <xsl:when test="$make.clean.html != 0">
+      <div class="msgaud">
+        <span class="msgaud-title">
+          <xsl:call-template name="gentext.template">
+            <xsl:with-param name="context" select="'msgset'"/>
+            <xsl:with-param name="name" select="'MsgAud'"/>
+          </xsl:call-template>
+        </span>
+        <xsl:apply-templates/>
+      </div>
+    </xsl:when>
+    <xsl:otherwise>
+      <p>
+        <b>
+          <xsl:call-template name="gentext.template">
+            <xsl:with-param name="context" select="'msgset'"/>
+            <xsl:with-param name="name" select="'MsgAud'"/>
+          </xsl:call-template>
+        </b>
+        <xsl:apply-templates/>
+      </p>
+    </xsl:otherwise>
+  </xsl:choose>
 </xsl:template>
 
 <xsl:template match="msgexplan">
 </xsl:template>
 
 <xsl:template match="msgexplan/title">
-  <p><b><xsl:apply-templates/></b></p>
+  <xsl:choose>
+    <xsl:when test="$make.clean.html != 0">
+      <div class="msgexplan">
+        <span class="msgexplan-title">
+          <xsl:apply-templates/>
+        </span>
+      </div>
+    </xsl:when>
+    <xsl:otherwise>
+      <p>
+        <b>
+          <xsl:apply-templates/>
+        </b>
+      </p>
+    </xsl:otherwise>
+  </xsl:choose>
 </xsl:template>
 
 <!-- ==================================================================== -->
index 9a826624bec3e3af9ca9f423f7ef9f0562b35fcd..c1f558e03abcc0aec2b7b2bd375bdea9ae812bb5 100644 (file)
@@ -1,3 +1,50 @@
 <?xml version="1.0"?>
 <style>
+
+/********************************/
+/* start of styles in block.xsl */
+/********************************/
+.formalpara-title {
+  font-weight: bold;
+}
+
+div.blockquote-title {
+  font-weight: bold;
+  margin-top: 1em;
+  margin-bottom: 1em;
+}
+
+span.msgmain-title {
+  font-weight: bold;
+}
+
+span.msgsub-title {
+  font-weight: bold;
+}
+
+span.msgrel-title {
+  font-weight: bold;
+}
+
+div.msglevel, div.msgorig, div.msgaud {
+  margin-top: 1em;
+  margin-bottom: 1em;
+}
+
+span.msglevel-title, span.msgorig-title, span.msgaud-title {
+  font-weight: bold;
+}
+
+div.msgexplan {
+  margin-top: 1em;
+  margin-bottom: 1em;
+}
+
+span.msgexplan-title {
+  font-weight: bold;
+}
+
+/********************************/
+/* end of styles in block.xsl */
+/********************************/
 </style>