hello im coming across a few problems on loading a large kml file i was originally using cold fusion but it just cant handle the large xml/kml files
so i thought id give it a bash using php i am fairly new to php and coldfusion
so you can get the kmz file ive been working on from http://marinetraffic2.aegean.gr/ais/getkml.aspx you will have to rename it to .zip then expand it there should be a kml file in there called doc.kml change it to xml and there you go there is a Bom at the start of it i got round that on the cfhttp and type=ut-8 thingy then removing the first 3 chars
now the part i am having problems with is loading the xpaths or any queries on it
i would like to put this is to an array to work with before i put it in to a data base there colums that i need are name coordinates styleurl and descriptions
i have manged to get this but to work
$dom = new DomDocument();
$dom->load("http://localhost/testdocs/bigdoc.xml");
$titles = $dom->getElementsByTagName("coordinates");
foreach($titles as $node) {
print $node->textContent . "<br> ";
}
this will return the list of names in the xml file
but thats all of them the path that i need would be kml/Document/Folder/Placemark/ (name yada yada)
can someone with a fresh pair of eyes
the bit in cold fusion just hanged there for ages but when i tried on the same much smaller file it worked
so im new to php but that little bit of code works on the large file unlike cold fusion
okey the main problem is that xpaths queries are just not working past the /folder
i hope you can kinda understand my ramblings
thanks for your help in advanced JC