<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:gnomon="http://www.npsl.co.uk/gnomon" xmlns:verb="http://informatik.hu-berlin.de/xmlverbatim" version="1.0" extension-element-prefixes="gnomon verb">

        
<!-- 
                Output an XHTML/transitional document (uses html output method
                as Xalan does not support xhtml)
         
-->
        
<xsl:output method="html" indent="yes" version="4.0" encoding="us-ascii" media-type="text/html" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" />

        
<!-- 
                For tutorial purposes, ignore this include.  Its function
                is simply to show xml source in a nice fashion, as browsers
                (at least IE and Opera) don't make a nice job of this.
                
                The pretty printing script is by Oliver Becker, see:
                http://www.informatik.hu-berlin.de/~obecker/XSLT/
                and the script source.
        
-->
        
<xsl:include href="/gnomon/util/xml-source-link.xsl" />
        
<xsl:include href="/gnomon/util/xmlverbatim.xsl" />

        
<!-- Match the document root -->        
        
<xsl:template match="/document">
                
<!-- Output an html document -->
                
<html>
                        
<!-- Copy the title -->
                        
<head>
                                
<title><xsl:value-of select="title" /></title>
                                
<link rel="stylesheet" type="text/css" href="../../util/xmlverbatim.css" />
                        
</head>
                        
<!-- Process the body -->
                        
<body>
                                
<xsl:apply-templates select="body" />
                        
</body>
                
</html>
        
</xsl:template>
        
        
<!-- Match a heading -->
        
<xsl:template match="heading">
                
<h1><xsl:apply-templates select="node()" /></h1>
        
</xsl:template>
        
        
<!-- Match a sub-heading -->
        
<xsl:template match="sub-heading">
                
<h2><xsl:apply-templates select="node()" /></h2>
        
</xsl:template>
        
        
<!-- Match a paragraph -->
        
<xsl:template match="paragraph">
                
<p><xsl:apply-templates select="node()" /></p>
        
</xsl:template>

        
<!-- Match a link -->
        
<xsl:template match="link">
                
<a href="{@linkend}"><xsl:apply-templates select="node()" /></a>
        
</xsl:template>
        
        
<!-- Match a list -->
        
<xsl:template match="itemizedlist">
                
<ul><xsl:apply-templates select="node()" /></ul>
        
</xsl:template>
        
        
<!-- Match a list entry -->
        
<xsl:template match="listitem">
                
<li><xsl:apply-templates select="node()" /></li>
        
</xsl:template>
        
        
<!-- Print the cookies collection -->
        
<xsl:template match="show-cookies">
                
<!-- This calls the XML pretty printer -->
                
<xsl:call-template name="xml-pretty-print">
                        
<xsl:with-param name="doc" select="gnomon:read-cookies()" />
                
</xsl:call-template>
        
</xsl:template>

        
<!-- Print the query string collection -->
        
<xsl:template match="show-query-string">
                
<!-- This calls the XML pretty printer -->
                
<xsl:call-template name="xml-pretty-print">
                        
<xsl:with-param name="doc" select="gnomon:request('q')" />
                
</xsl:call-template>
        
</xsl:template>

        
<!-- Print the form collection -->
        
<xsl:template match="show-form">
                
<!-- This calls the XML pretty printer -->
                
<xsl:call-template name="xml-pretty-print">
                        
<xsl:with-param name="doc" select="gnomon:request('f')" />
                
</xsl:call-template>
        
</xsl:template>

        
<!-- Print the parameters collection -->
        
<xsl:template match="show-parameters">
                
<!-- This calls the XML pretty printer -->
                
<xsl:call-template name="xml-pretty-print">
                        
<xsl:with-param name="doc" select="gnomon:request('p')" />
                
</xsl:call-template>
        
</xsl:template>

        
<!-- Print the cookies collection -->
        
<xsl:template match="show-server-variables">
                
<!-- This calls the XML pretty printer -->
                
<xsl:call-template name="xml-pretty-print">
                        
<xsl:with-param name="doc" select="gnomon:server-variables()" />
                
</xsl:call-template>
        
</xsl:template>

</xsl:stylesheet>