Additional Creation Methods

A number of less common node types can be created in the same way as createElement, createTextNode, and createCDATASection.

createComment

A comment can be created and added to your xml document using the createComment method.


$comment =& $cdCollection->createComment("This is my CD collection");
$cdCollection->documentElement->appendChild($comment);

createProcessingInstruction

A processing instruction can be created and added to your document using the createProcessingInstruction method.


$instruction =& $cdCollection->createProcessingInstruction
    ("xml-stylesheet", "type=\"text/css\" href=\"standard.css\"");
$cdCollection->appendChild($instruction);

createDocumentFragment

A document fragment can be created using the createDocumentFragment method. A document fragment is a temporary document-like node that can be used to store nodes that have not yet been added to the DOM tree.


$tempDoc =& $cdCollection->createDocumentFragment();
$tempDoc->appendChild($cdCollection->createElement("cd"));


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