Processing an XML Document

Parsing an XML document is the first step in processing it. Here is how an XML document is usually processed by a user-agent.

A parser will take an XML document and check whether it is well-formed or valid. In the most common scenario, it will then build a parse tree, which is a tree of all the document objects in the XML document. The parser will then pass this parse tree to a rendering agent. The rendering agent will then display some kind of tree view. Or, if a style sheet and/or script is associated with the XML document, the parser will style the document and create a series of flow objects for display. Figure 12.1 illustrates this process.

Figure 12.1. Processing an XML document.

XML parsers come in two flavors: ...

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.