22件ヒット
[1-22件を表示]
(0.050秒)
ライブラリ
-
rexml
/ document (22)
検索結果
先頭2件
-
REXML
:: Attributes # each {|name , value| . . . } -> () (18208.0) -
各属性の名前と値に対しブロックを呼び出します。
...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").first
a.attributes.each do |name, value|
p [name, value]
end
# => ["foo:att", "1"]
# => ["bar:att", "2"]
# => ["att", "<"]
//}... -
REXML
:: Attributes # each _ attribute {|attribute| . . . } -> () (6208.0) -
各属性に対しブロックを呼び出します。
...xmlns:bar="http://example.org/bar">
<a foo:att='1' bar:att='2' att='<'/>
</root>
EOS
a = doc.get_elements("/root/a").first
a.attributes.each_attribute do |attr|
p [attr.namespace, attr.name, attr.value]
end
# => ["http://example.org/foo", "att", "1"]
# => ["http://example.org/bar", "at...