highlight.xsl 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <?xml version="1.0"?>
  2. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xslthl="http://xslthl.sf.net" exclude-result-prefixes="xslthl" version="1.0">
  3. <!-- ********************************************************************
  4. $Id: highlight.xsl 9725 2013-02-28 14:49:03Z kosek $
  5. ********************************************************************
  6. This file is part of the XSL DocBook Stylesheet distribution.
  7. See ../README or http://docbook.sf.net/release/xsl/current/ for
  8. and other information.
  9. ******************************************************************** -->
  10. <xsl:import href="../highlighting/common.xsl"/>
  11. <xsl:template match="xslthl:keyword" mode="xslthl">
  12. <strong class="hl-keyword">
  13. <xsl:apply-templates mode="xslthl"/>
  14. </strong>
  15. </xsl:template>
  16. <xsl:template match="xslthl:string" mode="xslthl">
  17. <strong class="hl-string">
  18. <em style="color:red">
  19. <xsl:apply-templates mode="xslthl"/>
  20. </em>
  21. </strong>
  22. </xsl:template>
  23. <xsl:template match="xslthl:comment" mode="xslthl">
  24. <em class="hl-comment" style="color: silver">
  25. <xsl:apply-templates mode="xslthl"/>
  26. </em>
  27. </xsl:template>
  28. <xsl:template match="xslthl:directive" mode="xslthl">
  29. <span class="hl-directive" style="color: maroon">
  30. <xsl:apply-templates mode="xslthl"/>
  31. </span>
  32. </xsl:template>
  33. <xsl:template match="xslthl:tag" mode="xslthl">
  34. <strong class="hl-tag" style="color: #000096">
  35. <xsl:apply-templates mode="xslthl"/>
  36. </strong>
  37. </xsl:template>
  38. <xsl:template match="xslthl:attribute" mode="xslthl">
  39. <span class="hl-attribute" style="color: #F5844C">
  40. <xsl:apply-templates mode="xslthl"/>
  41. </span>
  42. </xsl:template>
  43. <xsl:template match="xslthl:value" mode="xslthl">
  44. <span class="hl-value" style="color: #993300">
  45. <xsl:apply-templates mode="xslthl"/>
  46. </span>
  47. </xsl:template>
  48. <xsl:template match='xslthl:html' mode="xslthl">
  49. <span class="hl-html" style="color: navy; font-weight: bold">
  50. <xsl:apply-templates mode="xslthl"/>
  51. </span>
  52. </xsl:template>
  53. <xsl:template match="xslthl:xslt" mode="xslthl">
  54. <strong style="color: #0066FF">
  55. <xsl:apply-templates mode="xslthl"/>
  56. </strong>
  57. </xsl:template>
  58. <!-- Not emitted since XSLTHL 2.0 -->
  59. <xsl:template match="xslthl:section" mode="xslthl">
  60. <strong>
  61. <xsl:apply-templates mode="xslthl"/>
  62. </strong>
  63. </xsl:template>
  64. <xsl:template match="xslthl:number" mode="xslthl">
  65. <span class="hl-number">
  66. <xsl:apply-templates mode="xslthl"/>
  67. </span>
  68. </xsl:template>
  69. <xsl:template match="xslthl:annotation" mode="xslthl">
  70. <em>
  71. <span class="hl-annotation" style="color: gray">
  72. <xsl:apply-templates mode="xslthl"/>
  73. </span>
  74. </em>
  75. </xsl:template>
  76. <!-- Not sure which element will be in final XSLTHL 2.0 -->
  77. <xsl:template match="xslthl:doccomment|xslthl:doctype" mode="xslthl">
  78. <strong class="hl-tag" style="color: blue">
  79. <xsl:apply-templates mode="xslthl"/>
  80. </strong>
  81. </xsl:template>
  82. </xsl:stylesheet>