The following is an example of syntax highlighting through xslt using xslthl . The following Xslt processor was used: SAXON 6.5.3 from Michael Kay ( http://saxon.sf.net/ )

Example XML document

This uses the standard builtin xml highlighter


<?xml version="1.0"?>

<!--
  Devpaks repository 4.0 - web portal
  Copyright (C) 2005  Michal Molhanec

  This program is free software; you can redistribute it and/or
  modify it under the terms of the GNU General Public License
  as published by the Free Software Foundation; either version 2
  of the License, or (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-->

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

<xsl:import href="common.xsl"/>

<xsl:template match="/page">

<p>
Is this information correct?
</p>
<pre>
<xsl:value-of select='@summary'/>
</pre>
<p>
If it's not use Go back button of your browser or click on Restart wizard link
below.
</p>
<hr/>
<p>
<a href='do_add_devpak.php' id='yeslink'>Yes, all information is correct.</a>
</p>

<p><a href="http://sourceforge.net/tracker/index.php?func=detail&aid=2023748&group_id=153524&atid=788111">bug #2023748</a> test
<b><u>underlined</u> and bold</b>
</p>

</xsl:template>

<otherElement>dfsf</otherElement>

<xsl:template name='extracss'>
  <style type="text/css" media="screen">
  <xsl:comment>
    pre {
      background: white;
      border: 3px solid black;
      padding: 3px;
    }
    #yeslink {
      font-weight: bold;
    }
  </xsl:comment>
  </style>
</xsl:template>

</xsl:stylesheet>

	

Another example

	
<code language="xml" xml:space="preserve">
	<![CDATA[
		plain data that may contain > and < without issues
	]]>
</code>

<!-- 
	only text sections are highlighted, real XML tags are untouched
	below you should see a header 
-->
		

This is formatted as a header <no-tag>

<!-- this code is still highlighted -->

Generated by: SAXON 6.5.3 from Michael Kay ( http://saxon.sf.net/ ) - Xslt version: 1