11件ヒット
[1-11件を表示]
(0.113秒)
ライブラリ
-
rexml
/ document (11)
クラス
-
REXML
:: Attributes (11)
検索結果
-
REXML
:: Attributes # each _ attribute {|attribute| . . . } -> () (36513.0) -
各属性に対しブロックを呼び出します。
...ttribute オブジェクトで渡されます。
//emlist[][ruby]{
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='<'/>
</root>
EOS
a = doc.get_elements("/root/a").firs......t
a.attributes.each_attribute do |attr|
p [attr.namespace, attr.name, attr.value]
end
# => ["http://example.org/foo", "att", "1"]
# => ["http://example.org/bar", "att", "2"]
# => ["", "att", "<"]
//}...