るりまサーチ

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

別のキーワード

  1. _builtin to_a
  2. matrix to_a
  3. to_a
  4. dbm to_a
  5. argf.class to_a

モジュール

キーワード

検索結果

<< 1 2 3 ... > >>

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

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

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

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

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

XML プロセッサが prefix を置き換えてしまった場合...
...@param namespace 名前空間(URI, 文字列)
@param name 属性名(文字列)

//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='&lt;'/>
</root>
EOS
a
=...
...nts("/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
.attributes.get_attribute_ns("http://example.org/foo", "attt") # =>...

REXML::Attributes#get_attribute(name) -> Attribute | nil (9233.0)

name という名前の属性を取得します。

...name という名前の属性を取得します。

name という名前を持つ属性がない場合は nil を返します。

@param name 属性名(文字列)
@see REXML::Attributes#[]

//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='&lt;'/>
</root>
EOS
a
= doc.get_elements("/root/a").first

a
.attributes.get_attribute("att") # => att='&lt;'
a
.attributes.get_attribute("foo:att") # => foo:att='1'
//}...

REXML::Namespace#name=(name) (9203.0)

名前を設定します。

...名前を設定します。

prefix を持つ名前も持たない名前も受け付けます。

@param name 名前(文字列)...

REXML::Attributes#each_attribute {|attribute| ... } -> () (9127.0)

各属性に対しブロックを呼び出します。

...L::Attribute オブジェクトで渡されます。

//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='&lt;'/>
</root>
EOS
a
= doc.get_elements("/root/a")....
...first

a
.attributes.each_attribute do |attr|
p [attr.namespace, attr.name, attr.value]
end
# => ["http://example.org/foo", "att", "1"]
# => ["http://example.org/bar", "att", "2"]
# => ["", "att", "<"]
//}...

REXML::Attribute#xpath -> String (9103.0)

その属性を指定する xpath 文字列を返します。

...その属性を指定する xpath 文字列を返します。

例えば "/foo/bar/@ns:r" という文字列を返します。...

絞り込み条件を変える

REXML::Namespace#expanded_name -> String (9103.0)

REXML::Namespace#name= で設定された名前を返します。

...REXML::Namespace#name= で設定された名前を返します。

name= で指定した名前が prefix を含んでいれば
prefix を含む名前を返し、そうでなければ
prefix を含まない名前を返します。

@see REXML::Namespace#prefix...

REXML::Namespace#fully_expanded_name -> String (9103.0)

完全修飾名を返します。

完全修飾名を返します。

REXML::Namespace#has_name?(other, ns = nil) -> bool (9103.0)

self が other と ns で指定した名前を持っているならば真を返します。

...(つまり prefix を含んでいる)場合は
REXML::Namespace#fully_expanded_name と other を比較します。
どちらでもない場合は other と REXML::Namespace#name を直接
比較します。

@param other 比較する名前(文字列)
@param ns 比較する名前空間(文字列)...

REXML::Namespace#local_name -> String (9103.0)

prefix を含まない「ローカルな」名前を返します。

prefix を含まない「ローカルな」名前を返します。
<< 1 2 3 ... > >>