PHP XML AND XSL Mystery

XML, Perl, Python, and other languages can be discussed here, even if it isn't PHP (We might forgive you).

Moderator: General Moderators

Post Reply
irishdude1
Forum Newbie
Posts: 1
Joined: Thu Jun 05, 2008 6:16 am

PHP XML AND XSL Mystery

Post 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
User avatar
arjan.top
Forum Contributor
Posts: 305
Joined: Sun Oct 14, 2007 4:36 am
Location: Hoče, Slovenia

Re: PHP XML AND XSL Mystery

Post by arjan.top »

the error is clear, you must use php DOM not simpleXML to open xml files
Post Reply