Xml parser validating vs non validating advantages

I suppose the two main approaches are DOM and SAX parsers.

DOM parsers create an in-memory tree of nodes for the document.

xml parser validating vs non validating advantages-37xml parser validating vs non validating advantages-68xml parser validating vs non validating advantages-74xml parser validating vs non validating advantages-29

Do you want the parser to supply an attribute's default value if the document author hasn't done so? In such cases, you can eliminate whole sub-categories of non-validating parsers from consideration.

Otherwise, the principal issues you need to consider are speed, size, and language binding (and other platform-related) issues.

Speed: If you're going to be parsing documents of only a few hundred elements, this is probably the least important concern.

In practice, though, I've occasionally run into discrepancies, and for this reason I'll usually run a document through more than one parser just to be sure of no surprises when it's actually delivered to an application.

(To their credit, the parser authors have always been very receptive to bug reports -- or, as the occasion warrants, to pointing out that it's my interpretation of the spec that's at fault! well-formedness consideration as with the online checkers.

Leave a Reply