
Tommy Nordgren wrote:
How do I get syntax highlighting in program listings, when doing a docbook transformation? I've downloaded and installed the xslthl jar from source forge. I'm using oxygen 9.3 and renderx xep. No matter how I configure the transformation, c program listings end up plain.
oXygen 9.3 is bundled with version of DocBook stylesheets which needs setting java property in order to get highlighting working. Thus it might be easier to use newer version of stylesheets instead of these bundled with oXygen. Try the following: 1. Download the latest version (at least 1.74.0) of DocBook stylesheets from http://sourceforge.net/project/showfiles.php?group_id=21935&package_id=16608 and unpack it somewhere 2. Download xslthl 2.0.0 from http://downloads.sourceforge.net/xslthl/xslthl-2.0.0.zip?modtime=1217348704&big_mirror=0&filesize=53099 and unpack the file xslthl-2.0.0.jar somewhere 3. In oXygen in Configure Transformation Scenario do the following: - *duplicate* existing DocBook HTML/PDF scenario - *edit* the duplicate - in *XSL URL* modify path to point to the copy of stylesheets from step 1. - in *Parameters* set parameter "highlight.source" to 1 and "highlight.xslthl.config" to location of xslthl-config.xml file which is part of the stylesheets downloaded in step 1. (e.g. file:///c:/temp/docbook-xsl/highlighting/xslthl-config.xml) - in *Extensions* add xslthl-2.0.0.jar 4. In your DocBook source use something like (note language attribute): <programlisting language="c">for (int i = 0; i < 100; i++) { printf(i + "\n"); }</programlisting> 5. Use newly created transformation scenario, you should get syntax highlighting. HTH, Jirka -- ------------------------------------------------------------------ Jirka Kosek e-mail: jirka@kosek.cz http://xmlguru.cz ------------------------------------------------------------------ Professional XML consulting and training services DocBook customization, custom XSLT/XSL-FO document processing ------------------------------------------------------------------ OASIS DocBook TC member, W3C Invited Expert, ISO JTC1/SC34 member ------------------------------------------------------------------