るりまサーチ

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

別のキーワード

  1. rexml/document namespaces
  2. element namespaces
  3. doctype namespaces
  4. attributes namespaces
  5. namespaces

ライブラリ

クラス

検索結果

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

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

...<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]",...

REXML::Attributes#namespaces -> { String => String } (18119.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
# => {}
//}...