132件ヒット
[101-132件を表示]
(0.071秒)
別のキーワード
ライブラリ
-
rexml
/ document (132)
クラス
-
REXML
:: Element (60) -
REXML
:: Elements (72)
キーワード
- [] (12)
- []= (12)
- delete (12)
-
delete
_ all (12) - each (12)
-
each
_ element _ with _ attribute (12) -
each
_ element _ with _ text (12) -
get
_ text (12) - text (12)
-
to
_ a (12)
検索結果
先頭3件
-
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>"
//}...