I have an XML Structure, like I have outline below. I am trying to use xPath to find particular elements within the structure, but have been unsuccessful. This is what I have thus far:
$resultset[0]['bibXML'] - Here is a paste of exactly what is being passed in this variable. http://pastebin.com/CwtFG5dj
Here is a link to the output of the $myNode using print_r(). http://pastebin.com/TwDaxs42
$myNode = new SimpleXMLElement($resultset[0]['bibXML']);
$bnum = $myNode->xpath("record/datafield[@tag='035']/subfield[@code='a']");
<?xml version="1.0" encoding="UTF-8"?>
<collection xmlns="http://www.loc.gov/MARC21/slim">
<record>
<leader>01220nam 2200265 4500</leader>
<controlfield tag="001">ocm00000197</controlfield>
<datafield tag="035" ind1="" ind2="">
<subfield code="a">.b10000021</subfield>
<subfield code="b">a </subfield>
<subfield code="c">-</subfield>
</datafield>
<datafield tag="245" ind1="" ind2="">
<subfield code="a">Some Book Title</subfield>
<subfield code="b">a </subfield>
<subfield code="c">-</subfield>
</datafield>
</record>
</collection>