るりまサーチ

最速Rubyリファレンスマニュアル検索!
900件ヒット [201-300件を表示] (0.124秒)

別のキーワード

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

キーワード

検索結果

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

REXML::Text#to_s -> String (8021.0)

テキストの内容を正規化(すべての実体をエスケープ)された状態で返します。

...値は XML のテキストとして妥当です。

結果は REXML::Text.new で指定した entity_filter を反映しています。

@see REXML::Text#value

//emlist[][ruby]{
require 'rexml/document'
t = REXML::Text.new("< & foobar", false, nil, false)
t.to_s # => "&lt; &amp; foobar"
t.value # =...

REXML::Attribute#namespace(arg = nil) -> String | nil (8015.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_attribute("r").pre...

REXML::Attribute#to_string -> String (8015.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 (8015.0)

属性名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='2' att='&lt;'...

REXML::Attributes#[]=(name, value) (8015.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='2' att='&lt...

絞り込み条件を変える

REXML::Attributes#delete(attribute) -> REXML::Element (8015.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:att='2' att='&lt;...

REXML::Attributes#delete_all(name) -> [REXML::Attribute] (8015.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='2' att='&lt...

REXML::Attributes#each {|name, value| ... } -> () (8015.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='2' att='&lt;...

REXML::Attributes#each_attribute {|attribute| ... } -> () (8015.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='2' att='&lt;'/...
<< < 1 2 3 4 5 ... > >>