(No version information available, might be only in CVS)
XSLTProcessor::transformToXML — Transforme en XML
Transforme le noeud source en une chaîne en y appliquant une feuille de style donnée par la méthode XSLTProcessor::importStylesheet .
Le document transformé.
Le résultat de la transformation en tant que chaîne de caractères ou FALSE si une erreur survient.
Exemple 2835. Transformation d'une chaîne
<?php
// CHargement du source XML
$xml
= new
DOMDocument
;
$xml
->
load
(
'collection.xml'
);
$xsl
= new
DOMDocument
;
$xsl
->
load
(
'collection.xsl'
);
// Configuration du transformateur
$proc
= new
XSLTProcessor
;
$proc
->
importStyleSheet
(
$xsl
);
// attachement des règles xsl
echo
$proc
->
transformToXML
(
$xml
);
?>
L'exemple ci-dessus va afficher :
Hey! Welcome to Nicolas Eliaszewicz's sweet CD collection! <h1>Fight for your mind</h1><h2>by Ben Harper - 1995</h2><hr> <h1>Electric Ladyland</h1><h2>by Jimi Hendrix - 1997</h2><hr>
XSLTProcessor::transformToDoc |
XSLTProcessor::transformToURI |