[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
[Recent Entries]
[Reply To This Message]
Re: rendering xml fragment tree as syntax highlighted
Subject: Re: rendering xml fragment tree as syntax highlighted HTML
From: "Dimitre Novatchev" <dnovatchev@xxxxxxxxx>
Date: Fri, 12 Jan 2007 09:09:59 -0800
|
The Xpath Visualizer is more than 6 years old now.
The XPath Vizualizer for Mozilla was produced later and is not using
any extension functions.
I also hope to be able to publish soon the XPath Visualizer for XPath
2.0 (it will soon be one year since this was produced), based on Saxon
8 .
All of these tools display XML documents (a la IE xml display) as well
as highlight results of evaluating XPath expressions.
--
Cheers,
Dimitre Novatchev
---------------------------------------
Truly great madness cannot be achieved without significant intelligence.
---------------------------------------
To invent, you need a good imagination and a pile of junk
-------------------------------------
You've achieved success in your field when you don't know whether what
you're doing is work or play
On 1/12/07, Christiane Fritze <fritze@xxxxxxx> wrote:
Hi all,
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 < and >
But how I have to handle my <xsl:copy-of> fragment to get the wanted result?
<!-- my XML -->
<?xml version="1.0" encoding="UTF-8"?>
<div0>
<entry key="Capriccio">
<form>
<orth>Capriccio</orth>
</form>
<sense>
<gramGrp>n.</gramGrp> virtuoses, einfallsreiches <seg
function="Mu|sikst">Musikst</seg>
<lb/> ueck, Uebernahme (18. Jh.) von gleichbed.<lb/> ital. <hi
rend="i">capriccio</hi>,
eigentl. <def>'Laune, Grille, <seg function="Ein|fall">Einfall</seg>
<lb/> '</def>; s. <hi rend="i">Kaprice</hi>.<lb/>
</sense>
</entry>
</div0>
<!-- my XSL -->
?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="2.0">
<xsl:output method="html" media-type="text/html"/>
<xsl:template match="div0">
<html>
<title>show XML tree</title>
<body>
<xsl:apply-templates mode="rendered"/>
<hr />
<xsl:apply-templates mode="structured"/>
</body>
</html>
</xsl:template>
<!-- rendering as a dictionary like layout -->
<xsl:template match="entry" mode="rendered">
<!-- some code, works fine -->
</xsl:template>
<!-- show the user the original xml code -->
<xsl:template match="entry" mode="structured">
<xsl:copy-of select="."/>
<tt>
<!-- ?? HOW to handle this result tree so that it can be shown in html? -->
</tt>
</xsl:template>
</xsl:stylesheet>
<!-- WANTED OUTPUT -->
<html>
<title>show XML tree</title>
<body>
<!-- some dictionary like rendered output -->
<tt>
<entry key="Capriccio"><br />
<form><br />
<orth>Capriccio</orth><br />
</form><br />
<sense><br />
<gramGrp>n.</gramGrp> virtuoses, einfallsreiches <seg
function="Mu|sikst">Musikst</seg><br />
<lb/> ueck, Uebernahme (18. Jh.) von gleichbed.<lb/> ital.
<hi rend="i">capriccio</hi>,<br />
eigentl. <def>'Laune, Grille, <seg
function="Ein|fall">Einfall</seg><br />
<lb/> '</def>; s. <hi
rend="i">Kaprice</hi>.<lb/><br />
</sense><br />
</entry><br />
</tt>
</body>
</html>
If the shown xml code is somehow colored it would be perfect.
Many thanks for any hint,
Regards,
Christiane
|
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format
RSS 2.0 |
|
Atom 0.3 |
|
|