Commit 18126800 authored by Jerome Chauveau's avatar Jerome Chauveau
Browse files

Merge branch 'mb/portedoc' into 'jc/todo-v1'

Mb/portedoc

See merge request pdn-certic/MaX!45
parents 2f89c6ff 7f539da8
Loading
Loading
Loading
Loading
+377 −14
Original line number Diff line number Diff line
<!--For conditions of distribution and use, see the accompanying legal.txt file.-->

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:tei="http://www.tei-c.org/ns/1.0"
                exclude-result-prefixes="tei xsl"
                xmlns:fo="http://www.w3.org/1999/XSL/Format">
  xmlns:xs="http://www.w3.org/2001/XMLSchema"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:ead="urn:isbn:1-931666-22-9"
  xmlns:xlink="http://www.w3.org/1999/xlink"
  xmlns:fo="http://www.w3.org/1999/XSL/Format" exclude-result-prefixes="xs ead xsi">

  <!-- Chargement des styles -->
  <xsl:import href="styles/styles-fo.xsl"/>
  <!-- La sortie de l'en-tête est dans un fichier à part -->
  <xsl:import href="styles/header.xsl"/>

  <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
  <xsl:param name="prettyName"/>
  <xsl:param name="baseuri"/>
  <xsl:param name="project"/>
  <xsl:param name="docName"/>
  <xsl:template match="ead:eadheader"/>

  <xsl:variable name="pretty-name">
    <!-- le titre du projet : c’est à dire le pretty name -->
    <xsl:text>Titre courant : $prettyName</xsl:text>
  </xsl:variable>
  <xsl:variable name="ref-biblio">
    <!-- le référence biblio du projet en s’appuyant sur le header -->
    <fo:block>Bibliothèque virtuelle du Mont Saint-Michel, Catherine Jacquemard (dir.) et Marie Bisson (coord.), Caen, Centre Michel de Boüard – Pôle Document numérique, 2017.</fo:block>
  </xsl:variable>


    <xsl:output method="xml" indent="yes"/>
    <xsl:template match="div">


  <xsl:template match="ead:archdesc">
    <fo:root>
      <!-- équivalent du head html -->
      <fo:layout-master-set>
                <fo:simple-page-master master-name="A4-portrait"
                                       page-height="29.7cm" page-width="21.0cm" margin="2cm">
                    <fo:region-body/>
        <!-- Les gabarits de page. Au moins 1 simple-page-master obligatoire-->
        <fo:simple-page-master master-name="premiere" margin-top="10mm" margin-bottom="10mm" margin-left="20mm" margin-right="20mm">
          <fo:region-body margin-bottom="20mm" margin-top="20mm"/>
          <fo:region-after extent="1cm" region-name="pied-premiere"/>
        </fo:simple-page-master>

        <fo:simple-page-master master-name="impaire" margin-top="10mm" margin-bottom="10mm" margin-left="20mm" margin-right="20mm">
          <fo:region-body margin-bottom="20mm" margin-top="20mm"/>
          <fo:region-before extent="1cm" region-name="entete-impaire"/>
          <fo:region-after extent="1cm" region-name="pied-impaire"/>
        </fo:simple-page-master>

        <fo:simple-page-master master-name="paire" margin-top="10mm" margin-bottom="10mm" margin-left="20mm" margin-right="20mm">
          <fo:region-body margin-bottom="20mm" margin-top="20mm"/>
          <fo:region-before extent="1cm" region-name="entete-paire"/>
          <fo:region-after extent="1cm" region-name="pied-paire"/>
        </fo:simple-page-master>

        <!-- Le modèle de séquence de pages avec enchaînement impaire/paire -->
        <fo:page-sequence-master master-name="corps">
          <fo:repeatable-page-master-alternatives>
            <!-- <fo:conditional-page-master-reference master-reference="premiere" page-position="first" odd-or-even="odd"/> -->
            <fo:conditional-page-master-reference master-reference="impaire" odd-or-even="odd"/>
            <fo:conditional-page-master-reference master-reference="paire" odd-or-even="even"/>
          </fo:repeatable-page-master-alternatives>
        </fo:page-sequence-master>
      </fo:layout-master-set>
            <fo:page-sequence master-reference="A4-portrait">
                <fo:flow flow-name="xsl-region-body">

      <!-- Début du document, la séquence de page utilise le modèle "corps" décrit plus haut -->
      <fo:page-sequence master-reference="corps">
        <!-- Description des en-têtes et pieds de pages, séparateur de bloc de notes de bas de page, etc. -->
        <fo:static-content flow-name="pied-premiere">
          <fo:block text-align="center" font-family="Times" font-size="8pt">
            <fo:page-number/>
          </fo:block>
        </fo:static-content>
        <fo:static-content flow-name="entete-impaire">
          <xsl:call-template name="output-header">
            <xsl:with-param name="pretty-name" select="$pretty-name"/>
          </xsl:call-template>
        </fo:static-content>
        <fo:static-content flow-name="pied-impaire">
          <fo:block text-align="center" font-family="Times" font-size="8pt">
            <fo:page-number/>
          </fo:block>
        </fo:static-content>
        <fo:static-content flow-name="entete-paire">
          <xsl:call-template name="output-header">
            <xsl:with-param name="pretty-name" select="$pretty-name"/>
          </xsl:call-template>
        </fo:static-content>
        <fo:static-content flow-name="pied-paire">
          <fo:block text-align="center" font-family="Times" font-size="8pt">
            <fo:page-number/>
          </fo:block>
        </fo:static-content>
        <fo:static-content flow-name="xsl-footnote-separator">
          <fo:block>
                        Hello World! Todo !
            <fo:leader leader-pattern="rule" leader-length="10%" rule-style="solid" rule-thickness="0.5pt"/>
          </fo:block>
        </fo:static-content>

        <!-- Le flux de texte dans la zone principale -->
        <fo:flow flow-name="xsl-region-body" xsl:use-attribute-sets="general">
          <fo:block>
                        <xsl:value-of select="."/>
            <xsl:apply-templates />
          </fo:block>
        </fo:flow>
      </fo:page-sequence>
    </fo:root>
  </xsl:template>

  <!-- <xsl:template match="ead:odd | ead:bibliography | ead:bibliography/ead:bibref">
    <fo:block>
      <xsl:apply-templates/>
    </fo:block>
  </xsl:template> -->

  <!-- Un peu de typo -->
  <xsl:template match="ead:emph">
    <fo:inline>
      <xsl:apply-templates select="./@render"/>
      <xsl:apply-templates/>
    </fo:inline>
  </xsl:template>

  <!-- Les composants -->
  <xsl:template match="ead:dsc/ead:c">
    <fo:block xsl:use-attribute-sets="composants">
      <xsl:apply-templates/>
    </fo:block>
  </xsl:template>
  <!-- Les sous-composants -->
  <xsl:template match="ead:c/ead:c">
    <fo:block xsl:use-attribute-sets="composants">
      <!-- <xsl:attribute name="page-break-before">always</xsl:attribute> -->
      <xsl:apply-templates/>
    </fo:block>
  </xsl:template>

  <!-- DID -->
  <xsl:template match="ead:did">
    <fo:block xsl:use-attribute-sets="table-and-caption">
      <fo:table xsl:use-attribute-sets="table">
        <fo:table-column column-width="120px"/>
        <fo:table-column />
        <fo:table-body>
          <xsl:apply-templates/>
        </fo:table-body>
      </fo:table>
    </fo:block>
  </xsl:template>

  <xsl:template match="ead:unitid | ead:unittitle | ead:language | ead:unitdate | ead:physdesc | ead:origination | ead:physloc | ead:repository | ead:materialspec">
    <fo:table-row>
      <fo:table-cell xsl:use-attribute-sets="cell">
        <fo:block xsl:use-attribute-sets="label">
          <xsl:choose>
            <xsl:when test="@label">
              <xsl:value-of select="@label"/>
            </xsl:when>
            <xsl:otherwise>
              <xsl:choose>
                <xsl:when test="self::ead:unitid">
                  <xsl:text>Cote(s)</xsl:text>
                </xsl:when>
                <xsl:when test="self::ead:unittitle">
                  <xsl:text>Intitulé</xsl:text>
                </xsl:when>
                <xsl:when test="self::ead:unitdate">
                  <xsl:text>Datation</xsl:text>
                </xsl:when>
                <xsl:when test="self::ead:physdesc">
                  <xsl:text>Description matérielle</xsl:text>
                </xsl:when>
                <xsl:when test="self::ead:language">
                  <xsl:text>Langue(s)</xsl:text>
                </xsl:when>
                <xsl:when test="self::ead:origination">
                  <xsl:text>Origine</xsl:text>
                </xsl:when>
                <xsl:when test="self::ead:physloc">
                  <xsl:text>Localisation physique</xsl:text>
                </xsl:when>
                <xsl:when test="self::ead:repository">
                  <xsl:text>Organisme responsable de l’accès intellectuel</xsl:text>
                </xsl:when>
                <xsl:when test="self::ead:materialspec">
                  <xsl:text>Particularités de certains types de documents</xsl:text>
                </xsl:when>
              </xsl:choose>
            </xsl:otherwise>
          </xsl:choose>
        </fo:block>
      </fo:table-cell>
      <fo:table-cell xsl:use-attribute-sets="cell">
        <fo:block xsl:use-attribute-sets="content">
          <xsl:apply-templates/>
        </fo:block>
      </fo:table-cell>
    </fo:table-row>
  </xsl:template>

  <xsl:template match="ead:dimensions | ead:extent | ead:physfacet">
    <fo:block>
      <fo:inline xsl:use-attribute-sets="label">
        <xsl:choose>
          <xsl:when test="@label">
            <xsl:value-of select="@label"/>
            <xsl:text> : </xsl:text>
          </xsl:when>
          <xsl:otherwise>
            <xsl:choose>
              <xsl:when test="self::ead:dimensions">
                <xsl:text>Dimensions : </xsl:text>
              </xsl:when>
              <xsl:when test="self::ead:extent">
                <xsl:text>Étendue : </xsl:text>
              </xsl:when>
              <xsl:when test="self::ead:physfacet">
                <xsl:text>Particularité(s) physique(s)</xsl:text>
              </xsl:when>
              <xsl:when test="self::ead:physdesc">
                <xsl:text>Description matérielle</xsl:text>
              </xsl:when>
              <xsl:when test="self::ead:language">
                <xsl:text>Langue(s)</xsl:text>
              </xsl:when>
            </xsl:choose>
          </xsl:otherwise>
        </xsl:choose>
      </fo:inline>
      <fo:inline xsl:use-attribute-sets="content">
        <xsl:apply-templates/>
      </fo:inline>
    </fo:block>
  </xsl:template>

  <xsl:template match="ead:accessrestrict | ead:accruals | ead:acqinfo | ead:altformavail | ead:appraisal | ead:arrangement | ead:bibliography | ead:bioghist | ead:controlaccess | ead:custodhist | ead:odd | ead:originalsloc | ead:otherfindaid | ead:phystech | ead:prefercite | ead:processinfo | ead:relatedmaterial | ead:scopecontent | ead:separatedmaterial | ead:userestrict | ead:c/ead:dao  | ead:c/ead:daogroup">
    <fo:block xsl:use-attribute-sets="div">
      <xsl:choose>
        <xsl:when test="ead:head">
          <xsl:apply-templates select="ead:head" mode="titre"/>
        </xsl:when>
        <xsl:otherwise>
          <xsl:choose>
            <xsl:when test="@type">
              <fo:block xsl:use-attribute-sets="head">
                <xsl:value-of select="@type"/>
              </fo:block>
            </xsl:when>
            <xsl:otherwise>
              <fo:block xsl:use-attribute-sets="head">
                <xsl:choose>
                  <xsl:when test="self::ead:accessrestrict">
                    <xsl:text>Conditions d’accès</xsl:text>
                  </xsl:when>
                  <xsl:when test="self::ead:accruals">
                    <xsl:text>Accroissement</xsl:text>
                  </xsl:when>
                  <xsl:when test="self::ead:acqinfo">
                    <xsl:text>Informations sur les modalités d’entrée</xsl:text>
                  </xsl:when>
                  <xsl:when test="self::ead:altformavail">
                    <xsl:text>Documents de substitution</xsl:text>
                  </xsl:when>
                  <xsl:when test="self::ead:appraisal">
                    <xsl:text>Informations sur l'évaluation</xsl:text>
                  </xsl:when>
                  <xsl:when test="self::ead:arrangement">
                    <xsl:text>Classement</xsl:text>
                  </xsl:when>
                  <xsl:when test="self::ead:bibliography">
                    <xsl:text>Bibliographie</xsl:text>
                  </xsl:when>
                  <xsl:when test="self::ead:bioghist">
                    <xsl:text>Biographie ou histoire</xsl:text>
                  </xsl:when>
                  <xsl:when test="self::ead:controlaccess">
                    <xsl:text>Accès controlés</xsl:text>
                  </xsl:when>
                  <xsl:when test="self::ead:custodhist">
                    <xsl:text>Historique de la conservation</xsl:text>
                  </xsl:when>
                  <xsl:when test="self::ead:odd">
                    <xsl:text>Autres descriptions documentaires</xsl:text>
                  </xsl:when>
                  <xsl:when test="self::ead:originalsloc">
                    <xsl:text> Existence et lieu de conservation des documents originaux</xsl:text>
                  </xsl:when>
                 <xsl:when test="self::ead:otherfindaid">
                    <xsl:text>Autres instrument de recherche</xsl:text>
                  </xsl:when> 
                 <xsl:when test="self::ead:phystech">
                    <xsl:text>Caractéristiques matérielles et contraintes techniques</xsl:text>
                  </xsl:when> 
                  <xsl:when test="self::ead:prefercite">
                    <xsl:text>Mention conseillée</xsl:text>
                  </xsl:when> 
                  <xsl:when test="self::ead:processinfo">
                    <xsl:text>Informations sur le traitement</xsl:text>
                  </xsl:when>  
                  <xsl:when test="self::ead:relatedmaterial">
                    <xsl:text>Documents en relation</xsl:text>
                  </xsl:when>  
                  <xsl:when test="self::ead:scopecontent">
                    <xsl:text>Présentation du Contenu</xsl:text>
                  </xsl:when>
                  <xsl:when test="self::ead:separatedmaterial">
                    <xsl:text>Documents séparés</xsl:text>
                  </xsl:when>
                  <xsl:when test="self::ead:userestrict">
                    <xsl:text>Conditions d'utilisation</xsl:text>
                  </xsl:when>
                </xsl:choose>
              </fo:block>
            </xsl:otherwise>
          </xsl:choose>
        </xsl:otherwise>
      </xsl:choose>
      <xsl:apply-templates/>
    </fo:block>
  </xsl:template>

  <xsl:template match="ead:odd/ead:p | ead:custodhist/ead:p | ead:scopecontent/ead:p | ead:controlaccess/ead:p">
    <fo:block xsl:use-attribute-sets="para">
      <xsl:apply-templates/>
    </fo:block>
  </xsl:template>

  <xsl:template match="ead:bibliography/ead:bibref | ead:bibliography/ead:p">
    <fo:block xsl:use-attribute-sets="bibref">
      <xsl:apply-templates/>
    </fo:block>
  </xsl:template>

  <xsl:template match="ead:list">
    <xsl:if test="ead:head">
      <fo:block xsl:use-attribute-sets="head-list">
        <xsl:apply-templates select="ead:head" mode="titre_liste"/>
      </fo:block>
    </xsl:if>
    <fo:list-block >
      <xsl:apply-templates/>
    </fo:list-block>
  </xsl:template>

  <xsl:template match="ead:item">
    <fo:list-item xsl:use-attribute-sets="item">
      <fo:list-item-label xsl:use-attribute-sets="item-puce">
        <fo:block></fo:block>
      </fo:list-item-label>
      <fo:list-item-body xsl:use-attribute-sets="item-corps">
        <fo:block xsl:use-attribute-sets="item-texte">
          <xsl:apply-templates/>
        </fo:block>
      </fo:list-item-body>
    </fo:list-item>
  </xsl:template>

  <xsl:template match="ead:head" mode="titre">
    <fo:block xsl:use-attribute-sets="head">
      <xsl:apply-templates/>
    </fo:block>
  </xsl:template>

 <xsl:template match="ead:head"></xsl:template>

  <xsl:template match="ead:list/ead:head" mode="titre_liste">
    <xsl:apply-templates select="node()"/>
  </xsl:template>
  <xsl:template match="ead:list/ead:head"></xsl:template>

<!-- Les mots clés -->

<xsl:template match="ead:controlaccess/ead:geogname | ead:controlaccess/ead:subject | ead:controlaccess/ead:genreform | ead:controlaccess/ead:persname">
<fo:inline><xsl:apply-templates/></fo:inline>
<xsl:text> ; </xsl:text>
</xsl:template>

<!-- Les liens -->

 <xsl:template match="ead:extref">
 <fo:basic-link xsl:use-attribute-sets="liens" external-destination="{@xlink:href}">
 <xsl:apply-templates/>
 </fo:basic-link>
 </xsl:template>

<xsl:template match="ead:ref">
 <!-- <fo:basic-link xsl:use-attribute-sets="liens" external-destination="{@xlink:href}"> -->
 <xsl:apply-templates/>
 <!-- </fo:basic-link> -->
 </xsl:template>

</xsl:stylesheet>
+0 −18
Original line number Diff line number Diff line
@@ -266,24 +266,6 @@
        </tr>
    </xsl:template>

    <xsl:template match="ead:unitdate">
        <tr class="unitdate">
            <xsl:choose>
                <xsl:when test="@label">
                    <th>
                        <xsl:value-of select="@label"/>
                    </th>
                </xsl:when>
                <xsl:otherwise>
                    <th>Datation</th>
                </xsl:otherwise>
            </xsl:choose>
            <td>
                <xsl:apply-templates select="node()"/>
            </td>
        </tr>
    </xsl:template>

    <!-- FIN Description et identification [did]-->
    <!-- Zone du contenu -->
    <xsl:template match="ead:scopecontent">
+571 −6

File changed.

Preview size limit exceeded, changes collapsed.

+52 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:xhtml="http://www.w3.org/1999/xhtml"
    xmlns="http://www.w3.org/1999/XSL/Format"
    xmlns:i18n="http://apache.org/cocoon/i18n/2.1" exclude-result-prefixes="xsl xhtml">



    <!-- Le template de l'en-tête -->
    <xsl:template name="output-header">
        <xsl:param name="pretty-name"/>
        <!-- Un block-container permet de fixer une hauteur, et donc d'ajuster l'image de fond -->
        <block-container>
            <xsl:attribute name="position">relative</xsl:attribute>
            <xsl:attribute name="top">0cm</xsl:attribute>
            <xsl:attribute name="left">0cm</xsl:attribute>
            <xsl:attribute name="width">100%</xsl:attribute>
            <xsl:attribute name="height">1cm</xsl:attribute>
            <xsl:attribute name="background-color">#93A9BE</xsl:attribute>
            <!-- Le contenu -->
            <block>
           <xsl:attribute name="margin-right">10pt</xsl:attribute> 
            <xsl:attribute name="margin-left">10pt</xsl:attribute>
            <xsl:attribute name="margin-top">1mm</xsl:attribute>
            <xsl:attribute name="padding">2pt</xsl:attribute>
            <xsl:attribute name="font-size">14pt</xsl:attribute>
            <xsl:attribute name="font-style">italic</xsl:attribute>
            <xsl:attribute name="font-family">serif</xsl:attribute>
            <xsl:attribute name="text-align">center</xsl:attribute>
           <xsl:attribute name="color">#fff</xsl:attribute> 
            <xsl:text>&#160;</xsl:text>
            <xsl:value-of select="$pretty-name"/>
            </block>
        </block-container>
            <block>
            <xsl:attribute name="margin-right">0pt</xsl:attribute> 
            <xsl:attribute name="margin-left">0pt</xsl:attribute>
            <xsl:attribute name="margin-top">1mm</xsl:attribute>
            <xsl:attribute name="padding">2pt</xsl:attribute>
            <xsl:attribute name="font-size">7pt</xsl:attribute>
            <xsl:attribute name="font-family">serif</xsl:attribute>
            <xsl:attribute name="text-align">right</xsl:attribute>
            <inline>
            <xsl:attribute name="font-style">italic</xsl:attribute>
            <xsl:text>Bibliothèque virtuelle du Mont Saint-Michel</xsl:text>
            </inline>
            <xsl:text>, Catherine Jacquemard (dir.) et Marie Bisson (coord.), Caen, Centre Michel de Boüard – Pôle Document numérique, 2017.</xsl:text>
            </block>
    </xsl:template>

</xsl:stylesheet>
 No newline at end of file
+175 −0

File added.

Preview size limit exceeded, changes collapsed.

Loading