Skip to content
Snippets Groups Projects
Commit aaadba84 authored by Anne Garcia-Fernandez's avatar Anne Garcia-Fernandez
Browse files

Merge branch 'manuscripts' into 'main'

Improve XSL for manuscript processing and fix some bugs

See merge request !83
parents fbfd1bfd 7280dadf
No related branches found
No related tags found
1 merge request!83Improve XSL for manuscript processing and fix some bugs
......@@ -9,7 +9,7 @@
<!DOCTYPE tei2editorial [
<!ENTITY times "&#215;">
<!ENTITY non_breakable_space "&#160;">
<!ENTITY nbsp "&#160;">
]>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tei="http://www.tei-c.org/ns/1.0"
......@@ -20,7 +20,7 @@
<xsl:template match="/">
<div class="col">
<nav class="text-center mb-3 small">
<xsl:text>Aller&non_breakable_space;à&non_breakable_space;:</xsl:text>
<xsl:text>Aller&nbsp;à&nbsp;:</xsl:text>
<xsl:for-each
select="tei:TEI/tei:teiHeader/tei:fileDesc/tei:sourceDesc/tei:msDesc/@xml:id">
<a class="goto m-2" href="#{.}">
......@@ -38,7 +38,7 @@
<xsl:value-of select="tei:msIdentifier/tei:settlement"/>
<xsl:text>, </xsl:text>
<xsl:value-of select="tei:msIdentifier/tei:repository"/>
<xsl:if test="tei:msIdentifier/tei:idno">
<xsl:if test="not(tei:msIdentifier/tei:idno = '')">
<xsl:for-each select="tei:msIdentifier/tei:idno">
<xsl:text>, </xsl:text>
<xsl:value-of select="."/>
......@@ -53,98 +53,69 @@
</code>
</h4>
<h5>Contenus</h5>
<div class="subsection">
<xsl:apply-templates select="tei:msContents"/>
</div>
<h5>Supports et composition</h5>
<div class="subsection">
<xsl:apply-templates select="tei:physDesc/tei:objectDesc/tei:supportDesc"/>
</div>
<h5>Dimensions et préparation de la page</h5>
<div class="subsection">
<xsl:apply-templates select="tei:physDesc/tei:objectDesc"/>
</div>
<xsl:if test="tei:physDesc/tei:handDesc">
<xsl:if test="normalize-space(tei:physDesc/tei:handDes)">
<h5>Écriture</h5>
<div class="subsection">
<xsl:apply-templates select="tei:msContents"/>
</div>
</xsl:if>
</xsl:if>
<xsl:if test="normalize-space(tei:physDesc/tei:objectDesc/tei:supportDesc)">
<xsl:if test="not(tei:physDesc/tei:objectDesc/tei:supportDesc = '')">
<h5>Supports et composition</h5>
<div class="subsection">
<xsl:apply-templates select="tei:physDesc/tei:objectDesc/tei:supportDesc"/>
</div>
</xsl:if>
<xsl:if test="normalize-space(tei:physDesc/tei:objectDesc)">
<xsl:if test="not(tei:physDesc/tei:objectDesc = '')">
<h5>Dimensions et préparation de la page</h5>
<div class="subsection">
<xsl:apply-templates select="tei:physDesc/tei:objectDesc"/>
</div>
</xsl:if>
<xsl:if test="tei:physDesc/tei:handDesc">
<xsl:if test="normalize-space(tei:physDesc/tei:handDesc)">
<h5>Écriture</h5>
<div class="subsection">
<xsl:apply-templates select="tei:physDesc/tei:handDesc"/>
</div>
</xsl:if>
<xsl:if test="not(tei:physDesc/tei:handDesc/normalize-space() = '')">
<h5>Écriture</h5>
<div class="subsection">
<xsl:apply-templates select="tei:physDesc/tei:handDesc"/>
</div>
</xsl:if>
<xsl:if test="tei:physDesc/tei:decoDesc">
<xsl:if test="normalize-space(tei:physDesc/tei:decoDesc)">
<h5>Mise en page et décoration</h5>
<div class="subsection">
<xsl:apply-templates select="tei:physDesc/tei:decoDesc"/>
</div>
</xsl:if>
<xsl:if test="not(tei:physDesc/tei:decoDesc/normalize-space() = '')">
<h5>Mise en page et décoration</h5>
<div class="subsection">
<xsl:apply-templates select="tei:physDesc/tei:decoDesc"/>
</div>
</xsl:if>
<xsl:if test="tei:history/tei:origin/tei:origDate">
<xsl:if test="normalize-space(tei:history/tei:origin/tei:origDate)">
<h5>HOrigine du manuscrit</h5>
<div class="subsection">
<xsl:apply-templates select="tei:history/tei:origin/tei:origDate"/>
</div>
</xsl:if>
<xsl:if test="not(tei:history/tei:origin/tei:origDate/normalize-space() = '')">
<h5>Origine du manuscrit</h5>
<div class="subsection">
<xsl:apply-templates select="tei:history/tei:origin/tei:origDate"/>
</div>
</xsl:if>
<xsl:if test="tei:history/tei:provenance">
<xsl:for-each select="tei:history/tei:provenance">
<xsl:if test="normalize-space(.)">
<h5>Histoire et traces d’usage</h5>
<div class="subsection">
<xsl:apply-templates select="."/>
</div>
</xsl:if>
</xsl:for-each>
<xsl:if test="not(tei:history/tei:provenance/normalize-space() = '')">
<h5>Histoire et traces d’usage</h5>
<div class="subsection">
<xsl:apply-templates select="tei:history/tei:provenance"/>
</div>
</xsl:if>
<xsl:if test="tei:additional/tei:listBibl">
<xsl:if test="normalize-space(tei:additional/tei:listBibl)">
<h5>Bibliographie</h5>
<div class="subsection">
<p>
<xsl:value-of select="tei:additional/tei:listBibl"/>
</p>
</div>
</xsl:if>
<xsl:if test="tei:additional/tei:listBibl/normalize-space()">
<h5>Bibliographie</h5>
<div class="subsection">
<p>
<xsl:apply-templates select="tei:additional/tei:listBibl"/>
</p>
</div>
</xsl:if>
<xsl:if test="tei:additional/tei:surrogates/tei:bibl/tei:ref">
<xsl:if test="normalize-space(tei:additional/tei:surrogates/tei:bibl/tei:ref)">
<h5>Numérisation</h5>
<div class="subsection">
<a href="{tei:additional/tei:surrogates/tei:bibl/tei:ref/@target}"
target="_blank">
<xsl:value-of
select="tei:additional/tei:surrogates/tei:bibl/tei:ref/@target"/>
</a>
</div>
</xsl:if>
<xsl:if test="tei:additional/tei:surrogates/tei:bibl/tei:ref/normalize-space()">
<h5>Numérisation</h5>
<div class="subsection">
<a href="{tei:additional/tei:surrogates/tei:bibl/tei:ref/@target}" target="_blank">
<xsl:value-of select="tei:additional/tei:surrogates/tei:bibl/tei:ref/@target"/>
</a>
</div>
</xsl:if>
</xsl:template>
......@@ -158,19 +129,15 @@
<xsl:apply-templates select="tei:p"/>
</xsl:when>
<xsl:otherwise>
<xsl:if test="tei:locus">
<xsl:if test="tei:locus and not(tei:locus/normalize-space() = '')">
<xsl:value-of select="tei:locus"/>
<xsl:text>&non_breakable_space;: </xsl:text>
<xsl:text>&nbsp;: </xsl:text>
</xsl:if>
<xsl:if test="tei:title">
<xsl:if test="tei:title and not(tei:title/normalize-space() = '')">
<xsl:value-of select="tei:title"/>
</xsl:if>
<!--<xsl:if test="tei:author">
<xsl:text>, </xsl:text>
<xsl:value-of select="tei:author"/>
</xsl:if>-->
<xsl:text>.</xsl:text>
<xsl:if test="tei:rubric">
<xsl:if test="tei:rubric and not(tei:rubric/normalize-space() = '')">
<xsl:text> </xsl:text>
<i>
<xsl:apply-templates select="tei:rubric"/>
......@@ -186,9 +153,13 @@
<!-- Support et composition -->
<xsl:template match="tei:supportDesc">
<p>
<xsl:value-of select="tei:support"/>
<xsl:if test="not(tei:support/normalize-space() = '')">
<xsl:apply-templates select="tei:support"/>
<xsl:text>. </xsl:text>
<xsl:value-of select="tei:extent/text()"/>
</xsl:if>
<xsl:if test="not(tei:extent/normalize-space() = '')">
<xsl:value-of select="tei:extent"/>
</xsl:if>
</p>
</xsl:template>
......@@ -227,44 +198,37 @@
</p>
</xsl:template>
<!-- Écriture-->
<xsl:template match="tei:physDesc/tei:handDesc">
<p>
<xsl:apply-templates select="tei:p"/>
</p>
</xsl:template>
<!-- Mise en page et décoration -->
<xsl:template match="tei:physDesc/tei:decoDesc">
<p>
<xsl:apply-templates select="tei:p"/>
</p>
<xsl:template match="tei:physDesc/tei:handDesc |
tei:physDesc/tei:decoDesc |
tei:history/tei:oroigin/tei:origDate |
tei:history/tei:provenance |
tei:rubric |
tei:support">
<xsl:apply-templates/>
</xsl:template>
<!-- Date de création du manuscrit -->
<xsl:template match="tei:history/tei:oroigin/tei:origDate">
<xsl:template match="tei:p">
<p>
<xsl:apply-templates select="text()"/>
<xsl:apply-templates/>
</p>
</xsl:template>
<!-- Histoire et traces d’usage -->
<xsl:template match="tei:history/tei:provenance">
<p>
<xsl:apply-templates select="tei:p | text()"/>
</p>
<xsl:template match="tei:listBibl">
<ul>
<xsl:apply-templates/>
</ul>
</xsl:template>
<xsl:template match="tei:p">
<xsl:apply-templates/>
<xsl:template match="tei:listBibl/tei:bibl">
<li>
<xsl:apply-templates/>
</li>
</xsl:template>
<xsl:template match="tei:rubric">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="*">
<b style="color:red">
<b class="btn btn-sm bg-warning">
<xsl:value-of select="name(.)"/>
</b>
<xsl:message>Not template for <xsl:value-of select="name(.)"/></xsl:message>
</xsl:template>
</xsl:stylesheet>
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment