Search code examples
htmlxmlxsltdocbook

How to use custom syntax highlighter styles in DocBook 5.0


I have syntax highlighting on a docbook using a custom language highlighter based on the c++ example.

How can I use different styles for the same highlighter type?

for instance:

<highlighter type="keywords">

<keyword>char</keyword>

<keyword>const</keyword>

<keyword>double</keyword>

<keyword>true</keyword>
<style>keyword</style>

</highlighter>

<highlighter type="keywords">

<keyword>Hotspot</keyword>

<keyword>Character</keyword>

<keyword>Region</keyword>
<style>class</style>

the second load of keywords should highlight with the style 'class' but how do I define and test for this non-default style?


Solution

  • Solved:

     <xsl:template match='xslthl:class' mode="xslthl">
     <b style="color: green"><xsl:apply-templates/></b>
     </xsl:template>
    

    the 'mode' attribute seems vital