Re: [Tutor] Problem with BeautifulSoup

2005-09-30 Thread Bernard Lebel
Nice! Thanks Kent Bernard On 9/30/05, Kent Johnson <[EMAIL PROTECTED]> wrote: > Oh, what if you try > > class MyBeautifulSoup(BeautifulSoup.BeautifulStoneSoup): > NESTABLE_BLOCK_TAGS = ['sceneobject', 'parameters', 'parameter', 'shader'] > NESTABLE_TAGS = buildTagMap([], NESTABLE_BLOCK

Re: [Tutor] Problem with BeautifulSoup

2005-09-30 Thread Kent Johnson
Oh, what if you try class MyBeautifulSoup(BeautifulSoup.BeautifulStoneSoup): NESTABLE_BLOCK_TAGS = ['sceneobject', 'parameters', 'parameter', 'shader'] NESTABLE_TAGS = buildTagMap([], NESTABLE_BLOCK_TAGS) Bernard Lebel wrote: > I know I should be doing that. But somehow it doesn't work (

Re: [Tutor] Problem with BeautifulSoup

2005-09-30 Thread Bernard Lebel
I know I should be doing that. But somehow it doesn't work (ie I keep getting mangled XML tree). Bernard On 9/30/05, Kent Johnson <[EMAIL PROTECTED]> wrote: > Bernard Lebel wrote: > > Hi Kent, > > > > Well I have decided to get this sorted once and for all. Not that I > > don't like ElementTree

Re: [Tutor] Problem with BeautifulSoup

2005-09-30 Thread Kent Johnson
Bernard Lebel wrote: > Hi Kent, > > Well I have decided to get this sorted once and for all. Not that I > don't like ElementTree, but the fack is that BeautifulSoup uses a near > identical syntax to the 3D application SDK's object model I'm using it > with, making interaction between the 3D and th

Re: [Tutor] Problem with BeautifulSoup

2005-09-30 Thread Bernard Lebel
Hi Kent, Well I have decided to get this sorted once and for all. Not that I don't like ElementTree, but the fack is that BeautifulSoup uses a near identical syntax to the 3D application SDK's object model I'm using it with, making interaction between the 3D and the XML extremely transparent. Anyw

Re: [Tutor] Problem with BeautifulSoup

2005-09-29 Thread Kent Johnson
(resending to the whole list) Bernard Lebel wrote: > Hi Kent, > > Thanks a lot for that answer. I have had a look at the BS code, and I > have to admit I'm a bit at a loss: how would you add several nestable > tag names in that list? > > I tried > NESTABLE_TAGS = BeautifulSoup.buildTagMap( [], '

Re: [Tutor] Problem with BeautifulSoup

2005-09-28 Thread Bernard Lebel
Hi Kent, Thanks a lot for that answer. I have had a look at the BS code, and I have to admit I'm a bit at a loss: how would you add several nestable tag names in that list? I tried NESTABLE_TAGS = BeautifulSoup.buildTagMap( [], 'parameter', 'parameters' ) for example, but I kept having these nest

Re: [Tutor] Problem with BeautifulSoup

2005-09-26 Thread Kent Johnson
Bernard Lebel wrote: > Hi grouchy, > > I seem to have found the problem. Somehow, it seems BeautifulSoup > doesn't like nested tags of the same name. This seems to be a feature of BS. It seems a bit of a misfeature when applied to XML but anyway...you can configure BS with a set of tags which ca

Re: [Tutor] Problem with BeautifulSoup

2005-09-23 Thread Bernard Lebel
Hi grouchy, I seem to have found the problem. Somehow, it seems BeautifulSoup doesn't like nested tags of the same name. For instance, I had this tree: Printing the entire tree in the command line shell showed some weird rear

Re: [Tutor] Problem with BeautifulSoup

2005-09-23 Thread grouchy
Hi Bernard,   Not much of an answer, but I printed out your snippet with prettify() to see how it was being parsed, and either the XML is funny, or Beautiful Soup is :) >>> from BeautifulSoup import BeautifulStoneSoup as BSS >>> soup = BSS(xml)>>> print soup.prettify()              1  3   1.797693

[Tutor] Problem with BeautifulSoup

2005-09-23 Thread Bernard Lebel
Hello, I have this set of XML tags: 1 3 1.79769313486e+308 False -1.79769313486e+308 7.64880829803 False 20