るりまサーチ

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

別のキーワード

  1. _builtin <
  2. bigdecimal <
  3. complex <
  4. integer <
  5. float <

ライブラリ

クラス

検索結果

REXML::Element#text=(text) (18131.0)

「先頭の」テキストノードを text で置き換えます。

...ment.new('<a><b/></a>')
doc.to_s # => "<a><b/></a>"
doc.root.text = "Foo"; doc.to_s # => "<a><b/>Foo</a>"
doc.root.text = "Bar"; doc.to_s # => "<a><b/>Bar</a>"
doc.root.add_element "c"
doc.root.text = "Baz"; doc.to_s # => "<a><b/>Baz<c/></a>"
doc.root.text = nil; doc.to_s # => "<a><b/><c/></a>"
//}...

REXML::Element#each_element_with_text(text = nil, max = 0, name = nil) {|element| ... } -> () (44.0)

テキストを子ノードとして 持つすべての子要素を引数としてブロックを呼び出します。

...:Document.new '<a><b>b</b><c>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.eac...
...h_element_with_text(nil, 0, 'd'){|e|p e}
# >> <d> ... </>
//}...