るりまサーチ

最速Rubyリファレンスマニュアル検索!
1308件ヒット [1-100件を表示] (0.154秒)
トップページ > クエリ:t[x] > クエリ:r[x] > 種類:インスタンスメソッド[x] > クエリ:@[x] > ライブラリ:rexml/document[x]

別のキーワード

  1. openssl t61string
  2. asn1 t61string
  3. matrix t
  4. t61string new
  5. fiddle type_size_t

モジュール

キーワード

検索結果

<< 1 2 3 ... > >>

REXML::Parent#insert_before(child1, child2) -> self (18215.0)

child2 を child1 で指定したノードの前に挿入します。

...の前に挿入します。

child1 が REXML::Child のインスタンスであるならば、その
子ノードの前に挿入されます。
child1 が 文字列であるならば、XPath で場所を指定します。
具体的には REXML::XPath.first(self, child1) で特定されるノード...
...
前に挿入されます。

挿入されるノード(child2)の親は self に変更されます。

@
param child1 挿入場所の指定
@
param child2 挿入されるノード...

REXML::Parent#parent? -> bool (18209.0)

true を返します。

...true を返します。

@
see REXML::Node#parent...

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

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

...

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

//emlist[][ruby]{
r
equire '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.delete_attribute("x")...
...; e # => <E y:x='bar'/>
//}...

REXML::Parent#replace_child(to_replace, replacement) -> () (15415.0)

子ノード列上の to_replace を replacement に置き換えます。

...子ノード列上の to_replace を replacement に置き換えます。

t
o_replace の parent は nil に、
r
eplacement の parent は selfに変更されます。

@
param to_replace 置き換え元のノード
@
param replacement 置き換え先のノード...

REXML::Child#parent -> REXML::Parent|nil (15409.0)

親ノードを返します。

...親ノードを返します。

ルートノードの場合は nil を返します。

@
see REXML::Child#parent=...

絞り込み条件を変える

REXML::Attributes#get_attribute(name) -> Attribute | nil (15315.0)

name という名前の属性を取得します。

...

@
param name 属性名(文字列)
@
see REXML::Attributes#[]

//emlist[][ruby]{
r
equire '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;'/>
</root>
EOS
a = doc.get_elements("...
.../root/a").first

a.attributes.get_attribute("att") # => att='&lt;'
a.attributes.get_attribute("foo:att") # => foo:att='1'
//}...

REXML::Attributes#get_attribute_ns(namespace, name) -> REXML::Attribute | nil (15315.0)

namespace と name で特定される属性を返します。

...prefix を含まない属性名を
指定します。

指定された属性が存在しない場合は nil を返します。

XML プロセッサが prefix を置き換えてしまった場合でも、このメソッドを
使うことで属性を正しく指定することができます。

@
par...
...URI, 文字列)
@
param name 属性名(文字列)

//emlist[][ruby]{
r
equire '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;'/>
</root>
EOS
a = doc.get_elements("/root/a").fir...
...st

a.attributes.get_attribute_ns("", "att") # => att='&lt;'
a.attributes.get_attribute_ns("http://example.org/foo", "att") # => foo:att='1'
a.attributes.get_attribute_ns("http://example.org/baz", "att") # => nil
a.attributes.get_attribute_ns("http://example.org/foo", "attt") # => nil
//}...

REXML::Child#parent=(other) (15215.0)

other を親ノードに設定します。

...other を親ノードに設定します。

other が元の親ノードと同じならばこのメソッドは何もしません。
self が親を持たない場合は単純に other を親ノードに設定します。
どちらでもない場合は、元の親ノードの子ノード列から self...
...ther を親ノードに設定します。

このメソッドだけでは other の子ノード集合に self は追加されません。
つまりこのメソッドを呼び出した直後は不完全な状態であり、親ノード側を
適切に設定する必要があります。

@
param other...
...新たな親ノード
@
see REXML::Child#parent...

REXML::Child#replace_with(child) -> self (15215.0)

親ノードの子ノード列上において、 self を child に置き換えます。

...親ノードの子ノード列上において、 self を child に置き換えます。

@
param child 置き換え後のノード
@
see REXML::Parent#replace_child...
<< 1 2 3 ... > >>