るりまサーチ

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

別のキーワード

  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::DocType (18016.0)

XML の DTD(文書型定義、Document Type Definition)を表すクラスです。

...XML の DTD(文書型定義、Document Type Definition)を表すクラスです。

rexml では DTD は積極的にはサポートされていません。
デフォルトの実体定義(gt, lt, amp, quot apos)の解決のため DTD は
ある程度はサポートされますが、スキーマの定...

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

文書の DTD を返します。

文書の DTD を返します。

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

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

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

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

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

@see REXML::DocType...

REXML::DocType.new(source, parent = nil) -> REXML::DocType (3153.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#external_id -> String | nil (3078.0)

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

...ml/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 bo...
...oks [
<!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 (3078.0)

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

...uby]{
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 (3078.0)

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

...uby]{
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 (3054.0)

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

...equire '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] (3048.0)

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

...equire '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 ... > >>