108件ヒット
[1-100件を表示]
(0.015秒)
種類
- インスタンスメソッド (72)
- 文書 (24)
- 特異メソッド (12)
ライブラリ
-
rexml
/ document (84)
クラス
-
REXML
:: Attributes (24) -
REXML
:: Element (24) -
REXML
:: Elements (24) -
REXML
:: XPath (12)
キーワード
-
NEWS for Ruby 2
. 1 . 0 (12) -
each
_ attribute (12) -
each
_ element _ with _ attribute (12) -
each
_ element _ with _ text (12) -
ruby 1
. 8 . 3 feature (12) -
to
_ a (12)
検索結果
先頭5件
- REXML
:: Elements # each(xpath = nil) {|element| . . . } -> [REXML :: Elements] - REXML
:: Attributes # each {|name , value| . . . } -> () - REXML
:: XPath . each(element , path = nil , namespaces = {} , variables = {}) {|e| . . . } -> () - REXML
:: Element # each _ element _ with _ attribute(key , value = nil , max = 0 , name = nil) {|element| . . . } -> () - REXML
:: Element # each _ element _ with _ text(text = nil , max = 0 , name = nil) {|element| . . . } -> ()
-
REXML
:: Elements # each(xpath = nil) {|element| . . . } -> [REXML :: Elements] (18155.0) -
全ての子要素に対しブロックを呼び出します。
...。
xpath を指定した場合には、その XPath 文字列に
マッチする要素に対しブロックを呼び出します。
REXML::XPath.each などとは異なり、要素以外の
テキストノードなどはすべて無視されることに注意してください。
@param xpath XP......<d/> がブロックに渡される
doc.root.elements.each {|e|p e}
# <b/>, <b/> がブロックに渡される
doc.root.elements.each('b') {|e|p e} #-> Yields b, b elements
# <b/>,<c/>,<d/>,<b/>,<c/>,<d/> がブロックに渡される
doc.root.elements.each('child::node()') {|e|p e}
# <b/>,<c/>,......<d/>,"sean",<b/>,<c/>,<d/> がブロックに渡される
REXML::XPath.each(doc.root, 'child::node()'){|node| p node }
//}... -
REXML
:: Attributes # each {|name , value| . . . } -> () (18125.0) -
各属性の名前と値に対しブロックを呼び出します。
...e '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").first
a.attributes.each do |name, value|
p [name, value]
end
# => ["foo:at... -
REXML
:: XPath . each(element , path = nil , namespaces = {} , variables = {}) {|e| . . . } -> () (18125.0) -
element の path で指定した XPath 文字列にマッチする各ノード に対してブロックを呼び出します。
...変数名とその値の対応付け
//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new(<<EOS)
<root xmlns:x='1'>
<a>
<b>b1</b>
<x:c />
<b>b2</b>
<d />
</a>
<b> b3 </b>
</root>
EOS
REXML::XPath.each(doc, "/root/a/b"){|e| p e.text }
# >> "b1"
# >> "b2"
//}... -
REXML
:: Element # each _ element _ with _ attribute(key , value = nil , max = 0 , name = nil) {|element| . . . } -> () (6149.0) -
特定の属性を持つすべての子要素を引数としてブロックを呼び出します。
...a>")
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... -
REXML
:: Element # each _ element _ with _ text(text = nil , max = 0 , name = nil) {|element| . . . } -> () (6149.0) -
テキストを子ノードとして 持つすべての子要素を引数としてブロックを呼び出します。
...>b</c><d>d</d><e/></a>'
doc.root.each_element_with_text {|e|p e}
# >> <b> ... </>
# >> <c> ... </>
# >> <d> ... </>
doc.root.each_element_with_text('b'){|e|p e}
# >> <b> ... </>
# >> <c> ... </>
doc.root.each_element_with_text('b', 1){|e|p e}
# >> <b> ... </>
doc.root.each_element_with_text(nil, 0,... -
REXML
:: Attributes # each _ attribute {|attribute| . . . } -> () (6125.0) -
各属性に対しブロックを呼び出します。
...e '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").first
a.attributes.each_attribute do |attr|
p [attr.namespace, attr.name, a... -
ruby 1
. 8 . 3 feature (54.0) -
ruby 1.8.3 feature *((<ruby 1.8 feature>)) *((<ruby 1.8.2 feature>))
...ョンを受け付けるようになりました。
cd が :noop オプションを受け付けなくなりました。
cp_r が :dereference_root オプションを受け付けるようになりました。
=== 2005-09-16
: File.join [ruby] [compat]
型チェックを厳密にするよう......b] [new]
追加。
: Net::HTTPHeader#each_capitalized [lib] [compat]
: Net::HTTPHeader#each_capitalized_name [lib] [new]
Net::HTTPHeader#canonical_each は Net::HTTPHeader#each_capitalized
に名前が変わりました。canonical_each も each_capitalized の別名とし
て提供......LE_EVENT#on_event [lib] [bug]
最後に定義したイベントハンドラが有効になるように修正しました。
=== 2005-07-27
: Dir#each [ruby] [bug]
: Dir#entries [ruby] [bug]
1回メソッドを呼んでしまうと空になるバグを修正しました。
$ ruby-1.8.2... -
NEWS for Ruby 2
. 1 . 0 (24.0) -
NEWS for Ruby 2.1.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
..._class_path
* 追加: ObjectSpace.#allocation_method_id
* 追加: ObjectSpace.#allocation_generation
* 追加: ObjectSpace.#reachable_objects_from_root
* 追加: ObjectSpace.#dump
* 追加: ObjectSpace.#dump_all
* OpenSSL::BN
* 拡張: OpenSSL::BN.new Fixnum や Bignum を......なりました。
* tsort
* 追加: TSort#tsort
* 追加: TSort#tsort_each
* 追加: TSort#strongly_connected_components
* 追加: TSort#each_strongly_connected_component
* 追加: TSort#each_strongly_connected_component_from
* webrick
* レスポンスボディは rea... -
REXML
:: Elements # to _ a(xpath = nil) -> [REXML :: Element] (24.0) -
すべての子要素の配列を返します。
...REXML::Elements#each と同様、REXML::XPath.match などと
異なり、要素以外の子ノードは無視されます。
@param xpath XPath文字列
//emlist[][ruby]{
require 'rexml/document'
require 'rexml/xpath'
doc = REXML::Document.new '<a>sean<b/>elliott<c/></a>'
doc.root.elements.to_a......# => [<b/>, <c/>]
doc.root.elements.to_a("child::node()") # => [<b/>, <c/>]
REXML::XPath.match(doc.root, "child::node()") # => ["sean", <b/>, "elliott", <c/>]
//}...