Commit ac85b063 authored by Eva Huet's avatar Eva Huet
Browse files

TEI + CSS : ajustements CR + notes

parent 96d477f1
Loading
Loading
Loading
Loading
+3 −5
Original line number Diff line number Diff line
@@ -909,8 +909,7 @@ body.dark .right-contents #refs h3 {
    font-size: 90%;
}

section.review p.bibl-cr {
    margin-bottom: 50px;
p.bibl-cr {
    margin-left: 30px;
}

@@ -986,9 +985,8 @@ body.dark #toc a.active {

/***** REVIEW *******/
.author-aut,
.authority_affiliation,
.authority_mail {
    text-align: right;
.authority_affiliation {
    text-align: right !important;
}

/***** INLINE ELEMENTS (from CHARLES) ******/
+209 −52
Original line number Diff line number Diff line
@@ -14,6 +14,16 @@

    <xsl:strip-space elements="*"/>

    <!-- variables flux notes -->
    <xsl:variable name="typeNoteAnn" select="//tei:normalization/tei:p[@rendition='annexe']/@n"/>
    <xsl:variable name="typeNoteEnc" select="//tei:normalization/tei:p[@rendition='floatingText']/@n"/>
    <xsl:variable name="typeNoteTab" select="//tei:normalization/tei:p[@rendition='table']/@n"/>
    <xsl:variable name="valueNoteTxt" select="//tei:normalization/tei:p[@rendition='note']/@n"/>
    <xsl:variable name="fluxNoteAnn" select="//tei:normalization/tei:p[@rendition='annexe']/@select"/>
    <xsl:variable name="fluxNoteEnc" select="//tei:normalization/tei:p[@rendition='floatingText']/@select"/>
    <xsl:variable name="fluxNoteTab" select="//tei:normalization/tei:p[@rendition='table']/@select"/>
    <xsl:variable name="fluxNoteTxt" select="//tei:normalization/tei:p[@rendition='note']/@select"/>

    <xsl:template match="node() | @*">
        <xsl:copy>
            <xsl:apply-templates select="@* | node()"/>
@@ -466,7 +476,15 @@
                    <xsl:attribute name="class">
                        <xsl:value-of select="local-name(.)"></xsl:value-of>
                    </xsl:attribute>
                    <xsl:apply-templates select="preceding-sibling::tei:front/* [not(self::tei:div[@type='titlePage'] or self::tei:div[@type='abstract'] or self::tei:div[@type='keywords'] or self::tei:div[@type='funder'])]"/>
                    <xsl:apply-templates select="preceding-sibling::tei:front/*
                        [not(self::tei:div[@type='titlePage'] 
                        or self::tei:div[@type='abstract'] 
                        or self::tei:div[@type='keywords'] 
                        or self::tei:div[@type='funder']
                        or (self::tei:listBibl and ancestor::tei:text[@type='review']))]"/>
                    <xsl:if test="ancestor::tei:text[@type='review'] and not(//tei:div[@type='review'])">
                        <xsl:apply-templates select="preceding-sibling::tei:front//tei:bibl[@type='display']"/>
                    </xsl:if>
                    <xsl:apply-templates/>
                    <xsl:apply-templates select="following-sibling::tei:back/*[not(self::tei:div[@type='bibliography'])]"/>
                </section>
@@ -511,7 +529,139 @@


    <!--footnote-->

    <xsl:template name="calculNumeroNote">
        <xsl:variable name="isRestart">
            <xsl:choose>
            <!-- encadré : floatingText hors description d'image -->
            <xsl:when test="ancestor::tei:floatingText[not(@type='description')]
                            and $fluxNoteEnc = 'restart'">encadre</xsl:when>
            <!-- annexe -->
            <xsl:when test="ancestor::tei:div[@type='appendix']
                            and $fluxNoteAnn = 'restart'">annexe</xsl:when>
            <xsl:when test="ancestor::tei:table
                            and $fluxNoteTab = 'restart'">table</xsl:when>
            <xsl:otherwise>false</xsl:otherwise>
            </xsl:choose>
        </xsl:variable>

        <xsl:choose>
            <xsl:when test="$isRestart = 'encadre'">
            <xsl:choose>
                <xsl:when test="$typeNoteEnc = 'a'">
                <xsl:number count="tei:note[ancestor::tei:floatingText[not(@type='description')]]"
                            from="tei:floatingText[not(@type='description')]"
                            level="any" format="a"/>
                </xsl:when>
                <xsl:when test="$typeNoteEnc = 'A'">
                <xsl:number count="tei:note[ancestor::tei:floatingText[not(@type='description')]]"
                            from="tei:floatingText[not(@type='description')]"
                            level="any" format="A"/>
                </xsl:when>
                <xsl:when test="$typeNoteEnc = 'i'">
                <xsl:number count="tei:note[ancestor::tei:floatingText[not(@type='description')]]"
                            from="tei:floatingText[not(@type='description')]"
                            level="any" format="i"/>
                </xsl:when>
                <xsl:when test="$typeNoteEnc = 'I'">
                <xsl:number count="tei:note[ancestor::tei:floatingText[not(@type='description')]]"
                            from="tei:floatingText[not(@type='description')]"
                            level="any" format="I"/>
                </xsl:when>
                <xsl:otherwise>
                <xsl:number count="tei:note[ancestor::tei:floatingText[not(@type='description')]]"
                            from="tei:floatingText[not(@type='description')]"
                            level="any" format="1"/>
                </xsl:otherwise>
            </xsl:choose>
            </xsl:when>

            <xsl:when test="$isRestart = 'annexe'">
            <xsl:choose>
                <xsl:when test="$typeNoteAnn = 'a'">
                <xsl:number count="tei:note[ancestor::tei:div[@type='appendix']]"
                            from="tei:div[@type='appendix']"
                            level="any" format="a"/>
                </xsl:when>
                <xsl:when test="$typeNoteAnn = 'A'">
                <xsl:number count="tei:note[ancestor::tei:div[@type='appendix']]"
                            from="tei:div[@type='appendix']"
                            level="any" format="A"/>
                </xsl:when>
                <xsl:when test="$typeNoteAnn = 'i'">
                <xsl:number count="tei:note[ancestor::tei:div[@type='appendix']]"
                            from="tei:div[@type='appendix']"
                            level="any" format="i"/>
                </xsl:when>
                <xsl:when test="$typeNoteAnn = 'I'">
                <xsl:number count="tei:note[ancestor::tei:div[@type='appendix']]"
                            from="tei:div[@type='appendix']"
                            level="any" format="I"/>
                </xsl:when>
                <xsl:otherwise>
                <xsl:number count="tei:note[ancestor::tei:div[@type='appendix']]"
                            from="tei:div[@type='appendix']"
                            level="any" format="1"/>
                </xsl:otherwise>
            </xsl:choose>
            </xsl:when>

            <xsl:when test="$isRestart = 'table'">
            <xsl:choose>
                <xsl:when test="$typeNoteTab = 'a'">
                <xsl:number count="tei:note[ancestor::tei:table]"
                            from="tei:table"
                            level="any" format="a"/>
                </xsl:when>
                <xsl:when test="$typeNoteTab = 'A'">
                <xsl:number count="tei:note[ancestor::tei:table]"
                            from="tei:table"
                            level="any" format="A"/>
                </xsl:when>
                <xsl:when test="$typeNoteTab = 'i'">
                <xsl:number count="tei:note[ancestor::tei:table]"
                            from="tei:table"
                            level="any" format="i"/>
                </xsl:when>
                <xsl:when test="$typeNoteTab = 'I'">
                <xsl:number count="tei:note[ancestor::tei:table]"
                            from="tei:table"
                            level="any" format="I"/>
                </xsl:when>
                <xsl:otherwise>
                <xsl:number count="tei:note[ancestor::tei:table]"
                            from="tei:table"
                            level="any" format="1"/>
                </xsl:otherwise>
            </xsl:choose>
            </xsl:when>
            <xsl:otherwise>
            <xsl:variable name="baseNumber">
                <xsl:choose>
                <xsl:when test="$fluxNoteTxt = 'following'
                                and //tei:normalization/tei:p[@rendition='note']/@n
                                and //tei:normalization/tei:p[@rendition='note']/@n != ''">
                    <xsl:value-of select="//tei:normalization/tei:p[@rendition='note']/@n"/>
                </xsl:when>
                <xsl:otherwise>1</xsl:otherwise>
                </xsl:choose>
            </xsl:variable>
            <xsl:variable name="precedingCount" select="count(
                preceding::tei:note[
                not($fluxNoteEnc = 'restart' and ancestor::tei:floatingText[not(@type='description')]) and
                not($fluxNoteAnn = 'restart' and ancestor::tei:div[@type='appendix']) and
                not($fluxNoteTab = 'restart' and ancestor::tei:table)
                ]
            )"/>
            <xsl:value-of select="$baseNumber + $precedingCount"/>
            </xsl:otherwise>
        </xsl:choose>
        </xsl:template>

    <xsl:template match="tei:note">
    <xsl:variable name="numeroNote">
        <xsl:call-template name="calculNumeroNote"/>
    </xsl:variable>
    <span>
        <xsl:attribute name="class">
        <xsl:text>xref-call fn-call</xsl:text>
@@ -523,7 +673,7 @@
        <xsl:attribute name="data-target">
        <xsl:value-of select="@xml:id"/>
        </xsl:attribute>
            <xsl:value-of select="@n"/>
        <xsl:value-of select="$numeroNote"/>
    </span>
    </xsl:template>

@@ -543,7 +693,7 @@
                <xsl:attribute name="dir" select="substring-after(child::tei:p/@rendition,'#')"/>
            </xsl:if>
            <span class="label" title="voir">
                <xsl:value-of select="@n"/>
                <xsl:call-template name="calculNumeroNote"/>
            </span>
            <xsl:apply-templates/>
        </li>
@@ -626,41 +776,42 @@
    </xsl:template>

    <xsl:template match="tei:bibl">
        <xsl:if test="@type='display'">
        <xsl:choose>
            <xsl:when test="@type='semantic'"/>
            <xsl:when test="@type='display'">
                <p class="bibl-cr">
                    <xsl:apply-templates/>
                </p>
        </xsl:if>
        <xsl:if test="@type='semantic'">
        </xsl:if>
        <xsl:if test="@rend='inline'">
            </xsl:when>
            <xsl:when test="@type='sec_authority'">
                <p class="author-section-body">
                    <xsl:apply-templates select="./tei:author/tei:persName/node()"/>
                </p>
            </xsl:when>
            <xsl:when test="@rend='inline'">
                <a class="bibl">
                    <xsl:apply-templates/>
                </a>
        </xsl:if>
        <xsl:if test="@type='sec_authority'">
            <p class="author-section-body">
                <xsl:apply-templates select="./tei:author/tei:persName/node()"/>
            </xsl:when>
            <xsl:when test="ancestor::tei:div[@type='review_bibliography']">
                <p class="bibl">
                    <xsl:apply-templates/>
                </p>
        </xsl:if>
        <xsl:if test="ancestor::tei:back">
            </xsl:when>
            <xsl:when test="ancestor::tei:back">
                <li class="bibl">
                    <xsl:if test="@rendition">
                        <xsl:attribute name="dir" select="substring-after(@rendition,'#')"/>
                    </xsl:if>
                    <xsl:apply-templates/>
                </li>
        </xsl:if>
        <xsl:if test="ancestor::tei:div[@type='review_bibliography']">
            <p class="bibl">
                <xsl:apply-templates/>
            </p>
        </xsl:if>        
        <xsl:if test="not(@type = 'semantic' or @type = 'display' or @type='sec_authority') and not(@rend = 'inline') and not(ancestor::tei:back)">
            </xsl:when>
            <xsl:otherwise>
                <p class="{local-name()}">
                    <xsl:apply-templates/>
                </p>
        </xsl:if>
            </xsl:otherwise>
        </xsl:choose>
    </xsl:template>


@@ -1460,7 +1611,11 @@
            <xsl:if test="@rend">
                <xsl:attribute name="class" select="@rend"/>
            </xsl:if>
            <xsl:if test="(parent::tei:body/tei:p[1] = . or parent::bodyInclusion/tei:p[1] = . or ancestor::tei:floatingText[@type='description']//tei:p[1] = .) and not(preceding-sibling::tei:p[contains(@rend, 'TEI_localpara')])">
            <xsl:if test="(parent::tei:body/tei:p[1] = .
            or parent::tei:div[@type='review']/tei:p[1] = . 
            or parent::bodyInclusion/tei:p[1] = . 
            or ancestor::tei:floatingText[@type='description']//tei:p[1] = .) 
            and not(preceding-sibling::tei:p[contains(@rend, 'TEI_localpara')])">
                <xsl:attribute name="class">firstPara</xsl:attribute>
            </xsl:if>
            <xsl:apply-templates/>
@@ -2063,5 +2218,7 @@

    <xsl:template match="tei:text[@type='review']//tei:p[@rend='authority_mail']"/>
    <xsl:template match="tei:text[@type='review']//tei:p[@rend='authority_biography']"/>
    <xsl:template match="tei:text[@type='review']//tei:p[@rend='author-aut'][not(ancestor::tei:div[@type='review'])]"/>
    <xsl:template match="tei:text[@type='review']//tei:p[@rend='authority_affiliation'][not(ancestor::tei:div[@type='review'])]"/>

</xsl:stylesheet>
 No newline at end of file