The PyXML package contains over 200 individual modules, some intended
for public use and some not. Many of these modules often perform
similar tasks, making it difficult to figure out which is the right
one to use in any given situation, and this can make it confusing.
Here's a list of the 30-odd packages and modules that are considered
public, along with brief descriptions to help you choose the right
- The Python DOM interface. The full interface
support DOM Levels 1 and 2. xml.dom contains
the implementation for DOM trees built from XML documents.
(This implementation is called 4DOM, and was written by Fourthought Inc.)
- DOM trees built from HTML documents are also supported.
- An adaptor for using Java DOM implementations with Jython.
- A lightweight DOM implementation that's also included in the Python
- Offers traversal and ranges on top of
xml.dom.minidom, using the 4DOM traversal implementation.
- Provides a stream of DOM elements. This module can make it easy
to write certain types of DTD-specific processing code.
- Various DOM-related extensions for pretty-printing DOM trees as XML or XHTML.
- A parser to generate SAX events from a DOM tree.
- Takes a DOM tree and outputs a text stream containing the
Canonical XML representation of the document.
- Classes for building DOM trees from various input sources:
SAX1 and SAX2 parsers, htmllib, and directly using Expat.
- Marshals simple Python data types into an XML format. The
Marshaller and Unmarshaller classes can be
subclassed in order to implement marshalling into a different XML
- Marshals Python objects into WDDX. (This module is built on top
of the preceding generic module.)
- Contains constants for the namespace URIs for various XML-related standards.
- A version of the sgmllib module that's part of the standard
Python library, rewritten to run on top of the sgmlop
- A validating XML parser. Usually you'll want to use xmlproc via SAX or
some other higher-level interface.
- SAX1 and SAX2 support for Python.
- SAX1 drivers for various parsers: htmllib,
LT, Expat, sgmllib, xmllib, xmlproc,
- SAX2 drivers for various parsers: htmllib, Java SAX parsers
(for Jython), Expat, sgmllib, xmlproc.
- Contains the core SAX2 handler classes ContentHandler,
DTDHandler, EntityResolver, and
ErrorHandler. Also contains symbolic names for the various
SAX2 features and properties.
- SAX2 extensions. This contains various factory classes that create
parser objects, and is how SAX2 parsers are used.
- Contains two SAX2 handler classes, DeclHandler and
LexicalHandler, and the XMLFilter interface.
Also contains the deprecated SAX1 handler classes.
- Various utility classes, such as DefaultHandler, a default
base class for SAX2 handlers, ErrorPrinter and
ErrorRaiser, two default error handlers, and
XMLGenerator, which generates XML output from a SAX2 event stream.
- Contains the XMLReader, the base interface for implementing
- A Python implementation of TREX, a schema language.
- Contains the legal XML character ranges as specified in the XML 1.0
Recommendation, and regular expressions that match various
- Parses ISO-8601 date/time specifiers, which look like
- A simple tree-based XML parsing interface.
- An XPath parser and evaluator.
(This implementation is called 4XPath, and was written by Fourthought Inc.)