るりまサーチ

最速Rubyリファレンスマニュアル検索!
319件ヒット [1-100件を表示] (0.165秒)

別のキーワード

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

ライブラリ

クラス

キーワード

検索結果

<< 1 2 3 ... > >>

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

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

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

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

@see REXML::DocType...

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

文書の DTD を返します。

文書の DTD を返します。

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

REXML::DocType (14000.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.new(source, parent = nil) -> REXML::DocType (11141.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
このインターフェースは deprecated です。

このメソッドは他のインターフェースもありますが、内部用なので使わないで
くださ...
...い。

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

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

self の複製を返します。

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

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

絞り込み条件を変える

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

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

...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(<<EOS).doctype
<!DOCTYPE...
...books [
<!ELEMENT books (book+)>
<!ELEMENT book (title,author)>
<!ELEMENT title (#PCDATA)>
<!ELEMENT author (#PCDATA)>
]>
EOS
doctype
.name # => "books"
doctype
.external_id # => nil
//}...

REXML::DocType#public -> String | nil (11066.0)

DTD の公開識別子を返します。

...][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#system -> String | nil (11066.0)

DTD のシステム識別子を返します。

...][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#attribute_of(element, attribute) -> String | nil (11048.0)

DTD 内の属性リスト宣言で、 element という名前の要素の attribute という 名前の属性のデフォルト値を返します。

...{
require 'rexml/document'

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

p doctype.attribute_...
...of("book", "publisher") # => "foobar publisher"
p doctype.attribute_of("bar", "foo") # => nil
p doctype.attribute_of("book", "baz") # => nil
p doctype.attribute_of("book", "title") # => nil
//}...

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

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

...{
require 'rexml/document'

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

p doctype.attributes...
..._of("book")
# => [author='', title='', publisher='foobar publisher']
p doctype.attributes_of("book")[0].name # => "author"
p doctype.attributes_of("book")[0].value # => ""
//}...

絞り込み条件を変える

<< 1 2 3 ... > >>