P
P
pavlov_eugene2011-01-24 10:46:42
PHP
pavlov_eugene, 2011-01-24 10:46:42

Why is there a conflict between the DomDocument and DomElement classes?

I am writing an XML document parser in php using the DomXml module.
For this I used the DomElement function class. Killed a whole day to figure it out, but did it. True, for this I had to uncomment the extension=php_domxml.dll line in the php.ini file.
The code is like this:
...
if(!$dom = domxml_open_mem($xmlstr)) {
echo "Error parsing document\n";
exit;
}
$root = $dom->document_element();
$nodes = $root->child_nodes();

What exactly is the problem. For the site being developed on another page, I used a ready-made Twitter feed parser, which uses the DomDocument function class for parsing.
The code is like this:
...
$feedURL = "twitter.com/statuses/user_timeline/yourtwitteruser... »;
$doc = new DOMDocument();
$doc->load($feedURL);
$arrFeeds = array();

So, after I uncommented the extension=php_domxml.dll line in the php.ini file, the parser for the tweeter stopped working. If it is commented out again, then the parser for the DomElement function class stops working.
I noticed that the parser for twitter does not work only when I have already written my own parser for my xml document. Now I don't know how to get out of the situation.
What is the problem? Or have I got it all wrong or am I missing something? Why conflict?
upd
For Wirth. I use XAMPP servers. Apache/2.2.3. PHP/5.1.6.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
pavlov_eugene, 2011-01-24
@pavlov_eugene

Answer found.
This is what happens when you use someone else's code (in the case of a twitter feed parser) and write your own.
Here he writes that these two classes (extensions) are incompatible - that's why they conflict. And without knowing this, I wrote the code for php4 ... We will rewrite)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question