On Nov 9, 5:54 pm, Artie Ziff <artie.z...@gmail.com> wrote: > Hello, > > I want to process XML-like data like this: <snipped> > Edits were substituting '/' for '\' on the end tags, and adding the > following structure:
If thats all you want, you can try the following: # obviously this should come from a file input= """<testname=ltpacpi.sh> <description> ACPI (Advanced Control Power & Integration) testscript for 2.5 kernels. <\description> <test_location> ltp/testcases/kernel/device-drivers/acpi/ltpacpi.sh <\test_location> <\testname>""" prefix = """<?xml version="1.0"?> <data> """ postfix = """</data>""" correctedInput = prefix + input.replace("\\", "/") + postfix # submit correctedinput to etree -- http://mail.python.org/mailman/listinfo/python-list