<?xml version='1.0'?>
<!-- dtrHTML.xsl Last updated: 24/08/00 16:16
XSLT template to display DATR XML in HTML as dtr file format
Copyright (C) Lee Goddard, 2/7/2000. All rights reserved.
<code@leegoddard.com>
Call with: <?xml-stylesheet type="text/xsl" href="dtr.xsl" ?>
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="html"/>
<!-- The root -->
<xsl:template match="DATR">
<TT>
<xsl:apply-templates/>
</TT>
<BR/>
<HR size="1" color="teal"/>
<FONT size="1" face="Lucinda, Verdana, Helvectia, Arial, Sans-serif" color="teal">
Produced from DATR XML by DATR datrHTML.xls version 0.13<BR/>
</FONT>
</xsl:template>
<xsl:template match="*">
<xsl:apply-templates select="*"></xsl:apply-templates>
</xsl:template>
<!-- Comment info -->
<xsl:template match="COMMENT">
<FONT color="green">%
<xsl:value-of select="text()"></xsl:value-of>
</FONT>
<BR/>
</xsl:template>
<!-- DATR definition/sentence elements -->
<xsl:template match="EQUATION">
<!--Concatonate GROUPS of nodedefs for DATR shorthand:
dp NOT form a union of set (cf. geraldg 06/07/00; Kay p.551),
Only print an element's "name" attribute if the previous
element has different "name" attribute; otherwise indent.
Thanks to Mike and Ken; Jeni for testing. -->
<xsl:choose>
<xsl:when test="not(@node = preceding-sibling::*[@node][1]/@node )">
<B>
<xsl:value-of select="@node"/>:
</B>
</xsl:when>
<xsl:otherwise>
      
</xsl:otherwise>
</xsl:choose>
<FONT color="#0000AA">
<<xsl:value-of select="@path"/>>
</FONT>
<xsl:if test="@type[.='EXTEND']">=</xsl:if>
<xsl:if test="@type[.!='EXTEND']">==</xsl:if> <!-- the default -->
 
<xsl:apply-templates select="*"/>
<xsl:if test="not(@node = following-sibling::*[@node][1]/@node)">
<!-- end the clause --><B>.</B>
<BR/>
</xsl:if>
<BR/>
</xsl:template>
<xsl:template match="QUERY">
<FONT color="black">?</FONT>
</xsl:template>
<xsl:template match="ATOM">
<FONT color="navy">
<xsl:value-of select="@value"/>
</FONT>
</xsl:template>
<xsl:template match="PATH">
<FONT color="navy">
<<xsl:apply-templates select="*"/>>
</FONT>
</xsl:template>
<xsl:template match="QUOTEDATOM">
<FONT color="blue">
"<xsl:value-of select="@value"/>"
</FONT>
</xsl:template>
<xsl:template match="QUOTEDPATH">
<FONT color="blue">
"<<xsl:apply-templates select="*"/>>"
</FONT>
</xsl:template>
<xsl:template match="NODEPATH">
<FONT color="navy">
<xsl:value-of select="@name"/>
:
<<xsl:apply-templates select="*"/>>
</FONT>
</xsl:template>
<xsl:template match="QUOTEDNODEPATH">
<FONT color="blue">
"
<xsl:value-of select="@name"/>:
<<xsl:apply-templates select="*"/>>
"
</FONT>
</xsl:template>
<!-- DTR file elements -->
<xsl:template match="HEADER">
<FONT color="gray" size="1">
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%<BR/>
%<BR/>
<xsl:for-each select="META">
%
<xsl:choose>
<xsl:when test="META">
<xsl:value-of select="@name"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="@name"/>
</xsl:otherwise>
</xsl:choose>
:  <!-- nbsp -->
<FONT face="Georgia, Times, Serif">
<xsl:value-of select="@content"/>
</FONT>
<BR/>
</xsl:for-each>
%<BR/>
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%<BR/>
<BR/>
</FONT>
</xsl:template>
<xsl:template match="OPENING">
<!-- The conditional match here is not really needed
but is neater and maybe needed in future -->
<xsl:for-each select="*">
<FONT color="red">
# <xsl:value-of select="name()"/> <xsl:text> </xsl:text>
</FONT>
<FONT color="darkred">
<xsl:if test="@value">
<xsl:value-of select="@value"/>
</xsl:if>
<xsl:if test="@filename">
<xsl:value-of select="@filename"/>
</xsl:if>
<xsl:if test="@range">
<xsl:value-of select="@range"/>
</xsl:if>
<xsl:apply-templates select="*"/>
</FONT>
<!-- end clause -->
<FONT color="red">
<B>.</B><BR/>
</FONT>
</xsl:for-each>
<BR/>
</xsl:template>
<xsl:template match="CLOSING">
<!-- The conditional match here is not really needed
but is neater and maybe needed in future -->
<xsl:for-each select="*">
<FONT color="red">
# <xsl:value-of select="name()"/> <xsl:text> </xsl:text>
</FONT>
<FONT color="darkred">
<xsl:if test="@value">
<xsl:value-of select="@value"/>
</xsl:if>
<xsl:if test="@filename">
<xsl:value-of select="@filename"/>
</xsl:if>
<xsl:if test="@range">
<xsl:value-of select="@range"/>
</xsl:if>
<xsl:apply-templates select="*"/>
</FONT>
<!-- end clause -->
<FONT color="red">
<B>.</B><BR/>
</FONT>
</xsl:for-each>
<BR/>
</xsl:template>
</xsl:stylesheet>