I am new to DOM XML and all the functions associated with it:
([url]http://ca.php.net/manual/en/function.domnode-get-content.php
Currently, I am trying to use the following code:
[CODE]$responseXml = file_get_contents(‘http://www.webservicex.net/stockquote.asmx/GetQuote?symbol=LU’);
echo ($responseXml . ‘<br>’);
$responseDoc = domxml_open_mem($responseXml);
$root = $responseDoc->document_element();
$node_array = $root->get_elements_by_tagname(“Stock”);
$symbol = $node_array->get_elements_by_tagname(“Symbol”);
echo ($symbol[0]->get_content());
I am getting the following error:
“Fatal error: Call to a member function on a non-object in “
regarding the following code: “echo ($symbol[0]->get_content());”
Am I incorrectly creating the $responseDoc?
Any help would be appreciated…
Regards
I. Jamal