I'm parsing a file that is set up like so:
<blah-name name="Turkey">
<blah-city name="Test"/>
<CAPS>
<type type="5">
<type-two type="6">
</CAPS>
At the top of my file, I create $xmlobj, like so:
$xmlobj = simplexml_load_file("TEST.XML");
I'm then inserting the values into a table by creating a class that takes all of these as properties:
$record->{'blah-city'}->attributes()->name;
Everything blows up when I try to dig into my capitalized XML, though:
$record->{'CAPS'}->type->attributes()->type;
My server blows up on the line above with this error:
Fatal error: Call to a member function attributes() on a non-object
and then it lists the line of the file where the above piece of code was written.
I've tried to do a var_dump($record->{'CAPS'});
and it shows that the entire structure properly exists with values intact.
Does anyone know how I could go about correcting this issue and moving forward with my work? It would be greatly appreciated!