[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] Syntax Highlighting


Subject: Re: [xsl] Syntax Highlighting
From: Florent Georges <lists@xxxxxxxxxxxx>
Date: Wed, 16 Dec 2009 15:41:09 +0000 (GMT)

Heiko Niemann wrote:

  Hi,

> I would like to display a syntax highlighted
XML source/code
> (in this case WSDL) in HTML. I have found a couple
stylesheets
> that might do the job. To ease my search I would like to know
>
whether there are any recommendations for this task. The
> stylesheet should
support idention.

  Back a few years ago, I wrote a general purpose XML
serializer
in XSLT:

    http://www.fgeorges.org/xslt/serial/

  If I remember
well, the serializer takes care of several
properties, like indentation,
whitespace handling (supports
@xml:space), even namespace reduction if I
remember correctly,
etc., and delegates the actual serialization to function
objects
(simulated using FXSL's f:apply()).  So you can use the
serializer
with different configurations in the same transform.

  The distribution
contains an implementation to serialize to
plain text and another to HTML
(generating span elements with
@class to configure easily the result, but you
can also configure
it at the XSLT level).

  That could be a nice example to
translate to XSLT 2.1 ;-)

  Regards,

-- 
Florent Georges
http://www.fgeorges.org/


Current Thread
Keywords