Xml düğümleri erişen SimpleXML sorunlar

0 Cevap php

i, belirli bir xml dosyası düğümleri erişimde ciddi sorunlar var:

http://write.fm/cqsmrf5

print_r i aşağıdaki sonucu alırsınız:

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.

0 Cevap