18件ヒット
[1-18件を表示]
(0.046秒)
クラス
-
REXML
:: Attributes (12) -
REXML
:: Element (3) -
REXML
:: Parent (2)
モジュール
-
REXML
:: Node (1)
キーワード
- [] (1)
- []= (1)
- attribute (1)
- delete (1)
-
delete
_ all (1) - each (1)
-
each
_ attribute (1) -
find
_ first _ recursive (1) -
get
_ attribute (1) -
get
_ attribute _ ns (1) -
insert
_ after (1) -
insert
_ before (1) - length (1)
- namespaces (1)
- prefixes (1)
- root (1)
-
root
_ node (1) - size (1)
検索結果
先頭5件
-
REXML
:: Node # find _ first _ recursive {|node| . . . } -> REXML :: Node | nil (27913.0) -
self とその各 element node を引数とし、ブロックを呼び出し、 そのブロックの返り値が真であった最初の node を返します。
self とその各 element node を引数とし、ブロックを呼び出し、
そのブロックの返り値が真であった最初の node を返します。
見付からなかった場合は nil を返します。 -
REXML
:: Attributes # delete(attribute) -> REXML :: Element (18946.0) -
指定した属性を取り除きます。
...を返します。
@param attribute 取り除く属性(文字列もしくは REXML::Attribute オブジェクト)
//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:at... -
REXML
:: Attributes # delete _ all(name) -> [REXML :: Attribute] (18646.0) -
name という名前を持つ属性をすべて削除します。
...て削除します。
削除された属性を配列で返します。
@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
:: Attributes # length -> Integer (18646.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='2' att='<'/>
</root>
EOS
a = doc.get_elements("/root/a").first
p a.attribu... -
REXML
:: Element # root _ node -> REXML :: Document | REXML :: Node (10018.0) -
self が属する文書のルートノードを返します。
...XML::Document オブジェクトが存在しない
場合は木構造上のルートノードが返されます。
//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new(<<EOS)
<root>
<children>
<grandchildren />
</children>
</root>
EOS
children = doc.get_elements("/root/children")... -
REXML
:: Parent # insert _ after(child1 , child2) -> self (9928.0) -
child2 を child1 で指定したノードの後ろに挿入します。
child2 を child1 で指定したノードの後ろに挿入します。
child1 が REXML::Child のインスタンスであるならば、その
子ノードの後ろに挿入されます。
child1 が 文字列であるならば、XPath で場所を指定します。
具体的には REXML::XPath.first(self, child1) で特定されるノードの
後ろに挿入されます。
挿入されるノード(child2)の親は self に変更されます。
@param child1 挿入場所の指定
@param child2 挿入されるノード -
REXML
:: Parent # insert _ before(child1 , child2) -> self (9928.0) -
child2 を child1 で指定したノードの前に挿入します。
child2 を child1 で指定したノードの前に挿入します。
child1 が REXML::Child のインスタンスであるならば、その
子ノードの前に挿入されます。
child1 が 文字列であるならば、XPath で場所を指定します。
具体的には REXML::XPath.first(self, child1) で特定されるノードの
前に挿入されます。
挿入されるノード(child2)の親は self に変更されます。
@param child1 挿入場所の指定
@param child2 挿入されるノード -
REXML
:: Element # root -> REXML :: Element (9718.0) -
self が属する文書のルート要素を返します。
...self が属する文書のルート要素を返します。
//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new(<<EOS)
<root>
<children>
<grandchildren />
</children>
</root>
EOS
children = doc.get_elements("/root/children").first
children.name # => "children"
children.root.name... -
REXML
:: Attributes # [](name) -> String | nil (9646.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
:: Attributes # each {|name , value| . . . } -> () (9646.0) -
各属性の名前と値に対しブロックを呼び出します。
...ックを呼び出します。
名前には expanded_name(REXML::Namespace#exapnded_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
:: Attributes # get _ attribute(name) -> Attribute | nil (9646.0) -
name という名前の属性を取得します。
...持つ属性がない場合は nil を返します。
@param name 属性名(文字列)
@see REXML::Attributes#[]
//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:at... -
REXML
:: Attributes # get _ attribute _ ns(namespace , name) -> REXML :: Attribute | nil (9646.0) -
namespace と name で特定される属性を返します。
...定することができます。
@param namespace 名前空間(URI, 文字列)
@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
:: Attributes # namespaces -> { String => String } (9646.0) -
self の中で宣言されている名前空間の集合を返します。
...返します。
返り値は名前空間の prefix をキーとし、URI を値とする
Hash を返します。
//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
:: Element # attribute(name , namespace = nil) -> REXML :: Attribute | nil (9646.0) -
name で指定される属性を返します。
...場合は nil を返します。
@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=... -
REXML
:: Attributes # []=(name , value) (9346.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 # each _ attribute {|attribute| . . . } -> () (9346.0) -
各属性に対しブロックを呼び出します。
...ブロックを呼び出します。
個々の属性は REXML::Attribute オブジェクトで渡されます。
//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] (9346.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='... -
REXML
:: Attributes # size -> Integer (9346.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='2' att='<'/>
</root>
EOS
a = doc.get_elements("/root/a").first
p a.attribu...