Why Parse XML?
As you saw earlier in the book, XML is not HTML. In HTML, the processing agent—that is, the HTML browser—has a built-in knowledge of HTML, and it also probably has a built-in "dekludging" engine that allows it to make sense of the most horrific HTML syntax.
XML isn't SGML, either. In SGML there is always a DTD, so an SGML processing agent can look at the DTD and figure out how an SGML document should be rendered.
Because an XML document is designed to be a standalone document, it must contain all the resources that will allow an XML processing agent to successfully process it. These resources are the elements that make an XML document well-formed. For example, without an end tag, a parser would not be able to tell when it had ...
Get XML Unleashed now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.