Revision 2398 tmp/org.txm.oriflamms.rcp/res/oriflamms-transcr-2-w-id-table-Fontenay.xsl

oriflamms-transcr-2-w-id-table-Fontenay.xsl (revision 2398)
1 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
  xmlns:me="http://www.menota.org/ns/1.0"
7
  xmlns:xs="http://www.w3.org/2001/XMLSchema" 
8
  exclude-result-prefixes="#all"
9
  version="2.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"
6
	xmlns:tei="http://www.tei-c.org/ns/1.0"
7
	xmlns:me="http://www.menota.org/ns/1.0"
8
	xmlns:xs="http://www.w3.org/2001/XMLSchema"
9
	exclude-result-prefixes="#all" version="2.0">
10 10

  
11
  <xd:doc type="stylesheet">
12
    <xd:short>
13
      
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
  
11
	<xd:doc type="stylesheet">
12
		<xd:short>
33 13

  
34
  <xsl:output method="xml" encoding="utf-8"/>
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.
35 20

  
36
  <xsl:strip-space elements="*"/>
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.
37 25

  
38
  <xsl:template match="/">
39
    <text>
40
      <xsl:apply-templates select="descendant::tei:w|descendant::tei:pc"/>
41
    </text>
42
  </xsl:template>
43
  
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>
44 32

  
45
<xsl:template match="tei:w|tei:pc">
46
  <xsl:call-template name="word"/>
47
</xsl:template>
48
  
49
  <xsl:template match="tei:seg[@type='wp']">
50
    <xsl:call-template name="word"/>
51
  </xsl:template>
52
  
53
  <xsl:template name="word">
54
    <!--<xsl:if test="self::tei:w"></xsl:if>-->
55
    <xsl:choose>
56
      <xsl:when test="descendant::tei:lb">
57
        <xsl:apply-templates select="tei:seg[@type='wp']"/>
58
      </xsl:when>
59
      <xsl:when test="matches(@xml:id,'[a-z]$')">
60
        <w-add id="{@xml:id}"><xsl:apply-templates/></w-add>
61
        <xsl:text>&#xa;</xsl:text>
62
      </xsl:when>
63
      <xsl:otherwise>
64
        <w id="{@xml:id}"><xsl:apply-templates/></w>
65
        <xsl:text>&#xa;</xsl:text>
66
      </xsl:otherwise>
67
    </xsl:choose>
68
    
69
  </xsl:template>
70
  
71
  <xsl:template match="tei:choice">
72
    <xsl:apply-templates select="tei:abbr|tei:orig|tei:sic"/>
73
  </xsl:template>
74 33

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

  
36
	<xsl:strip-space elements="*" />
37

  
38
	<xsl:template match="/">
39
		<text>
40
			<xsl:apply-templates
41
				select="descendant::tei:w|descendant::tei:pc" />
42
		</text>
43
	</xsl:template>
44

  
45

  
46
	<xsl:template match="tei:w|tei:pc">
47
		<xsl:call-template name="word" />
48
	</xsl:template>
49

  
50
	<xsl:template match="tei:seg[@type='wp']">
51
		<xsl:call-template name="word" />
52
	</xsl:template>
53

  
54
	<xsl:template name="word">
55
		<!--<xsl:if test="self::tei:w"></xsl:if> -->
56
		<xsl:choose>
57
			<xsl:when test="descendant::tei:lb">
58
				<xsl:apply-templates
59
					select="tei:seg[@type='wp']" />
60
			</xsl:when>
61
			<xsl:when test="matches(@xml:id,'[a-z]$')">
62
				<w-add id="{@xml:id}">
63
					<xsl:apply-templates />
64
				</w-add>
65
				<xsl:text>&#xa;</xsl:text>
66
			</xsl:when>
67
			<xsl:otherwise>
68
				<w id="{@xml:id}">
69
					<xsl:apply-templates />
70
				</w>
71
				<xsl:text>&#xa;</xsl:text>
72
			</xsl:otherwise>
73
		</xsl:choose>
74

  
75
	</xsl:template>
76

  
77
	<xsl:template match="tei:choice">
78
		<xsl:apply-templates
79
			select="tei:abbr|tei:orig|tei:sic" />
80
	</xsl:template>
81

  
75 82
</xsl:stylesheet>

Also available in: Unified diff