るりまサーチ

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

別のキーワード

  1. kernel require
  2. getoptlong require_order
  3. rubygems/custom_require require
  4. irb/ext/use-loader irb_require
  5. kernel require_relative

ライブラリ

クラス

検索結果

REXML::Element#xpath -> String (27443.0)

文書上の対象の要素にのみマッチする xpath 文字列を返します。

...チする xpath 文字列を返します。

//emlist[][ruby]{
require
'rexml/document'
doc = REXML::Document.new('<a><b/><c/></a>')
c = doc.root.elements[2] # <a> .. </a> の中の <c/> 要素
c # => <c/>
c.xpath # => "/a/c"
doc = REXML::Document.new('<a><b/><b/></a>')
b = doc.root.elements[2] # <a...
...> .. </a> の中の2番目の <b/> 要素
b # => <b/>
b.xpath # => "/a/b[2]"
//}...

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

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

...セスできないことに注意してください。

r
aw モードの設定は無視され、常に正規化されたテキストを返します。
R
EXML::Text#value も参照してください。

path を渡した場合は、その XPath 文字列で指定される
テキストノードの文...
...返します。

@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つのテキストノード("some text " と " more text"
# を持ってい...
...るが、前者を返す
doc.root.text # => "some text "
//}...