XML technologies / XML / Python & XML / The Document Object Model
(Excerpt from "Python & XML" by Christopher A. Jones & Fred L. Drake, Jr.)
The Document Object Model (DOM) is an interface giving developers programmatic access to a document’s structure. Perhaps the most common use of DOM is “Dynamic HTML” (DHTML), in which an HTML document in the browser can be modified programmatically using an embedded scripting language. This is usually an ECMAScript variant, such as JavaScript or JScript, because most browsers support it, but other languages can also be used. (In Windows browsers, this can even be Python!) This lets you change a table cell’s background color or dynamically switch fonts after the page has loaded in the browser. DOM defines the interface for which vendors can provide compatible APIs.
DOM is also extremely useful when exposed through a library such as the Python standard library or PyXML. It lets you manipulate an XML document already in memory using Python. The DOM interfaces allow you to modify or extract parts of the document.
Copyright © 2002 O'Reilly Verlag GmbH & Co. KG
You may print the online version for your private use.
Otherwise, this chapter from the book "Python & XML" is subject to the same conditions as the printed edition: the work and all its parts are protected by copyright. All rights reserved, including reproduction, translation, microfilming, and storage and processing in electronic systems.
O’Reilly Verlag GmbH & Co. KG, Balthasarstraße 81, 50670 Köln, kommentar(at)oreilly.de
back to top