84件ヒット
[1-84件を表示]
(0.028秒)
種類
- インスタンスメソッド (72)
- 文書 (12)
ライブラリ
-
rexml
/ document (72)
クラス
-
REXML
:: Attributes (24) -
REXML
:: Elements (48)
キーワード
- collect (12)
-
each
_ attribute (12) - inject (12)
-
ruby 1
. 8 . 4 feature (12) -
to
_ a (12)
検索結果
先頭5件
-
REXML
:: Elements # each(xpath = nil) {|element| . . . } -> [REXML :: Elements] (21256.0) -
全ての子要素に対しブロックを呼び出します。
...。
xpath を指定した場合には、その XPath 文字列に
マッチする要素に対しブロックを呼び出します。
REXML::XPath.each などとは異なり、要素以外の
テキストノードなどはすべて無視されることに注意してください。
@param xpath XP....../> がブロックに渡される
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| . . . } -> () (18113.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| . . . } -> () (6113.0) -
各属性に対しブロックを呼び出します。
...://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, attr.value]
end
# => ["http://example.org/foo", "att", "1"]
# => ["http://e... -
REXML
:: Elements # to _ a(xpath = nil) -> [REXML :: Element] (3024.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/>]
//}... -
REXML
:: Elements # collect(xpath = nil) {|element| . . } -> [object] (3012.0) -
Enumerable#collect と同様、 各子要素に対しブロックを呼び出し、その返り値の配列を返します。
...merable#collect と同様、
各子要素に対しブロックを呼び出し、その返り値の配列を返します。
xpath を指定した場合は、その XPath 文字列に
マッチする要素に対し同様の操作をします。
@param xpath XPath文字列
@see REXML::Elements#each... -
REXML
:: Elements # inject(xpath = nil , initial = nil) {|element| . . . } -> object (3012.0) -
Enumerable#inject と同様、 各子要素に対し畳み込みをします。
...Enumerable#inject と同様、
各子要素に対し畳み込みをします。
xpath を指定した場合は、その XPath 文字列に
マッチする要素に対し同様の操作をします。
@param xpath XPath文字列
@see REXML::Elements#each... -
ruby 1
. 8 . 4 feature (12.0) -
ruby 1.8.4 feature ruby 1.8.4 での ruby 1.8.3 からの変更点です。
...であってるのかな?
: File.join [bug]
#Wed Oct 19 08:28:32 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
#
# * file.c (rb_file_join): elements may contain null pointer strings.
# report and fixed by Lloyd Zusman (hippoman): [ruby-core:06326]
NULLポインタを持つString......(<ruby-dev:27331>))
: IO [bug]
#Wed Sep 28 08:12:18 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
#
# * io.c (read_buffered_data): check if reached EOF. fixed: [ruby-dev:27334]
Solaris(64bit?)などでEOF後にゴミを読み出すことがあったバグを修正。
((<ruby-dev:273......ttpservlet/cgihandler.rb
# (WEBrick::HTTPServlet::CGIHandler#do_GET): the value of Set-Cookie:
# header field should be splited into each cookie. [ruby-Bugs:2199]
#
# * lib/webrick/cookie.rb (WEBrick::Cookie.parse_set_cookie): new method
# to parse the value of Set-Coo...