simplexml_load_string and child nodes

clarenceblack

New Member
I am trying to get the information out of an xml string and view the child nodes in it. I am using:\[code\]'Title' => $current->AttributeSets->children('ns2')->ItemAttributes->Title,\[/code\]in an array where $current \[code\]$current = $parsed_xml->ListMatchingProductsResponse->ListMatchingProductsResult->Products->Product;\[/code\]the namespace is ns2 and the children are ItemAttributes and Title. When I run this I get no information where the title should be. Here is the response when I run the script:\[code\]SimpleXMLElement Object()\[/code\]Can anyone point me in the right direction please? I have looked at the other posts and have tried to use their examples but they are not working for me.Here is the XML:\[code\] <?xml version="1.0"?><ListMatchingProductsResponse xmlns="http://mws.amazonservices.com/schema/Products/2011-10-01"><ListMatchingProductsResult><Products xmlns="http://mws.amazonservices.com/schema/Products/2011-10-01" xmlns:ns2="http://mws.amazonservices.com/schema/Products/2011-10-01/default.xsd"><Product><AttributeSets><ns2:ItemAttributes xml:lang="en-US"><ns2:Title>JavaScript: The Missing Manual</ns2:Title>\[/code\]
 
Back
Top