Subversion Repositories eFlore/Archives.eflore-consultation-v1

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 jpm 1
<?xml version="1.0" encoding="iso-8859-1"?>
2
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
3
<xsl:output method="html" encoding="iso-8859-1" version="1.0" standalone="yes" indent="yes" />
4
<xsl:template match="/">&#60;?php
5
$y = 700 ;
6
$pdf = pdf_new() ;
7
pdf_open_file($pdf);
8
pdf_begin_page($pdf, 595, 842);
9
pdf_set_font($pdf, "Courier", 20, "host");
10
pdf_set_value($pdf, "textrendering", 0);
11
pdf_show_boxed($pdf, "Fiche d'identité d'un taxon", 50, 750,500,60,"center");
12
pdf_set_font($pdf, "Courier", 12, "host") ;
13
pdf_show_boxed($pdf, "Nom valide :", 50, 700,500,40,"left");
14
pdf_moveto($pdf, 50, 690);pdf_lineto($pdf, 330, 690);pdf_stroke($pdf);
15
<xsl:apply-templates/>
16
</xsl:template>
17
<xsl:template match="FICHE_IDENTITES_TAXONS">
18
  <xsl:if test="not(NOM_VALIDE) and not(LISTE_NOMS_VALIDES)">
19
  $y = $y - 50 ;
20
   pdf_show_boxed($pdf, "Il n'existe aucun nom valide pour ce taxon relativement à la
21
classification", 40, $y, 500,50, "left") ;
22
  </xsl:if>
23
<xsl:apply-templates select ="NOM_VALIDE"/>
24
<xsl:apply-templates select ="LISTE_NOMS_VALIDE"/>
25
<xsl:apply-templates select ="LISTE_NOMS_TAXONS_PARENTS"/>
26
<xsl:apply-templates select ="LISTE_SYNONYMES"/>
27
<xsl:apply-templates select ="LISTE_NOMS_VERNACULAIRES"/>
28
pdf_end_page($pdf);
29
pdf_close($pdf) ;
30
$data = pdf_get_buffer($pdf);
31
header("Content-type: application/pdf");
32
header("Content-Disposition: inline; filename=test.pdf");
33
header("Content-length : ".strlen($data)) ;
34
echo $data ;
35
?&#62;
36
</xsl:template>
37
 
38
<xsl:template match="NOM_VALIDE">
39
<xsl:apply-templates select="NOM_TAXON"/>
40
</xsl:template>
41
<xsl:template match="LISTE_NOMS_VALIDES">
42
<tr class="fieldLabel"><td>Nom valide:</td></tr>
43
<tr class="text"><td>
44
<UL>
45
<xsl:apply-templates select="NOM_TAXON" />
46
</UL>
47
</td></tr>
48
</xsl:template>
49
 
50
<xsl:template match="LISTE_NOMS_TAXONS_PARENTS">
51
$y = $y - 50 ;
52
pdf_show_boxed($pdf,"Niveaux taxonomiques supérieurs:",40,$y,500,50,"left") ;
53
 
54
<xsl:apply-templates select="NOM_TAXON_PARENTS/NOM_TAXON" mode="parent"/>
55
</xsl:template>
56
 
57
<xsl:template match="LISTE_SYNONYMES">
58
$y = $y - 50 ;
59
pdf_show_boxed($pdf,"Liste des synonymes :",40,$y,500,50,"left") ;
60
<xsl:apply-templates select="NOM_TAXON"/>
61
</xsl:template>
62
 
63
<xsl:template match="LISTE_NOMS_VERNACULAIRES">
64
$y = $y - 50 ;
65
pdf_show_boxed($pdf,"Noms communs :",40,$y,500,50,"left") ;
66
<xsl:apply-templates select="NOM_VERNACULAIRE" />
67
</xsl:template>
68
 
69
<xsl:template match="NOM_TAXON">
70
<xsl:apply-templates select="NOM"/>
71
</xsl:template>
72
 
73
<xsl:template match="NOM_TAXON" mode="parent">
74
<xsl:apply-templates select="NOM"/>
75
</xsl:template>
76
 
77
<xsl:template match="NOM">
78
$y = $y - 20 ;
79
pdf_show_boxed($pdf,"<xsl:value-of select="@type"/><xsl:value-of select="."/>&#160;<xsl:value-of select="@auteur"/>",40,$y,500,50,"left") ;
80
</xsl:template>
81
<xsl:template match="NOM_VERNACULAIRE">
82
$y = $y -50 ;
83
pdf_show_boxed($pdf,"<xsl:value-of select="@langue"/>&#160;:&#160;<xsl:value-of select="."/>(<xsl:value-of select="@pays"/>)&#160;<xsl:choose><xsl:when test="@emploi='0'">recommandé ou typique</xsl:when><xsl:when test="@emploi='1'">secondaire ou regional</xsl:when><xsl:when test="@emploi='2'">peu usité et à éviter</xsl:when></xsl:choose>",40,$y,500,50,"left") ;</xsl:template>
84
 
85
</xsl:stylesheet>