The very first task is to choose XML parser that will be used as a foundation of the KML driver. There are many questions that have to be answered:
- SAX or DOM?
- provide XML validation for KML documents (mandatory, optional, none)?
There are 4 XML parsers under our consideration:
Here is very detailed comparison (made in 2003) of XML parsing libraries that may be helpful during the analysis.
|Validating||no||yes||no||yes (w/o reparsing)|
|Used in GDAL part||OGDI||GML, ILI||many places||not yet|
* Google avoids Xerces because it considers it to be insecure in the face of hostile XML documents, but considers Expat safe. Presumably based on an indepth security review.
SAX or DOM
Which technic should be used for reading the KML files?
- I (Jens) guess SAX would be best, because of the memory consumption of DOM
- SAX is more complex to use in case of KML
I will use expat, because of the decision for SAX, the speed and it is more secure than Xerces.