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)? * etc. There are 4 XML parsers under our consideration: * [http://expat.sourceforge.net/ Expat] * [http://xml.apache.org/xerces-c/index.html Xerces] * [source:trunk/gdal/port/cpl_minixml.h minixml] * [http://www.xmlsoft.org/ libXML] Here is very [http://xmlbench.sourceforge.net/results/features200303/index.html detailed comparison] (made in 2003) of XML parsing libraries that may be helpful during the analysis. ||'''Feature'''||'''Expat'''||'''Xerces'''||'''minixml'''||'''libXML'''|| ||''Parser''||[http://en.wikipedia.org/wiki/Simple_API_for_XML SAX]||SAX, [http://en.wikipedia.org/wiki/Document_Object_Model DOM]||DOM||DOM|| ||''Validating''||no||yes||no||yes (w/o reparsing)|| ||''Encoding''||UTF-8||UTF-8/16,ASCII,latin1||ASCII/UTF-8||UTF-8/16,ASCII,latin1|| ||''Library size''||150KB||~4MB||built-in||~1MB|| ||''Thread safe''||yes||yes||yes||yes|| ||''Used in GDAL part''||OGDI||GML, ILI||many places||not yet|| ||''Secure'' ***||yes||no|||||| ||...||...||...||...||...|| '''***''' ''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.'' == Speed == [http://xmlbench.sourceforge.net/results/benchmark200402/index.html Speed comparison of different XML parsers] == 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 == Final == I will use expat, because of the decision for SAX, the speed and it is more secure than Xerces.