<?
$xml_mess='<?xml version="1.0" encoding="iso-8859-1" ?>
<index>
</index>';
//echo $xml_mess;
// Nouvelle instance
$xslt = new XSLTProcessor();
// Chargement du fichier XML
$xml = new domDocument();
$xml->loadXML($xml_mess);
// Chargement du fichier XSL
$xsl = new domDocument();
$xsl -> load('XSL/index.xsl');
// Import de la feuille XSL
$xslt -> importStylesheet($xsl);
echo $xslt->transformToXml($xml);
?>
le index.xsl:Code : Tout sélectionner
<?xml version="1.0" encoding="iso-8859-1"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output indent="yes" method="html" omit-xml-declaration="no" encoding="iso-8859-1" />
<xsl:template match="/">
<img src="IMAGES/SITE/portrait.png" alt="Bienvenue !" id="portrait" />
</xsl:template>
</xsl:stylesheet>Au final sa me donne :
<img src="IMAGES/SITE/portrait.png" alt="Bienvenue !" id="portrait">
Du coup tout mon code n'est plus valide W3C... QQ'un peut il m'expliquer pk le xsl fait sauter la fermeture de mes balises (ca le fait sur d'autres balises que image)