rebuild.xsl
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet
xmlns:tei="http://www.tei-c.org/ns/1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:exsl="http://exslt.org/common"
extension-element-prefixes="exsl"
exclude-result-prefixes="tei exsl"
version="1.0">
<xsl:output indent="yes" encoding="utf8"/>
<xsl:key name="TVALS" match="value" use="@ident"/>
<xsl:key name="TATTS" match="attribute" use="@ident"/>
<xsl:key name="TELEMS" match="element" use="@ident"/>
<xsl:key name="ATTS" match="tei:attDef" use="@ident"/>
<xsl:key name="VALS" match="tei:valItem" use="@ident"/>
<xsl:template match="/">
<xsl:comment>
Probleme: <argument>
<byline>
<catRef>
<classCode>
<classDecl>
<closer>
<creation>
<dateline>
<del> Korrektor oder andere Fassung
<div>
<divGen>
<editor>???
<gi> -> <en>?
<ident>
<lb> -> <zu>
<notesstmt> -> notesgroup
<pb> <su>
<principal>
<rs> Bezug nehmende Zeichenkette
<s> -> Satz
<samplingDecl>
<sic>
tag != Tag
<taxonomy>
<trailer>
</xsl:comment>
<i18n>
<xsl:for-each select=".//tei:elementSpec">
<xsl:sort select="@ident"/>
<element ident="{@ident}">
<xsl:variable name="this" select="@ident"/>
<xsl:for-each select="document('teinames.xml')/i18n">
<xsl:for-each select="key('TELEMS',$this)">
<xsl:copy-of select="equiv"/>
</xsl:for-each>
</xsl:for-each>
<desc><xsl:value-of select="tei:desc"/></desc>
</element>
</xsl:for-each>
<xsl:for-each select=".//tei:attDef">
<xsl:sort select="@ident"/>
<xsl:if test="not(@ident='xmlns' or @ident='TEIform')">
<xsl:if test="generate-id(.)=generate-id(key('ATTS',@ident)[1])">
<attribute ident="{@ident}">
<xsl:variable name="this" select="@ident"/>
<xsl:for-each select="document('teinames.xml')/i18n">
<xsl:for-each select="key('TATTS',$this)">
<xsl:copy-of select="equiv"/>
</xsl:for-each>
</xsl:for-each>
<desc><xsl:value-of select="tei:desc"/></desc>
</attribute>
</xsl:if>
</xsl:if>
</xsl:for-each>
<xsl:for-each select=".//tei:valItem">
<xsl:sort select="@ident"/>
<xsl:variable name="this" select="@ident"/>
<xsl:if test="generate-id(.)=generate-id(key('VALS',@ident)[1])">
<value ident="{@ident}">
<xsl:for-each select="document('teinames.xml')/i18n">
<xsl:for-each select="key('TVALS',$this)">
<xsl:copy-of select="equiv"/>
</xsl:for-each>
</xsl:for-each>
</value>
</xsl:if>
</xsl:for-each>
</i18n>
</xsl:template>
</xsl:stylesheet>