るりまサーチ (Ruby 2.3.0)

最速Rubyリファレンスマニュアル検索!
1件ヒット [1-1件を表示] (0.176秒)

別のキーワード

  1. rexml/document new
  2. rexml/document write
  3. rexml/document to_s
  4. rexml/document clone
  5. rexml/document node_type

ライブラリ

検索結果

REXML::Elements#size -> Integer (78364.0)

保持している要素の個数を返します。

保持している要素の個数を返します。

//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new '<a>sean<b/>elliott<b/>russell<b/></a>'
# doc.root は3つの要素と3つのテキストノードを持つため、6を返す
doc.root.size # => 6
# そのうち要素は3つであるため、以下は3を返す
doc.root.elements.size # => 3
//}