File size: 3,265 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 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 |
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0"
xmlns:eg="http://www.tei-c.org/ns/Examples"
xmlns:tei="http://www.tei-c.org/ns/1.0"
xmlns:xd="http://www.oxygenxml.com/ns/doc/xsl"
xmlns:exsl="http://exslt.org/common"
xmlns:msxsl="urn:schemas-microsoft-com:xslt"
xmlns:fn="http://www.w3.org/2005/xpath-functions"
extension-element-prefixes="exsl msxsl"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns:xi="http://www.w3.org/2003/XInclude"
exclude-result-prefixes="xi xsl tei xd eg fn #default">
<!-- <xsl:output method="html"/> -->
<!-- import teibp.xsl, which allows templates,
variables, and parameters from teibp.xsl
to be overridden here. -->
<xsl:import href="https://repository.ortolang.fr/api/content/tei-boilerplate-custom/latest/content/teibp.xsl"/>
<xsl:template match="tei:pb[@facs]">
<xsl:variable name="theFacs" select="@facs"/>
<xsl:variable name="theImage" select="//tei:surface[concat('#', @xml:id) = $theFacs]/tei:graphic/@url"/>
<a href="{$theImage}"><img src="{$theImage}" height="40"/></a>
</xsl:template>
<xsl:template match="tei:facsimile">
<xsl:for-each select="tei:graphic">
<!-- L'idéal serait de faire un thumbnail cliquable vers l'image... -->
<a href="{@url}" target="_blank"><img src="{@url}" height="40" /></a>
</xsl:for-each>
<xsl:apply-templates/>
<br/>
</xsl:template>
<xsl:template match="tei:text">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="tei:surface">
<xsl:variable name="myId" select="@xml:id"/>
<xsl:variable name="theImage" select="tei:graphic/@url"/>
<xsl:if test="not(//tei:pb[@facs=concat('#', $myId)])">
<a href="{$theImage}"><img src="{$theImage}" height="40"/></a>
</xsl:if>
</xsl:template>
<xsl:template match="tei:persName">
<a id="{@xml:id}" style="color:blue" href="{concat('../Index/personnes.xml#', translate(@key, ' ', '-'))}"><xsl:apply-templates/></a>
</xsl:template>
<xsl:template match="tei:placeName">
<a id="{@xml:id}" style="color:green" href="{concat('../Index/lieux.xml#', translate(@key, ' ', '-'))}"><xsl:apply-templates/></a>
</xsl:template>
<xsl:template match="tei:term">
<a style="color:red" href="{concat('../Index/termes.xml#', translate(@key, ' ', '-'))}"><xsl:apply-templates/></a>
</xsl:template>
<xsl:template match="xi:include">
<a href="{@href}">
<xsl:choose>
<xsl:when test="xi:fallback">
<xsl:apply-templates select="xi:fallback"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="@href"/>
<br/>
</xsl:otherwise>
</xsl:choose>
</a>
</xsl:template>
<xsl:template match="tei:title">
<i><xsl:apply-templates/></i>
</xsl:template>
<xsl:template match="tei:hi[@rend='sup']">
<SUP><xsl:apply-templates/></SUP>
</xsl:template>
<xsl:template match="tei:quote">
<xsl:text>« </xsl:text><xsl:apply-templates/><xsl:text> »</xsl:text>
</xsl:template>
</xsl:stylesheet>
|