Project Description
A lightweight, non-validating module that does an XML pretty print using python.
Works/does a best effort on html and malformed/invalid xml.



Command line Usage
python xmlpp.py <a xml file>

API Usage

import xmlpp #put the xmlpp.py file in the PYTHONPATH

import sys
outputfile= open("outputfile.xml", 'w')

xmlpp.pprint("<xml>test</xml>", output=outputfile) #use this to print to a file directly
outputfile.close() #flush and close

xmlstring = xmlpp.get_pprint("<xml>test</xml>") #use this to get the string

print xmlpp.pprint("<xml>test<new element/>") #works on incomplete xml as well

Last edited Aug 3, 2010 at 12:39 PM by ekhfre, version 9