るりまサーチ

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

別のキーワード

  1. rexml/document new
  2. rexml/document write
  3. rexml/document to_s
  4. rexml/document clone
  5. rexml/document node_type

ライブラリ

モジュール

キーワード

検索結果

<< 1 2 3 ... > >>

REXML::Attribute#namespace(arg = nil) -> String | nil (8007.0)

属性の名前空間の URI を返します。

...間でなく、arg という名前空間
の URI が返されます。
通常は省略します。

//emlist[][ruby]{
require 'rexml/document'
e = REXML::Element.new("el")
e.add_attribute("xmlns:ns", "http://www.example.com/ns")
e.add_attribute("ns:r", "rval")
p e.attributes.get_attrib...

REXML::Attribute#prefix -> String (8007.0)

属性の名前空間を返します。

...属性の名前空間を返します。

//emlist[][ruby]{
require 'rexml/document'
e = REXML::Element.new( "elns:myelement" )
e.add_attribute( "nsa:a", "aval" )
e.add_attribute( "b", "bval" )
p e.attributes.get_attribute( "a" ).prefix # -> "nsa"
p e.attributes.get_attribute( "b" ).prefix # -> "...

REXML::Attribute#to_string -> String (8007.0)

"name='value'" という形式の文字列を返します。

..."name='value'" という形式の文字列を返します。

//emlist[][ruby]{
require 'rexml/document'
e = REXML::Element.new("el")
e.add_attribute("ns:r", "rval")
p e.attributes.get_attribute("r").to_string # => "ns:r='rval'"
//}...

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

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

...い。

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

@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...

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

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

...同じ名前の属性がある場合は上書きされ、
そうでない場合は属性が追加されます。

//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=...

絞り込み条件を変える

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

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

...を返します。

@param attribute 取り除く属性(文字列もしくは REXML::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:at...

REXML::Attributes#delete_all(name) -> [REXML::Attribute] (8007.0)

name という名前を持つ属性をすべて削除します。

...て削除します。

削除された属性を配列で返します。

@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=...

REXML::Attributes#each {|name, value| ... } -> () (8007.0)

各属性の名前と値に対しブロックを呼び出します。

...ックを呼び出します。

名前には expanded_name(REXML::Namespace#exapnded_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='...

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

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

...ブロックを呼び出します。

個々の属性は REXML::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=...

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

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:at...

絞り込み条件を変える

<< 1 2 3 ... > >>