From the course: Python: XML, JSON, and the Web

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

The XML DOM

The XML DOM - Python Tutorial

From the course: Python: XML, JSON, and the Web

Start my 1-month free trial

The XML DOM

- [Instructor] The second and major way that XML content can be manipulated is by using the Document Object Model API or DOM. Now it's beyond the scope of this course to go deeply into the full DOM API and all the nuances that surround using it. If you're interested in learning all about how the DOM works and the various API's that are associated with it, you should check out the course XML Essential Training. One of the major differences between the DOM and SAX API's is that the DOM allows you to access any part of the XML file at random, and it makes it easy to modify the file content. When you use the DOM to parse XML code, the XML is read into memory in its entirety and represented as a tree structure. You can then use various API's to work on the resulting document tree. The Python Standard Library provides an implementation of the DOM API in the xml.dom.minidom module. It is intended to be a smaller implementation than the full DOM API. So let's take a brief look at some of the…

Contents