33件ヒット
[1-33件を表示]
(0.136秒)
ライブラリ
-
rexml
/ document (22) -
rexml
/ streamlistener (11)
クラス
-
REXML
:: DocType (11) -
REXML
:: Text (11)
モジュール
キーワード
- context (11)
- entitydecl (11)
検索結果
先頭3件
-
REXML
:: Text # doctype -> REXML :: DocType | nil (24309.0) -
テキストノードが属する文書の DTD を返します。
...テキストノードが属する文書の DTD を返します。
そのような文書(REXML::Document)が存在しない、すなわち
テキストノードの親ノードを辿っても REXML::Document に到達しない、
場合には nil を返します。
@see REXML::DocType... -
REXML
:: DocType # context -> { Symbol => object } (12201.0) -
DTD が属する文書の「コンテキスト」を返します。
...DTD が属する文書の「コンテキスト」を返します。
具体的には親ノードである REXML::Document オブジェクトの
REXML::Element#context を返します。
コンテキストの具体的な内容については REXML::Element#context を
参照してください。... -
REXML
:: StreamListener # entitydecl(content) -> () (6119.0) -
DTDの実体宣言をパースしたときに呼び出されるコールバックメソッドです。
...//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 said %YN;">
<!ENTITY open-hatch SYSTEM "http://www.textuality.com/boilerplate/Op......atch.xml">
<!ENTITY open-hatch PUBLIC "-//Textuality//TEXT Standard open-hatch boilerplate//EN" "http://www.textuality.com/boilerplate/OpenHatch.xml">
<!ENTITY hatch-pic SYSTEM "../grafix/OpenHatch.gif" NDATA gif>
]>
<root />
EOS
class Listener
include REXML::StreamListener
def entitydecl(conte......end
end
REXML::Parsers::StreamParser.new(xml, Listener.new).parse
# >> ["YN", "\"Yes\"", "%"]
# >> ["YN", "Yes", "%"]
# >> ["WhatHeSaid", "He said %YN;"]
# >> ["open-hatch", "SYSTEM", "http://www.textuality.com/boilerplate/OpenHatch.xml"]
# >> ["open-hatch", "PUBLIC", "-//Textuality//TEXT Standard o...