Statistics
| Revision:

root / tmp / org.txm.core / res / org / txm / xml / xsl / ts2xmlw.xsl @ 187

History | View | Annotate | Download (2.5 kB)

1
<?xml version="1.0"?>
2
<xsl:stylesheet version="1.0"
3
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4
                xmlns:tei="http://www.tei-c.org/ns/1.0"
5
                xmlns:xd="http://www.pnp-software.com/XSLTdoc"
6
                xmlns:edate="http://exslt.org/dates-and-times"
7
                exclude-result-prefixes="edate xd">
8

    
9
  <xd:doc type="stylesheet">
10

    
11
    <xd:short>
12
      Feuille de transformation du format TIGER-XML vers le format XML-TXM
13
    </xd:short>
14

    
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

    
30
    <xd:author>Matthieu Decorde, matthieu.decorde AT ens-lyon.fr</xd:author>
31
    <xd:author>Serge Heiden, slh AT ens-lyon.fr</xd:author>
32
    <xd:author>Alexey Lavrentev, alexei.lavrentev AT ens-lyon.fr></xd:author>
33

    
34
    <xd:copyright>2016, ENS de Lyon/CNRS (UMR IHRIM Cactus)</xd:copyright>
35

    
36
  </xd:doc>
37
  
38
  <xsl:output 
39
   method="xml"
40
   encoding="UTF-8"
41
   indent="yes" />
42

    
43
  <xsl:template match="corpus">
44
    <corpus>
45
    	<xsl:choose>
46
    		<xsl:when test="subcorpus">
47
    			<xsl:apply-templates select="subcorpus"/>
48
    		</xsl:when>
49
    		<xsl:otherwise>
50
    			<text>
51
    				<xsl:apply-templates select="s"/>
52
    			</text>			
53
    		</xsl:otherwise>
54
    	</xsl:choose>
55
    	<xsl:apply-templates/>
56
    </corpus>
57
  </xsl:template>
58
  
59
  <xsl:template match="subcorpus">
60
    <text>
61
	<xsl:attribute name="name"><xsl:value-of select="@name"/></xsl:attribute>
62
	<xsl:apply-templates select="s"/>
63
    </text>
64
  </xsl:template>
65
  
66
  <xsl:template match="s">
67
	<p>
68
	  <s>
69
	    <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
70
	      <xsl:apply-templates select="graph/terminals/t" />
71
	  </s>
72
	</p>
73
  </xsl:template>
74

    
75
  <xsl:template match="t">
76
		<w>
77
			<xsl:for-each select="@*[not(name()='word')]">
78
				<xsl:copy/>
79
			</xsl:for-each>
80
	        <xsl:value-of select="@word"/>
81
		</w>
82
  </xsl:template>
83

    
84
</xsl:stylesheet>