I am using the DOM XML functions in PHP 4.2.2, and I have not had any luck returning a DOMElement object using the get_element_by_id() function.
If I have some XML in "stuff.xml":
<?xml version="1.0"?>
<messages>
<error id="E001">content</error>
</messages>
Then shouldn't the following code return the "error" node as a DOMElement object??
$doc = domxml_open_file("stuff.xml");
$node = $doc->get_element_by_id("E001");
This is actually not returning ANYTHING!
I know that I can use XPath Contexts, using the XPath expression, "//*[@id='E001']", and I have gotten it to work this way, but it would just be nice to retrieve elements with the get_element_by_id() function.
Any ideas??
Thanks.