The DOM extension is the replacement for the
DOM XML extension from PHP 4.
The extension still contains many old functions, but they should no
longer be used. In particular, functions that are not object-oriented
should be avoided.
The extension allows you to operate on an XML document with the DOM API.
The API of the module follows the DOM Level 2 standard as closely
as possible. Consequently, the API is fully object-oriented.
It is a good idea to have the DOM standard available when
using this module.
This module defines a number of classes, which are explained in the
following tables. Classes with an equivalent in the DOM standard are
named DOMxxx.
The Document Type Declaration associated with this document.
documentElement
DOMElement
yes
This is a convenience attribute that allows direct access to the
child node that is the document element of the document.
documentURI
string
no
The location of the document or NULL if undefined.
encoding
string
no
formatOutput
bool
no
implementation
DOMImplementation
yes
The DOMImplementation object that handles
this document.
preserveWhiteSpace
bool
no
Do not remove redundant white space. Default to TRUE.
recover
bool
no
resolveExternals
bool
no
Set it to TRUE to load external entities from a doctype
declaration. This is useful for including character entities in
your XML document.
standalone
bool
no
strictErrorChecking
bool
no
Throws DOMException on errors. Default to TRUE.
substituteEntities
bool
no
validateOnParse
bool
no
Loads and validates against the DTD. Default to FALSE.
version
string
no
xmlEncoding
string
yes
An attribute specifying, as part of the XML declaration, the
encoding of this document. This is NULL when unspecified or when it
is not known, such as when the Document was created in memory.
xmlStandalone
bool
no
An attribute specifying, as part of the XML declaration, whether
this document is standalone. This is FALSE when unspecified.
xmlVersion
string
no
An attribute specifying, as part of the XML declaration, the
version number of this document. If there is no declaration and if
this document supports the "XML" feature, the value is "1.0".
The public identifier associated with the entity if specified, and
NULL otherwise.
systemId
string
yes
The system identifier associated with the entity if specified, and
NULL otherwise. This may be an absolute URI or not.
notationName
string
yes
For unparsed entities, the name of the notation for the entity. For
parsed entities, this is NULL.
actualEncoding
string
no
An attribute specifying the encoding used for this entity at the
time of parsing, when it is an external parsed entity. This is
NULL if it an entity from the internal subset or if it is not
known.
encoding
string
yes
An attribute specifying, as part of the text declaration, the
encoding of this entity, when it is an external parsed entity. This
is NULL otherwise.
version
string
yes
An attribute specifying, as part of the text declaration, the
version number of this entity, when it is an external parsed
entity. This is NULL otherwise.
The DOMImplementation interface provides a number
of methods for performing operations that are independent of any
particular instance of the document object model.
Перечисленные ниже константы определены данным расширением и могут быть
доступны только в том случае, если PHP был собран с
поддержкой этого расширения или же в том случае, если
данное расширение подгружается во время выполнения.
If a call to a method such as insertBefore or removeChild would make the Node
invalid with respect to "partial validity", this exception would be raised and
the operation would not be done.