我有一个XML提要,我需要从其中解析一些内容并将其存储到MySQL表中,但是我面临着一种新的XML(我不擅长此事),这是我正在获取的XML。正在使用来自此地址的simplexml_load_file打开: 这是出版的期刊出版物,我需要存储作者列表和其他一些内容,但是提示了如何进行管理。 非常感谢

  SimpleXMLElement Object
 (
 [DocSum] => SimpleXMLElement Object
    (
        [Id] => 22064119
        [Item] => Array
            (
                [0] => 2011 Dec
                [1] => SimpleXMLElement Object
                    (
                        [@attributes] => Array
                            (
                                [Name] => EPubDate
                                [Type] => Date
                            )

                    )

                [2] => Clin Nucl Med
                [3] => SimpleXMLElement Object
                    (
                        [@attributes] => Array
                            (
                                [Name] => AuthorList
                                [Type] => List
                            )

                        [Item] => Array
                            (
                                [0] => Jackson TA
                                [1] => Choong KW
                                [2] => Eng JA
                                [3] => McAneny D
                                [4] => Subramaniam RM
                                [5] => Knapp PE
                            )

                    )

                [4] => Knapp PE
                [5] => F-18 FDG PET/CT Imaging of Endogenous Cushing Syndrome.
                [6] => 36
                [7] => 12
                [8] => e231-2
                [9] => SimpleXMLElement Object
                    (
                        [@attributes] => Array
                            (
                                [Name] => LangList
                                [Type] => List
                            )

                        [Item] => English
                    )

                [10] => 7611109
                [11] => 0363-9762
                [12] => 1536-0229
                [13] => SimpleXMLElement Object
                    (
                        [@attributes] => Array
                            (
                                [Name] => PubTypeList
                                [Type] => List
                            )

                        [Item] => Journal Article
                    )

                [14] => PubMed - in process
                [15] => ppublish
                [16] => SimpleXMLElement Object
                    (
                        [@attributes] => Array
                            (
                                [Name] => ArticleIds
                                [Type] => List
                            )

                        [Item] => Array
                            (
                                [0] => 10.1097/RLU.0b013e3182336360
                                [1] => 00003072-201112000-00044
                                [2] => 22064119
                                [3] => 22064119
                                [4] => 22064119
                            )

                    )

                [17] => 10.1097/RLU.0b013e3182336360
                [18] => SimpleXMLElement Object
                    (
                        [@attributes] => Array
                            (
                                [Name] => History
                                [Type] => List
                            )

                        [Item] => Array
                            (
                                [0] => 2011/11/09 06:00
                                [1] => 2011/11/09 06:00
                                [2] => 2011/11/09 06:00
                            )

                    )

                [19] => SimpleXMLElement Object
                    (
                        [@attributes] => Array
                            (
                                [Name] => References
                                [Type] => List
                            )

                    )

                [20] => 1
                [21] => 0
                [22] => Clinical nuclear medicine
                [23] => SimpleXMLElement Object
                    (
                        [@attributes] => Array
                            (
                                [Name] => ELocationID
                                [Type] => String
                            )

                    )

                [24] => 2011 Dec;36(12):e231-2
            )

    )

 )

===============>>#1 票数:1

您可以在这样的对象上运行XPath: $xml->xpath('/DocSum/Item/3/Item');

  ask by Gustavo Benito Silva translate from so

未解决问题?本站智能推荐: