class REXML::Attributes

def get_attribute_ns(namespace, name)


attrs.get_attribute_ns('http://foo', 'nosuch') # => nil
attrs.get_attribute_ns('http://foo', 'att') # => foo:att='1'
attrs = ele.attributes
ele = d.root.elements['//ele'] # =>
d = REXML::Document.new(xml_string)
EOT



xml_string = <<-EOT

that matches the given +namespace+ and +name+:
Returns the \REXML::Attribute object among the attributes

get_attribute_ns(namespace, name)
:call-seq:
def get_attribute_ns(namespace, name)
  result = nil
  each_attribute() { |attribute|
    if name == attribute.name &&
      namespace == attribute.namespace() &&
      ( !namespace.empty? || !attribute.fully_expanded_name.index(':') )
      # foo will match xmlns:foo, but only if foo isn't also an attribute
      result = attribute if !result or !namespace.empty? or
                            !attribute.fully_expanded_name.index(':')
    end
  }
  result
end