るりまサーチ (Ruby 2.5.0)

最速Rubyリファレンスマニュアル検索!
2件ヒット [1-2件を表示] (0.009秒)

別のキーワード

  1. entity ndata
  2. rexml/document ndata
  3. ndata rexml::entity
  4. ndata rexml/document

クラス

モジュール

検索結果

REXML::Entity#ndata -> String | nil (54310.0)

解析対象外実体(unparsed entity)宣言である場合には その記法名(notation name)を返します。

解析対象外実体(unparsed entity)宣言である場合には
その記法名(notation name)を返します。

それ以外の場合は nil を返します。

REXML::StreamListener#entitydecl(content) -> () (25.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...