问题
i want to parse KML file, and get some info from it about Google maps. The question is witch parser should i use SAX, DOM or JAXB. From what i read JAXB sounds best to me, but i read this about JAXB.
"If you have a schema that uses mixed content, don't use data binding. Or at least pick your framework carefully. Data binding, as its name suggested, is designed for data, not documents. Mixed content, like XHTML, just doesn't make sense expressed in a Java interface or class. Some frameworks support partial binding of a schema such that some portion of the object tree is represented by a Node object from DOM or a similar API, but this is not a universal feature".
Does KML schema use mixed content and can i use JAXB for this task? And can you tell me more about advantage and disadvantage of SAX, DOM and JAXB.
回答1:
KML does not used mixed content see http://code.google.com/apis/kml/schema/kml21.xsd JAXB is best at this kind of schema.
来源:https://stackoverflow.com/questions/9275758/what-is-the-best-xml-parser