るりまサーチ

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

別のキーワード

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

ライブラリ

クラス

検索結果

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

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

...xt

//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 (8013.0)

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

...ます。

テキストノードがない場合には nil を返します。

@param path XPath文字列
@see 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つのテキス...