Hi,
This (DOM) display the data stored in XML formatted with a XSL file. Ik works fine.
$xslDoc = new DOMDocument();
$xslDoc->load("bookstore.xsl");
$xmlDoc = new DOMDocument();
$xmlDoc->load("bookstore.xml");
$proc = new XSLTProcessor();
$proc->importStylesheet($xslDoc);
echo $proc->transformToXML($xmlDoc);
I want to do it with (simplexml) with also including XSL. Code below displays but without XSL formated. How can add XSL as well.
Thanks
$xmlObject=simplexml_load_file("bookstore.xml");
foreach ($xmlObject->book as $theBook) {
$isbn=$theBook->isbn;
$title=$theBook->title;
$price=$theBook->price;
$author=$theBook->author->first_name.$theBook->author->surname;
$picture=$theBook->coverpic;
unset($title);
unset($author);
unset($publisher);
unset($city);
unset($year);
}
?>