2件ヒット
[1-2件を表示]
(0.046秒)
ライブラリ
-
rexml
/ document (2)
検索結果
-
REXML
:: Element # xpath -> String (18607.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... -
REXML
:: Element # text(path = nil) -> String | nil (607.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 (<...