I have a Java string of XML content. I use Velocity to generate some HTML reports, and this XML needs to be included into one of those HTML files. It would be nice if this XML is syntax colored and formatted. Does anyone know of a Java library to do this?
A:
How about transforming your xml to html using a XSLT stylesheet and the transform API. See Transform XML into HTML using XSLT: http://www.rgagnon.com/javadetails/java-0407.html
Pierre
2009-01-24 09:39:23
The idea is that the output looks like XML, but with syntax colouring.
Peter Hilton
2009-01-24 09:58:25
XSLT can do that by replacing, say, <span class="codeKeyWord">..</span> with something like <span class="codeKeyWord" style="color:green">..</span>. It's just not very clean way to do it.
Esko
2009-01-24 13:54:34