Re: Descendant

by "Donna Smillie" <dms(at)zetnet.co.uk>

 Date:  Sat, 14 Jun 2003 13:38:26 +0100
 To:  "John" <johnmoz(at)ozemail.com.au>,
<hwg-techniques(at)hwg.org>
 References:  apto
  todo: View Thread, Original
----- Original Message -----
From: "John" <johnmoz(at)ozemail.com.au>


> http://www.w3.org/TR/REC-CSS2/conform.html
>
> parent isn't defined.

Actually, if you look in the definition of "Content", you'll find:

"The content of an element may include text, and it may include a number of
sub-elements, in which case the element is called the parent of those
sub-elements."

> Child - An element A is called the child of element B if an only if B is
the
> parent of A.
> Descendant - An element A is called a descendant of an element B, if
either
> (1) A is a child of B, or (2) A is the child of some element C that is a
> descendant of B.
>
> would seem to be saying:
>
> Fred
> ---Jim
> ---Jane
> ------Jason
> ------Justine
> ---------Jacob
> ------Jeff
>
> that Jim, Jane, Jason, Justine, and Jeff are descendants of Fred BUT Jacob
> is not.
>
> That the way you guys read it?

At first it appears to be what these definitions result in, but if we parse
this step by step, we find that in fact Jacob is also a descendant of Fred.
Like this:

- Jim and Jane are children of Fred, and so by part (1) of the definition of
"descendant", are descendants of Fred.
- Jason, Justine and Jeff are children of Jane, who we have parsed as being
a descendant of Fred, and so by part (2) of the definition of "descendant",
these three are also descendants of Fred.
- Jacob is a child of Justine, who we have parsed as being a descendant of
Fred, and so by part (2) of the definition of "descendant", Jacob is also a
descendant of Fred.

As far as I can see, the "descendant" definition means that any element
which can be linked through a direct series of child to parent relationships
back to an element A is a descendent of element A.

Regards,
Donna

HWG hwg-techniques mailing list archives, maintained by Webmasters @ IWA

This page is part of a preserved archive of archives.hwg.org. The site is no longer active and its content is not maintained. For enquiries about this archive, write to archive(at)iwanet.org.