File size: 1,561 Bytes
9a1f9ba |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
<?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">
<!-- reste à appliquer ça la totalité des textes .... -->
<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>
|