< DOMDocument > Protocol Reference

Inheritance diagram for < DOMDocument >:

< DOMNode > < DOMParent > DOMDocument List of all members.

Detailed Description

Represents a XML-document itself.

A document cannot contain text or attribute nodes, any attempt to append or insert one will result in an exception being raised. A document can only contain one doctype and one element node. Should you try to append or insert a second, the first vill be removed.


Public Member Functions

(void)  setDocumentElement:
(id< DOMElement >)  documentElement
(void)  setDocType:
(id< DOMDocType >)  docType

Member Function Documentation

- (id <DOMDocType>) docType  
 

Returns the doctype of this document.

- (id <DOMElement>) documentElement  
 

Returns the root element of this document.

- (void) setDocType: (id< DOMDocType >)  docType  
 

Sets the doctype of this document.

The doctype is always the first node in the document.

The node is detached before it is set and the previous doctype is detached and removed.

Parameters:
docType The new doctype

- (void) setDocumentElement: (id< DOMElement >)  element  
 

Sets a new root element.

The element is detached before it is set. It will also be added to the same index in the childrens array as the last root element.

The previous root element is detached and removed.

Parameters:
element The new root element