Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > effbot ElementTree question

Reply
Thread Tools

effbot ElementTree question

 
 
dayzman@hotmail.com
Guest
Posts: n/a
 
      12-15-2004
Hi,

Is anyone here familiar with ElementTree by effbot?

With <html><body>hello</body></html> how is "hello" stored in the
element tree? Which node is it under? Similarly, with:
foo <a href = "blah"> blah </a> bar, how is bar stored? Which node is
it in?

Cheers,
Ming

 
Reply With Quote
 
 
 
 
Fredrik Lundh
Guest
Posts: n/a
 
      12-15-2004
<(E-Mail Removed)> wrote:

> Is anyone here familiar with ElementTree by effbot?
>
> With <html><body>hello</body></html> how is "hello" stored in the
> element tree? Which node is it under? Similarly, with:
> foo <a href = "blah"> blah </a> bar, how is bar stored? Which node is
> it in?


reposting the reply I just posted to the discussion board where you
asked the same question:

in the body case, the "hello" text ends up in the 'text' attribute of the "body"
node (in HTML/CSS terminology, this is known as an "anonymous block").

in the other case, the trailing text is stored in the 'tail' attribute of the
preceeding element ("a" in this case); see:

http://effbot.org/zone/element-infos...#mixed-content

for details on how ElementTree deals with mixed content.

</F>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ElementTree.XML(string XML) and ElementTree.fromstring(string XML)not working Kee Nethery Python 12 06-27-2009 06:06 AM
Pb console Effbot Méta-MCI Python 1 06-16-2006 09:52 AM
effbot ExeMaker: custom icon? Michael Spencer Python 0 12-18-2005 12:58 AM
Effbot's SimpleXMLWriter fails when py2exe'd Erik Bethke Python 3 02-08-2005 06:35 PM
effbot TidyHTMLTreeBuilder problem dayzman@hotmail.com Python 0 12-23-2004 06:15 AM



Advertisments