Merlin wrote:

Hi there,

I think I am parsing xml documents the wrong way.
There must be a better way to access the results laterone like objects.

For example I would like to search in a free form for a city name
inside an xml document and php should return the country name
and continent.

This is the xml structure:
<Country size="4">
    <countryName>Andorra</countryName>
    <countryCode>AD</countryCode>
    <countryContinent>Europe</countryContinent>
    <Cities size="4">
        <city>Encamp</city>
        <city>Escaldes-Engordany</city>
        <city>Ordino</city>
        <city>Soldeu</city>
    </Cities>
</Country>

Has anybody a good hint for me?

Thanx in advance,

Merlin

I created this class a short while ago that parses all of your XML into an easily usable Associative array structure. It extends PEAR::XML_Parse, so you need that as well.


http://reversefold.com/~papercrane/XML_Parser_Assoc/Assoc.phps
http://pear.php.net/package/XML_Parser

--
paperCrane <Justin Patrin>

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to