kendhal Posted September 18, 2008 Share Posted September 18, 2008 Folks, This is driving me crazy. I have PHP5.2.6 running on linux and have DOM enabled as shown below in my phpinfo call: DOM/XML enabled DOM/XML API Version 20031129 libxml Version 2.6.32 HTML Support enabled XPath Support enabled XPointer Support enabled Schema Support enabled RelaxNG Support enabled I have also checked ith "php -i | grep configure" and everything seems to be in place but The simple PHP code below gives me the following error: "Fatal error: Call to undefined method DOMNodeList::getElementsByTagName()" $dom = new DomDocument(); $dom->load("articles.xml"); $titles = $dom->getElementsByTagName("title"); foreach($titles as $node) { print $node->textContent . " "; } Can anyone shed some light on this? Thanks a ton. KD Quote Link to comment https://forums.phpfreaks.com/topic/124775-cant-seem-to-get-dom-enabled-on-php5/ Share on other sites More sharing options...
JonnoTheDev Posted September 18, 2008 Share Posted September 18, 2008 The getElementsByTagName() method must be obsolete in your version of DOM. Check the methods list for your version. Quote Link to comment https://forums.phpfreaks.com/topic/124775-cant-seem-to-get-dom-enabled-on-php5/#findComment-644646 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.