44件ヒット
[1-44件を表示]
(0.037秒)
別のキーワード
ライブラリ
-
rexml
/ document (44)
キーワード
- attribute (11)
-
get
_ elements (11) -
get
_ text (11) - text (11)
検索結果
先頭4件
-
REXML
:: Element # get _ text(path = nil) -> REXML :: Text | nil (6114.0) -
先頭のテキスト子ノードを返します。
...れる
テキストノードの文字列を返します。
テキストノードがない場合には 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 # get _ elements(xpath) -> [REXML :: Element] (6108.0) -
xpath にマッチする要素を配列で返します。
...xpath にマッチする要素を配列で返します。
xpath には XPath 文字列を指定します。
@param xpath XPath 文字列
@see REXML::Elements#to_a... -
REXML
:: Element # attribute(name , namespace = nil) -> REXML :: Attribute | nil (19.0) -
name で指定される属性を返します。
...いう属性名を持つ属性を指定できます。
指定した属性名の属性がない場合は nil を返します。
@param name 属性名(文字列)
@param namespace 名前空間のURI(文字列)
//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new(<<-EOS)
<root xmlns:f......oo="http://example.org/foo"
xmlns:bar="http://example.org/bar">
<a foo:att='1' bar:att='2' att='<'/>
</root>
EOS
a = doc.get_elements("/root/a").first
a.attribute("att") # => att='<'
a.attribute("att", "http://example.org/bar") # => bar:att='2'
a.attribute("bar:att") # => bar:att='2'
a... -
REXML
:: Element # text(path = nil) -> String | nil (13.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>"...