DOMElement->getAttribute()

(no version information, might be only in CVS)

DOMElement->getAttribute() -- Returns value of attribute

说明

class DOMElement {

string getAttribute ( string name )

}

Gets the value of the attribute with name name for the current node.

参数

name

The name of the attribute.

返回值

The value of the attribute, or an empty string if no attribute with the given name is found.


add a note add a note User Contributed Notes
Richard Remer
16-Sep-2006 01:45
DOMNode::getAttribute( 'xmlns' ) returns nothing.  Not sure if this is to XML DOM spec, but it isn't very intuitive.  Added to this problem is the fact that DOMNode::lookupNamespaceURI( null ) returns nothing as well.  As far as I can tell, there is no way to determine what the default namespace is in an XML document.