るりまサーチ

最速Rubyリファレンスマニュアル検索!
22件ヒット [1-22件を表示] (0.032秒)
トップページ > クエリ:name[x] > クエリ:first[x] > クエリ:namespaces[x]

別のキーワード

  1. _builtin name
  2. resolv each_name
  3. net/imap name
  4. openssl name
  5. win32ole name

ライブラリ

クラス

検索結果

REXML::Attributes#namespaces -> { String => String } (24219.0)

self の中で宣言されている名前空間の集合を返します。

...p://example.org/foo"
xmlns:bar="http://example.org/bar">
<a foo:att='1' bar:att='2' att='&lt;'/>
</root>
EOS
a = doc.get_elements("/root/a").first

p doc.root.attributes.namespaces
# => {"foo"=>"http://example.org/foo", "bar"=>"http://example.org/bar"}
p a.attributes.namespaces
# => {}
//}...

REXML::XPath.first(element, path = nil, namespaces = {}, variables = {}) -> Node | nil (18338.0)

element の path で指定した XPath 文字列にマッチする最初のノードを 返します。

...のルート要素からの
位置でマッチするノードを探します。
path を省略すると "*" を指定したことになります。

name
space で名前空間の対応付けを指定します。

variable で XPath 内の変数に対応する値を指定できます。
XPathインジ...
...

マッチするノードがない場合には nil を返します。

@param element 要素(REXML::Element)
@param path XPath文字列
@param namespace 名前空間とURLの対応付け
@param variables 変数名とその値の対応付け

//emlist[][ruby]{
require 'rexml/document'
doc = REXML...
...<a> ... </>
b1 = REXML::XPath.first(a, "b")
b1.text # => "b1"

REXML::XPath.first(doc, "/root/a/x:c") # => <x:c/>
REXML::XPath.first(a, "x:c") # => <x:c/>
REXML::XPath.first(a, "y:c") # => nil
REXML::XPath.first(a, "y:c", {"y" => "1"}) # => <x:c/>
b2 = REXML::XPath.first(doc, "/root/a/b[text()=$v]",...