Re: [Tutor] Another regular expression question

2005-09-14 Thread Alan G
> However is it normal that to parse a 2618 lines xml file > it takes 20-30 seconds or so? Only if you are running it on an original Palm Pilot! Seriously, I'd expect it to be more like 2-3 seconds. Something fishy there. Alan G. ___ Tutor maillist -

Re: [Tutor] Another regular expression question

2005-09-14 Thread Bernard Lebel
Hi Kent, Well even before reading your last email I gave it a go, just parsing the xml file and trying out some basic functions. It ran in less than two seconds. I don't know why BeautifulSoup is taking so long... Thanks for the "to get you started"! Bernard On 9/14/05, Kent Johnson <[EMAIL

Re: [Tutor] Another regular expression question

2005-09-14 Thread Kent Johnson
Bernard Lebel wrote: > The file size is 112 Kb. Most lines look this way: > > > > > I'll give a try to ElementTree. To get you started: from elementtree import ElementTree doc = ElementTree.parse('myfile.xml') for sceneobject in doc.findall('//sceneobject'): if sceneobject.get('type') == 'C

Re: [Tutor] Another regular expression question

2005-09-14 Thread Bernard Lebel
The file size is 112 Kb. Most lines look this way: I'll give a try to ElementTree. Bernard On 9/14/05, Kent Johnson <[EMAIL PROTECTED]> wrote: > Bernard Lebel wrote: > > Thanks for that pointer Kent, I'll check it out. Also thanks for > > letting me know I'm not nuts! :-) > > > > Alan's su

Re: [Tutor] Another regular expression question

2005-09-14 Thread Kent Johnson
Bernard Lebel wrote: > Thanks for that pointer Kent, I'll check it out. Also thanks for > letting me know I'm not nuts! :-) > > Alan's suggestion about BeautifulSoup is actually excellent. The > documentation is nice and the tool is very easy to use. > > However is it normal that to parse a 2618

Re: [Tutor] Another regular expression question

2005-09-14 Thread Bernard Lebel
Thanks for that pointer Kent, I'll check it out. Also thanks for letting me know I'm not nuts! :-) Alan's suggestion about BeautifulSoup is actually excellent. The documentation is nice and the tool is very easy to use. However is it normal that to parse a 2618 lines xml file it takes 20-30 secon

Re: [Tutor] Another regular expression question

2005-09-14 Thread Kent Johnson
Bernard Lebel wrote: > Thanks Alan, > > I'll check BeautifulSoup asap. > > I'm using regex simply because I have no clue where to start to parse > XML. I have read the various xml tools available in the Python > library, however I'm a complete loss at what to make out of them. Many > of them seem

Re: [Tutor] Another regular expression question

2005-09-14 Thread Bernard Lebel
Thanks Alan, I'll check BeautifulSoup asap. I'm using regex simply because I have no clue where to start to parse XML. I have read the various xml tools available in the Python library, however I'm a complete loss at what to make out of them. Many of them seem to use some programming standards, w

Re: [Tutor] Another regular expression question

2005-09-14 Thread Alan G
Hi Bernard, > Hello, yet another regular expression question :-) > > So I have this xml file that I'm trying to find a > specific tag in. I'm always suspicious when I see regular expression and xml/html in the same context. regex are not good for parsing xml/html files and it's usually much e

Re: [Tutor] Another regular expression question

2005-09-13 Thread Kent Johnson
Bernard Lebel wrote: > Hello, yet another regular expression question :-) > > So I have this xml file that I'm trying to find a specific tag in. For > this I'm using a regular expression. Right now, the tag I'm trying to > find looks like this: > > > > So I'm using a regular expression to find: