Parse XML file with Simple XML and xpath



I'm trying to obtain the values of the nodes "/entry/comment[type="subcellular location"]/subcellularLocation/location" from this file http://ift.tt/1x7ww5o


I'm using SimpleXML and xpath but I can't access to this nodes with:


$var = "http://ift.tt/1x7ww5o"; $Unip_result= new SimpleXMLElement($var, NULL, TRUE);


$value=$Unip_result->xpath("/entry/comment[@type='subcellular location']");


The result is an empty array...


No comments:

Post a Comment