ASPN ActiveState Programmer Network
  ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups | Web Services
SEARCH

Reference
ActivePython 2.5
Python Documentation
Library Reference
8. Structured Markup Processing Tools
8.1 HTMLParser -- Simple HTML and XHTML parser
8.2 sgmllib -- Simple SGML parser
8.3 htmllib -- A parser for HTML documents
8.4 htmlentitydefs -- Definitions of HTML general entities
8.5 xml.parsers.expat -- Fast XML parsing using Expat
8.6 xml.dom -- The Document Object Model API
8.7 xml.dom.minidom -- Lightweight DOM implementation
8.8 xml.dom.pulldom -- Support for building partial DOM trees
8.9 xml.sax -- Support for SAX2 parsers
8.10 xml.sax.handler -- Base classes for SAX handlers
8.11 xml.sax.saxutils -- SAX Utilities
8.12 xml.sax.xmlreader -- Interface for XML parsers
8.13 xml.etree.ElementTree -- The ElementTree XML API
8.13.1 Functions
8.13.2 ElementTree Objects
8.13.3 QName Objects
8.13.4 TreeBuilder Objects
8.13.5 XMLTreeBuilder Objects

MyASPN >> Reference >> ActivePython 2.5 >> Python Documentation >> Library Reference >> 8. Structured Markup Processing Tools
ActivePython 2.5 documentation

8.13 xml.etree.ElementTree -- The ElementTree XML API

New in version 2.5.

The Element type is a flexible container object, designed to store hierarchical data structures in memory. The type can be described as a cross between a list and a dictionary.

Each element has a number of properties associated with it:

  • a tag which is a string identifying what kind of data this element represents (the element type, in other words).
  • a number of attributes, stored in a Python dictionary.
  • a text string.
  • an optional tail string.
  • a number of child elements, stored in a Python sequence

To create an element instance, use the Element or SubElement factory functions.

The ElementTree class can be used to wrap an element structure, and convert it from and to XML.

A C implementation of this API is available as xml.etree.cElementTree.



See About this document... for information on suggesting changes.

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState 2004 All rights reserved