473,386 Members | 1,997 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

effbot ElementTree question

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

Jul 18 '05 #1
1 1444
<da*****@hotmail.com> 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>

Jul 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: dayzman | last post by:
Hi all, I'm using TidyHTMLTreeBuilder to model syntax structure of HTML documents. I've been trying to feed in Yahoo and CNN, but the parser seems to crash: " File...
3
by: Erik Bethke | last post by:
Hello All, So I have been using Effbot's XML stuff a lot! And I have been using py2exe, pygame and wxPython all mixed together... I am getting this strange error log when writing XML files...
1
by: Greg Wilson | last post by:
I'm trying to convert from minidom to ElementTree for handling XML, and am having trouble with entities in DTDs. My Python script looks like this: ...
0
by: Greg Aumann | last post by:
I am trying to write some python code for a library that reads an XML-like language from a file into elementtree data structures. Then I want to be able to read and/or modify the structure and then...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.