/[suikacvs]/messaging/manakai/t/markup-xml-parser-base.t
Suika

Contents of /messaging/manakai/t/markup-xml-parser-base.t

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1.2.11 - (show annotations) (download) (as text)
Tue Jun 22 07:36:20 2004 UTC (20 years, 10 months ago) by wakaba
Branch: experimental-xml-parser-200401
Changes since 1.1.2.10: +6 -0 lines
File MIME type: application/x-troff
Error refined

1 #!/usr/bin/perl -w
2 use strict;
3 use Test;
4 use Message::Markup::XML::QName qw/NULL_URI DEFAULT_PFX/;
5 use Message::Markup::XML::Node;
6 use Message::Markup::XML::Parser::Base;
7 BEGIN {
8 our $NS =
9 {
10 (DEFAULT_PFX) => Message::Markup::XML::Parser::Base::URI_CONFIG,
11 tree => q<http://suika.fam.cx/~wakaba/-temp/2004/2/22/Parser/TreeConstruct/>,
12 test => q<mid:t.markup-xml-parser-base.t+2004.5.20@manakai.suika.fam.cx#>,
13 };
14 }
15 use Message::Util::QName::General [qw/ExpandedURI/], our $NS;
16
17 sub match ($$;%) {
18 my ($result, $expect, %opt) = @_;
19 my $c = +{
20 parse_attribute_specification => sub {
21 no warnings 'uninitialized';
22 qq<<r $_[0] xmlns=""></r>>;
23 },
24 }->{$opt{method}} || sub {shift};
25 if (ref $expect) {
26 for (@$expect) {
27 return 1 if $result eq $c->($_);
28 }
29 } else {
30 $result eq $c->($expect);
31 }
32 }
33
34 my @a =
35 (
36 {
37 t => q{"foo"},
38 method => 'parse_attribute_value_specification',
39 option => {ExpandedURI q<match-or-error> => 1},
40 result => q(1),
41 },
42 {
43 t => q{'foo'},
44 method => 'parse_attribute_value_specification',
45 option => {ExpandedURI q<match-or-error> => 1},
46 result => q(1),
47 },
48 {
49 t => q{"foo},
50 method => 'parse_attribute_value_specification',
51 option => {ExpandedURI q<match-or-error> => 1},
52 result => q(0:4:SYNTAX_ALITC_REQUIRED),
53 },
54 {
55 t => q{'foo},
56 method => 'parse_attribute_value_specification',
57 option => {ExpandedURI q<match-or-error> => 1},
58 result => q(0:4:SYNTAX_ALITAC_REQUIRED),
59 },
60 {
61 t => q{foo},
62 method => 'parse_attribute_value_specification',
63 option => {ExpandedURI q<match-or-error> => 1},
64 result => q(0:0:SYNTAX_ATTRIBUTE_VALUE),
65 },
66 {
67 t => q{foo},
68 method => 'parse_attribute_value_specification',
69 option => {ExpandedURI q<match-or-error> => 0},
70 result => q(0:0:SYNTAX_ATTRIBUTE_VALUE),
71 },
72 {
73 t => q{>},
74 method => 'parse_attribute_value_specification',
75 option => {ExpandedURI q<match-or-error> => 0},
76 result => q(1),
77 },
78 {
79 t => q{"foo<bar"},
80 method => 'parse_attribute_value_specification',
81 result => q(0:4:SYNTAX_NO_LESS_THAN_IN_ATTR_VAL),
82 },
83 {
84 t => q{'foo<bar'},
85 method => 'parse_attribute_value_specification',
86 result => q(0:4:SYNTAX_NO_LESS_THAN_IN_ATTR_VAL),
87 },
88 {
89 entity => {amp => q<&#x26;>},
90 t => q{"foo&amp;bar"},
91 method => 'parse_attribute_value_specification',
92 option => {
93 ExpandedURI q<use-reference> => 1,
94 ExpandedURI q<allow-general-entity-reference> => 1,
95 ExpandedURI q<allow-numeric-character-reference> => 1,
96 ExpandedURI q<allow-hex-character-reference> => 1,
97 },
98 result => q(1),
99 },
100 {
101 entity => {amp => q<&#x26;>},
102 t => q{'foo&amp;bar'},
103 method => 'parse_attribute_value_specification',
104 option => {
105 ExpandedURI q<use-reference> => 1,
106 ExpandedURI q<allow-general-entity-reference> => 1,
107 ExpandedURI q<allow-numeric-character-reference> => 1,
108 ExpandedURI q<allow-hex-character-reference> => 1,
109 },
110 result => q(1),
111 },
112 {
113 t => q{"foo&#1234;bar"},
114 method => 'parse_attribute_value_specification',
115 option => {
116 ExpandedURI q<use-reference> => 1,
117 ExpandedURI q<allow-general-entity-reference> => 1,
118 ExpandedURI q<allow-numeric-character-reference> => 1,
119 ExpandedURI q<allow-hex-character-reference> => 1,
120 },
121 result => q(1),
122 },
123 {
124 t => q{'foo&#1234;bar'},
125 method => 'parse_attribute_value_specification',
126 result => q(1),
127 option => {
128 ExpandedURI q<use-reference> => 1,
129 ExpandedURI q<allow-general-entity-reference> => 1,
130 ExpandedURI q<allow-numeric-character-reference> => 1,
131 ExpandedURI q<allow-hex-character-reference> => 1,
132 },
133 },
134 {
135 t => q{"foo&#xE234;bar"},
136 method => 'parse_attribute_value_specification',
137 option => {
138 ExpandedURI q<use-reference> => 1,
139 ExpandedURI q<allow-general-entity-reference> => 1,
140 ExpandedURI q<allow-numeric-character-reference> => 1,
141 ExpandedURI q<allow-hex-character-reference> => 1,
142 },
143 result => q(1),
144 },
145 {
146 t => q{'foo&#xE234;bar'},
147 method => 'parse_attribute_value_specification',
148 option => {
149 ExpandedURI q<use-reference> => 1,
150 ExpandedURI q<allow-general-entity-reference> => 1,
151 ExpandedURI q<allow-numeric-character-reference> => 1,
152 ExpandedURI q<allow-hex-character-reference> => 1,
153 },
154 result => q(1),
155 },
156 {
157 t => q{"foo&#SPACE;bar"},
158 method => 'parse_attribute_value_specification',
159 option => {
160 ExpandedURI q<use-reference> => 1,
161 ExpandedURI q<allow-general-entity-reference> => 1,
162 ExpandedURI q<allow-numeric-character-reference> => 1,
163 ExpandedURI q<allow-hex-character-reference> => 1,
164 },
165 result => q(0:6:SYNTAX_NAMED_CHARACTER_REFERENCE),
166 },
167 {
168 t => q{"foo&#XE234;bar"},
169 method => 'parse_attribute_value_specification',
170 option => {
171 ExpandedURI q<use-reference> => 1,
172 ExpandedURI q<allow-general-entity-reference> => 1,
173 ExpandedURI q<allow-numeric-character-reference> => 1,
174 ExpandedURI q<allow-hex-character-reference> => 1,
175 },
176 result => q(0:6:SYNTAX_HCRO_CASE),
177 },
178 {
179 t => q{"foo& bar"},
180 method => 'parse_attribute_value_specification',
181 result => q(0:5:SYNTAX_HASH_OR_NAME_REQUIRED),
182 },
183 {
184 t => q{'foo&# bar'},
185 method => 'parse_attribute_value_specification',
186 result => q(0:6:SYNTAX_X_OR_DIGIT_REQUIRED),
187 },
188 {
189 t => q{"foo&#x bar"},
190 method => 'parse_attribute_value_specification',
191 result => q(0:7:SYNTAX_HEXDIGIT_REQUIRED),
192 },
193 {
194 t => q{"foo&#x0120 bar"},
195 method => 'parse_attribute_value_specification',
196 option => {
197 ExpandedURI q<use-reference> => 1,
198 ExpandedURI q<allow-general-entity-reference> => 1,
199 ExpandedURI q<allow-numeric-character-reference> => 1,
200 ExpandedURI q<allow-hex-character-reference> => 1,
201 },
202 result => q(0:11:SYNTAX_REFC_REQUIRED),
203 },
204 {
205 t => q{"foo&#0120 bar"},
206 method => 'parse_attribute_value_specification',
207 option => {
208 ExpandedURI q<use-reference> => 1,
209 ExpandedURI q<allow-general-entity-reference> => 1,
210 ExpandedURI q<allow-numeric-character-reference> => 1,
211 ExpandedURI q<allow-hex-character-reference> => 1,
212 },
213 result => q(0:10:SYNTAX_REFC_REQUIRED),
214 },
215 {
216 entity => {amp => q<&#x26;>},
217 t => q{"foo&amp bar"},
218 method => 'parse_attribute_value_specification',
219 option => {
220 ExpandedURI q<use-reference> => 1,
221 ExpandedURI q<allow-general-entity-reference> => 1,
222 ExpandedURI q<allow-numeric-character-reference> => 1,
223 ExpandedURI q<allow-hex-character-reference> => 1,
224 },
225 result => q(0:8:SYNTAX_REFC_REQUIRED),
226 },
227 {
228 t => q{foo="bar"},
229 method => 'parse_attribute_specification',
230 result => q(1),
231 },
232 {
233 t => q{"bar"},
234 method => 'parse_attribute_specification',
235 option => {ExpandedURI q<match-or-error> => 1},
236 result => q(0:0:SYNTAX_ATTR_NAME_REQUIRED),
237 },
238 {
239 t => q{"bar"},
240 method => 'parse_attribute_specification',
241 option => {ExpandedURI q<match-or-error> => 0},
242 result => q(1),
243 output => q(),
244 },
245 {
246 t => qq{foo \t= \x0D"bar"},
247 method => 'parse_attribute_specification',
248 result => q(1),
249 output => q(foo="bar"),
250 },
251 {
252 t => q{foo"bar"},
253 method => 'parse_attribute_specification',
254 result => q(0:3:SYNTAX_VI_REQUIRED),
255 },
256 {
257 t => q{foo=},
258 method => 'parse_attribute_specification',
259 result => q(0:4:SYNTAX_ALITO_OR_ALITAO_REQUIRED),
260 },
261 {
262 t => q{foo:bar='baz'},
263 method => 'parse_attribute_specification',
264 result => q(1),
265 output => [q(foo:bar="baz"), q(foo:bar='baz')],
266 },
267 {
268 t => q{:bar='baz'},
269 method => 'parse_attribute_specification',
270 result => q(1),
271 output => [q(:bar="baz"), q(:bar='baz')],
272 },
273 {
274 t => q{r='baz'},
275 method => 'parse_attribute_specification',
276 result => q(1),
277 output => [q(r="baz"), q(r='baz')],
278 },
279 {
280 t => q{r!='baz'},
281 method => 'parse_attribute_specification',
282 result => q(0:1:SYNTAX_VI_REQUIRED),
283 },
284 {
285 t => q{<foo>},
286 method => 'parse_start_tag',
287 result => q(1),
288 },
289 {
290 t => q{<foo >},
291 method => 'parse_start_tag',
292 result => q(1),
293 },
294 {
295 t => q{<foo},
296 method => 'parse_start_tag',
297 result => q(0:4:SYNTAX_STAGC_OR_NESTC_REQUIRED),
298 },
299 {
300 t => q{<foo bar="baz">},
301 method => 'parse_start_tag',
302 result => q(1),
303 },
304 {
305 t => q{<foo bar="baz" baz="bar">},
306 method => 'parse_start_tag',
307 result => q(1),
308 },
309 {
310 t => q{<foo bar="baz"baz="bar">},
311 method => 'parse_start_tag',
312 result => q(0:14:SYNTAX_S_REQUIRED_BETWEEN_ATTR_SPEC),
313 },
314 {
315 t => q{<foo bar="bazbaz="bar">},
316 method => 'parse_start_tag',
317 result => q(0:18:SYNTAX_S_REQUIRED_BETWEEN_ATTR_SPEC),
318 },
319 {
320 t => q{<foo "baz"baz="bar">},
321 method => 'parse_start_tag',
322 result => q(0:5:SYNTAX_STAGC_OR_NESTC_REQUIRED),
323 },
324 {
325 t => q{<foo="bar">},
326 method => 'parse_start_tag',
327 result => q(0:4:SYNTAX_STAGC_OR_NESTC_REQUIRED),
328 },
329 {
330 t => q{<foo a=bar>},
331 method => 'parse_start_tag',
332 result => q(0:7:SYNTAX_ATTRIBUTE_VALUE),
333 },
334 {
335 t => q{<foo/>},
336 method => 'parse_start_tag',
337 result => q(1),
338 },
339 {
340 t => q{<foo/},
341 method => 'parse_start_tag',
342 result => q(0:5:SYNTAX_NET_REQUIRED),
343 },
344 {
345 t => q{<foo />},
346 method => 'parse_start_tag',
347 result => q(1),
348 },
349 {
350 t => q{</foo>},
351 method => 'parse_start_tag',
352 result => q(0:1:SYNTAX_ELEMENT_TYPE_NAME_FOLLOWING_STAGO_REQUIRED),
353 },
354 {
355 t => q{<},
356 method => 'parse_start_tag',
357 result => q(0:1:SYNTAX_ELEMENT_TYPE_NAME_FOLLOWING_STAGO_REQUIRED),
358 },
359 {
360 t => q{<<},
361 method => 'parse_start_tag',
362 result => q(0:1:SYNTAX_ELEMENT_TYPE_NAME_FOLLOWING_STAGO_REQUIRED),
363 },
364
365 {
366 t => q{<e>text</e>},
367 method => 'parse_element',
368 option => {},
369 result => q(1),
370 },
371 {
372 t => q{<e>text<tag>text</tag>text<tag/>text</e>},
373 method => 'parse_element',
374 option => {},
375 result => q(1),
376 },
377 {
378 t => q{<e>text<tag</e>},
379 method => 'parse_element',
380 result => q(0:11:SYNTAX_STAGC_OR_NESTC_REQUIRED),
381 },
382 {
383 entity => {ref => q<ref>},
384 t => q{<e>text&ref;and&#1234;text</e>},
385 method => 'parse_element',
386 result => q(1),
387 },
388
389 {
390 t => q{<foo></foo bar="baz">},
391 method => 'parse_element',
392 result => q(0:11:SYNTAX_ETAGC_REQUIRED),
393 },
394 {
395 t => q{<foo></foo/>},
396 method => 'parse_element',
397 result => q(0:10:SYNTAX_ETAGC_REQUIRED),
398 },
399 {
400 t => q{<foo></foo},
401 method => 'parse_element',
402 result => q(0:10:SYNTAX_ETAGC_REQUIRED),
403 },
404 {
405 t => q{<foo></b>},
406 method => 'parse_element',
407 result => q(0:7:WFC_ELEMENT_TYPE_MATCH),
408 },
409 {
410 t => q{<e></},
411 method => 'parse_element',
412 option => {ExpandedURI q<allow_end_tag> => 0},
413 result => q(0:5:SYNTAX_ELEMENT_TYPE_NAME_FOLLOWING_ETAGO_REQUIRED),
414 },
415 {
416 t => q{<foo>aa},
417 method => 'parse_element',
418 result => q(0:7:SYNTAX_END_TAG_REQUIRED),
419 },
420
421 {
422 t => q{<!-- comment -->},
423 method => 'parse_markup_declaration',
424 result => 1,
425 },
426 {
427 t => q{<!-- comment- -->},
428 method => 'parse_markup_declaration',
429 result => 1,
430 },
431 {
432 t => q{<!-- comment-> -->},
433 method => 'parse_markup_declaration',
434 result => 1,
435 },
436 {
437 t => q{<!-- comment},
438 method => 'parse_markup_declaration',
439 result => q(0:12:SYNTAX_COMC_REQUIRED),
440 },
441 {
442 t => q{<!-- comment --},
443 method => 'parse_markup_declaration',
444 result => q(0:15:SYNTAX_MDC_FOR_COMMENT_REQUIRED),
445 },
446 {
447 t => q{<!-- comment --->},
448 method => 'parse_markup_declaration',
449 result => q(0:15:SYNTAX_MDC_FOR_COMMENT_REQUIRED),
450 },
451 {
452 t => q{<!--- comment -->},
453 method => 'parse_markup_declaration',
454 result => 1,
455 },
456 {
457 t => q{<!-- comment ----},
458 method => 'parse_markup_declaration',
459 result => q(0:15:SYNTAX_MULTIPLE_COMMENT),
460 },
461 {
462 t => q{<!-- comment ----aa-->},
463 method => 'parse_markup_declaration',
464 result => q(0:15:SYNTAX_MULTIPLE_COMMENT),
465 },
466 {
467 t => q{<!-- comment -- >},
468 method => 'parse_markup_declaration',
469 result => q(0:15:SYNTAX_S_IN_COMMENT_DECLARATION),
470 },
471
472 {
473 t => q{<e><!-- comment --></e>},
474 method => 'parse_element',
475 result => 1,
476 },
477 {
478 t => q{<e>bb<!-- comment -->aa</e>},
479 method => 'parse_element',
480 result => 1,
481 },
482 {
483 t => q{<e>bb<!-- comment -->aa<!--c--></e>},
484 method => 'parse_element',
485 result => 1,
486 },
487
488 {
489 t => q{<?pi?>},
490 method => 'parse_processing_instruction',
491 result => 1,
492 },
493 {
494 t => q{<?pi target-data?>},
495 method => 'parse_processing_instruction',
496 result => 1,
497 },
498 {
499 t => q{<?pi target-data ?>},
500 method => 'parse_processing_instruction',
501 result => 1,
502 },
503 {
504 t => q{<?pi target-data="something"?>},
505 method => 'parse_processing_instruction',
506 result => 1,
507 },
508 {
509 t => q{<?pi target-data="some?>},
510 method => 'parse_processing_instruction',
511 result => 1,
512 },
513 {
514 t => q{<? system-data ?>},
515 method => 'parse_processing_instruction',
516 result => q(0:2:SYNTAX_TARGET_NAME_REQUIRED),
517 },
518 {
519 t => q{<?pi},
520 method => 'parse_processing_instruction',
521 result => q(0:4:SYNTAX_PIC_REQUIRED),
522 },
523 {
524 t => q{<?pi!?>},
525 method => 'parse_processing_instruction',
526 result => q(0:4:SYNTAX_PIC_REQUIRED),
527 },
528
529 {
530 t => q{<e><?pi?>foo</e>},
531 method => 'parse_element',
532 result => q(1),
533 },
534 {
535 t => q{<e>bar<?pi?>foo</e>},
536 method => 'parse_element',
537 result => q(1),
538 },
539
540 {
541 t => q{<!foo>},
542 method => 'parse_markup_declaration',
543 result => q(0:2:SYNTAX_UNKNOWN_MARKUP_DECLARATION),
544 },
545
546 {
547 t => q{<!DOCTYPE>},
548 method => 'parse_markup_declaration',
549 result => q(0:9:SYNTAX_DOCTYPE_PS_REQUIRED),
550 },
551 {
552 t => q{<!DOCTYPE >},
553 method => 'parse_markup_declaration',
554 result => q(0:10:SYNTAX_DOCTYPE_NAME_REQUIRED),
555 },
556 {
557 t => q{<!DOCTYPE name>},
558 method => 'parse_markup_declaration',
559 result => q(1),
560 },
561 {
562 t => q{<!DOCTYPE #IMPLIED>},
563 method => 'parse_markup_declaration',
564 result => q(0:11:SYNTAX_DOCTYPE_IMPLIED),
565 },
566 {
567 t => q{<!DOCTYPE #keyword>},
568 method => 'parse_markup_declaration',
569 result => q(0:11:SYNTAX_DOCTYPE_RNI_KEYWORD),
570 },
571 {
572 t => q{<!DOCTYPE#IMPLIED>},
573 method => 'parse_markup_declaration',
574 result => q(0:9:SYNTAX_DOCTYPE_PS_REQUIRED),
575 },
576 {
577 t => q{<!DOCTYPE name >},
578 method => 'parse_markup_declaration',
579 result => q(1),
580 },
581 {
582 t => q{<!DOCTYPE name PUBLIC>},
583 method => 'parse_markup_declaration',
584 result => q(0:21:SYNTAX_DOCTYPE_PS_REQUIRED),
585 },
586 {
587 t => q{<!DOCTYPE name PUBLIC >},
588 method => 'parse_markup_declaration',
589 result => q(0:22:SYNTAX_PUBID_LITERAL_REQUIRED),
590 },
591 {
592 t => q{<!DOCTYPE name PUBLIC[]>},
593 method => 'parse_markup_declaration',
594 result => q(0:21:SYNTAX_DOCTYPE_PS_REQUIRED),
595 },
596 {
597 t => q{<!DOCTYPE name PUBLIC []>},
598 method => 'parse_markup_declaration',
599 result => q(0:22:SYNTAX_PUBID_LITERAL_REQUIRED),
600 },
601 {
602 t => q{<!DOCTYPE name PUBLIC"pubid">},
603 method => 'parse_markup_declaration',
604 result => q(0:21:SYNTAX_DOCTYPE_PS_REQUIRED),
605 },
606 {
607 t => q{<!DOCTYPE name PUBLIC "pubid">},
608 method => 'parse_markup_declaration',
609 result => q(0:29:SYNTAX_DOCTYPE_PS_REQUIRED),
610 },
611 {
612 t => q{<!DOCTYPE name PUBLIC 'pubid'>},
613 method => 'parse_markup_declaration',
614 result => q(0:29:SYNTAX_DOCTYPE_PS_REQUIRED),
615 },
616 {
617 t => q{<!DOCTYPE name PUBLIC "pubid},
618 method => 'parse_markup_declaration',
619 result => q(0:28:SYNTAX_PUBLIT_MLITC_REQUIRED),
620 },
621 {
622 t => q{<!DOCTYPE name PUBLIC 'pubid},
623 method => 'parse_markup_declaration',
624 result => q(0:28:SYNTAX_PUBLIT_MLITAC_REQUIRED),
625 },
626 {
627 t => q{<!DOCTYPE name PUBLIC "pubid" >},
628 method => 'parse_markup_declaration',
629 result => q(0:30:SYNTAX_SYSTEM_LITERAL_REQUIRED),
630 },
631 {
632 t => q{<!DOCTYPE name PUBLIC 'pubid' >},
633 method => 'parse_markup_declaration',
634 result => q(0:30:SYNTAX_SYSTEM_LITERAL_REQUIRED),
635 },
636 {
637 t => q{<!DOCTYPE name PUBLIC "pub<id" "">},
638 method => 'parse_markup_declaration',
639 result => q(0:26:SYNTAX_PUBID_LITERAL_INVALID_CHAR),
640 },
641 {
642 t => q{<!DOCTYPE name PUBLIC "pubid" "sysid">},
643 method => 'parse_markup_declaration',
644 result => q(1),
645 },
646 {
647 t => q{<!DOCTYPE name PUBLIC "pubid" "sysid" >},
648 method => 'parse_markup_declaration',
649 result => q(1),
650 },
651 {
652 t => q{<!DOCTYPE name PUBLIC "pubid" "sys<>id">},
653 method => 'parse_markup_declaration',
654 result => q(1),
655 },
656 {
657 t => q{<!DOCTYPE name PUBLIC "pubid" 'sysid'>},
658 method => 'parse_markup_declaration',
659 result => q(1),
660 },
661 {
662 t => q{<!DOCTYPE name PUBLIC "pubid" 'sysid' >},
663 method => 'parse_markup_declaration',
664 result => q(1),
665 },
666 {
667 t => q{<!DOCTYPE name PUBLIC "pubid" "sysid>},
668 method => 'parse_markup_declaration',
669 result => q(0:37:SYNTAX_SLITC_REQUIRED),
670 },
671 {
672 t => q{<!DOCTYPE name PUBLIC "pubid" 'sysid>},
673 method => 'parse_markup_declaration',
674 result => q(0:37:SYNTAX_SLITAC_REQUIRED),
675 },
676
677 {
678 t => q{<!DOCTYPE name SYSTEM>},
679 method => 'parse_markup_declaration',
680 result => q(0:21:SYNTAX_DOCTYPE_PS_REQUIRED),
681 },
682 {
683 t => q{<!DOCTYPE name SYSTEM >},
684 method => 'parse_markup_declaration',
685 result => q(0:22:SYNTAX_SYSTEM_LITERAL_REQUIRED),
686 },
687 {
688 t => q{<!DOCTYPE name SYSTEM[]>},
689 method => 'parse_markup_declaration',
690 result => q(0:21:SYNTAX_DOCTYPE_PS_REQUIRED),
691 },
692 {
693 t => q{<!DOCTYPE name SYSTEM []>},
694 method => 'parse_markup_declaration',
695 result => q(0:22:SYNTAX_SYSTEM_LITERAL_REQUIRED),
696 },
697 {
698 t => q{<!DOCTYPE name SYSTEM"sysid">},
699 method => 'parse_markup_declaration',
700 result => q(0:21:SYNTAX_DOCTYPE_PS_REQUIRED),
701 },
702 {
703 t => q{<!DOCTYPE name SYSTEM'sysid'>},
704 method => 'parse_markup_declaration',
705 result => q(0:21:SYNTAX_DOCTYPE_PS_REQUIRED),
706 },
707 {
708 t => q{<!DOCTYPE name SYSTEM "sysid">},
709 method => 'parse_markup_declaration',
710 result => q(1),
711 },
712 {
713 t => q{<!DOCTYPE name SYSTEM "sysid" >},
714 method => 'parse_markup_declaration',
715 result => q(1),
716 },
717 {
718 t => q{<!DOCTYPE name SYSTEM 'sysid'>},
719 method => 'parse_markup_declaration',
720 result => q(1),
721 },
722 {
723 t => q{<!DOCTYPE name SYSTEM 'sysid' >},
724 method => 'parse_markup_declaration',
725 result => q(1),
726 },
727 {
728 t => q{<!DOCTYPE name SYSTEM "sysid},
729 method => 'parse_markup_declaration',
730 result => q(0:28:SYNTAX_SLITC_REQUIRED),
731 },
732 {
733 t => q{<!DOCTYPE name SYSTEM 'sysid},
734 method => 'parse_markup_declaration',
735 result => q(0:28:SYNTAX_SLITAC_REQUIRED),
736 },
737 {
738 t => q{<!DOCTYPE name system},
739 method => 'parse_markup_declaration',
740 result => q(0:15:SYNTAX_MARKUP_DECLARATION_UNKNOWN_KEYWORD),
741 },
742
743 {
744 t => q{<!DOCTYPE name[]>},
745 method => 'parse_markup_declaration',
746 result => q(1),
747 },
748 {
749 t => q{<!DOCTYPE name []>},
750 method => 'parse_markup_declaration',
751 result => q(1),
752 },
753 {
754 t => q{<!DOCTYPE name[ ] >},
755 method => 'parse_markup_declaration',
756 result => q(1),
757 },
758 {
759 t => q{<!DOCTYPE name [] >},
760 method => 'parse_markup_declaration',
761 result => q(1),
762 },
763 {
764 t => q{<!DOCTYPE name PUBLIC "pubid" "sysid"[]>},
765 method => 'parse_markup_declaration',
766 result => q(1),
767 },
768 {
769 t => q{<!DOCTYPE name PUBLIC "pubid" "sysid" []>},
770 method => 'parse_markup_declaration',
771 result => q(1),
772 },
773 {
774 t => q{<!DOCTYPE name PUBLIC "pubid" 'sysid'[]>},
775 method => 'parse_markup_declaration',
776 result => q(1),
777 },
778 {
779 t => q{<!DOCTYPE name PUBLIC "pubid" 'sysid' []>},
780 method => 'parse_markup_declaration',
781 result => q(1),
782 },
783 {
784 t => q{<!DOCTYPE name PUBLIC "pubid" 'sysid'[] >},
785 method => 'parse_markup_declaration',
786 result => q(1),
787 },
788 {
789 t => q{<!DOCTYPE name PUBLIC "pubid" 'sysid' []>},
790 method => 'parse_markup_declaration',
791 result => q(1),
792 },
793 {
794 t => q{<!DOCTYPE name [] SYSTEM 'sysid'},
795 method => 'parse_markup_declaration',
796 result => q(0:18:SYNTAX_MDC_REQUIRED),
797 },
798
799 {
800 t => q{<!DOCTYPE name SYSTEM ""[ <!-- --> ]>},
801 method => 'parse_markup_declaration',
802 result => q(1),
803 },
804 {
805 t => q{<!DOCTYPE name SYSTEM ""[ <!-- --> ] >},
806 method => 'parse_markup_declaration',
807 result => q(1),
808 },
809 {
810 t => q{<!DOCTYPE name SYSTEM ""[ <!-- --> <!> ]>},
811 method => 'parse_markup_declaration',
812 result => q(0:35:SYNTAX_EMPTY_COMMENT_DECLARATION),
813 },
814 {
815 t => q{<!DOCTYPE name SYSTEM ""[ <!-- -- -- --> ]>},
816 method => 'parse_markup_declaration',
817 result => q(0:33:SYNTAX_S_IN_COMMENT_DECLARATION),
818 },
819 {
820 t => q{<!DOCTYPE name SYSTEM ""[ <!-- --> ] },
821 method => 'parse_markup_declaration',
822 result => q(0:38:SYNTAX_MDC_REQUIRED),
823 },
824 {
825 t => q{<!DOCTYPE name []aaa>},
826 method => 'parse_markup_declaration',
827 result => q(0:17:SYNTAX_MDC_REQUIRED),
828 },
829 {
830 t => q{<!DOCTYPE name PUBLIC "pub" "sys"aaa>},
831 method => 'parse_markup_declaration',
832 result => q(0:33:SYNTAX_MDC_REQUIRED),
833 },
834 {
835 t => q{<!DOCTYPE name SYSTEM "sys"aaa>},
836 method => 'parse_markup_declaration',
837 result => q(0:27:SYNTAX_MDC_REQUIRED),
838 },
839 {
840 t => q{<!DOCTYPE name [] >},
841 method => 'parse_markup_declaration',
842 result => q(1),
843 },
844 {
845 t => q{<!DOCTYPE name SYSTEM "sys" >},
846 method => 'parse_markup_declaration',
847 result => q(1),
848 },
849 {
850 entity => {param => 'aa'},
851 t => q{<!DOCTYPE %param; >},
852 method => 'parse_markup_declaration',
853 result => q(0:10:SYNTAX_PARAENT_REF_NOT_ALLOWED),
854 },
855 {
856 t => q{<!DOCTYPE --%param; -- >},
857 method => 'parse_markup_declaration',
858 result => q(0:10:SYNTAX_PS_COMMENT),
859 },
860
861 {
862 t => q{abcdefg},
863 method => 'parse_rpdata',
864 result => q(1),
865 },
866 {
867 t => q{abcd&#125;efg},
868 method => 'parse_rpdata',
869 result => q(1),
870 },
871 {
872 t => q{abcd&#x125;efg},
873 method => 'parse_rpdata',
874 result => q(1),
875 },
876 {
877 entity => {e5 => 'bb',},
878 t => q{abcd&e5;efg},
879 method => 'parse_rpdata',
880 result => q(1),
881 },
882 {
883 entity => {e5 => 'aa'},
884 t => q{abcd%e5;efg},
885 method => 'parse_rpdata',
886 result => q(1),
887 },
888 {
889 entity => {e5efg => 'aa'},
890 t => q{abcd&e5efg},
891 method => 'parse_rpdata',
892 result => q(0:10:SYNTAX_REFC_REQUIRED),
893 },
894 {
895 t => q{abcd&#xe5e a},
896 method => 'parse_rpdata',
897 result => q(0:10:SYNTAX_REFC_REQUIRED),
898 },
899 {
900 entity => {e5efg => 'aa'},
901 t => q{abcd%e5efg},
902 method => 'parse_rpdata',
903 result => q(0:10:SYNTAX_REFC_REQUIRED),
904 },
905 {
906 t => q{abcd% e5efg},
907 method => 'parse_rpdata',
908 result => q(0:5:SYNTAX_PARAENT_NAME_REQUIRED),
909 },
910
911 {
912 t => q{<!ENTITY "a">},
913 method => 'parse_entity_declaration',
914 result => q(0:9:SYNTAX_ENTITY_NAME_REQUIRED),
915 },
916 {
917 t => q{<!ENTITY a "a">},
918 method => 'parse_entity_declaration',
919 result => q(1),
920 },
921 {
922 t => q{<!ENTITY % "a">},
923 method => 'parse_entity_declaration',
924 result => q(0:11:SYNTAX_ENTITY_PARAM_NAME_REQUIRED),
925 },
926 {
927 t => q{<!ENTITY % a "a">},
928 method => 'parse_entity_declaration',
929 result => q(1),
930 },
931 {
932 t => q{<!ENTITY #DEFAULT "a">},
933 method => 'parse_entity_declaration',
934 result => q(0:10:SYNTAX_ENTITY_DEFAULT),
935 },
936 {
937 t => q{<!ENTITY #ALL "a">},
938 method => 'parse_entity_declaration',
939 result => q(0:10:SYNTAX_ENTITY_RNI_KEYWORD),
940 },
941 {
942 t => q{<!ENTITY % #DEFAULT "a">},
943 method => 'parse_entity_declaration',
944 result => q(0:11:SYNTAX_ENTITY_PARAM_NAME_REQUIRED),
945 },
946
947 {
948 t => q{<!ENTITY a "abcde">},
949 method => 'parse_entity_declaration',
950 result => q(1),
951 },
952 {
953 # entity => {a => q<b>},
954 t => q{<!ENTITY a "ab&a;cde">},
955 method => 'parse_entity_declaration',
956 result => q(1),
957 },
958 {
959 entity => {a => 'aa'},
960 t => q{<!ENTITY a "ab%a;cde">},
961 method => 'parse_entity_declaration',
962 result => q(1),
963 },
964 {
965 t => q{<!ENTITY a "ab<c'de">},
966 method => 'parse_entity_declaration',
967 result => q(1),
968 },
969 {
970 t => q{<!ENTITY a 'ab<c"de'>},
971 method => 'parse_entity_declaration',
972 result => q(1),
973 },
974 {
975 t => q{<!ENTITY a "abcde>},
976 method => 'parse_entity_declaration',
977 result => q(0:18:SYNTAX_PLITC_REQUIRED),
978 },
979 {
980 t => q{<!ENTITY a 'abcde>},
981 method => 'parse_entity_declaration',
982 result => q(0:18:SYNTAX_PLITAC_REQUIRED),
983 },
984 {
985 t => q{<!ENTITY a "abcde" >},
986 method => 'parse_entity_declaration',
987 result => q(1),
988 },
989 {
990 t => q{<!ENTITY a "abcde"aa>},
991 method => 'parse_entity_declaration',
992 result => q(0:18:SYNTAX_MDC_REQUIRED),
993 },
994 {
995 t => q{<!ENTITY a "abcde" aa>},
996 method => 'parse_entity_declaration',
997 result => q(0:19:SYNTAX_MDC_REQUIRED),
998 },
999 {
1000 t => q{<!ENTITY % pa "abcde" >},
1001 method => 'parse_entity_declaration',
1002 result => q(1),
1003 },
1004
1005 {
1006 t => q{<!ENTITY a SYSTEM "sys">},
1007 method => 'parse_entity_declaration',
1008 result => q(1),
1009 },
1010 {
1011 t => q{<!ENTITY a SYSTEM "sys" >},
1012 method => 'parse_entity_declaration',
1013 result => q(1),
1014 },
1015 {
1016 t => q{<!ENTITY a PUBLIC "pub" "sys">},
1017 method => 'parse_entity_declaration',
1018 result => q(1),
1019 },
1020 {
1021 t => q{<!ENTITY a PUBLIC "pub" "sys" >},
1022 method => 'parse_entity_declaration',
1023 result => q(1),
1024 },
1025 {
1026 t => q{<!ENTITY % a PUBLIC "pub" "sys" >},
1027 method => 'parse_entity_declaration',
1028 result => q(1),
1029 },
1030 {
1031 t => q{<!ENTITY a PUBLIC "pub" >},
1032 method => 'parse_entity_declaration',
1033 result => q(0:24:SYNTAX_SYSTEM_LITERAL_REQUIRED),
1034 },
1035 {
1036 t => q{<!ENTITY a PUBLIC >},
1037 method => 'parse_entity_declaration',
1038 result => q(0:18:SYNTAX_PUBID_LITERAL_REQUIRED),
1039 },
1040 {
1041 t => q{<!ENTITY a SYSTEM >},
1042 method => 'parse_entity_declaration',
1043 result => q(0:18:SYNTAX_SYSTEM_LITERAL_REQUIRED),
1044 },
1045 {
1046 t => q{<!ENTITY a SYSTEM "sys" "what?">},
1047 method => 'parse_entity_declaration',
1048 result => q(0:24:SYNTAX_MDC_REQUIRED),
1049 },
1050 {
1051 t => q{<!ENTITY a PUBLIC "pub" "sys" "what?">},
1052 method => 'parse_entity_declaration',
1053 result => q(0:30:SYNTAX_MDC_REQUIRED),
1054 },
1055 {
1056 t => q{<!ENTITY a PUBLIC "pub""sys">},
1057 method => 'parse_entity_declaration',
1058 result => q(0:23:SYNTAX_ENTITY_PS_REQUIRED),
1059 },
1060 {
1061 t => q{<!ENTITY a PUBLIC"pub" "sys">},
1062 method => 'parse_entity_declaration',
1063 result => q(0:17:SYNTAX_ENTITY_PS_REQUIRED),
1064 },
1065 {
1066 t => q{<!ENTITY a SYSTEM"sys">},
1067 method => 'parse_entity_declaration',
1068 result => q(0:17:SYNTAX_ENTITY_PS_REQUIRED),
1069 },
1070 {
1071 t => q{<!ENTITY a KEYWORD>},
1072 method => 'parse_entity_declaration',
1073 result => q(0:11:SYNTAX_ENTITY_TEXT_KEYWORD),
1074 },
1075 {
1076 t => q{<!ENTITY a CDATA "cdata">},
1077 method => 'parse_entity_declaration',
1078 result => q(0:11:SYNTAX_ENTITY_TEXT_PRE_KEYWORD),
1079 },
1080 {
1081 t => q{<!ENTITY a "cdata" CDATA>},
1082 method => 'parse_entity_declaration',
1083 result => q(0:19:SYNTAX_MDC_REQUIRED),
1084 },
1085 {
1086 t => q{<!ENTITY a SYSTEM "sys" NDATA notation>},
1087 method => 'parse_entity_declaration',
1088 result => q(1),
1089 },
1090 {
1091 t => q{<!ENTITY a SYSTEM "sys" NDATA notation >},
1092 method => 'parse_entity_declaration',
1093 result => q(1),
1094 },
1095 {
1096 t => q{<!ENTITY a SYSTEM "sys"NDATA notation>},
1097 method => 'parse_entity_declaration',
1098 result => q(0:23:SYNTAX_ENTITY_PS_REQUIRED),
1099 },
1100 {
1101 t => q{<!ENTITY a SYSTEM "sys" NDATAnotation>},
1102 method => 'parse_entity_declaration',
1103 result => q(0:24:SYNTAX_ENTITY_DATA_TYPE_UNKNOWN_KEYWORD),
1104 },
1105 {
1106 t => q{<!ENTITY a SYSTEM "sys" NDATA notation aa >},
1107 method => 'parse_entity_declaration',
1108 result => q(0:40:SYNTAX_MDC_REQUIRED),
1109 },
1110 {
1111 t => q{<!ENTITY a SYSTEM "sys" NDATA >},
1112 method => 'parse_entity_declaration',
1113 result => q(0:30:SYNTAX_ENTITY_DATA_TYPE_NOTATION_NAME_REQUIRED),
1114 },
1115 {
1116 t => q{<!ENTITY a SYSTEM "sys" NDATA #>},
1117 method => 'parse_entity_declaration',
1118 result => q(0:30:SYNTAX_ENTITY_DATA_TYPE_NOTATION_NAME_REQUIRED),
1119 },
1120 {
1121 t => q{<!ENTITY a SYSTEM "sys" CDATA a>},
1122 method => 'parse_entity_declaration',
1123 result => q(0:24:SYNTAX_ENTITY_DATA_TYPE_SGML_KEYWORD),
1124 },
1125 {
1126 t => q{<!ENTITY a SYSTEM "sys" SDATA a>},
1127 method => 'parse_entity_declaration',
1128 result => q(0:24:SYNTAX_ENTITY_DATA_TYPE_SGML_KEYWORD),
1129 },
1130 {
1131 t => q{<!ENTITY a SYSTEM "sys" SUBDOC a>},
1132 method => 'parse_entity_declaration',
1133 result => q(0:24:SYNTAX_ENTITY_DATA_TYPE_SGML_KEYWORD),
1134 },
1135 {
1136 t => q{<!ENTITY a SYSTEM "sys" NDATA b [ attr=val ]>},
1137 method => 'parse_entity_declaration',
1138 result => q(0:32:SYNTAX_MDC_REQUIRED),
1139 },
1140
1141 {
1142 entity => {b => ''},
1143 t => q{<!ENTITY a "%b;">},
1144 method => 'parse_entity_declaration',
1145 result => q(1),
1146 },
1147 {
1148 entity => {b => ''},
1149 t => q{<!ENTITY a %b; "aa">},
1150 method => 'parse_entity_declaration',
1151 result => q(1),
1152 },
1153 {
1154 entity => {b => '"aa"'},
1155 t => q{<!ENTITY a %b;>},
1156 method => 'parse_entity_declaration',
1157 result => q(1),
1158 },
1159 {
1160 entity => {b => q<SYSTEM "foo">},
1161 t => q{<!ENTITY a %b;>},
1162 method => 'parse_entity_declaration',
1163 result => q(1),
1164 },
1165 {
1166 entity => {b => q< PUBLIC "pub" 'sys' >},
1167 t => q{<!ENTITY a %b;>},
1168 method => 'parse_entity_declaration',
1169 result => q(1),
1170 },
1171 {
1172 entity => {b => 'SYSTEM'},
1173 t => q{<!ENTITY a %b;>},
1174 method => 'parse_entity_declaration',
1175 result => q(0:14:SYNTAX_ENTITY_PS_REQUIRED),
1176 },
1177 {
1178 entity => {b => "SYSTEM"},
1179 t => q{<!ENTITY a %b; >},
1180 method => 'parse_entity_declaration',
1181 result => q(0:15:SYNTAX_SYSTEM_LITERAL_REQUIRED),
1182 },
1183 {
1184 entity => {b => q< SYSTEM "foo" >},
1185 t => q{<!ENTITY a %b; >},
1186 method => 'parse_entity_declaration',
1187 result => q(1),
1188 },
1189 {
1190 entity => {b => q< SYSTEM %c; >,
1191 c => q< "sys" >},
1192 t => q{<!ENTITY a %b; >},
1193 method => 'parse_entity_declaration',
1194 result => q(1),
1195 },
1196 {
1197 entity => {b => q<SYSTEM %c; >,
1198 c => q< "sys" >},
1199 t => q{<!ENTITY%b; >},
1200 method => 'parse_entity_declaration',
1201 result => q(1),
1202 },
1203 {
1204 entity => {b => q[SYSTEM %c; > ],
1205 c => q< "sys" >},
1206 t => q{<!ENTITY%b; >},
1207 method => 'parse_entity_declaration',
1208 result => q(0:11:SYNTAX_MARKUP_DECLARATION_TOO_MANY_PARAM),
1209 },
1210
1211 {
1212 t => q{<!ENTITY --comment-->},
1213 method => 'parse_entity_declaration',
1214 result => q(0:9:SYNTAX_PS_COMMENT),
1215 },
1216 {
1217 t => q{<!ENTITY a --comment-->},
1218 method => 'parse_entity_declaration',
1219 result => q(0:11:SYNTAX_PS_COMMENT),
1220 },
1221 {
1222 t => q{<!ENTITY a "a" --comment-->},
1223 method => 'parse_entity_declaration',
1224 result => q(0:15:SYNTAX_PS_COMMENT),
1225 },
1226
1227 {
1228 t => q{<!ELEMENT el ANY>},
1229 method => 'parse_element_declaration',
1230 result => q(1),
1231 },
1232 {
1233 t => q{<!ELEMENT el EMPTY >},
1234 method => 'parse_element_declaration',
1235 result => q(1),
1236 },
1237 {
1238 t => q{<!ELEMENT el CDATA>},
1239 method => 'parse_element_declaration',
1240 result => q(0:13:SYNTAX_ELEMENT_SGML_CONTENT_KEYWORD),
1241 },
1242 {
1243 t => q{<!ELEMENT el RCDATA>},
1244 method => 'parse_element_declaration',
1245 result => q(0:13:SYNTAX_ELEMENT_SGML_CONTENT_KEYWORD),
1246 },
1247 {
1248 t => q{<!ELEMENT el foo>},
1249 method => 'parse_element_declaration',
1250 result => q(0:13:SYNTAX_ELEMENT_UNKNOWN_CONTENT_KEYWORD),
1251 },
1252 {
1253 t => q{<!ELEMENT el ANY foo>},
1254 method => 'parse_element_declaration',
1255 result => q(0:17:SYNTAX_MDC_REQUIRED),
1256 },
1257 {
1258 t => q{<!ELEMENT el - - ANY>},
1259 method => 'parse_element_declaration',
1260 result => q(0:13:SYNTAX_ELEMENT_TAG_MIN),
1261 },
1262 {
1263 t => q{<!ELEMENT el o - ANY>},
1264 method => 'parse_element_declaration',
1265 result => q(0:13:SYNTAX_ELEMENT_TAG_MIN),
1266 },
1267 {
1268 t => q{<!ELEMENT (el) o - ANY>},
1269 method => 'parse_element_declaration',
1270 result => q(0:10:SYNTAX_ELEMENT_DECLARATION_TYPE_NAME_GROUP),
1271 },
1272 {
1273 t => q{<!ELEMENT el 1 o - ANY>},
1274 method => 'parse_element_declaration',
1275 result => q(0:13:SYNTAX_ELEMENT_RANK_SUFFIX),
1276 },
1277 {
1278 t => q{<!ELEMENT>},
1279 method => 'parse_element_declaration',
1280 result => q(0:9:SYNTAX_ELEMENT_PS_REQUIRED),
1281 },
1282 {
1283 t => q{<!ELEMENT >},
1284 method => 'parse_element_declaration',
1285 result => q(0:10:SYNTAX_ELEMENT_DECLARATION_TYPE_NAME_REQUIRED),
1286 },
1287 {
1288 t => q{<!ELEMENT e>},
1289 method => 'parse_element_declaration',
1290 result => q(0:11:SYNTAX_ELEMENT_PS_REQUIRED),
1291 },
1292 {
1293 t => q{<!ELEMENT e >},
1294 method => 'parse_element_declaration',
1295 result => q(0:12:SYNTAX_ELEMENT_MODEL_OR_MIN_OR_RANK_REQUIRED),
1296 },
1297 {
1298 t => q{<!ELEMENT e ANY},
1299 method => 'parse_element_declaration',
1300 result => q(0:15:SYNTAX_MDC_REQUIRED),
1301 },
1302
1303 {
1304 t => q<(a)>,
1305 method => 'parse_model_group',
1306 result => 1,
1307 },
1308 {
1309 t => q<(a,b)>,
1310 method => 'parse_model_group',
1311 result => 1,
1312 },
1313 {
1314 t => q<(a,b,c)>,
1315 method => 'parse_model_group',
1316 result => 1,
1317 },
1318 {
1319 t => q<( a , b )>,
1320 method => 'parse_model_group',
1321 result => 1,
1322 },
1323 {
1324 t => q<( a , b >,
1325 method => 'parse_model_group',
1326 result => '0:11:SYNTAX_MODEL_GROUP_GRPC_REQUIRED',
1327 },
1328 {
1329 t => q<( a , >,
1330 method => 'parse_model_group',
1331 result => '0:10:SYNTAX_MODEL_GROUP_ITEM_REQUIRED',
1332 },
1333
1334 {
1335 t => q<( a+ )>,
1336 method => 'parse_model_group',
1337 result => 1,
1338 },
1339 {
1340 t => q<( a* )>,
1341 method => 'parse_model_group',
1342 result => 1,
1343 },
1344 {
1345 t => q<( a? )>,
1346 method => 'parse_model_group',
1347 result => 1,
1348 },
1349 {
1350 t => q<( a?, b )>,
1351 method => 'parse_model_group',
1352 result => 1,
1353 },
1354 {
1355 t => q<( a?, b, c+ )>,
1356 method => 'parse_model_group',
1357 result => 1,
1358 },
1359 {
1360 t => q<( a?, b*, c+ )>,
1361 method => 'parse_model_group',
1362 result => 1,
1363 },
1364 {
1365 t => q<( a?>,
1366 method => 'parse_model_group',
1367 result => '0:4:SYNTAX_MODEL_GROUP_GRPC_REQUIRED',
1368 },
1369 {
1370 t => q<( a ?>,
1371 method => 'parse_model_group',
1372 result => '0:4:SYNTAX_MODEL_GROUP_GRPC_REQUIRED',
1373 },
1374
1375 {
1376 t => q<( a | b )>,
1377 method => 'parse_model_group',
1378 result => 1,
1379 },
1380 {
1381 t => q<( a & b )>,
1382 method => 'parse_model_group',
1383 result => '0:4:SYNTAX_CONNECTOR',
1384 },
1385
1386 {
1387 t => q<( a , b )*>,
1388 method => 'parse_model_group',
1389 result => 1,
1390 },
1391 {
1392 t => q<( a , b )+>,
1393 method => 'parse_model_group',
1394 result => 1,
1395 },
1396 {
1397 t => q<( a , b )?>,
1398 method => 'parse_model_group',
1399 result => 1,
1400 },
1401 {
1402 t => q<( a , (b)* )>,
1403 method => 'parse_model_group',
1404 result => 1,
1405 },
1406 {
1407 t => q<( a , (b, c)* )>,
1408 method => 'parse_model_group',
1409 result => 1,
1410 },
1411 {
1412 t => q<( a , (b, (c, d)+)* )>,
1413 method => 'parse_model_group',
1414 result => 1,
1415 },
1416 {
1417 entity => {ry => 'aa'},
1418 t => q<( a , ([b, %ry; ], (c, d)+)* )>,
1419 method => 'parse_model_group',
1420 result => '0:7:SYNTAX_DATA_TAG_GROUP',
1421 },
1422
1423 {
1424 t => q<( a -- , b -- )>,
1425 method => 'parse_model_group',
1426 result => '0:4:SYNTAX_PS_COMMENT',
1427 },
1428 {
1429 entity => {
1430 b => q<, b>,
1431 },
1432 t => q<( a %b; )>,
1433 method => 'parse_model_group',
1434 result => 1,
1435 },
1436 {
1437 entity => {
1438 b => q<, >,
1439 },
1440 t => q<( a %b; )>,
1441 method => 'parse_model_group',
1442 result => '0:8:SYNTAX_MODEL_GROUP_ITEM_REQUIRED',
1443 },
1444 {
1445 entity => {
1446 b => q<, (b) >,
1447 },
1448 t => q<( a %b; )>,
1449 method => 'parse_model_group',
1450 result => 1,
1451 },
1452 {
1453 entity => {
1454 b => q<, (b >,
1455 },
1456 t => q<( a %b; ))>,
1457 method => 'parse_model_group',
1458 result => '0:5:SYNTAX_MODEL_GROUP_GRPC_REQUIRED',
1459 },
1460 {
1461 entity => {
1462 b => q<, b) >,
1463 },
1464 t => q<( a %b; >,
1465 method => 'parse_model_group',
1466 result => '0:3:SYNTAX_MARKUP_DECLARATION_TOO_MANY_PARAM',
1467 },
1468
1469 {
1470 t => q<( #PCDATA )* >,
1471 method => 'parse_model_group',
1472 result => 1,
1473 },
1474 {
1475 t => q<( #PCDATA ) >,
1476 method => 'parse_model_group',
1477 result => 1,
1478 },
1479 {
1480 t => q<( #PCDATA | a )* >,
1481 method => 'parse_model_group',
1482 result => 1,
1483 },
1484 {
1485 t => q<( #PCDATA | a | b)* >,
1486 method => 'parse_model_group',
1487 result => 1,
1488 },
1489 {
1490 t => q<( #PCDATA )+ >,
1491 method => 'parse_model_group',
1492 result => '0:11:SYNTAX_MODEL_GROUP_PCDATA_OCCUR',
1493 },
1494 {
1495 t => q<( #PCDATA | a )+ >,
1496 method => 'parse_model_group',
1497 result => '0:15:SYNTAX_MODEL_GROUP_MIXED_OCCUR',
1498 },
1499 {
1500 t => q<( #PCDATA , a )* >,
1501 method => 'parse_model_group',
1502 result => '0:10:SYNTAX_MODEL_GROUP_MIXED_CONNECTOR',
1503 },
1504 {
1505 t => q<( #PCDATA | (a) )* >,
1506 method => 'parse_model_group',
1507 result => '0:12:SYNTAX_MODEL_GROUP_MIXED_NESTED',
1508 },
1509 {
1510 t => q<( b | #PCDATA )* >,
1511 method => 'parse_model_group',
1512 result => '0:7:SYNTAX_MODEL_GROUP_PCDATA_POSITION',
1513 },
1514 {
1515 t => q<( b | #foo )* >,
1516 method => 'parse_model_group',
1517 result => '0:7:SYNTAX_MODEL_GROUP_UNKNOWN_KEYWORD',
1518 },
1519 {
1520 t => q<( #PCDATA | a , b ) >,
1521 method => 'parse_model_group',
1522 result => '0:14:SYNTAX_MODEL_GROUP_CONNECTOR_MATCH',
1523 },
1524 {
1525 t => q<( a , b | a) >,
1526 method => 'parse_model_group',
1527 result => '0:8:SYNTAX_MODEL_GROUP_CONNECTOR_MATCH',
1528 },
1529
1530 {
1531 t => q<<!ELEMENT e ( a , b , a) >>,
1532 method => 'parse_element_declaration',
1533 result => '1',
1534 },
1535 {
1536 t => q<<!ELEMENT e ( a , b >>,
1537 method => 'parse_element_declaration',
1538 result => '0:21:SYNTAX_MODEL_GROUP_GRPC_REQUIRED',
1539 },
1540 {
1541 entity => {b => q<(a, b>},
1542 t => q<<!ELEMENT e %b; ) >>,
1543 method => 'parse_element_declaration',
1544 result => '0:5:SYNTAX_MODEL_GROUP_GRPC_REQUIRED',
1545 },
1546 {
1547 entity => {b => q[(a, b )>]},
1548 t => q[<!ELEMENT e %b; ],
1549 method => 'parse_element_declaration',
1550 result => '0:7:SYNTAX_MARKUP_DECLARATION_TOO_MANY_PARAM',
1551 },
1552
1553 {
1554 t => q<<!NOTATION n PUBLIC "pub">>,
1555 method => 'parse_notation_declaration',
1556 result => 1,
1557 },
1558 {
1559 t => q<<!NOTATION n PUBLIC "pub" "sys" >>,
1560 method => 'parse_notation_declaration',
1561 result => 1,
1562 },
1563 {
1564 t => q<<!NOTATION n SYSTEM "sys">>,
1565 method => 'parse_notation_declaration',
1566 result => 1,
1567 },
1568 {
1569 t => q[<!NOTATION n SYSTEM "sys"],
1570 method => 'parse_notation_declaration',
1571 result => '0:25:SYNTAX_MDC_REQUIRED',
1572 },
1573 {
1574 t => q[<!NOTATION n SYSTEM "sys>],
1575 method => 'parse_notation_declaration',
1576 result => '0:25:SYNTAX_SLITC_REQUIRED',
1577 },
1578 {
1579 t => q[<!NOTATION n ],
1580 method => 'parse_notation_declaration',
1581 result => '0:13:SYNTAX_NOTATION_EXTERNAL_IDENTIFIER_REQUIRED',
1582 },
1583 {
1584 t => q[<!NOTATION>],
1585 method => 'parse_notation_declaration',
1586 result => '0:10:SYNTAX_NOTATION_PS_REQUIRED',
1587 },
1588 {
1589 t => q[<!NOTATION >],
1590 method => 'parse_notation_declaration',
1591 result => '0:11:SYNTAX_NOTATION_NAME_REQUIRED',
1592 },
1593 {
1594 t => q[<!NOTATION n>],
1595 method => 'parse_notation_declaration',
1596 result => '0:12:SYNTAX_NOTATION_PS_REQUIRED',
1597 },
1598 {
1599 t => q[<!NOTATION n SYSTEM >],
1600 method => 'parse_notation_declaration',
1601 result => '0:20:SYNTAX_SYSTEM_LITERAL_REQUIRED',
1602 },
1603 {
1604 entity => {n => q<not SYSTEM %sys;>, sys => q< "sys" >},
1605 t => q[<!NOTATION %n;>],
1606 method => 'parse_notation_declaration',
1607 result => 1,
1608 },
1609
1610 {
1611 t => q[<!ATTLIST a>],
1612 method => 'parse_attlist_declaration',
1613 result => 1,
1614 },
1615 {
1616 t => q[<!ATTLIST attr >],
1617 method => 'parse_attlist_declaration',
1618 result => 1,
1619 },
1620 {
1621 t => q[<!ATTLIST el <],
1622 method => 'parse_attlist_declaration',
1623 result => '0:13:SYNTAX_MDC_REQUIRED',
1624 },
1625 {
1626 t => q[<!ATTLIST >],
1627 method => 'parse_attlist_declaration',
1628 result => '0:10:SYNTAX_ATTLIST_ASSOCIATED_NAME_REQUIRED',
1629 },
1630 {
1631 t => q[<!ATTLIST>],
1632 method => 'parse_attlist_declaration',
1633 result => '0:9:SYNTAX_ATTLIST_PS_REQUIRED',
1634 },
1635
1636 {
1637 t => q[<!ATTLIST foo a CDATA #IMPLIED>],
1638 method => 'parse_attlist_declaration',
1639 result => 1,
1640 },
1641 {
1642 t => q[<!ATTLIST foo a CDATA #REQUIRED>],
1643 method => 'parse_attlist_declaration',
1644 result => 1,
1645 },
1646 {
1647 t => q[<!ATTLIST foo a NMTOKEN #IMPLIED>],
1648 method => 'parse_attlist_declaration',
1649 result => 1,
1650 },
1651 {
1652 t => q[<!ATTLIST foo a ID #IMPLIED>],
1653 method => 'parse_attlist_declaration',
1654 result => 1,
1655 },
1656 {
1657 t => q[<!ATTLIST foo a IDREF #IMPLIED>],
1658 method => 'parse_attlist_declaration',
1659 result => 1,
1660 },
1661 {
1662 t => q[<!ATTLIST foo a IDREFS #IMPLIED>],
1663 method => 'parse_attlist_declaration',
1664 result => 1,
1665 },
1666 {
1667 t => q[<!ATTLIST foo a NMTOKENS #IMPLIED>],
1668 method => 'parse_attlist_declaration',
1669 result => 1,
1670 },
1671 {
1672 t => q[<!ATTLIST foo a NMTOKENS #IMPLIED b CDATA #REQUIRED>],
1673 method => 'parse_attlist_declaration',
1674 result => 1,
1675 },
1676 {
1677 t => q[<!ATTLIST foo a NMTOKENS #IMPLIED a NMTOKENS #IMPLIED
1678 b CDATA #REQUIRED id ID #IMPLIED>],
1679 method => 'parse_attlist_declaration',
1680 result => 1,
1681 },
1682 {
1683 t => q[<!ATTLIST foo a NMTOKENS #CURRENT>],
1684 method => 'parse_attlist_declaration',
1685 result => '0:26:SYNTAX_ATTRDEF_DEFAULT_SGML_KEYWORD',
1686 },
1687 {
1688 t => q[<!ATTLIST foo a NMTOKENS #NEW>],
1689 method => 'parse_attlist_declaration',
1690 result => '0:26:SYNTAX_ATTRDEF_DEFAULT_UNKNOWN_KEYWORD',
1691 },
1692 {
1693 t => q[<!ATTLIST foo a NMTOKENS >],
1694 method => 'parse_attlist_declaration',
1695 result => '0:25:SYNTAX_ATTRDEF_DEFAULT_REQUIRED',
1696 },
1697 {
1698 t => q[<!ATTLIST foo a NMTOKENS#IMPLIED>],
1699 method => 'parse_attlist_declaration',
1700 result => '0:24:SYNTAX_ATTLIST_PS_REQUIRED',
1701 },
1702 {
1703 t => q[<!ATTLIST foo a NAME #IMPLIED>],
1704 method => 'parse_attlist_declaration',
1705 result => '0:16:SYNTAX_ATTRDEF_TYPE_SGML_KEYWORD',
1706 },
1707 {
1708 t => q[<!ATTLIST foo a URI #IMPLIED>],
1709 method => 'parse_attlist_declaration',
1710 result => '0:16:SYNTAX_ATTRDEF_TYPE_UNKNOWN_KEYWORD',
1711 },
1712 {
1713 t => q[<!ATTLIST foo a #IMPLIED>],
1714 method => 'parse_attlist_declaration',
1715 result => '0:16:SYNTAX_ATTRDEF_TYPE_REQUIRED',
1716 },
1717 {
1718 t => q[<!ATTLIST foo a#IMPLIED>],
1719 method => 'parse_attlist_declaration',
1720 result => '0:15:SYNTAX_ATTLIST_PS_REQUIRED',
1721 },
1722 {
1723 t => q[<!ATTLIST foo a CDATA #IMPLIED ab>],
1724 method => 'parse_attlist_declaration',
1725 result => '0:33:SYNTAX_ATTLIST_PS_REQUIRED',
1726 },
1727 {
1728 t => q[<!ATTLIST foo a CDATA "def">],
1729 method => 'parse_attlist_declaration',
1730 result => 1,
1731 },
1732 {
1733 t => q[<!ATTLIST foo a CDATA #FIXED "def">],
1734 method => 'parse_attlist_declaration',
1735 result => 1,
1736 },
1737 {
1738 t => q[<!ATTLIST foo a (a) #IMPLIED>],
1739 method => 'parse_attlist_declaration',
1740 result => 1,
1741 },
1742 {
1743 t => q[<!ATTLIST foo a (a|b) #IMPLIED>],
1744 method => 'parse_attlist_declaration',
1745 result => 1,
1746 },
1747 {
1748 t => q[<!ATTLIST foo a (a|b|c) #IMPLIED>],
1749 method => 'parse_attlist_declaration',
1750 result => 1,
1751 },
1752 {
1753 t => q[<!ATTLIST foo a (a|b|c #IMPLIED>],
1754 method => 'parse_attlist_declaration',
1755 result => '0:24:SYNTAX_ATTRDEF_TYPE_GROUP_GRPC_REQUIRED',
1756 },
1757 {
1758 t => q[<!ATTLIST foo a (a,b) #IMPLIED>],
1759 method => 'parse_attlist_declaration',
1760 result => '0:19:SYNTAX_CONNECTOR',
1761 },
1762 {
1763 t => q[<!ATTLIST foo a (a+|b) #IMPLIED>],
1764 method => 'parse_attlist_declaration',
1765 result => '0:19:SYNTAX_ATTRDEF_TYPE_GROUP_GRPC_REQUIRED',
1766 },
1767 {
1768 t => q[<!ATTLIST foo a (a|(b)) #IMPLIED>],
1769 method => 'parse_attlist_declaration',
1770 result => '0:20:SYNTAX_ATTRDEF_TYPE_GROUP_NMTOKEN_REQUIRED',
1771 },
1772 {
1773 t => q[<!ATTLIST foo a (a|b)* #IMPLIED>],
1774 method => 'parse_attlist_declaration',
1775 result => '0:22:SYNTAX_ATTLIST_PS_REQUIRED',
1776 },
1777 {
1778 t => q[<!ATTLIST foo a (a|b|c ) "c">],
1779 method => 'parse_attlist_declaration',
1780 result => 1,
1781 },
1782 {
1783 t => q[<!ATTLIST foo a NOTATION ( a|b|c ) "c">],
1784 method => 'parse_attlist_declaration',
1785 result => 1,
1786 },
1787 {
1788 entity => {lt => qq{&#@{[ord '<']};}},
1789 t => q[<!ATTLIST foo a NOTATION ( a|b|c ) 'c&lt;b&#33;!&#x4a;b'>],
1790 method => 'parse_attlist_declaration',
1791 result => 1,
1792 },
1793 {
1794 t => q[<!ATTLIST foo a NOTATION ( a|b|c ) 'c<b'>],
1795 method => 'parse_attlist_declaration',
1796 result => '0:37:SYNTAX_NO_LESS_THAN_IN_ATTR_VAL',
1797 },
1798
1799 {
1800 t => q{<![INCLUDE[<!---->]]>},
1801 method => 'parse_marked_section',
1802 option => {
1803 ExpandedURI q<allow-section> => {INCLUDE => 1,},
1804 },
1805 result => 1,
1806 },
1807 {
1808 t => q{<![ INCLUDE [<!---->]]>},
1809 method => 'parse_marked_section',
1810 option => {
1811 ExpandedURI q<allow-section> => {INCLUDE => 1,},
1812 ExpandedURI q<allow-section-ps> => 1,
1813 },
1814 result => 1,
1815 },
1816 {
1817 t => q{<![ INCLUDE [<!---->]>},
1818 method => 'parse_marked_section',
1819 option => {
1820 ExpandedURI q<allow-section> => {INCLUDE => 1,},
1821 ExpandedURI q<allow-section-ps> => 1,
1822 },
1823 result => '0:24:SYNTAX_MSE_REQUIRED',
1824 },
1825 {
1826 t => q{<![ INCLUDE <!---->]>},
1827 method => 'parse_marked_section',
1828 option => {
1829 ExpandedURI q<allow-section> => {INCLUDE => 1,},
1830 ExpandedURI q<allow-section-ps> => 1,
1831 },
1832 result => '0:14:SYNTAX_MSO_REQUIRED',
1833 },
1834 {
1835 t => q{<![ INCLUDE IGNORE[<!---->]]>},
1836 method => 'parse_marked_section',
1837 option => {
1838 ExpandedURI q<allow-section> => {INCLUDE => 1, IGNORE => 1},
1839 ExpandedURI q<allow-section-ps> => 1,
1840 },
1841 result => '0:14:SYNTAX_MARKED_SECTION_KEYWORDS',
1842 },
1843 {
1844 t => q{<![RCDATA[<!---->]]>},
1845 method => 'parse_marked_section',
1846 option => {
1847 ExpandedURI q<allow-section> => {INCLUDE => 1, IGNORE => 1},
1848 ExpandedURI q<allow-section-ps> => 1,
1849 },
1850 result => '0:3:SYNTAX_MARKED_SECTION_KEYWORD',
1851 },
1852 {
1853 t => q{<![DATA[<!---->]]>},
1854 method => 'parse_marked_section',
1855 option => {
1856 ExpandedURI q<allow-section> => {INCLUDE => 1, IGNORE => 1},
1857 ExpandedURI q<allow-section-ps> => 1,
1858 },
1859 result => '0:3:SYNTAX_MARKED_SECTION_KEYWORD',
1860 },
1861 {
1862 t => q{<![IGNORE[<!---->]]>},
1863 method => 'parse_marked_section',
1864 option => {
1865 ExpandedURI q<allow-section> => {INCLUDE => 1, IGNORE => 1},
1866 ExpandedURI q<allow-section-ps> => 1,
1867 },
1868 result => 1,
1869 },
1870 {
1871 t => q{<![IGNORE[<!---->},
1872 method => 'parse_marked_section',
1873 option => {
1874 ExpandedURI q<allow-section> => {INCLUDE => 1, IGNORE => 1},
1875 ExpandedURI q<allow-section-ps> => 1,
1876 },
1877 result => '0:17:SYNTAX_MSE_REQUIRED',
1878 },
1879 {
1880 t => q{<![IGNORE[<!----><![IGNORE[ ]]>...]]>},
1881 method => 'parse_marked_section',
1882 option => {
1883 ExpandedURI q<allow-section> => {INCLUDE => 1, IGNORE => 1},
1884 ExpandedURI q<allow-section-ps> => 1,
1885 },
1886 result => 1,
1887 },
1888 {
1889 t => q{<![IGNORE[<!----><![IGNORE[ <e><![CDATA[a&b ]]></e> ]]>...]]>},
1890 method => 'parse_marked_section',
1891 option => {
1892 ExpandedURI q<allow-section> => {INCLUDE => 1, IGNORE => 1},
1893 ExpandedURI q<allow-section-ps> => 1,
1894 },
1895 result => 1,
1896 },
1897 {
1898 t => q{<![IGNORE[<!----><![IGNORE[ <e><![CDATA[a&b ]]></e> ]>...]]>},
1899 method => 'parse_marked_section',
1900 option => {
1901 ExpandedURI q<allow-section> => {INCLUDE => 1, IGNORE => 1},
1902 ExpandedURI q<allow-section-ps> => 1,
1903 },
1904 result => '0:60:SYNTAX_MSE_REQUIRED',
1905 },
1906 {
1907 t => q{<![IGNORE[<!----><![ <e]]>.]]>},
1908 method => 'parse_marked_section',
1909 option => {
1910 ExpandedURI q<allow-section> => {INCLUDE => 1, IGNORE => 1},
1911 ExpandedURI q<allow-section-ps> => 1,
1912 },
1913 result => 1,
1914 },
1915 {
1916 t => q{<![ [<!----><![ <e]]>.]]>},
1917 method => 'parse_marked_section',
1918 option => {
1919 ExpandedURI q<allow-section> => {INCLUDE => 1, IGNORE => 1},
1920 ExpandedURI q<allow-section-ps> => 1,
1921 },
1922 result => '0:5:SYNTAX_MARKED_SECTION_KEYWORD_REQUIRED',
1923 },
1924 {
1925 t => q{<![[<!----><![ <e]]>.]]>},
1926 method => 'parse_marked_section',
1927 option => {
1928 ExpandedURI q<allow-section> => {INCLUDE => 1, IGNORE => 1},
1929 ExpandedURI q<allow-section-ps> => 1,
1930 },
1931 result => '0:3:SYNTAX_MARKED_SECTION_KEYWORD_REQUIRED',
1932 },
1933 {
1934 entity => {kwd => ' INCLUDE '},
1935 t => q{<![%kwd; [ <!-- --> ]]>},
1936 method => 'parse_marked_section',
1937 option => {
1938 ExpandedURI q<allow-section> => {INCLUDE => 1, IGNORE => 1},
1939 ExpandedURI q<allow-section-ps> => 1,
1940 ExpandedURI q<allow-param-entref> => 1,
1941 },
1942 result => 1,
1943 },
1944 {
1945 entity => {kwd => ' INCLUDE ', kwd2 => '%kwd3;', kwd3 => ''},
1946 t => q{<![%kwd; %kwd2; [ <!-- --> ]]>},
1947 method => 'parse_marked_section',
1948 option => {
1949 ExpandedURI q<allow-section> => {INCLUDE => 1, IGNORE => 1},
1950 ExpandedURI q<allow-section-ps> => 1,
1951 ExpandedURI q<allow-param-entref> => 1,
1952 },
1953 result => 1,
1954 },
1955 {
1956 entity => {kwd => ' INCLUDE ', kwd2 => ' -- comment --'},
1957 t => q{<![%kwd; %kwd2; [ <!-- --> ]]>},
1958 method => 'parse_marked_section',
1959 option => {
1960 ExpandedURI q<allow-section> => {INCLUDE => 1, IGNORE => 1},
1961 ExpandedURI q<allow-section-ps> => 1,
1962 ExpandedURI q<allow-param-entref> => 1,
1963 },
1964 result => '0:1:SYNTAX_PS_COMMENT',
1965 },
1966 {
1967 t => q{<![INCLUDE[ <!-- -- ]]>},
1968 method => 'parse_marked_section',
1969 option => {
1970 ExpandedURI q<allow-section> => {INCLUDE => 1, IGNORE => 1},
1971 ExpandedURI q<allow-section-ps> => 1,
1972 ExpandedURI q<section-content-parser> => 'parse_doctype_subset',
1973 },
1974 result => '0:19:SYNTAX_S_IN_COMMENT_DECLARATION',
1975 },
1976
1977 {
1978 t => q{<![CDATA[ <!-- -- ]]>},
1979 method => 'parse_marked_section',
1980 option => {
1981 ExpandedURI q<allow-section> => {CDATA => 1},
1982 },
1983 result => 1,
1984 },
1985 {
1986 t => q{<![CDATA [ <!-- -- ]]>},
1987 method => 'parse_marked_section',
1988 option => {
1989 ExpandedURI q<allow-section> => {CDATA => 1},
1990 },
1991 result => '0:8:SYNTAX_MARKED_SECTION_STATUS_PS',
1992 },
1993 {
1994 t => q{<![ CDATA[ <!-- -- ]]>},
1995 method => 'parse_marked_section',
1996 option => {
1997 ExpandedURI q<allow-section> => {CDATA => 1},
1998 },
1999 result => '0:3:SYNTAX_MARKED_SECTION_STATUS_PS',
2000 },
2001 {
2002 t => q{<![CDATA[ <!-- ]]-]>- ]]>},
2003 method => 'parse_marked_section',
2004 option => {
2005 ExpandedURI q<allow-section> => {CDATA => 1},
2006 },
2007 result => 1,
2008 },
2009 {
2010 entity => {kwd => 'CDATA'},
2011 t => q{<![%kwd;[ <!-- ]]-]>- ]]>},
2012 method => 'parse_marked_section',
2013 option => {
2014 ExpandedURI q<allow-section> => {CDATA => 1},
2015 ExpandedURI q<allow-param-entref> => 1,
2016 },
2017 result => '0:3:SYNTAX_MARKED_SECTION_STATUS_PS',
2018 },
2019
2020 {
2021 t => q{<!----> <!ENTITY e "entity text">
2022 <!ELEMENT el ANY> <!ATTLIST el foo CDATA "bar">
2023 <?pi ?> <![ INCLUDE
2024 [ <!ATTLIST el bar ID #IMPLIED> ]]>
2025 <!NOTATION n SYSTEM "not">},
2026 method => 'parse_doctype_subset',
2027 option => {
2028 ExpandedURI q<allow-section> => {INCLUDE => 1},
2029 ExpandedURI q<allow-param-entref> => 1,
2030 },
2031 result => 1,
2032 },
2033 {
2034 t => q{<!----> <!ENTITY e "entity text">
2035 <!DOCTYPE doc []>},
2036 method => 'parse_doctype_subset',
2037 option => {
2038 ExpandedURI q<allow-section> => {CDATA => 1},
2039 },
2040 result => '1:9:SYNTAX_MARKUP_DECLARATION_NOT_ALLOWED',
2041 },
2042 {
2043 t => q{<!----> <!ENTITY e "entity text"> ]>},
2044 method => 'parse_doctype_subset',
2045 option => {
2046 ExpandedURI q<allow-section> => {CDATA => 1},
2047 },
2048 result => '0:34:SYNTAX_DOCTYPE_SUBSET_INVALID_CHAR',
2049 },
2050
2051 {
2052 t => q{<!DOCTYPE d [<!----> <!ENTITY e "entity text"> ]>},
2053 method => 'parse_doctype_declaration',
2054 result => 1,
2055 },
2056 {
2057 t => q{<!DOCTYPE d [<!----> <![INCLUDE[<!ENTITY e "entity text">]]> ]>},
2058 method => 'parse_doctype_declaration',
2059 result => '0:21:SYNTAX_MARKED_SECTION_NOT_ALLOWED',
2060 },
2061 {
2062 entity => {d => {replace => q< <![INCLUDE[<!ENTITY e "entity text">]]>>,
2063 external => 0}},
2064 t => q{<!DOCTYPE d [<!----> %d; <!-- --> ]>},
2065 method => 'parse_doctype_declaration',
2066 result => '0:2:SYNTAX_MARKED_SECTION_NOT_ALLOWED',
2067 },
2068 {
2069 entity => {d => {replace => q{ <![INCLUDE[<!ENTITY e "entity text">]]>},
2070 external => 1}},
2071 t => q{<!DOCTYPE d [<!----> %d; <!-- --> ]>},
2072 method => 'parse_doctype_declaration',
2073 result => 1,
2074 },
2075 {
2076 entity => {d => {replace
2077 => q{<![INCLUDE[<!ENTITY e -- SYSTEM -- "entity text">]]>},
2078 external => 1}},
2079 t => q{<!DOCTYPE d [<!----> %d; ]>},
2080 method => 'parse_doctype_declaration',
2081 result => '0:22:SYNTAX_PS_COMMENT',
2082 },
2083
2084 {
2085 t => q{<?xml?>},
2086 method => 'parse_processing_instruction',
2087 result => q(0:0:SYNTAX_XML_DECLARATION_IN_MIDDLE),
2088 },
2089 {
2090 t => q{<?XML?>},
2091 method => 'parse_processing_instruction',
2092 result => q(0:2:SYNTAX_PI_TARGET_XML),
2093 },
2094 {
2095 t => q{<?XmL?>},
2096 method => 'parse_processing_instruction',
2097 result => q(0:2:SYNTAX_PI_TARGET_XML),
2098 },
2099 {
2100 t => q{<?XmL1?>},
2101 method => 'parse_processing_instruction',
2102 result => 1,
2103 },
2104
2105 {
2106 t => q{<?xml?>},
2107 method => 'parse_xml_declaration',
2108 option => {ExpandedURI q<allow-xml-declaration> => 1},
2109 result => q(0:5:SYNTAX_XML_VERSION_REQUIRED),
2110 },
2111 {
2112 t => q{<?xml ?>},
2113 method => 'parse_xml_declaration',
2114 option => {ExpandedURI q<allow-xml-declaration> => 1},
2115 result => q(0:6:SYNTAX_XML_VERSION_REQUIRED),
2116 },
2117 {
2118 t => q{<?xml ?>},
2119 method => 'parse_xml_declaration',
2120 option => {ExpandedURI q<allow-text-declaration> => 1},
2121 result => q(0:6:SYNTAX_XML_ENCODING_REQUIRED),
2122 },
2123 {
2124 t => q{<?xml ?>},
2125 method => 'parse_xml_declaration',
2126 option => {ExpandedURI q<allow-xml-declaration> => 1,
2127 ExpandedURI q<allow-text-declaration> => 1},
2128 result => q(0:6:SYNTAX_XML_ENCODING_REQUIRED),
2129 },
2130 {
2131 t => q{<?xml version="1.0"?>},
2132 method => 'parse_xml_declaration',
2133 option => {ExpandedURI q<allow-xml-declaration> => 1},
2134 result => 1,
2135 },
2136 {
2137 t => q{<?xml version="1.0" ?>},
2138 method => 'parse_xml_declaration',
2139 option => {ExpandedURI q<allow-xml-declaration> => 1},
2140 result => 1,
2141 },
2142 {
2143 t => qq{<?xml \tversion = "1.0"?>},
2144 method => 'parse_xml_declaration',
2145 option => {ExpandedURI q<allow-xml-declaration> => 1},
2146 result => 1,
2147 },
2148 {
2149 t => q{<?xml version='1.0' ?>},
2150 method => 'parse_xml_declaration',
2151 option => {ExpandedURI q<allow-xml-declaration> => 1},
2152 result => 1,
2153 },
2154 {
2155 t => q{<?xml version="1.0"encoding="iso-2022-jp"?>},
2156 method => 'parse_xml_declaration',
2157 option => {ExpandedURI q<allow-xml-declaration> => 1},
2158 result => q(0:19:SYNTAX_S_REQUIRED_BETWEEN_ATTR_SPEC),
2159 },
2160 {
2161 t => q{<?xml version="1.0?>},
2162 method => 'parse_xml_declaration',
2163 option => {ExpandedURI q<allow-xml-declaration> => 1},
2164 result => q(0:18:SYNTAX_ALITC_REQUIRED),
2165 },
2166 {
2167 t => q{<?xml version=1.0?>},
2168 method => 'parse_xml_declaration',
2169 option => {ExpandedURI q<allow-xml-declaration> => 1},
2170 result => q(0:14:SYNTAX_ALITO_OR_ALITAO_REQUIRED),
2171 },
2172 {
2173 t => q{<?xml version="1.1"?>},
2174 method => 'parse_xml_declaration',
2175 option => {ExpandedURI q<allow-xml-declaration> => 1},
2176 result => 1,
2177 },
2178 {
2179 t => q{<?xml version="1.2"?>},
2180 method => 'parse_xml_declaration',
2181 option => {ExpandedURI q<allow-xml-declaration> => 1},
2182 result => q(0:15:SYNTAX_XML_VERSION_UNSUPPORTED),
2183 },
2184 {
2185 t => q{<?xml version="1+2"?>},
2186 method => 'parse_xml_declaration',
2187 option => {ExpandedURI q<allow-xml-declaration> => 1},
2188 result => q(0:15:SYNTAX_XML_VERSION_INVALID),
2189 },
2190 {
2191 t => q{<?xml version=""?>},
2192 method => 'parse_xml_declaration',
2193 option => {ExpandedURI q<allow-xml-declaration> => 1},
2194 result => q(0:15:SYNTAX_XML_VERSION_INVALID),
2195 },
2196
2197 {
2198 t => q{<?xml encoding=""?>},
2199 method => 'parse_xml_declaration',
2200 option => {ExpandedURI q<allow-text-declaration> => 1},
2201 result => q(0:16:SYNTAX_XML_ENCODING_INVALID),
2202 },
2203 {
2204 t => q{<?xml encoding = 'iso-2022-jp'?>},
2205 method => 'parse_xml_declaration',
2206 option => {ExpandedURI q<allow-text-declaration> => 1},
2207 result => 1,
2208 },
2209 {
2210 t => q{<?xml encoding = 'iso-2022-jp'?>},
2211 method => 'parse_xml_declaration',
2212 option => {ExpandedURI q<allow-xml-declaration> => 1},
2213 result => q(0:7:SYNTAX_XML_VERSION_REQUIRED),
2214 },
2215 {
2216 t => q{<?xml encoding = 'iso+2022+jp'?>},
2217 method => 'parse_xml_declaration',
2218 option => {ExpandedURI q<allow-text-declaration> => 1},
2219 result => q(0:19:SYNTAX_XML_ENCODING_INVALID),
2220 },
2221 {
2222 t => q{<?xml encoding = ""?>},
2223 method => 'parse_xml_declaration',
2224 option => {ExpandedURI q<allow-text-declaration> => 1},
2225 result => q(0:18:SYNTAX_XML_ENCODING_INVALID),
2226 },
2227 {
2228 t => q{<?xml encoding = 'iso-2022-jp' version="1.0"?>},
2229 method => 'parse_xml_declaration',
2230 option => {ExpandedURI q<allow-xml-declaration> => 1},
2231 result => q(0:7:SYNTAX_XML_VERSION_REQUIRED),
2232 },
2233 {
2234 t => q{<?xml version="1.0" encoding = 'iso-2022-jp'?>},
2235 method => 'parse_xml_declaration',
2236 option => {ExpandedURI q<allow-xml-declaration> => 1},
2237 result => 1,
2238 },
2239 {
2240 t => q{<?xml version="1.0" encoding = 'iso-2022-jp'?>},
2241 method => 'parse_xml_declaration',
2242 option => {ExpandedURI q<allow-text-declaration> => 1},
2243 result => 1,
2244 },
2245 {
2246 t => q{<?xml version="1.0" encoding = 'iso-2022-jp'?>},
2247 method => 'parse_xml_declaration',
2248 option => {ExpandedURI q<allow-xml-declaration> => 1,
2249 ExpandedURI q<allow-text-declaration> => 1},
2250 result => 1,
2251 },
2252
2253 {
2254 t => q{<?xml version="1.0" encoding = 'UTF-8' standalone="yes" ?>},
2255 method => 'parse_xml_declaration',
2256 option => {ExpandedURI q<allow-xml-declaration> => 1,
2257 ExpandedURI q<allow-text-declaration> => 1},
2258 result => 1,
2259 },
2260 {
2261 t => q{<?xml version="1.0" encoding = 'UTF-8' standalone="no" ?>},
2262 method => 'parse_xml_declaration',
2263 option => {ExpandedURI q<allow-xml-declaration> => 1,
2264 ExpandedURI q<allow-text-declaration> => 1},
2265 result => 1,
2266 },
2267 {
2268 t => q{<?xml version="1.0" encoding = 'UTF-8' standalone="no" ?>},
2269 method => 'parse_xml_declaration',
2270 option => {ExpandedURI q<allow-text-declaration> => 1},
2271 result => q(0:39:SYNTAX_XML_STANDALONE),
2272 },
2273 {
2274 t => q{<?xml version="1.0" encoding = 'UTF-8' standalone="unknown" ?>},
2275 method => 'parse_xml_declaration',
2276 option => {ExpandedURI q<allow-xml-declaration> => 1},
2277 result => q(0:51:SYNTAX_XML_STANDALONE_INVALID),
2278 },
2279 {
2280 t => qq{<?xml version="1.1" encoding = 'UTF-8' \tstandalone="no" ?>},
2281 method => 'parse_xml_declaration',
2282 option => {ExpandedURI q<allow-xml-declaration> => 1},
2283 result => q(0:38:SYNTAX_XML_STANDALONE_S),
2284 },
2285 {
2286 t => qq{<?xml standalone = "yes" ?>},
2287 method => 'parse_xml_declaration',
2288 option => {ExpandedURI q<allow-xml-declaration> => 1},
2289 result => q(0:6:SYNTAX_XML_VERSION_REQUIRED),
2290 },
2291 {
2292 t => qq{<?xml standalone = "yes" ?>},
2293 method => 'parse_xml_declaration',
2294 option => {ExpandedURI q<allow-text-declaration> => 1},
2295 result => q(0:6:SYNTAX_XML_ENCODING_REQUIRED),
2296 },
2297 {
2298 t => qq{<?xml encoding="iso-2022-jp" standalone = "yes" ?>},
2299 method => 'parse_xml_declaration',
2300 option => {ExpandedURI q<allow-text-declaration> => 1},
2301 result => q(0:29:SYNTAX_XML_STANDALONE),
2302 },
2303 {
2304 t => qq{<?xml version="1.1" encode="iso-2022-jp" ?>},
2305 method => 'parse_xml_declaration',
2306 option => {ExpandedURI q<allow-xml-declaration> => 1},
2307 result => q(0:20:SYNTAX_XML_UNKNOWN_ATTR),
2308 },
2309 {
2310 t => q{<?xml <#version="1.&#x31;" ?>},
2311 method => 'parse_xml_declaration',
2312 option => {ExpandedURI q<allow-xml-declaration> => 1},
2313 result => q(0:6:SYNTAX_ATTR_SPEC_REQUIRED),
2314 },
2315 {
2316 t => qq{<?xml version="&version;" ?>},
2317 method => 'parse_xml_declaration',
2318 option => {ExpandedURI q<allow-xml-declaration> => 1},
2319 result => q(0:15:SYNTAX_XML_VERSION_INVALID),
2320 },
2321 {
2322 t => q{<?xml version=" 1.&#x31;" ?>},
2323 method => 'parse_xml_declaration',
2324 option => {ExpandedURI q<allow-xml-declaration> => 1},
2325 result => q(0:15:SYNTAX_XML_VERSION_INVALID),
2326 },
2327 {
2328 t => qq{<?xml version="-&#31;-" ?>},
2329 method => 'parse_xml_declaration',
2330 option => {ExpandedURI q<allow-xml-declaration> => 1},
2331 result => q(0:15:SYNTAX_XML_VERSION_INVALID),
2332 },
2333
2334 {
2335 t => q{<el>data</el>},
2336 method => 'parse_document_entity',
2337 result => 1,
2338 },
2339 {
2340 t => q{
2341
2342 <el>data</el>
2343
2344 },
2345 method => 'parse_document_entity',
2346 result => 1,
2347 },
2348 {
2349 t => q{<?xml version="1.0"?>
2350
2351 <el>data</el>
2352
2353 },
2354 method => 'parse_document_entity',
2355 result => 1,
2356 },
2357 {
2358 t => q{<?xml version="1.0"?>
2359
2360 <el>data</el>
2361 <!--
2362 comment -->
2363 },
2364 method => 'parse_document_entity',
2365 result => 1,
2366 },
2367 {
2368 t => q{<?xml-stylesheet href="1.0"?>
2369
2370 <el>data</el>
2371 <!--
2372 comment -->
2373 },
2374 method => 'parse_document_entity',
2375 result => 1,
2376 },
2377 {
2378 t => q{<!DOCTYPE el []>
2379 <el>data</el>
2380 <!--
2381 comment -->
2382 },
2383 method => 'parse_document_entity',
2384 result => 1,
2385 },
2386 {
2387 t => q{<el>a</el>
2388 <el>data</el>
2389 <!--
2390 comment -->
2391 },
2392 method => 'parse_document_entity',
2393 result => '1:0:SYNTAX_MULTIPLE_DOCUMENT_ELEMENTS',
2394 },
2395 {
2396 t => q{a<el>a</el>},
2397 method => 'parse_document_entity',
2398 result => '0:0:SYNTAX_CDATA_OUTSIDE_DOCUMENT_ELEMENT',
2399 },
2400 {
2401 t => q{<el>a</el>
2402 b},
2403 method => 'parse_document_entity',
2404 result => '1:2:SYNTAX_CDATA_OUTSIDE_DOCUMENT_ELEMENT',
2405 },
2406 {
2407 t => q{<el>a</el>
2408 <?xml version="1.0"?>},
2409 method => 'parse_document_entity',
2410 result => '1:2:SYNTAX_XML_DECLARATION_IN_MIDDLE',
2411 },
2412 {
2413 t => q{
2414 <?xml version="1.0"?> <el/>},
2415 method => 'parse_document_entity',
2416 result => '1:2:SYNTAX_XML_DECLARATION_IN_MIDDLE',
2417 },
2418 {
2419 t => q{<!DOCTYPE el []>
2420 <?xml version="1.0"?> <el/>},
2421 method => 'parse_document_entity',
2422 result => '1:2:SYNTAX_XML_DECLARATION_IN_MIDDLE',
2423 },
2424 {
2425 t => q{<el/><!DOCTYPE el []>},
2426 method => 'parse_document_entity',
2427 result => '0:5:SYNTAX_MARKUP_DECLARATION_NOT_ALLOWED',
2428 },
2429 {
2430 t => q{<el/><![IGNORE[]]>},
2431 method => 'parse_document_entity',
2432 result => '0:5:SYNTAX_MARKED_SECTION_NOT_ALLOWED',
2433 },
2434 {
2435 t => q{<el/>< },
2436 method => 'parse_document_entity',
2437 result => '0:5:SYNTAX_CDATA_OUTSIDE_DOCUMENT_ELEMENT',
2438 },
2439 {
2440 t => q{<!-- -->},
2441 method => 'parse_document_entity',
2442 result => '0:8:SYNTAX_NO_DOCUMENT_ELEMENT',
2443 },
2444 {
2445 t => q{<el><!-- -->},
2446 method => 'parse_document_entity',
2447 result => '0:12:SYNTAX_END_TAG_REQUIRED',
2448 },
2449 {
2450 t => q{<?xml?><el><!-- --></el>},
2451 method => 'parse_document_entity',
2452 result => '0:5:SYNTAX_XML_VERSION_REQUIRED',
2453 },
2454
2455 {
2456 entity => {f => q{baz}},
2457 t => q{<e>foo&f;bar</e>},
2458 method => 'parse_element',
2459 result => 1,
2460 },
2461 {
2462 entity => {f => q{baz<bar/>}},
2463 t => q{<e>foo&f;bar</e>},
2464 method => 'parse_element',
2465 result => 1,
2466 },
2467 {
2468 entity => {f => q{baz<bar>bar</bar>z}},
2469 t => q{<e>foo&f;bar</e>},
2470 method => 'parse_element',
2471 result => 1,
2472 },
2473 {
2474 entity => {f => q{baz&l;z}, l => q{foo}},
2475 t => q{<e>foo&f;bar</e>},
2476 method => 'parse_element',
2477 result => 1,
2478 },
2479 {
2480 entity => {f => q{baz<bar>bar</bar}},
2481 t => q{<e>foo&f;bar</e>},
2482 method => 'parse_element',
2483 result => '0:16:SYNTAX_ETAGC_REQUIRED',
2484 },
2485 {
2486 entity => {f => q{baz<bar>bar}},
2487 t => q{<e>foo&f;bar</e>},
2488 method => 'parse_element',
2489 result => '0:11:SYNTAX_END_TAG_REQUIRED',
2490 },
2491 {
2492 entity => {f => q{baz</bar>bar}},
2493 t => q{<e>foo&f;bar</e>},
2494 method => 'parse_element',
2495 result => '0:3:SYNTAX_END_TAG_NOT_ALLOWED',
2496 },
2497 {
2498 entity => {f => q{baz&bar}, bar => q<bar>},
2499 t => q{<e>foo&f;bar</e>},
2500 method => 'parse_element',
2501 result => '0:7:SYNTAX_REFC_REQUIRED',
2502 },
2503 {
2504 entity => {f => q{baz< bar}},
2505 t => q{<e>foo&f;bar</e>},
2506 method => 'parse_element',
2507 result => '0:4:SYNTAX_ELEMENT_TYPE_NAME_FOLLOWING_STAGO_REQUIRED',
2508 },
2509 {
2510 entity => {f => q{baz &g;bar}, g => {replace => q{fff}, external => 1}},
2511 t => q{<e>foo&f;bar</e>},
2512 method => 'parse_element',
2513 option => {ExpandedURI q<allow-general-entity-reference> => 1,
2514 ExpandedURI q<use-reference> => 1},
2515 result => 1,
2516 },
2517 {
2518 entity => {f => q{baz &g;bar}, g => {unparsed => 1, external => 1}},
2519 t => q{<e>foo&f;bar</e>},
2520 method => 'parse_element',
2521 option => {ExpandedURI q<allow-general-entity-reference> => 1,
2522 ExpandedURI q<use-reference> => 1},
2523 result => '0:5:WFC_PARSED_ENTITY',
2524 },
2525 {
2526 entity => {f => q{baz &f;bar}},
2527 t => q{<e>foo&f;bar</e>},
2528 method => 'parse_element',
2529 option => {ExpandedURI q<allow-general-entity-reference> => 1,
2530 ExpandedURI q<use-reference> => 1},
2531 result => '0:5:WFC_NO_RECURSION',
2532 },
2533 {
2534 entity => {f => q{baz &g;bar}, g => q{foo &f;bar}},
2535 t => q{<e>foo&f;bar</e>},
2536 method => 'parse_element',
2537 option => {ExpandedURI q<allow-general-entity-reference> => 1,
2538 ExpandedURI q<use-reference> => 1},
2539 result => '0:5:WFC_NO_RECURSION',
2540 },
2541 {
2542 entity => {f => {replace => q{baz bar}, externally => 1}},
2543 t => q{<e>foo&f;bar</e>},
2544 method => 'parse_element',
2545 option => {ExpandedURI q<allow-general-entity-reference> => 1,
2546 ExpandedURI q<use-reference> => 1,
2547 ExpandedURI q<test:standalone> => 1},
2548 result => '0:7:WFC_ENTITY_DECLARED__INTERNAL',
2549 },
2550 {
2551 entity => {f => {replace => q{baz bar}, externally => 1}},
2552 t => q{<e>foo&f;bar</e>},
2553 method => 'parse_element',
2554 option => {ExpandedURI q<allow-general-entity-reference> => 1,
2555 ExpandedURI q<use-reference> => 1,
2556 ExpandedURI q<test:standalone> => 0},
2557 result => 1,
2558 },
2559
2560 {
2561 entity => {f => q{baz bar}},
2562 t => q{"foo&f;bar"},
2563 method => 'parse_attribute_value_specification',
2564 option => {ExpandedURI q<allow-general-entity-reference> => 1,
2565 ExpandedURI q<use-reference> => 1},
2566 result => 1,
2567 },
2568 {
2569 entity => {f => q{baz &g;bar}, g => q{fff}},
2570 t => q{"foo&f;bar"},
2571 method => 'parse_attribute_value_specification',
2572 option => {ExpandedURI q<allow-general-entity-reference> => 1,
2573 ExpandedURI q<use-reference> => 1},
2574 result => 1,
2575 },
2576 {
2577 entity => {f => q{baz< bar}},
2578 t => q{'foo&f;bar'},
2579 method => 'parse_attribute_value_specification',
2580 option => {ExpandedURI q<allow-general-entity-reference> => 1,
2581 ExpandedURI q<use-reference> => 1},
2582 result => '0:3:WFC_NO_LESS_THAN_IN_ATTR_VAL',
2583 },
2584 {
2585 entity => {f => q{baz &g;bar}, g => {replace => q{fff}, external => 1}},
2586 t => q{"foo&f;bar"},
2587 method => 'parse_attribute_value_specification',
2588 option => {ExpandedURI q<allow-general-entity-reference> => 1,
2589 ExpandedURI q<use-reference> => 1},
2590 result => '0:5:WFC_NO_EXTERNAL_ENTITY_REFERENCES',
2591 },
2592 {
2593 entity => {f => q{baz &g;bar}, g => {unparsed => 1, external => 1}},
2594 t => q{"foo&f;bar"},
2595 method => 'parse_attribute_value_specification',
2596 option => {ExpandedURI q<allow-general-entity-reference> => 1,
2597 ExpandedURI q<use-reference> => 1},
2598 result => '0:5:WFC_NO_EXTERNAL_ENTITY_REFERENCES',
2599 },
2600 {
2601 entity => {f => q{baz &f;bar}},
2602 t => q{"foo&f;bar"},
2603 method => 'parse_attribute_value_specification',
2604 option => {ExpandedURI q<allow-general-entity-reference> => 1,
2605 ExpandedURI q<use-reference> => 1},
2606 result => '0:5:WFC_NO_RECURSION',
2607 },
2608 {
2609 entity => {f => q{baz &g;bar}, g => q{foo &f;bar}},
2610 t => q{"foo&f;bar"},
2611 method => 'parse_attribute_value_specification',
2612 option => {ExpandedURI q<allow-general-entity-reference> => 1,
2613 ExpandedURI q<use-reference> => 1},
2614 result => '0:5:WFC_NO_RECURSION',
2615 },
2616 {
2617 entity => {f => {replace => q{baz bar}, externally => 1}},
2618 t => q{"foo&f;bar"},
2619 method => 'parse_attribute_value_specification',
2620 option => {ExpandedURI q<allow-general-entity-reference> => 1,
2621 ExpandedURI q<use-reference> => 1,
2622 ExpandedURI q<test:standalone> => 1},
2623 result => '0:5:WFC_ENTITY_DECLARED__INTERNAL',
2624 },
2625 {
2626 entity => {f => {replace => q{baz bar}, externally => 1}},
2627 t => q{"foo&f;bar"},
2628 method => 'parse_attribute_value_specification',
2629 option => {ExpandedURI q<allow-general-entity-reference> => 1,
2630 ExpandedURI q<use-reference> => 1,
2631 ExpandedURI q<test:standalone> => 0},
2632 result => 1,
2633 },
2634
2635 {
2636 t => q{<?xml version="1.0"?> <doc/>},
2637 method => 'parse_document_entity',
2638 result => 1,
2639 },
2640 {
2641 t => q{<?xml version="1.1"?> <doc/>},
2642 method => 'parse_document_entity',
2643 result => 1,
2644 },
2645 {
2646 t => qq{<?xml version="1.1"?> \x85 <doc/>},
2647 method => 'parse_document_entity',
2648 result => 1,
2649 },
2650 {
2651 t => qq{<?xml version="1.0"?> \x85 <doc/>},
2652 method => 'parse_document_entity',
2653 result => q<0:22:SYNTAX_CDATA_OUTSIDE_DOCUMENT_ELEMENT>,
2654 },
2655 {
2656 t => qq{<?xml version="1.1"?> \x{2028} <doc/>},
2657 method => 'parse_document_entity',
2658 result => 1,
2659 },
2660 {
2661 t => qq{<?xml version="1.0"?> \x{2028} <doc/>},
2662 method => 'parse_document_entity',
2663 result => q<0:22:SYNTAX_CDATA_OUTSIDE_DOCUMENT_ELEMENT>,
2664 },
2665 {
2666 t => qq{<?xml version="1.0" \x85 ?> <doc/>},
2667 method => 'parse_document_entity',
2668 result => q<0:0:FATAL_NEW_NL_IN_XML_DECLARATION>,
2669 },
2670
2671 {
2672 t => qq{<?xml version="1.1"?>\x00 <doc/>},
2673 method => 'parse_document_entity',
2674 result => q<0:21:SYNTAX_NOT_IN_CHAR>,
2675 },
2676 {
2677 t => qq{<?xml version="1.1"?>\x01 <doc/>},
2678 method => 'parse_document_entity',
2679 result => q<0:21:SYNTAX_RESTRICTED_CHAR>,
2680 },
2681 {
2682 t => qq{<?xml version="1.1"?>\x81 <doc/>},
2683 method => 'parse_document_entity',
2684 result => q<0:21:SYNTAX_RESTRICTED_CHAR>,
2685 },
2686 {
2687 t => qq{<?xml version="1.0"?>\x01 <doc/>},
2688 method => 'parse_document_entity',
2689 result => q<0:21:SYNTAX_NOT_IN_CHAR>,
2690 },
2691
2692 {
2693 t => qq{<e a="&#x0000;"/>},
2694 method => 'parse_element',
2695 result => q<0:6:WFC_LEGAL_CHARACTER>,
2696 },
2697 {
2698 t => qq{<e a="&#0000;"/>},
2699 method => 'parse_element',
2700 result => q<0:6:WFC_LEGAL_CHARACTER>,
2701 },
2702 {
2703 t => qq{<e>a="&#x0000;"</e>},
2704 method => 'parse_element',
2705 result => q<0:6:WFC_LEGAL_CHARACTER>,
2706 },
2707 {
2708 t => qq{<e>a="&#0000;"</e>},
2709 method => 'parse_element',
2710 result => q<0:6:WFC_LEGAL_CHARACTER>,
2711 },
2712 {
2713 t => qq{<!ENTITY e "&#x0000;">},
2714 method => 'parse_entity_declaration',
2715 result => q<0:12:WFC_LEGAL_CHARACTER>,
2716 },
2717 {
2718 t => qq{<!ENTITY e "&#0000;">},
2719 method => 'parse_entity_declaration',
2720 result => q<0:12:WFC_LEGAL_CHARACTER>,
2721 },
2722
2723 {
2724 entity => {f => {replace => q<bar>}},
2725 t => qq{<!ENTITY e "%f;">},
2726 method => 'parse_entity_declaration',
2727 result => 1,
2728 },
2729 {
2730 entity => {f => {replace => q<%bar;>}, bar => {replace => q<bar>}},
2731 t => qq{<!ENTITY e "%f;">},
2732 method => 'parse_entity_declaration',
2733 result => 1,
2734 },
2735 {
2736 entity => {f => {replace => q<%bar;>}, bar => [undef]},
2737 t => qq{<!ENTITY e "%f;">},
2738 method => 'parse_entity_declaration',
2739 result => 1,
2740 },
2741 {
2742 entity => {f => {replace => q<%bar;>}, bar => [undef]},
2743 t => qq{<!ENTITY e "%f;">},
2744 method => 'parse_entity_declaration',
2745 option => {ExpandedURI q<test:standalone> => 1},
2746 result => '0:1:WFC_ENTITY_DECLARED',
2747 },
2748 {
2749 entity => {f => {replace => q<%bar;>}, bar => {replace => q<>,
2750 externally => 1}},
2751 t => qq{<!ENTITY e "%f;">},
2752 method => 'parse_entity_declaration',
2753 option => {ExpandedURI q<test:standalone> => 1},
2754 result => '0:1:WFC_ENTITY_DECLARED__INTERNAL',
2755 },
2756 {
2757 entity => {f => {replace => q<%f;>}},
2758 t => qq{<!ENTITY e "%f;">},
2759 method => 'parse_entity_declaration',
2760 option => {ExpandedURI q<test:standalone> => 1},
2761 result => '0:1:WFC_NO_RECURSION',
2762 },
2763 {
2764 entity => {f => {replace => q<%g;>}, g => {replace => q<%f;>}},
2765 t => qq{<!ENTITY e "%f;">},
2766 method => 'parse_entity_declaration',
2767 option => {ExpandedURI q<test:standalone> => 1},
2768 result => '0:1:WFC_NO_RECURSION',
2769 },
2770 {
2771 entity => {f => {replace => q<g;>, unparsed => 1}},
2772 t => qq{<!ENTITY e "%f;">},
2773 method => 'parse_entity_declaration',
2774 option => {ExpandedURI q<test:standalone> => 1},
2775 result => '0:13:WFC_PARSED_ENTITY',
2776 },
2777
2778 {
2779 entity => {g => {replace => q<<!-- comment -->>}},
2780 t => qq{<!ENTITY e "f"> %g;},
2781 method => 'parse_doctype_subset',
2782 result => 1,
2783 },
2784 {
2785 entity => {g => {replace => q<<!-- comment -->>, unparsed => 1}},
2786 t => qq{<!ENTITY e "f"> %g;},
2787 method => 'parse_doctype_subset',
2788 result => '0:17:WFC_PARSED_ENTITY',
2789 },
2790 {
2791 entity => {g => {replace => q<<!-- comment --> %g;>}},
2792 t => qq{<!ENTITY e "f"> %g;},
2793 method => 'parse_doctype_subset',
2794 result => '0:18:WFC_NO_RECURSION',
2795 },
2796 {
2797 entity => {g => {replace => q<<!-- comment --> %h;>}, h => q<<!-- --> %g;>},
2798 t => qq{<!ENTITY e "f"> %g;},
2799 method => 'parse_doctype_subset',
2800 result => '0:10:WFC_NO_RECURSION',
2801 },
2802 {
2803 entity => {g => {replace => q<<!-- comment -->>, externally => 1}},
2804 t => qq{<!ENTITY e "f"> %g;},
2805 method => 'parse_doctype_subset',
2806 result => 1,
2807 },
2808 {
2809 entity => {g => {replace => q<<!-- comment -->>, externally => 1}},
2810 t => qq{<!ENTITY e "f"> %g;},
2811 method => 'parse_doctype_subset',
2812 option => {ExpandedURI q<test:standalone> => 1},
2813 result => '0:17:WFC_ENTITY_DECLARED__INTERNAL',
2814 },
2815
2816 {
2817 entity => {g => {replace => q<"!-- comment --">}},
2818 t => qq{<!ENTITY e %g;>},
2819 method => 'parse_doctype_subset',
2820 result => 1,
2821 },
2822 {
2823 entity => {g => {replace => q<"!-- comment --">, unparsed => 1}},
2824 t => qq{<!ENTITY e %g;>},
2825 method => 'parse_doctype_subset',
2826 result => '0:12:WFC_PARSED_ENTITY',
2827 },
2828 {
2829 entity => {g => {replace => q<%g;>}},
2830 t => qq{<!ENTITY e %g;>},
2831 method => 'parse_doctype_subset',
2832 result => '0:1:WFC_NO_RECURSION',
2833 },
2834 {
2835 entity => {g => {replace => q<%h;>}, h => q<%g;>},
2836 t => qq{<!ENTITY e %g;>},
2837 method => 'parse_doctype_subset',
2838 result => '0:1:WFC_NO_RECURSION',
2839 },
2840 {
2841 entity => {g => {replace => q<%h;>}, h => q<"%g;">},
2842 t => qq{<!ENTITY e %g;>},
2843 method => 'parse_doctype_subset',
2844 result => '0:2:WFC_NO_RECURSION',
2845 },
2846 {
2847 entity => {g => {replace => q<"!-- comment --">, externally => 1}},
2848 t => qq{<!ENTITY e %g;>},
2849 method => 'parse_doctype_subset',
2850 result => 1,
2851 },
2852 {
2853 entity => {g => {replace => q<"!-- comment --">, externally => 1}},
2854 t => qq{<!ENTITY e %g;>},
2855 method => 'parse_doctype_subset',
2856 option => {ExpandedURI q<test:standalone> => 1,
2857 ExpandedURI q<allow-param-entref> => 1},
2858 result => '0:12:WFC_ENTITY_DECLARED__INTERNAL',
2859 },
2860 {
2861 entity => {g => {replace => q<%g>}},
2862 t => qq{<!ENTITY e %g;>},
2863 method => 'parse_doctype_subset',
2864 result => '0:1:WFC_NO_RECURSION',
2865 },
2866 {
2867 entity => {g => {replace => q<%h>}, h => {replace => q<>, unparsed => 1}},
2868 t => qq{<!ENTITY e %g;>},
2869 method => 'parse_doctype_subset',
2870 result => '0:2:SYNTAX_REFC_REQUIRED',
2871 },
2872
2873 {
2874 entity => {g => {replace => q<>}},
2875 t => qq{<!ENTITY e %g; "text">},
2876 method => 'parse_doctype_subset',
2877 result => 1,
2878 },
2879 {
2880 entity => {g => {replace => q<%h;>}, h => {replace => q<>}},
2881 t => qq{<!ENTITY e %g; "text">},
2882 method => 'parse_doctype_subset',
2883 result => 1,
2884 },
2885 {
2886 entity => {g => {replace => q<>}},
2887 t => qq{%g; <!ENTITY e "text">},
2888 method => 'parse_doctype_subset',
2889 result => 1,
2890 },
2891 {
2892 entity => {g => {replace => q<%h;>}, h => {replace => q<>}},
2893 t => qq{%g; <!ENTITY e "text">},
2894 method => 'parse_doctype_subset',
2895 result => 1,
2896 },
2897
2898 {
2899 t => qq{<ee>aa</ee>},
2900 method => 'parse_element',
2901 result => 1,
2902 },
2903 {
2904 t => qq{<ee\x{4E00}>U+4E00</ee\x{4E00}>},
2905 method => 'parse_element',
2906 result => 1,
2907 },
2908 {
2909 t => qq{<ee\x{4DFF}>U+4DFF</ee\x{4DFF}>},
2910 method => 'parse_element',
2911 result => '0:3:SYNTAX_STAGC_OR_NESTC_REQUIRED',
2912 },
2913 {
2914 t => qq{<?xml version="1.1"?>
2915 <ee\x{4DFF}>U+4DFF</ee\x{4DFF}>},
2916 method => 'parse_document_entity',
2917 result => 1,
2918 },
2919 {
2920 t => qq{<?xml version="1.0"?>
2921 <ee>AA\x{4DFF}</ee>},
2922 method => 'parse_document_entity',
2923 result => 1,
2924 },
2925 {
2926 t => qq{<?xml version="1.1"?>
2927 <ee>AA\x{4DFF}</ee>},
2928 method => 'parse_document_entity',
2929 result => 1,
2930 },
2931 {
2932 t => qq{<?xml version="1.0"?>
2933 <ee \x{4DFF}="a">AA</ee>},
2934 method => 'parse_document_entity',
2935 result => '1:14:SYNTAX_STAGC_OR_NESTC_REQUIRED',
2936 },
2937 {
2938 t => qq{<?xml version="1.1"?>
2939 <ee \x{4DFF}="a">AA</ee>},
2940 method => 'parse_document_entity',
2941 result => 1,
2942 },
2943 {
2944 t => qq{<?xml version="1.0"?>
2945 <ee a\x{4DFF}="a">AA</ee>},
2946 method => 'parse_document_entity',
2947 result => '1:15:SYNTAX_VI_REQUIRED',
2948 },
2949 {
2950 t => qq{<?xml version="1.1"?>
2951 <ee a\x{4DFF}="a">AA</ee>},
2952 method => 'parse_document_entity',
2953 result => 1,
2954 },
2955 {
2956 t => qq{<?xml version="1.0"?>
2957 <ee \x{4DFF}a="a">AA</ee>},
2958 method => 'parse_document_entity',
2959 result => '1:14:SYNTAX_STAGC_OR_NESTC_REQUIRED',
2960 },
2961 {
2962 t => qq{<?xml version="1.1"?>
2963 <ee \x{4DFF}a="a">AA</ee>},
2964 method => 'parse_document_entity',
2965 result => 1,
2966 },
2967 {
2968 t => qq{<?xml version="1.0"?>
2969 <!DOCTYPE \x{4DFF}a [
2970 <!ELEMENT \x{4DFF}a EMPTY>
2971 ]>
2972 <\x{4DFF}a/>},
2973 method => 'parse_document_entity',
2974 result => '1:20:SYNTAX_DOCTYPE_NAME_REQUIRED',
2975 },
2976 {
2977 t => qq{<?xml version="1.1"?>
2978 <!DOCTYPE \x{4DFF}a [
2979 <!ELEMENT \x{4DFF}a EMPTY>
2980 ]>
2981 <\x{4DFF}a/>},
2982 method => 'parse_document_entity',
2983 result => 1,
2984 },
2985 {
2986 t => qq{<?xml version="1.0"?>
2987 <!DOCTYPE \x{4EFF}a [
2988 <!ELEMENT \x{4EFF}a (\x{4DFF}a)>
2989 ]>
2990 <\x{4EFF}a/>},
2991 method => 'parse_document_entity',
2992 result => '2:26:SYNTAX_MODEL_GROUP_ITEM_REQUIRED',
2993 },
2994
2995 {
2996 t => qq{<?xml version="1.0" encoding="utf-8"?>
2997 <!DOCTYPE \x{4EFF}a [
2998 <!ELEMENT \x{4EFF}a (\x{4DFF}a)>
2999 ]>
3000 <\x{4EFF}a/>},
3001 method => 'parse_external_parsed_entity',
3002 result => 1,
3003 },
3004 {
3005 t => qq{<?xml version="1.1" encoding="utf-8"?>
3006 <!DOCTYPE \x{4EFF}a [
3007 <!ELEMENT \x{4EFF}a (\x{4DFF}a)>
3008 ]><!--
3009 <\x{4EFF}a/>},
3010 method => 'parse_external_parsed_entity',
3011 result => 1,
3012 },
3013 {
3014 t => qq{<?xml version="1.1"?>
3015 <!DOCTYPE \x{4EFF}a [
3016 <!ELEMENT \x{4EFF}a (\x{4DFF}a)>
3017 ]><!--
3018 <\x{4EFF}a/>},
3019 method => 'parse_external_parsed_entity',
3020 result => '0:19:SYNTAX_XML_ENCODING_REQUIRED',
3021 },
3022
3023 {
3024 t => q{<e a="b" a="c"/>},
3025 method => 'parse_element',
3026 result => '0:9:WFC_UNIQUE_ATT_SPEC',
3027 },
3028 {
3029 t => q{<e ba="b" ba="c"/>},
3030 method => 'parse_element',
3031 result => '0:10:WFC_UNIQUE_ATT_SPEC',
3032 },
3033
3034 {
3035 t => q{<e>aa]]>bb</e>},
3036 method => 'parse_element',
3037 result => '0:7:SYNTAX_MSE',
3038 },
3039 );
3040
3041 plan tests => scalar @a;
3042
3043 my $first_error;
3044 my $first_error_detail;
3045 my $parser = new test_parser;
3046 $parser->{error}->{option}->{report} = sub {
3047 my $err = shift;
3048 $err->{-object}->set_position ($err->{source}, diff => $err->{position_diff});
3049 unless ($first_error) {
3050 $first_error = join ':', $err->{-object}->get_position ($err->{source}),
3051 $err->{-type};
3052 $first_error_detail = $err->stringify;
3053 }
3054 };
3055 for (@a) {
3056 $first_error = '';
3057 $first_error_detail = '';
3058 my $method = $_->{method};
3059 pos ($_->{t}) = 0;
3060 $parser->reset;
3061 $parser->{ExpandedURI q<test:entity>} = $_->{entity} || {};
3062 $_->{option} ||= {
3063 ExpandedURI q<allow-declaration>=>{qw/DOCTYPE 1 ENTITY 1 ELEMENT 1 NOTATION 1 ATTLIST 1 comment 1 section 1/},
3064 ExpandedURI q<allow-param-entref> => 1,
3065 ExpandedURI q<use-reference> => 1,
3066 };
3067 $parser->{ExpandedURI q<is-standalone>}
3068 = $_->{option}->{ExpandedURI q<test:standalone>};
3069 $parser->$method (\$_->{t}, {}, %{$_->{option}});
3070 ok $first_error || 1, $_->{result}, $first_error_detail;
3071 }
3072
3073 package test_parser;
3074 BEGIN {
3075 push our @ISA, 'Message::Markup::XML::Parser::Base';
3076 use Message::Util::QName::General [qw/ExpandedURI/], $main::NS;
3077 }
3078
3079 sub general_entity_reference_in_attribute_value_literal_start ($$$$%) {
3080 my ($self, $src, $p, $pp, %opt) = @_;
3081 return if $pp->{ExpandedURI q<entity-opened>};
3082 for my $reptxt ($self->{ExpandedURI q<test:entity>}
3083 ->{${$pp->{ExpandedURI q<entity-name>}}}) {
3084 if (ref $reptxt eq 'HASH') {
3085 pos $reptxt->{replace} = 0 if defined $reptxt->{replace};
3086 push @{$opt{ExpandedURI q<source>}}, \($reptxt->{replace});
3087 $self->{error}->set_flag
3088 ((\$reptxt->{replace}),
3089 ExpandedURI q<is-external-entity> => $reptxt->{external});
3090 $self->{error}->set_flag
3091 ((\$reptxt->{replace}),
3092 ExpandedURI q<is-unparsed-entity> => $reptxt->{unparsed});
3093 $self->{error}->set_flag
3094 ((\$reptxt->{replace}),
3095 ExpandedURI q<is-declared-externally> => $reptxt->{externally});
3096 } elsif (ref $reptxt) {
3097 next;
3098 } elsif (not defined $reptxt) {
3099 warn "Entity ${$pp->{ExpandedURI q<entity-name>}} not defined";
3100 } else {
3101 pos $reptxt = 0;
3102 push @{$opt{ExpandedURI q<source>}}, \$reptxt;
3103 }
3104 }
3105 }
3106 BEGIN {
3107 *general_entity_reference_in_content_start
3108 = \&general_entity_reference_in_attribute_value_literal_start;
3109 *parameter_entity_reference_in_rpdata_start
3110 = \&general_entity_reference_in_attribute_value_literal_start;
3111 *parameter_entity_reference_in_subset_start
3112 = \&general_entity_reference_in_attribute_value_literal_start;
3113 *parameter_entity_reference_in_parameter_start
3114 = \&general_entity_reference_in_attribute_value_literal_start;
3115 }

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24