|
|
<?xml version="1.0"?> |
|
|
|
|
|
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:tei="http://www.tei-c.org/ns/1.0" version="2.0" xmlns="http://www.tei-c.org/ns/1.0" exclude-result-prefixes="tei"> |
|
|
|
|
|
|
|
|
<xsl:output method="xml"/> |
|
|
|
|
|
<xsl:template match="/"> |
|
|
<group> |
|
|
<xsl:for-each select="collection('../?select=*.xml;recurse=yes')"> |
|
|
<text> |
|
|
<xsl:apply-templates select="//tei:text"/> |
|
|
</text> |
|
|
</xsl:for-each> |
|
|
|
|
|
</group> |
|
|
|
|
|
</xsl:template> |
|
|
|
|
|
<xsl:template match="*"> |
|
|
<xsl:apply-templates/> |
|
|
</xsl:template> |
|
|
|
|
|
<xsl:template match="tei:persName"> |
|
|
<ref target="{concat('../',tokenize(base-uri(), '/')[last()-1], '/', tokenize(base-uri(), '/')[last()], '#', @xml:id)}"> |
|
|
<xsl:copy> |
|
|
<xsl:apply-templates select="@key | node()"/> |
|
|
</xsl:copy> |
|
|
</ref> |
|
|
</xsl:template> |
|
|
|
|
|
<xsl:template match="tei:placeName"> |
|
|
<ref target="{concat('../', tokenize(base-uri(), '/')[last()], '#',@xml:id)}"> |
|
|
<xsl:copy> |
|
|
<xsl:apply-templates select="@key | node()"/> |
|
|
</xsl:copy> |
|
|
</ref> |
|
|
</xsl:template> |
|
|
|
|
|
<xsl:template match="tei:term"> |
|
|
<ref target="{concat('../', tokenize(base-uri(), '/')[last()], '#',@xml:id)}"> |
|
|
<xsl:copy> |
|
|
<xsl:apply-templates select="@key | node()"/> |
|
|
</xsl:copy> |
|
|
</ref> |
|
|
</xsl:template> |
|
|
|
|
|
<xsl:template match="@*"> |
|
|
<xsl:copy/> |
|
|
</xsl:template> |
|
|
|
|
|
<xsl:template match="text()"> |
|
|
<xsl:value-of select="replace(., '\s+', ' ')"/> |
|
|
</xsl:template> |
|
|
|
|
|
</xsl:stylesheet> |
|
|
|