Well, the time has come for me to ask another question, I hope someone can help.
Here's the deal, I need to read a specific node from an XML message that is stored in a string. I figure XMLReader is the way to go.
I know that the node in question will contain either 'True' or 'False' which is perfect for my project.
Here's my code
I know the response has a node in it called 'Message' but I can't seem to get the value out of it.
I have run the return through intVal() which for true should return 1, but even when I know the XML node contains 'True' the return is always false.
I hope that makes sense, and I hope someone can help me.
Cheers
nathj
Here's the deal, I need to read a specific node from an XML message that is stored in a string. I figure XMLReader is the way to go.
I know that the node in question will contain either 'True' or 'False' which is perfect for my project.
Here's my code
Code:
$this->lcNZResponse = $loRequest->getResponseBody();
$loXMLReader = new XMLReader() ;
$loXMLReader->xml($this->lcNZResponse) ;
$lcTestString = $loXMLReader->getAttribute("Message") ;
if(strToLower($lcTestString) == "true")
{
$llReturn = true ;
}
return $llReturn ;
I have run the return through intVal() which for true should return 1, but even when I know the XML node contains 'True' the return is always false.
I hope that makes sense, and I hope someone can help me.
Cheers
nathj
Comment