Next in thread → Next in month →

Re: [docbook-apps] Syntax coloring of programlisting

From
Oliver Horn <>
Date
2004-11-11T00:27:24+00:00
ID
Thread
Re: [docbook-apps] Syntax coloring of programlisting
Hi,

>>>I'm thinking about doing syntax highlightning of example code, typically
>>>found in Docbook's programlisting[1] element. I've never seen this in
>>>Docbook, only in web forums and such. Have anyone any experience with
>>>this, or is aware of existing solutions?
>>>      
>>>
>>I've implemented something similar as XSLT extension function. The
>>extension function takes two string parameters (the first parameter
>>contains the plain code fragment, the second parameter defines its
>>language) and returns an interim node-set representing the tokenized
>>program. In a second step, the returned node-set can be processed
>>further, e.g. transformed into formatted output.
>>
>>My implementation is written for SAXON 6.5 and makes use of the free
>>jEdit Syntax Package [1] which performs the actual tokenization. The
>>implementation is just a few lines of Java code. I think a similar
>>extension for other (Java-based) XSLT processors or syntax highlighting
>>packages would be straight-forward. If you (or anyone else) is
>>interested in it, I can publish the source.
>>    
>>
>
>That would likely be useful, perhaps you can attach it to a mail in this 
>thread? 
>
>In order to avoid future confusion, you could put a license header of your 
>choice in every file.
>  
>
I've put it here: http://www.oliverh.com/saxon-tokenizer.zip

Regards,
Oliver
Next in thread → Next in month →