るりまサーチ (Ruby 2.2.0)

最速Rubyリファレンスマニュアル検索!
27件ヒット [1-27件を表示] (0.039秒)
トップページ > バージョン:2.2.0[x] > ライブラリ:rexml[x] > クエリ:REXML::DocType[x]

別のキーワード

  1. rexml/document new
  2. rexml/document write
  3. rexml/document clone
  4. rexml/document to_s
  5. rexml/document node_type

クラス

キーワード

検索結果

REXML::DocType (69004.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::NotationDecl
* REXML::AttlistDecl
などを保持しています。...

REXML::DocType#clone -> REXML::DocType (63343.0)

self の複製を返します。

...self の複製を返します。

external_id (REXML::DocType#external_id) と
名前(REXML::DocType#name) のみ複製されるため、
結果として得られるオブジェクトはあまり有用ではないでしょう。...

REXML::DocType.new(source, parent = nil) -> REXML::DocType (63325.0)

DocType オブジェクトを生成します。

...オブジェクトを生成します。

REXML
::Source オブジェクトの場合は、Source オブジェクトが
保持しているDTDのテキストがパースされ、その内容によって DocType
オブジェクトが初期化されます。
REXML
::DocType.new(Source.new(<<EOS))
<!DO...
...スもありますが、内部用なので使わないで
ください。

一般的にいって、XML 文書に含まれる DTD は REXML::Document.new などで
適切に解析され、REXML::Document#doctype で取得できます。
このメソッドを直接使う必要はありません。...

REXML::DocType#add(child) -> () (63022.0)

child を子ノード列の最後に追加します。

...child を子ノード列の最後に追加します。

REXML
::Parent#add を内部で呼び出します。
また、REXML::DocType#entities を更新します。

@param child 追加するノード...

REXML::DocType#attribute_of(element, attribute) -> String | nil (63004.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
author...

絞り込み条件を変える

REXML::DocType#attributes_of(element) -> [REXML::Attribute] (63004.0)

DTD 内の属性リスト宣言で、 element という名前の要素に対し宣言されている 属性の名前とデフォルト値を REXML::Attribute の配列で返します。

...デフォルト値を REXML::Attribute の配列で返します。

名前とデフォルト値のペアは、各 Attribute オブジェクトの
REXML
::Attribute#name と
REXML
::Attribute#value で表現されます。

//emlist[][ruby]{
require 'rexml/document'

doctype = REXML::Document.new(<<EOS...

REXML::DocType#context -> { Symbol => object } (63004.0)

DTD が属する文書の「コンテキスト」を返します。

...DTD が属する文書の「コンテキスト」を返します。

具体的には親ノードである REXML::Document オブジェクトの
REXML
::Element#context を返します。

コンテキストの具体的な内容については REXML::Element#context を
参照してください。...

REXML::DocType#entities -> { String => REXML::Entity } (63004.0)

DTD で宣言されている実体の集合を 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::Entity: ...>,
# "lt" => #<REXML::Entity: ...>, ... }
p doctype.entities["bar"].to_s # => "<!ENTITY bar \"barbarbarbar\">"
p doctype.entities["gt"].to_s # => "<!ENTITY gt \">\">"
//}...

REXML::DocType#entity(name) -> String | nil (63004.0)

name という実体参照名を持つ実体を文字列で返します。

...れる文字列は非正規化(REXML::Entity#unnormalized 参照)
された文字列が返されます。

name という名前を持つ実体が存在しない場合には nil を返します。

@param name 実体参照名(文字列)

//emlist[][ruby]{
doctype = REXML::Document.new(<<EOS).doctype...

REXML::DocType#external_id -> String | nil (63004.0)

DTD が外部サブセットを用いている場合は "SYSTEM", "PUBLIC" の いずれかの文字列を返します。

...t[][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/DTD/xhtml1-strict.dtd">
EOS
doctype.name # => "html"
doctype.external_id # => "PUBLIC"

doctype = REXML::Document.new(<<EO...

絞り込み条件を変える

REXML::DocType#name -> String (63004.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 (63004.0)

nil を返します。

nil を返します。

REXML::DocType#node_type -> Symbol (63004.0)

Symbol :doctype を返します。

Symbol :doctype を返します。

REXML::DocType#notation(name) -> REXML::NotationDecl | nil (63004.0)

DTD に含まれている記法宣言 (REXML::NotationDecl) で name という名前を持つものを返します。

...DTD に含まれている記法宣言 (REXML::NotationDecl) で
name という名前を持つものを返します。

name という名前を持つ記法宣言が存在しない場合は nil を返します。

@param name 検索する記法名...

REXML::DocType#notations -> [REXML::NotationDecl] (63004.0)

DTD に含まれている記法宣言 (REXML::NotationDecl) を 配列で返します。

...DTD に含まれている記法宣言 (REXML::NotationDecl) を
配列で返します。...

絞り込み条件を変える

REXML::DocType#public -> String | nil (63004.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/DTD/xhtm...
...l1-strict.dtd">
EOS
doctype.system # => "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
doctype.public # => "-//W3C//DTD XHTML 1.0 Strict//EN"

doctype = REXML::Document.new(<<EOS).doctype
<!DOCTYPE root SYSTEM "foobar">
EOS
doctype.system # => "foobar"
doctype.public # => nil
//}...

REXML::DocType#system -> String | nil (63004.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/DTD/xhtml1...
...-strict.dtd">
EOS
doctype.system # => "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
doctype.public # => "-//W3C//DTD XHTML 1.0 Strict//EN"

doctype = REXML::Document.new(<<EOS).doctype
<!DOCTYPE root SYSTEM "foobar">
EOS
doctype.system # => "foobar"
doctype.public # => nil
//}...

REXML::DocType#write(output, indent = 0, transitive = false, ie_hack = false) -> () (63004.0)

output に DTD を出力します。

...output に DTD を出力します。

このメソッドは deprecated です。REXML::Formatter で
出力してください。

@param output 出力先の IO オブジェクト
@param indent インデントの深さ。指定しないでください。
@param transitive 無視されます。指定...
...しないでください。
@param ie_hack 無視されます。指定しないでください。

//emlist[][ruby]{
require 'rexml/document'

doctype = REXML::Document.new(<<EOS).doctype
<!DOCTYPE books [
<!ELEMENT book (comment)>
<!ELEMENT comment (#PCDATA)>
<!ATTLIST book
author CDATA #...

REXML::DocType::DEFAULT_ENTITIES -> { String => REXML::Entity } (63004.0)

XML の仕様上デフォルトで定義されている実体の Hash table。

...XML の仕様上デフォルトで定義されている実体の Hash table。

"amp" => REXML::EntityConst::AMP は含まれません。...

REXML::Text#doctype -> REXML::DocType | nil (325.0)

テキストノードが属する文書の DTD を返します。

...テキストノードが属する文書の DTD を返します。

そのような文書(REXML::Document)が存在しない、すなわち
テキストノードの親ノードを辿っても REXML::Document に到達しない、
場合には nil を返します。

@see REXML::DocType...

絞り込み条件を変える

REXML::Document#doctype -> REXML::DocType | nil (307.0)

文書の DTD を返します。

文書の DTD を返します。

文書が DTD を持たない場合は nil を返します。

REXML::Document#<<(child) -> () (22.0)

子ノードを追加します。

...子ノードを追加します。

追加できるものは
* XML宣言(REXML::XMLDecl)
* DTD(REXML::DocType)
* ルート要素
のいずれかです。...

REXML::Document#add(child) -> () (22.0)

子ノードを追加します。

...子ノードを追加します。

追加できるものは
* XML宣言(REXML::XMLDecl)
* DTD(REXML::DocType)
* ルート要素
のいずれかです。...

REXML::Entity (22.0)

XML における実体(エンティティ、entity)の宣言(declaration)を表わすクラス。

...る実体(エンティティ、entity)の宣言(declaration)を表わすクラス。

DTD(REXML::DocType)内の実体宣言に対応するものです。

//emlist[][ruby]{
require 'rexml/document'

doc = REXML::Document.new(<<EOS)
<!DOCTYPE document [
<!ENTITY f "foo bar baz">
<!ENTITY x SYSTEM "x....

REXML::Text.new(arg, respect_whitespace = false, parent = nil, raw = nil, entity_filter = nil, illegal = REXML::Text::NEEDS_A_SECOND_CHECK) (22.0)

テキストノードオブジェクトを生成します。

...ジェクトを生成します。

arg でノードの内容を指定します。
文字列の場合はそれが内容として使われます。
REXML
::Text オブジェクトの場合はその内容が複製されます。

respect_whitespace に真を指定すると、arg に含まれる空白文...
...あると解釈され、
rexml
はテキストに含まれているすべての(定義済み)実体を
エスケープします
nilの場合、親ノードが raw モードであるかどうかで
self が raw モードになるかどうかが決まります。
arg に REXML::Text オブジェクト...
...(デフォルトの場合)、
テキストがどのようにエスケープされるかは、そのノードが属する
文書(REXML::Document)の
DTD(REXML::DocType, REXML::Document#doctype)
で定義されます。DTD が与えられていない場合は、XMLの規格上
以下の実体参照/...

絞り込み条件を変える

REXML::Text.normalize(input, doctype = nil, entity_filter = nil) -> String (22.0)

input を正規化(すべての entity をエスケープ)したものを 返します。

...input を正規化(すべての entity をエスケープ)したものを
返します。

@param input 正規化する文字列
@param doctype DTD(REXML::DocType オブジェクト)
@param entity_filter 置換したい実体の名前の配列...

REXML::Text.unnormalize(string, doctype = nil, filter = nil, illegal = nil) -> String (22.0)

string を非正規化(すべての entity をアンエスケープ)したものを 返します。

...ype DTD(REXML::DocType オブジェクト)
@param filter アンエスケープしない実体の実体名(文字列配列)
@param illegal 内部用。使わないでください。

//emlist[][ruby]{
require 'rexml/text'
REXML
::Text.unnormalize("&amp; &foobar; &lt;") # => "& &foobar; <"
REXML
::Text....