instance method REXML::Attributes#prefixes

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

self の中で宣言されている prefix の集合を文字列の配列で返します。

self が属する要素より上位の要素で定義されているものは含みません。


require 'rexml/document'

doc = REXML::Document.new(<<EOS)
<root xmlns:foo="http://example.org/foo"
      xmlns:bar="http://example.org/bar">
  <a foo:att='1' bar:att='2' att='&lt;'/>
</root>
EOS
a = doc.get_elements("/root/a").first

p doc.root.attributes.prefixes # => ["foo", "bar"]
p a.attributes.prefixes # => []