class REXML::Attributes
def prefixes
d.root.attributes.prefixes # => ["x", "y"]
d = REXML::Document.new(xml_string)
xml_string = ''
namespace declaration, if one exists.
The array does not include the default
Returns an array of prefix strings in the attributes.
prefixes -> array_of_prefix_strings
:call-seq:
def prefixes ns = [] each_attribute do |attribute| ns << attribute.name if attribute.prefix == 'xmlns' end if @element.document and @element.document.doctype expn = @element.expanded_name expn = @element.document.doctype.name if expn.size == 0 @element.document.doctype.attributes_of(expn).each { |attribute| ns << attribute.name if attribute.prefix == 'xmlns' } end ns end