Revision 2398 tmp/org.txm.oriflamms.rcp/res/oriflamms-patch-expan-fontenay.xsl

oriflamms-patch-expan-fontenay.xsl (revision 2398)
1 1
<?xml version="1.0"?>
2
<xsl:stylesheet xmlns:edate="http://exslt.org/dates-and-times"
3
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:tei="http://www.tei-c.org/ns/1.0"
4
  xmlns:xd="http://www.pnp-software.com/XSLTdoc"
5
  xmlns:txm="http://textometrie.org/1.0"
6
  xmlns:xi="http://www.w3.org/2001/XInclude" 
7
  xmlns:svg="http://www.w3.org/2000/svg" 
8
  xmlns:math="http://www.w3.org/1998/Math/MathML"
9
  exclude-result-prefixes="tei edate xd txm xi svg math" version="2.0">
2
<xsl:stylesheet
3
	xmlns:edate="http://exslt.org/dates-and-times"
4
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
5
	xmlns:tei="http://www.tei-c.org/ns/1.0"
6
	xmlns:xd="http://www.pnp-software.com/XSLTdoc"
7
	xmlns:txm="http://textometrie.org/1.0"
8
	xmlns:xi="http://www.w3.org/2001/XInclude"
9
	xmlns:svg="http://www.w3.org/2000/svg"
10
	xmlns:math="http://www.w3.org/1998/Math/MathML"
11
	exclude-result-prefixes="tei edate xd txm xi svg math" version="2.0">
10 12

  
11
  <xsl:output method="xml" encoding="utf-8" omit-xml-declaration="no" indent="yes"/>
12
  
13
  <xd:doc type="stylesheet">
14
    <xd:short>
15
      Cette feuille permet de repérer les lettres supprimées dans les
16
      résolution des abréviations
17
    </xd:short>
18
    <xd:detail>
19
      This stylesheet is free software; you can redistribute it and/or
20
      modify it under the terms of the GNU Lesser General Public
21
      License as published by the Free Software Foundation; either
22
      version 3 of the License, or (at your option) any later version.
23
      
24
      This stylesheet is distributed in the hope that it will be useful,
25
      but WITHOUT ANY WARRANTY; without even the implied warranty of
26
      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
27
      Lesser General Public License for more details.
28
      
29
      You should have received a copy of GNU Lesser Public License with
30
      this stylesheet. If not, see http://www.gnu.org/licenses/lgpl.html
31
    </xd:detail>
32
    <xd:author>Alexei Lavrentiev alexei.lavrentev@ens-lyon.fr</xd:author>
33
    <xd:copyright>2015, CNRS / ICAR (Équipe CACTUS)</xd:copyright>
34
  </xd:doc>
35
  
36
  <xsl:strip-space elements="*"/>
37
  
38
  
39
  <xsl:template match="node()">
40
    <!-- Copy the current node -->
41
    <xsl:copy>
42
      <!-- Including any attributes it has and any child nodes -->
43
      <xsl:apply-templates select="@*|node()"/>
44
    </xsl:copy>
45
  </xsl:template>
13
	<xsl:output method="xml" encoding="utf-8"
14
		omit-xml-declaration="no" indent="yes" />
46 15

  
47
  <!-- On supprime les attributs par défaut de la DTD TEI -->
48
  
49
  <xsl:template match="@*">
50
    <xsl:copy/>
51
  </xsl:template>
16
	<xd:doc type="stylesheet">
17
		<xd:short>
18
			Cette feuille permet de repérer les lettres supprimées dans les
19
			résolution des abréviations
20
		</xd:short>
21
		<xd:detail>
22
			This stylesheet is free software; you can redistribute it and/or
23
			modify it under the terms of the GNU Lesser General Public
24
			License as published by the Free Software Foundation; either
25
			version 3 of the License, or (at your option) any later version.
52 26

  
53
<xsl:template match="tei:expan">
54
  <xsl:choose>
55
    <xsl:when test="matches(.,'^(par|per)$','i')">
56
      <xsl:analyze-string select="." regex="(.)(..)">
57
        <xsl:matching-substring>
58
          <xsl:value-of select="regex-group(1)"/>
59
          <ex xmlns="http://www.tei-c.org/ns/1.0"><xsl:value-of select="regex-group(2)"></xsl:value-of></ex>
60
        </xsl:matching-substring>
61
      </xsl:analyze-string>
62
    </xsl:when>
63
  </xsl:choose>
64
</xsl:template>
27
			This stylesheet is distributed in the hope that it will be useful,
28
			but WITHOUT ANY WARRANTY; without even the implied warranty of
29
			MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
30
			Lesser General Public License for more details.
65 31

  
32
			You should have received a copy of GNU Lesser Public License with
33
			this stylesheet. If not, see http://www.gnu.org/licenses/lgpl.html
34
		</xd:detail>
35
		<xd:author>Alexei Lavrentiev alexei.lavrentev@ens-lyon.fr</xd:author>
36
		<xd:copyright>2015, CNRS / ICAR (Équipe CACTUS)</xd:copyright>
37
	</xd:doc>
66 38

  
39
	<xsl:strip-space elements="*" />
40

  
41

  
42
	<xsl:template match="node()">
43
		<!-- Copy the current node -->
44
		<xsl:copy>
45
			<!-- Including any attributes it has and any child nodes -->
46
			<xsl:apply-templates select="@*|node()" />
47
		</xsl:copy>
48
	</xsl:template>
49

  
50
	<!-- On supprime les attributs par défaut de la DTD TEI -->
51

  
52
	<xsl:template match="@*">
53
		<xsl:copy />
54
	</xsl:template>
55

  
56
	<xsl:template match="tei:expan">
57
		<xsl:choose>
58
			<xsl:when test="matches(.,'^(par|per)$','i')">
59
				<xsl:analyze-string select="." regex="(.)(..)">
60
					<xsl:matching-substring>
61
						<xsl:value-of select="regex-group(1)" />
62
						<ex xmlns="http://www.tei-c.org/ns/1.0">
63
							<xsl:value-of select="regex-group(2)"></xsl:value-of>
64
						</ex>
65
					</xsl:matching-substring>
66
				</xsl:analyze-string>
67
			</xsl:when>
68
		</xsl:choose>
69
	</xsl:template>
70

  
71

  
67 72
</xsl:stylesheet>

Also available in: Unified diff