Update 2008-07-10: I joined the xslthl project, you can expect an new release soon with these changes and much much more.

Updated Xslthl

Xslthl is an XSLT extention that adds syntax highlighting functionality. However, the project has some limitations and is currently no actively maintained. On this page you will find a modified version of the xslthl project that addesses some of these issues.

Changes

The following things have been changed:

Xalan connector
Xslthl only provided a saxon6 connector. This updated version also provides a Xalan connector (2.7). To use the Xalan connector add the following namespace to your xslt document: xmlns:xhl="xalan://net.sf.xslthl.XalanConnector". After this you will be able to call the highlight function like this: <xsl:apply-templates select="xhl:highlight($language, exsl:node-set(.))"/>
Embedded XML tags are no longer discarded
The following code is possible with this version:
<programlisting language="java">
class MyClass
{
	private int foo; <co xml:id="example.myclass.foo" />
}
</programlisting>
After highlighting the <co ... /> is still in the result and available for further processing. Previously only the syntax highlighted XML nodes were returned. This is very useful when using Xslthl with DocBook.
(bugfix) less "block" generation
In the original xslthl false positive matches would screw up additional highlighters. For example if your highlighter used both the keyword highlighter (on words "if", "then", "else") and a regular expression highlighter you would not be able to define a highlighter that matched on @[a-z]+". This problem is reduced in this version. For example @if will not be highlighted by the previously listed regex matcher.

Downloads


© 2008 Michiel Hendriks <elmuerte@drunksnipers.com> — xslthl source released under zlib/libpng License terms