### Navigation

- index
- modules |
- next |
- previous |
- Python »
- 3.3.0 Documentation »
- The Python Standard Library »

# 20. Structured Markup Processing Tools

Python supports a variety of modules to work with various forms of structured data markup. This includes modules to work with the Standard Generalized Markup Language (SGML) and the Hypertext Markup Language (HTML), and several interfaces for working with the Extensible Markup Language (XML).

It is important to note that modules in the `xml` package require that there be at least one SAX-compliant XML parser available. The Expat parser is included with Python, so the `xml.parsers.expat` module will always be available.

The documentation for the `xml.dom` and `xml.sax` packages are the definition of the Python bindings for the DOM and SAX interfaces.

- 20.1. `html` — HyperText Markup Language support
- 20.2. `html.parser` — Simple HTML and XHTML parser
  - 20.2.1. Example HTML Parser Application
  - 20.2.2. `HTMLParser` Methods
  - 20.2.3. Examples
- 20.3. `html.entities` — Definitions of HTML general entities
- 20.4. `xml.etree.ElementTree` — The ElementTree XML API
  - 20.4.1. Tutorial
    - 20.4.1.1. XML tree and elements
    - 20.4.1.2. Parsing XML
    - 20.4.1.3. Finding interesting elements
    - 20.4.1.4. Modifying an XML File
    - 20.4.1.5. Building XML documents
    - 20.4.1.6. Additional resources
  - 20.4.2. XPath support
    - 20.4.2.1. Example
    - 20.4.2.2. Supported XPath syntax
  - 20.4.3. Reference
    - 20.4.3.1. Functions
    - 20.4.3.2. Element Objects
    - 20.4.3.3. ElementTree Objects
    - 20.4.3.4. QName Objects
    - 20.4.3.5. TreeBuilder Objects
    - 20.4.3.6. XMLParser Objects
    - 20.4.3.7. Exceptions
- 20.5. `xml.dom` — The Document Object Model API
  - 20.5.1. Module Contents
  - 20.5.2. Objects in the DOM
    - 20.5.2.1. DOMImplementation Objects
    - 20.5.2.2. Node Objects
    - 20.5.2.3. NodeList Objects
    - 20.5.2.4. DocumentType Objects
    - 20.5.2.5. Document Objects
    - 20.5.2.6. Element Objects
    - 20.5.2.7. Attr Objects
    - 20.5.2.8. NamedNodeMap Objects
    - 20.5.2.9. Comment Objects
    - 20.5.2.10. Text and CDATASection Objects
    - 20.5.2.11. ProcessingInstruction Objects
    - 20.5.2.12. Exceptions
  - 20.5.3. Conformance
    - 20.5.3.1. Type Mapping
    - 20.5.3.2. Accessor Methods
- 20.6. `xml.dom.minidom` — Lightweight DOM implementation
  - 20.6.1. DOM Objects
  - 20.6.2. DOM Example
  - 20.6.3. minidom and the DOM standard
- 20.7. `xml.dom.pulldom` — Support for building partial DOM trees
  - 20.7.1. DOMEventStream Objects
- 20.8. `xml.sax` — Support for SAX2 parsers
  - 20.8.1. SAXException Objects
- 20.9. `xml.sax.handler` — Base classes for SAX handlers
  - 20.9.1. ContentHandler Objects
  - 20.9.2. DTDHandler Objects
  - 20.9.3. EntityResolver Objects
  - 20.9.4. ErrorHandler Objects
- 20.10. `xml.sax.saxutils` — SAX Utilities
- 20.11. `xml.sax.xmlreader` — Interface for XML parsers
  - 20.11.1. XMLReader Objects
  - 20.11.2. IncrementalParser Objects
  - 20.11.3. Locator Objects
  - 20.11.4. InputSource Objects
  - 20.11.5. The `Attributes` Interface
  - 20.11.6. The `AttributesNS` Interface
- 20.12. `xml.parsers.expat` — Fast XML parsing using Expat
  - 20.12.1. XMLParser Objects
  - 20.12.2. ExpatError Exceptions
  - 20.12.3. Example
  - 20.12.4. Content Model Descriptions
  - 20.12.5. Expat error constants

### Navigation

- index
- modules |
- next |
- previous |
- Python »
- 3.3.0 Documentation »
- The Python Standard Library »