0

私のXMLファイルは通常のものとは少し異なりますが、どうすればXMLを解決できますか...これは私が使用しているXMLファイルです...

<?xml version="1.0" encoding="utf-8"?>

<pma_xml_export version="1.0" xmlns:pma="http://www.phpmyadmin.net/some_doc_url/">
    <!--
    - Structure schemas
    -->
    <pma:structure_schemas>
        <pma:database name="pet shop" collation="utf8_general_ci" charset="utf8">
            <pma:table name="markers">
                CREATE TABLE `markers` (
                  `id` int(11) NOT NULL AUTO_INCREMENT,
                  `name` varchar(60) NOT NULL,
                  `address` varchar(80) NOT NULL,
                  `lat` float(10,6) NOT NULL,
                  `lng` float(10,6) NOT NULL,
                  `type` varchar(30) NOT NULL,
                  PRIMARY KEY (`id`)
                ) ENGINE=MyISAM AUTO_INCREMENT=19 DEFAULT CHARSET=utf8;
            </pma:table>
        </pma:database>
    </pma:structure_schemas>

    <!--
    - Database: 'pet shop'
    -->
    <database name="pet shop">
        <!-- Table markers -->
        <table name="markers">
            <column name="id">1</column>
            <column name="name">Pan Africa Market</column>
            <column name="address">1521 1st Ave, Seattle, WA</column>
            <column name="lat">47.608940</column>
            <column name="lng">-122.340141</column>
            <column name="type">restaurant</column>
        </table>
        <table name="markers">
            <column name="id">2</column>
            <column name="name">Buddha Thai &amp; Bar</column>
            <column name="address">2222 2nd Ave, Seattle, WA</column>
            <column name="lat">47.613590</column>
            <column name="lng">-122.344391</column>
            <column name="type">bar</column>
        </table>
        <table name="markers">
            <column name="id">3</column>
            <column name="name">The Melting Pot</column>
            <column name="address">14 Mercer St, Seattle, WA</column>
            <column name="lat">47.624561</column>
            <column name="lng">-122.356445</column>
            <column name="type">restaurant</column>
        </table>
        <table name="markers">
            <column name="id">4</column>
            <column name="name">Ipanema Grill</column>
            <column name="address">1225 1st Ave, Seattle, WA</column>
            <column name="lat">47.606365</column>
            <column name="lng">-122.337654</column>
            <column name="type">restaurant</column>
        </table>
        <table name="markers">
            <column name="id">5</column>
            <column name="name">Sake House</column>
            <column name="address">2230 1st Ave, Seattle, WA</column>
            <column name="lat">47.612823</column>
            <column name="lng">-122.345673</column>
            <column name="type">bar</column>
        </table>
        <table name="markers">
            <column name="id">6</column>
            <column name="name">Crab Pot</column>
            <column name="address">1301 Alaskan Way, Seattle, WA</column>
            <column name="lat">47.605961</column>
            <column name="lng">-122.340363</column>
            <column name="type">restaurant</column>
        </table>
        <table name="markers">
            <column name="id">7</column>
            <column name="name">Mama's Mexican Kitchen</column>
            <column name="address">2234 2nd Ave, Seattle, WA</column>
            <column name="lat">47.613976</column>
            <column name="lng">-122.345467</column>
            <column name="type">bar</column>
        </table>
        <table name="markers">
            <column name="id">8</column>
            <column name="name">Wingdome</column>
            <column name="address">1416 E Olive Way, Seattle, WA</column>
            <column name="lat">47.617214</column>
            <column name="lng">-122.326584</column>
            <column name="type">bar</column>
        </table>
        <table name="markers">
            <column name="id">9</column>
            <column name="name">Piroshky Piroshky</column>
            <column name="address">1908 Pike pl, Seattle, WA</column>
            <column name="lat">47.610126</column>
            <column name="lng">-122.342834</column>
            <column name="type">restaurant</column>
        </table>
        <table name="markers">
            <column name="id">10</column>
            <column name="name">Pan Africa Market</column>
            <column name="address">1521 1st Ave, Seattle, WA</column>
            <column name="lat">47.608940</column>
            <column name="lng">-122.340141</column>
            <column name="type">restaurant</column>
        </table>
        <table name="markers">
            <column name="id">11</column>
            <column name="name">Buddha Thai &amp; Bar</column>
            <column name="address">2222 2nd Ave, Seattle, WA</column>
            <column name="lat">47.613590</column>
            <column name="lng">-122.344391</column>
            <column name="type">bar</column>
        </table>
        <table name="markers">
            <column name="id">12</column>
            <column name="name">The Melting Pot</column>
            <column name="address">14 Mercer St, Seattle, WA</column>
            <column name="lat">47.624561</column>
            <column name="lng">-122.356445</column>
            <column name="type">restaurant</column>
        </table>
        <table name="markers">
            <column name="id">13</column>
            <column name="name">Ipanema Grill</column>
            <column name="address">1225 1st Ave, Seattle, WA</column>
            <column name="lat">47.606365</column>
            <column name="lng">-122.337654</column>
            <column name="type">restaurant</column>
        </table>
        <table name="markers">
            <column name="id">14</column>
            <column name="name">Sake House</column>
            <column name="address">2230 1st Ave, Seattle, WA</column>
            <column name="lat">47.612823</column>
            <column name="lng">-122.345673</column>
            <column name="type">bar</column>
        </table>
        <table name="markers">
            <column name="id">15</column>
            <column name="name">Crab Pot</column>
            <column name="address">1301 Alaskan Way, Seattle, WA</column>
            <column name="lat">47.605961</column>
            <column name="lng">-122.340363</column>
            <column name="type">restaurant</column>
        </table>
        <table name="markers">
            <column name="id">16</column>
            <column name="name">Mama's Mexican Kitchen</column>
            <column name="address">2234 2nd Ave, Seattle, WA</column>
            <column name="lat">47.613976</column>
            <column name="lng">-122.345467</column>
            <column name="type">bar</column>
        </table>
        <table name="markers">
            <column name="id">17</column>
            <column name="name">Wingdome</column>
            <column name="address">1416 E Olive Way, Seattle, WA</column>
            <column name="lat">47.617214</column>
            <column name="lng">-122.326584</column>
            <column name="type">bar</column>
        </table>
        <table name="markers">
            <column name="id">18</column>
            <column name="name">Piroshky Piroshky</column>
            <column name="address">1908 Pike pl, Seattle, WA</column>
            <column name="lat">47.610126</column>
            <column name="lng">-122.342834</column>
            <column name="type">restaurant</column>
        </table>
    </database>
</pma_xml_export>

では、緯度と経度を抽出するにはどうすればよいですか

4

1 に答える 1

0

6月の約束 -

プログラミング言語 (PHP) と IDE (Netbeans 7.1) についてご説明いただきありがとうございます。

あなたの最善の策は次のとおりです。

  1. PHP と XPath を使用して、XML ファイルから緯度と経度を読み取ります。

  2. PHP と PDO を使用してデータベースに保存します。

于 2012-07-03T20:01:28.203 に答える