るりまサーチ

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

別のキーワード

  1. rexml/document node_type
  2. win32ole ole_type
  3. rss type
  4. rss type=
  5. net/imap media_type

ライブラリ

キーワード

検索結果

<< 1 2 3 > >>

REXML::DocType#node_type -> Symbol (9102.0)

Symbol :doctype を返します。

...Symbol :doctype を返します。...

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

self の複製を返します。

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

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

REXML::DocType.new(source, parent = nil) -> REXML::DocType (3101.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#add(child) -> () (3001.0)

child を子ノード列の最後に追加します。

...child を子ノード列の最後に追加します。

REXML::Parent#add を内部で呼び出します。
また、REXML::DocType#entities を更新します。

@param child 追加するノード...

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

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

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

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

...'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#context -> { Symbol => object } (3001.0)

DTD が属する文書の「コンテキスト」を返します。

DTD が属する文書の「コンテキスト」を返します。

具体的には親ノードである REXML::Document オブジェクトの
REXML::Element#context を返します。

コンテキストの具体的な内容については REXML::Element#context を
参照してください。

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

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

...octype = 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.e...

REXML::DocType#entity(name) -> String | nil (3001.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
//}...
<< 1 2 3 > >>