instance method REXML::Attribute#to_string

to_string -> String[permalink][rdoc][edit]

"name='value'" という形式の文字列を返します。


require 'rexml/document'
e = REXML::Element.new("el")
e.add_attribute("ns:r", "rval")
p e.attributes.get_attribute("r").to_string # => "ns:r='rval'"