Hello Guys, i have serious problems accessing nodes of a specific xml file:
with print_r i get the following result:
SimpleXMLElement Object
(
[RecordSet] => SimpleXMLElement Object
(
[@attributes] => Array
(
[dataSource] => testdatabase
[totalRecordCount] => 3573
)
[Record] => Array
(
[0] => SimpleXMLElement Object
(
[@attributes] => Array
(
[counter] => 1
)
[Fields] => SimpleXMLElement Object
(
[Field] => Array
(
[0] => Barcelona
[1] => 1
)
)
)
[1] => SimpleXMLElement Object
(
[@attributes] => Array
(
[counter] => 2
)
[Fields] => SimpleXMLElement Object
(
[Field] => Array
(
[0] => Cádiz
[1] => 2
)
)
)
)
)
I tried to access through the command
print $xml->recordset->record[0]->fields->field[0];
But i only get the error:
Notice: Trying to get property of non-object in /Applications/MAMP/htdocs/test.php on line 18
Could anyone help me out. Thanks in advance.