Returns an array of Strings containing all of the prefixes declared by this set
of # attributes. The array does not include the default namespace
declaration, if one exists. doc = Document.new(“<a xmlns=‘foo’
xmlns:x=‘bar’ xmlns:y=‘twee’ ”+
# File lib/rexml/element.rb, line 1134
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