title: How to get colored pdf text output with docbook via dblatex?
body: <p>I need to output some hex-data with some bytes highlighted with colored background. Bytes in the data that represent red color values should have red background. That's why I chose</p>
  
  <pre><code>&lt;emphasis role="red"&gt;&lt;/emphasis&gt;
  </code></pre>
  
  <p>to be the tag of choice.</p>
  
  <h1>HTML output</h1>
  
  <p>For HTML output I use</p>
  
  <pre><code>  &lt;xsl:param name="emphasis.propagates.style" select="1"/&gt;
  </code></pre>
  
  <p>in the xsl file and</p>
  
  <pre><code>.red {
    background-color: red;
  }
  </code></pre>
  
  <p>in the stylesheet.
  This works flawlessly.</p>
  
  <h1>PDF output</h1>
  
  <p>For PDF output I use dblatex and tried (file fo.xsl)</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      xmlns:fo="http://www.w3.org/1999/XSL/Format"
      xmlns:d="http://docbook.org/ns/docbook"
      xmlns="http://www.w3.org/TR/xhtml1/transitional"
      version="1.0"&gt;
  
    &lt;xsl:param name="draft.mode"&gt;no&lt;/xsl:param&gt;
    &lt;xsl:param name="imagedata.default.scale"&gt;maxwidth=12cm&lt;/xsl:param&gt;
  
    &lt;xsl:template match="emphasis[@role='red']"&gt;
      &lt;xsl:param name="content"&gt;
        &lt;xsl:apply-templates/&gt;
      &lt;/xsl:param&gt;
      &lt;xsl:text&gt;{\color{red}&lt;/xsl:text&gt;
      &lt;xsl:copy-of select="$content"/&gt;
      &lt;xsl:text&gt;}&lt;/xsl:text&gt;
    &lt;/xsl:template&gt;
  
  &lt;/xsl:stylesheet&gt;
  </code></pre>
  
  <p>And (file test.xml)</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
    "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd"&gt;
  &lt;article lang="en"&gt;
    &lt;title&gt;Test&lt;/title&gt;
    &lt;para&gt;
      &lt;screen&gt;0240h: 00 20 &lt;emphasis role="red"&gt;00&lt;/emphasis&gt; 21&lt;/screen&gt;
    &lt;/para&gt;
  &lt;/article&gt;
  </code></pre>
  
  <p>With the following command to build latex source for checking:</p>
  
  <pre><code>dblatex --backend=pdftex --xslt=xsltproc \
      --input-format=xml --type=tex \
      --xsl-user=fo.xsl --verbose --output=test.tex test.xml
  </code></pre>
  
  <p>This does not work. Emphasised text is still italic, as shown in an excerpt from the resulting test.tex:</p>
  
  <pre><code>\begin{lstlisting}[firstnumber=1,escapeinside={&lt;t&gt;}{&lt;/t&gt;},moredelim={**[is][\bfseries]{&lt;b&gt;}{&lt;/b&gt;}},moredelim={**[is][\itshape]{&lt;i&gt;}{&lt;/i&gt;}},]
  0240h: 00 20 &lt;i&gt;00&lt;/i&gt; 21\end{lstlisting}
  </code></pre>
  
  <p>What am I doing wrong?</p>