5件ヒット
[1-5件を表示]
(0.045秒)
別のキーワード
クラス
-
REXML
:: Attributes (3) -
REXML
:: Elements (2)
検索結果
先頭5件
-
REXML
:: Elements # [](index , name = nil) -> REXML :: Element | nil (63769.0) -
index が指し示している要素を返します。
...取り出したい要素の index (整数)もしくは xpath (文字列)
@param name 子要素の名前(文字列)
//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new '<a><b/><c id="1"/><c id="2"/><d/></a>'
doc.root.elements[1] # => <b/>
doc.root.elements['c'] # => <c id=... -
REXML
:: Attributes # [](name) -> String | nil (63697.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
:: Elements # []=(index , element) (27769.0) -
集合に要素 element を追加/更新します。
...されます。
@param index 要素を更新する位置
@param element 要素(REXML::Elementオブジェクト)
//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new '<a/>'
doc.root.elements[10] = REXML::Element.new('b')
doc.root.to_s # => "<a><b/></a>"
doc.root.elements[1] # => <b... -
REXML
:: Attributes # []=(name , value) (27697.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 # prefixes -> [String] (9133.0) -
self の中で宣言されている prefix の集合を 文字列の配列で返します。
...返します。
self が属する要素より上位の要素で定義されているものは含みません。
//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='...