XML DOM tutoria...login
XML DOM tutorial
author:php.cn  update time:2022-04-13 15:27:56

DOM - Attribute



Attr object

The Attr object represents the attribute of the Element object. The allowed values ​​for a property are usually defined in the DTD.

Since the Attr object is also a node, it inherits the properties and methods of the Node object. However, properties cannot have a parent node, and properties are not considered children of elements. Many Node properties will return null.

Attr Object Attribute

AttributeDescription
baseURIReturn the absolute base URI of the attribute.
isIdReturns true if the attribute is of type ID, false otherwise.
localName Returns the local part of the property name.
nameReturns the name of the attribute.
namespaceURIReturns the namespace URI of the property.
nodeName Returns the name of the node, according to its type.
nodeTypeReturns the type of node.
nodeValue Sets or returns the value of a node, according to its type.
ownerDocumentReturns the root element (document object) to which the attribute belongs.
ownerElement Returns the element node to which the attribute is attached.
prefix Sets or returns the namespace prefix of the attribute.
schemaTypeInfoReturns the type information associated with the attribute.
specifiedReturns true if the attribute value is set in the document, false if its default value is set in the DTD/Schema.
textContentSets or returns the text content of the property.
valueSet or return the value of the attribute.

php.cn