DOMElement
class DOMElement extends DOMNode implements DOMParentNode, DOMChildNode (View source)
The DOMElement 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 | ||
DOMNode> | $childNodes | from DOMNode | |
DOMNode|null | $firstChild | ||
DOMNode|null | $lastChild | ||
DOMNode|null | $previousSibling | ||
DOMNode|null | $nextSibling | ||
DOMAttr> | $attributes | ||
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 | |
bool | $schemaTypeInfo | ||
string | $tagName | ||
$firstElementChild | |||
$lastElementChild | |||
$childElementCount | |||
$previousElementSibling | |||
$nextElementSibling | |||
string | $id | ||
string | $className |
Methods
Checks if feature is supported for specified version
Gets the namespace prefix of the node based on the namespace URI
Checks if the specified namespaceURI is the default namespace or not
Gets the namespace URI of the node based on the prefix
Gets the namespace URI of the node based on the prefix
Canonicalize nodes to a string
Canonicalize nodes to a file.
Returns value of attribute
Adds new attribute
Removes attribute
Returns attribute node
Gets elements by tagname
Returns value of attribute
Adds new attribute
Removes attribute
Returns attribute node
Get elements by namespaceURI and localName
Checks to see if attribute exists
Checks to see if attribute exists
Declares the attribute specified by name to be of type ID
Declares the attribute specified by local name and namespace URI to be of type ID
Declares the attribute specified by node to be of type ID
Replace current node with new node(s), a combination of {DOMChildNode::remove()} + {DOMChildNode::append()}.
No description
Creates a new DOMElement object
No description
No description
No description
Details
DOMNode
insertBefore(DOMNode $node, null|DOMNode $child = null)
Adds a new child before a reference node
bool
hasChildNodes()
Checks if node has children
DOMNode
cloneNode(bool $deep = false)
Clones a node
void
normalize()
Normalizes the node
bool
isSupported(string $feature, string $version)
Checks if feature is supported for specified version
bool
hasAttributes()
Checks if node has attributes
int
compareDocumentPosition(DOMNode $other)
No description
bool
isSameNode(DOMNode $otherNode)
Indicates if two nodes are the same node
string|null
lookupPrefix(string $namespace)
Gets the namespace prefix of the node based on the namespace URI
bool
isDefaultNamespace(string $namespace)
Checks if the specified namespaceURI is the default namespace or not
string|null
lookupNamespaceURI(string|null $prefix)
Gets the namespace URI of the node based on the prefix
string|null
lookupNamespaceUri(string|null $prefix)
Gets the namespace URI of the node based on the prefix
bool
isEqualNode($otherNode)
No description
getFeature($feature, $version)
No description
setUserData($key, $data, $handler)
No description
getUserData($key)
No description
string|null
getNodePath()
Gets an XPath location path for the node
int
getLineNo()
Get line number for a node
string|false
C14N(bool $exclusive = false, bool $withComments = false, null|array $xpath = null, null|array $nsPrefixes = null)
Canonicalize nodes to a string
int|false
C14NFile(string $uri, bool $exclusive = false, bool $withComments = false, null|array $xpath = null, null|array $nsPrefixes = null)
Canonicalize nodes to a file.
bool
contains(DOMNode|DOMNameSpaceNode|null $other)
No description
DOMNode
getRootNode(array|null $options = null)
No description
array
__sleep()
No description
void
__wakeup()
No description
string
getAttribute(string $qualifiedName)
Returns value of attribute
DOMAttr|false
setAttribute(string $qualifiedName, string $value)
Adds new attribute
bool
removeAttribute(string $qualifiedName)
Removes attribute
DOMAttr
getAttributeNode(string $qualifiedName)
Returns attribute node
bool
removeAttributeNode(DOMAttr $attr)
Removes attribute
DOMNodeList
getElementsByTagName(string $qualifiedName)
Gets elements by tagname
string
getAttributeNS(string $namespace, string $localName)
Returns value of attribute
void
setAttributeNS(string $namespace, string $qualifiedName, string $value)
Adds new attribute
void
removeAttributeNS(string $namespace, string $localName)
Removes attribute
DOMAttr
getAttributeNodeNS(string $namespace, string $localName)
Returns attribute node
DOMNodeList
getElementsByTagNameNS(string $namespace, string $localName)
Get elements by namespaceURI and localName
bool
hasAttribute(string $qualifiedName)
Checks to see if attribute exists
bool
hasAttributeNS(string $namespace, string $localName)
Checks to see if attribute exists
void
setIdAttribute(string $qualifiedName, bool $isId)
Declares the attribute specified by name to be of type ID
void
setIdAttributeNS(string $namespace, string $qualifiedName, bool $isId)
Declares the attribute specified by local name and namespace URI to be of type ID
void
setIdAttributeNode(DOMAttr $attr, bool $isId)
Declares the attribute specified by node to be of type ID
void
remove()
Acts as a simpler version of {DOMNode
void
before(DOMNode|string|null ...$nodes)
Add passed node(s) before the current node
void
after(DOMNode|string|null ...$nodes)
Add passed node(s) after the current node
void
replaceWith(DOMNode|string|null ...$nodes)
Replace current node with new node(s), a combination of {DOMChildNode::remove()} + {DOMChildNode::append()}.
void
append(DOMNode|string|null ...$nodes)
Appends one or many nodes to the list of children behind the last child node.
void
prepend(DOMNode|string|null ...$nodes)
Prepends one or many nodes to the list of children before the first child node.
void
replaceChildren(...$nodes)
No description
__construct(string $qualifiedName, string|null $value = null, string $namespace = '')
Creates a new DOMElement object
array
getAttributeNames()
No description
bool
toggleAttribute(string $qualifiedName, bool|null $force = null)
No description
DOMElement|null
insertAdjacentElement(string $where, DOMElement $element)
No description
void
insertAdjacentText(string $where, string $data)
No description