class DOMNotation extends DOMNode (View source)

The DOMNotation class

Constants

DOCUMENT_POSITION_DISCONNECTED Since: 8.4

DOCUMENT_POSITION_PRECEDING Since: 8.4

DOCUMENT_POSITION_FOLLOWING Since: 8.4

DOCUMENT_POSITION_CONTAINS Since: 8.4

DOCUMENT_POSITION_CONTAINED_BY Since: 8.4

DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC Since: 8.4

Properties

string $nodeName from  DOMNode
string|null $nodeValue from  DOMNode
int $nodeType from  DOMNode
DOMNode|null $parentNode from  DOMNode
DOMNode> $childNodes from  DOMNode
DOMNode|null $firstChild from  DOMNode
DOMNode|null $lastChild from  DOMNode
DOMNode|null $previousSibling from  DOMNode
DOMNode|null $nextSibling from  DOMNode
DOMAttr>|null $attributes from  DOMNode
DOMDocument|null $ownerDocument from  DOMNode
string|null $namespaceURI from  DOMNode
string|null $prefix from  DOMNode
string|null $localName from  DOMNode
string|null $baseURI from  DOMNode
string $textContent from  DOMNode
bool $isConnected from  DOMNode
DOMElement|null $parentElement from  DOMNode
string $publicId
string $systemId

Methods

insertBefore(DOMNode $node, null|DOMNode $child = null)

Adds a new child before a reference node

from  DOMNode
DOMNode|false
replaceChild(DOMNode $node, DOMNode $child)

Replaces a child

from  DOMNode
removeChild(DOMNode $child)

Removes child from list of children

from  DOMNode
appendChild(DOMNode $node)

Adds new child at the end of the children

from  DOMNode
bool
hasChildNodes()

Checks if node has children

from  DOMNode
cloneNode(bool $deep = false)

Clones a node

from  DOMNode
void
normalize()

Normalizes the node

from  DOMNode
bool
isSupported(string $feature, string $version)

Checks if feature is supported for specified version

from  DOMNode
bool
hasAttributes()

Checks if node has attributes

from  DOMNode
int
compareDocumentPosition(DOMNode $other)

No description

from  DOMNode
bool
isSameNode(DOMNode $otherNode)

Indicates if two nodes are the same node

from  DOMNode
string|null
lookupPrefix(string $namespace)

Gets the namespace prefix of the node based on the namespace URI

from  DOMNode
bool
isDefaultNamespace(string $namespace)

Checks if the specified namespaceURI is the default namespace or not

from  DOMNode
string|null
lookupNamespaceURI(string|null $prefix)

Gets the namespace URI of the node based on the prefix

from  DOMNode
string|null
lookupNamespaceUri(string|null $prefix)

Gets the namespace URI of the node based on the prefix

from  DOMNode
bool
isEqualNode($otherNode)

No description

from  DOMNode
getFeature($feature, $version)

No description

from  DOMNode
setUserData($key, $data, $handler)

No description

from  DOMNode
getUserData($key)

No description

from  DOMNode
string|null
getNodePath()

Gets an XPath location path for the node

from  DOMNode
int
getLineNo()

Get line number for a node

from  DOMNode
string|false
C14N(bool $exclusive = false, bool $withComments = false, null|array $xpath = null, null|array $nsPrefixes = null)

Canonicalize nodes to a string

from  DOMNode
int|false
C14NFile(string $uri, bool $exclusive = false, bool $withComments = false, null|array $xpath = null, null|array $nsPrefixes = null)

Canonicalize nodes to a file.

from  DOMNode
bool
contains(DOMNode|DOMNameSpaceNode|null $other)

No description

from  DOMNode
getRootNode(array|null $options = null)

No description

from  DOMNode
array
__sleep()

No description

from  DOMNode
void
__wakeup()

No description

from  DOMNode

Details

DOMNode insertBefore(DOMNode $node, null|DOMNode $child = null)

Adds a new child before a reference node

Parameters

DOMNode $node

The new node.

null|DOMNode $child

[optional]

The reference node. If not supplied, newnode is appended to the children.

Return Value

DOMNode

The inserted node.

DOMNode|false replaceChild(DOMNode $node, DOMNode $child)

Replaces a child

Parameters

DOMNode $node

The new node. It must be a member of the target document, i.e. created by one of the DOMDocument->createXXX() methods or imported in the document by .

DOMNode $child

The old node.

Return Value

DOMNode|false

The old node or false if an error occur.

DOMNode removeChild(DOMNode $child)

Removes child from list of children

Parameters

DOMNode $child

The removed child.

Return Value

DOMNode

If the child could be removed the functions returns the old child.

DOMNode appendChild(DOMNode $node)

Adds new child at the end of the children

Parameters

DOMNode $node

The appended child.

Return Value

DOMNode

The node added.

bool hasChildNodes()

Checks if node has children

Return Value

bool

true on success or false on failure.

DOMNode cloneNode(bool $deep = false)

Clones a node

Parameters

bool $deep

Indicates whether to copy all descendant nodes. This parameter is defaulted to false.

Return Value

DOMNode

The cloned node.

void normalize()

Normalizes the node

Return Value

void

bool isSupported(string $feature, string $version)

Checks if feature is supported for specified version

Parameters

string $feature

The feature to test. See the example of DOMImplementation::hasFeature for a list of features.

string $version

The version number of the feature to test.

Return Value

bool

true on success or false on failure.

bool hasAttributes()

Checks if node has attributes

Return Value

bool

true on success or false on failure.

int compareDocumentPosition(DOMNode $other)

No description

Parameters

DOMNode $other

Return Value

int

bool isSameNode(DOMNode $otherNode)

Indicates if two nodes are the same node

Parameters

DOMNode $otherNode

The compared node.

Return Value

bool

true on success or false on failure.

string|null lookupPrefix(string $namespace)

Gets the namespace prefix of the node based on the namespace URI

Parameters

string $namespace

The namespace URI.

Return Value

string|null

The prefix of the namespace.

bool isDefaultNamespace(string $namespace)

Checks if the specified namespaceURI is the default namespace or not

Parameters

string $namespace

The namespace URI to look for.

Return Value

bool

Return true if namespaceURI is the default namespace, false otherwise.

string|null lookupNamespaceURI(string|null $prefix)

Gets the namespace URI of the node based on the prefix

Parameters

string|null $prefix

The prefix of the namespace.

Return Value

string|null

The namespace URI of the node.

string|null lookupNamespaceUri(string|null $prefix)

Gets the namespace URI of the node based on the prefix

Parameters

string|null $prefix

The prefix of the namespace.

Return Value

string|null

The namespace URI of the node.

bool isEqualNode($otherNode)

No description

Parameters

$otherNode

Return Value

bool

getFeature($feature, $version)

No description

Parameters

$feature
$version

setUserData($key, $data, $handler)

No description

Parameters

$key
$data
$handler

getUserData($key)

No description

Parameters

$key

string|null getNodePath()

Gets an XPath location path for the node

Return Value

string|null

the XPath, or NULL in case of an error.

int getLineNo()

Get line number for a node

Return Value

int

Always returns the line number where the node was defined in.

string|false C14N(bool $exclusive = false, bool $withComments = false, null|array $xpath = null, null|array $nsPrefixes = null)

Canonicalize nodes to a string

Parameters

bool $exclusive

[optional] Enable exclusive parsing of only the nodes matched by the provided xpath or namespace prefixes.

bool $withComments

[optional] Retain comments in output.

null|array $xpath

[optional] An array of xpaths to filter the nodes by.

null|array $nsPrefixes

[optional] An array of namespace prefixes to filter the nodes by.

Return Value

string|false

Canonicalized nodes as a string or FALSE on failure

int|false C14NFile(string $uri, bool $exclusive = false, bool $withComments = false, null|array $xpath = null, null|array $nsPrefixes = null)

Canonicalize nodes to a file.

Parameters

string $uri

Number of bytes written or FALSE on failure

bool $exclusive

[optional] Enable exclusive parsing of only the nodes matched by the provided xpath or namespace prefixes.

bool $withComments

[optional] Retain comments in output.

null|array $xpath

[optional] An array of xpaths to filter the nodes by.

null|array $nsPrefixes

[optional] An array of namespace prefixes to filter the nodes by.

Return Value

int|false

Number of bytes written or FALSE on failure

bool contains(DOMNode|DOMNameSpaceNode|null $other)

Since: 8.3

No description

Parameters

DOMNode|DOMNameSpaceNode|null $other

Return Value

bool

DOMNode getRootNode(array|null $options = null)

Since: 8.3

No description

Parameters

array|null $options

Return Value

DOMNode

array __sleep()

Since: 8.1

No description

Return Value

array

void __wakeup()

Since: 8.1

No description

Return Value

void