[lxml-dev] On lxml documentation

Marius Gedminas marius at pov.lt
Thu Jan 8 22:16:18 CET 2009


On Thu, Jan 08, 2009 at 10:55:30PM +0200, F Wolff wrote:
> Just a quick word of thanks again for lxml and the wonderful
> documentation. I'm currently optimising things a bit, and it is a joy.
> 
> I have a question and a request.
> 
> What is the difference between a "child", a "descendant" and a
> "subelement"?  I encountered these terms on this page:
> http://codespeak.net/lxml/api/lxml.etree._Element-class.html

All children are descendants, but not all descendants are children.  A
child of a child is also a descendant, as is a child of a child of a
child, and so on for any intermediate number of child-ness.

As far as I can tell, 'child' and 'subelement' are synonyms in this
context.  (I imagine other XML libraries distinguish children that were
elements from other kinds of children -- e.g. text nodes.)  I'm sure
someone will correct me if I'm wrong.

HTH,
Marius Gedminas
-- 
Life was simple before World War II. After that, we had systems.
        -- Grace Murray Hopper, 1987
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://codespeak.net/pipermail/lxml-dev/attachments/20090108/20bbcf82/attachment-0001.pgp 


More information about the lxml-dev mailing list