|
|
<?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="1.0" exclude-result-prefixes="tei"> |
|
|
|
|
|
|
|
|
<xsl:template match="/"> |
|
|
<xsl:processing-instruction name="xml-stylesheet"> |
|
|
type="text/xsl" href="../custom.xsl" |
|
|
</xsl:processing-instruction> |
|
|
<xsl:apply-templates/> |
|
|
</xsl:template> |
|
|
|
|
|
<xsl:template match="*"> |
|
|
<xsl:copy> |
|
|
<xsl:apply-templates select="@* | node()"/> |
|
|
</xsl:copy> |
|
|
</xsl:template> |
|
|
|
|
|
<xsl:template match="@* | text() | processing-instruction() | comment()"> |
|
|
<xsl:copy/> |
|
|
</xsl:template> |
|
|
|
|
|
<xsl:template match="tei:persName | tei:term | tei:placeName"> |
|
|
<xsl:copy> |
|
|
<xsl:apply-templates select="@*"/> |
|
|
<xsl:if test="contains(@key, '#')"> |
|
|
<xsl:attribute name="key"> |
|
|
<xsl:value-of select="translate(@key, '#', '')"/> |
|
|
</xsl:attribute> |
|
|
</xsl:if> |
|
|
<xsl:if test="not(@xml:id)"> |
|
|
<xsl:attribute name="xml:id"> |
|
|
<xsl:value-of select="generate-id()"/> |
|
|
</xsl:attribute> |
|
|
</xsl:if> |
|
|
<xsl:apply-templates select="* | text()"/> |
|
|
</xsl:copy> |
|
|
</xsl:template> |
|
|
|
|
|
|
|
|
</xsl:stylesheet> |
|
|
|