OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Re: [docbook] Programming language in programlisting


Lars Trieloff wrote:


> I am writing a Saxon-Extension for Syntax-Highlighting code in 
> programlistings.


Here's one for XML (not yet finished), written in XSLT 2:

http://www.pinkjuice.com/howto/vimxml/xslt/tinydbk2xhtml/markup_xml.xslt2
It matches XHTML code
   template match="code[@class='XML' and not(*)]"
You could easily modify this line to match DocBook code.

Sample output:
http://www.pinkjuice.com/howto/vimxml/tasks.xml#generatingxml
and at the bottom of
http://www.pinkjuice.com/howto/vimxml/intro.xml

It's part of the prototype
http://www.pinkjuice.com/howto/vimxml/about.xml#sources
and will be part of Doxy
http://www.pinkjuice.com/doxy/

If you'll ever write syntax markup XSLTs (be it in XSLT 1 or 2) for any 
programming lang or syntax, perhaps you want to make them available.

> My question is, how to specify the programming language 
> of the code in the programlisting.
> 
> As I understood lang, it is only for human languages. The other option 
> seems to be role, so which version is better?
> 
> <programlisting lang="java">
> 
> or
> 
> <programlisting role="java">


This is insufficient, and not concise IMHO. No (syntax) tool can know 
that the syntax is Java.

See my RFE, RFE 692319
http://sourceforge.net/tracker/index.php?func=detail&aid=692319&group_id=21935&atid=373750
eg
<programlisting role="ClassTemplate" syntax="Java"

Tobi


-- 
http://www.pinkjuice.com/



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]