Salut
mon fichier php http://flandriac.free.fr/xsl/xslalo1.php?filxml=alo.xml
fonctionne en utilisant mon xsltalo2.xsl duquel j'ai pu solutionner mon pb de name space
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
<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- Edited by XMLSpy® -->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns="http://www.allocine.net/v6/ns/">
<xsl:template match="/">
  <html>
  <body>
  <h2>My CD Collection</h2>
    <table border="1">
      <tr bgcolor="#9acd32">
        <th>Title</th>
        <th>productionYear</th>
        <th>code</th>
      </tr>
      <xsl:for-each select="ns:movie">
      <tr>
        <td><xsl:value-of select="ns:title"/></td>
        <td><xsl:value-of select="ns:productionYear"/></td>
        <td><xsl:value-of select="ns:casting/ns:castMember/ns:person/@code" /></td>
      </tr>
      </xsl:for-each>
    </table>
  </body>
  </html>
</xsl:template>
</xsl:stylesheet>
En revanche avec
http://flandriac.free.fr/xsl/xslalo1...arge&version=2
j'ai l'erreur
Warning: Sablotron error on line 1: XML parser error 4: not well-formed (invalid token) in /mnt/160/sda/1/3/flandriac/xsl/xslalo1.php on line 8
Pourtant les deux fichiers xml ont le même contenu
Vous pouvez vérifier mes fichiers sont en ligne.
Pour info mon xslalo1.php est comme ceci:
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
  <?
// Crée le processeur XSLT
$xh = xslt_create();
xslt_set_base ($xh, 'file://' . getcwd () . '/');
if ($filxml==""){$filxml='http://api.allocine.fr/xml/movie?code=182097&media=mp4-lc&partner=YW5kcm9pZC12Mg&profile=large&version=2';}
//if ($filxml==""){$filxml='alo.xml';}
// Traite le document, puis affiche le résultat
$result = xslt_process($xh, $filxml, 'xsltalo2.xsl');
if (!$result)
  echo ("Erreur XSLT ...". $filxml);
else
  echo ($result);
 
// Détruit le processeur XSLT
xslt_free($xh);
?>
Merci de votre aide, je progresse