るりまサーチ

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

別のキーワード

  1. rexml/document attributes
  2. attributes <<
  3. attributes []
  4. uri attributes
  5. attributes new

検索結果

<< < 1 2 3 4 ... > >>

REXML::Element#has_attributes? -> bool (6102.0)

要素が属性を1つ以上持っていれば真を返します。

要素が属性を1つ以上持っていれば真を返します。

URI::LDAP#attributes=(s) (6102.0)

自身の Attribute を文字列で設定します。

自身の Attribute を文字列で設定します。

@param s 自身の Attribute を文字列で設定します。

REXML::Attributes#delete(attribute) -> REXML::Element (3025.0)

指定した属性を取り除きます。

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

a.attributes.delete("att") # => <a foo:att='1' bar:att='2'/>
a.attributes.delete("foo:att") # => <a bar:att='2'/>
attr = a.attributes.get_attribute("bar:att")
a.attributes.delete(attr) # => <a/>
//}...

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

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

...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.attributes.get_attribute_ns("http://example.org/fo...

REXML::Attributes#[](name) -> String | nil (3019.0)

属性名nameの属性値を返します。

...属性名nameの属性値を返します。

属性値ではなく REXML::Attribute オブジェクトが必要な場合は
REXML::Attributes#get_attribute を使ってください。

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

@param name 属性名(文字列)

//emlis...
...'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

p a.attributes["att"] # => "<"
p a.attributes["bar:att"] # => "2"
//}...

絞り込み条件を変える

REXML::Attributes#[]=(name, value) (3019.0)

指定した属性を更新します。

.../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["att"] = "9"
a.attributes["foo:attt"] = "8"
a # => <a foo:att='1' bar:att='2' att='9' foo:attt='8'/>
//}

@see REXML::Attributes#add...

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

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

...e 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_attr...
...ibute("att") # => att='&lt;'
a.attributes.get_attribute("foo:att") # => foo:att='1'
//}...

REXML::Attributes#namespaces -> { String => String } (3013.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::Attributes#prefixes -> [String] (3013.0)

self の中で宣言されている prefix の集合を 文字列の配列で返します。

...'

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

p doc.root.attributes.prefixes # => ["foo", "bar"]
p a.attributes.prefixes # => []
//}...
<< < 1 2 3 4 ... > >>