種類
- インスタンスメソッド (241)
- 特異メソッド (40)
- クラス (30)
- 定数 (9)
- モジュール (7)
クラス
-
REXML
:: AttlistDecl (7) -
REXML
:: Attribute (16) -
REXML
:: Attributes (16) -
REXML
:: CData (4) -
REXML
:: Child (11) -
REXML
:: Comment (9) -
REXML
:: Declaration (2) -
REXML
:: DocType (18) -
REXML
:: Document (21) -
REXML
:: Element (44) -
REXML
:: ElementDecl (1) -
REXML
:: Elements (14) -
REXML
:: Entity (13) -
REXML
:: ExternalEntity (3) -
REXML
:: Formatters :: Default (2) -
REXML
:: Formatters :: Pretty (5) -
REXML
:: Formatters :: Transitive (1) -
REXML
:: Instruction (8) -
REXML
:: NotationDecl (8) -
REXML
:: Parent (29) -
REXML
:: Text (13) -
REXML
:: XMLDecl (18) -
REXML
:: XPath (3)
モジュール
-
REXML
:: EntityConst (5) -
REXML
:: Namespace (8) -
REXML
:: Node (7) -
REXML
:: Security (4)
キーワード
- << (4)
- <=> (2)
- == (4)
- AMP (1)
- APOS (1)
- AttlistDecl (1)
- Attribute (1)
- Attributes (1)
- BaseParser (1)
- CData (1)
- Child (1)
- Comment (1)
- DECLARATION (1)
-
DEFAULT
_ ENTITIES (1) -
DEFAULT
_ VERSION (1) - Declaration (1)
- Default (1)
- DocType (1)
- Document (1)
- Element (1)
- ElementDecl (1)
- Elements (1)
- Encoding (1)
- Entity (1)
- EntityConst (1)
- ExternalEntity (1)
- Functions (1)
- GT (1)
- IOSource (1)
- Instruction (1)
- LT (1)
- Namespace (1)
- Node (1)
- NotationDecl (1)
- Output (1)
- Parent (1)
- Pretty (1)
- QUOT (1)
- Security (1)
- Source (1)
- SourceFactory (1)
- Text (1)
- Transitive (1)
- TreeParser (1)
- UNDEFINED (1)
- XMLDecl (1)
- XMLTokens (1)
- XPath (1)
- XPathParser (1)
- [] (4)
- []= (5)
- add (5)
-
add
_ attribute (2) -
add
_ attributes (1) -
add
_ element (1) -
add
_ namespace (2) - attribute (1)
-
attribute
_ of (1) - attributes (1)
-
attributes
_ of (1) - bytes (1)
- cdatas (1)
- children (1)
- clone (9)
- collect (1)
- comments (1)
- compact (1)
- compact= (1)
- content (1)
- content= (1)
- context (2)
- context= (1)
-
deep
_ clone (1) - default (1)
- delete (3)
-
delete
_ all (2) -
delete
_ at (1) -
delete
_ attribute (1) -
delete
_ element (1) -
delete
_ if (2) -
delete
_ namespace (1) - doctype (2)
- document (2)
- dowrite (1)
- each (6)
-
each
_ attribute (1) -
each
_ child (2) -
each
_ element (1) -
each
_ element _ with _ attribute (1) -
each
_ element _ with _ text (1) -
each
_ index (2) -
each
_ recursive (1) - element (1)
- element= (1)
-
element
_ name (1) - elements (1)
- empty? (2)
- encoding (2)
- encoding= (1)
- entities (1)
- entity (1)
-
entity
_ expansion _ limit (2) -
entity
_ expansion _ limit= (2) -
entity
_ expansion _ text _ limit (2) -
entity
_ expansion _ text _ limit= (2) - external (1)
-
external
_ id (1) -
find
_ first _ recursive (1) - first (1)
-
get
_ attribute (1) -
get
_ attribute _ ns (1) -
get
_ elements (1) -
get
_ text (1) -
has
_ attributes? (1) -
has
_ elements? (1) -
has
_ name? (1) -
has
_ text? (1) - include? (1)
- index (2)
-
index
_ in _ parent (1) - inject (1)
-
insert
_ after (1) -
insert
_ before (1) - instructions (1)
- length (2)
-
local
_ name (1) - match (1)
- matches? (1)
- name (5)
- name= (1)
- namespace (2)
- namespaces (3)
- ndata (1)
- new (24)
-
next
_ element (1) -
next
_ sibling (1) -
next
_ sibling= (1) -
next
_ sibling _ node (1) -
node
_ type (9) - normalize (1)
- normalized (1)
- normalized= (1)
- notation (1)
- notations (1)
- nowrite (1)
- parent (1)
- parent= (1)
- parent? (2)
-
parse
_ stream (1) - prefix (2)
- prefix= (1)
- prefixes (2)
-
previous
_ element (1) -
previous
_ sibling (1) -
previous
_ sibling= (1) -
previous
_ sibling _ node (1) - pubid (1)
- public (2)
- public= (1)
- push (1)
- raw (2)
- raw= (1)
- ref (1)
- remove (2)
-
replace
_ child (1) -
replace
_ with (1) - root (2)
-
root
_ node (1) - size (3)
-
stand
_ alone? (2) - standalone (1)
- standalone= (1)
- string (1)
- string= (1)
- system (2)
- system= (1)
- target (1)
- target= (1)
- text (1)
- text= (1)
- texts (1)
-
to
_ a (3) -
to
_ s (9) -
to
_ string (1) - unnormalize (1)
- unnormalized (1)
- unshift (1)
- value (4)
- value= (1)
- version (2)
- version= (1)
- whitespace (1)
- width (1)
- width= (1)
- write (11)
- writeencoding (1)
- writethis (1)
-
xml
_ decl (1) - xmldecl (1)
- xpath (2)
検索結果
先頭5件
-
REXML
:: AttlistDecl (7.0) -
DTD の属性リスト宣言を表すクラスです。
DTD の属性リスト宣言を表すクラスです。 -
REXML
:: AttlistDecl # [](key) -> String | nil (7.0) -
key という属性名のデフォルト値を返します。
key という属性名のデフォルト値を返します。
key という名前の属性が存在しない、もしくは
デフォルト値を持たない場合は nil を返します。 -
REXML
:: AttlistDecl # each {|name , value| . . . } -> () (7.0) -
それぞれの属性名、デフォルト値を引数として ブロックを順に呼び出します。
それぞれの属性名、デフォルト値を引数として
ブロックを順に呼び出します。
デフォルト値を持たない属性に関しては nil が渡されます。 -
REXML
:: AttlistDecl # element _ name -> String (7.0) -
属性を定義しているエレメントの名前を返します。
属性を定義しているエレメントの名前を返します。 -
REXML
:: AttlistDecl # include?(key) -> bool (7.0) -
key が属性名であるならば真を返します。
key が属性名であるならば真を返します。
@param key 属性名であるかどうか判定する文字列 -
REXML
:: AttlistDecl # node _ type -> Symbol (7.0) -
Symbol :attlistdecl を返します。
Symbol :attlistdecl を返します。 -
REXML
:: AttlistDecl # write(out , indent = -1) -> () (7.0) -
self を out に出力します。
self を out に出力します。
@param out 出力先の IO オブジェクト
@param indent インデント数(無視されます) -
REXML
:: AttlistDecl . new(source) -> REXML :: AttlistDecl (7.0) -
このメソッドは内部用なので使わないでください。
このメソッドは内部用なので使わないでください。 -
REXML
:: Attribute (7.0) -
要素(REXML::Element)の属性を表すクラスです。
要素(REXML::Element)の属性を表すクラスです。
つまり、 <element attribute="value"/> という
要素における attribute=value というペアのことです。
属性にはなんらかの名前空間(namespace, REXML::Namespace)
に属することができます。 -
REXML
:: Attribute # ==(other) -> bool (7.0) -
属性の名前と値が other と一致する場合に真を返します。
属性の名前と値が other と一致する場合に真を返します。 -
REXML
:: Attribute # clone -> REXML :: Element (7.0) -
self を複製し返します。
self を複製し返します。 -
REXML
:: Attribute # element -> REXML :: Element (7.0) -
その属性が属する要素を返します。
その属性が属する要素を返します。 -
REXML
:: Attribute # element=(element) (7.0) -
self が属する要素を変更します。
self が属する要素を変更します。
@param element 変更先の要素(REXML::Element) -
REXML
:: Attribute # namespace(arg = nil) -> String | nil (7.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 (7.0) -
「:attribute」というシンボルを返します。
「:attribute」というシンボルを返します。 -
REXML
:: Attribute # normalized=(value) (7.0) -
正規化された属性値を設定します。
正規化された属性値を設定します。
通常はライブラリが自動的にこの値を設定するので
ユーザはこれを使う必要はないでしょう。
@param value 正規化された属性値 -
REXML
:: Attribute # prefix -> String (7.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
:: Attribute # remove -> () (7.0) -
self を所属する要素から取り除きます。
self を所属する要素から取り除きます。 -
REXML
:: Attribute # to _ s -> String (7.0) -
正規化された属性値を返します。
正規化された属性値を返します。
属性値の正規化については XML の仕様を参考にしてください。 -
REXML
:: Attribute # to _ string -> String (7.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
:: Attribute # value -> String (7.0) -
正規化されていない属性値を返します。
正規化されていない属性値を返します。
属性値の正規化については XML の仕様を参考にしてください。 -
REXML
:: Attribute # write(output , indent = -1) -> object (7.0) -
output に self の情報を name='value' という形式で書き込みます。
output に self の情報を name='value' という形式で書き込みます。
output が返ります。
@param output 書き込み先の IO オブジェクト
@param indent インデントレベル、ここでは無視される -
REXML
:: Attribute # xpath -> String (7.0) -
その属性を指定する xpath 文字列を返します。
その属性を指定する xpath 文字列を返します。
例えば "/foo/bar/@ns:r" という文字列を返します。 -
REXML
:: Attribute . new(attribute , value , parent = nil) -> REXML :: Attribute (7.0) -
新たな属性オブジェクトを生成します。
新たな属性オブジェクトを生成します。
2種類の初期化が可能です。
REXML::Attribute オブジェクトを渡した場合は、
属性名とその値がそれから複製されます。
parent で新たに作られる属性オブジェクトが属する
要素が指定できます。
parent を省略した場合は複製元と同じ要素の属するように
設定されます。
また、属性名とその値を文字列で指定することもできます。
parent で新たに作られる属性オブジェクトが属する
要素が指定できます。
parent を省略した場合は nil が設定されます。
通常はこのメソッドは直接は使わず、REXML::Element#add_at... -
REXML
:: Attribute . new(attribute _ to _ clone , parent = nil) -> REXML :: Attribute (7.0) -
新たな属性オブジェクトを生成します。
新たな属性オブジェクトを生成します。
2種類の初期化が可能です。
REXML::Attribute オブジェクトを渡した場合は、
属性名とその値がそれから複製されます。
parent で新たに作られる属性オブジェクトが属する
要素が指定できます。
parent を省略した場合は複製元と同じ要素の属するように
設定されます。
また、属性名とその値を文字列で指定することもできます。
parent で新たに作られる属性オブジェクトが属する
要素が指定できます。
parent を省略した場合は nil が設定されます。
通常はこのメソッドは直接は使わず、REXML::Element#add_at... -
REXML
:: Attributes (7.0) -
属性の集合を表すクラスです。
属性の集合を表すクラスです。
REXML::Element#attributes はこのクラスのオブジェクトを返します。
各属性には REXML::Attributes#[] でアクセスします。 -
REXML
:: Attributes # <<(attribute) -> () (7.0) -
属性を追加/更新します。
属性を追加/更新します。
attribute で更新する属性(REXML::Attribute オブジェクト)を
指定します。既に同じ名前(REXML::Attribute#name)のオブジェクトが
存在する場合は属性が上書きされ、ない場合は追加されます。
@param attribute 追加(更新)する属性(REXML::Attribute オブジェクト)
@see REXML::Attributes#[]= -
REXML
:: Attributes # [](name) -> String | nil (7.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 # []=(name , value) (7.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 # add(attribute) -> () (7.0) -
属性を追加/更新します。
属性を追加/更新します。
attribute で更新する属性(REXML::Attribute オブジェクト)を
指定します。既に同じ名前(REXML::Attribute#name)のオブジェクトが
存在する場合は属性が上書きされ、ない場合は追加されます。
@param attribute 追加(更新)する属性(REXML::Attribute オブジェクト)
@see REXML::Attributes#[]= -
REXML
:: Attributes # delete(attribute) -> REXML :: Element (7.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] (7.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 # each {|name , value| . . . } -> () (7.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 # each _ attribute {|attribute| . . . } -> () (7.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 # get _ attribute(name) -> Attribute | nil (7.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 (7.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 # length -> Integer (7.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
:: Attributes # namespaces -> { String => String } (7.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] (7.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 (7.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
:: Attributes # to _ a -> [Attribute] (7.0) -
属性の配列を返します。
...属性の配列を返します。
//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new("<a x='1' y='2' z='3' />")
doc.root.attributes.to_a # => [x='1', y='2', z='3']
//}... -
REXML
:: Attributes . new(element) -> REXML :: Attributes (7.0) -
空の Attributes オブジェクトを生成します。
空の Attributes オブジェクトを生成します。
どの要素の属性であるかを element で指定します。
通常は REXML::Element.new によって Attributes オブジェクト
が生成されるため、このメソッドを使う必要はありません。
@param element 属性が属する要素(REXML::Element オブジェクト) -
REXML
:: CData (7.0) -
XML の cdata セクションを表すクラス
XML の cdata セクションを表すクラス
cdata とは <![CDATA[ と ]]> で囲まれたテキストデータのことです。 -
REXML
:: CData # clone -> REXML :: CData (7.0) -
self を複製して返します。
self を複製して返します。
親ノードの情報は複製されません。 -
REXML
:: CData # to _ s -> String (7.0) -
テキスト文字列を返します。
...テキスト文字列を返します。
@see REXML::Text#value, REXML::Text#to_s
//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new(<<EOS)
<root><![CDATA[foobar baz]]></root>
EOS
doc.root[0].class # => REXML::CData
doc.root[0].value # => "foobar baz"
//}... -
REXML
:: CData # value -> String (7.0) -
テキスト文字列を返します。
...テキスト文字列を返します。
@see REXML::Text#value, REXML::Text#to_s
//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new(<<EOS)
<root><![CDATA[foobar baz]]></root>
EOS
doc.root[0].class # => REXML::CData
doc.root[0].value # => "foobar baz"
//}... -
REXML
:: CData . new(text , respect _ whitespace = true , parent = nil) -> REXML :: CData (7.0) -
text をテキストとして持つ CData オブジェクトを生成します。
...字列
@param respect_whitespace 空白を保存するかどうかを決める真偽値
@param parent 親ノード
//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new(<<EOS)
<root />
EOS
doc.root.add(REXML::CData.new("foo bar baz "))
doc.to_s # => "<root><![CDATA[foo bar baz ]]><... -
REXML
:: Child (7.0) -
あるノード(親ノード)に子ノードとして保持されている ノードを表すクラスです。
あるノード(親ノード)に子ノードとして保持されている
ノードを表すクラスです。
親にアクセスするためには REXML::Child#parent を使います。 -
REXML
:: Child # bytes (7.0) -
@todo
@todo -
REXML
:: Child # document -> REXML :: Document | nil (7.0) -
そのノードが属する document (REXML::Document) を返します。
そのノードが属する document (REXML::Document) を返します。
属する document が存在しない場合は nil を返します。 -
REXML
:: Child # next _ sibling -> REXML :: Node (7.0) -
次の隣接ノードを返します。
次の隣接ノードを返します。
REXML::Node#next_sibling_node の別名です。
@see REXML::Child#next_sibling= -
REXML
:: Child # next _ sibling=(other) (7.0) -
other を self の次の隣接ノードとします。
...ドが持つ子ノード列の self の後ろに
other を挿入します。
@param other 挿入するノード
//emlist[][ruby]{
require 'rexml/document'
a = REXML::Element.new("a")
b = a.add_element("b")
c = REXML::Element.new("c")
b.next_sibling = c
d = REXML::Element.new("d")
b.previous_sibli... -
REXML
:: Child # parent -> REXML :: Parent|nil (7.0) -
親ノードを返します。
親ノードを返します。
ルートノードの場合は nil を返します。
@see REXML::Child#parent= -
REXML
:: Child # parent=(other) (7.0) -
other を親ノードに設定します。
other を親ノードに設定します。
other が元の親ノードと同じならばこのメソッドは何もしません。
self が親を持たない場合は単純に other を親ノードに設定します。
どちらでもない場合は、元の親ノードの子ノード列から self を取り除いて
から other を親ノードに設定します。
このメソッドだけでは other の子ノード集合に self は追加されません。
つまりこのメソッドを呼び出した直後は不完全な状態であり、親ノード側を
適切に設定する必要があります。
@param other 新たな親ノード
@see REXML::Child#parent -
REXML
:: Child # previous _ sibling -> REXML :: Node (7.0) -
前の隣接ノードを返します。
前の隣接ノードを返します。
REXML::Node#previous_sibling_node の別名です。
@see REXML::Child#previous_sibling= -
REXML
:: Child # previous _ sibling=(other) (7.0) -
other を self の前の隣接ノードとします。
...ードが持つ子ノード列の self の前に
other を挿入します。
@param other 挿入するノード
//emlist[][ruby]{
require 'rexml/document'
a = REXML::Element.new("a")
b = a.add_element("b")
c = REXML::Element.new("c")
b.next_sibling = c
d = REXML::Element.new("d")
b.previous_sibli... -
REXML
:: Child # remove -> self (7.0) -
親ノードの子ノード列から self を取り除きます。
親ノードの子ノード列から self を取り除きます。 -
REXML
:: Child # replace _ with(child) -> self (7.0) -
親ノードの子ノード列上において、 self を child に置き換えます。
親ノードの子ノード列上において、 self を child に置き換えます。
@param child 置き換え後のノード
@see REXML::Parent#replace_child -
REXML
:: Child . new(parent = nil) -> REXML :: Child (7.0) -
REXML::Child オブジェクトを生成します。
REXML::Child オブジェクトを生成します。
parent で親ノードを指定します。
親ノードへの追加は行わないため、オブジェクト生成後に親に
適切に設定する必要があります。
通常、このメソッドは直接は使いません。継承先のクラスが適切に
このメソッド(initialize)を呼び出します。
@param parent 親ノード -
REXML
:: Comment (7.0) -
XML コメントを表すクラス。
...XML コメントを表すクラス。
コメントとは <!-- と --> で挟まれたテキストです。
//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new(<<EOS)
<!-- xx -->
<root>
<!-- yy -->
text
<!-- zz -->
</root>
EOS
doc[0].string # => " xx "
doc.root[1].string # => " yy... -
REXML
:: Comment # <=>(other) -> -1 | 0 | 1 (7.0) -
other と内容(REXML::Comment#string)を比較します。
other と内容(REXML::Comment#string)を比較します。 -
REXML
:: Comment # ==(other) -> bool (7.0) -
other と内容(REXML::Comment#string)が同じならば真を返します。
other と内容(REXML::Comment#string)が同じならば真を返します。 -
REXML
:: Comment # clone -> REXML :: Comment (7.0) -
内容が複製された Comment オブジェクトを返します。 (親ノードの情報は複製されません)。
内容が複製された Comment オブジェクトを返します。
(親ノードの情報は複製されません)。 -
REXML
:: Comment # node _ type -> Symbol (7.0) -
シンボル :comment を返します。
シンボル :comment を返します。 -
REXML
:: Comment # string -> String (7.0) -
コメント文字列を返します。
コメント文字列を返します。 -
REXML
:: Comment # string=(value) (7.0) -
コメント文字列を設定します。
コメント文字列を設定します。
@param value 設定する文字列 -
REXML
:: Comment # to _ s -> String (7.0) -
コメント文字列を返します。
コメント文字列を返します。 -
REXML
:: Comment . new(comment , parent = nil) -> REXML :: Comment (7.0) -
Comment オブジェクトを生成します。
Comment オブジェクトを生成します。
引数に REXML::Comment オブジェクトを渡すとその内容が複製されます
(親ノードの情報は複製されません)。
@param string コメント文字列
@param comment REXML::Comment オブジェクト
@param parent 親ノード -
REXML
:: Comment . new(string , parent = nil) -> REXML :: Comment (7.0) -
Comment オブジェクトを生成します。
Comment オブジェクトを生成します。
引数に REXML::Comment オブジェクトを渡すとその内容が複製されます
(親ノードの情報は複製されません)。
@param string コメント文字列
@param comment REXML::Comment オブジェクト
@param parent 親ノード -
REXML
:: Declaration (7.0) -
DTD に含まれる各種宣言ノードを表すクラスです。
DTD に含まれる各種宣言ノードを表すクラスです。
このクラス自体は直接はインスタンスを作りません。
各サブクラスのインスタンスが使われます。 -
REXML
:: Declaration # to _ s -> String (7.0) -
ノードを文字列化します。
ノードを文字列化します。 -
REXML
:: Declaration # write(output , indent) -> () (7.0) -
output にノードを出力します。
output にノードを出力します。
このメソッドは deprecated です。REXML::Formatter で
出力してください。
@param output 出力先の IO オブジェクト
@param indent インデントの大きさ。無視されます。 -
REXML
:: DocType (7.0) -
XML の DTD(文書型定義、Document Type Definition)を表すクラスです。
XML の DTD(文書型定義、Document Type Definition)を表すクラスです。
rexml では DTD は積極的にはサポートされていません。
デフォルトの実体定義(gt, lt, amp, quot apos)の解決のため DTD は
ある程度はサポートされますが、スキーマの定義や検証をしたい場合は
XML schema や RELAX NG などを使ってください。
子ノード(REXML::Parent#children)として、
* REXML::ElementDecl
* REXML::ExternalEntity
* REXML::Entity
... -
REXML
:: DocType # add(child) -> () (7.0) -
child を子ノード列の最後に追加します。
child を子ノード列の最後に追加します。
REXML::Parent#add を内部で呼び出します。
また、REXML::DocType#entities を更新します。
@param child 追加するノード -
REXML
:: DocType # attribute _ of(element , attribute) -> String | nil (7.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
:: DocType # attributes _ of(element) -> [REXML :: Attribute] (7.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
:: DocType # clone -> REXML :: DocType (7.0) -
self の複製を返します。
self の複製を返します。
external_id (REXML::DocType#external_id) と
名前(REXML::DocType#name) のみ複製されるため、
結果として得られるオブジェクトはあまり有用ではないでしょう。 -
REXML
:: DocType # context -> { Symbol => object } (7.0) -
DTD が属する文書の「コンテキスト」を返します。
DTD が属する文書の「コンテキスト」を返します。
具体的には親ノードである REXML::Document オブジェクトの
REXML::Element#context を返します。
コンテキストの具体的な内容については REXML::Element#context を
参照してください。 -
REXML
:: DocType # entities -> { String => REXML :: Entity } (7.0) -
DTD で宣言されている実体の集合を Hash で返します。
DTD で宣言されている実体の集合を Hash で返します。
返される Hash は実体参照名をキーとし、対応する REXML::Entity オブジェクト
を値とするハッシュテーブルです。
これには、XML のデフォルトの実体(gt, lt, quot, apos)も含まれています。
//emlist[][ruby]{
doctype = REXML::Document.new(<<EOS).doctype
<!DOCTYPE foo [
<!ENTITY bar "barbarbarbar">
]>
EOS
p doctype.entities # => { "gt" => #... -
REXML
:: DocType # entity(name) -> String | nil (7.0) -
name という実体参照名を持つ実体を文字列で返します。
name という実体参照名を持つ実体を文字列で返します。
返される文字列は非正規化(REXML::Entity#unnormalized 参照)
された文字列が返されます。
name という名前を持つ実体が存在しない場合には nil を返します。
@param name 実体参照名(文字列)
//emlist[][ruby]{
doctype = REXML::Document.new(<<EOS).doctype
<!DOCTYPE foo [
<!ENTITY bar "barbarbarbar">
]>
EOS
p doctype.entity("bar") # => "ba... -
REXML
:: DocType # external _ id -> String | nil (7.0) -
DTD が外部サブセットを用いている場合は "SYSTEM", "PUBLIC" の いずれかの文字列を返します。
..."SYSTEM", "PUBLIC" の
いずれかの文字列を返します。
それ以外の場合は nil を返します。
//emlist[][ruby]{
require 'rexml/document'
doctype = REXML::Document.new(<<EOS).doctype
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/... -
REXML
:: DocType # name -> String (7.0) -
ルート要素名を返します。
ルート要素名を返します。
//emlist[][ruby]{
document = REXML::Document.new(<<EOS)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
EOS
doctype = document.doctype
p doctype.name # => "html"
//} -
REXML
:: DocType # namespaces -> nil (7.0) -
nil を返します。
nil を返します。 -
REXML
:: DocType # node _ type -> Symbol (7.0) -
Symbol :doctype を返します。
Symbol :doctype を返します。 -
REXML
:: DocType # notation(name) -> REXML :: NotationDecl | nil (7.0) -
DTD に含まれている記法宣言 (REXML::NotationDecl) で name という名前を持つものを返します。
DTD に含まれている記法宣言 (REXML::NotationDecl) で
name という名前を持つものを返します。
name という名前を持つ記法宣言が存在しない場合は nil を返します。
@param name 検索する記法名 -
REXML
:: DocType # notations -> [REXML :: NotationDecl] (7.0) -
DTD に含まれている記法宣言 (REXML::NotationDecl) を 配列で返します。
DTD に含まれている記法宣言 (REXML::NotationDecl) を
配列で返します。 -
REXML
:: DocType # public -> String | nil (7.0) -
DTD の公開識別子を返します。
...す。
DTD が公開識別子による外部サブセットを含んでいない場合は nil を返します。
//emlist[][ruby]{
require 'rexml/document'
doctype = REXML::Document.new(<<EOS).doctype
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/D... -
REXML
:: DocType # system -> String | nil (7.0) -
DTD のシステム識別子を返します。
...ム識別子を返します。
DTD が外部サブセットを含んでいない場合は nil を返します。
//emlist[][ruby]{
require 'rexml/document'
doctype = REXML::Document.new(<<EOS).doctype
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/D... -
REXML
:: DocType # write(output , indent = 0 , transitive = false , ie _ hack = false) -> () (7.0) -
output に DTD を出力します。
...ます。指定しないでください。
@param ie_hack 無視されます。指定しないでください。
//emlist[][ruby]{
require 'rexml/document'
doctype = REXML::Document.new(<<EOS).doctype
<!DOCTYPE books [
<!ELEMENT book (comment)>
<!ELEMENT comment (#PCDATA)>
<!ATTLIST book... -
REXML
:: DocType . new(source , parent = nil) -> REXML :: DocType (7.0) -
DocType オブジェクトを生成します。
DocType オブジェクトを生成します。
REXML::Source オブジェクトの場合は、Source オブジェクトが
保持しているDTDのテキストがパースされ、その内容によって DocType
オブジェクトが初期化されます。
REXML::DocType.new(Source.new(<<EOS))
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
EOS
このインターフェースは dep... -
REXML
:: DocType :: DEFAULT _ ENTITIES -> { String => REXML :: Entity } (7.0) -
XML の仕様上デフォルトで定義されている実体の Hash table。
XML の仕様上デフォルトで定義されている実体の Hash table。
"amp" => REXML::EntityConst::AMP は含まれません。 -
REXML
:: Document (7.0) -
XMLの完全な文書(ドキュメント)を表すクラス。
XMLの完全な文書(ドキュメント)を表すクラス。
XML処理命令(Processing Instruction, PI)、
DTD(文書型定義、Document Type Definition)、
などを含んでいます。
ドキュメントは直下の子ノードをただ一つ持っています(rootと呼び、
REXML::Document#root でアクセスできます)。
2つ目の要素を(REXML::Element#add_elementなどで)追加しようとすると
例外(RuntimeError)が発生します。 -
REXML
:: Document # <<(child) -> () (7.0) -
子ノードを追加します。
子ノードを追加します。
追加できるものは
* XML宣言(REXML::XMLDecl)
* DTD(REXML::DocType)
* ルート要素
のいずれかです。 -
REXML
:: Document # add(child) -> () (7.0) -
子ノードを追加します。
子ノードを追加します。
追加できるものは
* XML宣言(REXML::XMLDecl)
* DTD(REXML::DocType)
* ルート要素
のいずれかです。 -
REXML
:: Document # clone -> REXML :: Document (7.0) -
self を複製します。
self を複製します。
REXML::Document.new(self) と同じです。 -
REXML
:: Document # doctype -> REXML :: DocType | nil (7.0) -
文書の DTD を返します。
文書の DTD を返します。
文書が DTD を持たない場合は nil を返します。 -
REXML
:: Document # encoding -> String (7.0) -
XML 宣言に含まれている XML 文書のエンコーディングを返します。
...宣言を持たない場合はデフォルトの値
(REXML::XMLDecl.defaultで宣言されているもの)を返します。
//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new(<<EOS)
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<e />
EOS
doc.encoding # => "UTF-8"
//}... -
REXML
:: Document # expanded _ name -> String (7.0) -
""(空文字列)を返します。
""(空文字列)を返します。
XMLの仕様上、このオブジェクトはexpanded name名前を持ちえません。 -
REXML
:: Document # name -> String (7.0) -
""(空文字列)を返します。
""(空文字列)を返します。
XMLの仕様上、このオブジェクトはexpanded name名前を持ちえません。 -
REXML
:: Document # node _ type -> Symbol (7.0) -
シンボル :document を返します。
シンボル :document を返します。