Hey David,

There's quite a few ways to get th data you're asking. If you're using
PHP5 you can use SimpleXML (http://us2.php.net/simplexml) which would
be really straight forward. Somewhere along the lines of  $xml-
>Response->Placemark->Point->coordinates or if you feel like using
xpath something like /Response/Placement/Point/coordinates could do
the trick...

My XML is a little rusty and nothing is tested, but I'm sure you can
figure it out from here.

Take care,
Bill

On May 4, 2:54 am, David <[EMAIL PROTECTED]> wrote:
> Hey folks,
>
> I'm fairly new to Cake, so bear with me. My question is about Cake's
> XML class:
>
> Specifically, I'm trying to parse an XML file like this:
>
> <kml>
>   <Response>
>     <name>723 Chestnut Street, Philadelphia, PA 19106</name>
>     <Status>
>       <code>200</code>
>       <request>geocode</request>
>     </Status>
>     <Placemark id="p1">
>       <address>723 Chestnut St, Philadelphia, PA 19106, USA</address>
>       <AddressDetails Accuracy="8">
>         <Country>
>           <CountryNameCode>US</CountryNameCode>
>           <AdministrativeArea>
>             <AdministrativeAreaName>PA</AdministrativeAreaName>
>             <Locality>
>               <LocalityName>Philadelphia</LocalityName>
>               <Thoroughfare>
>                 <ThoroughfareName>723 Chestnut St</ThoroughfareName>
>               </Thoroughfare>
>               <PostalCode>
>                 <PostalCodeNumber>19106</PostalCodeNumber>
>               </PostalCode>
>             </Locality>
>           </AdministrativeArea>
>         </Country>
>       </AddressDetails>
>       <Point>
>         <coordinates>-75.153277,39.949768,0</coordinates>
>       </Point>
>     </Placemark>
>   </Response>
> </kml>
>
> Trick is I only want the coordinates. I'm also somewhat new to working
> with XML, so I might be missing something completely obvious here.
>
> Anywho, I can get the XML to load fine with $feed =& new XML($url);
>
> I just can't figure out how to parse it and get to that one piece of
> data.
>
> You're help is greatly appreciated. Thanks in advance.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to