Statistiques
| Révision :

root / tei / xsl / analyse_styles_oo.xsl @ 2

Historique | Voir | Annoter | Télécharger (2,74 ko)

1
<?xml version="1.0" encoding="UTF-8"?>
2
<xsl:stylesheet version="2.0" exclude-result-prefixes="xsl" 
3
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0">
4
	<xsl:output method="xml" version="1.0" encoding="UTF-8" />
5
				
6
<xsl:template match="/">
7
	<xsl:element name="styles_oo">
8
		<!-- pour chaque fichier, on va stocker dans une chaine de caractere les noms des styles en fonction de leurs caractéristiques -->
9
		<xsl:call-template name="analyse"/>
10
	</xsl:element>	
11
</xsl:template>
12
	
13
<xsl:template name="analyse">
14
		<!-- styles de texte -->
15
		
16
		<xsl:element name="style">
17
		<xsl:attribute name="name">color_green</xsl:attribute>
18
		<xsl:for-each select="//style:style[@style:family='text']//*[@fo:color='#23ff23']"><xsl:value-of select="ancestor::style:style/@style:name"/>_</xsl:for-each>
19
		</xsl:element>
20
		
21
		<xsl:element name="style">
22
		<xsl:attribute name="name">vusillus</xsl:attribute>
23
		<xsl:for-each select="//style:style[@style:family='text']//*[contains(@style:font-name, 'Vusillus') or contains(@style:font-name, 'Vusillus old face')]"><xsl:value-of select="ancestor::style:style/@style:name"/>_</xsl:for-each>
24
		</xsl:element>
25
		
26
		<xsl:element name="style">
27
		<xsl:attribute name="name">bold</xsl:attribute>
28
		<xsl:for-each select="//style:style[@style:family='text']//*[@fo:font-weight='bold']"><xsl:value-of select="ancestor::style:style/@style:name"/>_</xsl:for-each>
29
		</xsl:element>
30
		
31
		
32
		<xsl:element name="style">
33
		<xsl:attribute name="name">underline</xsl:attribute>
34
		<xsl:for-each select="//style:style[@style:family='text']//*[@style:text-underline-style='solid']"><xsl:value-of select="ancestor::style:style/@style:name"/>_</xsl:for-each>
35
		</xsl:element>
36

    
37
		
38
		<xsl:element name="style">
39
		<xsl:attribute name="name">bgcolor_blue</xsl:attribute>
40
		<xsl:for-each select="//style:style[@style:family='text']//*[@fo:background-color='#99ccff']"><xsl:value-of select="ancestor::style:style/@style:name"/>_</xsl:for-each>
41
		</xsl:element>
42

    
43
		<!-- styles de paragraphes -->
44
		<xsl:element name="style">
45
		<xsl:attribute name="name">endnote</xsl:attribute>
46
		<xsl:for-each select="//style:style[@style:family='paragraph' and @style:parent-style-name='endnote_20_text']"><xsl:value-of select="ancestor::style:style/@style:name"/>_</xsl:for-each>
47
		</xsl:element>
48
		
49
		<xsl:element name="style">
50
		<xsl:attribute name="name">footnote</xsl:attribute>
51
		<xsl:for-each select="//style:style[@style:family='paragraph' and @style:parent-style-name='footnote_20_text']"><xsl:value-of select="ancestor::style:style/@style:name"/>_</xsl:for-each>
52
		</xsl:element>
53
		</xsl:template>	
54
</xsl:stylesheet>