XML Parsing in Python

There are tons of libraries out there for processing XML in Python.

[1] minidom

[2] ElementTree

One of the painpoints I found while using ElementTree is that the XML is written out in a single line instead of a nice pretty format.

Apparently the best way to prettify it is using the minidom library.

Code:

  • Checkout the ‘prettify’ method in this code, and
  • How its being used in the editXML method. (relevant files : appt, updated)
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s