132件ヒット
[101-132件を表示]
(0.055秒)
別のキーワード
ライブラリ
-
rexml
/ document (132)
クラス
-
REXML
:: Element (72) -
REXML
:: Elements (60)
キーワード
- [] (12)
- []= (12)
- delete (12)
-
delete
_ element (12) - each (12)
-
each
_ element _ with _ attribute (12) -
each
_ element _ with _ text (12) -
get
_ text (12) - text (12)
-
to
_ a (12)
検索結果
先頭3件
-
REXML
:: Element # delete _ element(element) -> REXML :: Element (37.0) -
子要素を削除します。
...す)。
文字列を指定すると、XPath としてマッチする要素を削除します。
複数の要素がマッチする場合はそのうち1つが削除されます。
@param element 削除する要素
@see REXML::Elements#delete
//emlist[][ruby]{
require 'rexml/document'
doc = REXML::D......nt("/a/b")
doc.to_s # => "<a><c/><c id='1'/><d/><c/></a>"
doc.delete_element("a/c[@id='1']")
doc.to_s # => "<a><c/><d/><c/></a>"
doc.root.delete_element("c")
doc.to_s # => "<a><d/><c/></a>"
doc.root.delete_element("c")
doc.to_s # => "<a><d/></a>"
doc.root.delete_element(1)
doc.to_s # => "<a/>"
//}... -
REXML
:: Element # get _ text(path = nil) -> REXML :: Text | nil (37.0) -
先頭のテキスト子ノードを返します。
...path を渡した場合は、その XPath 文字列で指定される
テキストノードの文字列を返します。
テキストノードがない場合には nil を返します。
@param path XPath文字列
@see REXML::Element#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 (37.0) -
先頭のテキスト子ノードの文字列を返します。
...path を渡した場合は、その XPath 文字列で指定される
テキストノードの文字列を返します。
テキストノードがない場合には nil を返します。
@param path XPath文字列
@see REXML::Element#get_text
//emlist[][ruby]{
require 'rexml/document'
doc = RE......XML::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 text "
//}...