Re: [xsl] rendering xml fragment tree as syntax highlighted HTML

Subject: Re: [xsl] rendering xml fragment tree as syntax highlighted HTML
From: Christiane Fritze <fritze@xxxxxxx>
Date: Fri, 12 Jan 2007 18:10:27 +0100
Thanks all for your help,

the code of Antony works fine. For our purpose it is not so important to
visualize the empty elements in the condensed form even though it would
be fine to have an exact representation of the source xml.

Indeed I looked for a serialization method, so I will try the serializer
of Florent. But less nice is that the signs  & < etc. in the text nodes
will be transformed into entities (as it is the case in the linked
examples).

Regards,
Christiane

Florent Georges wrote:
Christiane Fritze wrote:

Hi

I want to copy a fragment tree from my source xml document
using <xsl:copy-of/> to the result html document.  This
xml fragment should be rendered als well known code2html
tools does it for perl code etc.  It means at least all <
and > have to be transformed into &lt; and &gt;

If I understand correctly, you want an XML serializer in XSLT. If you use XSLT 2.0, you can take a look at this serializer:

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

  If you want an example, the following are first the XML
input and second the HTML produced by a simple stylesheet
(the last link) showing serialization with different
options:

    http://www.fgeorges.org/xslt/serial/hello-world.xml
    http://www.fgeorges.org/xslt/serial/hello-world.html
    http://www.fgeorges.org/xslt/serial/hello-world.xml

Regards,

--drkm

























___________________________________________________________________________
Dicouvrez une nouvelle fagon d'obtenir des riponses ` toutes vos questions !
Profitez des connaissances, des opinions et des expiriences des internautes
sur Yahoo! Questions/Riponses
http://fr.answers.yahoo.com

Current Thread