22件ヒット
[1-22件を表示]
(0.041秒)
ライブラリ
-
rexml
/ document (22)
キーワード
- Entity (11)
- NotationDecl (11)
検索結果
-
REXML
:: NotationDecl (55.0) -
DTD の記法宣言を表すクラスです。
...DTD の記法宣言を表すクラスです。
//emlist[][ruby]{
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-g......if 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/......cs/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 #... -
REXML
:: Entity (31.0) -
XML における実体(エンティティ、entity)の宣言(declaration)を表わすクラス。
...ィティ、entity)の宣言(declaration)を表わすクラス。
DTD(REXML::DocType)内の実体宣言に対応するものです。
//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new(<<EOS)
<!DOCTYPE document [
<!ENTITY f "foo bar baz">
<!ENTITY x SYSTEM "x.txt">
<!ENTITY y SY......STEM "y.png" NDATA PNG>
<!ENTITY % z "zzz">
<!ENTITY zz "%z;%z;&f;">
]>
EOS
entities = doc.doctype.entities
# f は 内部実体名なので、external や ref は nil である
p entities["f"].name # => "f"
p entities["f"].value # => "foo bar baz"
p entities["f"].external # => nil
p entities["f"].......# external や ref が文字列を返してくる。
# しかし解析対象実体(parsed entity)なので ndata は nil を返す
p entities["x"].name # => "x"
p entities["x"].value # => nil
p entities["x"].external # => "SYSTEM"
p entities["x"].ref # => "x.txt"
p entities["x"].ndata # => nil
# y...