I used the following code for XSLT in php:
# LOAD XML FILE $XML = new DOMDocument(); $XML = simplexml_load_file("images/upload/source.xml");
The code is pretty simple, we need to download the source xml file and then load the stylesheet, and indeed, it really works.
The code causing the problem is the last line:
print $XML->save("newfile.xml") ;
after starting, in which I received the error "Fatal error: calling the undefined method SimpleXMLElement :: save ()". But, in fact, I followed the tutorial: http://devzone.zend.com/article/1713 .
Maybe I screwed up something, can someone tell me? thanks in advance.
Following your guys' advice, I changed the code as follows:
# LOAD XML FILE $XML = new DOMDocument(); $XML->load("images/upload/source.xml");
now correctly converted XML is displayed in the browser, I tried several ways, but still could not understand how to print this result in a file, and not show in the browser, any help is welcome, thanks in advance.
Kevin source share