> > > I want to write a parser over the docbook html output to highlight
> > > the php code in the pear manual. My problem is that now the docbook
> > > tag:
> > >
> > > <programlisting role="php">
> > >
> > > is converted to only:
> > >
> > > <PRE CLASS="programlisting">
> > >
> > > with not difference between one language and an another. How can I
> > > (or start looking at) convert the role="php" to something like <PRE
> > > CLASS="programphp">?
> >
> > well, the "RIGHT THING"(tm) would be to extend the modular style
> > sheets (DSSSL or XSL, whatever you like best) to do so when
> > generating HTML from XML in the first place instead of modifying the
> > generated HTML
> 
> Sure, but I don't want to implement highlight_string() in XSL :-)  
> Sorry I don't know in deep those technologies. For me is very easy to 
> parse the HTML. Or perhapst here is a "get the contents of this tag 
> from the ouptut of that program". Other ugly idea could be to parse 
> directly the DocBook xml and transform this tag in CDATA (really the 
> html highlighted string).
> 
> Any way, any answer for my first question?

OK, I had the time, to test the DSSSL fragment sent to the list
by Jirka Kosek. It seems it works. I'll commit it. It adds
the role="" attributes content as a class="" parameter in HTML,
so it looks like:

 <pre class="php"> and not <pre class="programlisting"> for

PHP files :)

Nice for you as you can now highliht all PHP examples. This
also added a new list for the new versions of the CHM manual.
IMHO it is a very nice idea, to have all the examples colored
(even it adds some more bytes to the files).

Goba

Reply via email to