るりまサーチ

最速Rubyリファレンスマニュアル検索!
204件ヒット [1-100件を表示] (0.149秒)
トップページ > 種類:インスタンスメソッド[x] > クエリ:d[x] > クラス:REXML::Element[x]

別のキーワード

  1. bigdecimal/util to_d
  2. float to_d
  3. rsa d
  4. rsa d=
  5. matrix d

検索結果

<< 1 2 3 > >>

REXML::Element#cdatas -> [REXML::CData] (6202.0)

すべての cdata 子ノードの配列を返します。

...すべての cdata 子ノードの配列を返します。

返される配列は freeze されます。...

REXML::Element#document -> REXML::Document | nil (6202.0)

self が属する文書(REXML::Document)オブジェクトを返します。

...self が属する文書(REXML::Document)オブジェクトを返します。

属する文書がない場合には nil を返します。...

REXML::Element#root_node -> REXML::Document | REXML::Node (6202.0)

self が属する文書のルートノードを返します。

...::Document) オブジェクトが
返されます。

その要素が属する REXML::Document オブジェクトが存在しない
場合は木構造上のルートノードが返されます。

//emlist[][ruby]{
require 'rexml/document'
d
oc = REXML::Document.new(<<EOS)
<root>
<children>
<grandc...
...hildren />
</children>
</root>
EOS

children = doc.get_elements("/root/children").first
children.name # => "children"
children.root_node == doc # => true
grandchildren = doc.get_elements("/root/children/grandchildren").first
grandchildren.name # => "grandchildren"
grandchildren.root_node == doc # =>...

REXML::Element#delete_element(element) -> REXML::Element (6132.0)

子要素を削除します。

...子要素を削除します。

element で削除する要素を指定できます。整数、文字列、REXML::Element
オブジェクトのいずれかが指定できます。

REXML::Element
を指定すると、その要素が削除されます。
整数を指定すると、element 番目の要...
...@see REXML::Elements#delete

//emlist[][ruby]{
require 'rexml/document'
d
oc = REXML::Document.new '<a><b/><c/><c id="1"/><d/><c/></a>'
d
oc.delete_element("/a/b")
d
oc.to_s # => "<a><c/><c id='1'/><d/><c/></a>"
d
oc.delete_element("a/c[@id='1']")
d
oc.to_s # => "<a><c/><d/><c/></a>"
d
oc.root.delete_ele...
...ment("c")
d
oc.to_s # => "<a><d/><c/></a>"
d
oc.root.delete_element("c")
d
oc.to_s # => "<a><d/></a>"
d
oc.root.delete_element(1)
d
oc.to_s # => "<a/>"
//}...

REXML::Element#add_attributes(attrs) -> () (6126.0)

要素の属性を複数追加します。 同じ名前の属性がすでにある場合はその属性を新しい 属性で置き換えます。

...属性の属性名と属性値の対の集合(Array or Hash)

//emlist[][ruby]{
require 'rexml/document'
e = REXML::Element.new("e")
e.add_attributes({"a" => "b", "c" => "d"})
e # => <e a='b' c='d'/>
e = REXML::Element.new("e")
e.add_attributes([["a", "b"], ["c", "d"]])
e # => <e a='b' c='d'/>
//}...

絞り込み条件を変える

REXML::Element#add_attribute(attr) -> () (6114.0)

要素の属性を追加します。 同じ名前の属性がすでにある場合はその属性を新しい 属性で置き換えます。

...ormalized な文字列を渡す必要があります。

@param key 属性名(文字列)
@param value 属性値(文字列)
@param attr 属性(REXML::Attribute オブジェクト)

//emlist[][ruby]{
require 'rexml/document'
d
oc = REXML::Document.new("<e/>")
d
oc.root.add_attribute("a", "b"); doc.root...
...# => <e a='b'/>
d
oc.root.add_attribute("x:a", "c"); doc.root # => <e a='b' x:a='c'/>
d
oc.root.add_attribute(REXML::Attribute.new("b", "d"))
d
oc.root # => <e a='b' x:a='c' b='d'/>
//}...

REXML::Element#add_attribute(key, value) -> () (6114.0)

要素の属性を追加します。 同じ名前の属性がすでにある場合はその属性を新しい 属性で置き換えます。

...ormalized な文字列を渡す必要があります。

@param key 属性名(文字列)
@param value 属性値(文字列)
@param attr 属性(REXML::Attribute オブジェクト)

//emlist[][ruby]{
require 'rexml/document'
d
oc = REXML::Document.new("<e/>")
d
oc.root.add_attribute("a", "b"); doc.root...
...# => <e a='b'/>
d
oc.root.add_attribute("x:a", "c"); doc.root # => <e a='b' x:a='c'/>
d
oc.root.add_attribute(REXML::Attribute.new("b", "d"))
d
oc.root # => <e a='b' x:a='c' b='d'/>
//}...

REXML::Element#add_element(element, attrs = nil) -> Element (6102.0)

子要素を追加します。

...子要素を追加します。

element として追加する要素を指定します。
REXML::Element
オブジェクトもしくは文字列を指定します。

element として REXML::Element オブジェクトを指定した場合、それが追加されます。
文字列を指定した場...
...ist[][ruby]{
require 'rexml/document'
d
oc = REXML::Document.new('<a/>')
el = doc.root.add_element 'my-tag' # => <my-tag/>
d
oc.root.to_s # => "<a><my-tag/></a>"
el = doc.root.add_element 'my-tag', {'attr1'=>'val1', 'attr2'=>'val2'}
# => <my-tag attr1='val1' attr2='val2'/>
d
oc.root.to_s # => "<a><my-t...
...ag/><my-tag attr1='val1' attr2='val2'/></a>"
el = REXML::Element.new 'my-tag'
d
oc.root.add_element el # => <my-tag/>
d
oc.root.to_s # => "<a><my-tag/><my-tag attr1='val1' attr2='val2'/><my-tag/></a>"
//}

@see REXML::Elements#add, REXML::Element.new...

REXML::Element#add_namespace(prefix, uri) -> self (6102.0)

名前空間を要素に追加します。

...ire 'rexml/document'
a = REXML::Element.new("a")
a.add_namespace("xmlns:foo", "bar" )
a.add_namespace("foo", "bar") # 上と同じ意味
a.add_namespace("twiddle")
a.to_s # => "<a xmlns:foo='bar' xmlns='twiddle'/>"
a.add_namespace("foo", "baz")
a.to_s # => "<a xmlns:foo='baz' xmlns='twiddle'/>"
//}...
<< 1 2 3 > >>