File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -71,6 +71,19 @@ def test_prohibited_character
71
71
valid-name \" % &\" >]>
72
72
DETAIL
73
73
end
74
+
75
+ def test_unnecessary_ndata_declaration
76
+ exception = assert_raise ( REXML ::ParseException ) do
77
+ REXML ::Document . new ( '<!DOCTYPE root [<!ENTITY valid-name "valid-entity-value" NDATA valid-ndata-value>]>' )
78
+ end
79
+ assert_equal ( <<-DETAIL . chomp , exception . to_s )
80
+ Malformed entity declaration
81
+ Line: 1
82
+ Position: 83
83
+ Last 80 unconsumed characters:
84
+ valid-name \" valid-entity-value\" NDATA valid-ndata-value>]>
85
+ DETAIL
86
+ end
74
87
end
75
88
76
89
# https://www.w3.org/TR/2006/REC-xml11-20060816/#NT-ExternalID
@@ -202,6 +215,19 @@ def test_prohibited_character
202
215
% valid-name \" % &\" >]>
203
216
DETAIL
204
217
end
218
+
219
+ def test_unnecessary_ndata_declaration
220
+ exception = assert_raise ( REXML ::ParseException ) do
221
+ REXML ::Document . new ( '<!DOCTYPE root [<!ENTITY % valid-name "valid-entity-value" NDATA valid-ndata-value>]>' )
222
+ end
223
+ assert_equal ( <<-DETAIL . chomp , exception . to_s )
224
+ Malformed entity declaration
225
+ Line: 1
226
+ Position: 85
227
+ Last 80 unconsumed characters:
228
+ % valid-name \" valid-entity-value\" NDATA valid-ndata-value>]>
229
+ DETAIL
230
+ end
205
231
end
206
232
207
233
# https://www.w3.org/TR/2006/REC-xml11-20060816/#NT-ExternalID
You can’t perform that action at this time.
0 commit comments