XML Parsing

Diez B. Roggisch deets at nospam.web.de
Wed Mar 28 05:51:18 EDT 2007


pyapplico at gmail.com wrote:

> I want to parse this XML file:
> 
> <?xml version="1.0" ?>
> 
> <text>
> 
> <text:one>
> <file>filename</file>
> <contents>
> Hello
> </contents>
> </text:one>
> 
> <text:two>
> <file>filename2</file>
> <contents>
> Hello2
> </contents>
> </text:two>
> 
> </text>
> 
> This XML will be in a file called filecreate.xml
> 
> As you might have guessed, I want to create files from this XML file
> contents, so how can I do this?
> What modules should I use? What options do I have? Where can I find
> tutorials? Will I be able to put
> this on the internet (on a googlepages server)?
> 
> Thanks in advance to everyone who helps me.
> And yes I have used Google but I am unsure what to use.

The above file is not valid XML. It misses a xmlns:text namespace
declaration. So you won't be able to parse it regardless of what parser you
use.

Diez



More information about the Python-list mailing list