Background

Most XML parsers are able to build a tree model of an XML document as it is parsed, then allow the main application access to this model through an API. The arguments for using a standard API are the same as for the SAX approach, but in addition the major Web browser developers agreed that there was a need to provide a similar capability for accessing HTML elements from scripts in a Web page. DOM (the Document Object Model) was developed by the W3C, primarily to specify how Web browsers and embedded scripts should access HTML and XML documents. But the DOM is equally suited to more general software processing of XML documents, and the generation of new documents.

There is a core standard that applies to both HTML and XML documents ...

Get XML Companion, The, Third Edition 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.