Subversion Repositories eFlore/Archives.eflore-consultation-v1

Rev

Rev 8 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 8 Rev 9
Line 19... Line 19...
19
// |                                                                                                      |
19
// |                                                                                                      |
20
// | You should have received a copy of the GNU General Public License                                    |
20
// | You should have received a copy of the GNU General Public License                                    |
21
// | along with Foobar; if not, write to the Free Software                                                |
21
// | along with Foobar; if not, write to the Free Software                                                |
22
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
22
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
23
// +------------------------------------------------------------------------------------------------------+
23
// +------------------------------------------------------------------------------------------------------+
24
// CVS : $Id: eflore_transfo_xslt.inc.php,v 1.2 2005-06-01 18:26:21 jpm Exp $
24
// CVS : $Id: eflore_transfo_xslt.inc.php,v 1.3 2005-11-18 15:14:39 jp_milcent Exp $
25
/**
25
/**
26
* Réalisation de la transfo XSL du XML d'eFlore.
26
* Réalisation de la transfo XSL du XML d'eFlore.
27
*
27
*
28
*@package eFlore
28
*@package eFlore
29
*@subpackage Ancien
29
*@subpackage Ancien
30
//Auteur original :
30
//Auteur original :
31
*@author        Jean-Pascal MILCENT <jpm@tela-botanica.org>
31
*@author        Jean-Pascal MILCENT <jpm@tela-botanica.org>
32
//Autres auteurs :
32
//Autres auteurs :
33
*@author        Aucun
33
*@author        Aucun
34
*@copyright     Tela-Botanica 2000-2005
34
*@copyright     Tela-Botanica 2000-2005
35
*@version       $Revision: 1.2 $ $Date: 2005-06-01 18:26:21 $
35
*@version       $Revision: 1.3 $ $Date: 2005-11-18 15:14:39 $
36
// +------------------------------------------------------------------------------------------------------+
36
// +------------------------------------------------------------------------------------------------------+
37
*/
37
*/
Line 38... Line 38...
38
 
38
 
39
// +------------------------------------------------------------------------------------------------------+
39
// +------------------------------------------------------------------------------------------------------+
Line 107... Line 107...
107
//include ("php/lib/lib.divers.php") ;
107
//include ("php/lib/lib.divers.php") ;
108
//$tmp_pdf = "eflore_pdf".create_new_random(5) ;
108
//$tmp_pdf = "eflore_pdf".create_new_random(5) ;
Line 109... Line 109...
109
 
109
 
-
 
110
 
110
 
111
// Début pour PHP 4 avec utilisation de Sablotron
111
// Début pour PHP 4 avec utilisation de Sablotron
112
/*
112
$xh = xslt_create();//Crée un nouvel analyseur XSLT.
113
$xh = xslt_create();//Crée un nouvel analyseur XSLT.
-
 
114
xslt_set_encoding($xh,'ISO-8859-1');
113
xslt_set_encoding($xh,'ISO-8859-1');
115
$result = xslt_process($xh,'arg:/_xml', 'arg:/_xsl', NULL, $arguments);
Line 114... Line 116...
114
$result = xslt_process($xh,'arg:/_xml', 'arg:/_xsl', NULL, $arguments);
116
*/
115
// Fin pour PHP 4
117
// Fin pour PHP 4
116
 
118
 
117
/*
119
 
Line 118... Line 120...
118
// Début pour PHP 5
120
// Début pour PHP 5
Line 125... Line 127...
125
$proc = new xsltprocessor();
127
$proc = new xsltprocessor();
126
$xsl = $proc->importStylesheet($xsl);
128
$xsl = $proc->importStylesheet($xsl);
Line 127... Line 129...
127
 
129
 
128
$result = $proc->transformToXML($inputDom);
130
$result = $proc->transformToXML($inputDom);
129
// Fin PHP 5
131
// Fin PHP 5
130
*/
132
 
131
$result = ereg_replace ('transformer.php\?', $baseURL, $result) ;
133
$result = ereg_replace ('transformer.php\?', $baseURL, $result) ;
132
//$result = ereg_replace ("pdf.php", $tmp_pdf.".php", $result) ;
134
//$result = ereg_replace ("pdf.php", $tmp_pdf.".php", $result) ;
133
if ($result) {
135
if ($result) {
134
    $res = $result;
136
    $res = $result;
135
    $tab_champ['ESD_RESULTAT'] = 'ok';
137
    $tab_champ['ESD_RESULTAT'] = 'ok';
136
} else {
138
} else {
137
    // Début pour PHP 4 avec utilisation de Sablotron
139
    // Début pour PHP 4 avec utilisation de Sablotron
138
    print 'Message d\'erreur XSLT: ' . xslt_error($xh) .//xslt_error -- Retourne le message d'erreur courant
140
    //print 'Message d\'erreur XSLT: ' . xslt_error($xh) .//xslt_error -- Retourne le message d'erreur courant
139
    print ' avec le code : ' . xslt_errno($xh);//xslt_errno -- Retourne le numéro d'erreur courant
141
    //print ' avec le code : ' . xslt_errno($xh);//xslt_errno -- Retourne le numéro d'erreur courant
140
    // Fin pour PHP 4
142
    // Fin pour PHP 4
141
    $tab_champ['ESD_RESULTAT'] = 'ERREUR';
143
    $tab_champ['ESD_RESULTAT'] = 'ERREUR';
Line 142... Line 144...
142
}
144
}
-
 
145
 
143
 
146
// Début pour PHP 4 avec utilisation de Sablotron
-
 
147
/*
144
// Début pour PHP 4 avec utilisation de Sablotron
148
xslt_free($xh);//Détruit l'analyseur XSLT
Line 145... Line 149...
145
xslt_free($xh);//Détruit l'analyseur XSLT
149
*/
146
// Fin pour PHP 4
150
// Fin pour PHP 4
147
 
151
 
148
// Début pour PHP 5
152
// Début pour PHP 5
Line 149... Line 153...
149
//unset($xsl);//Détruit l'analyseur XSLT
153
unset($xsl);//Détruit l'analyseur XSLT
150
//unset($inputDom);
154
unset($inputDom);
151
// Fin pour PHP 5
155
// Fin pour PHP 5