DOM Reference

Reference for the classes exposed by PHP's DOM extension (php.net/manual/en/book.dom.php 331 ). All node types extend DOMNode.

DOMNode

readonly string $nodeName;
string $nodeValue;
readonly int $nodeType;
readonly DOMNode $parentNode;
readonly DOMNodeList $childNodes;
readonly DOMNode $firstChild;
readonly DOMNode $lastChild;
readonly DOMNode $previousSibling;
readonly DOMNode $nextSibling;
readonly DOMNamedNodeMap $attributes;
readonly DOMDocument $ownerDocument;
readonly string $namespaceURI;
string $prefix;
readonly string $localName;
readonly string $baseURI;
readonly string $textContent;
DOMNode appendChild 331 (DOMNode $newnode)
string C14N 331 ([bool $exclusive [, bool $with_comments [, array $xpath [, array $ns_prefixes]]]])
int C14NFile 331 (string $uri [, bool $exclusive [, bool $with_comments [, array $xpath [, array $ns_prefixes]]]])
DOMNode cloneNode 331 ([bool $deep])
int getLineNo 331 (void)
string getNodePath 331 (void)
bool hasAttributes 331 (void)
bool hasChildNodes 331 (void)
DOMNode insertBefore 331 (DOMNode $newnode [, DOMNode $refnode])
bool isDefaultNamespace 331 (string $namespaceURI)
bool isSameNode 331 (DOMNode $node)
bool isSupported 331 (string $feature, string $version)
string lookupNamespaceURI 331 (string $prefix)
string lookupPrefix 331 (string $namespaceURI)
void normalize 331 (void)
DOMNode removeChild 331 (DOMNode $oldnode)
DOMNode replaceChild 331 (DOMNode $newnode, DOMNode $oldnode)

DOMDocument extends DOMNode

readonly string $actualEncoding;
readonly DOMConfiguration $config;
readonly DOMDocumentType $doctype;
readonly DOMElement $documentElement;
string $documentURI;
string $encoding;
bool $formatOutput;
readonly DOMImplementation $implementation;
bool $preserveWhiteSpace = true;
bool $recover;
bool $resolveExternals;
bool $standalone;
bool $strictErrorChecking = true;
bool $substituteEntities;
bool $validateOnParse = false;
string $version;
readonly string $xmlEncoding;
bool $xmlStandalone;
string $xmlVersion;
__construct 331 ([string $version [, string $encoding]])
DOMAttr createAttribute 331 (string $name)
DOMAttr createAttributeNS 331 (string $namespaceURI, string $qualifiedName)
DOMCDATASection createCDATASection 331 (string $data)
DOMComment createComment 331 (string $data)
DOMDocumentFragment createDocumentFragment 331 (void)
DOMElement createElement 331 (string $name [, string $value])
DOMElement createElementNS 331 (string $namespaceURI, string $qualifiedName [, string $value])
DOMEntityReference createEntityReference 331 (string $name)
DOMProcessingInstruction createProcessingInstruction 331 (string $target [, string $data])
DOMText createTextNode 331 (string $content)
DOMElement getElementById 331 (string $elementId)
DOMNodeList getElementsByTagName 331 (string $name)
DOMNodeList getElementsByTagNameNS 331 (string $namespaceURI, string $localName)
DOMNode importNode 331 (DOMNode $importedNode [, bool $deep])
mixed load 331 (string $filename [, int $options = 0])
bool loadHTML 331 (string $source [, int $options = 0])
bool loadHTMLFile 331 (string $filename [, int $options = 0])
mixed loadXML 331 (string $source [, int $options = 0])
void normalizeDocument 331 (void)
bool registerNodeClass 331 (string $baseclass, string $extendedclass)
bool relaxNGValidate 331 (string $filename)
bool relaxNGValidateSource 331 (string $source)
int save 331 (string $filename [, int $options])
string saveHTML 331 ([DOMNode $node = NULL])
int saveHTMLFile 331 (string $filename)
string saveXML 331 ([DOMNode $node [, int $options]])
bool schemaValidate 331 (string $filename [, int $flags])
bool schemaValidateSource 331 (string $source [, int $flags])
bool validate 331 (void)
int xinclude 331 ([int $options])

For the save*() functions, only LIBXML_NOEMPTYTAG is a supported $options value. For the load*() functions and xinclude(), $options accepts any combination of the libxml constants 331 : LIBXML_COMPACT, LIBXML_DTDATTR, LIBXML_DTDLOAD, LIBXML_DTDVALID, LIBXML_HTML_NOIMPLIED, LIBXML_HTML_NODEFDTD, LIBXML_NOBLANKS, LIBXML_NOCDATA, LIBXML_NOEMPTYTAG, LIBXML_NOENT, LIBXML_NOERROR, LIBXML_NONET, LIBXML_NOWARNING, LIBXML_NOXMLDECL, LIBXML_NSCLEAN, LIBXML_PARSEHUGE, LIBXML_PEDANTIC, LIBXML_XINCLUDE, LIBXML_ERR_ERROR, LIBXML_ERR_FATAL, LIBXML_ERR_NONE, LIBXML_ERR_WARNING, LIBXML_VERSION, LIBXML_DOTTED_VERSION, LIBXML_SCHEMA_CREATE. The methods loadXML(), loadHTML(), saveXML(), saveHTML(), relaxNGValidateSource(), and schemaValidateSource() operate on an in-memory string rather than a file.


DOMElement extends DOMNode

readonly bool $schemaTypeInfo;
readonly string $tagName;
__construct 331 (string $name [, string $value [, string $namespaceURI]])
string getAttribute 331 (string $name)
DOMAttr getAttributeNode 331 (string $name)
DOMAttr getAttributeNodeNS 331 (string $namespaceURI, string $localName)
string getAttributeNS 331 (string $namespaceURI, string $localName)
DOMNodeList getElementsByTagName 331 (string $name)
DOMNodeList getElementsByTagNameNS 331 (string $namespaceURI, string $localName)
bool hasAttribute 331 (string $name)
bool hasAttributeNS 331 (string $namespaceURI, string $localName)
bool removeAttribute 331 (string $name)
bool removeAttributeNode 331 (DOMAttr $oldnode)
bool removeAttributeNS 331 (string $namespaceURI, string $localName)
DOMAttr setAttribute 331 (string $name, string $value)
DOMAttr setAttributeNode 331 (DOMAttr $attr)
DOMAttr setAttributeNodeNS 331 (DOMAttr $attr)
void setAttributeNS 331 (string $namespaceURI, string $qualifiedName, string $value)
void setIdAttribute 331 (string $name, bool $isId)
void setIdAttributeNode 331 (DOMAttr $attr, bool $isId)
void setIdAttributeNS 331 (string $namespaceURI, string $localName, bool $isId)

DOMAttr extends DOMNode

readonly string $name;
readonly DOMElement $ownerElement;
readonly bool $schemaTypeInfo;
readonly bool $specified;
string $value;
__construct 331 (string $name [, string $value])
bool isId 331 (void)

DOMDocumentFragment extends DOMNode

bool appendXML 331 (string $data)

DOMDocumentType extends DOMNode

readonly string $Id; // publicId
readonly string $systemId;
readonly string $name;
readonly DOMNamedNodeMap $entities;
readonly DOMNamedNodeMap $notations;
readonly string $internalSubset;

DOMNotation extends DOMNode

readonly string $Id; // publicId
readonly string $systemId;

DOMEntity extends DOMNode

readonly string $Id; // publicId
readonly string $systemId;
readonly string $notationName;
string $actualEncoding;
readonly string $encoding;
readonly string $version;

DOMEntityReference extends DOMNode

__construct 331 (string $name)

DOMProcessingInstruction extends DOMNode

readonly string $target;
string $data;
__construct 331 (string $name [, string $value])

DOMCharacterData extends DOMNode

string $data;
readonly int $length;
void appendData 331 (string $data)
void deleteData 331 (int $offset, int $count)
void insertData 331 (int $offset, string $data)
void replaceData 331 (int $offset, int $count, string $data)
string substringData 331 (int $offset, int $count)

DOMComment extends DOMCharacterData

__construct 331 ([string $value])

DOMText extends DOMCharacterData

readonly string $wholeText;
__construct 331 ([string $value])
bool isWhitespaceInElementContent 331 (void)
DOMText splitText 331 (int $offset)

DOMCdataSection extends DOMText

__construct 331 (string $value)

DOMNamedNodeMap implements Traversable

readonly int $length;
DOMNode getNamedItem 331 (string $name)
DOMNode getNamedItemNS 331 (string $namespaceURI, string $localName)
DOMNode item 331 (int $index)

DOMNodeList implements Traversable

readonly int $length;
DOMNode item 331 (int $index)

DOMException extends Exception

readonly int $code;

DOMImplementation

__construct 331 (void)
DOMDocument createDocument 331 ([string $namespaceURI = NULL [, string $qualifiedName = NULL [, DOMDocumentType $doctype = NULL]]])
DOMDocumentType createDocumentType 331 ([string $qualifiedName = NULL [, string $Id = NULL [, string $systemId = NULL]]])
bool hasFeature 331 (string $feature, string $version)