るりまサーチ

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

別のキーワード

  1. psych root
  2. pstore root?
  3. document root
  4. pathname root?
  5. rexml/document root

検索結果

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

RSS::RootElementMixin#output_encoding (3001.0)

@todo

@todo

RSS::RootElementMixin#output_encoding= (3001.0)

@todo

@todo

RSS::RootElementMixin#to_xml (3001.0)

@todo

@todo

REXML::Elements#delete(element) -> Element (49.0)

element で指定した子要素を取り除きます。

...c.root.elements[1]
doc.root.elements.delete b # => <b/>
doc.root.to_s # => "<a><c/><c id='1'/></a>"
doc.elements.delete("a/c[@id='1']") # => <c id='1'/>
doc.root.to_s # => "<a><c/></a>"
doc.root.elements.delete 1 # => <c/>
doc.root.t...
...o_s # => "<a/>"
doc.root.elements.delete '/a'
doc.root.to_s # => ""
//}...

REXML::Elements#[]=(index, element) (43.0)

集合に要素 element を追加/更新します。

...ML::Document.new '<a/>'
doc.root.elements[10] = REXML::Element.new('b')
doc.root.to_s # => "<a><b/></a>"
doc.root.elements[1] # => <b/>
doc.root.elements[1] = REXML::Element.new('c')
doc.root.to_s # => "<a><c/></a>"
doc.root.elements['c'] = REXML::Element.new('d')
doc.root.to_s # => "<a><d/></a>"
//...

絞り込み条件を変える

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

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

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

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

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

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

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

子要素を追加します。

...cument'
doc = REXML::Document.new('<a/>')
el = doc.root.add_element 'my-tag' # => <my-tag/>
doc.root.to_s # => "<a><my-tag/></a>"
el = doc.root.add_element 'my-tag', {'attr1'=>'val1', 'attr2'=>'val2'}
# => <my-tag attr1='val1' attr2='val2'/>
doc.root.to_s # => "<a><my-tag/><my-tag attr1='val1' attr2...
...='val2'/></a>"
el = REXML::Element.new 'my-tag'
doc.root.add_element el # => <my-tag/>
doc.root.to_s # => "<a><my-tag/><my-tag attr1='val1' attr2='val2'/><my-tag/></a>"
//}

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

REXML::Elements#[](index, name = nil) -> REXML::Element | nil (37.0)

index が指し示している要素を返します。

.../><d/></a>'
doc.root.elements[1] # => <b/>
doc.root.elements['c'] # => <c id='1'/>
doc.root.elements[2,'c'] # => <c id='2'/>

doc = REXML::Document.new '<a><b><c /><a id="1"/></b></a>'
doc.root.elements["a"] # => nil
doc.root.elements["b/a"] # => <a id='1'/>
doc.root.elements["/a"]...
<< < 1 2 3 4 5 ... > >>