﻿<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:tei="http://www.tei-c.org/ns/1.0">
	<xsl:output method="xml" indent="yes" encoding="UTF-8" />

	<xsl:template match="/">
		<liste>
			<xsl:apply-templates select="//tei:w" />
		</liste>
	</xsl:template>

	<xsl:template match="//tei:w">
		<xsl:if test="not(ancestor-or-self::tei:del) and not(ancestor-or-self::tei:sic)">
			<xsl:if test="ancestor-or-self::tei:head">
				<eintrag id="{@xml:id}" lemma="{@lemma}" lemmaid ="{@lemmaRef}" text="{ancestor-or-self::tei:TEI/@xml:id}" referenz="Überschrift" corresp="{@corresp}">
					<xsl:apply-templates />
				</eintrag>
			</xsl:if>
			<xsl:if test="ancestor-or-self::tei:l">
				<eintrag id="{@xml:id}" lemma="{@lemma}" lemmaid ="{@lemmaRef}" text="{ancestor-or-self::tei:TEI/@xml:id}" referenz="{ancestor-or-self::tei:l/@n}" corresp="{@corresp}">
					<xsl:apply-templates />
				</eintrag>
			</xsl:if>
		</xsl:if>
	</xsl:template>

	<xsl:template match="//tei:w//tei:sic">

	</xsl:template>

	<xsl:template match="//tei:w//tei:orig">

	</xsl:template>

	<xsl:template match="//tei:w//tei:del">

	</xsl:template>

	<xsl:template match="//tei:w//tei:abbr">

	</xsl:template>

	<xsl:template match="//tei:w//tei:add[@corresp='#reg13']">

	</xsl:template>
</xsl:stylesheet>