[oXygen-user] Highlighting syntax

Jirka Kosek
Wed Oct 15 07:40:02 CDT 2008


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 &lt; 100; i++)
{
  printf(i + "\n");
}</programlisting>

5. Use newly created transformation scenario, you should get syntax
highlighting.

HTH,

			Jirka

-- 
------------------------------------------------------------------
  Jirka Kosek      e-mail:       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
------------------------------------------------------------------

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 250 bytes
Desc: OpenPGP digital signature
Url : http://www.oxygenxml.com/pipermail/oxygen-user/attachments/20081015/fc7ce8f3/attachment.bin 


More information about the oXygen-user mailing list