The DOMAttr class

(PHP 5, PHP 7, PHP 8)

Introduction

DOMAttr represents an attribute in the DOMElement object.

Class synopsis

classDOMAttrextendsDOMNode {
publicreadonlystring$name;
publicreadonlybool$specified = true;
publicreadonly?DOMElement$ownerElement;
publicreadonlymixed$schemaTypeInfo = null;
publicreadonlystring$nodeName;
publicreadonlyint$nodeType;
publicreadonly?DOMNode$parentNode;
publicreadonly?DOMElement$parentElement;
publicreadonlyDOMNodeList$childNodes;
publicreadonly?DOMNode$firstChild;
publicreadonly?DOMNode$lastChild;
publicreadonly?DOMNode$previousSibling;
publicreadonly?DOMNode$nextSibling;
publicreadonlybool$isConnected;
publicreadonly?string$namespaceURI;
publicreadonly?string$localName;
publicreadonly?string$baseURI;
public__construct(string$name, string$value = "")
publicisId(): bool
publicDOMNode::C14N(
    bool$exclusive = false,
    bool$withComments = false,
    ?array$xpath = null,
    ?array$nsPrefixes = null
): string|false
publicDOMNode::C14NFile(
    string$uri,
    bool$exclusive = false,
    bool$withComments = false,
    ?array$xpath = null,
    ?array$nsPrefixes = null
): int|false
publicDOMNode::isSameNode(DOMNode$otherNode): bool
publicDOMNode::isSupported(string$feature, string$version): bool
}

Properties

name

The name of the attribute.

ownerElement

The element which contains the attribute or null.

schemaTypeInfo

Not implemented yet, always is null.

specified

Not implemented yet, always is true.

value

The value of the attribute.

Note:

Note, XML entities are expanded upon setting a value. Thus the & character has a special meaning. Setting value to itself will fail when value contains an &. To avoid entity expansion, use DOMElement::setAttribute() instead.

Table of Contents

To Top