effbot ElementTree question

Discussion in 'Python' started by dayzman@hotmail.com, Dec 15, 2004.

  1. Guest

    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
     
    , Dec 15, 2004
    #1
    1. Advertising

  2. <> 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-infoset.htm#mixed-content

    for details on how ElementTree deals with mixed content.

    </F>
     
    Fredrik Lundh, Dec 15, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    0
    Views:
    283
  2. Erik  Bethke
    Replies:
    3
    Views:
    411
    Erik Bethke
    Feb 8, 2005
  3. Michael Spencer

    effbot ExeMaker: custom icon?

    Michael Spencer, Dec 18, 2005, in forum: Python
    Replies:
    0
    Views:
    290
    Michael Spencer
    Dec 18, 2005
  4. Méta-MCI

    Pb console Effbot

    Méta-MCI, Jun 14, 2006, in forum: Python
    Replies:
    1
    Views:
    286
    Fredrik Lundh
    Jun 16, 2006
  5. Kee Nethery
    Replies:
    12
    Views:
    2,096
    Stefan Behnel
    Jun 27, 2009
Loading...

Share This Page