るりまサーチ (Ruby 2.3.0)

最速Rubyリファレンスマニュアル検索!
1件ヒット [1-1件を表示] (0.093秒)
トップページ > バージョン:2.3.0[x] > クエリ:n[x] > ライブラリ:rexml[x] > クエリ:new[x] > クエリ:entitydecl[x]

別のキーワード

  1. etc sc_xopen_enh_i18n
  2. pop3 n_bytes
  3. pop n_bytes
  4. net/pop n_bytes
  5. pop3 n_mails

モジュール

検索結果

REXML::StreamListener#entitydecl(content) -> () (73261.0)

DTDの実体宣言をパースしたときに呼び出されるコールバックメソッドです。

...き方によって content に渡されるデータの形式が異なります。

//emlist[][ruby]{
require 'rexml/parsers/baseparser'
require 'rexml/parsers/streamparser'
require 'rexml/streamlistener'
xml = <<EOS
<!DOCTYPE root [
<!ENTITY % YN '"Yes"'>
<!ENTITY % YN 'Yes'>
<!ENTITY WhatHeSaid "He...
...ch.xml">
<!ENTITY hatch-pic SYSTEM "../grafix/OpenHatch.gif" NDATA gif>
]>
<root />
EOS

class Listener
include REXML::StreamListener
def entitydecl(content); p content; end
end
REXML
::Parsers::StreamParser.new(xml, Listener.new).parse
# >> ["YN", "\"Yes\"", "%"]
# >> ["YN", "Yes", "%"]
# >> ["W...