Project

General

Profile

Bug #8301 ยป attributes_to_a.rb

ohai (Ippei Obayashi), 04/20/2013 04:39 PM

 
1
require 'rexml/document'
2

    
3
doc = REXML::Document.new(<<EOS)
4
<root xmlns:foo="http://example.org/foo"
5
      xmlns:bar="http://example.org/bar">
6
  <a foo:att='1' bar:att='2' att='&lt;' baz="4"/>
7
</root>
8
EOS
9

    
10
a = doc.get_elements("/root/a").first
11
p a.attributes.to_a