るりまサーチ

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

別のキーワード

  1. document root
  2. psych root
  3. rexml/document root
  4. pstore root?
  5. pathname root?

ライブラリ

クラス

検索結果

REXML::Element#get_text(path = nil) -> REXML::Text | nil (18126.0)

先頭のテキスト子ノードを返します。

...ement#text

//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new "<p>some text <b>this is bold!</b> more text</p>"
# doc.root (<p> ... </p>) は2つのテキストノード("some text " と " more text"
# を持っているが、前者を返す
doc.root.get_text.value # => "some text...

REXML::Element#text(path = nil) -> String | nil (25.0)

先頭のテキスト子ノードの文字列を返します。

...e REXML::Element#get_text

//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new "<p>some text <b>this is bold!</b> more text</p>"
# doc.root (<p> ... </p>) は2つのテキストノード("some text " と " more text"
# を持っているが、前者を返す
doc.root.text # => "some...