るりまサーチ

最速Rubyリファレンスマニュアル検索!
11件ヒット [1-11件を表示] (0.073秒)
トップページ > 種類:クラス[x] > クエリ:TXT[x] > クエリ:Entity[x]

別のキーワード

  1. resolv txt
  2. txt data
  3. txt new
  4. txt strings
  5. txt resolv

ライブラリ

検索結果

REXML::Entity (18071.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 SYSTE...
...M "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"].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 は解析対象外実体(unparsed entity)なので ndata が記...