summaryrefslogtreecommitdiff
path: root/lib/rexml
diff options
context:
space:
mode:
authorkou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-08-11 09:09:25 +0000
committerkou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-08-11 09:09:25 +0000
commitf61f11a936a233f032dafa0298890ab8116c63bd (patch)
tree4e8d37905628b1e3ece22ec3411f2e2e51894fb4 /lib/rexml
parent3e5f5f5ca4ca2594f102832b34fc08ae82d74c23 (diff)
* lib/rexml/parsers/sax2parser.rb (REXML::Parsers::SAX2Parser#parse):
Support NDATA in external entity declaration. * test/rexml/parser/test_sax2.rb: Add tests for the above case. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42516 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rexml')
-rw-r--r--lib/rexml/parsers/sax2parser.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/rexml/parsers/sax2parser.rb b/lib/rexml/parsers/sax2parser.rb
index d73daf7..4a95bc6 100644
--- a/lib/rexml/parsers/sax2parser.rb
+++ b/lib/rexml/parsers/sax2parser.rb
@@ -177,6 +177,12 @@ module REXML
handle( :characters, copy )
when :entitydecl
@entities[ event[1] ] = event[2] if event.size == 3
+ case event[2]
+ when "SYSTEM"
+ event[4, 0] = "NDATA" if event.size == 5
+ when "PUBLIC"
+ event[5, 0] = "NDATA" if event.size == 6
+ end
handle( event[0], event[1..-1] )
when :processing_instruction, :comment, :attlistdecl,
:elementdecl, :cdata, :notationdecl, :xmldecl