]> granicus.if.org Git - docbook-dsssl/commitdiff
Implementing handling for <b> and <i>: transform to <strong> and <em> for XHTML outpu...
authorKeith Fahlgren <abdelazer@users.sourceforge.net>
Tue, 28 Sep 2010 17:02:06 +0000 (17:02 +0000)
committerKeith Fahlgren <abdelazer@users.sourceforge.net>
Tue, 28 Sep 2010 17:02:06 +0000 (17:02 +0000)
xsl/html/highlight.xsl
xsl/xhtml-1_1/html2xhtml.xsl
xsl/xhtml/html2xhtml.xsl

index 6c9c34223b96dd8fb9d4d32194795a74f1ff72b6..58a02b0500b1ec20e70b661bac94b2480238bd25 100644 (file)
@@ -1,10 +1,6 @@
-<?xml version='1.0'?>\r
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"\r
-               xmlns:xslthl="http://xslthl.sf.net"\r
-                exclude-result-prefixes="xslthl"\r
-                version='1.0'>\r
-\r
-<!-- ********************************************************************\r
+<?xml version="1.0"?>\r
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xslthl="http://xslthl.sf.net" exclude-result-prefixes="xslthl" version="1.0">\r
+  <!-- ********************************************************************\r
      $Id$\r
      ********************************************************************\r
 \r
      and other information.\r
 \r
      ******************************************************************** -->\r
-\r
-<xsl:import href="../highlighting/common.xsl"/>\r
-\r
-<xsl:template match='xslthl:keyword' mode="xslthl">\r
-  <b class="hl-keyword"><xsl:apply-templates mode="xslthl"/></b>\r
-</xsl:template>\r
-\r
-<xsl:template match='xslthl:string' mode="xslthl">\r
-  <b class="hl-string"><i style="color:red"><xsl:apply-templates mode="xslthl"/></i></b>\r
-</xsl:template>\r
-\r
-<xsl:template match='xslthl:comment' mode="xslthl">\r
-  <i class="hl-comment" style="color: silver"><xsl:apply-templates mode="xslthl"/></i>\r
-</xsl:template>\r
-\r
-<xsl:template match='xslthl:directive' mode="xslthl">\r
-  <span class="hl-directive" style="color: maroon"><xsl:apply-templates mode="xslthl"/></span>\r
-</xsl:template>\r
-\r
-<xsl:template match='xslthl:tag' mode="xslthl">\r
-  <b class="hl-tag" style="color: #000096"><xsl:apply-templates mode="xslthl"/></b>\r
-</xsl:template>\r
-\r
-<xsl:template match='xslthl:attribute' mode="xslthl">\r
-  <span class="hl-attribute" style="color: #F5844C"><xsl:apply-templates mode="xslthl"/></span>\r
-</xsl:template>\r
-\r
-<xsl:template match='xslthl:value' mode="xslthl">\r
-  <span class="hl-value" style="color: #993300"><xsl:apply-templates mode="xslthl"/></span>\r
-</xsl:template>\r
-\r
-<xsl:template match='xslthl:html' mode="xslthl">\r
-  <b><i style="color: red"><xsl:apply-templates mode="xslthl"/></i></b>\r
-</xsl:template>\r
-\r
-<xsl:template match='xslthl:xslt' mode="xslthl">\r
-  <b style="color: #0066FF"><xsl:apply-templates mode="xslthl"/></b>\r
-</xsl:template>\r
-\r
-<!-- Not emitted since XSLTHL 2.0 -->\r
-<xsl:template match='xslthl:section' mode="xslthl">\r
-  <b><xsl:apply-templates mode="xslthl"/></b>\r
-</xsl:template>\r
-\r
-<xsl:template match='xslthl:number' mode="xslthl">\r
-  <span class="hl-number"><xsl:apply-templates mode="xslthl"/></span>\r
-</xsl:template>\r
-\r
-<xsl:template match='xslthl:annotation' mode="xslthl">\r
-  <i><span class="hl-annotation" style="color: gray"><xsl:apply-templates mode="xslthl"/></span></i>\r
-</xsl:template>\r
-\r
-<!-- Not sure which element will be in final XSLTHL 2.0 -->\r
-<xsl:template match='xslthl:doccomment|xslthl:doctype' mode="xslthl">\r
-  <b class="hl-tag" style="color: blue"><xsl:apply-templates mode="xslthl"/></b>\r
-</xsl:template>\r
-\r
-</xsl:stylesheet>
\ No newline at end of file
+  <xsl:import href="../highlighting/common.xsl"/>\r
+  <xsl:template match="xslthl:keyword" mode="xslthl">\r
+    <strong class="hl-keyword">\r
+      <xsl:apply-templates mode="xslthl"/>\r
+    </strong>\r
+  </xsl:template>\r
+  <xsl:template match="xslthl:string" mode="xslthl">\r
+    <strong class="hl-string">\r
+      <em style="color:red">\r
+        <xsl:apply-templates mode="xslthl"/>\r
+      </em>\r
+    </strong>\r
+  </xsl:template>\r
+  <xsl:template match="xslthl:comment" mode="xslthl">\r
+    <em class="hl-comment" style="color: silver">\r
+      <xsl:apply-templates mode="xslthl"/>\r
+    </em>\r
+  </xsl:template>\r
+  <xsl:template match="xslthl:directive" mode="xslthl">\r
+    <span class="hl-directive" style="color: maroon">\r
+      <xsl:apply-templates mode="xslthl"/>\r
+    </span>\r
+  </xsl:template>\r
+  <xsl:template match="xslthl:tag" mode="xslthl">\r
+    <strong class="hl-tag" style="color: #000096">\r
+      <xsl:apply-templates mode="xslthl"/>\r
+    </strong>\r
+  </xsl:template>\r
+  <xsl:template match="xslthl:attribute" mode="xslthl">\r
+    <span class="hl-attribute" style="color: #F5844C">\r
+      <xsl:apply-templates mode="xslthl"/>\r
+    </span>\r
+  </xsl:template>\r
+  <xsl:template match="xslthl:value" mode="xslthl">\r
+    <span class="hl-value" style="color: #993300">\r
+      <xsl:apply-templates mode="xslthl"/>\r
+    </span>\r
+  </xsl:template>\r
+  <xsl:template match="xslthl:html" mode="xslthl">\r
+    <strong>\r
+      <em style="color: red">\r
+        <xsl:apply-templates mode="xslthl"/>\r
+      </em>\r
+    </strong>\r
+  </xsl:template>\r
+  <xsl:template match="xslthl:xslt" mode="xslthl">\r
+    <strong style="color: #0066FF">\r
+      <xsl:apply-templates mode="xslthl"/>\r
+    </strong>\r
+  </xsl:template>\r
+  <!-- Not emitted since XSLTHL 2.0 -->\r
+  <xsl:template match="xslthl:section" mode="xslthl">\r
+    <strong>\r
+      <xsl:apply-templates mode="xslthl"/>\r
+    </strong>\r
+  </xsl:template>\r
+  <xsl:template match="xslthl:number" mode="xslthl">\r
+    <span class="hl-number">\r
+      <xsl:apply-templates mode="xslthl"/>\r
+    </span>\r
+  </xsl:template>\r
+  <xsl:template match="xslthl:annotation" mode="xslthl">\r
+    <em>\r
+      <span class="hl-annotation" style="color: gray">\r
+        <xsl:apply-templates mode="xslthl"/>\r
+      </span>\r
+    </em>\r
+  </xsl:template>\r
+  <!-- Not sure which element will be in final XSLTHL 2.0 -->\r
+  <xsl:template match="xslthl:doccomment|xslthl:doctype" mode="xslthl">\r
+    <strong class="hl-tag" style="color: blue">\r
+      <xsl:apply-templates mode="xslthl"/>\r
+    </strong>\r
+  </xsl:template>\r
+</xsl:stylesheet>\r
index 9b4bc16eab7321e7c57ea995168856303d5dc128..ca293d311c4374132e59ebe429bb51f1338c0601 100644 (file)
 <!-- "The following HTML elements specify font information. 
       Although they are not all deprecated, their use is discouraged in 
       favor of style sheets." -->
-<xsl:template match="b|i">
-  <xsl:apply-templates/>
+<xsl:template match="b">
+  <strong xmlns="http://www.w3.org/1999/xhtml">
+    <xsl:apply-templates select="@*|node()"/>
+  </strong>
+</xsl:template>  
+<xsl:template match="i">
+  <em xmlns="http://www.w3.org/1999/xhtml">
+    <xsl:apply-templates select="@*|node()"/>
+  </em>
 </xsl:template>  
 
 <!-- this only occurs in docbook.xsl to identify errors -->
index ca0062d5ee8f81999b60a819c6cd9d0ca5005b81..2d89f56ed2e044d93f122a4a97e142bbf9e436dd 100644 (file)
 <!-- "The following HTML elements specify font information. 
       Although they are not all deprecated, their use is discouraged in 
       favor of style sheets." -->
-<xsl:template match="b|i">
-  <xsl:apply-templates/>
+<xsl:template match="b">
+  <strong xmlns="http://www.w3.org/1999/xhtml">
+    <xsl:apply-templates select="@*|node()"/>
+  </strong>
+</xsl:template>  
+<xsl:template match="i">
+  <em xmlns="http://www.w3.org/1999/xhtml">
+    <xsl:apply-templates select="@*|node()"/>
+  </em>
 </xsl:template>  
 
 <!-- this only occurs in docbook.xsl to identify errors -->