Re: [Tutor] ElementTree: finding a tag with specific attribute

2005-09-19 Thread Bernard Lebel
Well I have just retested BS with my XML file and now it's much, much faster (I would say instantaneous). Bernard On 9/19/05, Kent Johnson <[EMAIL PROTECTED]> wrote: > Kent Johnson wrote: > > I looked at this again and there is a bug in BS that causes this > > behaviour. It's kind of an intere

Re: [Tutor] ElementTree: finding a tag with specific attribute

2005-09-19 Thread grouchy
Now I can replace my my Kent-and-Danny patched version :)On 9/19/05, Bernard Lebel <[EMAIL PROTECTED]> wrote: Thanks a lot everyone for this! Glad I could help debug BS!Bernard On 9/19/05, Kent Johnson <[EMAIL PROTECTED]> wrote:> Kent Johnson wrote:> > I looked at this again and there is a bug in B

Re: [Tutor] ElementTree: finding a tag with specific attribute

2005-09-19 Thread Bernard Lebel
Thanks a lot everyone for this! Glad I could help debug BS! Bernard On 9/19/05, Kent Johnson <[EMAIL PROTECTED]> wrote: > Kent Johnson wrote: > > I looked at this again and there is a bug in BS that causes this > > behaviour. It's kind of an interesting bug that is a side-effect of > > the way

Re: [Tutor] ElementTree: finding a tag with specific attribute

2005-09-19 Thread Kent Johnson
Kent Johnson wrote: > I looked at this again and there is a bug in BS that causes this > behaviour. It's kind of an interesting bug that is a side-effect of > the way BS uses introspection to access child tags. There is a new release of BS that fixes this problem and one Danny found recently (bro

Re: [Tutor] ElementTree: finding a tag with specific attribute

2005-09-16 Thread Kent Johnson
One last note then I really have to go to bed... There is a program to help browse the results of profiling a Python program. It's not fancy but it helps. http://webpages.charter.net/erburley/pprofui.html Kent ___ Tutor maillist - Tutor@python.org h

Re: [Tutor] ElementTree: finding a tag with specific attribute

2005-09-16 Thread Kent Johnson
Kent Johnson wrote: >>Bernard Lebel wrote: >>>Btw in case you wonder, I don't use BeautifulSoup because somehow it >>>takes 20-30 seconds to parse a 2000-line xml file, and I don't know >>>why. ElementTree is proving very performing. > > I took a bit of a look at this using the Python profiler. Th

Re: [Tutor] ElementTree: finding a tag with specific attribute

2005-09-16 Thread Bernard Lebel
Kent, sorry to send you back your request, I won't access to file until Monday, so either you send it to Danny, either Dannay waits until Monday. I'm fine with you sending the file to Danny. Guys let me know if Danny receives the file, I'll send it Monday if not. And thanks for looking into this,

Re: [Tutor] ElementTree: finding a tag with specific attribute

2005-09-16 Thread Kent Johnson
Danny Yoo wrote: >>If you look at the list, for a while the functions are being called 777 >>times. This is probably the number of start tags in the document. But >>when you get to recursiveChildGenerator(), all of a sudden it is called >>898655 times, over 1000 times for each call to _fetch()! Thi

Re: [Tutor] ElementTree: finding a tag with specific attribute

2005-09-16 Thread Danny Yoo
> If you look at the list, for a while the functions are being called 777 > times. This is probably the number of start tags in the document. But > when you get to recursiveChildGenerator(), all of a sudden it is called > 898655 times, over 1000 times for each call to _fetch()! This is a > staggeri

Re: [Tutor] ElementTree: finding a tag with specific attribute

2005-09-16 Thread Kent Johnson
Kent Johnson wrote: > Bernard Lebel wrote: > >>Hello, >> >>With ElementTree, can you search a tag under an Element by not only >>specifying the tag label, but also some tag attribute values? That >>would be in the case where I have several tags with the same label but >>with various attribute valu

Re: [Tutor] ElementTree: finding a tag with specific attribute

2005-09-16 Thread Bernard Lebel
Thanks Kent, I'll check your suggestion out. I have sent you the xml file. Bernard On 9/16/05, Kent Johnson <[EMAIL PROTECTED]> wrote: > Bernard Lebel wrote: > > Hello, > > > > With ElementTree, can you search a tag under an Element by not only > > specifying the tag label, but also some tag

Re: [Tutor] ElementTree: finding a tag with specific attribute

2005-09-16 Thread Kent Johnson
Bernard Lebel wrote: > Hello, > > With ElementTree, can you search a tag under an Element by not only > specifying the tag label, but also some tag attribute values? That > would be in the case where I have several tags with the same label but > with various attribute values. > > Right now I do a