Statistics
| Revision:

root / tmp / org.txm.core / res / org / txm / xml / xsl / txm-filter-teifrantext-xmlw.xsl @ 187

History | View | Annotate | Download (3.7 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
  <xsl:import href="txm-filter-teip5-xmlw-preserve.xsl"/>
9
  
10
  <xd:doc type="stylesheet">
11
    <xd:short>
12
      Feuille de style de préparation des fichiers TEI de la Revue
13
      Discours à l'importation TXM dans un format xml simple. 
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>2012, CNRS / ICAR (ICAR3 LinCoBaTO)</xd:copyright>
31
  </xd:doc>
32
  
33
  <xsl:output method="xml" encoding="utf-8" omit-xml-declaration="no"/>
34

    
35
  <!--<xsl:variable name="langue"><xsl:value-of select="lower-case(//tei:teiHeader[1]/tei:profileDesc[1]/tei:langUsage[1]/tei:language[1])"/></xsl:variable>-->
36

    
37
<!-- On injecte les mots clés dans la langue de l'article et on ne garde que l'abstract dans la langue de l'article -->
38
  
39
  <xsl:template match="text()">
40
    <xsl:analyze-string select="." regex="&amp;lt;|&amp;gt;|&amp;|&lt;|&gt;|--|\*(\w+)">
41
      <xsl:matching-substring>
42
        <xsl:choose>
43
          <xsl:when test="matches(.,'&amp;lt;')">
44
            <xsl:text>‹</xsl:text>
45
          </xsl:when>
46
          <xsl:when test="matches(.,'&amp;gt;')">
47
            <xsl:text>›</xsl:text>
48
          </xsl:when>
49
          <!--          <xsl:when test="matches(.,'&amp;')">
50
            <!-\-<expan xmlns="http://www.tei-c.org/ns/1.0">and</expan>-\->
51
          	<xsl:text>&amp;amp;</xsl:text>
52
          </xsl:when>-->
53
          <xsl:when test="matches(.,'&lt;')">
54
            <xsl:text>‹</xsl:text>
55
          </xsl:when>
56
          <xsl:when test="matches(.,'&gt;')">
57
            <xsl:text>›</xsl:text>
58
          </xsl:when>
59
          <!-- pose problème si se trouve dans les notes transformés en commentaires xml par le tokeniseur -->
60
          <xsl:when test="matches(.,'--')">
61
            <xsl:text> - </xsl:text>
62
          </xsl:when>
63
          <!-- spécial Frantext!!! -->
64
          <xsl:when test="matches(.,'\*(\w+)')">
65
            <w xmlns="http://www.tei-c.org/ns/1.0" type="maj"><xsl:value-of select="regex-group(1)"/></w>
66
          </xsl:when>
67
          <xsl:otherwise>
68
            <xsl:value-of select="."/>
69
          </xsl:otherwise>
70
        </xsl:choose>
71
      </xsl:matching-substring>
72
      <xsl:non-matching-substring>         
73
        <xsl:value-of select="."/>
74
      </xsl:non-matching-substring>      
75
    </xsl:analyze-string>
76
  </xsl:template>
77
  
78
  <xsl:template match="tei:text">
79
    <xsl:copy>
80
      <xsl:apply-templates/>
81
    </xsl:copy>
82
  </xsl:template>
83
  
84
<xsl:template match="tei:div">
85
  <xsl:copy>
86
    <xsl:attribute name="n"><xsl:value-of select="count(preceding-sibling::tei:div) + 1"/></xsl:attribute>
87
    <xsl:apply-templates select="@*"/>
88
    <xsl:apply-templates/>
89
  </xsl:copy>
90
</xsl:template>
91
  
92
</xsl:stylesheet>