class LibXML::XML::Attributes

Provides access to an element’s attributes (XML::Attr).

Basic Usage:

require 'test_helper'

doc = XML::Document.new(<some_file>)
attributes = doc.root.attributes

attributes.each do |attribute|
  ..
end

attributes['foo'] = 'bar'
attribute = attributes.get_attribute['foo']
attribute.value == 'foo'

To access a namespaced attribute:

XLINK_URI = 'http://www.w3.org/1999/xlink'

attribute = attributes.get_attribute_ns(XLINK_URI, 'title')
attribute.value = 'My title'