The DOMAttr class

(PHP 5, PHP 7, PHP 8)

简介

DOMAttr represents an attribute in the DOMElement object.

类摘要

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
}

属性

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, 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.

目录

To Top