種類
- インスタンスメソッド (18)
- 特異メソッド (2)
クラス
-
REXML
:: Attribute (8) -
REXML
:: Attributes (8) -
REXML
:: DocType (2) -
REXML
:: Element (2)
キーワード
- [] (1)
- attribute (1)
-
attribute
_ of (1) -
attributes
_ of (1) - each (1)
-
each
_ attribute (1) -
each
_ element _ with _ attribute (1) -
get
_ attribute _ ns (1) - length (1)
- namespace (1)
- namespaces (1)
- new (2)
-
node
_ type (1) - prefix (1)
- prefixes (1)
- size (1)
-
to
_ string (1) - write (1)
- xpath (1)
検索結果
先頭5件
- REXML
:: Attributes # get _ attribute _ ns(namespace , name) -> REXML :: Attribute | nil - REXML
:: DocType # attribute _ of(element , attribute) -> String | nil - REXML
:: Element # each _ element _ with _ attribute(key , value = nil , max = 0 , name = nil) {|element| . . . } -> () - REXML
:: DocType # attributes _ of(element) -> [REXML :: Attribute] - REXML
:: Attributes # each _ attribute {|attribute| . . . } -> ()
-
REXML
:: Attributes # get _ attribute _ ns(namespace , name) -> REXML :: Attribute | nil (37207.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
:: DocType # attribute _ of(element , attribute) -> String | nil (36979.0) -
DTD 内の属性リスト宣言で、 element という名前の要素の attribute という 名前の属性のデフォルト値を返します。
...かの場合は nil を返します。
@param element 要素名(文字列)
@param attribute 属性名(文字列)
//emlist[][ruby]{
require 'rexml/document'
doctype = REXML::Document.new(<<EOS).doctype
<!DOCTYPE books [
<!ELEMENT book (comment)>
<!ELEMENT comment (#PCDATA)>
<!ATTLIST book... -
REXML
:: Element # each _ element _ with _ attribute(key , value = nil , max = 0 , name = nil) {|element| . . . } -> () (36979.0) -
特定の属性を持つすべての子要素を引数としてブロックを呼び出します。
...値(文字列)
@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 e }
# >> <b id='1'/... -
REXML
:: DocType # attributes _ of(element) -> [REXML :: Attribute] (36961.0) -
DTD 内の属性リスト宣言で、 element という名前の要素に対し宣言されている 属性の名前とデフォルト値を REXML::Attribute の配列で返します。
...、各 Attribute オブジェクトの
REXML::Attribute#name と
REXML::Attribute#value で表現されます。
//emlist[][ruby]{
require 'rexml/document'
doctype = REXML::Document.new(<<EOS).doctype
<!DOCTYPE books [
<!ELEMENT book (comment)>
<!ELEMENT comment (#PCDATA)>
<!ATTLIST book... -
REXML
:: Attributes # each _ attribute {|attribute| . . . } -> () (36697.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
:: Attribute # namespace(arg = nil) -> String | nil (36643.0) -
属性の名前空間の URI を返します。
...間でなく、arg という名前空間
の URI が返されます。
通常は省略します。
//emlist[][ruby]{
require 'rexml/document'
e = REXML::Element.new("el")
e.add_attribute("xmlns:ns", "http://www.example.com/ns")
e.add_attribute("ns:r", "rval")
p e.attributes.get_attrib... -
REXML
:: Attribute # node _ type -> Symbol (36607.0) -
「:attribute」というシンボルを返します。
「:attribute」というシンボルを返します。 -
REXML
:: Attribute # prefix -> String (36361.0) -
属性の名前空間を返します。
...属性の名前空間を返します。
//emlist[][ruby]{
require 'rexml/document'
e = REXML::Element.new( "elns:myelement" )
e.add_attribute( "nsa:a", "aval" )
e.add_attribute( "b", "bval" )
p e.attributes.get_attribute( "a" ).prefix # -> "nsa"
p e.attributes.get_attribute( "b" ).prefix # -> "... -
REXML
:: Attributes # namespaces -> { String => String } (36343.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
:: Attributes # prefixes -> [String] (36343.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
:: Attribute # xpath -> String (36307.0) -
その属性を指定する xpath 文字列を返します。
その属性を指定する xpath 文字列を返します。
例えば "/foo/bar/@ns:r" という文字列を返します。 -
REXML
:: Element # attribute(name , namespace = nil) -> REXML :: Attribute | nil (28207.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 # length -> Integer (27325.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
:: Attribute . new(attribute , value , parent = nil) -> REXML :: Attribute (19207.0) -
新たな属性オブジェクトを生成します。
新たな属性オブジェクトを生成します。
2種類の初期化が可能です。
REXML::Attribute オブジェクトを渡した場合は、
属性名とその値がそれから複製されます。
parent で新たに作られる属性オブジェクトが属する
要素が指定できます。
parent を省略した場合は複製元と同じ要素の属するように
設定されます。
また、属性名とその値を文字列で指定することもできます。
parent で新たに作られる属性オブジェクトが属する
要素が指定できます。
parent を省略した場合は nil が設定されます。
通常はこのメソッドは直接は使わず、REXML::Element#add_at... -
REXML
:: Attribute . new(attribute _ to _ clone , parent = nil) -> REXML :: Attribute (19207.0) -
新たな属性オブジェクトを生成します。
新たな属性オブジェクトを生成します。
2種類の初期化が可能です。
REXML::Attribute オブジェクトを渡した場合は、
属性名とその値がそれから複製されます。
parent で新たに作られる属性オブジェクトが属する
要素が指定できます。
parent を省略した場合は複製元と同じ要素の属するように
設定されます。
また、属性名とその値を文字列で指定することもできます。
parent で新たに作られる属性オブジェクトが属する
要素が指定できます。
parent を省略した場合は nil が設定されます。
通常はこのメソッドは直接は使わず、REXML::Element#add_at... -
REXML
:: Attributes # [](name) -> String | nil (18343.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| . . . } -> () (18325.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
:: Attribute # write(output , indent = -1) -> object (18307.0) -
output に self の情報を name='value' という形式で書き込みます。
output に self の情報を name='value' という形式で書き込みます。
output が返ります。
@param output 書き込み先の IO オブジェクト
@param indent インデントレベル、ここでは無視される -
REXML
:: Attribute # to _ string -> String (18025.0) -
"name='value'" という形式の文字列を返します。
..."name='value'" という形式の文字列を返します。
//emlist[][ruby]{
require 'rexml/document'
e = REXML::Element.new("el")
e.add_attribute("ns:r", "rval")
p e.attributes.get_attribute("r").to_string # => "ns:r='rval'"
//}... -
REXML
:: Attributes # size -> Integer (18025.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...