Statistics
| Revision:

root / tmp / org.txm.core / res / org / txm / xml / xsl / txm-filter-corpusakkadien-xmlw_mots_effaces.xsl @ 187

History | View | Annotate | Download (3.5 kB)

1
<?xml version="1.0"?>
2
<xsl:stylesheet
3
  xmlns:xd="http://www.pnp-software.com/XSLTdoc"
4
  xmlns:edate="http://exslt.org/dates-and-times"
5
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:tei="http://www.tei-c.org/ns/1.0"
6
  exclude-result-prefixes="tei edate xd" version="2.0">
7
  
8
  <xd:doc type="stylesheet">
9
    <xd:short>
10
      Cette feuille de style permet de préparer les transcriptions de tablettes
11
      d'argile (projet UMR PROCLAC) à l'import XML/W + CSV de TXM en créant les
12
      propriétés de mots "no-unclear" et "non-supplied" pour éliminer les formes
13
      non présentes ou peu lisibles dans les sources.
14
    </xd:short>
15
    <xd:detail>
16
      This stylesheet is free software; you can redistribute it and/or
17
      modify it under the terms of the GNU Lesser General Public
18
      License as published by the Free Software Foundation; either
19
      version 3 of the License, or (at your option) any later version.
20
      
21
      This stylesheet is distributed in the hope that it will be useful,
22
      but WITHOUT ANY WARRANTY; without even the implied warranty of
23
      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
24
      Lesser General Public License for more details.
25
      
26
      You should have received a copy of GNU Lesser Public License with
27
      this stylesheet. If not, see http://www.gnu.org/licenses/lgpl.html
28
    </xd:detail>
29
    <xd:author>Alexei Lavrentiev, alexei.lavrentev@ens-lyon.fr</xd:author>
30
    <xd:copyright>2014-2015, CNRS / ICAR (équipe CACTUS)</xd:copyright>
31
  </xd:doc>
32
  
33

    
34
  <xsl:output method="xml" encoding="utf-8" omit-xml-declaration="yes"/>
35

    
36
  <xsl:template match="@*|*">
37
    <xsl:copy>
38
      <xsl:apply-templates select="@*|node()" />
39
    </xsl:copy>
40
  </xsl:template>
41
  
42
  <xsl:template match="@*|*" mode="nosupplied">
43
    <xsl:copy>
44
      <xsl:apply-templates select="@*|node()" />
45
    </xsl:copy>
46
  </xsl:template>
47
  
48
  <xsl:template match="@*|*" mode="nounclear">
49
    <xsl:copy>
50
      <xsl:apply-templates select="@*|node()" />
51
    </xsl:copy>
52
  </xsl:template>
53
  
54
  <xsl:template match="*[local-name()='teiHeader']"/>
55
  
56
  <xsl:template match="text()" mode="#all">
57
    <xsl:choose>
58
      <xsl:when test="ancestor::*[local-name()='w']">
59
        <xsl:value-of select="."/>
60
      </xsl:when>
61
      <xsl:otherwise/>
62
    </xsl:choose>
63
  </xsl:template>
64
  
65
  <!-- On supprime les mots qui sont illisibles dans la source et on ajoute une propriété lexicale
66
  qui correspond à la lisibilité -->
67
  
68
  <xsl:template match="//*[local-name()='w']">
69
        <xsl:copy>
70
          <xsl:apply-templates select="@*"/>
71
          <xsl:attribute name="no-supplied">
72
            <xsl:choose>
73
              <xsl:when test="ancestor::*[local-name()='supplied']">¤</xsl:when>
74
              <xsl:otherwise><xsl:apply-templates mode="nosupplied"/></xsl:otherwise>
75
            </xsl:choose>
76
          </xsl:attribute>
77
          <xsl:attribute name="no-unclear">
78
            <xsl:choose>
79
              <xsl:when test="ancestor::*[local-name()='supplied'] or ancestor::*[local-name()='unclear']">¤</xsl:when>
80
              <xsl:otherwise><xsl:apply-templates mode="nounclear"/></xsl:otherwise>
81
            </xsl:choose>
82
          </xsl:attribute>
83
          <xsl:apply-templates/>
84
        </xsl:copy>
85
  </xsl:template>
86
  
87
  <xsl:template match="*[local-name()='supplied']" mode="nosupplied"/>
88
  
89
  <xsl:template match="*[local-name()='supplied']" mode="nounclear"/>
90
  
91
  <xsl:template match="*[local-name()='unclear']" mode="nounclear"/>
92
	
93
</xsl:stylesheet>