mirror of
https://github.com/ruby/ruby.git
synced 2025-08-24 13:34:17 +02:00
* 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
This commit is contained in:
parent
3e5f5f5ca4
commit
f61f11a936
3 changed files with 36 additions and 0 deletions
|
@ -54,6 +54,18 @@ class TestSAX2Parser < Test::Unit::TestCase
|
|||
|
||||
class TestExternlID < self
|
||||
class TestSystem < self
|
||||
def test_with_ndata
|
||||
declaration = [
|
||||
"name",
|
||||
"SYSTEM", "system-literal",
|
||||
"NDATA", "ndata-name",
|
||||
]
|
||||
assert_equal([declaration],
|
||||
parse(<<-INTERNAL_SUBSET))
|
||||
<!ENTITY name SYSTEM "system-literal" NDATA ndata-name>
|
||||
INTERNAL_SUBSET
|
||||
end
|
||||
|
||||
def test_without_ndata
|
||||
declaration = [
|
||||
"name",
|
||||
|
@ -67,6 +79,18 @@ class TestSAX2Parser < Test::Unit::TestCase
|
|||
end
|
||||
|
||||
class TestPublic < self
|
||||
def test_with_ndata
|
||||
declaration = [
|
||||
"name",
|
||||
"PUBLIC", "public-literal", "system-literal",
|
||||
"NDATA", "ndata-name",
|
||||
]
|
||||
assert_equal([declaration],
|
||||
parse(<<-INTERNAL_SUBSET))
|
||||
<!ENTITY name PUBLIC "public-literal" "system-literal" NDATA ndata-name>
|
||||
INTERNAL_SUBSET
|
||||
end
|
||||
|
||||
def test_without_ndata
|
||||
declaration = [
|
||||
"name",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue