<?xml version="1.0" encoding="us-ascii"?>
<xsl:stylesheet version='1.0' 
 xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
 xmlns:html='http://www.w3.org/1999/xhtml'
>

<xsl:output method="html" indent="yes" encoding="us-ascii"/>

<xsl:template match="/">
<xsl:apply-templates />
</xsl:template>

<xsl:template match="query" >
<p>

<div>
<xsl:copy-of select="ancestor::html:div/*[1]" />
</div>

<xsl:choose>
<xsl:when test="@href and not(@name) and ( not(contains(@href, 'http:') or starts-with(@href, '/')))">
<a>
<xsl:attribute name="href">
<xsl:value-of select="concat('http://www.w3.org/2001/tag/2003/webarch-20031111/', @href)" />
</xsl:attribute>
<xsl:value-of select="." />
</a>
</xsl:when>
<xsl:when test="@class='ednote'">
<xsl:copy-of select="ancestor::html:p" />
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="."/>
</xsl:otherwise>
</xsl:choose>
</p>
</xsl:template>


<xsl:template match="text()">
</xsl:template>

</xsl:stylesheet>


