- self[name] -> String | nil[permalink][rdoc][edit]
- 
属性名nameの属性値を返します。 属性値ではなく REXML::Attribute オブジェクトが必要な場合は REXML::Attributes#get_attribute を使ってください。 nameという属性名の属性がない場合は nil を返します。 - [PARAM] name:
- 属性名(文字列)
 require 'rexml/document' doc = REXML::Document.new(<<EOS) <root xmlns:foo="http://example.org/foo" xmlns:bar="http://example.org/bar"> <a foo:att='1' bar:att='2' att='<'/> </root> EOS a = doc.get_elements("/root/a").first p a.attributes["att"] # => "<" p a.attributes["bar:att"] # => "2"