xml.etree.ElementTree — XML Manipulation API¶
Purpose: | Generate and parse XML documents |
---|
The ElementTree library includes tools for parsing XML using event-based and document-based APIs, searching parsed documents with XPath expressions, and creating new or modifying existing documents.
- Parsing an XML Document
- Traversing the Parsed Tree
- Finding Nodes in a Document
- Parsed Node Attributes
- Watching Events While Parsing
- Creating a Custom Tree Builder
- Parsing Strings
- Building Documents With Element Nodes
- Pretty-Printing XML
- Setting Element Properties
- Building Trees from Lists of Nodes
- Serializing XML to a Stream
See also
- Standard library documentation for xml.etree.ElementTree – The standard library documentation for this module.
csv
– Read and write comma-separated-value files- defusedxml – A package with fixes for various entity-expansion denial of service vulnerabilities useful for working with untrusted XML data.
- Prety print xml with python - indenting xml – A tip from Rene Dudfield for pretty-printing XML in Python.
- ElementTree Overview – Fredrick Lundh’s original documentation and links to the development versions of the ElementTree library.
- Process XML in Python with ElementTree – IBM DeveloperWorks article by David Mertz.
- Outline Processor Markup Language (OPML) – Dave Winer’s OPML specification and documentation.
- XML Path Language (XPath) – A syntax for identifying parts of an XML document.
- XPath Support in ElementTree – Part of Fredrick Lundh’s original documentation for ElementTree.