XSLTProcessor->transformToXML()
Transform to XML
&reftitle.description;
XSLTProcessor
string
transformToXML
DOMDocumentdoc
Transforms the source node to a string applying the stylesheet given by
the method.
&reftitle.parameters;
doc
The transformed document.
&reftitle.returnvalues;
The result of the transformation as a string or &false; on error.
&reftitle.examples;
Transforming to a string
load('collection.xml');
$xsl = new DOMDocument;
$xsl->load('collection.xsl');
// Configure the transformer
$proc = new XSLTProcessor;
$proc->importStyleSheet($xsl); // attach the xsl rules
echo $proc->transformToXML($xml);
?>
]]>
&example.outputs;
Fight for your mindby Ben Harper - 1995
Electric Ladyland
by Jimi Hendrix - 1997
]]>
&reftitle.seealso;