views:

26

answers:

1

Why are Element objects a subclass of Node objects? Aren't elements and nodes the same thing, with different names? Or are there other kinds of Node?

+3  A: 

Elements are not the only node type.

  • Element nodes are nodes that contain other nodes.

  • Text nodes are nodes that contain text.

  • Attribute nodes are nodes that contain attributes.

Anon.
Thanks. I didn't even think that plain old text became nodes! Accepting when SO lets me...
Delan Azabani