るりまサーチ (Ruby 2.1.0)

最速Rubyリファレンスマニュアル検索!
5件ヒット [1-5件を表示] (0.071秒)
トップページ > バージョン:2.1.0[x] > クエリ:String[x] > クエリ:b[x] > クラス:REXML::Element[x]

別のキーワード

  1. string []=
  2. string []
  3. string slice
  4. string slice!
  5. string gsub

ライブラリ

キーワード

検索結果

REXML::Element#namespaces -> {String => String} (646.0)

self の文脈で定義されている名前空間の情報を返します。

self の文脈で定義されている名前空間の情報を返します。

対象の要素とその外側の要素で定義されている名前空間を、{ prefix => 識別子 }
というハッシュテーブルで返します。

//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new("<a xmlns:x='1' xmlns:y='2'><b/><c xmlns:z='3'/></a>")
doc.elements['//b'].namespaces # => {"x"=>"1", "y"=>"2"}
//}

REXML::Element#xpath -> String (469.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#namespace(prefix=nil) -> String (415.0)

self の文脈で prefix が指している名前空間の URI を返します。

self の文脈で prefix が指している名前空間の URI を返します。

prefix を省略すると、デフォルトの名前空間の URI を返します。

prefix で指示される名前空間の宣言が存在しない場合は nil を返します。

//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new("<a xmlns='1' xmlns:y='2'><b/><c xmlns:z='3'/><y:d /></a>")
b = doc.elements['//b']
b.namespace # => "1"
...

REXML::Element#prefixes -> [String] (343.0)

self の文脈で定義されている prefix を文字列の配列を返します。

self の文脈で定義されている prefix を文字列の配列を返します。

対象の要素とその外側の要素で定義されている prefix を返します。

//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new("<a xmlns:x='1' xmlns:y='2'><b/><c xmlns:z='3'/></a>")
doc.elements['//b'].prefixes # => ["x", "y"]
//}

REXML::Element#text(path = nil) -> String | nil (343.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 (<...

絞り込み条件を変える