Outline for March 12, 2018

Project: due March 19, 2018 at 12:30pm


  1. What is XML?
    1. Tree structure
    2. Elements, tags, attributes, and attribute values
    3. Example: sample1.xml
  2. Python and XML [basic-xml.py]
    1. xml.etree.ElementTree
    2. Parsing the tree from file input (ET.parse()), from a string (ET.fromstring())
    3. Referring to elements
    4. Accessing tag names, attributes
    5. Finding nodes in the tree
    6. Dumping, writing the tree
    7. Removing an element and its descendants
    8. Changing an element’s attribute
    9. Setting attributes
  3. Example: prettyprinting XML [xmlpp.py]

Matt Bishop
Department of Computer Science
University of California at Davis
Davis, CA 95616-8562 USA
Last modified: Version of March 12, 2018 at 1:27PM
Winter Quarter 2018
You can get a PDF version of this