XML + Xslt -> Xml with PHP
- by rokdd
Hi,
I know that there are really a mass of XML XSLT php merging threads at SO. But php specific i could not found what might my problem:
$xml = new DOMDocument;
$xml-load("f.xml");
$xsl = new DOMDocument;
$xsl-load('test.xsl');
// init and configure processor
$proc = new XSLTProcessor;
$proc-importStyleSheet($xsl); // import xsl document
$xml2=$proc-transformToXML($xml);
echo $xml2;
My xslt file looks a bit empty.. However i tried ´output method="xml"´. but it doesnot help..
PHP returns always the data as text or html but not in XML.. what i am doing wrong. I only want to edit the XML with xslt and save back to XML (file).
THanks for your help!