IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Bibliothèques et frameworks PHP Discussion :

[DOM] Problème de transformation XML sur un serveur web


Sujet :

Bibliothèques et frameworks PHP

  1. #1
    Membre à l'essai
    Profil pro
    Inscrit en
    Novembre 2009
    Messages
    7
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Novembre 2009
    Messages : 7
    Points : 10
    Points
    10
    Par défaut [DOM] Problème de transformation XML sur un serveur web
    Bonjour,

    (Merci de déplacer mon message si je ne suis pas sur le bon forum)
    Je m'adresse à vous car j'ai un problème concernant la génération automatique de fichiers html sur le serveur web par le processeur XSLT de PHP.

    J'ai été chargé d'améliorer l'affichage d'un site web en modifiant les CSS et la XSLT, de plus on m'a demandé de séparer en deux sites distincts les deux sous projets (Marillac et Patin). Ce que j'ai fait en supprimant en dupliquant l'ensemble du répertoire et en supprimant dans chacun l'un des sous dossiers.

    Je pensais que j'avais bien fait car sur mon serveur local (Wampserver dernière version sous Windows 7), la génération automatique des fichiers HTML se fait sans problème mais sur le serveur web (Apache/2.2.17 (Linux/SUSE), rien ne se passe, j'ai juste la page d'accueil mais quand on clique sur les liens, les fichiers html ne sont pas générés.

    Le problème semble venir du fichier PHP permettant la création des fichiers html tei2html.php qui est à la racine du répertoire

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    <?php
     
    ini_set('display_errors', 'Off');
     
    $cachedir = 'data/'.dirname($_REQUEST['file']).'/xhtml';
    if(!is_dir($cachedir)) mkdir($cachedir);
     
    $cachepath = $cachedir .'/'. basename($_REQUEST['file']);
     
    if(!file_exists($cachepath)
       || array_key_exists('regenerate', $_GET)
       || filemtime('data/'.$_REQUEST['file']) > (filemtime($cachepath))) {
     
    	$xml = new DOMDocument;
    	$xml->load('data/'.$_REQUEST['file']);
     
    	$xsl = new DOMDocument;
    	$xsl->load('data/projetsimple.xsl');
     
    	$proc = new XSLTProcessor;
    	$proc->importStyleSheet($xsl);
     
    	$html = str_replace('href="../../', 'href="', $proc->transformToXML($xml));
    	$html = str_replace('&lt;!-- xsl-escape-lt --&gt;&lt;', '<', $html);
    	$html = str_replace('&gt;&lt;!-- xsl-escape-gt --&gt;', '>', $html);
    	$html = str_replace('src="../../', 'src="', $html);
     
    	file_put_contents($cachepath, $html);
    }
     
    header('Content-type: text/html; charset=UTF-8;');
    echo file_get_contents($cachepath);
     
    ?>
    Sur le serveur web, le message d'erreur est le suivant:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    PHP Warning:  
    file_put_contents(data/marillac/xhtml/BSG_Tabmat_Preface.xml): failed to open 
    stream: Permission denied in 
    /srv/www/htdocs/static/centres/grihl/edition_tei/vie_de_marillac/tei2xhtml.php 
    on line 28, referer: 
    http://www.ehess.fr/centres/grihl/edition_tei/vie_de_marillac/index.html
    [Thu Jan 09 12:27:20 2014] [error] [client 193.48.45.119] PHP Warning:  
    file_get_contents(data/marillac/xhtml/BSG_Tabmat_Preface.xml): failed to open 
    stream: No such file or directory in 
    /srv/www/htdocs/static/centres/grihl/edition_tei/vie_de_marillac/tei2xhtml.php 
    on line 32, referer: 
    http://www.ehess.fr/centres/grihl/edition_tei/vie_de_marillac/index.html
    Ce fichier est censé créer les fichiers dans le répertoire \vie_de_marillac\data\marillac\xhtml à partir de fichiers XML qui sont dans le répertoire parent: \vie_de_marillac\data\marillac

    Autant sur WampServer la transformation se fait sans problème, autant sur le serveur web, rien n'est généré

    Mais peut-être que le problème vient du fait que, pour séparer les deux dossiers, j'ai mis en commentaire une partie du fichier \vie_de_marillac\data\folder.js

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
     
    var folders = [
                      {"title": "Marillac", "path": "marillac", "uri": "http://www.ehess.fr/grihl/edition_tei/vie_de_marillac/", "index": "marillac_index.xml", "pers": "marillac_listpersonnes.xml", "interp": "marillac_interpretation.xml", "biblio": "marillac_listbiblio.xml", "parts": [
     
                          {"title": "Pièces liminaires", "versions":
                            [{"title": "1. Bibliothèque Sainte-Geneviève", "path": "BSG_Tabmat_Preface.xml"},
                             {"title": "2. Bibliothèque Nationale", "path": "BNF_Tabmat_Preface.xml"}]},
     
                          {"title": "Généalogie, ch.1", "versions":
                            [{"title": "1. Bibliothèque Sainte-Geneviève", "path": "BSG_chap_01_genealogie.xml"},
                             {"title": "2. Bibliothèque Nationale", "path": "BNF_chap_01_genealogie.xml"}]},
     
                          {"title": "Offices et commissions, ch.2", "versions":
                            [{"title": "1. Bibliothèque Sainte-Geneviève", "path": "BSG_chap_02_offices.xml"},
                             {"title": "2. Bibliothèque Nationale", "path": "BNF_chap_02_offices.xml"}]},
     
                          {"title": "Loi salique, ch. 3", "versions":
                            [{"title": "1. Bibliothèque Sainte-Geneviève", "path": "BSG_chap_03_loisalique.xml"},
                             {"title": "2. Bibliothèque Nationale", "path": "BNF_chap_03_loisalique.xml"}]},
     
                          {"title": "Sainte conversation, ch. 4", "versions":
                            [{"title": "1. Bibliothèque Sainte-Geneviève", "path": "BSG_chap_04_conversation.xml"},
                             {"title": "2. Bibliothèque Nationale", "path": "BNF_chap_04_conversation.xml"}]},
     
                          {"title": "Désintéressement, ch. 5", "versions":
                            [{"title": "1. Bibliothèque Sainte-Geneviève", "path": "BSG_chap_05_richesses.xml"},
                             {"title": "2. Bibliothèque Nationale", "path": "BNF_chap_05_richesses.xml"}]},
     
                          {"title": "Modestie, ch. 6", "versions":
                            [{"title": "1. Bibliothèque Sainte-Geneviève", "path": "BSG_chap_06_gloire.xml"},
                             {"title": "2. Bibliothèque Nationale", "path": "BNF_chap_06_gloire.xml"}]},
     
    		              {"title": "Détachement, ch. 7", "versions":
                            [{"title": "1. Bibliothèque Sainte-Geneviève", "path": "BSG_chap_07_consolation.xml"},
                             {"title": "2. Bibliothèque Nationale", "path": "BNF_chap_07_consolation.xml"}]},
     
    		              {"title": "Confiance en Dieu, ch. 8", "versions":
                            [{"title": "1. Bibliothèque Sainte-Geneviève", "path": "BSG_chap_08_dependance.xml"},
                             {"title": "2. Bibliothèque Nationale", "path": "BNF_chap_08_dependance.xml"}]},
     
    		              {"title": "Piété et dévotion, ch. 9", "versions":
                            [{"title": "1. Bibliothèque Sainte-Geneviève", "path": "BSG_chap_09_devotion.xml"},
                             {"title": "2. Bibliothèque Nationale", "path": "BNF_chap_09_devotion.xml"}]},
     
    		              {"title": "Protection des carmélites, ch. 10", "versions":
                            [{"title": "1. Bibliothèque Sainte-Geneviève", "path": "BSG_chap_10_larochelle.xml"},
                             {"title": "2. Bibliothèque Nationale", "path": "BNF_chap_10_larochelle.xml"}]},
     
                          {"title": "Mortifications, ch. 11", "versions":
                            [{"title": "1. Bibliothèque Sainte-Geneviève", "path": "BSG_chap_11_mortifications.xml"},
                             {"title": "2. Bibliothèque Nationale", "path": "BNF_chap_11_mortifications.xml"}]},
     
                          {"title": "Capacité d'esprit, ch. 12", "versions":
                            [{"title": "1. Bibliothèque Sainte-Geneviève", "path": "BSG_chap_12_capacite.xml"},
                             {"title": "2. Archives Nationales", "path": "AN_chap_12_capacite.xml"},
                             {"title": "3. Bibliothèque Nationale", "path": "BNF_chap_12_capacite.xml"}]},
     
                          {"title": "Justice, ch. 13", "versions":
                            [{"title": "1. Bibliothèque Sainte-Geneviève", "path": "BSG_chap_13_justice.xml"},
                             {"title": "2. Archives Nationales", "path": "AN_chap_13_justice.xml"},
                             {"title": "3. Bibliothèque Nationale", "path": "BNF_chap_13_justice.xml"}]},
     
                          {"title": "Ordonnance de 1629, ch. 14", "versions":
                            [{"title": "1. Bibliothèque Sainte-Geneviève", "path": "BSG_chap_14_ordonnance.xml"},
                             {"title": "2. Archives Nationales", "path": "AN_chap_14_ordonnance.xml"},
                             {"title": "3. Bibliothèque Nationale", "path": "BNF_chap_14_ordonnance.xml"}]},
     
                          {"title": "Changements politiques, ch. 15", "versions":
                            [{"title": "1. Bibliothèque Sainte-Geneviève", "path": "BSG_chap_15_consideration.xml"},
                             {"title": "2. Archives Nationales", "path": "AN_chap_15_consideration.xml"},
                             {"title": "3. Bibliothèque Nationale", "path": "BNF_chap_15_consideration.xml"}]},
     
                          {"title": "De ses amis, ch. 16", "versions":
                            [{"title": "1. Bibliothèque Sainte-Geneviève", "path": "BSG_chap_16_amys.xml"},
                             {"title": "2. Archives Nationales", "path": "AN_chap_16_amys.xml"},
                             {"title": "3. Bibliothèque Nationale", "path": "BNF_chap_16_amys.xml"}]},
     
                          {"title": "Peu d'attachement à sa charge, ch. 17", "versions":
                            [{"title": "1. Bibliothèque Sainte-Geneviève", "path": "BSG_chap_17_attachement.xml"},
                             {"title": "2. Archives Nationales", "path": "AN_chap_17_attachement.xml"},
                             {"title": "3. Bibliothèque Nationale", "path": "BNF_chap_17_attachement.xml"}]},
     
                          {"title": "Remise des sceaux, ch. 18", "versions":
                            [{"title": "1. Bibliothèque Sainte-Geneviève", "path": "BSG_chap_18_renditsceaux.xml"},
                             {"title": "2. Archives Nationales", "path": "AN_chap_18_renditsceaux.xml"},
                             {"title": "3. Bibliothèque Nationale", "path": "BNF_chap_18_renditsceaux.xml"}]},
     
                          {"title": "Mémoire, ch. 19", "versions":
                            [{"title": "1. Bibliothèque Sainte-Geneviève", "path": "BSG_chap_19_memoires.xml"},
                             {"title": "2. Archives Nationales", "path": "AN_chap_19_memoires.xml"},
                             {"title": "3. Bibliothèque Nationale", "path": "BNF_chap_19_memoires.xml"}]},
     
                          {"title": "Séjour à Chateaudun, ch. 20", "versions":
                            [{"title": "1. Bibliothèque Sainte-Geneviève", "path": "BSG_chap_20_chasteaudun.xml"},
                             {"title": "2. Archives Nationales", "path": "AN_chap_20_chasteaudun.xml"},
                             {"title": "3. Bibliothèque Nationale", "path": "BNF_chap_20_chasteaudun.xml"}]},
     
                          {"title": "Décès, ch. 21", "versions":
                            [{"title": "1. Bibliothèque Sainte-Geneviève", "path": "BSG_chap_21_deces.xml"},
                             {"title": "2. Archives Nationales", "path": "AN_chap_21_deces.xml"},
                             {"title": "3. Bibliothèque Nationale", "path": "BNF_chap_21_deces.xml"}]},
     
                          {"title": "Sépulture, ch. 22", "versions":
                            [{"title": "1. Bibliothèque Sainte-Geneviève", "path": "BSG_chap_22_sepulture.xml"},
                             {"title": "2. Archives Nationales", "path": "AN_chap_22_sepulture.xml"},
                             {"title": "3. Bibliothèque Nationale", "path": "BNF_chap_22_sepulture.xml"}]},
     
                          {"title": "Grâces spéciales, ch. 24", "versions":
                            [{"title": "1. Bibliothèque Sainte-Geneviève", "path": "BSG_chap_24_graces.xml"},
                             {"title": "2. Archives Nationales", "path": "AN_chap_24_graces.xml"},
                             {"title": "3. Bibliothèque Nationale", "path": "BNF_chap_24_graces.xml"}]},
     
                          {"title": "Preuves de sa dévotion, ch. 25", "versions":
                            [{"title": "1. Bibliothèque Sainte-Geneviève", "path": "BSG_chap_25_autorites.xml"},
                             {"title": "2. Archives Nationales", "path": "AN_chap_25_autorites.xml"},
                             {"title": "3. Bibliothèque Nationale", "path": "BNF_chap_25_autorites.xml"}]}
     
     
     
                      ]}
     
                      /*{"title": "Patin", "path": "patin", "uri": "http://www.ehess.fr/centres/grihl/", "index": "patin_index.xml", "pers": "patin_listpersonnes.xml", "biblio": "patin_listbiblio.xml", "parts": [
     
                          {"title": "Patin", "versions":
                            [{"title": "Patin", "path": "patin-01.xml"}]}
                      ]}*/
                  ]
    Comme je sens que ce n'est pas très clair, j'ajoute en pièces jointes les fichiers index.html et index_get.php qui sont à la racine du répertoire.


    Je vous remercie de votre aide
    Fichiers attachés Fichiers attachés

  2. #2
    Membre à l'essai
    Profil pro
    Inscrit en
    Novembre 2009
    Messages
    7
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Novembre 2009
    Messages : 7
    Points : 10
    Points
    10
    Par défaut
    Bonjour,

    Si personne ne répond à mon message, c'est qu'il n'est pas clair ou qu'il manque d'informations? Merci de me le préciser

Discussions similaires

  1. Récupération de balise XML sur un serveur web.
    Par corgato dans le forum Débuter
    Réponses: 8
    Dernier message: 23/12/2008, 08h34
  2. [DOM XML] Enregistrer un fichier XML sur un serveur ftp
    Par scorpion1611 dans le forum Bibliothèques et frameworks
    Réponses: 2
    Dernier message: 12/09/2007, 15h33
  3. [AJAX] probleme appelle page XML sur autre serveur
    Par ldcarpathes dans le forum Général JavaScript
    Réponses: 1
    Dernier message: 14/08/2006, 18h35
  4. [XSLT] Problème de transformation XML avec un fichier xslt
    Par seb35 dans le forum Format d'échange (XML, JSON...)
    Réponses: 2
    Dernier message: 24/04/2006, 22h02
  5. Utiliser un fichier XML sur un serveur FTP
    Par ired dans le forum Bases de données
    Réponses: 1
    Dernier message: 06/04/2005, 13h43

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo