Re: [Tutor] parsing xml as lines

2015-11-04 Thread Peter Otten
richard kappler wrote: > I have an xml file that get's written to as events occur. Each event > writes a new 'line' of xml to the file, in a specific format, eg: > sometthing like this: > > http://www.w3.org/2001/XMLSchema-instance"; > xsi:noNamespaceSchemaLocation="Logging.xsd" version="1.0"> h

[Tutor] parsing xml as lines

2015-11-04 Thread richard kappler
I have an xml file that get's written to as events occur. Each event writes a new 'line' of xml to the file, in a specific format, eg: sometthing like this: http://www.w3.org/2001/XMLSchema-instance"; xsi:noNamespaceSchemaLocation="Logging.xsd" version="1.0">somestuff and each 'line' has that sam

Re: [Tutor] parsing XML into a python dictionary

2009-11-15 Thread Stefan Behnel
Christopher Spears, 14.11.2009 19:47: > Thanks! I have a lot of XML files at work that users search through. I > want to parse the XML into a python dictionary and then read the dictionary > into a database that users can use to search through the thousands of files. I think "database" is the righ

Re: [Tutor] parsing XML into a python dictionary

2009-11-14 Thread Christopher Spears
erything under the "comic" tag. --- On Sat, 11/14/09, Kent Johnson wrote: > From: Kent Johnson > Subject: Re: [Tutor] parsing XML into a python dictionary > To: "Christopher Spears" > Cc: tutor@python.org > Date: Saturday, November 14, 2009, 5:03 AM &

Re: [Tutor] parsing XML into a python dictionary

2009-11-14 Thread Kent Johnson
On Sat, Nov 14, 2009 at 1:14 AM, Christopher Spears wrote: > I've been working on a way to parse an XML document and convert it into a > python dictionary.  I want to maintain the hierarchy of the XML.  Here is the > sample XML I have been working on: > > >   >    Neil Gaiman >    Glyn Dillon >

Re: [Tutor] parsing XML into a python dictionary

2009-11-14 Thread Alan Gauld
"Christopher Spears" wrote I've been working on a way to parse an XML document and convert it into a python dictionary. I want to maintain the hierarchy of the XML. Here is the sample XML I have been working on: Neil Gaiman Glyn Dillon Charles Vess This is my first stab at

[Tutor] parsing XML into a python dictionary

2009-11-13 Thread Christopher Spears
I've been working on a way to parse an XML document and convert it into a python dictionary. I want to maintain the hierarchy of the XML. Here is the sample XML I have been working on: Neil Gaiman Glyn Dillon Charles Vess This is my first stab at this: #!/usr/bin/env pyth

Re: [Tutor] parsing XML

2009-11-10 Thread Alan Gauld
"Stefan Behnel" wrote Note that ElementTree provides both a SAX-like interface (look for the 'target' property of parsers) and an incremental parser (iterparse). Interesting, I didn't realise that. I've only ever used it to build a tree. XML parsers fall into 2 groups. Those that parse the

Re: [Tutor] parsing XML

2009-11-10 Thread Stefan Behnel
Alan Gauld, 10.11.2009 06:53: > "Christopher Spears" wrote >> I need to parse several XML documents into a Python dictionary. Is >> there a module that would be particularly good for this? I heard >> beginners should start with ElementTree. However, SAX seems to make a >> little more sense to m

Re: [Tutor] parsing XML

2009-11-09 Thread Alan Gauld
"Christopher Spears" wrote I need to parse several XML documents into a Python dictionary. Is there a module that would be particularly good for this? I heard beginners should start with ElementTree. However, SAX seems to make a little more sense to me. XML parsers fall into 2 groups

Re: [Tutor] parsing XML

2009-11-09 Thread Eric Pavey
On Mon, Nov 9, 2009 at 7:48 PM, Christopher Spears wrote: > Hi! > > I need to parse several XML documents into a Python dictionary. Is there a > module that would be particularly good for this? I heard beginners should > start with ElementTree. However, SAX seems to make a little more sense to

[Tutor] parsing XML

2009-11-09 Thread Christopher Spears
Hi! I need to parse several XML documents into a Python dictionary. Is there a module that would be particularly good for this? I heard beginners should start with ElementTree. However, SAX seems to make a little more sense to me. Any suggestions? __