Xml parser validating vs non validating advantages 40 year old man dating 22 year old woman
I suppose the two main approaches are DOM and SAX parsers.DOM parsers create an in-memory tree of nodes for the document.In the grand tradition of Perlians throughout history, you will of course use an existing parser -- say, XML:: Parser -- rather than writing your own.(In this case, you'll find that XML:: Parser is built on the same expat, written in C, that's at the heart of the Mozilla browser.) Or maybe you're using the Oracle 8 database management system to read in and emit XML from its relational tables -- why bother even looking at some parser other than the one that comes with Oracle, and risking potential incompatibilities?Very easy to use for the programmer, but could be too much overhead for large documents. SAX parsers read through the document once and create a stream of events like "tag started".
For instance, Microsoft's Internet Explorer 5.x browsers use a parser built into the file, and the Mozilla browser is built on a parser, written in C, called "expat." Nevertheless, in some cases you do need to select a parser.) But maybe for one reason or another you really do need to select a standalone parser. And within the well-formedness category, you may need some additional but optional features which are required only of a validating parser.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.(Note: Any parser that validates will also check for well-formedness.A parser which is nominally non-validating may or may not make use of a DTD if one is present.) For this sort of application, I generally use one or more of the various Web-based syntax checkers.
Check out their website to get details on supported standards, reference documentation, etc.