public Method

Attributes.each() { |attr.expanded_name, attr.value| ... }

Itterates over each attribute of an Element, yielding the expanded name and value as a pair of Strings.

doc = Document.new '<a x="1" y="2">'
doc.root.attributes.each {|name, value| p name+" => "+value }</a>

Source Code

# File rexml/element.rb, line 1013
def each
  each_attribute do |attr|
    yield attr.expanded_name, attr.value
  end
end
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.