るりまサーチ

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

別のキーワード

  1. _builtin new
  2. _builtin inspect
  3. _builtin []
  4. _builtin to_s
  5. _builtin each

ライブラリ

クラス

検索結果

REXML::Attributes#get_attribute_ns(namespace, name) -> REXML::Attribute | nil (27444.0)

namespace と name で特定される属性を返します。

...namespace で名前空間を、 name で prefix を含まない属性名を
指定します。

指定された属性が存在しない場合は nil を返します。

XML プロセッサが prefix を置き換えてしまった場合でも、このメソッドを
使うことで属性を正し...
...o:att='1' bar:att='2' att='<'/>
</root>
EOS
a = doc.get_elements("/root/a").first

a.attributes.get_attribute_ns("", "att") # => att='&lt;'
a.attributes.get_attribute_ns("http://example.org/foo", "att") # => foo:att='1'
a.attributes.get_attribute_ns("http://example.org/baz", "att") # => nil
a.att...
...ributes.get_attribute_ns("http://example.org/foo", "attt") # => nil
//}...