Outils pour utilisateurs

Outils du site


public:specs_dev_gwt:079_corpus_parameters

Paramètres de corpus TXM 0.7.9 pour le portail TXM

Le fichier de paramètres import.xml utilisé jusqu'à TXM 0.7.9 contient un certain nombre d'éléments spécifiques au portail TXM (affichage de la sélection et de la liste des textes, limitation des contextes de concordances, voir la section 4 du “Manuel portail 0.6.1”). Il est également possible de “patcher” le fichier import.xml pour créer des éditions parallèles entre plusieurs langues et versions d'un texte (cette opération nécessite également la création de copies de fichiers html des éditions). Les deux opérations peuvent se faire grâce à une transformation XSL du fichier import.xml. Il serait souhaitable que l'export “au format TXM 0.7.9” à partir de TXM 0.8.x puisse intégrer cette manipulation.

Exemple du fichier import.xml patché

(copie du Manuel portail)

<?xml version="1.0" encoding="UTF-8"?>
<import author="alavrent" date="14-06-13" desc="" name="bfm2013"
    rootDir="/home/mdecorde/xml/bfm2013" script="bfmLoader.groovy" version="0.7">
    <linkGrp type="align"/>
    <corpora>
        <corpus annotate="true" cqpid="BFM20131378283851169" desc="" encoding="UTF-8" font=""
            lang="fro" name="BFM2013">
            <tokenizer onlyThoseTests="false"/>
            <xslt xsl=""/>
            <pattributes>
                <pattribute id="pos" 
                    import="true" 
                    longname="Étiquette morphosyntaxique vérifiée"
                    mandatory="true" 
                    order="1" 
                    pattern="" 
                    renderer="" 
                    shortname="POS" 
                    tooltip="true"
                    type="String"/>
                <!-- ... -->
            </pattributes>
            <sattributes>
                <sattribute id="text_sigles" 
                    import="true" 
                    longname="Identifiant BFM et sigle DEAF"
                    pattern="" 
                    renderer="" 
                    shortname="sigles" 
                    type="String"/>
 
                <!--  ... -->
 
            </sattributes>
            <uis>
                <ui command="concordance">
                    <!-- dupliquer pour chaque fonction -->
                    <view>
                        <pattribute id="word"/>
                        <pattribute id="pos"/>
                    </view>
                    <sort>
                        <pattribute id="word"/>
                        <pattribute id="pos"/>
                    </sort>
                    <ref>
                        <!-- dupliquer pour le tri -->
                        <pattribute id="ref"/>
                        <pattribute id="text:titre"/>
                    </ref>
                </ui>
                <ui command="selection">
                    <sattribute colwidth="125" display="true" partition="false" ref="text_auteur"
                        selection="true"/>
                    <sattribute colwidth="150" display="true" partition="false" ref="text_titre"
                        selection="true"/>
                    <sattribute colwidth="50" display="false" partition="false" ref="text_notbefore"
                        selection="false"/>
                    <sattribute colwidth="50" display="false" partition="false" ref="text_notafter"
                        selection="false"/>
                    <sattribute colwidth="125" display="true" partition="false"
                        ref="text_datecompolibre" selection="false" sortBy="datecompo"/>
                    <sattribute colwidth="50" display="false" partition="false" ref="text_datecompo"
                        selection="false"/>
                    <group colwidth="50" display="false" inputFormat="yyyy-MM-dd"
                        longname="Date de composition" max="notafter" min="notbefore"
                        outputFormat="yyyy" partition="false" position="4" ref="text_bfmdate"
                        selection="true" shortname="date œuvre" sortBy="datecompo" type="MinMaxDate"/>
                </ui>
            </uis>
            <biblios>
                <biblio id="adgar">biblio/adgar-biblio.html</biblio>
                <biblio id="adhalefeuill">biblio/adhalefeuill-biblio.html</biblio>
            </biblios>
 
            <editions default="courante">
                <edition mode="groovy"
                    name="courante"
                    script="org.txm.importer.xml/pager.groovy"/>
                <edition mode="groovy"
                    name="ms-colonne"
                    script="org.txm.importer.xml/pager.groovy"/>
            </editions>
            <texts>
                <text name="strasb" pdf="pdf/strasb.pdf">
                    <source file="/home/mdecorde/TXM/corpora/bfm2013/txm/BFM2013/strasb.xml"
                        type=".xml"/>
                    <editions>
                        <edition index="/home/mdecorde/TXM/corpora/bfm2013/HTML/BFM2013/default"
                            name="default" type="html">
                            <page id="1" wordid="w_0"/>
                            <page id="2" wordid="w_strasb_1"/>
                            <page id="3" wordid="w_strasb_97"/>
                        </edition>
                    </editions>
                </text>
                <text name="eulali">
                    <source file="/home/mdecorde/TXM/corpora/bfm2013/txm/BFM2013/eulali.xml"
                        type=".xml"/>
                    <editions>
                        <edition index="/home/mdecorde/TXM/corpora/bfm2013/HTML/BFM2013/default"
                            name="courante" type="html">
                            <page id="1" wordid="w_0"/>
                            <page id="2" wordid="w_eulali_1"/>
                        </edition>
                        <edition index="/home/mdecorde/TXM/corpora/bfm2013/HTML/BFM2013/ms-colonne"
                            name="ms-colonne" type="html">
                            <page id="1" wordid="w_0"/>
                            <page id="2" wordid="w_eulali_1"/>
                        </edition>                        
                    </editions>
                </text>
            </texts>
            <queries/>
            <preBuild/>
            <prop key="lang" type="String">fro</prop>
        </corpus>
    </corpora>
</import>

Exemple de script XSL : BFM

<?xml version="1.0"?>
<xsl:stylesheet xmlns:edate="http://exslt.org/dates-and-times"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:tei="http://www.tei-c.org/ns/1.0"
  exclude-result-prefixes="tei edate" version="2.0">
 
  <xsl:output method="xml" encoding="utf-8" omit-xml-declaration="no" indent="yes"/>
 
  <xsl:variable name="filedir">
    <xsl:analyze-string select="document-uri(.)" regex="^(.*)/([^/]+)$">
      <xsl:matching-substring>
        <xsl:value-of select="regex-group(1)"/>
      </xsl:matching-substring>
    </xsl:analyze-string>
  </xsl:variable>
 
 
  <xsl:variable name="corpusname">
    <xsl:value-of select="//corpus[1]/@name"></xsl:value-of>
  </xsl:variable>
 
 
  <xsl:template match="*">
        <xsl:copy>
          <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()"/>
        </xsl:copy>
  </xsl:template>
 
  <xsl:template match="@*|processing-instruction()|comment()">
    <xsl:copy/>
  </xsl:template>
 
<xsl:template match="/">
  <xsl:result-document href="{$filedir}/import-rcp.xml">
    <xsl:copy-of select="."/>
  </xsl:result-document>
  <xsl:apply-templates/>
</xsl:template>
 
  <xsl:template match="text()">
    <xsl:value-of select="."/>
  </xsl:template>
 
<xsl:template match="pattributes">
  <pattributes>
    <pattribute id="cattex-pos"
      import="true"
      longname="Étiquette morphologique Cattex 09"
      mandatory="true"
      order="1"
      pattern=""
      renderer=""
      shortname="POS"
      tooltip="true"
      type="String"/>
    <pattribute id="ud-pos"
      import="true"
      longname="Étiquette partie du discours Universal Dependencies"
      mandatory="true"
      order="2"
      pattern=""
      renderer=""
      shortname="POSauto"
      tooltip="true"
      type="String"/>
    <pattribute id="q"
      import="true"
      longname="Niveau de discours direct"
      mandatory="true"
      order="3"
      pattern=""
      renderer=""
      shortname="q"
      tooltip="true"
      type="String"/>
    <pattribute id="sp"
      import="true"
      longname="Discours d'un personnage (drame ou dialogue)"
      mandatory="true"
      order="4"
      pattern=""
      renderer=""
      shortname="sp"
      tooltip="true"
      type="String"/>
    <pattribute id="id"
      import="true"
      longname="Identifiant du mot"
      mandatory="true"
      order="5"
      pattern=""
      renderer=""
      shortname="w_id"
      tooltip="true"
      type="String"/>
    <pattribute id="pb"
      import="true"
      longname="Numéro de page"
      mandatory="true"
      order="6"
      pattern=""
      renderer=""
      shortname="page"
      tooltip="true"
      type="String"/>
    <pattribute id="lb"
      import="true"
      longname="Numéro de vers"
      mandatory="true"
      order="7"
      pattern=""
      renderer=""
      shortname="vers"
      tooltip="true"
      type="String"/>
    <pattribute id="morphosynt"
      import="true"
      longname="État de l'étiquetage morphosyntaxique"
      mandatory="true"
      order="7"
      pattern=""
      renderer=""
      shortname="Morphosynt"
      tooltip="true"
      type="String"/>
    <pattribute id="lemmatisation"
      import="true"
      longname="État de la lemmatisation"
      mandatory="true"
      order="7"
      pattern=""
      renderer=""
      shortname="Lemmatisation"
      tooltip="true"
      type="String"/>
    <pattribute id="text:titre"
      import="true"
      longname="Titre du texte"
      mandatory="true"
      order="8"
      pattern=""
      renderer=""
      shortname="titre"
      tooltip="true"
      type="String"/>
    <pattribute id="text:auteur"
      import="true"
      longname="Auteur du texte"
      mandatory="true"
      order="9"
      pattern=""
      renderer=""
      shortname="auteur"
      tooltip="true"
      type="String"/>
    <pattribute id="text:forme"
      import="true"
      longname="Forme du texte"
      mandatory="true"
      order="10"
      pattern=""
      renderer=""
      shortname="forme"
      tooltip="true"
      type="String"/>
    <pattribute id="text:domaine"
      import="true"
      longname="Domaine du texte"
      mandatory="true"
      order="11"
      pattern=""
      renderer=""
      shortname="domaine"
      tooltip="true"
      type="String"/>
    <pattribute id="text:genre"
      import="true"
      longname="Genre du texte"
      mandatory="true"
      order="12"
      pattern=""
      renderer=""
      shortname="genre"
      tooltip="true"
      type="String"/>
    <pattribute id="text:deaf"
      import="true"
      longname="Sigle DEAF"
      mandatory="true"
      order="13"
      pattern=""
      renderer=""
      shortname="sigle DEAF"
      tooltip="true"
      type="String"/>
    <pattribute id="text:idbfm"
      import="true"
      longname="Sigle BFM"
      mandatory="true"
      order="14"
      pattern=""
      renderer=""
      shortname="sigle BFM"
      tooltip="true"
      type="String"/>
  </pattributes>  
</xsl:template> 
 
  <xsl:template match="sattributes">
    <sattributes>
      <sattribute id="text_idbfm"
        import="true"
        longname="Identifiant BFM"
        pattern=""
        renderer=""
        shortname="id bfm"
        type="String"/>
      <sattribute id="text_sigles"
        import="true"
        longname="Identifiant BFM et sigle DEAF"
        pattern=""
        renderer=""
        shortname="sigles"
        type="String"/>
      <sattribute id="text_auteur"
        import="true"
        longname="Auteur"
        pattern=""
        renderer=""
        shortname="auteur"
        type="String"/>
      <sattribute id="text_titre"
        import="true"
        longname="Titre"
        pattern=""
        renderer=""
        shortname="titre"
        type="String"/>
      <sattribute id="text_siecle"
        import="true"
        longname="Siècle"
        pattern=""
        renderer=""
        shortname="siècle"
        type="String"/>
      <sattribute id="text_notbefore"
        import="true"
        inputFormat="yyyy-MM-dd"
        longname="Pas avant"
        outputFormat="yyyy"
        pattern=""
        renderer=""
        shortname="pas avant"
        type="Date"/>
      <sattribute id="text_notafter"
        import="true"
        inputFormat="yyyy-MM-dd"
        longname="Pas après"
        outputFormat="yyyy"
        pattern=""
        renderer=""
        shortname="pas après"
        type="Date"/>
      <sattribute id="text_datecompolibre"
        import="true"
        longname="Date de composition de l'œuvre"
        pattern=""
        renderer=""
        shortname="date compo libre"
        sortBy="datecompo"
        type="String"/>
      <sattribute id="text_datecompo"
        import="true"
        inputFormat="yyyy-MM-dd"
        longname="Date formelle (moyenne) de composition de l'œuvre"
        outputFormat="yyyy"
        pattern=""
        renderer=""
        shortname="date compo"
        type="Date"/>
      <sattribute id="text_msnotbefore"
        import="true"
        inputFormat="yyyy-MM-dd"
        longname="Pas avant"
        outputFormat="yyyy"
        pattern=""
        renderer=""
        shortname="ms pas avant"
        type="Date"/>
      <sattribute id="text_msnotafter"
        import="true"
        inputFormat="yyyy-MM-dd"
        longname="Pas après"
        outputFormat="yyyy"
        pattern=""
        renderer=""
        shortname="ms pas après"
        type="Date"/>
      <sattribute id="text_msdatelibre"
        import="true"
        longname="Date du manuscrit"
        pattern=""
        renderer=""
        shortname="ms date libre"
        sortBy="msdate"
        type="String"/>
      <sattribute id="text_msdate"
        import="true"
        inputFormat="yyyy-MM-dd"
        longname="Date formelle (moyenne) du manuscrit"
        outputFormat="yyyy"
        pattern=""
        renderer=""
        shortname="ms date"
        type="Date"/>
      <sattribute id="text_forme"
        import="true"
        longname="Forme"
        pattern=""
        renderer=""
        shortname="forme"
        type="String"/>
      <sattribute id="text_domaine"
        import="true"
        longname="Domaine"
        pattern=""
        renderer=""
        shortname="domaine"
        type="String"/>
      <sattribute id="text_genre"
        import="true"
        longname="Genre"
        pattern=""
        renderer=""
        shortname="genre"
        type="String"/>
      <sattribute id="text_dialecte"
        import="true"
        longname="Dialecte"
        pattern=""
        renderer=""
        shortname="dialecte"
        type="String"/>
      <sattribute id="text_relation"
        import="true"
        longname="Relation (traduction, adaptation...)"
        pattern=""
        renderer=""
        shortname="relation"
        type="String"/>
      <sattribute id="text_morphosynt"
        import="true"
        longname="État de l'étiquetage morphosyntaxique"
        pattern=""
        renderer=""
        shortname="morphosynt"
        type="String"/>
      <sattribute id="text_lemmatisation"
        import="true"
        longname="État de la lemmatisation"
        pattern=""
        renderer=""
        shortname="lemmatisation"
        type="String"/>
      <!--<sattribute id="text_restrictions"
        import="true"
        longname="Restrictions"
        pattern=""
        renderer=""
        shortname="restrictions"
        type="String"/>-->
      <sattribute id="text_edsci"
        import="true"
        longname="Éditeur scientifique"
        pattern=""
        renderer=""
        shortname="éditeur"
        type="String"/>
      <sattribute id="text_edcomm"
        import="true"
        longname="Maison d'édition"
        pattern=""
        renderer=""
        shortname="maison éd"
        type="String"/>
      <sattribute id="text_edville"
        import="true"
        longname="Lieu d'édition"
        pattern=""
        renderer=""
        shortname="lieu éd"
        type="String"/>
      <sattribute id="text_eddate"
        import="true"
        longname="Date de l'édition"
        pattern=""
        renderer=""
        shortname="date éd"
        type="String"/>
      <sattribute id="text_ednum"
        import="true"
        longname="Numéro de l'édition"
        pattern=""
        renderer=""
        shortname="édition"
        type="String"/>
    </sattributes>
  </xsl:template>
 
  <xsl:template match="uis">
    <uis>
      <ui command="concordances"> <!-- dupliquer pour chq fonction ? -->
        <view>
          <pattribute id="word"/>
          <pattribute id="cattex-pos"/>
          <pattribute id="ud-pos"/>
          <pattribute id="q"/>
        </view>
        <sort>
          <pattribute id="word"/>
          <pattribute id="cattex-pos"/>
          <pattribute id="ud-pos"/>
          <pattribute id="q"/>
        </sort>
        <ref> <!-- dupliquer pour le tri ? -->
          <pattribute id="ref"/>
          <pattribute id="text:titre"/>
          <pattribute id="text:auteur"/>
          <pattribute id="text:siecle"/>
          <pattribute id="text:forme"/>
          <pattribute id="text:domaine"/>
          <pattribute id="text:genre"/>
          <pattribute id="text:relation"/>
          <pattribute id="text:deaf"/>
          <pattribute id="text:idbfm"/>
          <pattribute id="pb"/>
          <pattribute id="lb"/>
          <pattribute id="id"/>
          <pattribute id="cattex-pos"/>
          <pattribute id="ud-pos"/>
          <pattribute id="q"/>
          <pattribute id="sp"/>                  
        </ref>
      </ui>
      <ui command="selection">
        <sattribute colwidth="75"
          display="false"
          partition="true"
          ref="text_idbfm"
          selection="true"/>
        <sattribute colwidth="125"
          display="true"
          partition="false"
          ref="text_auteur"
          selection="true"/>
        <sattribute colwidth="150"
          display="true"
          partition="false"
          ref="text_titre"
          selection="true"/>
        <sattribute colwidth="50"
          display="false"
          partition="true"
          ref="text_siecle"
          selection="true"/>
        <sattribute colwidth="50"
          display="false"
          partition="false"
          ref="text_notbefore"
          selection="false"/>
        <sattribute colwidth="50"
          display="false"
          partition="false"
          ref="text_notafter"
          selection="false"/>
        <sattribute colwidth="125"
          display="true"
          partition="false"
          ref="text_datecompolibre"
          selection="false"
          sortBy="datecompo"/>
        <sattribute colwidth="50"
          display="false"
          partition="false"
          ref="text_datecompo"
          selection="false"/>
        <sattribute colwidth="50"
          display="false"
          partition="false"
          ref="text_msnotbefore"
          selection="false"/>
        <sattribute colwidth="50"
          display="false"
          partition="false"
          ref="text_msnotafter"
          selection="false"/>
        <sattribute colwidth="100"
          display="true"
          partition="false"
          ref="text_msdatelibre"
          selection="false"
          sortBy="msdate"/>
        <sattribute colwidth="50"
          display="false"
          partition="false"
          ref="text_msdate"
          selection="false"/>
        <sattribute colwidth="75"
          display="true"
          partition="true"
          ref="text_forme"
          selection="true"/>
        <sattribute colwidth="75"
          display="true"
          partition="true"
          ref="text_domaine"
          selection="true"/>
        <sattribute colwidth="75"
          display="true"
          partition="true"
          ref="text_genre"
          selection="true"/>
        <sattribute colwidth="100"
          display="true"
          partition="true"
          ref="text_dialecte"
          selection="true"/>
        <sattribute colwidth="75"
          display="true"
          partition="true"
          ref="text_relation"
          selection="true"/>
        <sattribute colwidth="75"
          display="false"
          partition="true"
          ref="text_morphosynt"
          selection="true"/>
        <sattribute colwidth="75"
          display="false"
          partition="true"
          ref="text_lemmatisation"
          selection="true"/>
        <!--<sattribute colwidth="50"
          display="false"
          partition="true"
          ref="text_restrictions"
          selection="true"/>-->
        <sattribute colwidth="125"
          display="false"
          partition="false"
          ref="text_edsci"
          selection="false"/>
        <sattribute colwidth="75"
          display="false"
          partition="false"
          ref="text_edville"
          selection="false"/>
        <sattribute colwidth="150"
          display="false"
          partition="false"
          ref="text_edcomm"
          selection="false"/>
        <sattribute colwidth="50"
          display="false"
          partition="false"
          ref="text_eddate"
          selection="false"/>
        <sattribute colwidth="50"
          display="false"
          partition="false"
          ref="text_ednum"
          selection="false"/>
        <group colwidth="50"
          display="false"
          inputFormat="yyyy-MM-dd"
          longname="Date de composition"
          max="notafter"
          min="notbefore"
          outputFormat="yyyy"
          partition="false"
          position="4"
          ref="text_bfmdate"
          selection="true"
          shortname="date œuvre"
          sortBy="datecompo"
          type="MinMaxDate"/>
        <group colwidth="50"
          display="false"
          inputFormat="yyyy-MM-dd"
          longname="Date du manuscrit"
          max="msnotafter"
          min="msnotbefore"
          outputFormat="yyyy"
          partition="false"
          position="5"
          ref="text_bfmmsdate"
          selection="true"
          shortname="date ms"
          sortBy="msdate"
          type="MinMaxDate"/>
      </ui>
    </uis>
  </xsl:template>
 
  <xsl:template match="biblios">
    <biblios>
      <xsl:for-each select="//texts/text">
        <biblio id="{@name}"><xsl:value-of select="concat('biblio/',@name,'-biblio.html')"/></biblio>
      </xsl:for-each>
    </biblios>
  </xsl:template>
 
  <!-- on supprime l'édition facs qui pose problème sur le portail lorsqu'elle n'est pas construite -->
  <xsl:template match="edition[@name='facs' and @build_edition='false']"></xsl:template>
 
  <xsl:template match="text">
    <xsl:variable name="textname">
      <xsl:value-of select="@name"/>
    </xsl:variable>
    <xsl:variable name="textfile">
      <xsl:value-of select="concat($filedir,'/txm/',$corpusname,'/',@name,'.xml')"/>
      <!-- remplacé 'src' par 'txm' -->
    </xsl:variable>
    <xsl:variable name="metadatafile">
      <xsl:value-of select="concat($filedir,'/metadata.csv.xml')"></xsl:value-of>
    </xsl:variable>
    <xsl:element name="text">
      <xsl:apply-templates select="@*"/>
      <xsl:if test="document($metadatafile)//text[@id=$textname]/entry[@id='licence' and @value='libre']">
        <!-- ancien test: document($textfile)/tei:TEI/tei:teiHeader[1]/tei:fileDesc[1]/tei:publicationStmt[1]/tei:availability[1]/tei:licence[1]/tei:ab[1][matches(@subtype,'libre')] -->
        <xsl:choose>
          <xsl:when test="matches(@name,'^qgraal_cm')"><xsl:attribute name="pdf"><xsl:value-of select="concat('pdf/',@name,'-index.pdf')"/></xsl:attribute></xsl:when>
          <xsl:otherwise><xsl:attribute name="pdf"><xsl:value-of select="concat('pdf/',@name,'.pdf')"/></xsl:attribute></xsl:otherwise>
        </xsl:choose>        
      </xsl:if>
      <xsl:apply-templates/>
    </xsl:element>
  </xsl:template>
 
  <xsl:template match="page">
    <xsl:choose>
      <xsl:when test="@wordid='w_0' and not(@id='1')">
        <!-- deleting empty pages -->
      </xsl:when>
      <xsl:otherwise>
        <xsl:copy-of select="."/>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:template>
</xsl:stylesheet>

Exemple de script XSL : éditions parallèles, projet Coran 12-21

<?xml version="1.0"?>
<xsl:stylesheet xmlns:edate="http://exslt.org/dates-and-times"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:tei="http://www.tei-c.org/ns/1.0"
  exclude-result-prefixes="tei edate" version="2.0">
 
  <xsl:output method="xml" encoding="utf-8" omit-xml-declaration="no" indent="yes"/>
 
  <xsl:variable name="filedir">
    <xsl:analyze-string select="document-uri(.)" regex="^(.*)/([^/]+)$">
      <xsl:matching-substring>
        <xsl:value-of select="regex-group(1)"/>
      </xsl:matching-substring>
    </xsl:analyze-string>
  </xsl:variable>
 
 
  <xsl:variable name="corpusname">
    <xsl:value-of select="//corpus[1]/@name"></xsl:value-of>
  </xsl:variable>
 
  <xsl:variable name="path-html">
    <xsl:value-of select="concat($filedir,'/HTML/',$corpusname)"/>
  </xsl:variable>
 
 
  <xsl:template match="*" mode="#all">
        <xsl:copy>
          <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()" mode="#current"/>
        </xsl:copy>
  </xsl:template>
 
  <xsl:template match="@*|processing-instruction()|comment()" mode="#all">
    <xsl:copy/>
  </xsl:template>
 
<xsl:template match="/">
  <xsl:result-document href="{$filedir}/import-rcp.xml">
    <xsl:copy-of select="."/>
  </xsl:result-document>
  <xsl:apply-templates/>
</xsl:template>
 
  <xsl:template match="text()">
    <xsl:value-of select="."/>
  </xsl:template>
 
 
  <xsl:template match="text">
    <xsl:element name="text">
      <xsl:apply-templates select="@*"/>
      <xsl:apply-templates/>
    </xsl:element>
  </xsl:template>
 
  <!-- creating parallel editions -->
 
  <xsl:template match="corpus/editions">
    <editions default="default">
      <edition build_edition="true"
        mode="groovy"
        name="default"
        page_break_tag="pb"
        script="pager.groovy"
        words_per_page="999999"/>
      <edition build_edition="true"
        mode="groovy"
        name="Blachere"
        page_break_tag="pb"
        script="pager.groovy"
        words_per_page="999999"/>
      <edition build_edition="true"
        mode="groovy"
        name="DuRyer"
        page_break_tag="pb"
        script="pager.groovy"
        words_per_page="999999"/>
      <edition build_edition="true"
        mode="groovy"
        name="Hamidullah"
        page_break_tag="pb"
        script="pager.groovy"
        words_per_page="999999"/>
      <edition build_edition="true"
        mode="groovy"
        name="Postnikov"
        page_break_tag="pb"
        script="pager.groovy"
        words_per_page="999999"/>
      <edition build_edition="true"
        mode="groovy"
        name="Caire"
        page_break_tag="pb"
        script="pager.groovy"
        words_per_page="999999"/>
    </editions>
  </xsl:template>
 
  <xsl:template match="text/editions">
    <editions>
      <xsl:apply-templates select="edition[@name='default']" mode="default"/>
      <xsl:apply-templates select="edition[@name='default']" mode="blachere"/>
      <xsl:apply-templates select="edition[@name='default']" mode="duryer"/>
      <xsl:apply-templates select="edition[@name='default']" mode="hamidullah"/>
      <xsl:apply-templates select="edition[@name='default']" mode="postnikov"/>
      <xsl:apply-templates select="edition[@name='default']" mode="caire"/>
    </editions>
  </xsl:template>
 
  <xsl:template match="text/editions/edition" mode="default">
    <xsl:copy>
      <xsl:apply-templates select="@*"/>
      <xsl:apply-templates mode="#current"/>
    </xsl:copy>
  </xsl:template>
 
  <xsl:template match="text/editions/edition" mode="blachere">
    <xsl:copy>
      <xsl:apply-templates select="@*"/>
      <xsl:attribute name="index"><xsl:value-of select="replace(@index,'/default$','/Blachere')"/></xsl:attribute>
      <xsl:attribute name="name">Blachere</xsl:attribute>
      <xsl:apply-templates/>
    </xsl:copy>
  </xsl:template>
 
  <xsl:template match="text/editions/edition" mode="duryer">
    <xsl:copy>
      <xsl:apply-templates select="@*"/>
      <xsl:attribute name="index"><xsl:value-of select="replace(@index,'/default$','/DuRyer')"/></xsl:attribute>
      <xsl:attribute name="name">DuRyer</xsl:attribute>
      <xsl:apply-templates/>
    </xsl:copy>
  </xsl:template>
 
  <xsl:template match="text/editions/edition" mode="hamidullah">
    <xsl:copy>
      <xsl:apply-templates select="@*"/>
      <xsl:attribute name="index"><xsl:value-of select="replace(@index,'/default$','/Hamidullah')"/></xsl:attribute>
      <xsl:attribute name="name">Hamidullah</xsl:attribute>
      <xsl:apply-templates/>
    </xsl:copy>
  </xsl:template>
  <xsl:template match="text/editions/edition" mode="postnikov">
    <xsl:copy>
      <xsl:apply-templates select="@*"/>
      <xsl:attribute name="index"><xsl:value-of select="replace(@index,'/default$','/Postnikov')"/></xsl:attribute>
      <xsl:attribute name="name">Postnikov</xsl:attribute>
      <xsl:apply-templates/>
    </xsl:copy>
  </xsl:template>
  <xsl:template match="text/editions/edition" mode="caire">
    <xsl:copy>
      <xsl:apply-templates select="@*"/>
      <xsl:attribute name="index"><xsl:value-of select="replace(@index,'/default$','/Caire')"/></xsl:attribute>
      <xsl:attribute name="name">Caire</xsl:attribute>
      <xsl:apply-templates/>
    </xsl:copy>
  </xsl:template>
 
<!--  <xsl:template match="page">
    <xsl:choose>
      <xsl:when test="@wordid='w_0' and not(@id='1')">
        <!-\- deleting empty pages -\->
      </xsl:when>
      <xsl:otherwise>
        <xsl:copy-of select="."/>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:template>-->
 
  <xsl:template match="page" mode="default">
    <xsl:choose>
      <xsl:when test="@wordid='w_0XXXXXXXXXXXXXXXXXXXXXXX' and not(position()=1)">
        <!-- deleting empty pages -->
      </xsl:when>
      <xsl:otherwise>
        <xsl:variable name="textName">
          <xsl:value-of select="ancestor::text/@name"/>
        </xsl:variable>
        <xsl:copy-of select="."/>
        <xsl:choose>
          <xsl:when test="matches($textName,'-Blachere')">
<!--            <xsl:result-document href="{$filedir}/HTML/{$corpusname}/default/{$textName}_{@id}.html" method="html">
              <xsl:copy-of select="document(concat($path-html,'/default/',$textName,'_',@id,'.html'))"/>
            </xsl:result-document>
-->            <xsl:result-document href="{$filedir}/HTML/{$corpusname}/Blachere/{$textName}_{@id}.html" method="html">
              <xsl:copy-of select="document(concat($path-html,'/default/',$textName,'_',@id,'.html'))"/>
            </xsl:result-document>
            <xsl:result-document href="{$filedir}/HTML/{$corpusname}/Blachere/{replace($textName,'-Blachere','-DuRyer')}_{@id}.html" method="html">
              <xsl:copy-of select="document(concat($path-html,'/default/',$textName,'_',@id,'.html'))"/>
            </xsl:result-document>
          <xsl:result-document href="{$filedir}/HTML/{$corpusname}/Blachere/{replace($textName,'-Blachere','-Hamidullah')}_{@id}.html" method="html">
            <xsl:copy-of select="document(concat($path-html,'/default/',$textName,'_',@id,'.html'))"/>
          </xsl:result-document>
            <xsl:result-document href="{$filedir}/HTML/{$corpusname}/Blachere/{replace($textName,'-Blachere','-Postnikov')}_{@id}.html" method="html">
              <xsl:copy-of select="document(concat($path-html,'/default/',$textName,'_',@id,'.html'))"/>
            </xsl:result-document>
            <xsl:result-document href="{$filedir}/HTML/{$corpusname}/Blachere/{replace($textName,'-Blachere','-Caire')}_{@id}.html" method="html">
              <xsl:copy-of select="document(concat($path-html,'/default/',$textName,'_',@id,'.html'))"/>
            </xsl:result-document>
          </xsl:when>
          <xsl:when test="matches($textName,'-DuRyer')">
            <!--            <xsl:result-document href="{$filedir}/HTML/{$corpusname}/default/{$textName}_{@id}.html" method="html">
              <xsl:copy-of select="document(concat($path-html,'/default/',$textName,'_',@id,'.html'))"/>
            </xsl:result-document>
-->            <xsl:result-document href="{$filedir}/HTML/{$corpusname}/DuRyer/{$textName}_{@id}.html" method="html">
              <xsl:copy-of select="document(concat($path-html,'/default/',$textName,'_',@id,'.html'))"/>
            </xsl:result-document>
            <xsl:result-document href="{$filedir}/HTML/{$corpusname}/DuRyer/{replace($textName,'-DuRyer','-Blachere')}_{@id}.html" method="html">
              <xsl:copy-of select="document(concat($path-html,'/default/',$textName,'_',@id,'.html'))"/>
            </xsl:result-document>
            <xsl:result-document href="{$filedir}/HTML/{$corpusname}/DuRyer/{replace($textName,'-DuRyer','-Hamidullah')}_{@id}.html" method="html">
              <xsl:copy-of select="document(concat($path-html,'/default/',$textName,'_',@id,'.html'))"/>
            </xsl:result-document>
            <xsl:result-document href="{$filedir}/HTML/{$corpusname}/DuRyer/{replace($textName,'-DuRyer','-Postnikov')}_{@id}.html" method="html">
              <xsl:copy-of select="document(concat($path-html,'/default/',$textName,'_',@id,'.html'))"/>
            </xsl:result-document>
            <xsl:result-document href="{$filedir}/HTML/{$corpusname}/DuRyer/{replace($textName,'-DuRyer','-Caire')}_{@id}.html" method="html">
              <xsl:copy-of select="document(concat($path-html,'/default/',$textName,'_',@id,'.html'))"/>
            </xsl:result-document>
          </xsl:when>
          <xsl:when test="matches($textName,'-Hamidullah')">
            <!--            <xsl:result-document href="{$filedir}/HTML/{$corpusname}/default/{$textName}_{@id}.html" method="html">
              <xsl:copy-of select="document(concat($path-html,'/default/',$textName,'_',@id,'.html'))"/>
            </xsl:result-document>
-->            <xsl:result-document href="{$filedir}/HTML/{$corpusname}/Hamidullah/{$textName}_{@id}.html" method="html">
              <xsl:copy-of select="document(concat($path-html,'/default/',$textName,'_',@id,'.html'))"/>
            </xsl:result-document>
            <xsl:result-document href="{$filedir}/HTML/{$corpusname}/Hamidullah/{replace($textName,'-Hamidullah','-Blachere')}_{@id}.html" method="html">
              <xsl:copy-of select="document(concat($path-html,'/default/',$textName,'_',@id,'.html'))"/>
            </xsl:result-document>
            <xsl:result-document href="{$filedir}/HTML/{$corpusname}/Hamidullah/{replace($textName,'-Hamidullah','-DuRyer')}_{@id}.html" method="html">
              <xsl:copy-of select="document(concat($path-html,'/default/',$textName,'_',@id,'.html'))"/>
            </xsl:result-document>
            <xsl:result-document href="{$filedir}/HTML/{$corpusname}/Hamidullah/{replace($textName,'-Hamidullah','-Postnikov')}_{@id}.html" method="html">
              <xsl:copy-of select="document(concat($path-html,'/default/',$textName,'_',@id,'.html'))"/>
            </xsl:result-document>
            <xsl:result-document href="{$filedir}/HTML/{$corpusname}/Hamidullah/{replace($textName,'-Hamidullah','-Caire')}_{@id}.html" method="html">
              <xsl:copy-of select="document(concat($path-html,'/default/',$textName,'_',@id,'.html'))"/>
            </xsl:result-document>
          </xsl:when>
          <xsl:when test="matches($textName,'-Postnikov')">
            <!--            <xsl:result-document href="{$filedir}/HTML/{$corpusname}/default/{$textName}_{@id}.html" method="html">
              <xsl:copy-of select="document(concat($path-html,'/default/',$textName,'_',@id,'.html'))"/>
            </xsl:result-document>
-->            <xsl:result-document href="{$filedir}/HTML/{$corpusname}/Postnikov/{$textName}_{@id}.html" method="html">
              <xsl:copy-of select="document(concat($path-html,'/default/',$textName,'_',@id,'.html'))"/>
            </xsl:result-document>
            <xsl:result-document href="{$filedir}/HTML/{$corpusname}/Postnikov/{replace($textName,'-Postnikov','-Blachere')}_{@id}.html" method="html">
              <xsl:copy-of select="document(concat($path-html,'/default/',$textName,'_',@id,'.html'))"/>
            </xsl:result-document>
            <xsl:result-document href="{$filedir}/HTML/{$corpusname}/Postnikov/{replace($textName,'-Postnikov','-DuRyer')}_{@id}.html" method="html">
              <xsl:copy-of select="document(concat($path-html,'/default/',$textName,'_',@id,'.html'))"/>
            </xsl:result-document>
            <xsl:result-document href="{$filedir}/HTML/{$corpusname}/Postnikov/{replace($textName,'-Postnikov','-Hamidullah')}_{@id}.html" method="html">
              <xsl:copy-of select="document(concat($path-html,'/default/',$textName,'_',@id,'.html'))"/>
            </xsl:result-document>
            <xsl:result-document href="{$filedir}/HTML/{$corpusname}/Postnikov/{replace($textName,'-Postnikov','-Caire')}_{@id}.html" method="html">
              <xsl:copy-of select="document(concat($path-html,'/default/',$textName,'_',@id,'.html'))"/>
            </xsl:result-document>
          </xsl:when>
          <xsl:when test="matches($textName,'-Caire')">
            <!--            <xsl:result-document href="{$filedir}/HTML/{$corpusname}/default/{$textName}_{@id}.html" method="html">
              <xsl:copy-of select="document(concat($path-html,'/default/',$textName,'_',@id,'.html'))"/>
            </xsl:result-document>
-->            <xsl:result-document href="{$filedir}/HTML/{$corpusname}/Caire/{$textName}_{@id}.html" method="html">
              <xsl:copy-of select="document(concat($path-html,'/default/',$textName,'_',@id,'.html'))"/>
            </xsl:result-document>
            <xsl:result-document href="{$filedir}/HTML/{$corpusname}/Caire/{replace($textName,'-Caire','-Blachere')}_{@id}.html" method="html">
              <xsl:copy-of select="document(concat($path-html,'/default/',$textName,'_',@id,'.html'))"/>
            </xsl:result-document>
            <xsl:result-document href="{$filedir}/HTML/{$corpusname}/Caire/{replace($textName,'-Caire','-DuRyer')}_{@id}.html" method="html">
              <xsl:copy-of select="document(concat($path-html,'/default/',$textName,'_',@id,'.html'))"/>
            </xsl:result-document>
            <xsl:result-document href="{$filedir}/HTML/{$corpusname}/Caire/{replace($textName,'-Caire','-Hamidullah')}_{@id}.html" method="html">
              <xsl:copy-of select="document(concat($path-html,'/default/',$textName,'_',@id,'.html'))"/>
            </xsl:result-document>
            <xsl:result-document href="{$filedir}/HTML/{$corpusname}/Caire/{replace($textName,'-Caire','-Postnikov')}_{@id}.html" method="html">
              <xsl:copy-of select="document(concat($path-html,'/default/',$textName,'_',@id,'.html'))"/>
            </xsl:result-document>
          </xsl:when>
        </xsl:choose>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:template>
 
</xsl:stylesheet>
public/specs_dev_gwt/079_corpus_parameters.txt · Dernière modification: 2020/12/03 12:39 par alexei.lavrentev@ens-lyon.fr