interviews_daudet / data /custom.xsl
de-francophones's picture
Upload 173 files
9a1f9ba verified
<?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>«&#8239;</xsl:text><xsl:apply-templates/><xsl:text>&#8239;»</xsl:text>
</xsl:template>
</xsl:stylesheet>