Class: REXML::Attributes

Inherits:
Object
  • Object
show all
Defined in:
lib/test/unit/xml/attributes_mixin.rb

Overview

The REXML::Attributes mix-in adds methods that are useful for attribute collections, but not present in the standard REXML::Attributes class

Instance Method Summary collapse

Instance Method Details

#get_attribute_ns(namespace, name) ⇒ Object

The get_attribute_ns method retrieves a method by its namespace and name. Thus it is possible to reliably identify an attribute even if an XML processor has changed the prefix.



11
12
13
14
15
16
17
18
19
# File 'lib/test/unit/xml/attributes_mixin.rb', line 11

def get_attribute_ns(namespace, name)
  each_attribute() { |attribute|
    if name == attribute.name &&
       namespace == attribute.namespace()
      return attribute
    end
  }
  nil
end