Search
Project
General
Profile
Sign in
Register
Home
Projects
Help
Search
:
Ruby
All Projects
Ruby
Overview
Activity
Roadmap
Issues
Repository
Like
Download (680 Bytes)
Bug #8665
» test_streamparser.rb
ohai (Ippei Obayashi)
, 07/23/2013 03:56 AM
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/OpenHatch.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
(
content
);
p
content
;
end
end
REXML
::
Parsers
::
StreamParser
.
new
(
xml
,
Listener
.
new
).
parse
« Previous
1
2
Next »
(1-1/2)
Loading...