xml data or other?

shivers.paul at yahoo.co.uk shivers.paul at yahoo.co.uk
Tue Nov 13 15:05:49 CET 2012


On Friday, November 9, 2012 12:54:56 PM UTC, Artie Ziff wrote:
> Hello,
> 
> 
> 
> I want to process XML-like data like this:
> 
> 
> 
> <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>
> 
> 
> 
> 
> 
> After manually editing the data above, the python module 
> 
> xml.etree.ElementTree parses it without failing due to error in the data 
> 
> structure.
> 
> 
> 
> Edits were substituting '/' for '\' on the end tags, and adding the 
> 
> following structure:
> 
> 
> 
> <?xml version="1.0"?>
> 
> <data>
> 
>    <testname name=ltpacpi.sh>
> 
>      ...
> 
>    <\testname>
> 
> </data>
> 
> 
> 
> 
> 
> Is there a name for the format above (perhaps xhtml)?
> 
> I'd like to find a python module that can translate it to proper xml. 
> 
> Does one exist? etree?
> 
> 
> 
> Many thanks!
> 
> az

maybe an xml tool would be better, a good list of xml tools here; http://www.xml-data.info


More information about the Python-list mailing list