るりまサーチ

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

別のキーワード

  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::Document#doctype -> REXML::DocType | nil (21203.0)

文書の DTD を返します。

文書の DTD を返します。

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

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

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

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

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

@see REXML::DocType...

REXML::DocType#external_id -> String | nil (3079.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 (3079.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 (3079.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 (3055.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] (3049.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 # => ""
//}...

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

DTD で宣言されている実体の集合を Hash で返します。

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

REXML::DocType#name -> String (3043.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"
//}...
<< 1 2 3 > >>