class REXML::Attributes

def add( attribute )


attrs.include?('baz') # => true
attrs.add(REXML::Attribute.new('baz', '3')) # => baz='3'
attrs.add(REXML::Attribute.new('foo:att', '2')) # => foo:att='2'
attrs # => {"att"=>{"foo"=>foo:att='1', "bar"=>bar:att='2', ""=>att='<'}}
attrs = ele.attributes
ele = d.root.elements['//ele'] # =>
d = REXML::Document.new(xml_string)
EOT



xml_string = <<-EOT

returns +attribute+:
attribute of the same name if it exists;
Adds attribute +attribute+, replacing the previous

add(attribute) -> attribute
:call-seq:
def add( attribute )
  self[attribute.name] = attribute
end