22件ヒット
[1-22件を表示]
(0.052秒)
ライブラリ
-
rexml
/ document (22)
キーワード
- namespaces (11)
- prefixes (11)
検索結果
-
REXML
:: Attributes # prefixes -> [String] (9218.0) -
self の中で宣言されている prefix の集合を 文字列の配列で返します。
...いる prefix の集合を
文字列の配列で返します。
self が属する要素より上位の要素で定義されているものは含みません。
//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new(<<EOS)
<root xmlns:foo="http://example.org/foo"
xmlns:bar="htt......p://example.org/bar">
<a foo:att='1' bar:att='2' att='<'/>
</root>
EOS
a = doc.get_elements("/root/a").first
p doc.root.attributes.prefixes # => ["foo", "bar"]
p a.attributes.prefixes # => []
//}... -
REXML
:: Attributes # namespaces -> { String => String } (3209.0) -
self の中で宣言されている名前空間の集合を返します。
...り値は名前空間の prefix をキーとし、URI を値とする
Hash を返します。
//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new(<<EOS)
<root xmlns:foo="http://example.org/foo"
xmlns:bar="http://example.org/bar">
<a foo:att='1' bar:att='2' att='<'/>
</r......oot>
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
# => {}
//}...