Re: ElementTree surprise

2007-08-16 Thread Paul Rubin
Stefan Behnel <[EMAIL PROTECTED]> writes: > So it's not even an ElementTree thing. ET just doesn't know what > exactly was in the original XML byte stream. A very simple way to > make sure you always get a string back is > >>> text = element.text or "" Thanks, I ended up doing something like t

Re: ElementTree surprise

2007-08-16 Thread Stefan Behnel
Paul Rubin wrote: > Torsten Bronger <[EMAIL PROTECTED]> writes: >>> >> Technically, text is nodes as all other element nodes. In the >> parrot example, there is no empty textnode but no textnode at all. > > That is required by the xml standard? If yes, elementtree is doing > the right thing

Re: ElementTree surprise

2007-08-15 Thread Paul Rubin
Torsten Bronger <[EMAIL PROTECTED]> writes: > > > Technically, text is nodes as all other element nodes. In the > parrot example, there is no empty textnode but no textnode at all. That is required by the xml standard? If yes, elementtree is doing the right thing, but it surprises me, I wou

Re: ElementTree surprise

2007-08-15 Thread Torsten Bronger
Hallöchen! Paul Rubin writes: > I have a doc with a bunch of fields like: > > stuff > other stuff > > and sometimes > > > > I use ElementTree to parse the doc and I use the .text attribute > to get "stuff" or "other stuff" in the spam and penguin examples. > > I'd expect .text to be