Re: python and parsing an xml file

2011-02-22 Thread Stefan Behnel
John Nagle, 22.02.2011 23:56: On 2/21/2011 2:08 PM, Matt Funk wrote: On 2/21/2011 11:22 AM, Terry Reedy wrote: On 2/21/2011 12:30 PM, Matt Funk wrote: Hi, I was wondering if someone had some advice: I want to create a set of xml input files to my code that look as follows: Why? mmmh. not su

Re: python and parsing an xml file

2011-02-22 Thread John Nagle
On 2/21/2011 2:08 PM, Matt Funk wrote: Hi Terry, On 2/21/2011 11:22 AM, Terry Reedy wrote: On 2/21/2011 12:30 PM, Matt Funk wrote: Hi, I was wondering if someone had some advice: I want to create a set of xml input files to my code that look as follows: Why? mmmh. not sure how to answer thi

Re: python and parsing an xml file

2011-02-22 Thread Matt Funk
One thing i forgot, in case anyone is at this point: the reason i chose ConfigObj over ConfigParser is that it allows subsections. matt On 2/22/2011 4:01 AM, Ian wrote: > On 21/02/2011 22:08, Matt Funk wrote: >>> Why? >> mmmh. not sure how to answer this question exactly. I guess it's a >> design

Re: python and parsing an xml file

2011-02-22 Thread Matt Funk
Hi, first of all thanks everyone for the (at least to me) valuable discussion about xml and its usage domain. Also thanks for all the hints and suggestions. In terms of my problems, from what i can tell right now the ConfigObj4 (see: http://www.voidspace.org.uk/python/configobj.html#reading-a-confi

Re: python and parsing an xml file

2011-02-22 Thread Paul Anton Letnes
Den 22.02.11 13.29, skrev pyt...@bdurham.com: Paul, How about skipping the whole xml thing? You can dynamically import any python module, even if it does not have a python filename. Great example! Can you do the same with a cStringIO based file that exists in memory vs. on disk? Your exampl

Re: python and parsing an xml file

2011-02-22 Thread python
Paul, > How about skipping the whole xml thing? You can dynamically import any python > module, even if it does not have a python filename. Great example! Can you do the same with a cStringIO based file that exists in memory vs. on disk? Your example requires a physical file on disk. Is it poss

Re: python and parsing an xml file

2011-02-22 Thread Ian
On 21/02/2011 22:08, Matt Funk wrote: Why? mmmh. not sure how to answer this question exactly. I guess it's a design decision. I am not saying that it is best one, but it seemed suitable to me. I am certainly open to suggestions. But here are some requirements: 1) My boss needs to be able to rea

Re: python and parsing an xml file

2011-02-22 Thread Stefan Behnel
Matt Funk, 21.02.2011 23:08: On 2/21/2011 11:22 AM, Terry Reedy wrote: On 2/21/2011 12:30 PM, Matt Funk wrote: Hi, I was wondering if someone had some advice: I want to create a set of xml input files to my code that look as follows: Why? mmmh. not sure how to answer this question exactly.

Re: python and parsing an xml file

2011-02-22 Thread Paul Anton Letnes
Den 21.02.11 18.30, skrev Matt Funk: Hi, I was wondering if someone had some advice: I want to create a set of xml input files to my code that look as follows: Alg1 ./Alg1.in c:\tmp 1 So there are co

Re: python and parsing an xml file

2011-02-21 Thread Stefan Behnel
Matt Funk, 21.02.2011 23:40: On 2/21/2011 3:28 PM, Stefan Behnel wrote: Matt Funk, 21.02.2011 23:07: thank you for your advice. I am running into an issue though (which is likely a newbie problem): My xml file looks like (which i got from the internet): Gambardella, Matthew

Re: python and parsing an xml file

2011-02-21 Thread Matt Funk
Hi Stefan, i don't mean to be annoying so sorry if i am. According to your instructions i do: parser = objectify.makeparser(ns_clean=True, remove_comments=True) root = objectify.parse(inputfile,parser).getroot() print root.catalog.book.author.text which still gives the following error: AttributeE

Re: python and parsing an xml file

2011-02-21 Thread Stefan Behnel
Matt Funk, 21.02.2011 23:07: thank you for your advice. I am running into an issue though (which is likely a newbie problem): My xml file looks like (which i got from the internet): Gambardella, Matthew XML Developer's Guide Computer 44.95 2000-10-01

Re: python and parsing an xml file

2011-02-21 Thread Matt Funk
HI Stefan, thank you for your advice. I am running into an issue though (which is likely a newbie problem): My xml file looks like (which i got from the internet): Gambardella, Matthew XML Developer's Guide Computer 44.95 2000-10-01 An in-depth look at cre

Re: python and parsing an xml file

2011-02-21 Thread Matt Funk
Hi Terry, On 2/21/2011 11:22 AM, Terry Reedy wrote: > On 2/21/2011 12:30 PM, Matt Funk wrote: >> Hi, >> I was wondering if someone had some advice: >> I want to create a set of xml input files to my code that look as >> follows: > > Why? mmmh. not sure how to answer this question exactly. I guess

Re: python and parsing an xml file

2011-02-21 Thread Stefan Behnel
Terry Reedy, 21.02.2011 19:22: On 2/21/2011 12:30 PM, Matt Funk wrote: Hi, I was wondering if someone had some advice: I want to create a set of xml input files to my code that look as follows: Why? ... So there are comments, whitespace etc ... in it. I would like to be able to put everythin

Re: python and parsing an xml file

2011-02-21 Thread Terry Reedy
On 2/21/2011 12:30 PM, Matt Funk wrote: Hi, I was wondering if someone had some advice: I want to create a set of xml input files to my code that look as follows: Why? ... So there are comments, whitespace etc ... in it. I would like to be able to put everything into some sort of structure su

Re: python and parsing an xml file

2011-02-21 Thread Stefan Behnel
Matt Funk, 21.02.2011 18:30: I want to create a set of xml input files to my code that look as follows: Alg1 ./Alg1.in c:\tmp 1 That's not XML. XML documents have exactly one root element, i.e. you n

python and parsing an xml file

2011-02-21 Thread Matt Funk
Hi, I was wondering if someone had some advice: I want to create a set of xml input files to my code that look as follows: Alg1 ./Alg1.in c:\tmp 1 So there are comments, whitespace etc ... in it