[](name) public

Fetches an attribute value. If you want to get the Attribute itself, use get_attribute()


an XPath attribute name. Namespaces are relevant here.


the String value of the matching attribute, or nil if no matching attribute was found. This is the unnormalized value (with entities expanded).

doc = Document.new “<a foo:att=‘1’ bar:att=‘2’ att=‘&lt;’/>” doc.root.attributes[‘att’] #-> ‘<’ doc.root.attributes[‘bar:att’] #-> ‘2’

Show source
Register or log in to add new notes.