XSLTProcessor->transformToDoc()
Transform to a DOMDocument
&reftitle.description;
XSLTProcessor
DOMDocument
transformToDoc
DOMNodedoc
Transforms the source node to a DOMDocument applying
the stylesheet given by the method.
&reftitle.parameters;
doc
The node to be transformed.
&reftitle.returnvalues;
The resulting DOMDocument or &false; on error.
&reftitle.examples;
Transforming to a DOMDocument
load('collection.xml');
$xsl = new DOMDocument;
$xsl->load('collection.xsl');
// Configure the transformer
$proc = new XSLTProcessor;
$proc->importStyleSheet($xsl); // attach the xsl rules
echo trim($proc->transformToDoc($xml)->firstChild->wholeText);
?>
]]>
&example.outputs;
&reftitle.seealso;