Search code examples
xmlpretty-printdocbook

Source code pretty printer with DocBook or XML output?


Is there some source code pretty printer out there that is able to generate DocBook, or at least XML output from my C sources?

I want to include some good looking source code examples in my DocBook document.


Solution

  • I'm not sure what you mean by a pretty-printer that generates XML, but if you want code examples in DocBook documents to be nicely colourized when transformed to HTML or FO/PDF output, take a look at XSLTHL. This is an XSLT extension module (written in Java) that decorates the content of <programlisting> elements.

    For details on using XSLTHL with with the DocBook XSL stylesheets, see http://docbook.sourceforge.net/release/xsl/current/doc/html/highlight.source.html.