<?xml version="1.0" encoding="ascii"?>
<!--

Copyright (c) 2002,2003 The Regenstrief Institute.  All rights reserved.

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., 675 Mass Ave, Cambridge, MA 02139, USA.

Written by Gunther Schadow.

$Id: spextract-winnow2.xsl,v 1.1.1.1 2005/02/17 00:43:51 gschadow Exp $

-->
<xsl:transform version="2.0"
   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
   xmlns:saxon="http://saxon.sf.net/"
   xmlns:extension-element-prefixes="saxon"
   xmlns:exclude-result-prefixes="xsl saxon m">

  <xsl:output method="xml" media-type="text/xml"/>
  <xsl:strip-space elements="*"/>

  <xsl:key name="refkey" match="*" use="@ref"/>

  <!-- deep identity transform -->
  <xsl:template match="/|@*|node()">
    <xsl:copy>
      <xsl:apply-templates select="@*|node()"/>
    </xsl:copy>
  </xsl:template>

  <xsl:template match="a[@id and not(key('refkey',@id))]">
    <xsl:apply-templates select="node()"/>
  </xsl:template>
</xsl:transform>
