Object Hierarchy

The following table shows the DOM object hierarchy:

Object

Permitted child objects

Document

Element (one is the maximum)

ProcessingInstruction

Comment

DocumentType (one is the maximum)

DocumentFragment

Element ProcessingInstruction Comment Text CDATASection EntityReference

DocumentType

None (leaf node)

EntityReference

Element ProcessingInstruction Comment Text CDATASection EntityReference

Element

Element Text Comment ProcessingInstruction CDATASection EntityReference

Attr

Text EntityReference

ProcessingInstruction

None (leaf node)

Comment

None (leaf node)

Text

None (leaf node)

CDATASection

None (leaf node)

Entity

Element ProcessingInstruction Comment Text CDATASection EntityReference

Notation

None (leaf node)

Get XML in a Nutshell, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.