DOMIT! v 0.52 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    27    28    29    30    31   
createElement

Adding your new cd to the existing DOMIT_Document requires that you create and populate a new DOMIT_Element named "cd". You do this using the createElement method of DOMIT_Document.

$newCDNode =& $cdCollection->createElement("cd");

This creates a node that, if printed out using the toString method, would look like this:

<cd></cd>

We need to add an "id" attribute, however, so that the node is consistent with the existing "cd" nodes. We can do this using the setAttribute method:

$newCDNode->setAttribute("id", "4");


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