February 2006
Intermediate to advanced
648 pages
14h 53m
English
The xml.dom module defines some objects and exceptions that are used by parsers that implement the Document Object Model. With DOM, documents are parsed into a tree structure representing the document structure. The tree structure can then be traversed and manipulated as necessary.
As an example of the tree structure, consider the following XML document:
<?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE recipe [ <!-- The RECIPE DTD appears here --> <!ELEMENT recipe (title, description?, ingredients, directions)> <!ELEMENT ingredients (item+)> <!ELEMENT title (#PCDATA)> <!ELEMENT description (#PCDATA)> <!ELEMENT item (#PCDATA)> <!ELEMENT directions (#PCDATA)> <!ATTLIST item num CDATA #REQUIRED units (C | tsp | tbl | bottles | none ...
Read now
Unlock full access