48件ヒット
[1-48件を表示]
(0.075秒)
別のキーワード
ライブラリ
-
rdoc
/ context (12) -
rexml
/ document (36)
クラス
-
RDoc
:: Context (12) -
REXML
:: Attributes (24) -
REXML
:: Element (12)
キーワード
-
each
_ attribute (24) -
each
_ element _ with _ attribute (12)
検索結果
先頭4件
-
REXML
:: Attributes # each {|name , value| . . . } -> () (21108.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| . . . } -> () (15322.0) -
各属性に対しブロックを呼び出します。
...各属性に対しブロックを呼び出します。
個々の属性は REXML::Attribute オブジェクトで渡されます。
//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new(<<EOS)
<root xmlns:foo="http://example.org/foo"
xmlns:bar="http://example.org/bar">
<a fo......o: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", "att", "2"]
# => ["", "att", "<"]
//}... -
REXML
:: Element # each _ element _ with _ attribute(key , value = nil , max = 0 , name = nil) {|element| . . . } -> () (12251.0) -
特定の属性を持つすべての子要素を引数としてブロックを呼び出します。
...)
doc.root.each_element_with_attribute('id'){|e| p e }
# >> <b id='1'/>
# >> <c id='2'/>
# >> <d id='1'/>
doc.root.each_element_with_attribute('id', '1'){|e| p e }
# >> <b id='1'/>
# >> <d id='1'/>
doc.root.each_element_with_attribute('id', '1', 1){|e| p e }
# >> <b id='1'/>
doc.root.each_element_wi... -
RDoc
:: Context # each _ attribute {|a| . . . } -> [RDoc :: Attr] (12203.0) -
追加された RDoc::Attr に対してブロックを評価します。
追加された RDoc::Attr に対してブロックを評価します。