Load XML documents into a DOMDocument class and transform : XSLTProcessor « XML « PHP






Load XML documents into a DOMDocument class and transform

 
<?
    $xsl = new DOMDocument( );
    $xml = new DOMDocument( );

    $xsl->load("input.xsl");
    $xml->load("employees.xml");

    $xsltproc = new XSLTProcessor( );
    $xsltproc->importStylesheet($xsl);
    echo $xsltproc->transformToXML($xml);
?>
  
  








Related examples in the same category

1.Transforming XML to HTML with XSL
2.Transforming XML with XSL
3.Transforming XML with XSLT and PHP functions