るりまサーチ

最速Rubyリファレンスマニュアル検索!
110件ヒット [1-100件を表示] (0.044秒)
トップページ > クエリ:new[x] > クラス:REXML::DocType[x]

別のキーワード

  1. openssl new
  2. _builtin new
  3. rexml/document new
  4. resolv new
  5. socket new

ライブラリ

キーワード

検索結果

<< 1 2 > >>

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

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

...持している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...
...スもありますが、内部用なので使わないで
ください。

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

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

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

...cument'
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 [...

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

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

REXML::DocType#system -> String | nil (13.0)

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

REXML::DocType#attribute_of(element, attribute) -> String | nil (7.0)

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

...@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 CDATA #REQUIRED
tit...

絞り込み条件を変える

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

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

...
REXML::Attribute#name と
REXML::Attribute#value で表現されます。

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

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

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

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

...す。

これには、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: ...>,
#...

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

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

...つ実体が存在しない場合には nil を返します。

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

//emlist[][ruby]{
doctype = REXML::Document.new(<<EOS).doctype
<!DOCTYPE foo [
<!ENTITY bar "barbarbarbar">
]>
EOS
p doctype.entity("bar") # => "barbarbar"
p doctype.entity("foo") # => nil
//}...

REXML::DocType#name -> String (7.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#write(output, indent = 0, transitive = false, ie_hack = false) -> () (7.0)

output に DTD を出力します。

...い。
@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 #REQUIRED
ti...

絞り込み条件を変える

<< 1 2 > >>