14 | | == XML Parser == |
15 | | |
16 | | 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: |
17 | | * SAX or DOM? |
18 | | * provide XML validation for KML documents (mandatory, optional, none)? |
19 | | * ... |
20 | | |
21 | | |
22 | | There are 3 or 4 XML parsers under our consideration: |
23 | | * [http://expat.sourceforge.net/ Expat] |
24 | | * [http://xml.apache.org/xerces-c/index.html Xerces] |
25 | | * [source:trunk/gdal/port/cpl_minixml.h minixml] |
26 | | * [http://www.xmlsoft.org/ libXML] |
27 | | |
28 | | 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. |
29 | | |
30 | | |
31 | | ||'''Feature'''||'''Expat'''||'''Xerces'''||'''minixml'''||'''libXML'''|| |
32 | | ||''Parser''||[http://en.wikipedia.org/wiki/Simple_API_for_XML SAX]||SAX, [http://en.wikipedia.org/wiki/Document_Object_Model DOM]||DOM||DOM|| |
33 | | ||''Validating''||no||yes||no||yes (w/o reparsing)|| |
34 | | ||''Encoding''||UTF-8||UTF-8/16,ASCII,latin1||ASCII/UTF-8||UTF-8/16,ASCII,latin1|| |
35 | | ||''Library size''||150KB||~4MB||built-in||~1MB|| |
36 | | ||''Thread safe''||yes||yes||yes||yes|| |
37 | | ||''Used in GDAL part''||OGDI||GML, ILI||many places||not yet|| |
38 | | ||''Secure'' ***||yes||no|||||| |
39 | | ||...||...||...||...||...|| |
40 | | |
41 | | '''***''' ''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.'' |
42 | | |
43 | | === SAX or DOM === |
44 | | Which technic should be used for reading the KML files? |
45 | | * I (Jens) guess SAX would be best, because of the memory consumption of DOM |
46 | | * SAX is more complex to use in case of KML |
| 14 | == XmlParser == |