るりまサーチ (Ruby 2.2.0)

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

別のキーワード

  1. string []=
  2. string []
  3. string slice
  4. string slice!
  5. string gsub

キーワード

検索結果

REXML::DocType#attribute_of(element, attribute) -> String | nil (310.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#entities -> { String => REXML::Entity } (310.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 (310.0)

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

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

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

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

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

REXML::DocType#external_id -> String | nil (310.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 (310.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#public -> String | nil (310.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 (310.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::DEFAULT_ENTITIES -> { String => REXML::Entity } (310.0)

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

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

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