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
Expand|Select|Wrap|Line Numbers
- $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