Main
DOMDocumentSample

DOMDocument Specs

DOMDocument inherits from DOMNode

Properties:
(DOMDocumentType) doctype - read only
(DOMImplementation) implementation - read only
(DOMElement) documentElement - read only
(string) actualEncoding - read only alias for encoding
(string) encoding
(bool) standalone
(string) version
(bool) strictErrorChecking - enable (TRUE)/disable(FALSE) exceptions. Normal PHP errors when disabled - default TRUE
(string) documentURI config - read only
(bool) formatOutput - format output when using save() or saveXML() - default FALSE
(bool) validateOnParser - set Parser to validate document when using load() or loadXML() - default FALSE
(bool) resolveExternals - resolve External Entities but do not validate on load() or loadXML() - default FALSE
(bool) preserveWhiteSpace - preserve whitespace on load() or loadXML() - default TRUE
(bool) substituteEntities - substitute Entities on load() or loadXML() - default FALSE

Methods:

createElement(string name) creates and returns new DOMElement
createDocumentFragment() creates and returns new DOMDocumentFragment
createTextNode(string data) creates and returns new DOMTextNode
createComment(string data) creates and returns new DOMComment
createCDATASection(string data) creates and returns new DOMCDATASection
createProcessingInstruction(string target[, string data]) creates and returns new DOMProcessingInstruction
createAttribute(string name) creates and returns new DOMAttr
createEntityReference(string name) creates and returns new DOMEntityReference
getElementsByTagName(string tagname) returns DOMNodeList
importNode(DOMNode importedNode[, bool deep]) import node from another document - raises DOMException
createElementNS(string namespaceURI, string qualifiedName) creates and returns new DOMElement - raises DOMException
createAttributeNS(string namespaceURI, string qualifiedName) creates and returns new DOMAttr - raises DOMException
getElementsByTagNameNS(string namespaceURI, string localName) returns DOMNodeList
getElementById(string elementId) returns DOMElement
adoptNode(DOMNode source) not implemented
normalizeDocument() void
renameNode(DOMNode node, string namespaceURI, string qualifiedName) not implemented
load(string filename) load a DOMDocument from filename
save(string filename) save a DOMDocument to filename
loadXML(string source) load a DOMDocument from string
saveXML([DOMNode node]) save a DOMDocument or DOMNode to string