DOMIT! v 0.1 Tutorial
<<    index    >>
1    2    3    4    5     6    7    8    9    10    11    12    13    14    15   
16    17    18    19    20    21    22    23    24    25    26   
The documentElement Node

Once populated, a DOMIT_Document does not contain much in the way of useful data. It does, however, have a reference to a root node named documentElement. In the case of our cd collection, the document element is a node of class DOMIT_Element which:

  • has a nodeName of "cdLibrary".
  • has a nodeType of 1.
  • has a nodeValue of null.

The last two properties are standard values for an Element node in the DOM specification and never change. The nodeName of an Element is always identical to its tag name.

If you wish to access any of these properties, your code should look like this:

  • $myNodeName = $cdCollection->documentElement->nodeName;

    (returns "cdLibrary")

  • $myNodeType = $cdCollection->documentElement->nodeType;

    (returns 1)

  • $myNodeValue = $cdCollection->documentElement->nodeValue;

    (returns null)


Documentation generated by ClassyDoc, using the DOMIT! and SAXY parsers.
Please visit Engage Interactive to download free copies.