要約
DTD の記法宣言を表すクラスです。
require 'rexml/document'
doctype = REXML::Document.new(<<EOS).doctype
<!DOCTYPE foo [
<!NOTATION type-image-svg       PUBLIC "-//W3C//DTD SVG 1.1//EN"
      "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!NOTATION type-image-gif       PUBLIC "image/gif">
<!NOTATION foobar               SYSTEM "http://example.org/foobar.dtd">
]>
EOS
svg = doctype.notation("type-image-svg")
p svg.name  # => "type-image-svg"
p svg.to_s  # => "<!NOTATION type-image-svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">"
p svg.public # => "-//W3C//DTD SVG 1.1//EN"
p svg.system # => "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"
gif = doctype.notation("type-image-gif")
p gif.name # => "type-image-gif"
p gif.to_s # => "<!NOTATION type-image-gif PUBLIC \"image/gif\">"
p gif.public # => "image/gif"
p gif.system # => nil
foobar = doctype.notation("foobar")
p foobar.name # => "foobar"
p foobar.to_s # => "<!NOTATION foobar SYSTEM \"http://example.org/foobar.dtd\">"
p foobar.public # => nil
p foobar.system # => "http://example.org/foobar.dtd"
目次
継承しているメソッド
- REXML::Childから継承しているメソッド
- REXML::Nodeから継承しているメソッド
特異メソッド
- new(name, middle, pub, sys) -> REXML::NotationDecl[permalink][rdoc][edit]
- 
NotationDecl オブジェクトを生成します。 - [PARAM] name:
- 記法名(文字列)
- [PARAM] middle:
- 種別("PUBLIC" もしくは "SYSTEM")
- [PARAM] pub:
- 公開識別子(文字列)
- [PARAM] sys:
- URI(文字列)
 
インスタンスメソッド
- name -> String[permalink][rdoc][edit]
- 
記法宣言の名前を返します。 
- public -> String | nil[permalink][rdoc][edit]
- 
公開識別子を返します。 宣言が公開識別子を含まない場合は nil を返します。 
- public=(value)[permalink][rdoc][edit]
- 
公開識別子を value に変更します。 - [PARAM] value:
- 設定する公開識別子(文字列)
 
- system -> String | nil[permalink][rdoc][edit]
- 
システム識別子(URI)を返します。 宣言がシステム識別子を含まない場合は nil を返します。 
- system=(value)[permalink][rdoc][edit]
- 
システム識別子を変更します。 - [PARAM] value:
- 設定するシステム識別子
 
- to_s -> String[permalink][rdoc][edit]
- 
self を文字列化したものを返します。 
- write(output, indent = -1)[permalink][rdoc][edit]
- 
output へ self を文字列化して出力します。 このメソッドは deprecated です。REXML::Formatter で出力してください。 - [PARAM] output:
- 出力先の IO オブジェクト
- [PARAM] indent:
- インデントの大きさ。無視されます。