method
[]
![Some documentation Importance_1](https://d2vfyqvduarcvs.cloudfront.net/images/importance_1.png?1349367920)
[](name)
public
Fetches an attribute value. If you want to get the Attribute itself, use get_attribute()
name: | an XPath attribute name. Namespaces are relevant here. |
Returns: | 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='<'/>" doc.root.attributes['att'] #-> '<' doc.root.attributes['bar:att'] #-> '2'