A DOM structure consists of a tree-like collection of objects called "Nodes" and a set of methods that one can use to traverse this hierarchy. The top-level object is referred to as a "Document".
Typically, a DOM Document is created by passing to its parseXML method a string like the following XML description of a person's cd music collection:
<cdlibrary>
<cd id="0001">
<name>Robbie Fulks</name>
<title>Couples in Trouble</title>
</cd>
<cd id="0002">
<name>Richard Thompson</name>
<title>Mock Tudor</title>
</cd>
<cd id="0003">
<name>Keller Williams</name>
<title>Laugh</title>
</cd>
</cdlibrary>
|