Page 1 of 1

PHP XML AND XSL Mystery

Posted: Thu Jun 05, 2008 6:22 am
by irishdude1
Hi I'm new to this forum and I am hoping someone here can help with my query.

I'm getting this error:

Catchable fatal error: Argument 1 passed to XSLTProcessor::importStylesheet() must be an instance of DOMDocument, instance of SimpleXMLElement given in portfolio.php on line 39

I stumped on what this error means. My code is below, can anyone lead me in the right direction? THANKS!

PHP

Code: Select all

 
$portfolio = simplexml_load_file('includes/portfolio.xml');
$xsl = simpleXML_load_file('includes/portfolio.xsl');
$proc = new XsltProcessor();
$proc->importStylesheet($xsl); <-- THIS IS LINE 39
 
My XML can be found here: http://www.ican.ie/html/includes/portfolio.xml

Re: PHP XML AND XSL Mystery

Posted: Thu Jun 05, 2008 8:43 am
by arjan.top
the error is clear, you must use php DOM not simpleXML to open xml files