るりまサーチ

最速Rubyリファレンスマニュアル検索!
308件ヒット [1-100件を表示] (0.153秒)
トップページ > クエリ:i[x] > クエリ:l[x] > クラス:REXML::Element[x]

別のキーワード

  1. _builtin to_i
  2. fiddle to_i
  3. matrix elements_to_i
  4. matrix i
  5. csv to_i

検索結果

<< 1 2 3 ... > >>

REXML::Element#delete_attribute(key) -> REXML::Attribute | nil (12301.0)

要素から key という属性名の属性を削除します。

...il を返します。

@param key 削除する要素(文字列(属性名) or REXML::Attributeオブジェクト)

//emlist[][ruby]{
require 'rexml/document'
e = REXML::Element.new("E")
e.add_attribute("x", "foo"); e # => <E x='foo'/>
e.add_attribute("y:x", "bar"); e # => <E x='foo' y:x='bar'/>
e.del...
...ete_attribute("x"); e # => <E y:x='bar'/>
//}...

REXML::Element#each_element_with_attribute(key, value = nil, max = 0, name = nil) {|element| ... } -> () (12301.0)

特定の属性を持つすべての子要素を引数としてブロックを呼び出します。

...を呼び出します。

key で指定した属性名の属性を持つ要素のみを対象とします。
value を指定すると、keyで指定した属性名を持つ属性の値がvalueである
もののみを対象とします。
maxを指定すると、対象となる子要素の先頭 max...
...@param value 属性値(文字列)
@param max ブロック呼出の対象とする子要素の最大個数
@param name xpath文字列

//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new("<a><b id='1'/><c id='2'/><d id='1'/><e/></a>")
doc.root.each_element_with_attribute('id'){|e| p...
...>> <b id='1'/>
# >> <c id='2'/>
# >> <d id='1'/>
doc.root.each_element_with_attribute('id', '1'){|e| p e }
# >> <b id='1'/>
# >> <d id='1'/>
doc.root.each_element_with_attribute('id', '1', 1){|e| p e }
# >> <b id='1'/>
doc.root.each_element_with_attribute('id', '1', 0, 'd'){|e| p e }
# >> <d id='1'...

REXML::Element#each_element_with_text(text = nil, max = 0, name = nil) {|element| ... } -> () (12301.0)

テキストを子ノードとして 持つすべての子要素を引数としてブロックを呼び出します。

...mlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new '<a><b>b</b><c>b</c><d>d</d><e/></a>'
doc.root.each_element_with_text {|e|p e}
# >> <b> ... </>
# >> <c> ... </>
# >> <d> ... </>
doc.root.each_element_with_text('b'){|e|p e}
# >> <b> ... </>
# >> <c> ... </>
doc.root.each_element_wit...
...h_text('b', 1){|e|p e}
# >> <b> ... </>
doc.root.each_element_with_text(nil, 0, 'd'){|e|p e}
# >> <d> ... </>
//}...

REXML::Element#previous_element -> Element | nil (12301.0)

前の兄弟要素を返します。

...前の兄弟要素を返します。

前の要素が存在しない場合は nil を返します。...

REXML::Element#write(output = $stdout, indent = -1, transitive = false, ie_hack = false) (9401.0)

このメソッドは deprecated です。 REXML::Formatter を代わりに 使ってください。

...ドは deprecated です。 REXML::Formatter を代わりに
使ってください。

output にその要素を文字列化したものを(子要素を含め)出力します。

@param output 出力先(IO のように << で書き込めるオブジェクト)
@param indent インデントのスペ...
...sitive XMLではインデントのスペースでDOMが変化してしまう場合がある。
これに真を渡すと、XMLのDOMに余計な要素が加わらないように
空白の出力を適当に抑制するようになる
@param ie_hack IEはバージョンによってはXML...
...をちゃんと解釈できないので、
それに対応したXMLを出力するかどうかを真偽値で指定する...

絞り込み条件を変える

REXML::Element#attribute(name, namespace = nil) -> REXML::Attribute | nil (9301.0)

name で指定される属性を返します。

...name で指定される属性を返します。

属性は REXML::Attribute オブジェクトの形で返します。

name は "foo:bar" のように prefix を指定することができます。

namespace で名前空間の URI を指定することで、その名前空間内で
name という...
...il を返します。

@param name 属性名(文字列)
@param namespace 名前空間のURI(文字列)
//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='&l...
...t;'/>
</root>
EOS
a = doc.get_elements("/root/a").first
a.attribute("att") # => att='&lt;'
a.attribute("att", "http://example.org/bar") # => bar:att='2'
a.attribute("bar:att") # => bar:att='2'
a.attribute("baz") # => nil
//}...

REXML::Element#attributes -> REXML::Attributes (9301.0)

要素が保持している属性の集合を返します。

要素が保持している属性の集合を返します。

REXML::Element#instructions -> [REXML::Instraction] (9301.0)

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

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

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

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

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

...XML::Attribute オブジェクトを
渡す方法です。

文字列2つで指定する場合、属性値は unnormalized な文字列を渡す必要があります。

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

//emlis...
...t[][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#has_attributes? -> bool (9201.0)

要素が属性を1つ以上持っていれば真を返します。

要素が属性を1つ以上持っていれば真を返します。

絞り込み条件を変える

<< 1 2 3 ... > >>