るりまサーチ

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

別のキーワード

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

ライブラリ

クラス

キーワード

検索結果

<< < 1 2 >>

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

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

... XPath 文字列で指定される
テキストノードの文字列を返します。

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

@param path XPath文字列
@see REXML::Element#text

//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new "<p>some text <b>thi...
...s 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 (19.0)

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

... XPath 文字列で指定される
テキストノードの文字列を返します。

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

@param path XPath文字列
@see REXML::Element#get_text

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

REXML::Elements#[]=(index, element) (13.0)

集合に要素 element を追加/更新します。

...文字列が指定できます。
整数を指定した場合は index 番目の要素を変更します(1-originです)。
文字列の場合は XPath としてマッチした要素を更新します。

整数/文字列どちらの場合でも対応する要素が存在しない場合は、
末尾...
...:Document.new '<a/>'
doc.root.elements[10] = REXML::Element.new('b')
doc.root.to_s # => "<a><b/></a>"
doc.root.elements[1] # => <b/>
doc.root.elements[1] = REXML::Element.new('c')
doc.root.to_s # => "<a><c/></a>"
doc.root.elements['c'] = REXML::Element.new('d')
doc.root.to_s # => "<a><d/></a>"
//}...
<< < 1 2 >>