/[suikacvs]/messaging/manakai/lib/Message/DOM/XMLParser.dis
Suika

Contents of /messaging/manakai/lib/Message/DOM/XMLParser.dis

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.25 - (hide annotations) (download)
Wed Feb 15 15:36:16 2006 UTC (18 years, 9 months ago) by wakaba
Branch: MAIN
Changes since 1.24: +334 -16 lines
++ manakai/lib/Message/DOM/ChangeLog	15 Feb 2006 15:36:08 -0000
	* XMLParser.dis: Set |allDeclarationsProcessed|
	attribute of the |Document| node.  Don't process entity
	and attribute definition list declarations after
	unread parameter entity reference.  Warns if an attribute definition is
	ignored (|xp:warning-attribute-definition-ignored|).  Set
	flags whether predefined entities are declared or not.
	WFC error |xp:wf-pes-in-internal-subset| is implemented.

2006-02-15  Wakaba  <wakaba@suika.fam.cx>

1 wakaba 1.1 Module:
2     @QName: MDOM|XMLParser
3     @Namespace:
4     http://suika.fam.cx/~wakaba/archive/2004/dom/xml-parser#
5    
6     @FullName:
7     @@lang:en
8     @@@: XML Parser
9    
10     @DISCore:author: DISCore|Wakaba
11     @License: license|Perl+MPL
12     @Date:
13 wakaba 1.25 $Date: 2006/02/15 13:36:21 $
14 wakaba 1.1
15     @DefaultFor: ManakaiDOM|ManakaiDOMLatest
16    
17     @Require:
18     @@Module:
19     @@@QName: MDOM|DOMLS
20     @@@WithFor: ManakaiDOM|ManakaiDOMLatest
21 wakaba 1.6 @@Module:
22     @@@QName: MDOM|XDoctype
23     @@@WithFor: ManakaiDOM|ManakaiDOMLatest
24 wakaba 1.1
25     Namespace:
26 wakaba 1.8 @c:
27     http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#
28 wakaba 1.11 @cfg:
29     http://suika.fam.cx/www/2006/dom-config/
30 wakaba 1.6 @d:
31     http://suika.fam.cx/~wakaba/archive/2004/dom/xdt#
32 wakaba 1.1 @dis:
33     http://suika.fam.cx/~wakaba/archive/2004/8/18/lang#dis--
34 wakaba 1.5 @dtest:
35     http://suika.fam.cx/~wakaba/archive/2005/manakai/Util/DIS#Test/
36 wakaba 1.1 @dx:
37     http://suika.fam.cx/~wakaba/archive/2005/manakai/Util/Error/DOMException#
38     @ecore:
39     http://suika.fam.cx/~wakaba/archive/2005/manakai/Util/Error/Core/
40     @f:
41     http://suika.fam.cx/~wakaba/archive/2004/dom/feature#
42 wakaba 1.11 @fe:
43     http://suika.fam.cx/www/2006/feature/
44     @gls:
45     http://suika.fam.cx/~wakaba/archive/2004/dom/gls#
46 wakaba 1.1 @idl:
47     http://suika.fam.cx/~wakaba/archive/2004/dis/IDL#
48     @infoset:
49     http://www.w3.org/2001/04/infoset#
50     @lang:
51     http://suika.fam.cx/~wakaba/archive/2004/8/18/lang#
52     @license:
53     http://suika.fam.cx/~wakaba/archive/2004/8/18/license#
54     @LSEV:
55     http://www.w3.org/2002/DOMLS
56     @ManakaiDOM:
57     http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom#
58     @ManakaiDOMLS:
59     http://suika.fam.cx/~wakaba/archive/2004/mdom-ls#
60     @MDOM:
61     http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom#ManakaiDOM.
62     @MDOMX:
63     http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#
64 wakaba 1.11 @mn:
65     http://suika.fam.cx/~wakaba/archive/2005/manakai/Util/ManakaiNode#
66 wakaba 1.1 @rdf:
67     http://www.w3.org/1999/02/22-rdf-syntax-ns#
68     @rdfs:
69     http://www.w3.org/2000/01/rdf-schema#
70     @t:
71     http://suika.fam.cx/~wakaba/archive/2004/dom/tree#
72 wakaba 1.5 @test:
73     http://suika.fam.cx/~wakaba/archive/2004/dis/Test#
74 wakaba 1.8 @x:
75     http://suika.fam.cx/~wakaba/archive/2004/dom/xml#
76 wakaba 1.1 @xml:
77     http://www.w3.org/XML/1998/namespace
78 wakaba 1.9 @xml-dtd:
79     http://www.w3.org/TR/REC-xml
80 wakaba 1.1 @xmlns:
81     http://www.w3.org/2000/xmlns/
82     @xp:
83     http://suika.fam.cx/~wakaba/archive/2004/dom/xml-parser#
84    
85     ## -- Features
86    
87     ElementTypeBinding:
88     @Name: FeatureDef
89     @ElementType:
90     dis:ResourceDef
91     @ShadowContent:
92     @@rdf:type: f|Feature
93     @@For: =ManakaiDOM|all
94    
95     ElementTypeBinding:
96     @Name: FeatureVerDef
97     @ElementType:
98     dis:ResourceDef
99     @ShadowContent:
100     @@rdf:type: f|Feature
101    
102     ElementTypeBinding:
103     @Name: featureQName
104     @ElementType:
105     f:name
106     @ShadowContent:
107     @@ContentType: DISCore|QName
108    
109     ResourceDef:
110     @QName: DOMString
111     @AliasFor: DOMMain|DOMString
112     @For: ManakaiDOM|DOM
113    
114     ResourceDef:
115     @QName: Node
116     @AliasFor: t|Node
117     @For: ManakaiDOM|DOM
118    
119     ResourceDef:
120     @QName: Element
121     @AliasFor: t|Element
122     @For: ManakaiDOM|DOM
123    
124     ResourceDef:
125     @QName: Document
126     @AliasFor: t|Document
127     @For: ManakaiDOM|DOM
128    
129 wakaba 1.6 ResourceDef:
130     @QName: DocumentXDoctype
131     @AliasFor: d|DocumentXDoctype
132     @For: ManakaiDOM|DOM
133    
134 wakaba 1.8 ResourceDef:
135     @QName: DTDef
136     @AliasFor: d|DocumentTypeDefinition
137     @For: ManakaiDOM|DOM
138    
139     ResourceDef:
140     @QName: ETDef
141     @AliasFor: d|ElementTypeDefinition
142     @For: ManakaiDOM|DOM
143    
144     ResourceDef:
145     @QName: ATDef
146     @AliasFor: d|AttributeDefinition
147     @For: ManakaiDOM|DOM
148    
149 wakaba 1.1 ElementTypeBinding:
150     @Name: ClsDef
151     @ElementType:
152     dis:ResourceDef
153     @ShadowContent:
154     @@rdf:type:
155     @@@@: dis|MultipleResource
156     @@@ForCheck: !ManakaiDOM|ForIF !ManakaiDOM|ForClass
157     @@resourceFor:
158     @@@@: ManakaiDOM|ForClass
159     @@@ForCheck: ManakaiDOM|ManakaiDOM !=ManakaiDOM|ManakaiDOM
160     @@For: ManakaiDOM|DOM3
161     @@For: =ManakaiDOM|ManakaiDOM
162    
163     @@rdf:type:
164     @@@@: DISLang|Class
165     @@@ForCheck: ManakaiDOM|ForClass
166    
167     ElementTypeBinding:
168     @Name: ClsQName
169     @ElementType:
170     dis:QName
171     @ShadowContent:
172     @@ForCheck: ManakaiDOM|ForClass
173    
174     ElementTypeBinding:
175     @Name: ClsISA
176     @ElementType:
177     dis:ISA
178     @ShadowContent:
179     @@ForCheck: ManakaiDOM|ForClass
180    
181     ElementTypeBinding:
182     @Name: nullCase
183     @ElementType:
184     dis:ResourceDef
185     @ShadowContent:
186     @@rdf:type: ManakaiDOM|InCase
187     @@Value:
188     @@@is-null:1
189    
190     ResourceDef:
191     @QName: LSParser
192     @AliasFor: DOMLS|LSParser
193     @For: ManakaiDOM|DOM3
194    
195     ClsDef:
196     @ClsQName: ManakaiXMLParser
197    
198     @Implement: DOMLS|LSParser
199    
200     @f:implements:
201     @@@: DOMLS|LSFeature30
202     @@For: ManakaiDOM|DOM3
203    
204 wakaba 1.11 @DISLang:role: gls|ParserRole
205 wakaba 1.1
206 wakaba 1.3 @enDesc:
207     Note that the <Class::ManakaiXMLParser> reports any XML errors
208     (syntax errors and / or well-formedness constraint errors)
209     via the <IF::DOMCore:error-handler> registered to
210     the <A::DOMLS:LSParser.domConfig> object. Each error has
211     its <A::DOMCore:DOMError.severity>, either <C::DOMCore:SEVERITY_ERROR>
212     or <C::DOMCore:SEVERITY_FATAL_ERROR>. However, their semantics
213     are slight different from the ones of <QUOTE::error> and
214     <QUOTE::fatal error> in XML; in this implemenetation,
215     <C::DOMCore:SEVERITY_ERROR> implies that the parsing process
216     can effectively be continued to detect more errors while
217     <C::DOMCore:SEVERITY_FATAL_ERROR> implies that the error
218     is serious so that the result document tree and any errors
219     might be far from the ones obtained when the error would not
220     be found.
221    
222 wakaba 1.1 @Attr:
223     @@Name: domConfig
224     @@enDesc:
225     The configuration of the parser.
226    
227     @@Get:
228     @@@Type: DOMCore|DOMConfiguration
229     @@@enDesc: The DOM configuration object.
230     @@@PerlDef:
231     __CODE{DOMCore|getConfigObject::
232     $target => $self,
233     $targetHash => $self,
234     $targetType => {<IFName::LSParser>},
235     $result => $r,
236     }__;
237    
238     @Method:
239     @@ManakaiDOM:isForInternal:1
240     @@ForCheck: ManakaiDOM|ForClass
241     @@Operator: DISPerl|NewMethod
242     @@enDesc:
243     Creates a new instance of the object.
244     @@Param:
245     @@@Name: impl
246 wakaba 1.11 @@@Type: gls|GLSImplementation
247 wakaba 1.1 @@@enDesc:
248     The implementation from which the parser is created.
249     @@Param:
250     @@@Name: features
251     @@@Type: DOMString
252     @@@dis:actualType: f|FeaturesString
253     @@@enDesc:
254     The set of features requested for the parser.
255     @@Return:
256     @@@Type: DOMMain|DOMObject
257     @@@dis:actualType: LSParser
258     @@@enDesc:
259     The newly created parser.
260     @@@PerlDef:
261     $r = bless {
262     <H::DOMCore:implementation> => $impl,
263     }, $self;
264    
265     @Method:
266     @@Name: parseString
267     @@enImplNote:
268     Non-standard - to be removed
269    
270     @@Param:
271     @@@Name: sourceText
272     @@@Type: DOMString
273     @@Return:
274     @@@Type: Document
275     @@@PerlDef:
276    
277     $self->{char} = [];
278     $self->{token} = [];
279 wakaba 1.6 $self->{entity} = [{
280     reptxt => \$sourceText,
281     line => 1,
282     column => 1,
283     pos => 0,
284     }];
285 wakaba 1.14 $self->{location} = $self->{entity}->[-1];
286 wakaba 1.6 $self->{entity_char} = [];
287     $self->{entity_token} = [];
288 wakaba 1.3 $self->{xml_version} = '1.0';
289     $self->{standalone} = false;
290 wakaba 1.19 $self->{has_xref} = false;
291 wakaba 1.11 $self->{general_entity} = {
292     lt => {is_predefined => true},
293     gt => {is_predefined => true},
294     amp => {is_predefined => true},
295     quot => {is_predefined => true},
296     apos => {is_predefined => true},
297     };
298 wakaba 1.6 $self->{param_entity} = {};
299 wakaba 1.9 $self->{attr} = {};
300     # $self->{attr}->{$element_type_name}->{$attr_name} = $attr_def
301 wakaba 1.25 $self->{dont_process} = false;
302     ## Don't process |ENTITY| and |ATTLIST| declarations.
303 wakaba 1.1
304     __DEEP{
305 wakaba 1.11 $r = $self->{<H::c|implementation>}-><M::DOMImpl.createDocument>;
306     $self->{doc} = $r;
307 wakaba 1.21 $self->{doc_cfg} = $r-><AG::Document.domConfig>;
308 wakaba 1.11 CORE::delete $self->{docx};
309     CORE::delete $self->{dtdef};
310 wakaba 1.17 CORE::delete $self->{dtdecl};
311 wakaba 1.21
312     $r-><AS::Document.strictErrorChecking> (false);
313     ## NOTE: Any checks such as |Name| validity done by
314     ## methods on DOM nodes are disabled. It might result
315     ## in creating an ill-formed DOM tree when parser
316     ## errors are traped by |error-handler|.
317     $self->{doc_cfg}-><M::c|DOMConfiguration.setParameter>
318     (<Q::cfg|entity-reference-read-only> => false);
319     ## NOTE: Turn this configuration parameter off is required
320     ## because entity reference subtree is created by
321     ## the parser rather than |createEntityReference|'s
322     ## cloning. Parser's |cfg:entity-reference-read-only|
323     ## configuration parameter controls whether generated
324     ## subtree is then marked as read-only or not.
325     $self->{doc_cfg}-><M::c|DOMConfiguration.setParameter>
326     (<Q::cfg|clone-entity-reference-subtree> => true);
327     ## NOTE: Turn this configuration parameter on makes
328     ## entity reference subtrees in attribute default values
329     ## cloned as is into default attribute node subtrees.
330 wakaba 1.11
331     ## Document entity -> |Document| node
332     $self->_parse_DocumentEntity;
333    
334     ## Replacement tree for general |Entity| nodes
335 wakaba 1.20 my @ent = values %{$self->{general_entity}};
336     for my $ent (@ent) {
337     if (exists $ent->{has_replacement_text}) {
338 wakaba 1.11 my $ent_name = $ent->{name};
339     $self->{entity} = [<Code::getCopyOfEntityState::
340     $entity_type = 'general_entity',
341     $entity_name = $ent_name>];
342 wakaba 1.14 $self->{location} = $self->{entity}->[-1];
343 wakaba 1.11 $self->{token} = [];
344     $self->{char} = [];
345 wakaba 1.23 local $ent->{is_opened} = true;
346 wakaba 1.11 ## TODO: External entity support
347     $self->_parse_InternalGeneralParsedEntity ($ent->{node});
348     $ent->{node}-><AS::x|Entity.hasReplacementTree> (true);
349 wakaba 1.21 ## ISSUE: Should errors detected by this phase result
350     ## in |DOMLS:PARSE_ERR| exception thrown?
351 wakaba 1.20 }
352 wakaba 1.11 ## TODO: Read-only if configuration (for all entities)
353     }
354    
355 wakaba 1.21 ## Turns flags to their default value
356     $self->{doc_cfg}-><M::c|DOMConfiguration.setParameter>
357     (<Q::cfg|entity-reference-read-only> => null);
358     $self->{doc_cfg}-><M::c|DOMConfiguration.setParameter>
359     (<Q::cfg|clone-entity-reference-subtree> => null);
360 wakaba 1.11 $r-><AS::Document.strictErrorChecking> (true);
361 wakaba 1.1 }__;
362    
363     @Method:
364     @@Name: shiftChar
365     @@ManakaiDOM:isForInternal:1
366     @@ForCheck: ManakaiDOM|ForClass
367     @@enDesc:
368     Returns the next character.
369     @@Return:
370     @@@Type: idl|long||ManakaiDOM|all
371     @@@enDesc:
372     The code position number of the next character, if any,
373 wakaba 1.6 or <CODE::-1>.
374 wakaba 1.1 @@@PerlDef:
375     if (@{$self->{char}}) {
376     $r = shift @{$self->{char}};
377     } else {
378 wakaba 1.7 no warnings 'substr';
379     ## substr outside length warnings at the end of the string
380 wakaba 1.6 GETCHAR: {
381     my $char = substr (${$self->{entity}->[-1]->{reptxt}},
382     $self->{entity}->[-1]->{pos}, 1);
383    
384 wakaba 1.7 if (defined $char and length $char) {
385 wakaba 1.13 $self->{entity}->[-1]->{pos}++;
386 wakaba 1.6 $r = ord $char;
387     if ($r == 0x000A) {
388     $self->{entity}->[-1]->{line}++;
389     $self->{entity}->[-1]->{column} = 1;
390     } elsif ($r == 0x000D) {
391     my $next_char = substr (${$self->{entity}->[-1]->{reptxt}},
392     $self->{entity}->[-1]->{pos}, 1);
393     if ($next_char eq "\x0A") {
394     $self->{entity}->[-1]->{pos}++;
395 wakaba 1.13 $self->{entity}->[-1]->{line}++;
396 wakaba 1.6 $self->{entity}->[-1]->{column} = 1;
397     } elsif ($next_char eq "\x85") {
398     if ($self->{xml_version} eq '1.1') {
399 wakaba 1.16 if ($self->{entity}->[-1]->{no_xml11_eol}) {
400     my $location = {
401     utf32_offset => $self->{entity}->[-1]->{pos} - 1,
402     line_number => $self->{entity}->[-1]->{line},
403     column_number => $self->{entity}->[-1]->{column},
404     };
405     my $continue = __DOMCore:ERROR{
406     xp|fatal-xml11-end-of-line-in-xml-declaration::
407     DOMCore|location => {$location},
408     xp|character-number => {$r},
409     }__;
410     unless ($continue) {
411     __EXCEPTION{DOMLS|PARSE_ERR}__;
412     }
413     } # no_xml11_eol
414 wakaba 1.6 $self->{entity}->[-1]->{pos}++;
415 wakaba 1.13 $self->{entity}->[-1]->{line}++;
416 wakaba 1.6 $self->{entity}->[-1]->{column} = 1;
417     } else {
418 wakaba 1.16 ## |no_xml11_eol| will be tested later.
419 wakaba 1.13 $self->{entity}->[-1]->{column}++;
420     ## Line number will be increased by next |shiftChar| call.
421 wakaba 1.6 }
422 wakaba 1.3 } else {
423 wakaba 1.13 $self->{entity}->[-1]->{line}++;
424 wakaba 1.6 $self->{entity}->[-1]->{column} = 1;
425     }
426     $r = 0x000A;
427     } elsif (
428     not ((0x0020 <= $r and $r <= 0x007E) or
429     (0x00A0 <= $r and $r <= 0xD7FF) or
430     (0xE000 <= $r and $r <= 0xFFFD) or
431     (0x10000 <= $r and $r <= 0x10FFFF)) and
432     $r != 0x0009 and $r != 0x0085 and
433     not ($self->{xml_version} eq '1.0' and
434     (0x007F <= $r and $r <= 0x009F))
435     ) {
436     my $location = {
437 wakaba 1.13 utf32_offset => $self->{entity}->[-1]->{pos} - 1,
438 wakaba 1.6 line_number => $self->{entity}->[-1]->{line},
439     column_number => $self->{entity}->[-1]->{column},
440     };
441     my $continue = __DOMCore:ERROR{xp|wf-legal-literal-character::
442     DOMCore|location => {$location},
443     xp|character-number => {$r},
444     }__;
445     unless ($continue) {
446     __EXCEPTION{DOMLS|PARSE_ERR}__;
447 wakaba 1.3 }
448 wakaba 1.6 $self->{entity}->[-1]->{column}++;
449     } elsif ($r == 0x0085 or $r == 0x2028) {
450 wakaba 1.16 if ($self->{entity}->[-1]->{no_xml11_eol}) {
451     my $location = {
452     utf32_offset => $self->{entity}->[-1]->{pos} - 1,
453     line_number => $self->{entity}->[-1]->{line},
454     column_number => $self->{entity}->[-1]->{column},
455     };
456     my $continue = __DOMCore:ERROR{
457     xp|fatal-xml11-end-of-line-in-xml-declaration::
458     DOMCore|location => {$location},
459     xp|character-number => {$r},
460     }__;
461     unless ($continue) {
462     __EXCEPTION{DOMLS|PARSE_ERR}__;
463     }
464     } # no_xml11_eol
465 wakaba 1.6 $r = 0x000A if $self->{xml_version} eq '1.1';
466 wakaba 1.13 ## Even in XML 1.0 it increases the line number.
467 wakaba 1.6 $self->{entity}->[-1]->{line}++;
468     $self->{entity}->[-1]->{column} = 1;
469 wakaba 1.3 } else {
470 wakaba 1.6 $self->{entity}->[-1]->{column}++;
471 wakaba 1.3 }
472     } else {
473 wakaba 1.6 $r = -1;
474 wakaba 1.3 }
475 wakaba 1.6 } # GETCHAR
476 wakaba 1.1 }
477    
478     @Method:
479     @@ManakaiDOM:isForInternal: 1
480     @@Operator: ManakaiDOM|MUErrorHandler
481     @@enDesc:
482     When a <IF::ecore|ErrorInterface||ManakaiDOM|Perl> is <Perl::report>ed,
483     then this method is invoked.
484    
485     The method calls the <cfg::DOMCore|error-handler> if the error is of
486     <IF::DOMCore|DOMError>. Otherwise, the error is re-thrown so that
487     corresponding <Perl::catch> clause, if any, can catch the error.
488     @@Param:
489     @@@Name: err
490     @@@Type: ecore|ErrorInterface||ManakaiDOM|Perl
491     @@@enDesc:
492     The reported error object.
493     @@Return:
494     @@@Type: DISPerl|Any
495     @@@enDesc:
496     If the <P::err> is a <IF::DOMCore|DOMError>, then the return value
497     of the error handler.
498    
499     {NOTE:: If the error is thrown, the method never returns.
500     }
501     @@@nullCase:
502     @@@@enDesc:
503     No error handler.
504     @@@PerlDef:
505     if ($err->isa (<IFName::DOMCore|DOMError||ManakaiDOM|ManakaiDOM>)) {
506     __DEEP{
507     A: {
508     my $cfg = $self-><AG::LSParser.domConfig>;
509     my $h = $cfg-><M::DOMCore|DOMConfiguration.getParameter>
510     ('error-handler');
511     $r = $h-><M::DOMCore|DOMErrorHandler.handleError> ($err);
512     } # A
513     }__;
514     } else {
515     $err-><M::ecore|ErrorInterface||ManakaiDOM|Perl.throw>;
516     }
517    
518     @DISPerl:dpgDef:
519    
520     /*
521     XML Document Entity
522    
523     document := prolog element *Misc
524     - *Char RestrictedChar *Char ;; [1]
525     */
526 wakaba 1.11 rule DocumentEntity : standalone {
527 wakaba 1.1 /*
528     prolog := XMLDecl? *Misc [doctypedecl *Misc] ;; [22]
529     */
530 wakaba 1.16 ?lexmode DocumentStart;
531 wakaba 1.11
532     my $doc;
533     lang:Perl {
534     $doc = $self->{doc};
535     }
536 wakaba 1.1
537 wakaba 1.3 ~? (XDO) {
538 wakaba 1.16 ?lexmode XMLDeclarationOrPI;
539     lang:Perl {
540     $self->{entity}->[-1]->{no_xml11_eol} = true;
541     }
542     ~ (S) { // XML declaration
543     &_XMLDeclaration_ ($doc => $doc);
544     ~ (PIC2) {
545     ?lexmode DocumentProlog;
546     } else {
547     ?lexmode DocumentProlog;
548     }
549     } (NameChar) { // Processing instruction whose target begins with |xml|
550     my $target_token;
551     lang:Perl ($v => $token.value) {
552     $target_token = $token;
553     $target_token->{value} = 'xml'.$target_token->{value};
554     $self->{entity}->[-1]->{no_xml11_eol} = false;
555     }
556     ?lexmode PINmtoken;
557     ~? (Nmtoken) {
558     lang:Perl ($v => $token.value) {
559     $target_token->{value} .= $v;
560     }
561     ?lexmode PIName;
562     }
563     lang:Perl {
564     $target_token->{type} = 'Name';
565     $target_token->{location_d} += 3; # 'xml'
566     unshift @{$self->{token}}, $token;
567     $token = $target_token;
568     }
569     &_ProcessingInstruction_ ($doc => $doc, $parent => $doc);
570     ~ (PIC) {
571     ?lexmode DocumentProlog;
572     } else {
573     ?lexmode DocumentProlog;
574     }
575 wakaba 1.3 } else {
576 wakaba 1.16 lang:Perl {
577     $self->{entity}->[-1]->{no_xml11_eol} = false;
578     }
579 wakaba 1.3 }
580     } else {
581     ?lexmode 'DocumentProlog';
582     }
583 wakaba 1.1
584     // *Misc
585 wakaba 1.2 ~* (CDO) {
586 wakaba 1.1 &_CommentDeclaration_ ($doc => $doc, $parent => $doc);
587    
588     ~ (MDC) {
589     ?lexmode DocumentProlog;
590     } else {
591     ?lexmode DocumentProlog;
592     }
593     } (PIO) {
594     &_ProcessingInstruction_ ($doc => $doc, $parent => $doc);
595    
596     ~ (PIC) {
597     ?lexmode 'DocumentProlog';
598     } else {
599     ?lexmode DocumentProlog;
600     }
601     } (S) {
602     //
603     }
604    
605     // doctypedecl
606     ~? (MDO) {
607     &_DocumentTypeDeclaration_ ($doc => $doc);
608    
609 wakaba 1.3 ~ (MDC) {
610     ?lexmode DocumentMisc;
611     } else {
612     ?lexmode DocumentMisc;
613     }
614     } else {
615     ?lexmode DocumentMisc;
616 wakaba 1.1 }
617 wakaba 1.25
618     lang:Perl {
619     $self->{doc}-><AS::Document.allDeclarationsProcessed> (true)
620     unless $self->{dont_process};
621     }
622 wakaba 1.1
623     // *Misc
624 wakaba 1.2 ~* (CDO) {
625 wakaba 1.1 &_CommentDeclaration_ ($doc => $doc, $parent => $doc);
626    
627     ~ (MDC) {
628     ?lexmode DocumentMisc;
629     } else {
630     ?lexmode DocumentMisc;
631     }
632     } (PIO) {
633     &_ProcessingInstruction_ ($doc => $doc, $parent => $doc);
634    
635     ~ (PIC) {
636     ?lexmode 'DocumentMisc';
637     } else {
638     ?lexmode DocumentMisc;
639     }
640     } (S) {
641     //
642     }
643    
644     // Document element
645     ~ (STAGO) {
646     &Element_ ($doc => $doc, $parent => $doc)
647     : unshift-current-token;
648     ~ (TAGC) {
649     ?lexmode DocumentEnd;
650     } else {
651     ?lexmode DocumentEnd;
652     }
653     } else {
654     ?lexmode 'DocumentEnd';
655     }
656    
657     // *Misc
658 wakaba 1.2 ~* (CDO) {
659 wakaba 1.1 &_CommentDeclaration_ ($doc => $doc, $parent => $doc);
660    
661     ~ (MDC) {
662     ?lexmode DocumentEnd;
663     } else {
664     ?lexmode DocumentEnd;
665     }
666     } (PIO) {
667     &_ProcessingInstruction_ ($doc => $doc, $parent => $doc);
668     ~ (PIC) {
669     ?lexmode 'DocumentEnd';
670     } else {
671     ?lexmode DocumentEnd;
672     }
673     } (S) {
674     //
675     }
676    
677     ~ (#EOF) { }
678     } // DocumentEntity
679 wakaba 1.11
680     /*
681     Internal General Parsed Entity
682    
683     An internal general parsed entity is well-formed if its
684     replacement text matches the production labeled |content|.
685     */
686     rule InternalGeneralParsedEntity ($ent) : standalone {
687     ?lexmode ElementContent;
688    
689     my $ns;
690     lang:Perl {
691     $ns = {
692     xml => <Q::xml:>,
693     xmlns => <Q::xmlns:>,
694     };
695     }
696    
697     &content ($parent => $ent, $ns => $ns);
698    
699     ~ (#EOF) { }
700     } // InternalGeneralParsedEntity
701    
702 wakaba 1.1 /*
703     XML Declaration
704    
705     XMLDecl := '<?xml' VersionInfo
706     [EncodingDecl]
707     [SDDecl]
708     [S] '?>' ;; [23]
709    
710     NOTE: XML declaration is optional in XML 1.0
711     while it is required in XML 1.1.
712     */
713 wakaba 1.16 rule _XMLDeclaration_ {
714     // ~ (XDO) { }
715 wakaba 1.3 ?lexmode XMLDeclaration;
716 wakaba 1.16 //lang:Perl {
717     // $self->{entity}->[-1]->{no_xml11_eol} = true;
718     //}
719     //~ (S) { }
720 wakaba 1.3
721     ~ (Name == 'version') {
722     ~? (S) { }
723     ~ (VI) { }
724     ~? (S) { }
725 wakaba 1.1
726 wakaba 1.3 my $ver;
727     my $bad_token;
728    
729     ~ (LIT) {
730     ?lexmode AttributeValueLiteral;
731    
732     ~ (STRING) {
733     lang:Perl ($version => $token.value) {
734     $ver = $version;
735     $bad_token = $token;
736     }
737     }
738    
739     ~ (LIT) {
740     ?lexmode XMLDeclaration;
741     }
742     } (LITA) {
743     ?lexmode AttributeValueLiteralA;
744    
745     ~ (STRING) {
746     lang:Perl ($version => $token.value) {
747     $ver = $version;
748     $bad_token = $token;
749     }
750     }
751    
752     ~ (LITA) {
753     ?lexmode XMLDeclaration;
754     }
755     }
756    
757     lang:Perl : has-error {
758     unless ($ver eq '1.0' or $ver eq '1.1') {
759     my $location;
760     __CODE{xp|get-location-from-token::
761     $token => {$bad_token},
762     $result => {$location},
763     }__;
764     my $continue = __DOMCore:ERROR{xp|wf-unsupported-xml-version::
765     DOMCore|location => {$location},
766 wakaba 1.16 xp|parent => {$self->{doc}},
767 wakaba 1.3 infoset|version => {$ver},
768     xp|error-token => {$bad_token},
769     }__;
770     unless ($continue) {
771     __EXCEPTION{DOMLS|PARSE_ERR}__;
772     }
773     }
774 wakaba 1.16 $self->{doc}-><AS::Document.xmlVersion> ($ver);
775 wakaba 1.3 $self->{xml_version} = $ver;
776     }
777    
778     ~? (S) { }
779 wakaba 1.1 }
780    
781 wakaba 1.3 ~? (Name == 'encoding') {
782     ~? (S) { }
783     ~ (VI) { }
784     ~? (S) { }
785    
786     my $ver;
787     my $bad_token;
788    
789     ~ (LIT) {
790     ?lexmode AttributeValueLiteral;
791    
792     ~ (STRING) {
793     lang:Perl ($version => $token.value) {
794     $ver = $version;
795     $bad_token = $token;
796     }
797     }
798    
799     ~ (LIT) {
800     ?lexmode XMLDeclaration;
801     }
802     } (LITA) {
803     ?lexmode AttributeValueLiteralA;
804    
805     ~ (STRING) {
806     lang:Perl ($version => $token.value) {
807     $ver = $version;
808     $bad_token = $token;
809     }
810     }
811    
812     ~ (LITA) {
813     ?lexmode XMLDeclaration;
814     }
815     }
816    
817     lang:Perl : has-error {
818     unless ($ver =~ /\A[A-Za-z][A-Za-z0-9._-]*\z/) {
819     my $location;
820     __CODE{xp|get-location-from-token::
821     $token => {$bad_token},
822     $result => {$location},
823     }__;
824     my $continue = __DOMCore:ERROR{xp|wf-malformed-enc-name::
825     DOMCore|location => {$location},
826 wakaba 1.16 xp|parent => {$self->{doc}},
827 wakaba 1.3 xp|name => {$ver},
828     xp|error-token => {$bad_token},
829     }__;
830     unless ($continue) {
831     __EXCEPTION{DOMLS|PARSE_ERR}__;
832     }
833     }
834 wakaba 1.16 $self->{doc}-><AS::Document.xmlEncoding> ($ver);
835 wakaba 1.3 }
836    
837     ~? (S) { }
838 wakaba 1.1 }
839 wakaba 1.3
840     ~? (Name == 'standalone') {
841     ~? (S) { }
842     ~ (VI) { }
843     ~? (S) { }
844    
845     my $ver;
846     my $bad_token;
847    
848     ~ (LIT) {
849     ?lexmode AttributeValueLiteral;
850    
851     ~ (STRING) {
852     lang:Perl ($version => $token.value) {
853     $ver = $version;
854     $bad_token = $token;
855     }
856     }
857    
858     ~ (LIT) {
859     ?lexmode XMLDeclaration;
860     }
861     } (LITA) {
862     ?lexmode AttributeValueLiteralA;
863    
864     ~ (STRING) {
865     lang:Perl ($version => $token.value) {
866     $ver = $version;
867     $bad_token = $token;
868     }
869     }
870 wakaba 1.1
871 wakaba 1.3 ~ (LITA) {
872     ?lexmode XMLDeclaration;
873     }
874     }
875    
876     lang:Perl : has-error {
877     unless ($ver eq 'yes' or $ver eq 'no') {
878     my $location;
879     __CODE{xp|get-location-from-token::
880     $token => {$bad_token},
881     $result => {$location},
882     }__;
883     my $continue = __DOMCore:ERROR{xp|wf-malformed-xml-standalone::
884     DOMCore|location => {$location},
885 wakaba 1.16 xp|parent => {$self->{doc}},
886 wakaba 1.3 xp|name => {$ver},
887     xp|error-token => {$bad_token},
888     }__;
889     unless ($continue) {
890     __EXCEPTION{DOMLS|PARSE_ERR}__;
891     }
892     }
893 wakaba 1.13 if ($ver eq 'yes') {
894 wakaba 1.16 $self->{doc}-><AS::Document.xmlStandalone> (true);
895 wakaba 1.13 $self->{standalone} = true;
896     }
897 wakaba 1.3 }
898    
899     ~? (S) { }
900     }
901    
902 wakaba 1.16 ~ (PIC1) {
903     lang:Perl {
904     $self->{entity}->[-1]->{no_xml11_eol} = false;
905     }
906     } else {
907     lang:Perl {
908     $self->{entity}->[-1]->{no_xml11_eol} = false;
909     }
910     }
911    
912     // ~ (PIC2) { }
913 wakaba 1.3 } // _XMLDeclaration_
914 wakaba 1.1
915     /*
916     Comment Declaration
917    
918     Comment := '<!--' *(Char - '-' / '-' (Char - '-'))
919     '-->' ;; [15]
920 wakaba 1.4 */
921 wakaba 1.1 rule _CommentDeclaration_ ($doc, $parent) {
922     ?lexmode 'CommentDeclaration';
923    
924     ~? (STRING) {
925     lang:Perl ($data => $token.value) {
926     my $com = $doc-><M::Document.createComment> ($data);
927     $parent-><M::Node.appendChild> ($com);
928     }
929     } else {
930     lang:Perl {
931     my $com = $doc-><M::Document.createComment> ('');
932     $parent-><M::Node.appendChild> ($com);
933     }
934     }
935    
936     ~ (COM) {
937     ?lexmode MarkupDeclaration;
938     } else {
939     ?lexmode MarkupDeclaration;
940     }
941    
942     // ~ (MDC) { }
943 wakaba 1.4 } // _CommentDeclaration
944 wakaba 1.15
945     rule _CommentDeclarationDTD {
946     ?lexmode CommentDeclaration;
947 wakaba 1.4
948     ~? (STRING) {
949     //
950     }
951    
952     ~ (COM) {
953     ?lexmode MarkupDeclaration;
954     } else {
955     ?lexmode MarkupDeclaration;
956     }
957    
958     ~ (MDC) {
959     ?lexmode DTD;
960     } else {
961     ?lexmode DTD;
962     }
963     } // _CommentDeclarationDTD
964    
965 wakaba 1.1 /*
966     Processing Instruction
967    
968     PI := '<?' PITarget [S *Char - *Char '?>' *Char]
969     '?>' ;; [16]
970     */
971     rule _ProcessingInstruction_ ($doc, $parent) {
972     ?lexmode 'PIName';
973    
974     my $pi;
975    
976     ~ (Name) {
977 wakaba 1.3 lang:Perl ($name => $token.value) : has-error {
978 wakaba 1.1 if (lc $name eq 'xml') {
979 wakaba 1.3 my $location;
980     __CODE{xp|get-location-from-token::
981     $token => {$token},
982     $result => {$location},
983     }__;
984     my $continue = __DOMCore:ERROR{xp|wf-pi-target-is-xml::
985     xp|name => {$name},
986     DOMCore|location => {$location},
987     xp|parent => {$parent},
988     }__;
989     unless ($continue) {
990     __EXCEPTION{DOMLS|PARSE_ERR::
991     }__;
992     }
993 wakaba 1.1 }
994     ## TODO: Namespace well-formedness
995     $pi = $doc-><M::Document.createProcessingInstruction>
996     ($name);
997     }
998 wakaba 1.14 } else {
999     lang:Perl {
1000     $pi = $doc-><M::Document.createProcessingInstruction> ('#INVALID');
1001     }
1002 wakaba 1.1 }
1003    
1004 wakaba 1.14 ~? (S) {
1005 wakaba 1.1 ?lexmode 'PIData';
1006    
1007     my $tdata;
1008    
1009     ~? (DATA) {
1010     lang:Perl ($data => $token.value) {
1011     $tdata = $data;
1012     }
1013     } else {
1014     lang:Perl {
1015     $tdata = '';
1016     }
1017     }
1018    
1019     lang:Perl {
1020     $pi-><AS::Node.nodeValue> ($tdata);
1021     }
1022     }
1023    
1024     lang:Perl {
1025     $parent-><M::Node.appendChild> ($pi);
1026     }
1027    
1028     // ~ (PIC) { }
1029     } // _ProcessingInstruction_
1030 wakaba 1.4
1031 wakaba 1.6 /*
1032     Processing instruction in DTD
1033     */
1034     rule _ProcessingInstructionDTD ($doc, $doctype) {
1035 wakaba 1.4 ?lexmode 'PIName';
1036 wakaba 1.6
1037     my $pi;
1038 wakaba 1.4
1039     ~ (Name) {
1040 wakaba 1.6 lang:Perl ($name => $token.value) : has-error {
1041     if (lc $name eq 'xml') {
1042     my $location;
1043     __CODE{xp|get-location-from-token::
1044     $token => {$token},
1045     $result => {$location},
1046     }__;
1047     my $continue = __DOMCore:ERROR{xp|wf-pi-target-is-xml::
1048     xp|name => {$name},
1049     DOMCore|location => {$location},
1050     xp|parent => {$doctype},
1051     }__;
1052     unless ($continue) {
1053     __EXCEPTION{DOMLS|PARSE_ERR::
1054     }__;
1055     }
1056     }
1057     ## TODO: Namespace well-formedness
1058     $pi = $doc-><M::Document.createProcessingInstruction>
1059     ($name);
1060     }
1061 wakaba 1.14 } else {
1062     lang:Perl {
1063     $pi = $doc-><M::Document.createProcessingInstruction> ('#INVALID');
1064     }
1065 wakaba 1.4 }
1066    
1067 wakaba 1.14 ~? (S) {
1068 wakaba 1.4 ?lexmode 'PIData';
1069    
1070 wakaba 1.6 my $tdata;
1071    
1072 wakaba 1.4 ~? (DATA) {
1073 wakaba 1.6 lang:Perl ($data => $token.value) {
1074     $tdata = $data;
1075     }
1076     } else {
1077     lang:Perl {
1078     $tdata = '';
1079     }
1080     }
1081    
1082     lang:Perl {
1083     $pi-><AS::Node.nodeValue> ($tdata);
1084 wakaba 1.4 }
1085     }
1086    
1087 wakaba 1.6 lang:Perl {
1088     $doctype-><M::Node.appendChild> ($pi);
1089     }
1090    
1091 wakaba 1.4 ~ (PIC) {
1092     ?lexmode DTD;
1093     } else {
1094     ?lexmode DTD;
1095     }
1096     } // _ProcessingInstructionDTD
1097 wakaba 1.1
1098     /*
1099     Element content parsing mode
1100    
1101     element := EmptyElemTag /
1102     STag content ETag ;; [39]
1103     content := (CharData / element / Reference / CDSect /
1104     PI / Comment) ;; [43]
1105     */
1106 wakaba 1.6 rule Element_ ($doc, $parent, $ns) : standalone {
1107 wakaba 1.1 ?lexmode 'ElementContent';
1108    
1109     my $node; // Current "parent" node
1110     my $nodes; // Node stack (w/o $current_node)
1111     my $type; // Current "parent" element type QName
1112     my $types; // Element type stack (w/o $current_type)
1113 wakaba 1.6 //my $ns; // Current in-scope namespace bindings
1114 wakaba 1.1 my $nses; // Namespace binding stack (w/o $current_ns)
1115    
1116     lang:Perl {
1117     $node = $parent;
1118     $nodes = [];
1119     $type = '';
1120     $types = [];
1121 wakaba 1.6 $ns ||= {
1122 wakaba 1.1 xml => <Q::xml:>,
1123     xmlns => <Q::xmlns:>,
1124     };
1125     $nses = [];
1126     }
1127    
1128     ~* : name => CONTENT
1129     (CharData) {
1130     // Character data
1131     lang:Perl ($data => $token.value) {
1132     $node-><M::Node.appendChild>
1133     ($doc-><M::Document.createTextNode> ($data));
1134     }
1135     } (STAGO) {
1136     // Start tag or empty element tag
1137    
1138     ?lexmode 'StartTag';
1139    
1140     ~ (Name) {
1141     my $attrs;
1142     lang:Perl ($name => $token.value) {
1143     push @{$types}, $type;
1144     $type = $name;
1145     $attrs = {};
1146     }
1147    
1148     ~? (S) {
1149     &AttributeSpecificationList
1150     ($doc => $doc, $attrs => $attrs);
1151     }
1152    
1153     my $el;
1154 wakaba 1.9
1155     /*
1156     Note that this implementation does not perform
1157     attribute value tokenization (but does white space
1158     normalization common to attribute types) and
1159     construct the tree as is. DOM Level 3 Core spec
1160     is unclear on this point. With tokenization,
1161     entity references cannot be preserved.
1162    
1163     The manakai Node.nodeValue and Attr.value attributes
1164     do tokenization according to attribute types.
1165     */
1166    
1167     /*
1168     ISSUE: Should |xml:id| attribute be typed?
1169     */
1170 wakaba 1.1
1171     lang:Perl {
1172     push @{$nses}, $ns;
1173     $ns = {%$ns};
1174    
1175     my %gattr;
1176     my %lattr;
1177     for my $atqname (keys %$attrs) {
1178     my ($pfx, $lname) = split /:/, $atqname;
1179 wakaba 1.9 $attrs->{$atqname}->{def} = $self->{attr}->{$type}->{$atqname};
1180 wakaba 1.1 if (defined $lname) { ## Global attribute
1181     ## TODO: Namespace well-formedness (lname is NCName)
1182     if ($pfx eq 'xmlns') {
1183     my $nsuri = $attrs->{$atqname}->{value};
1184     if ($lname eq 'xml' and
1185     $nsuri ne <Q::xml:>) {
1186     ## TODO: error
1187     } elsif ($lname eq 'xmlns') {
1188     ## TODO: error
1189     }
1190     if ($nsuri eq '') {
1191     ## TODO: error in XML 1.0
1192     } elsif ($nsuri eq <Q::xml:> and
1193     $lname ne 'xml') {
1194     ## TODO: error
1195     } elsif ($nsuri eq <Q::xmlns:>) {
1196     ## TODO: error
1197     }
1198     $ns->{$lname} = $attrs->{$atqname}->{value};
1199 wakaba 1.9 if ($attrs->{$atqname}->{def}) {
1200     my $dt = $attrs->{$atqname}->{def}-><AG::ATDef.declaredType>;
1201     if ({
1202     <C::ATDef.ID_ATTR> => true,
1203     <C::ATDef.IDREF_ATTR> => true,
1204     <C::ATDef.IDREFS_ATTR> => true,
1205     <C::ATDef.ENTITY_ATTR> => true,
1206     <C::ATDef.ENTITIES_ATTR> => true,
1207     <C::ATDef.NMTOKEN_ATTR> => true,
1208     <C::ATDef.NMTOKENS_ATTR> => true,
1209     <C::ATDef.NOTATION_ATTR> => true,
1210     <C::ATDef.ENUMERATION_ATTR> => true,
1211     }->{$dt}) {
1212     ## Tokenization (XML 1 3.3.3)
1213     for ($ns->{$lname}) {
1214     s/^\x20+//;
1215     s/\x20+\z//;
1216     s/\x20+/ /g;
1217     }
1218     }
1219     }
1220 wakaba 1.1 delete $ns->{$lname} unless length $ns->{$lname};
1221     } elsif ($pfx eq '') {
1222     ## TODO: pfx is not NCName error
1223     } else {
1224     if ($gattr{$pfx}->{$lname}) {
1225     ## TODO: Namespace well-formedness error
1226     }
1227     }
1228     $gattr{$pfx}->{$lname} = $attrs->{$atqname};
1229     } else { ## Local attribute
1230     if ($pfx eq 'xmlns') {
1231     $ns->{''} = $attrs->{xmlns}->{value};
1232 wakaba 1.9 if ($attrs->{$atqname}->{def}) {
1233     my $dt = $attrs->{$atqname}->{def}-><AG::ATDef.declaredType>;
1234     if ({
1235     <C::ATDef.ID_ATTR> => true,
1236     <C::ATDef.IDREF_ATTR> => true,
1237     <C::ATDef.IDREFS_ATTR> => true,
1238     <C::ATDef.ENTITY_ATTR> => true,
1239     <C::ATDef.ENTITIES_ATTR> => true,
1240     <C::ATDef.NMTOKEN_ATTR> => true,
1241     <C::ATDef.NMTOKENS_ATTR> => true,
1242     <C::ATDef.NOTATION_ATTR> => true,
1243     <C::ATDef.ENUMERATION_ATTR> => true,
1244     }->{$dt}) {
1245     ## Tokenization (XML 1 3.3.3)
1246     for ($ns->{''}) {
1247     s/^\x20+//;
1248     s/\x20+\z//;
1249     s/\x20+/ /g;
1250     }
1251     }
1252     }
1253 wakaba 1.1 delete $ns->{''} unless length $ns->{''};
1254     } else {
1255     $lattr{$pfx} = $attrs->{$atqname};
1256     }
1257     }
1258     }
1259    
1260     my ($pfx, $lname) = split /:/, $type;
1261     my $nsuri;
1262     ## TODO: lname is NCName?
1263     if (defined $lname) { ## Prefixed namespace
1264     if ($pfx eq '') {
1265     ## TODO: pfx is not NCName error
1266     }
1267     if (defined $ns->{$pfx}) {
1268     $nsuri = $ns->{$pfx};
1269     } else {
1270     ## TODO: namespace ill-formed
1271     }
1272     } else { ## Default namespace
1273     $nsuri = $ns->{''};
1274     }
1275    
1276     $el = $doc-><M::Document.createElementNS>
1277     ($nsuri, $type);
1278    
1279     if ($attrs->{xmlns}) {
1280     my $attr = $doc-><M::Document.createAttributeNS>
1281     (<Q::xmlns:>, 'xmlns');
1282     for (@{$attrs->{xmlns}->{nodes}}) {
1283     $attr-><M::Node.appendChild> ($_);
1284     }
1285 wakaba 1.9 if ($attrs->{xmlns}->{def}) {
1286     __CODE{t|setAttrType::
1287     $attr => $attr,
1288     $type => {$attrs->{xmlns}->{def}-><AG::ATDef.declaredType>},
1289     }__;
1290     }
1291 wakaba 1.1 $el-><M::Element.setAttributeNodeNS> ($attr);
1292     }
1293    
1294     for my $lname (keys %lattr) {
1295     my $attr = $doc-><M::Document.createAttributeNS>
1296     (null, $lname);
1297     for (@{$lattr{$lname}->{nodes}}) {
1298     $attr-><M::Node.appendChild> ($_);
1299     }
1300 wakaba 1.9 if ($attrs->{$lname}->{def}) {
1301     __CODE{t|setAttrType::
1302     $attr => $attr,
1303     $type => {$attrs->{$lname}->{def}-><AG::ATDef.declaredType>},
1304     }__;
1305     }
1306 wakaba 1.1 $el-><M::Element.setAttributeNodeNS> ($attr);
1307     }
1308    
1309     for my $pfx (keys %gattr) {
1310     for my $lname (keys %{$gattr{$pfx}}) {
1311     my $attr = $doc-><M::Document.createAttributeNS>
1312     ($ns->{$pfx}, $pfx.':'.$lname);
1313     for (@{$gattr{$pfx}->{$lname}->{nodes}}) {
1314     $attr-><M::Node.appendChild> ($_);
1315     }
1316 wakaba 1.9 if ($attrs->{$pfx}->{$lname}->{def}) {
1317     __CODE{t|setAttrType::
1318     $attr => $attr,
1319     $type => {$attrs->{$pfx}->{$lname}
1320     ->{def}-><AG::ATDef.declaredType>},
1321     }__;
1322     }
1323 wakaba 1.1 $el-><M::Element.setAttributeNodeNS> ($attr);
1324     }
1325     }
1326    
1327     $node-><M::Node.appendChild> ($el);
1328     }
1329    
1330     ~ (TAGC) {
1331     lang:Perl {
1332     push @{$nodes}, $node;
1333     $node = $el;
1334     }
1335     ?lexmode ElementContent;
1336 wakaba 1.6 } (NESTC) {
1337     my $is_docel;
1338 wakaba 1.1 lang:Perl {
1339     $ns = pop @{$nses};
1340     $type = pop @{$types};
1341 wakaba 1.6 $is_docel = (@{$types} == 0);
1342     }
1343    
1344     if-true ($is_docel) {
1345     return;
1346     }
1347    
1348     ~ (TAGC) {
1349     ?lexmode ElementContent;
1350     } else {
1351     ?lexmode ElementContent;
1352 wakaba 1.1 }
1353     } else {
1354     ?lexmode ElementContent;
1355     }
1356     } else {
1357     ?lexmode ElementContent;
1358     }
1359    
1360     } (ETAGO) {
1361     // End tag
1362    
1363     ?lexmode 'EndTag';
1364    
1365     my $is_docel;
1366    
1367     ~ (Name) {
1368 wakaba 1.3 lang:Perl ($name => $token.value) : has-error {
1369 wakaba 1.1 if ($name eq $type) {
1370     $type = pop @{$types};
1371     if ($type eq '') {
1372     $is_docel = true;
1373     }
1374     $node = pop @{$nodes};
1375     $ns = pop @{$nses};
1376     } else {
1377 wakaba 1.3 my $location;
1378     __CODE{xp|get-location-from-token::
1379     $token => $token,
1380     $result => $location,
1381     }__;
1382     my $continue = __DOMCore:ERROR{xp|wf-element-type-match::
1383     DOMCore:location => {$location},
1384     xp|token => {$token},
1385     xp|expected-element-type => {$type},
1386     xp|actual-element-type => {$name},
1387     xp|node => {$node},
1388     }__;
1389     unless ($continue) {
1390     __EXCEPTION{DOMLS|PARSE_ERR}__;
1391     }
1392 wakaba 1.1 }
1393     }
1394     }
1395    
1396     ~? (S) { }
1397    
1398     if-true ($is_docel) {
1399 wakaba 1.3 lang:Perl : has-error {
1400 wakaba 1.1 if (@{$types}) {
1401 wakaba 1.3 my $location;
1402     __CODE{xp|get-location-from-token::
1403     $token => $token,
1404     $result => $location,
1405     }__;
1406     for my $type (reverse @{$types}) {
1407     my $continue = __DOMCore:ERROR{xp|wf-no-end-tag::
1408     DOMCore:location => {$location},
1409     xp|token => {$token},
1410     xp|expected-element-type => {$type},
1411     xp|node => {$node},
1412     }__;
1413     unless ($continue) {
1414     __EXCEPTION{DOMLS|PARSE_ERR}__;
1415     }
1416     $node = shift @{$nodes};
1417     }
1418 wakaba 1.1 }
1419     }
1420     return;
1421     }
1422    
1423     ~ (TAGC) {
1424     ?lexmode ElementContent;
1425     } else {
1426     ?lexmode 'ElementContent';
1427     }
1428    
1429     } (HCRO) {
1430     &_HexadecimalCharacterReference_
1431     ($doc => $doc, $parent => $node);
1432    
1433     ~ (REFC) {
1434     ?lexmode 'ElementContent';
1435     } else {
1436     ?lexmode ElementContent;
1437     }
1438     } (CRO) {
1439     &_NumericCharacterReference_
1440     ($doc => $doc, $parent => $node);
1441    
1442     ~ (REFC) {
1443     ?lexmode 'ElementContent';
1444     } else {
1445     ?lexmode ElementContent;
1446     }
1447     } (ERO) {
1448 wakaba 1.6 &_GeneralEntityReferenceEC
1449     ($doc => $doc, $parent => $node, $ns => $ns);
1450 wakaba 1.1 } (CDO) {
1451     &_CommentDeclaration_ ($doc => $doc, $parent => $node);
1452    
1453     ~ (MDC) {
1454     ?lexmode ElementContent;
1455     } else {
1456     ?lexmode ElementContent;
1457     }
1458     } (CDSO) {
1459     &_CDATASection_ ($doc => $doc, $parent => $node);
1460    
1461     ~ (MSE) {
1462     ?lexmode 'ElementContent';
1463     } else {
1464     ?lexmode ElementContent;
1465     }
1466     } (PIO) {
1467     &_ProcessingInstruction_ ($doc => $doc, $parent => $node);
1468    
1469     ~ (PIC) {
1470     ?lexmode 'ElementContent';
1471     } else {
1472     ?lexmode ElementContent;
1473     }
1474     }
1475 wakaba 1.3
1476     ~ (#NONE) { }
1477 wakaba 1.1 } // Element_
1478 wakaba 1.11
1479     /*
1480     content := [CharData]
1481     *((element / Reference / CDSect / PI / Comment) [CharData])
1482     */
1483     rule content ($parent, $ns) {
1484     // ?lexmode ElementContent;
1485    
1486     my $doc;
1487     lang:Perl {
1488     $doc = $self->{doc};
1489     }
1490    
1491     ~* (CharData) {
1492     lang:Perl ($data => $token.value) {
1493     $parent-><M::Node.appendChild>
1494     ($self->{doc}-><M::Document.createTextNode> ($data));
1495     }
1496     } (STAGO) {
1497     &Element_ ($doc => $doc, $parent => $parent, $ns => $ns)
1498     : unshift-current-token;
1499     ~ (TAGC) {
1500     ?lexmode ElementContent;
1501     } else {
1502     ?lexmode ElementContent;
1503     }
1504     } (HCRO) {
1505     &_HexadecimalCharacterReference_
1506     ($doc => $doc, $parent => $parent);
1507    
1508     ~ (REFC) {
1509     ?lexmode 'ElementContent';
1510     } else {
1511     ?lexmode ElementContent;
1512     }
1513     } (CRO) {
1514     &_NumericCharacterReference_
1515     ($doc => $doc, $parent => $parent);
1516    
1517     ~ (REFC) {
1518     ?lexmode 'ElementContent';
1519     } else {
1520     ?lexmode ElementContent;
1521     }
1522     } (ERO) {
1523     &_GeneralEntityReferenceEC
1524     ($doc => $doc, $parent => $parent, $ns => $ns);
1525     } (CDO) {
1526     &_CommentDeclaration_ ($doc => $doc, $parent => $parent);
1527    
1528     ~ (MDC) {
1529     ?lexmode ElementContent;
1530     } else {
1531     ?lexmode ElementContent;
1532     }
1533     } (CDSO) {
1534     &_CDATASection_ ($doc => $doc, $parent => $parent);
1535    
1536     ~ (MSE) {
1537     ?lexmode 'ElementContent';
1538     } else {
1539     ?lexmode ElementContent;
1540     }
1541     } (PIO) {
1542     &_ProcessingInstruction_ ($doc => $doc, $parent => $parent);
1543    
1544     ~ (PIC) {
1545     ?lexmode 'ElementContent';
1546     } else {
1547     ?lexmode ElementContent;
1548     }
1549     }
1550     } // content
1551 wakaba 1.1
1552     rule AttributeSpecificationList ($doc, $attrs)
1553     : standalone
1554     {
1555     ?lexmode 'StartTag';
1556    
1557     my $i;
1558     lang:Perl {
1559     $i = 0;
1560     }
1561    
1562     ~* (Name) {
1563     my $atqname;
1564     lang:Perl ($name => $token.value) {
1565     $atqname = $name;
1566     }
1567    
1568     my $vals;
1569 wakaba 1.18 lang:Perl : has-error {
1570 wakaba 1.1 if ($attrs->{$atqname}) {
1571 wakaba 1.3 my $location;
1572     __CODE{xp|get-location-from-token::
1573     $token => $token,
1574     $result => $location,
1575     }__;
1576     my $continue = __DOMCore:ERROR{xp|wf-unique-att-spec::
1577     DOMCore:location => {$location},
1578     xp|token => {$token},
1579     xp|name => {$atqname},
1580     }__;
1581     unless ($continue) {
1582     __EXCEPTION{DOMLS|PARSE_ERR}__;
1583     }
1584 wakaba 1.1 }
1585    
1586     $vals = $attrs->{$atqname} = {
1587     nodes => [],
1588     value => '',
1589     index => $i++,
1590     };
1591     }
1592 wakaba 1.3
1593     ~? (S) { }
1594     ~ (VI) { }
1595     ~? (S) { }
1596 wakaba 1.1
1597     ~ (LIT) {
1598     &_AttributeValueSpecification_
1599     ($doc => $doc, $vals => $vals);
1600    
1601     ~ (LIT) {
1602     ?lexmode StartTag;
1603     } else {
1604     ?lexmode StartTag;
1605     }
1606     } (LITA) {
1607     &_AttributeValueSpecificationA_
1608     ($doc => $doc, $vals => $vals);
1609    
1610     ~ (LITA) {
1611     ?lexmode StartTag;
1612     } else {
1613     ?lexmode StartTag;
1614     }
1615     }
1616     } (S) : separator : terminator? { }
1617     } // AttributeSpecificationList
1618    
1619     rule _AttributeValueSpecification_ ($doc, $vals) {
1620     // ~ (LIT) { }
1621     ?lexmode 'AttributeValueLiteral';
1622    
1623     ~* (STRING) {
1624     lang:Perl ($value => $token.value) {
1625     $value =~ s/[\x09\x0A\x0D]/ /g;
1626     my $text = $doc-><M::Document.createTextNode> ($value);
1627     push @{$vals->{nodes}}, $text;
1628     $vals->{value} .= $value;
1629     }
1630     } (HCRO) {
1631     &_HexadecimalCharacterReferenceV_
1632     ($doc => $doc, $vals => $vals);
1633    
1634     ~ (REFC) {
1635     ?lexmode AttributeValueLiteral;
1636     } else {
1637     ?lexmode AttributeValueLiteral;
1638     }
1639     } (CRO) {
1640     &_NumericCharacterReferenceV_
1641     ($doc => $doc, $vals => $vals);
1642    
1643     ~ (REFC) {
1644     ?lexmode AttributeValueLiteral;
1645     } else {
1646     ?lexmode AttributeValueLiteral;
1647     }
1648     } (ERO) {
1649     // TODO: Attribute value normalization
1650     &_GeneralEntityReferenceV_
1651     ($doc => $doc, $vals => $vals);
1652    
1653     ~ (REFC) {
1654     ?lexmode AttributeValueLiteral;
1655     } else {
1656     ?lexmode AttributeValueLiteral;
1657     }
1658     }
1659    
1660     // ~ (LIT) { } (LITA) { }
1661     } // _AttributeValueSpecification_
1662    
1663     rule _AttributeValueSpecificationA_ ($doc, $vals) {
1664     // ~ (LITA) { }
1665     ?lexmode 'AttributeValueLiteralA';
1666    
1667     ~* (STRING) {
1668     lang:Perl ($value => $token.value) {
1669     $value =~ s/[\x09\x0A\x0D]/ /g;
1670     my $text = $doc-><M::Document.createTextNode> ($value);
1671     push @{$vals->{nodes}}, $text;
1672     $vals->{value} .= $value;
1673     }
1674     } (HCRO) {
1675     &_HexadecimalCharacterReferenceV_
1676     ($doc => $doc, $vals => $vals);
1677    
1678     ~ (REFC) {
1679     ?lexmode AttributeValueLiteralA;
1680     } else {
1681     ?lexmode AttributeValueLiteralA;
1682     }
1683     } (CRO) {
1684     &_NumericCharacterReferenceV_
1685     ($doc => $doc, $vals => $vals);
1686    
1687     ~ (REFC) {
1688     ?lexmode AttributeValueLiteralA;
1689     } else {
1690     ?lexmode AttributeValueLiteralA;
1691     }
1692     } (ERO) {
1693     // TODO: Attribute value normalization
1694     &_GeneralEntityReferenceV_
1695     ($doc => $doc, $vals => $vals);
1696    
1697     ~ (REFC) {
1698     ?lexmode AttributeValueLiteralA;
1699     } else {
1700     ?lexmode AttributeValueLiteralA;
1701     }
1702     }
1703    
1704     // ~ (LITA) { }
1705     } // _AttributeValueSpecificationA_
1706    
1707     /*
1708 wakaba 1.11 Parsing replacement text of an entity referenced in
1709     an attribute value specification.
1710     */
1711     rule AttributeValueLiteralE_ ($parent, $vals)
1712     : recursive
1713     {
1714     // ?lexmode AttributeValueLiteralE;
1715    
1716     ~* (STRING) {
1717     lang:Perl ($value => $token.value) {
1718     $value =~ s/[\x09\x0A\x0D]/ /g;
1719     my $text = $self->{doc}-><M::Document.createTextNode> ($value);
1720     $parent-><M::Node.appendChild> ($text);
1721     $vals->{value} .= $value;
1722     }
1723     } (HCRO) {
1724     &_HexadecimalCharacterReferenceAE_
1725     ($parent => $parent, $vals => $vals);
1726    
1727     ~ (REFC) {
1728     ?lexmode AttributeValueLiteralE;
1729     } else {
1730     ?lexmode AttributeValueLiteralE;
1731     }
1732     } (CRO) {
1733     &_NumericCharacterReferenceAE_
1734     ($parent => $parent, $vals => $vals);
1735    
1736     ~ (REFC) {
1737     ?lexmode AttributeValueLiteralE;
1738     } else {
1739     ?lexmode AttributeValueLiteralE;
1740     }
1741     } (ERO) {
1742     &_GeneralEntityReferenceAE_ ($parent => $parent, $vals => $vals);
1743    
1744     ~ (REFC) {
1745     ?lexmode AttributeValueLiteralE;
1746     } else {
1747     ?lexmode AttributeValueLiteralE;
1748     }
1749 wakaba 1.18 } (#INVALID == '<') {
1750     lang:Perl : has-error {
1751     my $location;
1752     __CODE{xp|get-location-from-token::
1753     $token => $token,
1754     $result => $location,
1755     }__;
1756     my $continue = __DOMCore:ERROR{xp|wf-no-lt-in-attribute-values::
1757     c|location => {$location},
1758     xp|token => {$token},
1759     }__;
1760     unless ($continue) {
1761     __EXCEPTION{DOMLS|PARSE_ERR}__;
1762     }
1763    
1764     my $text = $self->{doc}-><M::Document.createTextNode> ('<');
1765     $parent-><M::Node.appendChild> ($text);
1766     $vals->{value} .= '<';
1767     }
1768 wakaba 1.11 }
1769    
1770     // ~ (#EOF) { }
1771     } // AttributeValueLiteralE_
1772    
1773     /*
1774 wakaba 1.1 CDATA Section Content Parsing Mode
1775     */
1776     rule _CDATASection_ ($doc, $parent) {
1777     ?lexmode 'CDATASectionContent';
1778    
1779     my $cdata;
1780    
1781 wakaba 1.2 ~? (CData) {
1782 wakaba 1.1 lang:Perl ($data => $token.value) {
1783     $cdata = $data;
1784     }
1785     } else {
1786     lang:Perl {
1787     $cdata = '';
1788     }
1789     }
1790    
1791     lang:Perl {
1792     my $cdsect = $doc-><M::Document.createCDATASection>
1793     ($cdata);
1794     $parent-><M::Node.appendChild> ($cdsect);
1795     }
1796    
1797     // ~ (MSE) { }
1798     } // _CDATASection_
1799    
1800     rule _NumericCharacterReference_ ($doc, $parent) {
1801     ?lexmode 'NumericCharacterReference';
1802    
1803     ~ (NUMBER) {
1804 wakaba 1.3 lang:Perl ($num => $token.value) : has-error {
1805     $num += 0;
1806     unless (
1807     ($self->{xml_version} eq '1.0' and
1808     ((0x0020 <= $num and $num <= 0xD7FF) or
1809     (0xE000 <= $num and $num <= 0xFFFD) or
1810     (0x10000 <= $num and $num <= 0x10FFFF) or
1811     $num == 0x9 or $num == 0xA or $num == 0xD)) or
1812     ($self->{xml_version} eq '1.1' and
1813     ((0x0001 <= $num and $num <= 0xD7FF) or
1814     (0xE000 <= $num and $num <= 0xFFFD) or
1815     (0x10000 <= $num and $num <= 0x10FFFF)))
1816     ) {
1817     my $location;
1818     __CODE{xp|get-location-from-token::
1819     $token => $token,
1820     $result => $location,
1821     }__;
1822     my $continue = __DOMCore:ERROR{xp|wf-legal-character::
1823     DOMCore:location => {$location},
1824     xp|token => {$token},
1825     xp|character-number => {$num},
1826     xp|parent => {$parent},
1827     }__;
1828     unless ($continue) {
1829     __EXCEPTION{DOMLS|PARSE_ERR}__;
1830     }
1831     }
1832     my $ncr = $doc-><M::Document.createTextNode> (chr $num);
1833 wakaba 1.1 $parent-><M::Node.appendChild> ($ncr);
1834     }
1835     }
1836    
1837     // ~ (REFC) { }
1838     } // _NumericCharacterReference_
1839    
1840     rule _NumericCharacterReferenceV_ ($doc, $vals) {
1841     ?lexmode 'NumericCharacterReference';
1842    
1843     ~ (NUMBER) {
1844 wakaba 1.3 lang:Perl ($num => $token.value) : has-error {
1845     $num += 0;
1846     unless (
1847     ($self->{xml_version} eq '1.0' and
1848     ((0x0020 <= $num and $num <= 0xD7FF) or
1849     (0xE000 <= $num and $num <= 0xFFFD) or
1850     (0x10000 <= $num and $num <= 0x10FFFF) or
1851     $num == 0x9 or $num == 0xA or $num == 0xD)) or
1852     ($self->{xml_version} eq '1.1' and
1853     ((0x0001 <= $num and $num <= 0xD7FF) or
1854     (0xE000 <= $num and $num <= 0xFFFD) or
1855     (0x10000 <= $num and $num <= 0x10FFFF)))
1856     ) {
1857     my $location;
1858     __CODE{xp|get-location-from-token::
1859     $token => $token,
1860     $result => $location,
1861     }__;
1862     my $continue = __DOMCore:ERROR{xp|wf-legal-character::
1863     DOMCore:location => {$location},
1864     xp|token => {$token},
1865     xp|character-number => {$num},
1866     }__;
1867     unless ($continue) {
1868     __EXCEPTION{DOMLS|PARSE_ERR}__;
1869     }
1870     }
1871 wakaba 1.1 my $ncr = $doc-><M::Document.createTextNode>
1872 wakaba 1.9 (my $char = chr $num);
1873 wakaba 1.1 push @{$vals->{nodes}}, $ncr;
1874     $vals->{value} .= $char;
1875     }
1876     }
1877    
1878     // ~ (REFC) { }
1879     } // _NumericCharacterReferenceV_
1880    
1881 wakaba 1.11 /*
1882     Numeric character reference in the replacement text
1883     of the entity referenced in an attribute value specification
1884     */
1885     rule _NumericCharacterReferenceAE_ ($parent, $vals)
1886     {
1887     ?lexmode NumericCharacterReference;
1888    
1889     ~ (NUMBER) {
1890     lang:Perl ($num => $token.value) : has-error {
1891     $num += 0;
1892     unless (
1893     ($self->{xml_version} eq '1.0' and
1894     ((0x0020 <= $num and $num <= 0xD7FF) or
1895     (0xE000 <= $num and $num <= 0xFFFD) or
1896     (0x10000 <= $num and $num <= 0x10FFFF) or
1897     $num == 0x9 or $num == 0xA or $num == 0xD)) or
1898     ($self->{xml_version} eq '1.1' and
1899     ((0x0001 <= $num and $num <= 0xD7FF) or
1900     (0xE000 <= $num and $num <= 0xFFFD) or
1901     (0x10000 <= $num and $num <= 0x10FFFF)))
1902     ) {
1903     my $location;
1904     __CODE{xp|get-location-from-token::
1905     $token => $token,
1906     $result => $location,
1907     }__;
1908     my $continue = __DOMCore:ERROR{xp|wf-legal-character::
1909     DOMCore:location => {$location},
1910     xp|token => {$token},
1911     xp|character-number => {$num},
1912     }__;
1913     unless ($continue) {
1914     __EXCEPTION{DOMLS|PARSE_ERR}__;
1915     }
1916     }
1917     my $ncr = $self->{doc}-><M::Document.createTextNode>
1918     (my $char = chr $num);
1919     $parent-><M::Node.appendChild> ($ncr);
1920     $vals->{value} .= $char;
1921     }
1922     }
1923    
1924     // ~ (REFC) { }
1925     } // _NumericCharacterReferenceAE_
1926    
1927     rule _NumericCharacterReferenceEV_ ($vals)
1928     {
1929     ?lexmode 'NumericCharacterReference';
1930    
1931     ~ (NUMBER) {
1932     lang:Perl ($num => $token.value) : has-error {
1933     $num += 0;
1934     unless (
1935     ($self->{xml_version} eq '1.0' and
1936     ((0x0020 <= $num and $num <= 0xD7FF) or
1937     (0xE000 <= $num and $num <= 0xFFFD) or
1938     (0x10000 <= $num and $num <= 0x10FFFF) or
1939     $num == 0x9 or $num == 0xA or $num == 0xD)) or
1940     ($self->{xml_version} eq '1.1' and
1941     ((0x0001 <= $num and $num <= 0xD7FF) or
1942     (0xE000 <= $num and $num <= 0xFFFD) or
1943     (0x10000 <= $num and $num <= 0x10FFFF)))
1944     ) {
1945     my $location;
1946     __CODE{xp|get-location-from-token::
1947     $token => $token,
1948     $result => $location,
1949     }__;
1950     my $continue = __DOMCore:ERROR{xp|wf-legal-character::
1951     DOMCore:location => {$location},
1952     xp|token => {$token},
1953     xp|character-number => {$num},
1954     }__;
1955     unless ($continue) {
1956     __EXCEPTION{DOMLS|PARSE_ERR}__;
1957     }
1958     }
1959     push @{$vals}, chr $num;
1960     }
1961     }
1962    
1963     // ~ (REFC) { }
1964     } // _NumericCharacterReferenceEV_
1965    
1966 wakaba 1.1 rule _HexadecimalCharacterReference_ ($doc, $parent) {
1967     ?lexmode 'HexadecimalCharacterReference';
1968    
1969     ~ (Hex) {
1970 wakaba 1.9 lang:Perl ($v => $token.value) : has-error {
1971     my $num = hex $v;
1972 wakaba 1.3 unless (
1973     ($self->{xml_version} eq '1.0' and
1974     ((0x0020 <= $num and $num <= 0xD7FF) or
1975     (0xE000 <= $num and $num <= 0xFFFD) or
1976     (0x10000 <= $num and $num <= 0x10FFFF) or
1977     $num == 0x9 or $num == 0xA or $num == 0xD)) or
1978     ($self->{xml_version} eq '1.1' and
1979     ((0x0001 <= $num and $num <= 0xD7FF) or
1980     (0xE000 <= $num and $num <= 0xFFFD) or
1981     (0x10000 <= $num and $num <= 0x10FFFF)))
1982     ) {
1983     my $location;
1984     __CODE{xp|get-location-from-token::
1985     $token => $token,
1986     $result => $location,
1987     }__;
1988     my $continue = __DOMCore:ERROR{xp|wf-legal-character::
1989     DOMCore:location => {$location},
1990     xp|token => {$token},
1991     xp|character-number => {$num},
1992     xp|parent => {$parent},
1993     }__;
1994     unless ($continue) {
1995     __EXCEPTION{DOMLS|PARSE_ERR}__;
1996     }
1997     }
1998 wakaba 1.1 my $ncr = $doc-><M::Document.createTextNode>
1999 wakaba 1.9 (chr $num);
2000 wakaba 1.1 $parent-><M::Node.appendChild> ($ncr);
2001     }
2002     }
2003    
2004     // ~ (REFC) { }
2005     } // _HexadecimalCharacterReference_
2006    
2007 wakaba 1.3 rule _HexadecimalCharacterReferenceV_ ($doc, $vals) {
2008 wakaba 1.1 ?lexmode 'HexadecimalCharacterReference';
2009    
2010     ~ (Hex) {
2011 wakaba 1.9 lang:Perl ($v => $token.value) : has-error {
2012     my $num = hex $v;
2013 wakaba 1.3 unless (
2014     ($self->{xml_version} eq '1.0' and
2015     ((0x0020 <= $num and $num <= 0xD7FF) or
2016     (0xE000 <= $num and $num <= 0xFFFD) or
2017     (0x10000 <= $num and $num <= 0x10FFFF) or
2018     $num == 0x9 or $num == 0xA or $num == 0xD)) or
2019     ($self->{xml_version} eq '1.1' and
2020     ((0x0001 <= $num and $num <= 0xD7FF) or
2021     (0xE000 <= $num and $num <= 0xFFFD) or
2022     (0x10000 <= $num and $num <= 0x10FFFF)))
2023     ) {
2024     my $location;
2025     __CODE{xp|get-location-from-token::
2026     $token => $token,
2027     $result => $location,
2028     }__;
2029     my $continue = __DOMCore:ERROR{xp|wf-legal-character::
2030     DOMCore:location => {$location},
2031     xp|token => {$token},
2032     xp|character-number => {$num},
2033     }__;
2034     unless ($continue) {
2035     __EXCEPTION{DOMLS|PARSE_ERR}__;
2036     }
2037     }
2038 wakaba 1.1 my $ncr = $doc-><M::Document.createTextNode>
2039 wakaba 1.9 (my $char = chr $num);
2040 wakaba 1.1 push @{$vals->{nodes}}, $ncr;
2041     $vals->{value} .= $char;
2042     }
2043     }
2044    
2045     // ~ (REFC) { }
2046 wakaba 1.11 } // _HexadecimalCharacterReferenceV_
2047    
2048     /*
2049     Hexadecimal character reference in the replacement text
2050     of the entity referenced in an attribute value literal
2051     */
2052     rule _HexadecimalCharacterReferenceAE_ ($parent, $vals)
2053     {
2054     ?lexmode HexadecimalCharacterReference;
2055    
2056     ~ (Hex) {
2057     lang:Perl ($v => $token.value) : has-error {
2058     my $num = hex $v;
2059     unless (
2060     ($self->{xml_version} eq '1.0' and
2061     ((0x0020 <= $num and $num <= 0xD7FF) or
2062     (0xE000 <= $num and $num <= 0xFFFD) or
2063     (0x10000 <= $num and $num <= 0x10FFFF) or
2064     $num == 0x9 or $num == 0xA or $num == 0xD)) or
2065     ($self->{xml_version} eq '1.1' and
2066     ((0x0001 <= $num and $num <= 0xD7FF) or
2067     (0xE000 <= $num and $num <= 0xFFFD) or
2068     (0x10000 <= $num and $num <= 0x10FFFF)))
2069     ) {
2070     my $location;
2071     __CODE{xp|get-location-from-token::
2072     $token => $token,
2073     $result => $location,
2074     }__;
2075     my $continue = __DOMCore:ERROR{xp|wf-legal-character::
2076     DOMCore:location => {$location},
2077     xp|token => {$token},
2078     xp|character-number => {$num},
2079     }__;
2080     unless ($continue) {
2081     __EXCEPTION{DOMLS|PARSE_ERR}__;
2082     }
2083     }
2084     my $ncr = $self->{doc}-><M::Document.createTextNode>
2085     (my $char = chr $num);
2086     $parent-><M::Node.appendChild> ($ncr);
2087     $vals->{value} .= $char;
2088     }
2089     }
2090    
2091     // ~ (REFC) { }
2092     } // _HexadecimalCharacterReferenceAE_
2093    
2094     rule _HexadecimalCharacterReferenceEV_ ($vals) {
2095     ?lexmode HexadecimalCharacterReference;
2096    
2097     ~ (Hex) {
2098     lang:Perl ($v => $token.value) : has-error {
2099     my $num = hex $v;
2100     unless (
2101     ($self->{xml_version} eq '1.0' and
2102     ((0x0020 <= $num and $num <= 0xD7FF) or
2103     (0xE000 <= $num and $num <= 0xFFFD) or
2104     (0x10000 <= $num and $num <= 0x10FFFF) or
2105     $num == 0x9 or $num == 0xA or $num == 0xD)) or
2106     ($self->{xml_version} eq '1.1' and
2107     ((0x0001 <= $num and $num <= 0xD7FF) or
2108     (0xE000 <= $num and $num <= 0xFFFD) or
2109     (0x10000 <= $num and $num <= 0x10FFFF)))
2110     ) {
2111     my $location;
2112     __CODE{xp|get-location-from-token::
2113     $token => $token,
2114     $result => $location,
2115     }__;
2116     my $continue = __DOMCore:ERROR{xp|wf-legal-character::
2117     DOMCore:location => {$location},
2118     xp|token => {$token},
2119     xp|character-number => {$num},
2120     }__;
2121     unless ($continue) {
2122     __EXCEPTION{DOMLS|PARSE_ERR}__;
2123     }
2124     }
2125     push @{$vals}, chr $num;
2126     }
2127     }
2128    
2129     // ~ (REFC) { }
2130     } // _HexadecimalCharacterReferenceEV_
2131    
2132     /*
2133     General entity reference in element's content
2134     */
2135     rule _GeneralEntityReferenceEC ($doc, $parent, $ns)
2136     : recursive
2137     {
2138     ?lexmode 'EntityReference';
2139    
2140     ~ (Name == 'lt') {
2141     lang:Perl {
2142     $parent-><M::Node.appendChild>
2143     ($self->{doc}-><M::Document.createTextNode> ('<'));
2144     }
2145     } (Name == 'gt') {
2146     lang:Perl {
2147     $parent-><M::Node.appendChild>
2148     ($self->{doc}-><M::Document.createTextNode> ('>'));
2149     }
2150     } (Name == 'amp') {
2151     lang:Perl {
2152     $parent-><M::Node.appendChild>
2153     ($self->{doc}-><M::Document.createTextNode> ('&'));
2154     }
2155     } (Name == 'quot') {
2156     lang:Perl {
2157     $parent-><M::Node.appendChild>
2158     ($self->{doc}-><M::Document.createTextNode> ('"'));
2159     }
2160     } (Name == 'apos') {
2161     lang:Perl {
2162     $parent-><M::Node.appendChild>
2163     ($self->{doc}-><M::Document.createTextNode> ("'"));
2164     }
2165     } (Name) {
2166     my $er;
2167 wakaba 1.19 lang:Perl ($name => $token.value) : has-error {
2168 wakaba 1.11 ## TODO: Namespace well-formedness
2169     $er = $doc-><M::Document.createEntityReference>
2170     ($name);
2171 wakaba 1.20 $er-><AS::Node.textContent> ('');
2172     ## NOTE: When document entity (and entities referenced directly
2173     ## or indirectly from it) is parsed, no general entity
2174     ## node have its replacement tree. During general
2175     ## entity node collection construction, however,
2176     ## some entity node has replacement tree.
2177 wakaba 1.11 $parent-><M::Node.appendChild> ($er);
2178 wakaba 1.19
2179     my $ent = $self->{general_entity}->{$name};
2180     if (not $ent) { # no entity declaration
2181     if ($self->{standalone} or not $self->{has_xref}) { # WFC error
2182     my $location;
2183     __CODE{xp|get-location-from-token::
2184     $token => {$token},
2185     $result => {$location},
2186     }__;
2187     my $continue = __DOMCore:ERROR{xp|wf-entity-declared::
2188     xp|error-token => {$token},
2189     c|location => {$location},
2190     xp|name => {$name},
2191     }__;
2192     unless ($continue) {
2193     __EXCEPTION{DOMLS|PARSE_ERR}__;
2194     }
2195     } # Otherwise VC error
2196 wakaba 1.23 push @{$self->{entity}}, <Code::getEmptyEntityState::
2197     $name = $name>;
2198 wakaba 1.20 $er-><AS::x|EntityReference.isExpanded> (false);
2199 wakaba 1.19
2200     } else { # there IS entity declaration
2201     if (($self->{standalone} or not $self->{has_xref}) and
2202     $ent->{is_externally_declared} and
2203     not $self->{entity}->[-1]->{is_externally_declared}) {
2204     my $location;
2205     __CODE{xp|get-location-from-token::
2206     $token => {$token},
2207     $result => {$location},
2208     }__;
2209     my $continue = __DOMCore:ERROR{xp|wf-entity-declared::
2210     xp|error-token => {$token},
2211     c|location => {$location},
2212     xp|name => {$name},
2213     }__;
2214     unless ($continue) {
2215     __EXCEPTION{DOMLS|PARSE_ERR}__;
2216     }
2217     }
2218     $er-><AS::x|EntityReference.isExpanded>
2219     ($ent->{has_replacement_text});
2220     push @{$self->{entity}}, <Code::getCopyOfEntityState::
2221 wakaba 1.11 $entity_type = 'general_entity',
2222     $entity_name = $name>;
2223 wakaba 1.23
2224     if (defined $ent->{notation}) {
2225     my $location;
2226     __CODE{xp|get-location-from-token::
2227     $token => {$token},
2228     $result => {$location},
2229     }__;
2230     my $continue = __c|ERROR{xp|wf-parsed-entity::
2231     xp|error-token => {$token},
2232     c|location => {$location},
2233     xp|name => {$name},
2234     }__;
2235     unless ($continue) {
2236     __EXCEPTION{DOMLS|PARSE_ERR::
2237     }__;
2238     }
2239     } # if unparsed entity
2240    
2241     if ($ent->{is_opened}) {
2242     my $location;
2243     __CODE{xp|get-location-from-token::
2244     $token => {$token},
2245     $result => {$location},
2246     }__;
2247     my $continue = __c|ERROR{xp|wf-no-recursion::
2248     xp|error-token => {$token},
2249     c|location => {$location},
2250     xp|name => {$name},
2251     }__;
2252     unless ($continue) {
2253     __EXCEPTION{DOMLS|PARSE_ERR::
2254     }__;
2255     }
2256     $self->{entity}->[-1]->{reptxt} = \'';
2257     $er-><AS::x|EntityReference.isExpanded> (false);
2258     } # recursive
2259     $ent->{is_opened} = true;
2260     } # entity declared
2261 wakaba 1.14 $self->{location} = $self->{entity}->[-1];
2262 wakaba 1.11 push @{$self->{entity_token}}, $self->{token};
2263     $self->{token} = [];
2264     push @{$self->{entity_char}}, $self->{char};
2265     $self->{char} = [];
2266     }
2267    
2268     ?lexmode ElementContent;
2269     &content ($doc => $doc, $parent => $er, $ns => $ns);
2270     ~ (#EOF) { }
2271     lang:Perl {
2272 wakaba 1.23 $self->{general_entity}->{$self->{entity}->[-1]->{name}}
2273     ->{is_opened} = false
2274     if $self->{general_entity}->{$self->{entity}->[-1]->{name}};
2275 wakaba 1.11 $self->{token} = pop @{$self->{entity_token}};
2276     $self->{char} = pop @{$self->{entity_char}};
2277     pop @{$self->{entity}};
2278 wakaba 1.14 $self->{location} = $self->{entity}->[-1];
2279 wakaba 1.11 }
2280    
2281     // TODO: Set read-only flag
2282    
2283     ?lexmode EntityReference;
2284     ?requires-next-token;
2285     }
2286    
2287     ~ (REFC) {
2288     ?lexmode ElementContent;
2289     } else {
2290     ?lexmode ElementContent;
2291     }
2292     } // _GeneralEntityReferenceEC
2293    
2294     /*
2295     General entity reference in an attribute value literal
2296     */
2297     rule _GeneralEntityReferenceV_ ($vals) {
2298     ?lexmode EntityReference;
2299    
2300     ~ (Name == 'lt') {
2301     lang:Perl {
2302     push @{$vals->{nodes}}, $self->{doc}-><M::Document.createTextNode>
2303     ('<');
2304     $vals->{value} .= '<';
2305     }
2306     } (Name == 'gt') {
2307     lang:Perl {
2308     push @{$vals->{nodes}}, $self->{doc}-><M::Document.createTextNode>
2309     ('>');
2310     $vals->{value} .= '>';
2311     }
2312     } (Name == 'amp') {
2313     lang:Perl {
2314     push @{$vals->{nodes}}, $self->{doc}-><M::Document.createTextNode>
2315     ('&');
2316     $vals->{value} .= '&';
2317     }
2318     } (Name == 'quot') {
2319     lang:Perl {
2320     push @{$vals->{nodes}}, $self->{doc}-><M::Document.createTextNode>
2321     ('"');
2322     $vals->{value} .= '"';
2323     }
2324     } (Name == 'apos') {
2325     lang:Perl {
2326     push @{$vals->{nodes}}, $self->{doc}-><M::Document.createTextNode>
2327     ("'");
2328     $vals->{value} .= "'";
2329     }
2330     } (Name) {
2331     my $er;
2332 wakaba 1.18 lang:Perl ($name => $token.value) : has-error {
2333 wakaba 1.11 ## TODO: Namespace well-formedness
2334 wakaba 1.18
2335 wakaba 1.11 $er = $self->{doc}-><M::Document.createEntityReference> ($name);
2336 wakaba 1.20 $er-><AS::Node.textContent> ('');
2337     ## NOTE: When document entity (and entities referenced directly
2338     ## or indirectly from it) is parsed, no general entity
2339     ## node have its replacement tree. During general
2340     ## entity node collection construction, however,
2341     ## some entity node has replacement tree.
2342 wakaba 1.19 my $ent = $self->{general_entity}->{$name};
2343 wakaba 1.20 if (not $ent) { # no entity declaration
2344     if ($self->{standalone} or not $self->{has_xref}) { # WFC error
2345     my $location;
2346     __CODE{xp|get-location-from-token::
2347     $token => {$token},
2348     $result => {$location},
2349     }__;
2350     my $continue = __DOMCore:ERROR{xp|wf-entity-declared::
2351     xp|error-token => {$token},
2352     c|location => {$location},
2353     xp|name => {$name},
2354     }__;
2355     unless ($continue) {
2356     __EXCEPTION{DOMLS|PARSE_ERR}__;
2357     }
2358     } # Otherwise VC error
2359 wakaba 1.23 push @{$self->{entity}}, <Code::getEmptyEntityState::
2360     $name = $name>;
2361 wakaba 1.20 $er-><AS::x|EntityReference.isExpanded> (false);
2362    
2363     } else { # there IS entity declaration
2364     if (($self->{standalone} or not $self->{has_xref}) and
2365     $ent->{is_externally_declared} and
2366     not $self->{entity}->[-1]->{is_externally_declared}) {
2367     my $location;
2368     __CODE{xp|get-location-from-token::
2369     $token => {$token},
2370     $result => {$location},
2371     }__;
2372     my $continue = __DOMCore:ERROR{xp|wf-entity-declared::
2373     xp|error-token => {$token},
2374     c|location => {$location},
2375     xp|name => {$name},
2376     }__;
2377     unless ($continue) {
2378     __EXCEPTION{DOMLS|PARSE_ERR}__;
2379     }
2380     }
2381    
2382     if ($ent->{is_external_entity}) {
2383     my $location;
2384     __CODE{xp|get-location-from-token::
2385     $token => {$token},
2386     $result => {$location},
2387     }__;
2388     my $continue = __c|ERROR{xp|wf-no-external-entity-references::
2389     xp|error-token => {$token},
2390     c|location => {$location},
2391     xp|name => {$name},
2392     }__;
2393     unless ($continue) {
2394     __EXCEPTION{DOMLS|PARSE_ERR::
2395     }__;
2396     }
2397 wakaba 1.23 ## NOTE: |xp:wf-parsed-entity| is not checked
2398 wakaba 1.20 } # if external entity
2399    
2400     $er-><AS::x|EntityReference.isExpanded>
2401 wakaba 1.19 ($ent->{has_replacement_text});
2402 wakaba 1.20 push @{$self->{entity}}, <Code::getCopyOfEntityState::
2403 wakaba 1.11 $entity_type = 'general_entity',
2404     $entity_name = $name>;
2405 wakaba 1.23
2406     if ($ent->{is_opened}) {
2407     my $location;
2408     __CODE{xp|get-location-from-token::
2409     $token => {$token},
2410     $result => {$location},
2411     }__;
2412     my $continue = __c|ERROR{xp|wf-no-recursion::
2413     xp|error-token => {$token},
2414     c|location => {$location},
2415     xp|name => {$name},
2416     }__;
2417     unless ($continue) {
2418     __EXCEPTION{DOMLS|PARSE_ERR::
2419     }__;
2420     }
2421     $self->{entity}->[-1]->{reptxt} = \'';
2422     $er-><AS::x|EntityReference.isExpanded> (false);
2423     } # recursive
2424     $ent->{is_opened} = true;
2425 wakaba 1.20 }
2426     push @{$vals->{nodes}}, $er;
2427 wakaba 1.14 $self->{location} = $self->{entity}->[-1];
2428 wakaba 1.11 push @{$self->{entity_token}}, $self->{token};
2429     $self->{token} = [];
2430     push @{$self->{entity_char}}, $self->{char};
2431     $self->{char} = [];
2432     }
2433    
2434     ?lexmode AttributeValueLiteralE;
2435     &AttributeValueLiteralE_ ($parent => $er, $vals => $vals);
2436     ~ (#EOF) { }
2437     lang:Perl {
2438 wakaba 1.23 $self->{general_entity}->{$self->{entity}->[-1]->{name}}
2439     ->{is_opened} = false
2440     if $self->{general_entity}->{$self->{entity}->[-1]->{name}};
2441 wakaba 1.11 $self->{token} = pop @{$self->{entity_token}};
2442     $self->{char} = pop @{$self->{entity_char}};
2443     pop @{$self->{entity}};
2444 wakaba 1.14 $self->{location} = $self->{entity}->[-1];
2445 wakaba 1.11 }
2446    
2447     // TODO: Set read-only flag
2448    
2449     ?lexmode EntityReference;
2450     ?requires-next-token;
2451     }
2452    
2453     // ~ (REFC) { }
2454     } // _GeneralEntityReferenceV_
2455 wakaba 1.1
2456 wakaba 1.6 /*
2457 wakaba 1.11 General entity reference in the replacement text
2458     of the entity referenced in an attribute value literal
2459 wakaba 1.6 */
2460 wakaba 1.11 rule _GeneralEntityReferenceAE_ ($parent, $vals)
2461 wakaba 1.6 {
2462 wakaba 1.11 ?lexmode EntityReference;
2463 wakaba 1.1
2464 wakaba 1.11 ~ (Name == 'lt') {
2465     lang:Perl {
2466     $parent-><M::Node.appendChild>
2467     ($self->{doc}-><M::Document.createTextNode> ('<'));
2468     $vals->{value} .= '<';
2469     }
2470     } (Name == 'gt') {
2471     lang:Perl {
2472     $parent-><M::Node.appendChild>
2473     ($self->{doc}-><M::Document.createTextNode> ('>'));
2474     $vals->{value} .= '>';
2475     }
2476     } (Name == 'amp') {
2477     lang:Perl {
2478     $parent-><M::Node.appendChild>
2479     ($self->{doc}-><M::Document.createTextNode> ('&'));
2480     $vals->{value} .= '&';
2481     }
2482     } (Name == 'quot') {
2483     lang:Perl {
2484     $parent-><M::Node.appendChild>
2485     ($self->{doc}-><M::Document.createTextNode> ('"'));
2486     $vals->{value} .= '"';
2487     }
2488     } (Name == 'apos') {
2489     lang:Perl {
2490     $parent-><M::Node.appendChild>
2491     ($self->{doc}-><M::Document.createTextNode> ("'"));
2492     $vals->{value} .= "'";
2493     }
2494     } (Name) {
2495 wakaba 1.6 my $er;
2496 wakaba 1.1 lang:Perl ($name => $token.value) {
2497     ## TODO: Namespace well-formedness
2498 wakaba 1.18
2499 wakaba 1.11 $er = $self->{doc}-><M::Document.createEntityReference> ($name);
2500 wakaba 1.20 $er-><AS::Node.textContent> ('');
2501     ## NOTE: When document entity (and entities referenced directly
2502     ## or indirectly from it) is parsed, no general entity
2503     ## node have its replacement tree. During general
2504     ## entity node collection construction, however,
2505     ## some entity node has replacement tree.
2506 wakaba 1.19 my $ent = $self->{general_entity}->{$name};
2507 wakaba 1.22 if (not $ent) { # no entity declaration
2508     if ($self->{standalone} or not $self->{has_xref}) { # WFC error
2509     my $location;
2510     __CODE{xp|get-location-from-token::
2511     $token => {$token},
2512     $result => {$location},
2513     }__;
2514     my $continue = __DOMCore:ERROR{xp|wf-entity-declared::
2515     xp|error-token => {$token},
2516     c|location => {$location},
2517     xp|name => {$name},
2518     }__;
2519     unless ($continue) {
2520     __EXCEPTION{DOMLS|PARSE_ERR}__;
2521     }
2522     } # Otherwise VC error
2523 wakaba 1.23 push @{$self->{entity}}, <Code::getEmptyEntityState::
2524     $name = $name>;
2525 wakaba 1.22 $er-><AS::x|EntityReference.isExpanded> (false);
2526    
2527     } else { # there IS entity declaration
2528     if (($self->{standalone} or not $self->{has_xref}) and
2529     $ent->{is_externally_declared} and
2530     not $self->{entity}->[-1]->{is_externally_declared}) {
2531     my $location;
2532     __CODE{xp|get-location-from-token::
2533     $token => {$token},
2534     $result => {$location},
2535     }__;
2536     my $continue = __DOMCore:ERROR{xp|wf-entity-declared::
2537     xp|error-token => {$token},
2538     c|location => {$location},
2539     xp|name => {$name},
2540     }__;
2541     unless ($continue) {
2542     __EXCEPTION{DOMLS|PARSE_ERR}__;
2543     }
2544     }
2545    
2546     if ($ent->{is_external_entity}) {
2547     my $location;
2548     __CODE{xp|get-location-from-token::
2549     $token => {$token},
2550     $result => {$location},
2551     }__;
2552     my $continue = __c|ERROR{xp|wf-no-external-entity-references::
2553     xp|error-token => {$token},
2554     c|location => {$location},
2555     xp|name => {$name},
2556     }__;
2557     unless ($continue) {
2558     __EXCEPTION{DOMLS|PARSE_ERR::
2559     }__;
2560     }
2561 wakaba 1.23 ## NOTE: |xp:wf-parsed-entity| is not checked
2562 wakaba 1.22 } # if external entity
2563    
2564     $er-><AS::x|EntityReference.isExpanded>
2565 wakaba 1.19 ($ent->{has_replacement_text});
2566 wakaba 1.22 push @{$self->{entity}}, <Code::getCopyOfEntityState::
2567 wakaba 1.6 $entity_type = 'general_entity',
2568     $entity_name = $name>;
2569 wakaba 1.23
2570     if ($ent->{is_opened}) {
2571     my $location;
2572     __CODE{xp|get-location-from-token::
2573     $token => {$token},
2574     $result => {$location},
2575     }__;
2576     my $continue = __c|ERROR{xp|wf-no-recursion::
2577     xp|error-token => {$token},
2578     c|location => {$location},
2579     xp|name => {$name},
2580     }__;
2581     unless ($continue) {
2582     __EXCEPTION{DOMLS|PARSE_ERR::
2583     }__;
2584     }
2585     $self->{entity}->[-1]->{reptxt} = \'';
2586     $er-><AS::x|EntityReference.isExpanded> (false);
2587     } # recursive
2588     $ent->{is_opened} = true;
2589 wakaba 1.22 }
2590     $parent-><M::Node.appendChild> ($er);
2591 wakaba 1.14 $self->{location} = $self->{entity}->[-1];
2592 wakaba 1.6 push @{$self->{entity_token}}, $self->{token};
2593     $self->{token} = [];
2594     push @{$self->{entity_char}}, $self->{char};
2595     $self->{char} = [];
2596     }
2597    
2598 wakaba 1.11 ?lexmode AttributeValueLiteralE;
2599     &AttributeValueLiteralE_ ($parent => $er, $vals => $vals);
2600 wakaba 1.6 ~ (#EOF) { }
2601     lang:Perl {
2602 wakaba 1.23 $self->{general_entity}->{$self->{entity}->[-1]->{name}}
2603     ->{is_opened} = false
2604     if $self->{general_entity}->{$self->{entity}->[-1]->{name}};
2605 wakaba 1.6 $self->{token} = pop @{$self->{entity_token}};
2606     $self->{char} = pop @{$self->{entity_char}};
2607     pop @{$self->{entity}};
2608 wakaba 1.14 $self->{location} = $self->{entity}->[-1];
2609 wakaba 1.6 }
2610    
2611 wakaba 1.11 // TODO: Set read-only flag
2612    
2613 wakaba 1.6 ?lexmode EntityReference;
2614     ?requires-next-token;
2615 wakaba 1.1 }
2616    
2617     // ~ (REFC) { }
2618 wakaba 1.11 } // _GeneralEntityReferenceAE_
2619 wakaba 1.6
2620     /*
2621 wakaba 1.24 General Entity Reference in Literal Entity Value in Entity Declaration
2622 wakaba 1.6 */
2623 wakaba 1.11 rule _GeneralEntityReferenceEV_ ($vals) {
2624 wakaba 1.6 ?lexmode 'EntityReference';
2625    
2626     ~ (Name) {
2627     lang:Perl ($name => $token.value) {
2628     ## TODO: Namespace well-formedness
2629     push @$vals, $name;
2630     }
2631 wakaba 1.24 /*
2632     WFCs such as Entity Declared are not checked
2633     <http://www.w3.org/TR/xml11/#bypass>
2634    
2635     Note that violation to the Parsed Entity WFC is an error
2636     rather than fatal error here.
2637     */
2638 wakaba 1.6 }
2639 wakaba 1.11
2640     // No expansion
2641 wakaba 1.6
2642     // ~ (REFC) { }
2643     } // _GeneralEntityReferenceEV_
2644 wakaba 1.1
2645     /*
2646 wakaba 1.4 Document Type Declaration
2647 wakaba 1.1 */
2648 wakaba 1.4 rule _DocumentTypeDeclaration_ ($doc) {
2649     ?lexmode MarkupDeclaration;
2650    
2651     ~ (Name == 'DOCTYPE') { }
2652    
2653     ~ (S) { }
2654    
2655     // Document type name
2656 wakaba 1.6 my $name;
2657 wakaba 1.4 ~ (Name) {
2658 wakaba 1.6 lang:Perl ($v => $token.value) {
2659     $name = $v;
2660     }
2661     }
2662 wakaba 1.17
2663     my $node;
2664     my $decl;
2665 wakaba 1.6 lang:Perl {
2666 wakaba 1.11 $self->{docx} = $self->{doc}
2667     -><M::Node.getFeature> (<Q::fe:XDoctype>, '3.0');
2668     $node = $self->{docx}-><M::DocumentXDoctype.createDocumentTypeDefinition>
2669     ($name);
2670 wakaba 1.17 $decl = $self->{dtdecl} = $node-><M::Node.getFeature>
2671     (<Q::fe:XDoctypeDeclaration>, '3.0');
2672 wakaba 1.4 }
2673    
2674 wakaba 1.25 my $has_extid;
2675 wakaba 1.4 ~? (S) {
2676     ~? (Name == 'PUBLIC') {
2677     ~ (S) { }
2678    
2679 wakaba 1.17 &PubidLiteral ($decl => $decl);
2680 wakaba 1.4
2681     ~ (S) { }
2682    
2683 wakaba 1.17 &SystemLiteral ($decl => $decl);
2684 wakaba 1.4
2685     ~? (S) { }
2686 wakaba 1.19
2687     lang:Perl {
2688     $self->{has_xref} = true;
2689 wakaba 1.25 $has_extid = true;
2690 wakaba 1.19 }
2691 wakaba 1.4 } (Name == 'SYSTEM') {
2692     ~ (S) { }
2693    
2694 wakaba 1.17 &SystemLiteral ($decl => $decl);
2695 wakaba 1.4
2696     ~? (S) { }
2697 wakaba 1.19
2698     lang:Perl {
2699     $self->{has_xref} = true;
2700 wakaba 1.25 $has_extid = true;
2701 wakaba 1.19 }
2702 wakaba 1.4 }
2703     }
2704 wakaba 1.17
2705 wakaba 1.11 lang:Perl {
2706     $self->{dtdef} = $node;
2707 wakaba 1.21 $self->{doc}-><M::Node.appendChild> ($node);
2708     $self->{doc_cfg}-><M::c|DOMConfiguration.setParameter>
2709     ('schema-type' => <Q::xml-dtd:>);
2710     ## ISSUE: Should default schema language information be
2711     ## preserved by some other flag?
2712 wakaba 1.11 }
2713    
2714 wakaba 1.4 ~? (DSO) {
2715 wakaba 1.6 &InternalSubset ($doc => $doc, $doctype => $node);
2716 wakaba 1.4
2717     ~ (DSC) {
2718     ?lexmode MarkupDeclaration;
2719     } else {
2720     ?lexmode MarkupDeclaration;
2721     }
2722    
2723     ~? (S) { }
2724     }
2725    
2726 wakaba 1.25 // TODO: Read and process external subset if any.
2727     lang:Perl {
2728     $self->{dont_process} = true if $has_extid;
2729     }
2730    
2731 wakaba 1.4 // ~ (MDC) { }
2732     } // _DocumentTypeDeclaration_
2733    
2734 wakaba 1.17 /*
2735     Public Identifier Literal
2736     */
2737     rule PubidLiteral ($decl) {
2738     my $pubid;
2739     my $pubid_token;
2740 wakaba 1.4 ~ (LIT) {
2741     ?lexmode SystemLiteral;
2742    
2743     ~? (STRING) {
2744 wakaba 1.17 lang:Perl ($v => $token.value) {
2745     $pubid = $v;
2746     $pubid_token = $token;
2747     }
2748 wakaba 1.4 }
2749    
2750     ~ (LIT) {
2751     ?lexmode MarkupDeclaration;
2752     } else {
2753     ?lexmode MarkupDeclaration;
2754     }
2755     } (LITA) {
2756     ?lexmode SystemLiteralA;
2757    
2758     ~? (STRING) {
2759 wakaba 1.17 lang:Perl ($v => $token.value) {
2760     $pubid = $v;
2761     $pubid_token = $token;
2762     }
2763 wakaba 1.4 }
2764    
2765     ~ (LITA) {
2766     ?lexmode MarkupDeclaration;
2767     } else {
2768     ?lexmode MarkupDeclaration;
2769     }
2770     }
2771 wakaba 1.17
2772     if-true ($pubid_token) {
2773     lang:Perl : has-error {
2774     if ($pubid =~ m{[^\x20\x0D\x0Aa-zA-Z0-9'()+,./:=?;!*#\@\$_%-]}s) {
2775     my $location;
2776     __CODE{xp|get-location-from-token::
2777     $token => {$pubid_token},
2778     $result => {$location},
2779     }__;
2780     ## Should this be other (new) error type?
2781     my $continue = __DOMCore:ERROR{xp|wf-syntax-error::
2782     xp|error-token => {$token},
2783     c|location => {$location},
2784     }__;
2785     unless ($continue) {
2786     __EXCEPTION{DOMLS|PARSE_ERR::
2787     }__;
2788     }
2789     }
2790    
2791     ## NOTE: U+0009 is syntactically illegal.
2792 wakaba 1.23 $pubid =~ s/[\x09\x0A\x0D\x20]+/\x20/gs;
2793 wakaba 1.17 $pubid =~ s/\A\x20//s;
2794     $pubid =~ s/\x20\z//s;
2795     ## NOTE: Bare attribute name is written.
2796     $decl->public_id ($pubid);
2797     }
2798     }
2799 wakaba 1.4 } // PubidLiteral
2800    
2801 wakaba 1.17 /*
2802     System Identifier Literal
2803     */
2804     rule SystemLiteral ($decl) {
2805 wakaba 1.4 ~ (LIT) {
2806     ?lexmode SystemLiteral;
2807 wakaba 1.17 &_SystemLiteral ($decl => $decl);
2808 wakaba 1.4 } (LITA) {
2809     ?lexmode SystemLiteralA;
2810 wakaba 1.17 &_SystemLiteral ($decl => $decl);
2811 wakaba 1.4 }
2812     } // SystemLiteral
2813    
2814 wakaba 1.17 /*
2815     System Identifier Literal Content
2816     */
2817     rule _SystemLiteral ($decl) {
2818     // LIT or LITA
2819    
2820 wakaba 1.4 ~? (STRING) {
2821 wakaba 1.17 lang:Perl ($v => $token.value) {
2822     ## NOTE: Bare attribute name is written.
2823     $decl->system_id ($v);
2824     }
2825 wakaba 1.4 }
2826    
2827     ~ (LIT) {
2828     ?lexmode MarkupDeclaration;
2829     } (LITA) {
2830     ?lexmode MarkupDeclaration;
2831     } else {
2832     ?lexmode MarkupDeclaration;
2833     }
2834     } // _SystemLiteral
2835    
2836     /*
2837     DTD Internal Subset
2838    
2839     intSubset := *(markupdecl / DeclSep) ;; [28b]
2840     */
2841 wakaba 1.6 rule InternalSubset ($doc, $doctype) {
2842 wakaba 1.4 ?lexmode DTD;
2843    
2844     ~* (MDO) {
2845     ?lexmode MarkupDeclaration;
2846    
2847     ~ (Name == 'ELEMENT') {
2848     &_ElementDeclaration ($doc => $doc);
2849     } (Name == 'ATTLIST') {
2850 wakaba 1.8 &_AttlistDeclaration ($doc => $doc, $doctype => $doctype);
2851 wakaba 1.4 } (Name == 'ENTITY') {
2852     &_EntityDeclaration ($doc => $doc);
2853     } (Name == 'NOTATION') {
2854     &_NotationDeclaration ($doc => $doc);
2855     }
2856     } (S) {
2857     //
2858     } (CDO) {
2859     &_CommentDeclarationDTD ($doc => $doc);
2860     } (PIO) {
2861 wakaba 1.6 &_ProcessingInstructionDTD ($doc => $doc, $doctype => $doctype);
2862 wakaba 1.4 } (PERO) {
2863     ?lexmode EntityReference;
2864    
2865 wakaba 1.19 lang:Perl {
2866     $self->{has_xref} = true;
2867 wakaba 1.25 $self->{dont_process} = true;
2868 wakaba 1.19 }
2869    
2870 wakaba 1.4 ~ (Name) {
2871    
2872     }
2873    
2874     ~ (REFC) {
2875     ?lexmode DTD;
2876     } else {
2877     ?lexmode DTD;
2878     }
2879     }
2880     } // InternalSubset
2881    
2882     rule _ElementDeclaration ($doc) {
2883     // ~ (MDO) { }
2884     // ?lexmode MarkupDeclaration
2885     // ~ (Name == 'Element') { }
2886    
2887     ~ (S) { }
2888    
2889     ~ (Name) {
2890    
2891     }
2892    
2893     ?lexmode ElementDeclaration;
2894    
2895     ~ (S) { }
2896    
2897     // contentspec
2898     ~ (MGO) {
2899     &_ContentModel ($doc => $doc);
2900     } (Name == 'EMPTY') {
2901    
2902     } (Name == 'ANY') {
2903    
2904     }
2905    
2906     ~? (S) { }
2907    
2908     ~ (MDC) {
2909     ?lexmode DTD;
2910     } else {
2911     ?lexmode DTD;
2912     }
2913     } // _ElementDeclaration
2914    
2915     rule _ContentModel ($doc) {
2916     // ~ (MGO) { }
2917    
2918     ~? (S) { }
2919    
2920     ~ (Name) {
2921     // Element content model
2922     &_ModelGroup ($doc => $doc)
2923     : unshift-current-token;
2924    
2925     ~? (OPT) {
2926    
2927     } (REP) {
2928    
2929     } (PLUS) {
2930    
2931     }
2932    
2933     } (MDO) {
2934     &_ModelGroup ($doc => $doc)
2935     : unshift-current-token;
2936    
2937     ~? (OPT) {
2938    
2939     } (REP) {
2940    
2941     } (PLUS) {
2942    
2943     }
2944    
2945     } (PCDATA) {
2946     // Mixed content declaration
2947     ~? (S) { }
2948    
2949     ~* (OR) {
2950     ~? (S) { }
2951    
2952     ~ (Name) {
2953    
2954     }
2955    
2956     ~? (S) { }
2957     }
2958    
2959     ~ (MGC) { }
2960    
2961     ~? (REP) {
2962    
2963     } else {
2964     // TODO: error if |Name|
2965     }
2966    
2967    
2968     }
2969     } // _ContentModel
2970    
2971     rule _ModelGroup ($doc)
2972     : standalone
2973     : recursive
2974     {
2975     // ~ (MGO) { }
2976     // ~? (S) { }
2977    
2978     &ContentParticle ($doc => $doc);
2979    
2980     ~? (S) { }
2981    
2982     ~? (OR) {
2983     ~? (S) { }
2984    
2985     &ContentParticle ($doc => $doc);
2986    
2987     ~? (S) { }
2988    
2989     ~* (OR) {
2990     ~? (S) { }
2991    
2992     &ContentParticle ($doc => $doc);
2993    
2994     ~? (S) { }
2995     }
2996    
2997     } (SEQ) {
2998     ~? (S) { }
2999    
3000     &ContentParticle ($doc => $doc);
3001    
3002     ~? (S) { }
3003    
3004     ~* (SEQ) {
3005     ~? (S) { }
3006    
3007     &ContentParticle ($doc => $doc);
3008    
3009     ~? (S) { }
3010     }
3011    
3012     }
3013    
3014     ~ (MGC) { }
3015     } // _ModelGroup
3016    
3017     rule ContentParticle ($doc) {
3018     ~ (Name) {
3019    
3020     } (MGO) {
3021     ~? (S) { }
3022    
3023     &_ModelGroup ($doc => $doc);
3024     }
3025    
3026     ~? (OPT) {
3027    
3028     } (REP) {
3029    
3030     } (PLUS) {
3031    
3032     }
3033     } // ContentParticle
3034    
3035 wakaba 1.8 /*
3036     Attribute list declaration
3037     */
3038     rule _AttlistDeclaration ($doc, $doctype) {
3039 wakaba 1.4 // ~ (MDO) { }
3040     // ~ (Name == 'ATTLIST') { }
3041    
3042     ?lexmode AttlistDeclaration;
3043    
3044     ~ (S) { }
3045    
3046 wakaba 1.8 my $name;
3047 wakaba 1.4 ~ (Name) {
3048 wakaba 1.8 lang:Perl ($v => $token.value) {
3049     $name = $v;
3050     }
3051     } else {
3052     lang:Perl { $name = '#ILLEGAL' }
3053     }
3054 wakaba 1.4
3055 wakaba 1.8 my $docxd;
3056     my $et;
3057     lang:Perl {
3058     $et = $doctype-><M::DTDef.getElementTypeDefinitionNode> ($name);
3059     unless ($et) {
3060 wakaba 1.11 $docxd = $doc-><M::Node.getFeature> (<Q::fe:XDoctype>, '3.0');
3061 wakaba 1.8 $et = $docxd-><M::DocumentXDoctype.createElementTypeDefinition>
3062     ($name);
3063     $doctype-><M::DTDef.setElementTypeDefinitionNode> ($et)
3064     unless $name eq '#ILLEGAL';
3065     }
3066 wakaba 1.4 }
3067    
3068     ~? (S) { }
3069    
3070     ~* (Name) {
3071 wakaba 1.8 my $at;
3072 wakaba 1.25 lang:Perl ($v => $token.value) : has-error {
3073 wakaba 1.8 $docxd ||= $doc-><M::Node.getFeature>
3074 wakaba 1.11 (<Q::fe:XDoctype>, '3.0');
3075 wakaba 1.8 $at = $docxd-><M::DocumentXDoctype.createAttributeDefinition> ($v);
3076 wakaba 1.25 if (exists $et-><AG::ETDef.attributeDefinitions>->{$v}) {
3077     my $location;
3078     __CODE{xp|get-location-from-token::
3079     $token => {$token},
3080     $result => {$location},
3081     }__;
3082     my $continue = __c|ERROR{xp|warning-attribute-definition-ignored::
3083     xp|error-token => {$token},
3084     c|location => {$location},
3085     xp|name => {$v},
3086     }__;
3087     unless ($continue) {
3088     __EXCEPTION{DOMLS|PARSE_ERR::
3089     }__;
3090     }
3091     } elsif ($self->{dont_process} and not $self->{standalone}) {
3092     my $location;
3093     __CODE{xp|get-location-from-token::
3094     $token => {$token},
3095     $result => {$location},
3096     }__;
3097     my $continue = __c|ERROR{
3098     xp|warning-attribute-definition-not-processed::
3099     xp|error-token => {$token},
3100     c|location => {$location},
3101     xp|name => {$v},
3102     }__;
3103     unless ($continue) {
3104     __EXCEPTION{DOMLS|PARSE_ERR::
3105     }__;
3106     }
3107     } else {
3108 wakaba 1.9 $et-><M::ETDef.setAttributeDefinitionNode> ($at);
3109     $self->{attr}->{$name}->{$v} = $at;
3110     }
3111 wakaba 1.8 }
3112 wakaba 1.4
3113     ~ (S) { }
3114    
3115     // AttType
3116     ~ (Name == 'NOTATION') {
3117     ~ (S) { }
3118    
3119 wakaba 1.8 my $kwd;
3120     lang:Perl {
3121     $at-><AS::ATDef.declaredType> (<C::ATDef.NOTATION_ATTR>);
3122     $kwd = $at-><AG::ATDef.allowedTokens>;
3123     }
3124    
3125 wakaba 1.4 ~ (EGO) {
3126     ~? (S) { }
3127    
3128 wakaba 1.8 ~+ (Name) {
3129     lang:Perl ($v => $token.value) {
3130     push @$kwd, $v;
3131     }
3132 wakaba 1.4
3133     ~? (S) { }
3134     } (OR) : separator {
3135     ~? (S) { }
3136     }
3137    
3138     ~ (EGC) { }
3139     }
3140 wakaba 1.8
3141 wakaba 1.4 } (Name) {
3142 wakaba 1.8 my $type;
3143     lang:Perl ($v => $token.value) : has-error {
3144     my $map = {
3145     CDATA => <C::ATDef.CDATA_ATTR>,
3146     ID => <C::ATDef.ID_ATTR>,
3147     IDREF => <C::ATDef.IDREF_ATTR>,
3148     IDREFS => <C::ATDef.IDREFS_ATTR>,
3149     ENTITY => <C::ATDef.ENTITY_ATTR>,
3150     ENTITIES => <C::ATDef.ENTITIES_ATTR>,
3151     NMTOKEN => <C::ATDef.NMTOKEN_ATTR>,
3152     NMTOKENS => <C::ATDef.NMTOKENS_ATTR>,
3153     };
3154     if ($map->{$v}) {
3155     $at-><AS::ATDef.declaredType> ($map->{$v});
3156     } else {
3157     ## TODO: Exception
3158     }
3159     }
3160 wakaba 1.4
3161     } (EGO) {
3162     ?lexmode Enumeration;
3163    
3164     ~? (S) { }
3165    
3166 wakaba 1.8 my $kwd;
3167     lang:Perl {
3168     $at-><AS::ATDef.declaredType> (<C::ATDef.ENUMERATION_ATTR>);
3169     $kwd = $at-><AG::ATDef.allowedTokens>;
3170     }
3171    
3172     ~+ (Nmtoken) {
3173     lang:Perl ($v => $token.value) {
3174     push @$kwd, $v;
3175     }
3176 wakaba 1.4
3177     ~? (S) { }
3178     } (OR) : separator {
3179     ~? (S) { }
3180     }
3181    
3182     ~ (EGC) {
3183     ?lexmode AttlistDeclaration;
3184     } else {
3185     ?lexmode AttlistDeclaration;
3186     }
3187    
3188     }
3189    
3190     ~ (S) { }
3191    
3192     // DefaultDecl
3193     ~ (RNI) {
3194     ~ (Name == 'REQUIRED') {
3195 wakaba 1.8 lang:Perl {
3196     $at-><AS::ATDef.defaultType> (<C::ATDef.REQUIRED_DEFAULT>);
3197     }
3198 wakaba 1.4 } (Name == 'IMPLIED') {
3199 wakaba 1.8 lang:Perl {
3200     $at-><AS::ATDef.defaultType> (<C::ATDef.IMPLIED_DEFAULT>);
3201     }
3202 wakaba 1.4 } (Name == 'FIXED') {
3203     ~ (S) { }
3204 wakaba 1.8
3205     lang:Perl {
3206     $at-><AS::ATDef.defaultType> (<C::ATDef.FIXED_DEFAULT>);
3207     }
3208 wakaba 1.4
3209     ~ (LIT) {
3210     my $vals;
3211     lang:Perl {
3212 wakaba 1.8 $vals = {nodes => [], value => ''};
3213 wakaba 1.4 }
3214    
3215     &_AttributeValueSpecification_ ($doc => $doc, $vals => $vals);
3216    
3217 wakaba 1.8 lang:Perl {
3218     for (@{$vals->{nodes}}) {
3219     $at-><M::Node.appendChild> ($_);
3220     }
3221     }
3222    
3223 wakaba 1.4 ~ (LIT) {
3224     ?lexmode AttlistDeclaration;
3225     } else {
3226     ?lexmode AttlistDeclaration;
3227     }
3228     } (LITA) {
3229     my $vals;
3230     lang:Perl {
3231 wakaba 1.8 $vals = {nodes => [], value => ''};
3232 wakaba 1.4 }
3233    
3234     &_AttributeValueSpecificationA_ ($doc => $doc, $vals => $vals);
3235    
3236 wakaba 1.8 lang:Perl {
3237     for (@{$vals->{nodes}}) {
3238     $at-><M::Node.appendChild> ($_);
3239     }
3240     }
3241    
3242     ~ (LITA) {
3243 wakaba 1.4 ?lexmode AttlistDeclaration;
3244     } else {
3245     ?lexmode AttlistDeclaration;
3246     }
3247     }
3248     }
3249    
3250     } (LIT) {
3251     my $vals;
3252     lang:Perl {
3253 wakaba 1.8 $at-><AS::ATDef.defaultType> (<C::ATDef.EXPLICIT_DEFAULT>);
3254     $vals = {nodes => [], value => ''};
3255 wakaba 1.4 }
3256    
3257     &_AttributeValueSpecification_ ($doc => $doc, $vals => $vals);
3258    
3259 wakaba 1.8 lang:Perl {
3260     for (@{$vals->{nodes}}) {
3261     $at-><M::Node.appendChild> ($_);
3262     }
3263     }
3264    
3265 wakaba 1.4 ~ (LIT) {
3266     ?lexmode AttlistDeclaration;
3267     } else {
3268     ?lexmode AttlistDeclaration;
3269     }
3270     } (LITA) {
3271     my $vals;
3272     lang:Perl {
3273 wakaba 1.8 $at-><AS::ATDef.defaultType> (<C::ATDef.EXPLICIT_DEFAULT>);
3274     $vals = {nodes => [], value => ''};
3275 wakaba 1.4 }
3276    
3277     &_AttributeValueSpecificationA_ ($doc => $doc, $vals => $vals);
3278    
3279 wakaba 1.8 lang:Perl {
3280     for (@{$vals->{nodes}}) {
3281     $at-><M::Node.appendChild> ($_);
3282     }
3283     }
3284    
3285 wakaba 1.4 ~ (LITA) {
3286     ?lexmode AttlistDeclaration;
3287     } else {
3288     ?lexmode AttlistDeclaration;
3289     }
3290     }
3291    
3292     } (S) : separator : terminator? {
3293     //
3294     }
3295    
3296     ~ (MDC) {
3297     ?lexmode DTD;
3298     } else {
3299     ?lexmode DTD;
3300     }
3301     } // _AttlistDeclaration
3302    
3303 wakaba 1.11 /*
3304     Entity declaration
3305     */
3306 wakaba 1.4 rule _EntityDeclaration ($doc) {
3307     // ~ (MDO) { }
3308     // ~ (Name == ENTITY) { }
3309    
3310     ~ (S) { }
3311    
3312 wakaba 1.23 my $is_param_entity;
3313 wakaba 1.6 my $decl;
3314 wakaba 1.18 lang:Perl { $decl = { name => '#ILLEGAL', reptxt => \'' }; }
3315 wakaba 1.6
3316 wakaba 1.4 ~? (PERO) {
3317     ~ (S) { }
3318 wakaba 1.6 lang:Perl {
3319 wakaba 1.23 $is_param_entity = $decl->{is_param_entity} = true;
3320 wakaba 1.6 }
3321 wakaba 1.4 }
3322    
3323 wakaba 1.19 /*
3324     TODO: Set |$decl->{is_externally_declared}| flag
3325     and |Entity.isExternallyDeclared| attribute
3326     for entity declarations in external subset or
3327     in parameter entity.
3328     */
3329    
3330 wakaba 1.4 ~ (Name) {
3331 wakaba 1.6 lang:Perl ($v => $token.value) {
3332     $decl->{name} = $v;
3333     }
3334 wakaba 1.4 }
3335    
3336 wakaba 1.18 my $node;
3337 wakaba 1.11 lang:Perl {
3338 wakaba 1.18 $node =
3339 wakaba 1.11 $decl->{node} = $self->{docx}-><M::DocumentXDoctype.createGeneralEntity>
3340     ($decl->{name});
3341     ## TODO: Parameter entity...
3342     }
3343    
3344 wakaba 1.4 ~ (S) { }
3345    
3346     ~ (LIT) {
3347 wakaba 1.6 &_EntityValue ($doc => $doc, $decl => $decl);
3348 wakaba 1.4 } (LITA) {
3349 wakaba 1.6 &_EntityValueA ($doc => $doc, $decl => $decl);
3350 wakaba 1.4 } (Name == 'PUBLIC') {
3351     ~ (S) { }
3352    
3353 wakaba 1.18 &PubidLiteral ($decl => $node);
3354 wakaba 1.4
3355     ~ (S) { }
3356    
3357 wakaba 1.18 &SystemLiteral ($decl => $node);
3358    
3359     lang:Perl {
3360     $decl->{is_external_entity} = true;
3361     }
3362 wakaba 1.4 } (Name == 'SYSTEM') {
3363     ~ (S) { }
3364    
3365 wakaba 1.18 &SystemLiteral ($decl => $node);
3366    
3367     lang:Perl {
3368     $decl->{is_external_entity} = true;
3369     }
3370 wakaba 1.4 }
3371    
3372     ~? (S) {
3373     ~? (Name == 'NDATA') {
3374 wakaba 1.23 if-true ($is_param_entity) {
3375     lang:Perl : has-error {
3376     my $location;
3377     __CODE{xp|get-location-from-token::
3378     $token => {$token},
3379     $result => {$location},
3380     }__;
3381     my $continue = __DOMCore:ERROR{xp|wf-syntax-error::
3382     xp|error-token => {$token},
3383     c|location => {$location},
3384     }__;
3385     unless ($continue) {
3386     __EXCEPTION{DOMLS|PARSE_ERR::
3387     }__;
3388     }
3389     }
3390     }
3391 wakaba 1.4
3392     ~ (S) { }
3393    
3394     ~ (Name) {
3395 wakaba 1.6 lang:Perl ($v => $token.value) {
3396     $decl->{notation} = $v;
3397 wakaba 1.11 $decl->{node}-><AG::x|Entity.notationName> ($v);
3398 wakaba 1.6 }
3399 wakaba 1.4 }
3400    
3401     ~? (S) { }
3402     }
3403     }
3404    
3405 wakaba 1.24 lang:Perl : has-error {
3406 wakaba 1.6 if ($self->{$decl->{is_param_entity} ? 'param_entity' : 'general_entity'}
3407     ->{$decl->{name}}) {
3408 wakaba 1.24 ## Predefined entity
3409     if (not $decl->{is_param_entity} and
3410     {lt => true, gt => true, amp => true,
3411     quot => true, apos => true}->{$decl->{name}}) {
3412     if ($decl->{is_external_entity}) {
3413     my $location;
3414     __CODE{xp|get-location-from-token::
3415     $token => {$token},
3416     $result => {$location},
3417     }__;
3418     my $continue = __c|ERROR{xp|error-internal-predefined-entity::
3419     xp|error-token => {$token},
3420     c|location => {$location},
3421     xp|name => {$decl->{name}},
3422     }__;
3423     unless ($continue) {
3424     __EXCEPTION{DOMLS|PARSE_ERR::
3425     }__;
3426     }
3427     } elsif (
3428     not ({gt => true, apos => true, quot => true}->{$decl->{name}} and
3429     ${$decl->{reptxt}} eq {
3430     gt => '>', apos => "'", quot => '"',
3431     }->{$decl->{name}}) and
3432     not (${$decl->{reptxt}} =~ /\A&#0*@{[{
3433     lt => '60', gt => '62', amp => '38',
3434     apos => '39', quot => '34',
3435     }->{$decl->{name}}]};\z/) and
3436     not (${$decl->{reptxt}} =~ /\A&#x0*(?:(?i)@{[{
3437     lt => '3C', gt => '3E', amp => '26',
3438     apos => '27', quot => '22',
3439     }->{$decl->{name}}]});\z/)
3440     ) {
3441     ## NOTE: See "SuikaWiki - Predefined Entities"
3442     ## "http://suika.fam.cx/gate/2005/sw/%E5%AE%9A%E7%BE%A9%E6%B8%88%E5%AE%9F%E4%BD%93".
3443     my $location;
3444     __CODE{xp|get-location-from-token::
3445     $token => {$token},
3446     $result => {$location},
3447     }__;
3448     my $continue = __c|ERROR{xp|error-malformed-predefined-entity::
3449     xp|error-token => {$token},
3450     c|location => {$location},
3451     xp|name => {$decl->{name}},
3452     xp|replacement-text => {${$decl->{reptxt}}},
3453     }__;
3454     unless ($continue) {
3455     __EXCEPTION{DOMLS|PARSE_ERR::
3456     }__;
3457     }
3458     }
3459 wakaba 1.25 $self->{dtdecl}->{<H::mn:node>}->{{
3460     lt => <H::d|hasLtDeclaration>,
3461     gt => <H::d|hasGtDeclaration>,
3462     amp => <H::d|hasAmpDeclaration>,
3463     apos => <H::d|hasAposDeclaration>,
3464     quot => <H::d|hasQuotDeclaration>,
3465     }->{$decl->{name}}} = true;
3466 wakaba 1.24 } else { ## Dupulicating declaration
3467     my $location;
3468     __CODE{xp|get-location-from-token::
3469     $token => {$token},
3470     $result => {$location},
3471     }__;
3472     my $continue = __c|ERROR{xp|warning-entity-declaration-ignored::
3473     xp|error-token => {$token},
3474     c|location => {$location},
3475     xp|name => {$decl->{name}},
3476     }__;
3477     unless ($continue) {
3478     __EXCEPTION{DOMLS|PARSE_ERR::
3479     }__;
3480     }
3481     }
3482 wakaba 1.25 } elsif ($self->{dont_process} and not $self->{standalone}) {
3483     ## TODO: |standalone| and parameter entities??
3484     my $location;
3485     __CODE{xp|get-location-from-token::
3486     $token => {$token},
3487     $result => {$location},
3488     }__;
3489     my $continue = __c|ERROR{xp|warning-entity-declaration-not-processed::
3490     xp|error-token => {$token},
3491     c|location => {$location},
3492     xp|name => {$decl->{name}},
3493     }__;
3494     unless ($continue) {
3495     __EXCEPTION{DOMLS|PARSE_ERR::
3496     }__;
3497     }
3498 wakaba 1.6 } else {
3499     $self->{$decl->{is_param_entity} ? 'param_entity' : 'general_entity'}
3500     ->{$decl->{name}} = $decl;
3501 wakaba 1.11 $self->{dtdef}-><M::DTDef.setGeneralEntityNode> ($decl->{node})
3502     unless $decl->{is_param_entity};
3503 wakaba 1.6 }
3504     }
3505    
3506 wakaba 1.4 ~ (MDC) {
3507     ?lexmode DTD;
3508     } else {
3509     ?lexmode DTD;
3510     }
3511     } // _EntityDeclaration
3512    
3513     rule _NotationDeclaration ($doc) {
3514     // ~ (MDO) { }
3515     // ~ (Name == NOTATION) { }
3516    
3517     ~ (S) { }
3518    
3519     ~ (Name) {
3520    
3521     }
3522    
3523     ~ (S) { }
3524    
3525 wakaba 1.17 my $decl;
3526     lang:Perl {
3527     $decl = $self->{docx}-><M::DocumentXDoctype.createGeneralEntity>
3528     ($decl->{name});
3529     ## Temporary: to avoid error.
3530     }
3531    
3532 wakaba 1.4 ~ (Name == 'PUBLIC') {
3533     ~ (S) { }
3534    
3535 wakaba 1.17 &PubidLiteral ($decl => $decl);
3536 wakaba 1.4
3537     ~? (S) {
3538     ~? (LIT) {
3539     ?lexmode SystemLiteral;
3540 wakaba 1.17 &_SystemLiteral ($decl => $decl);
3541 wakaba 1.4
3542     ~? (S) { }
3543     } (LITA) {
3544     ?lexmode SystemLiteralA;
3545 wakaba 1.17 &_SystemLiteral ($decl => $decl);
3546 wakaba 1.4
3547     ~? (S) { }
3548     }
3549     }
3550     } (Name == 'SYSTEM') {
3551     ~ (S) { }
3552    
3553 wakaba 1.17 &SystemLiteral ($decl => $decl);
3554 wakaba 1.4
3555     ~? (S) { }
3556     }
3557    
3558     ~ (MDC) {
3559     ?lexmode DTD;
3560     } else {
3561     ?lexmode DTD;
3562     }
3563     } // _NotationDeclaration
3564    
3565 wakaba 1.11 rule _EntityValue ($decl) {
3566 wakaba 1.4 ?lexmode EntityValue;
3567    
3568     my $vals;
3569 wakaba 1.6 my $reptxt;
3570 wakaba 1.4 lang:Perl {
3571     $vals = [];
3572 wakaba 1.6 $reptxt = '';
3573 wakaba 1.4 }
3574    
3575     ~* (STRING) {
3576 wakaba 1.6 lang:Perl ($v => $token.value) {
3577     $reptxt .= $v;
3578     }
3579 wakaba 1.4 } (PERO) {
3580 wakaba 1.25 ?lexmode EntityReference;
3581 wakaba 1.19
3582     lang:Perl {
3583     $self->{has_xref} = true;
3584 wakaba 1.25 $self->{dont_process} = true;
3585 wakaba 1.19 }
3586 wakaba 1.6
3587     // TODO: Expand or wferror if internal subset
3588 wakaba 1.4
3589     ~ (Name) {
3590    
3591 wakaba 1.25 // Note that external subset and parameter entities are not supported
3592     lang:Perl ($name => $token.value) : has-error {
3593     my $location;
3594     __CODE{xp|get-location-from-token::
3595     $token => {$token},
3596     $result => {$location},
3597     }__;
3598     my $continue = __c|ERROR{xp|wf-pes-in-internal-subset::
3599     xp|error-token => {$token},
3600     c|location => {$location},
3601     xp|name => {$name},
3602     }__;
3603     unless ($continue) {
3604     __EXCEPTION{DOMLS|PARSE_ERR::
3605     }__;
3606     }
3607     }
3608 wakaba 1.4 }
3609    
3610     ~ (REFC) {
3611     ?lexmode EntityValue;
3612     } else {
3613     ?lexmode EntityValue;
3614     }
3615     } (HCRO) {
3616 wakaba 1.11 &_HexadecimalCharacterReferenceEV_ ($vals => $vals);
3617 wakaba 1.4
3618 wakaba 1.6 lang:Perl {
3619 wakaba 1.11 $reptxt .= $vals->[-1];
3620 wakaba 1.6 }
3621    
3622 wakaba 1.4 ~ (REFC) {
3623     ?lexmode EntityValue;
3624     } else {
3625     ?lexmode EntityValue;
3626     }
3627     } (CRO) {
3628 wakaba 1.11 &_NumericCharacterReferenceEV_ ($vals => $vals);
3629 wakaba 1.6
3630     lang:Perl {
3631 wakaba 1.11 $reptxt .= $vals->[-1];
3632 wakaba 1.6 }
3633 wakaba 1.4
3634     ~ (REFC) {
3635     ?lexmode EntityValue;
3636     } else {
3637     ?lexmode EntityValue;
3638     }
3639     } (ERO) {
3640 wakaba 1.11 &_GeneralEntityReferenceEV_ ($vals => $vals);
3641 wakaba 1.4
3642 wakaba 1.6 lang:Perl {
3643 wakaba 1.11 $reptxt .= '&' . $vals->[-1] . ';';
3644 wakaba 1.6 }
3645    
3646 wakaba 1.4 ~ (REFC) {
3647     ?lexmode EntityValue;
3648     } else {
3649     ?lexmode EntityValue;
3650     }
3651     }
3652    
3653     ~ (LIT) {
3654     ?lexmode MarkupDeclaration;
3655     } (LITA) {
3656     ?lexmode MarkupDeclaration;
3657     } else {
3658     ?lexmode MarkupDeclaration;
3659     }
3660 wakaba 1.6
3661     lang:Perl {
3662     $decl->{reptxt} = \$reptxt;
3663 wakaba 1.19 $decl->{has_replacement_text} = true;
3664 wakaba 1.6 }
3665 wakaba 1.4 } // _EntityValue
3666    
3667 wakaba 1.11 rule _EntityValueA ($decl) {
3668 wakaba 1.4 ?lexmode EntityValueA;
3669    
3670     my $vals;
3671 wakaba 1.6 my $reptxt;
3672 wakaba 1.4 lang:Perl {
3673     $vals = [];
3674 wakaba 1.6 $reptxt = '';
3675 wakaba 1.4 }
3676    
3677     ~* (STRING) {
3678 wakaba 1.6 lang:Perl ($v => $token.value) {
3679     $reptxt .= $v;
3680     }
3681 wakaba 1.4 } (PERO) {
3682 wakaba 1.25 ?lexmode EntityReference;
3683 wakaba 1.4
3684 wakaba 1.19 lang:Perl {
3685     $self->{has_xref} = true;
3686 wakaba 1.25 $self->{dont_process} = true;
3687 wakaba 1.19 }
3688    
3689 wakaba 1.6 // TODO: implement this
3690 wakaba 1.4 ~ (Name) {
3691    
3692 wakaba 1.25 // Note that external subset and parameter entities are not supported
3693     lang:Perl ($name => $token.value) : has-error {
3694     my $location;
3695     __CODE{xp|get-location-from-token::
3696     $token => {$token},
3697     $result => {$location},
3698     }__;
3699     my $continue = __c|ERROR{xp|wf-pes-in-internal-subset::
3700     xp|error-token => {$token},
3701     c|location => {$location},
3702     xp|name => {$name},
3703     }__;
3704     unless ($continue) {
3705     __EXCEPTION{DOMLS|PARSE_ERR::
3706     }__;
3707     }
3708     }
3709 wakaba 1.4 }
3710    
3711     ~ (REFC) {
3712     ?lexmode EntityValueA;
3713     } else {
3714     ?lexmode EntityValueA;
3715     }
3716     } (HCRO) {
3717 wakaba 1.11 &_HexadecimalCharacterReferenceEV_ ($vals => $vals);
3718 wakaba 1.4
3719 wakaba 1.6 lang:Perl {
3720 wakaba 1.11 $reptxt .= $vals->[-1];
3721 wakaba 1.6 }
3722    
3723    
3724 wakaba 1.4 ~ (REFC) {
3725     ?lexmode EntityValueA;
3726     } else {
3727     ?lexmode EntityValueA;
3728     }
3729     } (CRO) {
3730 wakaba 1.11 &_NumericCharacterReferenceEV_ ($vals => $vals);
3731 wakaba 1.4
3732 wakaba 1.6 lang:Perl {
3733 wakaba 1.11 $reptxt .= $vals->[-1];
3734 wakaba 1.6 }
3735    
3736 wakaba 1.4 ~ (REFC) {
3737     ?lexmode EntityValueA;
3738     } else {
3739     ?lexmode EntityValueA;
3740     }
3741     } (ERO) {
3742 wakaba 1.11 &_GeneralEntityReferenceEV_ ($vals => $vals);
3743 wakaba 1.4
3744 wakaba 1.6 lang:Perl {
3745 wakaba 1.11 $reptxt .= '&' . $vals->[-1] . ';';
3746 wakaba 1.6 }
3747    
3748 wakaba 1.4 ~ (REFC) {
3749     ?lexmode EntityValueA;
3750     } else {
3751     ?lexmode EntityValueA;
3752     }
3753     }
3754    
3755     ~ (LITA) {
3756     ?lexmode MarkupDeclaration;
3757     } else {
3758     ?lexmode MarkupDeclaration;
3759     }
3760 wakaba 1.6
3761     lang:Perl {
3762     $decl->{reptxt} = \$reptxt;
3763 wakaba 1.19 $decl->{has_replacement_text} = true;
3764 wakaba 1.6 }
3765 wakaba 1.4 } // _EntityValueA
3766    
3767    
3768     /*
3769     XML Name
3770     */
3771     lexmode NameChar {
3772     $NameStartChar10 := [
3773     '_' ':'
3774     // Letter
3775     // BaseChar
3776     U+0041..U+005A U+0061..U+007A U+00C0..U+00D6
3777     U+00D8..U+00F6 U+00F8..U+00FF U+0100..U+0131
3778     U+0134..U+013E U+0141..U+0148 U+014A..U+017E
3779     U+0180..U+01C3 U+01CD..U+01F0 U+01F4..U+01F5
3780     U+01FA..U+0217 U+0250..U+02A8 U+02BB..U+02C1
3781     U+0386 U+0388..U+038A U+038C U+038E..U+03A1
3782     U+03A3..U+03CE U+03D0..U+03D6 U+03DA U+03DC
3783     U+03DE U+03E0 U+03E2..U+03F3 U+0401..U+040C
3784     U+040E..U+044F U+0451..U+045C U+045E..U+0481
3785     U+0490..U+04C4 U+04C7..U+04C8 U+04CB..U+04CC
3786     U+04D0..U+04EB U+04EE..U+04F5 U+04F8..U+04F9
3787     U+0531..U+0556 U+0559 U+0561..U+0586
3788     U+05D0..U+05EA U+05F0..U+05F2 U+0621..U+063A
3789     U+0641..U+064A U+0671..U+06B7 U+06BA..U+06BE
3790     U+06C0..U+06CE U+06D0..U+06D3 U+06D5
3791     U+06E5..U+06E6 U+0905..U+0939 U+093D
3792     U+0958..U+0961 U+0985..U+098C U+098F..U+0990
3793     U+0993..U+09A8 U+09AA..U+09B0 U+09B2
3794     U+09B6..U+09B9 U+09DC..U+09DD U+09DF..U+09E1
3795     U+09F0..U+09F1 U+0A05..U+0A0A U+0A0F..U+0A10
3796     U+0A13..U+0A28 U+0A2A..U+0A30 U+0A32..U+0A33
3797     U+0A35..U+0A36 U+0A38..U+0A39 U+0A59..U+0A5C
3798     U+0A5E U+0A72..U+0A74 U+0A85..U+0A8B U+0A8D
3799     U+0A8F..U+0A91 U+0A93..U+0AA8 U+0AAA..U+0AB0
3800     U+0AB2..U+0AB3 U+0AB5..U+0AB9 U+0ABD U+0AE0
3801     U+0B05..U+0B0C U+0B0F..U+0B10 U+0B13..U+0B28
3802     U+0B2A..U+0B30 U+0B32..U+0B33 U+0B36..U+0B39
3803     U+0B3D U+0B5C..U+0B5D U+0B5F..U+0B61
3804     U+0B85..U+0B8A U+0B8E..U+0B90 U+0B92..U+0B95
3805     U+0B99..U+0B9A U+0B9C U+0B9E..U+0B9F
3806     U+0BA3..U+0BA4 U+0BA8..U+0BAA U+0BAE..U+0BB5
3807     U+0BB7..U+0BB9 U+0C05..U+0C0C U+0C0E..U+0C10
3808     U+0C12..U+0C28 U+0C2A..U+0C33 U+0C35..U+0C39
3809     U+0C60..U+0C61 U+0C85..U+0C8C U+0C8E..U+0C90
3810     U+0C92..U+0CA8 U+0CAA..U+0CB3 U+0CB5..U+0CB9
3811     U+0CDE U+0CE0..U+0CE1 U+0D05..U+0D0C
3812     U+0D0E..U+0D10 U+0D12..U+0D28 U+0D2A..U+0D39
3813     U+0D60..U+0D61 U+0E01..U+0E2E U+0E30
3814     U+0E32..U+0E33 U+0E40..U+0E45 U+0E81..U+0E82
3815     U+0E84 U+0E87..U+0E88 U+0E8A U+0E8D
3816     U+0E94..U+0E97 U+0E99..U+0E9F U+0EA1..U+0EA3
3817     U+0EA5 U+0EA7 U+0EAA..U+0EAB U+0EAD..U+0EAE
3818     U+0EB0 U+0EB2..U+0EB3 U+0EBD U+0EC0..U+0EC4
3819     U+0F40..U+0F47 U+0F49..U+0F69 U+10A0..U+10C5
3820     U+10D0..U+10F6 U+1100 U+1102..U+1103
3821     U+1105..U+1107 U+1109 U+110B..U+110C
3822     U+110E..U+1112 U+113C U+113E U+1140 U+114C
3823     U+114E U+1150 U+1154..U+1155 U+1159
3824     U+115F..U+1161 U+1163 U+1165 U+1167 U+1169
3825     U+116D..U+116E U+1172..U+1173 U+1175 U+119E
3826     U+11A8 U+11AB U+11AE..U+11AF U+11B7..U+11B8
3827     U+11BA U+11BC..U+11C2 U+11EB U+11F0 U+11F9
3828     U+1E00..U+1E9B U+1EA0..U+1EF9 U+1F00..U+1F15
3829     U+1F18..U+1F1D U+1F20..U+1F45 U+1F48..U+1F4D
3830     U+1F50..U+1F57 U+1F59 U+1F5B U+1F5D
3831     U+1F5F..U+1F7D U+1F80..U+1FB4 U+1FB6..U+1FBC
3832     U+1FBE U+1FC2..U+1FC4 U+1FC6..U+1FCC
3833     U+1FD0..U+1FD3 U+1FD6..U+1FDB U+1FE0..U+1FEC
3834     U+1FF2..U+1FF4 U+1FF6..U+1FFC U+2126
3835     U+212A..U+212B U+212E U+2180..U+2182
3836     U+3041..U+3094 U+30A1..U+30FA U+3105..U+312C
3837     U+AC00..U+D7A3
3838     // Ideographic
3839     U+4E00..U+9FA5 U+3007 U+3021..U+3029
3840     ];
3841     $NameChar10 := [
3842     '.' '-' '_' ':'
3843     // Letter
3844     // BaseChar
3845     U+0041..U+005A U+0061..U+007A U+00C0..U+00D6
3846     U+00D8..U+00F6 U+00F8..U+00FF U+0100..U+0131
3847     U+0134..U+013E U+0141..U+0148 U+014A..U+017E
3848     U+0180..U+01C3 U+01CD..U+01F0 U+01F4..U+01F5
3849     U+01FA..U+0217 U+0250..U+02A8 U+02BB..U+02C1
3850     U+0386 U+0388..U+038A U+038C U+038E..U+03A1
3851     U+03A3..U+03CE U+03D0..U+03D6 U+03DA U+03DC
3852     U+03DE U+03E0 U+03E2..U+03F3 U+0401..U+040C
3853     U+040E..U+044F U+0451..U+045C U+045E..U+0481
3854     U+0490..U+04C4 U+04C7..U+04C8 U+04CB..U+04CC
3855     U+04D0..U+04EB U+04EE..U+04F5 U+04F8..U+04F9
3856     U+0531..U+0556 U+0559 U+0561..U+0586
3857     U+05D0..U+05EA U+05F0..U+05F2 U+0621..U+063A
3858     U+0641..U+064A U+0671..U+06B7 U+06BA..U+06BE
3859     U+06C0..U+06CE U+06D0..U+06D3 U+06D5
3860     U+06E5..U+06E6 U+0905..U+0939 U+093D
3861     U+0958..U+0961 U+0985..U+098C U+098F..U+0990
3862     U+0993..U+09A8 U+09AA..U+09B0 U+09B2
3863     U+09B6..U+09B9 U+09DC..U+09DD U+09DF..U+09E1
3864     U+09F0..U+09F1 U+0A05..U+0A0A U+0A0F..U+0A10
3865     U+0A13..U+0A28 U+0A2A..U+0A30 U+0A32..U+0A33
3866     U+0A35..U+0A36 U+0A38..U+0A39 U+0A59..U+0A5C
3867     U+0A5E U+0A72..U+0A74 U+0A85..U+0A8B U+0A8D
3868     U+0A8F..U+0A91 U+0A93..U+0AA8 U+0AAA..U+0AB0
3869     U+0AB2..U+0AB3 U+0AB5..U+0AB9 U+0ABD U+0AE0
3870     U+0B05..U+0B0C U+0B0F..U+0B10 U+0B13..U+0B28
3871     U+0B2A..U+0B30 U+0B32..U+0B33 U+0B36..U+0B39
3872     U+0B3D U+0B5C..U+0B5D U+0B5F..U+0B61
3873     U+0B85..U+0B8A U+0B8E..U+0B90 U+0B92..U+0B95
3874     U+0B99..U+0B9A U+0B9C U+0B9E..U+0B9F
3875     U+0BA3..U+0BA4 U+0BA8..U+0BAA U+0BAE..U+0BB5
3876     U+0BB7..U+0BB9 U+0C05..U+0C0C U+0C0E..U+0C10
3877     U+0C12..U+0C28 U+0C2A..U+0C33 U+0C35..U+0C39
3878     U+0C60..U+0C61 U+0C85..U+0C8C U+0C8E..U+0C90
3879     U+0C92..U+0CA8 U+0CAA..U+0CB3 U+0CB5..U+0CB9
3880     U+0CDE U+0CE0..U+0CE1 U+0D05..U+0D0C
3881     U+0D0E..U+0D10 U+0D12..U+0D28 U+0D2A..U+0D39
3882     U+0D60..U+0D61 U+0E01..U+0E2E U+0E30
3883     U+0E32..U+0E33 U+0E40..U+0E45 U+0E81..U+0E82
3884     U+0E84 U+0E87..U+0E88 U+0E8A U+0E8D
3885     U+0E94..U+0E97 U+0E99..U+0E9F U+0EA1..U+0EA3
3886     U+0EA5 U+0EA7 U+0EAA..U+0EAB U+0EAD..U+0EAE
3887     U+0EB0 U+0EB2..U+0EB3 U+0EBD U+0EC0..U+0EC4
3888     U+0F40..U+0F47 U+0F49..U+0F69 U+10A0..U+10C5
3889     U+10D0..U+10F6 U+1100 U+1102..U+1103
3890     U+1105..U+1107 U+1109 U+110B..U+110C
3891     U+110E..U+1112 U+113C U+113E U+1140 U+114C
3892     U+114E U+1150 U+1154..U+1155 U+1159
3893     U+115F..U+1161 U+1163 U+1165 U+1167 U+1169
3894     U+116D..U+116E U+1172..U+1173 U+1175 U+119E
3895     U+11A8 U+11AB U+11AE..U+11AF U+11B7..U+11B8
3896     U+11BA U+11BC..U+11C2 U+11EB U+11F0 U+11F9
3897     U+1E00..U+1E9B U+1EA0..U+1EF9 U+1F00..U+1F15
3898     U+1F18..U+1F1D U+1F20..U+1F45 U+1F48..U+1F4D
3899     U+1F50..U+1F57 U+1F59 U+1F5B U+1F5D
3900     U+1F5F..U+1F7D U+1F80..U+1FB4 U+1FB6..U+1FBC
3901     U+1FBE U+1FC2..U+1FC4 U+1FC6..U+1FCC
3902     U+1FD0..U+1FD3 U+1FD6..U+1FDB U+1FE0..U+1FEC
3903     U+1FF2..U+1FF4 U+1FF6..U+1FFC U+2126
3904     U+212A..U+212B U+212E U+2180..U+2182
3905     U+3041..U+3094 U+30A1..U+30FA U+3105..U+312C
3906     U+AC00..U+D7A3
3907     // Ideographic
3908     U+4E00..U+9FA5 U+3007 U+3021..U+3029
3909     // Digit
3910     U+0030..U+0039 U+0660..U+0669 U+06F0..U+06F9
3911     U+0966..U+096F U+09E6..U+09EF U+0A66..U+0A6F
3912     U+0AE6..U+0AEF U+0B66..U+0B6F U+0BE7..U+0BEF
3913     U+0C66..U+0C6F U+0CE6..U+0CEF U+0D66..U+0D6F
3914     U+0E50..U+0E59 U+0ED0..U+0ED9 U+0F20..U+0F29
3915     // CombiningChar
3916     U+0300..U+0345 U+0360..U+0361 U+0483..U+0486
3917     U+0591..U+05A1 U+05A3..U+05B9 U+05BB..U+05BD
3918     U+05BF U+05C1..U+05C2 U+05C4 U+064B..U+0652
3919     U+0670 U+06D6..U+06DC U+06DD..U+06DF
3920     U+06E0..U+06E4 U+06E7..U+06E8 U+06EA..U+06ED
3921     U+0901..U+0903 U+093C U+093E..U+094C U+094D
3922     U+0951..U+0954 U+0962..U+0963 U+0981..U+0983
3923     U+09BC U+09BE U+09BF U+09C0..U+09C4
3924     U+09C7..U+09C8 U+09CB..U+09CD U+09D7
3925     U+09E2..U+09E3 U+0A02 U+0A3C U+0A3E U+0A3F
3926     U+0A40..U+0A42 U+0A47..U+0A48 U+0A4B..U+0A4D
3927     U+0A70..U+0A71 U+0A81..U+0A83 U+0ABC
3928     U+0ABE..U+0AC5 U+0AC7..U+0AC9 U+0ACB..U+0ACD
3929     U+0B01..U+0B03 U+0B3C U+0B3E..U+0B43
3930     U+0B47..U+0B48 U+0B4B..U+0B4D U+0B56..U+0B57
3931     U+0B82..U+0B83 U+0BBE..U+0BC2 U+0BC6..U+0BC8
3932     U+0BCA..U+0BCD U+0BD7 U+0C01..U+0C03
3933     U+0C3E..U+0C44 U+0C46..U+0C48 U+0C4A..U+0C4D
3934     U+0C55..U+0C56 U+0C82..U+0C83 U+0CBE..U+0CC4
3935     U+0CC6..U+0CC8 U+0CCA..U+0CCD U+0CD5..U+0CD6
3936     U+0D02..U+0D03 U+0D3E..U+0D43 U+0D46..U+0D48
3937     U+0D4A..U+0D4D U+0D57 U+0E31 U+0E34..U+0E3A
3938     U+0E47..U+0E4E U+0EB1 U+0EB4..U+0EB9
3939     U+0EBB..U+0EBC U+0EC8..U+0ECD U+0F18..U+0F19
3940     U+0F35 U+0F37 U+0F39 U+0F3E U+0F3F
3941     U+0F71..U+0F84 U+0F86..U+0F8B U+0F90..U+0F95
3942     U+0F97 U+0F99..U+0FAD U+0FB1..U+0FB7 U+0FB9
3943     U+20D0..U+20DC U+20E1 U+302A..U+302F U+3099
3944     U+309A
3945     // Extender
3946     U+00B7 U+02D0 U+02D1 U+0387 U+0640 U+0E46
3947     U+0EC6 U+3005 U+3031..U+3035 U+309D..U+309E
3948     U+30FC..U+30FE
3949     ];
3950 wakaba 1.1
3951     $NameStartChar11 := [
3952     ':' '_'
3953     'A' 'B' 'C' 'D' 'E' 'F' 'G' 'H' 'I' 'J' 'K' 'L' 'M'
3954     'N' 'O' 'P' 'Q' 'R' 'S' 'T' 'U' 'V' 'W' 'X' 'Y' 'Z'
3955     'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm'
3956     'n' 'o' 'p' 'q' 'r' 's' 't' 'u' 'v' 'w' 'x' 'y' 'z'
3957     U+00C0..U+00D6 U+00D8..U+00F6 U+00F8..U+02FF
3958     U+0370..U+037D U+037F..U+1FFF U+200C..U+200D
3959     U+2070..U+218F U+2C00..U+2FEF U+3001..U+D7FF
3960     U+F900..U+FDCF U+FDF0..U+FFFD U+10000..U+EFFFF
3961     ];
3962     $NameChar11 := [
3963     '-' '.' '0' '1' '2' '3' '4' '5' '6' '7' '8' '9'
3964     U+00B7 U+0300..U+036F U+203F..U+2040
3965     // NameStartChar
3966     ':' '_'
3967     'A' 'B' 'C' 'D' 'E' 'F' 'G' 'H' 'I' 'J' 'K' 'L' 'M'
3968     'N' 'O' 'P' 'Q' 'R' 'S' 'T' 'U' 'V' 'W' 'X' 'Y' 'Z'
3969     'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm'
3970     'n' 'o' 'p' 'q' 'r' 's' 't' 'u' 'v' 'w' 'x' 'y' 'z'
3971     U+00C0..U+00D6 U+00D8..U+00F6 U+00F8..U+02FF
3972     U+0370..U+037D U+037F..U+1FFF U+200C..U+200D
3973     U+2070..U+218F U+2C00..U+2FEF U+3001..U+D7FF
3974     U+F900..U+FDCF U+FDF0..U+FFFD U+10000..U+EFFFF
3975     ];
3976 wakaba 1.4 } // NameChar
3977    
3978     lexmode Name
3979     : extends => 'NameChar'
3980     {
3981 wakaba 1.1 Name : value := $NameStartChar11 $NameChar11*;
3982     } // Name
3983 wakaba 1.4
3984     lexmode Nmtoken
3985     : extends => 'NameChar'
3986     {
3987     Nmtoken : value := $NameChar11*;
3988     } // Nmtoken
3989 wakaba 1.1
3990     /*
3991 wakaba 1.14 S
3992 wakaba 1.1 */
3993     lexmode S {
3994 wakaba 1.14 $s := [U+0009 U+000A U+000D U+0020];
3995     S := $s+;
3996 wakaba 1.1 } // S
3997    
3998     /*
3999     Document end scanning mode
4000     */
4001     lexmode DocumentEnd
4002     : standalone
4003     : extends => 'S'
4004     {
4005     /*
4006     Processing instruction
4007     */
4008     PIO := ['<'] ['?'];
4009    
4010     /*
4011     Comment declaration
4012     */
4013     CDO := ['<'] ['!'] ['-'] ['-'];
4014     } // DocumentEnd
4015    
4016     /*
4017     Document misc scanning mode
4018    
4019     This mode scans |Misc| constructions as well
4020     as document element's start tag.
4021     */
4022     lexmode DocumentMisc
4023     : standalone
4024     : extends => 'DocumentEnd'
4025     {
4026     /*
4027     Document element start tag
4028     */
4029     STAGO := ['<'];
4030     } // DocumentMisc
4031    
4032     /*
4033     Document prolog scanning mode
4034     */
4035     lexmode DocumentProlog
4036     : standalone
4037     : extends => 'DocumentMisc'
4038     {
4039     /*
4040     |DOCTYPE| declaration
4041     */
4042     MDO := ['<'] ['!'];
4043     } // DocumentProlog
4044 wakaba 1.16
4045 wakaba 1.1 /*
4046 wakaba 1.16 Document Start Scanning Mode
4047 wakaba 1.1 */
4048     lexmode DocumentStart
4049     : standalone
4050     : extends => 'DocumentProlog'
4051     {
4052     /*
4053     XML declaration
4054     */
4055 wakaba 1.16 XDO := ['<'] ['?'] ['x'] ['m'] ['l'];
4056 wakaba 1.1 } // DocumentStart
4057    
4058     /*
4059     Comment declaration scanning mode
4060     */
4061     lexmode CommentDeclaration
4062     : standalone
4063     {
4064     /*
4065     Comment close
4066     */
4067     COM := ['-'] ['-'];
4068    
4069     /*
4070     Comment data
4071     */
4072 wakaba 1.15 ?default-token STRING : value;
4073 wakaba 1.1 } // CommentDeclaration
4074    
4075     /*
4076     Processing instruction name and |S| scanning mode
4077     */
4078     lexmode PIName
4079     : standalone
4080     : extends => 'Name'
4081     : extends => 'S'
4082     {
4083     /*
4084     Processing instruction close
4085     */
4086     PIC := ['?'] ['>'];
4087     } // PIName
4088    
4089     /*
4090 wakaba 1.16 Processing instruction name and |S| scanning mode
4091     */
4092     lexmode PINmtoken
4093     : standalone
4094     : extends => 'Nmtoken'
4095     : extends => 'S'
4096     {
4097     /*
4098     Processing instruction close
4099     */
4100     PIC := ['?'] ['>'];
4101     } // PINmtoken
4102    
4103     /*
4104 wakaba 1.1 Processing instruction data scanning mode
4105     */
4106     lexmode PIData
4107     : standalone
4108     {
4109     /*
4110     Processing instruction close
4111     */
4112     PIC := ['?'] ['>'];
4113    
4114     /*
4115     Processing instruction target data
4116     */
4117 wakaba 1.2 ?default-token DATA : value;
4118 wakaba 1.1 } // PIData
4119    
4120     /*
4121     Content of element scanning mode
4122     */
4123     lexmode ElementContent
4124     : standalone
4125     {
4126     /*
4127     Start tag open
4128     */
4129     STAGO := ['<'];
4130    
4131     /*
4132     End tag open
4133     */
4134     ETAGO := ['<'] ['/'];
4135    
4136     /*
4137     Hexadecimal character reference open
4138     */
4139     HCRO := ['&'] ['#'] ['x'];
4140    
4141     /*
4142     Numeric character reference open
4143     */
4144     CRO := ['&'] ['#'];
4145    
4146     /*
4147     General entity reference open
4148     */
4149     ERO := ['&'];
4150    
4151     /*
4152     Comment declaration open
4153     */
4154     CDO := ['<'] ['!'] ['-'] ['-'];
4155    
4156     /*
4157     CDATA section open
4158     */
4159     CDSO := ['<'] ['!'] ['[']
4160     ['C'] ['D'] ['A'] ['T'] ['A'] ['['];
4161    
4162     /*
4163     Processing instruction open
4164     */
4165     PIO := ['<'] ['?'];
4166 wakaba 1.2
4167     /*
4168     Markup section end
4169     */
4170     MSE := [']'] [']'] ['>'];
4171    
4172     /*
4173     Character data
4174     */
4175     /*
4176     Character data and/or |MSE|
4177     */
4178     ?default-token CharData : value;
4179 wakaba 1.1 } // ElementContent
4180    
4181     /*
4182     CDATA section content scanning mode
4183     */
4184     lexmode CDATASectionContent
4185     : standalone
4186     {
4187     /*
4188     Markup section end
4189     */
4190     MSE := [']'] [']'] ['>'];
4191    
4192     /*
4193     Character data
4194 wakaba 1.2 */
4195     ?default-token CData : value;
4196 wakaba 1.1 } // CDATASectionContent
4197    
4198     lexmode EntityReference
4199     : standalone
4200     : extends => 'Name'
4201     {
4202     /*
4203     Reference close
4204     */
4205     REFC := [';'];
4206     } // EntityReference
4207    
4208     lexmode NumericCharacterReference
4209     : standalone
4210     {
4211     /*
4212     Decimal number
4213     */
4214     $digit := ['0' '1' '2' '3' '4' '5' '6' '7' '8' '9'];
4215     NUMBER : value := $digit+;
4216    
4217     /*
4218     Reference close
4219     */
4220     REFC := [';'];
4221     } // NumericCharacterReference
4222    
4223     lexmode HexadecimalCharacterReference
4224     : standalone
4225     {
4226     /*
4227     Hexadecimal number
4228     */
4229     $hexdigit := ['0' '1' '2' '3' '4' '5' '6' '7' '8' '9'
4230     'A' 'B' 'C' 'D' 'E' 'F'
4231     'a' 'b' 'c' 'd' 'e' 'f'];
4232     Hex : value := $hexdigit+;
4233    
4234     /*
4235     Reference close
4236     */
4237     REFC := [';'];
4238     } // HexadecimalCharacterReference
4239    
4240 wakaba 1.16 /*
4241     The XML Declaration and Text Declaration Scanning Mode
4242     */
4243 wakaba 1.3 lexmode XMLDeclaration
4244     : standalone
4245     : extends => 'Name'
4246     : extends => 'S'
4247     {
4248    
4249     /*
4250     Value indicator
4251     */
4252     VI := ['='];
4253    
4254     /*
4255     Literal open
4256     */
4257     LIT := ['"'];
4258     LITA := [U+0027];
4259    
4260     /*
4261     Processing instruction close
4262 wakaba 1.16
4263     The |PIC|, i.e. |?>|, is split into two tokens |PIC1| and |PIC2|
4264     in this scanning mode to set |no_xml11_eol| flag in the
4265     |_XMLDeclaration_| |rule|.
4266 wakaba 1.3 */
4267 wakaba 1.16 PIC1 := ['?'];
4268     PIC2 := ['>'];
4269 wakaba 1.3 } // XMLDeclaration
4270 wakaba 1.16
4271     /*
4272     The XML Declaration or Processing Instruction Scanning Mode
4273    
4274     '<?xml' S ...
4275     (DocumentStart) (XMLDeclarationOrPI) (XMLDeclaration)
4276     '<?xml' '1' S ...
4277     (DocumentStart) (XMLDeclarationOrPI) (PINmtoken)(PIName) (PITarget)
4278     '<?xml' '-' 'stylesheet' S ...
4279     (DocumentStart) (XMLDeclarationOrPI) (PINmtoken) (PIName) (PITarget)
4280     */
4281     lexmode XMLDeclarationOrPI
4282     : standalone
4283     : extends => 'NameChar'
4284     : extends => 'S'
4285     {
4286     NameChar : value := $NameChar11;
4287     } // XMLDeclarationOrPI
4288 wakaba 1.3
4289 wakaba 1.1 lexmode StartTag
4290     : standalone
4291     : extends => 'Name'
4292     : extends => 'S'
4293     {
4294    
4295     /*
4296     Value indicator
4297     */
4298     VI := ['='];
4299    
4300     /*
4301     Literal open
4302     */
4303     LIT := ['"'];
4304     LITA := [U+0027];
4305    
4306     /*
4307     Tag close
4308     */
4309     TAGC := ['>'];
4310    
4311     /*
4312 wakaba 1.6 Null end-tag enabled start-tag close
4313 wakaba 1.1 */
4314 wakaba 1.6 NESTC := ['/'];
4315 wakaba 1.1 } // StartTag
4316    
4317     lexmode EndTag
4318     : standalone
4319     : extends => 'Name'
4320     : extends => 'S'
4321     {
4322     /*
4323     Tag close
4324     */
4325     TAGC := ['>'];
4326     } // EndTag
4327    
4328     lexmode AttributeValueLiteral_ {
4329     ERO := ['&'];
4330     CRO := ['&'] ['#'];
4331     HCRO := ['&'] ['#'] ['x'];
4332     } // AttributeValueLiteral_
4333    
4334     lexmode AttributeValueLiteral
4335     : standalone
4336     : extends => 'AttributeValueLiteral_'
4337     {
4338     LIT := ['"'];
4339 wakaba 1.3 STRING : value := [^'"' '&' '<']+;
4340 wakaba 1.1 } // AttributeValueLiteral
4341    
4342     lexmode AttributeValueLiteralA
4343     : standalone
4344     : extends => 'AttributeValueLiteral_'
4345     {
4346 wakaba 1.4 LITA := [U+0027];
4347 wakaba 1.3 STRING : value := [^U+0027 '&' '<']+;
4348 wakaba 1.1 } // AttributeValueLiteralA
4349 wakaba 1.11
4350     lexmode AttributeValueLiteralE
4351     : standalone
4352     : extends => 'AttributeValueLiteral_'
4353     {
4354     STRING : value := [^'&' '<']+;
4355     } // AttributeValueLiteralE
4356 wakaba 1.4
4357     lexmode EntityValue_ {
4358     PERO := ['%'];
4359     ERO := ['&'];
4360     CRO := ['&'] ['#'];
4361     HCRO := ['&'] ['#'] ['x'];
4362     } // EntityValue_
4363    
4364     lexmode EntityValue
4365     : standalone
4366     : extends => 'EntityValue_'
4367     {
4368     LIT := ['"'];
4369     STRING : value := [^'"' '&' '%']+;
4370     } // EntityValue
4371    
4372     lexmode EntityValueA
4373     : standalone
4374     : extends => 'EntityValue_'
4375     {
4376     LITA := [U+0027];
4377     STRING : value := [^U+0027 '&' '%']+;
4378     } // EntityValueA
4379    
4380     lexmode SystemLiteral
4381     : standalone
4382     {
4383     LIT := ['"'];
4384     ?default-token STRING : value;
4385     } // SystemLiteral
4386    
4387     lexmode SystemLiteralA
4388     : standalone
4389     {
4390     LITA := [U+0027];
4391     ?default-token STRING : value;
4392     } // SystemLiteralA
4393    
4394     lexmode DTD
4395     : standalone
4396     : extends => 'S'
4397     {
4398     /*
4399     Markup declaration open
4400     */
4401     MDO := ['<'] ['!'];
4402    
4403     /*
4404     Comment declaration open
4405     */
4406     CDO := ['<'] ['!'] ['-'] ['-'];
4407    
4408     /*
4409     Processing instruction open
4410     */
4411     PIO := ['<'] ['?'];
4412    
4413     /*
4414     Parameter entity reference open
4415     */
4416     PERO := ['%'];
4417    
4418     /*
4419     Declaration subset close
4420     */
4421     DSC := [']'];
4422    
4423     /*
4424     Contition section open
4425     */
4426     CSO := ['<'] ['!'] ['['];
4427     } // DTD
4428    
4429     /*
4430     Markup declaration scanning mode
4431    
4432     This mode is used to recognize |MDC| that terminates
4433     a comment declaration as well as the base |lexmode|
4434     for e.g. document type declaration scanning mode.
4435     */
4436     lexmode MarkupDeclaration
4437     : standalone
4438     : extends => 'Name'
4439     : extends => 'S'
4440     {
4441     /*
4442     Markup declaration close
4443     */
4444     MDC := ['>'];
4445    
4446     /*
4447     Literal open
4448     */
4449     LIT := ['"'];
4450    
4451     /*
4452     Alternative literal open
4453     */
4454     LITA := [U+0027];
4455    
4456     /*
4457     Parameter entity reference open
4458     */
4459     PERO := ['%'];
4460    
4461     /*
4462     Declaration subset open
4463     */
4464     DSO := ['['];
4465     } // MarkupDeclaration
4466    
4467     lexmode ElementDeclaration
4468     : standalone
4469     : extends => 'MarkupDeclaration'
4470     {
4471     /*
4472     Model group open
4473     */
4474     MGO := ['('];
4475    
4476     /*
4477     Model group close
4478     */
4479     MGC := [')'];
4480    
4481     /*
4482     Reserved name indicator
4483     */
4484     RNI := ['#'];
4485    
4486     /*
4487     Occurence indicators
4488     */
4489     OPT := ['?'];
4490     REP := ['*'];
4491     PLUS := ['+'];
4492    
4493     /*
4494     Connectors
4495     */
4496     OR := ['|'];
4497     SEQ := [','];
4498     } // ElementDeclaration
4499    
4500     lexmode AttlistDeclaration
4501     : standalone
4502     : extends => 'MarkupDeclaration'
4503     {
4504     /*
4505     Enumeration group open
4506     */
4507     EGO := ['('];
4508    
4509     /*
4510     Enumeration group close
4511     */
4512     EGC := [')'];
4513    
4514     /*
4515     Enumeration choice delimiter
4516     */
4517     OR := ['|'];
4518    
4519     /*
4520     Reserved name indicator
4521     */
4522     RNI := ['#'];
4523     } // AttlistDeclaration
4524    
4525     lexmode Enumeration
4526     : standalone
4527     : extends => 'Nmtoken'
4528     : extends => 'S'
4529     {
4530     /*
4531     Enumeration group close
4532     */
4533     EGC := [')'];
4534    
4535     /*
4536     Enumeration choice delimiter
4537     */
4538     OR := ['|'];
4539     } // Enumeration
4540    
4541 wakaba 1.1
4542     token-error default : default {
4543     lang:Perl {
4544 wakaba 1.3 my $location;
4545     __CODE{xp|get-location-from-token::
4546     $token => {$token},
4547     $result => {$location},
4548     }__;
4549     my $continue = __DOMCore:ERROR{xp|wf-syntax-error::
4550 wakaba 1.1 xp|error-token => {$token},
4551     DOMCore|location => {$location},
4552     }__;
4553     unless ($continue) {
4554     __EXCEPTION{DOMLS|PARSE_ERR::
4555     }__;
4556     }
4557     }
4558     } // default
4559 wakaba 1.5
4560     @XMLTests:
4561     @@XMLTest:
4562 wakaba 1.15 @@@QName: xp.char.xml10.test
4563     @@@DEnt:
4564     @@@@test:value:
4565     <?xml version="1.0"?>
4566     <p>$u0009$u000A$u000D$u0020$uD7FF$uE000$uFFFD$U00010000$U0010FFFF</p>
4567     @@@test:domTree:
4568     document {
4569     xml-version: '1.0';
4570     element {
4571     text-content: U+0009 U+000A U+000A U+0020 U+D7FF
4572     U+E000 U+FFFD U+10000 U+10FFFF;
4573     }
4574     }
4575     @@XMLTest:
4576     @@@QName: xp.char.xml11.test
4577     @@@DEnt:
4578     @@@@test:value:
4579     <?xml version="1.1"?>
4580     <p>$u0009$u000A$u000D$u0020$uD7FF$uE000$uFFFD$U00010000$U0010FFFF</p>
4581     @@@test:domTree:
4582     document {
4583     xml-version: '1.1';
4584     element {
4585     text-content: U+0009 U+000A U+000A U+0020 U+D7FF
4586     U+E000 U+FFFD U+10000 U+10FFFF;
4587     }
4588     }
4589     @@XMLTest:
4590     @@@QName: xp.char.xml10.c0.test
4591     @@@DEnt:
4592     @@@@test:value:
4593     <?xml version="1.0"?>
4594     <p>$u0000$u0001$u0002$u0003$u0004$u0005$u0006$u0007$u0008$u000B$
4595     $u000C$u000E$u000F$u0010$u0011$u0012$u0013$u0014$u0015$u0016$
4596     $u0017$u0018$u0019$u001A$u001B$u001C$u001D$u001E$u001F</p>
4597     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 4); } /* U+0000 */
4598     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 5); } /* U+0001 */
4599     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 6); } /* U+0002 */
4600     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 7); } /* U+0003 */
4601     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 8); } /* U+0004 */
4602     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 9); } /* U+0005 */
4603     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 10); } /* U+0006 */
4604     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 11); } /* U+0007 */
4605     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 12); } /* U+0008 */
4606     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 13); } /* U+000B */
4607     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 14); } /* U+000C */
4608     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 15); } /* U+000E */
4609     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 16); } /* U+000F */
4610     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 17); } /* U+0010 */
4611     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 18); } /* U+0011 */
4612     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 19); } /* U+0012 */
4613     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 20); } /* U+0013 */
4614     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 21); } /* U+0014 */
4615     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 22); } /* U+0015 */
4616     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 23); } /* U+0016 */
4617     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 24); } /* U+0017 */
4618     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 25); } /* U+0018 */
4619     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 26); } /* U+0019 */
4620     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 27); } /* U+001A */
4621     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 28); } /* U+001B */
4622     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 29); } /* U+001C */
4623     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 30); } /* U+001D */
4624     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 31); } /* U+001E */
4625     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 32); } /* U+001F */
4626     @@XMLTest:
4627     @@@QName: xp.char.xml11.c0.test
4628     @@@DEnt:
4629     @@@@test:value:
4630     <?xml version="1.1"?>
4631     <p>$u0000$u0001$u0002$u0003$u0004$u0005$u0006$u0007$u0008$u000B$
4632     $u000C$u000E$u000F$u0010$u0011$u0012$u0013$u0014$u0015$u0016$
4633     $u0017$u0018$u0019$u001A$u001B$u001C$u001D$u001E$u001F</p>
4634     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 4); } /* U+0000 */
4635     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 5); } /* U+0001 */
4636     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 6); } /* U+0002 */
4637     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 7); } /* U+0003 */
4638     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 8); } /* U+0004 */
4639     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 9); } /* U+0005 */
4640     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 10); } /* U+0006 */
4641     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 11); } /* U+0007 */
4642     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 12); } /* U+0008 */
4643     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 13); } /* U+000B */
4644     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 14); } /* U+000C */
4645     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 15); } /* U+000E */
4646     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 16); } /* U+000F */
4647     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 17); } /* U+0010 */
4648     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 18); } /* U+0011 */
4649     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 19); } /* U+0012 */
4650     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 20); } /* U+0013 */
4651     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 21); } /* U+0014 */
4652     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 22); } /* U+0015 */
4653     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 23); } /* U+0016 */
4654     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 24); } /* U+0017 */
4655     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 25); } /* U+0018 */
4656     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 26); } /* U+0019 */
4657     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 27); } /* U+001A */
4658     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 28); } /* U+001B */
4659     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 29); } /* U+001C */
4660     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 30); } /* U+001D */
4661     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 31); } /* U+001E */
4662     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 32); } /* U+001F */
4663     @@XMLTest:
4664     @@@QName: xp.char.xml10.c1.test
4665     @@@DEnt:
4666     @@@@test:value:
4667     <?xml version="1.0"?>
4668     <p>$u007F$u0080$u0081$u0082$u0083$u0084$u0086$u0087$u0088$
4669     $u0089$u008A$u008B$u008C$
4670     $u008D$u008E$u008F$u0090$u0091$u0092$u0093$u0094$u0095$u0096$
4671     $u0097$u0098$u0099$u009A$u009B$u009C$u009D$u009E$u009F$u0085</p>
4672     @@@test:domTree:
4673     document {
4674     xml-version: '1.0';
4675     element {
4676     text-content: U+007F U+0080 U+0081 U+0082 U+0083 U+0084 U+0086
4677     U+0087 U+0088 U+0089 U+008A U+008B U+008C U+008D
4678     U+008E U+008F U+0090 U+0091 U+0092 U+0093 U+0094
4679     U+0095 U+0096 U+0097 U+0098 U+0099 U+009A U+009B
4680     U+009C U+009D U+009E U+009F U+0085;
4681     }
4682     }
4683     @@XMLTest:
4684     @@@QName: xp.char.xml11.c1.test
4685     @@@DEnt:
4686     @@@@test:value:
4687     <?xml version="1.1"?>
4688     <p>$u007F$u0080$u0081$u0082$u0083$u0084$u0086$u0087$u0088$
4689     $u0089$u008A$u008B$u008C$
4690     $u008D$u008E$u008F$u0090$u0091$u0092$u0093$u0094$u0095$u0096$
4691     $u0097$u0098$u0099$u009A$u009B$u009C$u009D$u009E$u009F$u0085</p>
4692     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 4); } /* U+007F */
4693     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 5); } /* U+0080 */
4694     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 6); } /* U+0081 */
4695     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 7); } /* U+0082 */
4696     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 8); } /* U+0083 */
4697     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 9); } /* U+0084 */
4698     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 10); } /* U+0086 */
4699     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 11); } /* U+0087 */
4700     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 12); } /* U+0088 */
4701     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 13); } /* U+0089 */
4702     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 14); } /* U+008A */
4703     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 15); } /* U+008B */
4704     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 16); } /* U+008C */
4705     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 17); } /* U+008D */
4706     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 18); } /* U+008E */
4707     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 19); } /* U+008F */
4708     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 20); } /* U+0090 */
4709     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 21); } /* U+0091 */
4710     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 22); } /* U+0092 */
4711     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 23); } /* U+0093 */
4712     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 24); } /* U+0094 */
4713     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 25); } /* U+0095 */
4714     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 26); } /* U+0096 */
4715     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 27); } /* U+0097 */
4716     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 28); } /* U+0098 */
4717     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 29); } /* U+0099 */
4718     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 30); } /* U+009A */
4719     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 31); } /* U+009B */
4720     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 32); } /* U+009C */
4721     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 33); } /* U+009D */
4722     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 34); } /* U+009E */
4723     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 35); } /* U+009F */
4724    
4725     @@XMLTest:
4726 wakaba 1.12 @@@QName: xp.syntax.empty.test
4727     @@@DEnt:
4728     @@@@test:value: \
4729     @@@c:erred:
4730     <[[xp:wf-syntax-error]]> { (1, 1); }
4731     @@XMLTest:
4732     @@@QName: xp.syntax.space.test
4733     @@@DEnt:
4734 wakaba 1.13 @@@@test:value: \
4735 wakaba 1.12 @@@c:erred:
4736     <[[xp:wf-syntax-error]]> { (1, 4); }
4737     @@XMLTest:
4738     @@@QName: xp.syntax.newlines.test
4739     @@@DEnt:
4740     @@@@test:value:
4741     \
4742     \
4743     \
4744     @@@c:erred:
4745     <[[xp:wf-syntax-error]]> { (3, 1); }
4746    
4747     @@XMLTest:
4748 wakaba 1.6 @@@QName: xp.only.docel.test
4749 wakaba 1.5 @@@DEnt:
4750     @@@@test:value:
4751     <p></p>
4752     @@@test:domTree:
4753     document {
4754     xml-version: '1.0';
4755 wakaba 1.6 xml-encoding: null;
4756     xml-standalone: false;
4757     element {
4758     namespace-uri: null;
4759     prefix: null;
4760     local-name: 'p';
4761     text-content: '';
4762     }
4763     }
4764     @@XMLTest:
4765     @@@QName: xp.only.docel.emptyelemtag.test
4766     @@@DEnt:
4767     @@@@test:value:
4768     <p/>
4769     @@@test:domTree:
4770     document {
4771     xml-version: '1.0';
4772     xml-encoding: null;
4773     xml-standalone: false;
4774 wakaba 1.5 element {
4775     namespace-uri: null;
4776     prefix: null;
4777     local-name: 'p';
4778     text-content: '';
4779     }
4780     }
4781 wakaba 1.15 @@XMLTest:
4782     @@@QName: xp.root.s.1.test
4783     @@@DEnt:
4784     @@@@test:value:
4785     <?xml version="1.0"?>$u0020$u000D$u000A$u0009
4786     <p></p>
4787     @@@test:domTree:
4788     document {
4789     element { }
4790     }
4791    
4792     @@XMLTest:
4793     @@@QName: xp.Name.1.test
4794     @@@DEnt:
4795     @@@@test:value: <name/>
4796     @@@test:domTree:
4797     document {
4798     element {
4799     node-name: 'name';
4800     }
4801     }
4802     @@XMLTest:
4803     @@@QName: xp.Name.2.test
4804     @@@DEnt:
4805     @@@@test:value: <name0/>
4806     @@@test:domTree:
4807     document {
4808     element {
4809     node-name: 'name0';
4810     }
4811     }
4812     @@enImplNote:
4813     @@@ddid: xml11name
4814     @@@@:
4815     {TODO:: XML 1.1 Name tests required
4816     }
4817    
4818     @@XMLTest:
4819     @@@QName: xp.content.mse.1.test
4820     @@@DEnt:
4821     @@@@test:value:
4822     <p>]]></p>
4823     @@@c:erred:
4824     <[[xp|wf-syntax-error]]> { (1, 4)..(1, 6); }
4825     @@XMLTest:
4826     @@@QName: xp.content.mse.2.test
4827     @@@DEnt:
4828     @@@@test:value:
4829     <p>aaa]]>bbb</p>
4830     @@@c:erred:
4831     <[[xp|wf-syntax-error]]> { (1, 7)..(1, 9); }
4832    
4833     @@XMLTest:
4834     @@@QName: xp.root.comment.1.test
4835     @@@DEnt:
4836     @@@@test:value:
4837     <!--comment data-->
4838     <p/>
4839     @@@test:domTree:
4840     document {
4841     comment {
4842     data: 'comment data';
4843     }
4844     element { }
4845     }
4846     @@XMLTest:
4847     @@@QName: xp.root.comment.2.test
4848     @@@DEnt:
4849     @@@@test:value:
4850     <!---->
4851     <p/>
4852     @@@test:domTree:
4853     document {
4854     comment {
4855     data: '';
4856     }
4857     element { }
4858     }
4859     @@XMLTest:
4860     @@@QName: xp.root.after.pi.comment.1.test
4861     @@@DEnt:
4862     @@@@test:value:
4863     <?pi?>
4864     <!--comment data-->
4865     <p/>
4866     @@@test:domTree:
4867     document {
4868     pi { }
4869     comment {
4870     data: 'comment data';
4871     }
4872     element { }
4873     }
4874     @@XMLTest:
4875     @@@QName: xp.root.after.pi.comment.2.test
4876     @@@DEnt:
4877     @@@@test:value:
4878     <?pi?>
4879     <!---->
4880     <p/>
4881     @@@test:domTree:
4882     document {
4883     pi { }
4884     comment {
4885     data: '';
4886     }
4887     element { }
4888     }
4889     @@XMLTest:
4890     @@@QName: xp.root.after.element.comment.1.test
4891     @@@DEnt:
4892     @@@@test:value:
4893     <p/>
4894     <!--comment data-->
4895     @@@test:domTree:
4896     document {
4897     element { }
4898     comment {
4899     data: 'comment data';
4900     }
4901     }
4902     @@XMLTest:
4903     @@@QName: xp.root.after.element.comment.2.test
4904     @@@DEnt:
4905     @@@@test:value:
4906     <p/>
4907     <!---->
4908     @@@test:domTree:
4909     document {
4910     element { }
4911     comment {
4912     data: '';
4913     }
4914     }
4915     @@XMLTest:
4916     @@@QName: xp.doctype.intsubset.comment.1.test
4917     @@@DEnt:
4918     @@@@test:value:
4919     <!DOCTYPE a [
4920     <!--comment data-->
4921     ]>
4922     <p/>
4923     @@@test:domTree:
4924     document {
4925     document-type { }
4926     element { }
4927     }
4928     @@XMLTest:
4929     @@@QName: xp.doctype.intsubset.comment.2.test
4930     @@@DEnt:
4931     @@@@test:value:
4932     <!DOCTYPE a [
4933     <!---->
4934     ]>
4935     <p/>
4936     @@@test:domTree:
4937     document {
4938     document-type { }
4939     element { }
4940     }
4941     @@XMLTest:
4942     @@@QName: xp.doctype.intsubset.comment.3.test
4943     @@@DEnt:
4944     @@@@test:value:
4945     <!DOCTYPE a [
4946     <?pi?>
4947     <!---->
4948     ]>
4949     <p/>
4950     @@@test:domTree:
4951     document {
4952     document-type {
4953     pi { }
4954     }
4955     element { }
4956     }
4957     @@XMLTest:
4958     @@@QName: xp.content.comment.1.test
4959     @@@DEnt:
4960     @@@@test:value:
4961     <p><!--comment data--></p>
4962     @@@test:domTree:
4963     document {
4964     element {
4965     comment {
4966     data: 'comment data';
4967     }
4968     }
4969     }
4970     @@XMLTest:
4971     @@@QName: xp.content.comment.2.test
4972     @@@DEnt:
4973     @@@@test:value:
4974     <p><!----></p>
4975     @@@test:domTree:
4976     document {
4977     element {
4978     comment {
4979     data: '';
4980     }
4981     }
4982     }
4983     @@XMLTest:
4984     @@@QName: xp.content.comment.3.test
4985     @@@DEnt:
4986     @@@@test:value:
4987     <p>aaaaa<!---->bbbbb</p>
4988     @@@test:domTree:
4989     document {
4990     element {
4991     text {
4992     data: 'aaaaa';
4993     }
4994     comment {
4995     data: '';
4996     }
4997     text {
4998     data: 'bbbbb';
4999     }
5000     }
5001     }
5002     @@XMLTest:
5003     @@@QName: xp.content.comment.--.1.test
5004     @@@DEnt:
5005     @@@@test:value:
5006     <p><!--data--data--></p>
5007     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 12)..(1, 17); }
5008     @@XMLTest:
5009     @@@QName: xp.content.comment.---gt.test
5010     @@@DEnt:
5011     @@@@test:value:
5012     <p><!--data---></p>
5013     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 12)..(1, 15); }
5014 wakaba 1.13
5015     @@XMLTest:
5016     @@@QName: xp.xmldecl.version.1.0.test
5017     @@@DEnt:
5018     @@@@test:value:
5019     <?xml version="1.0"?>
5020     <p></p>
5021     @@@test:domTree:
5022     document {
5023     xml-version: '1.0';
5024     xml-encoding: null;
5025     xml-standalone: false;
5026     element { }
5027     }
5028     @@XMLTest:
5029     @@@QName: xp.xmldecl.version.1.0.lita.test
5030     @@@DEnt:
5031     @@@@test:value:
5032     <?xml version='1.0'?>
5033     <p></p>
5034     @@@test:domTree:
5035     document {
5036     xml-version: '1.0';
5037     xml-encoding: null;
5038     xml-standalone: false;
5039     element { }
5040     }
5041     @@XMLTest:
5042     @@@QName: xp.xmldecl.version.1.0.s.test
5043     @@@DEnt:
5044     @@@@test:value:
5045     <?xml version = "1.0" ?>
5046     <p></p>
5047     @@@test:domTree:
5048     document {
5049     xml-version: '1.0';
5050     xml-encoding: null;
5051     xml-standalone: false;
5052     element { }
5053     }
5054     @@XMLTest:
5055     @@@QName: xp.xmldecl.version.1.1.test
5056     @@@DEnt:
5057     @@@@test:value:
5058     <?xml version="1.1"?>
5059     <p></p>
5060     @@@test:domTree:
5061     document {
5062     xml-version: '1.1';
5063     xml-encoding: null;
5064     xml-standalone: false;
5065     element { }
5066     }
5067    
5068     @@XMLTest:
5069     @@@QName: xp.xmldecl.version.1.0.encoding.usascii.test
5070     @@@DEnt:
5071     @@@@test:value:
5072     <?xml version="1.0" encoding="US-ascii"?>
5073     <p></p>
5074     @@@test:domTree:
5075     document {
5076     xml-version: '1.0';
5077     xml-encoding: 'US-ascii';
5078     xml-standalone: false;
5079     element { }
5080     }
5081     @@XMLTest:
5082     @@@QName: xp.xmldecl.version.1.0.encoding.usascii.lita.test
5083     @@@DEnt:
5084     @@@@test:value:
5085     <?xml version="1.0" encoding='US-ascii'?>
5086     <p></p>
5087     @@@test:domTree:
5088     document {
5089     xml-version: '1.0';
5090     xml-encoding: 'US-ascii';
5091     xml-standalone: false;
5092     element { }
5093     }
5094     @@XMLTest:
5095     @@@QName: xp.xmldecl.version.1.0.encoding.usascii.s.test
5096     @@@DEnt:
5097     @@@@test:value:
5098     <?xml version="1.0" encoding = "US-ascii" ?>
5099     <p></p>
5100     @@@test:domTree:
5101     document {
5102     xml-version: '1.0';
5103     xml-encoding: 'US-ascii';
5104     xml-standalone: false;
5105     element { }
5106     }
5107    
5108     @@XMLTest:
5109     @@@QName: xp.xmldecl.version.1.0.encoding.usascii.standalone.yes.test
5110     @@@DEnt:
5111     @@@@test:value:
5112     <?xml version="1.0" encoding="us-ascii" standalone="yes"?>
5113     <p></p>
5114     @@@test:domTree:
5115     document {
5116     xml-version: '1.0';
5117     xml-encoding: 'us-ascii';
5118     xml-standalone: true;
5119     element { }
5120     }
5121     @@XMLTest:
5122     @@@QName: xp.xmldecl.version.1.0.encoding.usascii.standalone.no.test
5123     @@@DEnt:
5124     @@@@test:value:
5125     <?xml version="1.0" encoding="us-ascii" standalone="no"?>
5126     <p></p>
5127     @@@test:domTree:
5128     document {
5129     xml-version: '1.0';
5130     xml-encoding: 'us-ascii';
5131     xml-standalone: false;
5132     element { }
5133     }
5134     @@XMLTest:
5135     @@@QName: xp.xmldecl.version.1.0.encoding.usascii.standalone.yes.lita.test
5136     @@@DEnt:
5137     @@@@test:value:
5138     <?xml version="1.0" encoding="us-ascii" standalone='yes'?>
5139     <p></p>
5140     @@@test:domTree:
5141     document {
5142     xml-version: '1.0';
5143     xml-encoding: 'us-ascii';
5144     xml-standalone: true;
5145     element { }
5146     }
5147     @@XMLTest:
5148     @@@QName: xp.xmldecl.version.1.0.encoding.usascii.standalone.yes.s.test
5149     @@@DEnt:
5150     @@@@test:value:
5151     <?xml version="1.0" encoding="us-ascii" standalone = "yes" ?>
5152     <p></p>
5153     @@@test:domTree:
5154     document {
5155     xml-version: '1.0';
5156     xml-encoding: 'us-ascii';
5157     xml-standalone: true;
5158     element { }
5159     }
5160 wakaba 1.14 @@XMLTest:
5161     @@@QName: xp.xmldecl.no.encoding.but.standalone.attr.test
5162     @@@DEnt:
5163     @@@@test:value:
5164     <?xml version="1.0" standalone="yes"?>
5165     <p></p>
5166     @@@test:domTree:
5167     document {
5168     xml-version: '1.0';
5169     xml-encoding: null;
5170     xml-standalone: true;
5171     element { }
5172     }
5173     @@XMLTest:
5174     @@@QName: xp.xmldecl.encoding.encname.test
5175     @@@DEnt:
5176     @@@@test:value:
5177     <?xml version="1.0" encoding="a-._01-"?>
5178     <p></p>
5179     @@@test:domTree:
5180     document {
5181     xml-version: '1.0';
5182     xml-encoding: 'a-._01-';
5183     xml-standalone: false;
5184     element { }
5185     }
5186    
5187     @@XMLTest:
5188     @@@QName: xp.xmldecl.no.s.no.attr.test
5189     @@@DEnt:
5190     @@@@test:value:
5191     <?xml?>
5192     <p></p>
5193     @@@c:erred:
5194 wakaba 1.16 <[[xp:wf-syntax-error]]> { (1, 1)..(1, 7); }
5195 wakaba 1.14 @@XMLTest:
5196     @@@QName: xp.xmldecl.s.no.attr.test
5197     @@@DEnt:
5198     @@@@test:value:
5199     <?xml ?>
5200     <p></p>
5201     @@@c:erred:
5202     <[[xp:wf-syntax-error]]> { (1, 8)..(1, 9); }
5203     @@XMLTest:
5204     @@@QName: xp.xmldecl.unknown.attr.test
5205     @@@DEnt:
5206     @@@@test:value:
5207     <?xml unknown="value"?>
5208     <p></p>
5209     @@@c:erred:
5210     <[[xp:wf-syntax-error]]> { (1, 8)..(1, 22); }
5211     @@XMLTest:
5212     @@@QName: xp.xmldecl.version.unknown.attr.test
5213     @@@DEnt:
5214     @@@@test:value:
5215     <?xml version="1.0" unknown="value"?>
5216     <p></p>
5217     @@@c:erred:
5218     <[[xp:wf-syntax-error]]> { (1, 21)..(1, 35); }
5219     @@XMLTest:
5220     @@@QName: xp.xmldecl.version.encoding.unknown.attr.test
5221     @@@DEnt:
5222     @@@@test:value:
5223     <?xml version="1.0" encoding="us-ascii" unknown="value"?>
5224     <p></p>
5225     @@@c:erred:
5226     <[[xp:wf-syntax-error]]> { (1, 41)..(1, 55); }
5227     @@XMLTest:
5228     @@@QName: xp.xmldecl.version.encoding.standalone.unknown.attr.test
5229     @@@DEnt:
5230     @@@@test:value:
5231     <?xml version="1.0" encoding="us-ascii" standalone="yes"
5232     unknown="value"?>
5233     <p></p>
5234     @@@c:erred:
5235     <[[xp:wf-syntax-error]]> { (2, 1)..(2, 15); }
5236     @@XMLTest:
5237     @@@QName: xp.xmldecl.no.version.but.encoding.attr.test
5238     @@@DEnt:
5239     @@@@test:value:
5240     <?xml encoding="us-ascii"?>
5241     <p></p>
5242     @@@c:erred:
5243     <[[xp:wf-syntax-error]]> { (1, 7)..(1, 25); }
5244     @@XMLTest:
5245     @@@QName: xp.xmldecl.no.version.but.standalone.attr.test
5246     @@@DEnt:
5247     @@@@test:value:
5248     <?xml standalone="yes"?>
5249     <p></p>
5250     @@@c:erred:
5251     <[[xp:wf-syntax-error]]> { (1, 7)..(1, 24); }
5252     @@XMLTest:
5253     @@@QName: xp.xmldecl.version.unsupported.test
5254     @@@DEnt:
5255     @@@@test:value:
5256     <?xml version="1.2"?>
5257     <p></p>
5258     @@@c:erred:
5259     <[[xp:wf-unsupported-xml-version]]> { (1, 7)..(1, 19); }
5260     @@XMLTest:
5261     @@@QName: xp.xmldecl.version.unsupported.2.test
5262     @@@DEnt:
5263     @@@@test:value:
5264     <?xml version=" 1.0 "?>
5265     <p></p>
5266     @@@c:erred:
5267     <[[xp:wf-unsupported-xml-version]]> { (1, 7)..(1, 21); }
5268     @@XMLTest:
5269     @@@QName: xp.xmldecl.version.unsupported.3.test
5270     @@@DEnt:
5271     @@@@test:value:
5272     <?xml version="01.00"?>
5273     <p></p>
5274     @@@c:erred:
5275     <[[xp:wf-unsupported-xml-version]]> { (1, 7)..(1, 21); }
5276     @@XMLTest:
5277     @@@QName: xp.xmldecl.encoding.malformed.1.test
5278     @@@DEnt:
5279     @@@@test:value:
5280     <?xml version="1.0" encoding="0088"?>
5281     <p></p>
5282     @@@c:erred:
5283     <[[xp:wf-malformed-enc-name]]> { (1, 21)..(1, 35); }
5284     @@XMLTest:
5285     @@@QName: xp.xmldecl.encoding.malformed.2.test
5286     @@@DEnt:
5287     @@@@test:value:
5288     <?xml version="1.0" encoding="D.V.D!"?>
5289     <p></p>
5290     @@@c:erred:
5291     <[[xp:wf-malformed-enc-name]]> { (1, 21)..(1, 38); }
5292     @@XMLTest:
5293     @@@QName: xp.xmldecl.standalone.malformed.1.test
5294     @@@DEnt:
5295     @@@@test:value:
5296     <?xml version="1.0" standalone="true"?>
5297     <p></p>
5298     @@@c:erred:
5299     <[[xp:wf-malformed-xml-standalone]]> { (1, 21)..(1, 38); }
5300     @@XMLTest:
5301     @@@QName: xp.xmldecl.standalone.malformed.2.test
5302     @@@DEnt:
5303     @@@@test:value:
5304     <?xml version="1.0" standalone="YES"?>
5305     <p></p>
5306     @@@c:erred:
5307     <[[xp:wf-malformed-xml-standalone]]> { (1, 21)..(1, 37); }
5308     @@XMLTest:
5309     @@@QName: xp.xmldecl.standalone.malformed.3.test
5310     @@@DEnt:
5311     @@@@test:value:
5312     <?xml version="1.0" standalone="no "?>
5313     <p></p>
5314     @@@c:erred:
5315     <[[xp:wf-malformed-xml-standalone]]> { (1, 21)..(1, 38); }
5316 wakaba 1.6
5317     @@XMLTest:
5318 wakaba 1.14 @@@QName: xp.no-xmldecl.xml...-pi.test
5319     @@@DEnt:
5320     @@@@test:value:
5321     <?xmldeclaration?>
5322     <a></a>
5323     @@@test:domTree:
5324     document {
5325     pi {
5326     node-name: 'xmldeclaration';
5327     node-value: '';
5328     }
5329     element { }
5330     }
5331     @@XMLTest:
5332     @@@QName: xp.no-xmldecl.xml...-pi.after.document.element.test
5333     @@@DEnt:
5334     @@@@test:value:
5335     <a></a>
5336     <?xmldeclaration?>
5337     @@@test:domTree:
5338     document {
5339     element { }
5340     pi {
5341     node-name: 'xmldeclaration';
5342     node-value: '';
5343     }
5344     }
5345     @@XMLTest:
5346     @@@QName: xp.no-xmldecl.xml...-pi.in.document.element.test
5347     @@@DEnt:
5348     @@@@test:value:
5349     <a>
5350     <?xmldeclaration?>
5351     </a>
5352     @@@test:domTree:
5353     document {
5354     element {
5355     text { }
5356     pi {
5357     node-name: 'xmldeclaration';
5358     node-value: '';
5359     }
5360     text { }
5361     }
5362     }
5363     @@XMLTest:
5364     @@@QName: xp.no-xmldecl.xml...-pi.in.doctype.test
5365     @@@DEnt:
5366     @@@@test:value:
5367     <!DOCTYPE a [
5368     <?xmldeclaration?>
5369     ]>
5370     <a></a>
5371     @@@test:domTree:
5372     document {
5373     document-type {
5374     pi {
5375     node-name: 'xmldeclaration';
5376     node-value: '';
5377     }
5378     }
5379     element { }
5380     }
5381    
5382     @@XMLTest:
5383     @@@QName: xp.XMLdecl.test
5384     @@@DEnt:
5385     @@@@test:value:
5386     <?XML version="1.0"?>
5387     <p></p>
5388     @@@c:erred:
5389     <[[xp:wf-pi-target-is-xml]]> { (1, 1)..(1, 5); }
5390     @@XMLTest:
5391     @@@QName: xp.Xmldecl.test
5392     @@@DEnt:
5393     @@@@test:value:
5394     <?Xml version="1.0"?>
5395     <p></p>
5396     @@@c:erred:
5397     <[[xp:wf-pi-target-is-xml]]> { (1, 1)..(1, 5); }
5398     @@XMLTest:
5399     @@@QName: xp.xmldecl.after.document.element.empty.test
5400     @@@DEnt:
5401     @@@@test:value:
5402     <p></p>
5403     <?xml?>
5404     @@@c:erred:
5405     <[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); }
5406     @@XMLTest:
5407     @@@QName: xp.xmldecl.after.document.element.test
5408     @@@DEnt:
5409     @@@@test:value:
5410     <p></p>
5411     <?xml version="1.0"?>
5412     @@@c:erred:
5413     <[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); }
5414     @@XMLTest:
5415     @@@QName: xp.xmldecl.in.element.empty.test
5416     @@@DEnt:
5417     @@@@test:value:
5418     <p>
5419     <?xml?>
5420     </p>
5421     @@@c:erred:
5422     <[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); }
5423     @@XMLTest:
5424     @@@QName: xp.xmldecl.in.element.test
5425     @@@DEnt:
5426     @@@@test:value:
5427     <p>
5428     <?xml version="1.0"?>
5429     </p>
5430     @@@c:erred:
5431     <[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); }
5432     @@XMLTest:
5433     @@@QName: xp.xmldecl.after.comment.test
5434     @@@DEnt:
5435     @@@@test:value:
5436     <!---->
5437     <?xml version="1.0"?>
5438     <p></p>
5439     @@@c:erred:
5440     <[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); }
5441     @@XMLTest:
5442     @@@QName: xp.xmldecl.after.comment.empty.test
5443     @@@DEnt:
5444     @@@@test:value:
5445     <!---->
5446     <?xml?>
5447     <p></p>
5448     @@@c:erred:
5449     <[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); }
5450     @@XMLTest:
5451     @@@QName: xp.xmldecl.after.pi.test
5452     @@@DEnt:
5453     @@@@test:value:
5454     <?xml-declaration?>
5455     <?xml version="1.0"?>
5456     <p></p>
5457     @@@c:erred:
5458     <[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); }
5459     @@XMLTest:
5460     @@@QName: xp.xmldecl.after.pi.empty.test
5461     @@@DEnt:
5462     @@@@test:value:
5463     <?xml-declaration?>
5464     <?xml?>
5465     <p></p>
5466     @@@c:erred:
5467     <[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); }
5468     @@XMLTest:
5469 wakaba 1.16 @@@QName: xp.xmldecl.after.pi.2.test
5470     @@@DEnt:
5471     @@@@test:value:
5472     <?declaration?>
5473     <?xml version="1.0"?>
5474     <p></p>
5475     @@@c:erred:
5476     <[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); }
5477     @@XMLTest:
5478     @@@QName: xp.xmldecl.after.pi.empty.2.test
5479     @@@DEnt:
5480     @@@@test:value:
5481     <?declaration?>
5482     <?xml?>
5483     <p></p>
5484     @@@c:erred:
5485     <[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); }
5486     @@XMLTest:
5487 wakaba 1.14 @@@QName: xp.xmldecl.after.doctype.test
5488     @@@DEnt:
5489     @@@@test:value:
5490     <!DOCTYPE a>
5491     <?xml version="1.0"?>
5492     <p></p>
5493     @@@c:erred:
5494     <[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); }
5495     @@XMLTest:
5496     @@@QName: xp.xmldecl.after.doctype.empty.test
5497     @@@DEnt:
5498     @@@@test:value:
5499     <!DOCTYPE a>
5500     <?xml?>
5501     <p></p>
5502     @@@c:erred:
5503     <[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); }
5504     @@XMLTest:
5505     @@@QName: xp.xmldecl.in.doctype.test
5506     @@@DEnt:
5507     @@@@test:value:
5508     <!DOCTYPE a [
5509     <?xml version="1.0"?>
5510     ]>
5511     <p></p>
5512     @@@c:erred:
5513     <[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); }
5514     @@XMLTest:
5515     @@@QName: xp.xmldecl.in.doctype.empty.test
5516     @@@DEnt:
5517     @@@@test:value:
5518     <!DOCTYPE a [
5519     <?xml?>
5520     ]>
5521     <p></p>
5522     @@@c:erred:
5523     <[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); }
5524    
5525     @@XMLTest:
5526     @@@QName: xp.pi.before.element.empty.test
5527     @@@DEnt:
5528     @@@@test:value:
5529     <?target?>
5530     <a></a>
5531     @@@test:domTree:
5532     document {
5533     pi {
5534     node-name: 'target';
5535     node-value: '';
5536     }
5537     element { }
5538     }
5539     @@XMLTest:
5540     @@@QName: xp.pi.before.element.s.test
5541     @@@DEnt:
5542     @@@@test:value:
5543     <?target ?>
5544     <a></a>
5545     @@@test:domTree:
5546     document {
5547     pi {
5548     node-name: 'target';
5549     node-value: '';
5550     }
5551     element { }
5552     }
5553     @@XMLTest:
5554     @@@QName: xp.pi.before.element.string.test
5555     @@@DEnt:
5556     @@@@test:value:
5557     <?target string?>
5558     <a></a>
5559     @@@test:domTree:
5560     document {
5561     pi {
5562     node-name: 'target';
5563     node-value: 'string';
5564     }
5565     element { }
5566     }
5567     @@XMLTest:
5568     @@@QName: xp.pi.before.element.string.s.test
5569     @@@DEnt:
5570     @@@@test:value:
5571     <?target string ?>
5572     <a></a>
5573     @@@test:domTree:
5574     document {
5575     pi {
5576     node-name: 'target';
5577     node-value: 'string ';
5578     }
5579     element { }
5580     }
5581     @@XMLTest:
5582     @@@QName: xp.pi.before.element.gt.test
5583     @@@DEnt:
5584     @@@@test:value:
5585     <?target string>string?>
5586     <a></a>
5587     @@@test:domTree:
5588     document {
5589     pi {
5590     node-name: 'target';
5591     node-value: 'string>string';
5592     }
5593     element { }
5594     }
5595     @@XMLTest:
5596     @@@QName: xp.pi.doctype.empty.test
5597     @@@DEnt:
5598     @@@@test:value:
5599     <!DOCTYPE a [
5600     <?target?>
5601     ]>
5602     <a></a>
5603     @@@test:domTree:
5604     document {
5605     document-type {
5606     pi {
5607     node-name: 'target';
5608     node-value: '';
5609     }
5610     }
5611     element { }
5612     }
5613    
5614     @@XMLTest:
5615     @@@QName: xp.pi.no.target.test
5616     @@@DEnt:
5617     @@@@test:value:
5618     <??>
5619     <p></p>
5620     @@@c:erred:
5621     <[[xp:wf-syntax-error]]> { (1, 3)..(1, 4); }
5622     @@XMLTest:
5623     @@@QName: xp.pi.no.target.2.test
5624     @@@DEnt:
5625     @@@@test:value:
5626     <? ?>
5627     <p></p>
5628     @@@c:erred:
5629     <[[xp:wf-syntax-error]]> { (1, 3)..(1, 4); }
5630     @@XMLTest:
5631     @@@QName: xp.pi.bad.target.1.test
5632     @@@DEnt:
5633     @@@@test:value:
5634     <?target! ?>
5635     <p></p>
5636     @@@c:erred:
5637     <[[xp:wf-syntax-error]]> { (1, 9)..(1, 9); }
5638     @@XMLTest:
5639     @@@QName: xp.pi.bad.target.2.test
5640     @@@DEnt:
5641     @@@@test:value:
5642     <?0target ?>
5643     <p></p>
5644     @@@c:erred:
5645     <[[xp:wf-syntax-error]]> { (1, 3)..(1, 3); }
5646    
5647     @@XMLTest:
5648 wakaba 1.15 @@@QName: xp.cdatasection.empty.1.test
5649     @@@DEnt:
5650     @@@@test:value:
5651     <p><![CDATA[]]></p>
5652     @@@test:domTree:
5653     document {
5654     element {
5655     cdata-section {
5656     data: '';
5657     }
5658     }
5659     }
5660     @@XMLTest:
5661     @@@QName: xp.cdatasection.empty.2.test
5662     @@@DEnt:
5663     @@@@test:value:
5664     <p>aa<![CDATA[]]>bb</p>
5665     @@@test:domTree:
5666     document {
5667     element {
5668     text { data: 'aa'; }
5669     cdata-section {
5670     data: '';
5671     }
5672     text { data: 'bb'; }
5673     }
5674     }
5675     @@XMLTest:
5676     @@@QName: xp.cdatasection.1.test
5677     @@@DEnt:
5678     @@@@test:value:
5679     <p><![CDATA[abcdefg]]></p>
5680     @@@test:domTree:
5681     document {
5682     element {
5683     cdata-section {
5684     data: 'abcdefg';
5685     }
5686     }
5687     }
5688     @@XMLTest:
5689     @@@QName: xp.cdatasection.2.test
5690     @@@DEnt:
5691     @@@@test:value:
5692     <p>aa<![CDATA[abcdefg]]>bb</p>
5693     @@@test:domTree:
5694     document {
5695     element {
5696     text { data: 'aa'; }
5697     cdata-section {
5698     data: 'abcdefg';
5699     }
5700     text { data: 'bb'; }
5701     }
5702     }
5703     @@XMLTest:
5704     @@@QName: xp.cdatasection.ref.1.test
5705     @@@DEnt:
5706     @@@@test:value:
5707     <p><![CDATA[a&amp;&#x32;&#32;%abc;&def;]]&gt;b]]></p>
5708     @@@test:domTree:
5709     document {
5710     element {
5711     cdata-section {
5712     data: 'a&amp;&#x32;&#32;%abc;&def;]]&gt;b';
5713     }
5714     }
5715     }
5716     @@XMLTest:
5717     @@@QName: xp.cdatasection.in.general.entity.test
5718     @@@DEnt:
5719     @@@@test:value:
5720     <!DOCTYPE p [
5721     <!ENTITY cdata "<![CDATA[text]]>">
5722     ]>
5723     <p>&cdata;</p>
5724     @@@test:domTree:
5725     document {
5726     document-type {
5727     general-entity {
5728     node-name: 'cdata';
5729     cdata-section {
5730     data: 'text';
5731     }
5732     }
5733     }
5734     element {
5735     general-entity-reference {
5736 wakaba 1.23 node-name: 'cdata';
5737 wakaba 1.19 is-expanded: true;
5738 wakaba 1.15 cdata-section {
5739     data: 'text';
5740     }
5741     }
5742     }
5743     }
5744     @@XMLTest:
5745     @@@QName: xp.cdatasection.no.mse.test
5746     @@@DEnt:
5747     @@@@test:value:
5748     <p><![CDATA[text</p>
5749     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 21); }
5750     @@XMLTest:
5751     @@@QName: xp.cdatasection.nest.test
5752     @@@DEnt:
5753     @@@@test:value:
5754     <p><![CDATA[text01<![CDATA[txt2]]>text3]]></p>
5755     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 40)..(1, 42); }
5756    
5757     @@XMLTest:
5758 wakaba 1.6 @@@QName: xp.doctype.empty.test
5759     @@@DEnt:
5760     @@@@test:value:
5761     <!DOCTYPE a>
5762     <a></a>
5763     @@@test:domTree:
5764     document {
5765     xml-version: '1.0';
5766     xml-encoding: null;
5767     xml-standalone: false;
5768     document-type {
5769     node-name: 'a';
5770 wakaba 1.17 public-id: null;
5771     system-id: null;
5772 wakaba 1.6 }
5773     element {
5774     namespace-uri: null;
5775     prefix: null;
5776     local-name: 'a';
5777     text-content: '';
5778     }
5779     }
5780 wakaba 1.15 @@XMLTest:
5781     @@@QName: xp.doctype.empty.after.document.element.test
5782     @@@DEnt:
5783     @@@@test:value:
5784     <a></a>
5785     <!DOCTYPE a>
5786     @@@c:erred: <[[xp|wf-syntax-error]]> { (2, 1)..(2, 12); }
5787     @@XMLTest:
5788     @@@QName: xp.doctype.empty.in.element.test
5789     @@@DEnt:
5790     @@@@test:value:
5791     <a>
5792     <!DOCTYPE a>
5793     </a>
5794     @@@c:erred: <[[xp|wf-syntax-error]]> { (2, 1)..(2, 12); }
5795     @@XMLTest:
5796     @@@QName: xp.doctype.empty.dup.test
5797     @@@DEnt:
5798     @@@@test:value:
5799     <!DOCTYPE a>
5800     <!DOCTYPE a>
5801     <a></a>
5802     @@@c:erred: <[[xp|wf-syntax-error]]> { (2, 1)..(2, 12); }
5803     @@XMLTest:
5804     @@@QName: xp.doctype.empty.in.intsubset.test
5805     @@@DEnt:
5806     @@@@test:value:
5807     <!DOCTYPE a [
5808     <!DOCTYPE a>
5809     ]>
5810     <a></a>
5811     @@@c:erred: <[[xp|wf-syntax-error]]> { (2, 1)..(2, 12); }
5812 wakaba 1.16 @@XMLTest:
5813     @@@QName: xp.doctype.no.s.no.name.test
5814     @@@DEnt:
5815     @@@@test:value:
5816     <!DOCTYPE>
5817     <a></a>
5818     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 10); }
5819     @@XMLTest:
5820     @@@QName: xp.doctype.no.name.test
5821     @@@DEnt:
5822     @@@@test:value:
5823     <!DOCTYPE >
5824     <a></a>
5825     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 11); }
5826     @@XMLTest:
5827     @@@QName: xp.doctype.name.s.test
5828     @@@DEnt:
5829     @@@@test:value:
5830     <!DOCTYPE aa >
5831     <aa></aa>
5832     @@@test:domTree:
5833     document {
5834     document-type {
5835     node-name: 'aa';
5836 wakaba 1.17 public-id: null;
5837     system-id: null;
5838 wakaba 1.16 }
5839     element { }
5840     }
5841     @@XMLTest:
5842     @@@QName: xp.doctype.no.mdc.test
5843     @@@DEnt:
5844     @@@@test:value:
5845     <!DOCTYPE aa
5846     <aa></aa>
5847     @@@c:erred: <[[xp|wf-syntax-error]]> { (2, 1); }
5848 wakaba 1.6
5849     @@XMLTest:
5850 wakaba 1.16 @@@QName: xp.doctype.intsubset.empty.1.test
5851 wakaba 1.6 @@@DEnt:
5852     @@@@test:value:
5853 wakaba 1.16 <!DOCTYPE a []>
5854 wakaba 1.6 <a></a>
5855     @@@test:domTree:
5856     document {
5857     xml-version: '1.0';
5858     xml-encoding: null;
5859     xml-standalone: false;
5860     document-type {
5861     node-name: 'a';
5862 wakaba 1.17 public-id: null;
5863     system-id: null;
5864 wakaba 1.6 }
5865     element {
5866     namespace-uri: null;
5867     prefix: null;
5868     local-name: 'a';
5869     text-content: '';
5870     }
5871     }
5872     @@XMLTest:
5873 wakaba 1.16 @@@QName: xp.doctype.intsubset.empty.2.test
5874 wakaba 1.6 @@@DEnt:
5875     @@@@test:value:
5876     <!DOCTYPE a [
5877 wakaba 1.16
5878 wakaba 1.6 ]>
5879     <a></a>
5880     @@@test:domTree:
5881     document {
5882     xml-version: '1.0';
5883     xml-encoding: null;
5884     xml-standalone: false;
5885     document-type {
5886     node-name: 'a';
5887 wakaba 1.17 public-id: null;
5888     system-id: null;
5889 wakaba 1.6 }
5890     element {
5891     namespace-uri: null;
5892     prefix: null;
5893     local-name: 'a';
5894     text-content: '';
5895     }
5896     }
5897     @@XMLTest:
5898 wakaba 1.16 @@@QName: xp.doctype.intsubset.empty.3.test
5899 wakaba 1.6 @@@DEnt:
5900     @@@@test:value:
5901 wakaba 1.16 <!DOCTYPE a[]>
5902 wakaba 1.6 <a></a>
5903     @@@test:domTree:
5904     document {
5905     document-type {
5906     node-name: 'a';
5907 wakaba 1.17 public-id: null;
5908     system-id: null;
5909 wakaba 1.6 }
5910 wakaba 1.16 element { }
5911     }
5912     @@XMLTest:
5913     @@@QName: xp.doctype.intsubset.empty.4.test
5914     @@@DEnt:
5915     @@@@test:value:
5916     <!DOCTYPE a[] >
5917     <a></a>
5918     @@@test:domTree:
5919     document {
5920     document-type {
5921     node-name: 'a';
5922 wakaba 1.17 public-id: null;
5923     system-id: null;
5924 wakaba 1.6 }
5925 wakaba 1.16 element { }
5926 wakaba 1.6 }
5927     @@XMLTest:
5928 wakaba 1.16 @@@QName: xp.doctype.intsubset.no.dsc.1.test
5929     @@@DEnt:
5930     @@@@test:value:
5931     <!DOCTYPE a [>
5932     <a></a>
5933     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 14); }
5934     @@XMLTest:
5935     @@@QName: xp.doctype.intsubset.no.dsc.2.test
5936 wakaba 1.6 @@@DEnt:
5937     @@@@test:value:
5938     <!DOCTYPE a [
5939     <a></a>
5940 wakaba 1.16 @@@c:erred: <[[xp|wf-syntax-error]]> { (2, 1); }
5941     @@XMLTest:
5942     @@@QName: xp.doctype.intsubset.no.dsc.3.test
5943     @@@DEnt:
5944     @@@@test:value:
5945     <!DOCTYPE a [
5946     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 14); }
5947     @@XMLTest:
5948     @@@QName: xp.doctype.intsubset.no.mdc.1.test
5949     @@@DEnt:
5950     @@@@test:value:
5951     <!DOCTYPE a []
5952     <a/>
5953     @@@c:erred: <[[xp|wf-syntax-error]]> { (2, 1); }
5954     @@XMLTest:
5955     @@@QName: xp.doctype.intsubset.no.mdc.2.test
5956     @@@DEnt:
5957     @@@@test:value:
5958     <!DOCTYPE a []]>
5959     <a/>
5960     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 15); }
5961 wakaba 1.17 @@XMLTest:
5962     @@@QName: xp.doctype.pubid.sysid.1.test
5963     @@@DEnt:
5964     @@@@test:value:
5965     <!DOCTYPE a PUBLIC "pubid" "sysid">
5966     <a/>
5967     @@@test:domTree:
5968     document {
5969     document-type {
5970     node-name: 'a';
5971     public-id: 'pubid';
5972     system-id: 'sysid';
5973     }
5974     element { }
5975     }
5976     @@XMLTest:
5977     @@@QName: xp.doctype.pubid.sysid.2.test
5978     @@@DEnt:
5979     @@@@test:value:
5980     <!DOCTYPE a PUBLIC 'pubid' "sysid">
5981     <a/>
5982     @@@test:domTree:
5983     document {
5984     document-type {
5985     node-name: 'a';
5986     public-id: 'pubid';
5987     system-id: 'sysid';
5988     }
5989     element { }
5990     }
5991     @@XMLTest:
5992     @@@QName: xp.doctype.pubid.sysid.3.test
5993     @@@DEnt:
5994     @@@@test:value:
5995     <!DOCTYPE a PUBLIC "pubid" 'sysid'>
5996     <a/>
5997     @@@test:domTree:
5998     document {
5999     document-type {
6000     node-name: 'a';
6001     public-id: 'pubid';
6002     system-id: 'sysid';
6003     }
6004     element { }
6005     }
6006     @@XMLTest:
6007     @@@QName: xp.doctype.pubid.sysid.4.test
6008     @@@DEnt:
6009     @@@@test:value:
6010     <!DOCTYPE a PUBLIC 'pubid' 'sysid'>
6011     <a/>
6012     @@@test:domTree:
6013     document {
6014     document-type {
6015     node-name: 'a';
6016     public-id: 'pubid';
6017     system-id: 'sysid';
6018     }
6019     element { }
6020     }
6021     @@XMLTest:
6022     @@@QName: xp.doctype.pubid.sysid.5.test
6023     @@@DEnt:
6024     @@@@test:value:
6025     <!DOCTYPE a PUBLIC "pubid" "sysid" >
6026     <a/>
6027     @@@test:domTree:
6028     document {
6029     document-type {
6030     node-name: 'a';
6031     public-id: 'pubid';
6032     system-id: 'sysid';
6033     }
6034     element { }
6035     }
6036     @@XMLTest:
6037     @@@QName: xp.doctype.pubid.sysid.6.test
6038     @@@DEnt:
6039     @@@@test:value:
6040     <!DOCTYPE a PUBLIC 'pubid' 'sysid' >
6041     <a/>
6042     @@@test:domTree:
6043     document {
6044     document-type {
6045     node-name: 'a';
6046     public-id: 'pubid';
6047     system-id: 'sysid';
6048     }
6049     element { }
6050     }
6051     @@XMLTest:
6052     @@@QName: xp.doctype.pubid.sysid.intsubset.1.test
6053     @@@DEnt:
6054     @@@@test:value:
6055     <!DOCTYPE a PUBLIC "pubid" "sysid"[]>
6056     <a/>
6057     @@@test:domTree:
6058     document {
6059     document-type {
6060     node-name: 'a';
6061     public-id: 'pubid';
6062     system-id: 'sysid';
6063     }
6064     element { }
6065     }
6066     @@XMLTest:
6067     @@@QName: xp.doctype.pubid.sysid.intsubset.2.test
6068     @@@DEnt:
6069     @@@@test:value:
6070     <!DOCTYPE a PUBLIC "pubid" "sysid" []>
6071     <a/>
6072     @@@test:domTree:
6073     document {
6074     document-type {
6075     node-name: 'a';
6076     public-id: 'pubid';
6077     system-id: 'sysid';
6078     }
6079     element { }
6080     }
6081     @@XMLTest:
6082     @@@QName: xp.doctype.pubid.sysid.intsubset.3.test
6083     @@@DEnt:
6084     @@@@test:value:
6085     <!DOCTYPE a PUBLIC 'pubid' 'sysid'[]>
6086     <a/>
6087     @@@test:domTree:
6088     document {
6089     document-type {
6090     node-name: 'a';
6091     public-id: 'pubid';
6092     system-id: 'sysid';
6093     }
6094     element { }
6095     }
6096     @@XMLTest:
6097     @@@QName: xp.doctype.pubid.sysid.intsubset.4.test
6098     @@@DEnt:
6099     @@@@test:value:
6100     <!DOCTYPE a PUBLIC 'pubid' 'sysid' []>
6101     <a/>
6102     @@@test:domTree:
6103     document {
6104     document-type {
6105     node-name: 'a';
6106     public-id: 'pubid';
6107     system-id: 'sysid';
6108     }
6109     element { }
6110     }
6111     @@XMLTest:
6112     @@@QName: xp.doctype.sysid.1.test
6113     @@@DEnt:
6114     @@@@test:value:
6115     <!DOCTYPE a SYSTEM "sysid">
6116     <a/>
6117     @@@test:domTree:
6118     document {
6119     document-type {
6120     node-name: 'a';
6121     public-id: null;
6122     system-id: 'sysid';
6123     }
6124     element { }
6125     }
6126     @@XMLTest:
6127     @@@QName: xp.doctype.sysid.2.test
6128     @@@DEnt:
6129     @@@@test:value:
6130     <!DOCTYPE a SYSTEM 'sysid'>
6131     <a/>
6132     @@@test:domTree:
6133     document {
6134     document-type {
6135     node-name: 'a';
6136     public-id: null;
6137     system-id: 'sysid';
6138     }
6139     element { }
6140     }
6141     @@XMLTest:
6142     @@@QName: xp.doctype.sysid.3.test
6143     @@@DEnt:
6144     @@@@test:value:
6145     <!DOCTYPE a SYSTEM "sysid" >
6146     <a/>
6147     @@@test:domTree:
6148     document {
6149     document-type {
6150     node-name: 'a';
6151     public-id: null;
6152     system-id: 'sysid';
6153     }
6154     element { }
6155     }
6156     @@XMLTest:
6157     @@@QName: xp.doctype.sysid.4.test
6158     @@@DEnt:
6159     @@@@test:value:
6160     <!DOCTYPE a SYSTEM 'sysid' >
6161     <a/>
6162     @@@test:domTree:
6163     document {
6164     document-type {
6165     node-name: 'a';
6166     public-id: null;
6167     system-id: 'sysid';
6168     }
6169     element { }
6170     }
6171     @@XMLTest:
6172     @@@QName: xp.doctype.sysid.intsubset.1.test
6173     @@@DEnt:
6174     @@@@test:value:
6175     <!DOCTYPE a SYSTEM "sysid"[]>
6176     <a/>
6177     @@@test:domTree:
6178     document {
6179     document-type {
6180     node-name: 'a';
6181     public-id: null;
6182     system-id: 'sysid';
6183     }
6184     element { }
6185     }
6186     @@XMLTest:
6187     @@@QName: xp.doctype.sysid.intsubset.2.test
6188     @@@DEnt:
6189     @@@@test:value:
6190     <!DOCTYPE a SYSTEM "sysid" []>
6191     <a/>
6192     @@@test:domTree:
6193     document {
6194     document-type {
6195     node-name: 'a';
6196     public-id: null;
6197     system-id: 'sysid';
6198     }
6199     element { }
6200     }
6201     @@XMLTest:
6202     @@@QName: xp.doctype.sysid.intsubset.3.test
6203     @@@DEnt:
6204     @@@@test:value:
6205     <!DOCTYPE a SYSTEM 'sysid'[]>
6206     <a/>
6207     @@@test:domTree:
6208     document {
6209     document-type {
6210     node-name: 'a';
6211     public-id: null;
6212     system-id: 'sysid';
6213     }
6214     element { }
6215     }
6216     @@XMLTest:
6217     @@@QName: xp.doctype.sysid.intsubset.4.test
6218     @@@DEnt:
6219     @@@@test:value:
6220     <!DOCTYPE a SYSTEM 'sysid' []>
6221     <a/>
6222     @@@test:domTree:
6223     document {
6224     document-type {
6225     node-name: 'a';
6226     public-id: null;
6227     system-id: 'sysid';
6228     }
6229     element { }
6230     }
6231     @@XMLTest:
6232     @@@QName: xp.doctype.public.stago.test
6233     @@@DEnt:
6234     @@@@test:value:
6235     <!DOCTYPE a PUBLIC<a/>
6236     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 19); }
6237     @@XMLTest:
6238     @@@QName: xp.doctype.public.mdc.test
6239     @@@DEnt:
6240     @@@@test:value:
6241     <!DOCTYPE a PUBLIC>
6242     <a/>
6243     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 19); }
6244     @@XMLTest:
6245     @@@QName: xp.doctype.public.s.stago.test
6246     @@@DEnt:
6247     @@@@test:value:
6248     <!DOCTYPE a PUBLIC <a/>
6249     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 20); }
6250     @@XMLTest:
6251     @@@QName: xp.doctype.public.s.mdc.test
6252     @@@DEnt:
6253     @@@@test:value:
6254     <!DOCTYPE a PUBLIC >
6255     <a/>
6256     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 20); }
6257     @@XMLTest:
6258     @@@QName: xp.doctype.public.lit.test
6259     @@@DEnt:
6260     @@@@test:value:
6261     <!DOCTYPE a PUBLIC"p" "s">
6262     <a/>
6263     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 19); }
6264     @@XMLTest:
6265     @@@QName: xp.doctype.public.lita.test
6266     @@@DEnt:
6267     @@@@test:value:
6268     <!DOCTYPE a PUBLIC'p' "s">
6269     <a/>
6270     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 19); }
6271     @@XMLTest:
6272     @@@QName: xp.doctype.pubid.lit.lita.unmatched.1.test
6273     @@@DEnt:
6274     @@@@test:value:
6275     <!DOCTYPE a PUBLIC "p' "s">
6276     <a/>
6277     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 25); }
6278     @@XMLTest:
6279     @@@QName: xp.doctype.pubid.lit.lita.unmatched.2.test
6280     @@@DEnt:
6281     @@@@test:value:
6282     <!DOCTYPE a PUBLIC "p' 's'><a/>
6283     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 32); }
6284     @@XMLTest:
6285     @@@QName: xp.doctype.pubid.lita.lit.unmatched.1.test
6286     @@@DEnt:
6287     @@@@test:value:
6288     <!DOCTYPE a PUBLIC 'p" "s"><a/>
6289     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 32); }
6290     @@XMLTest:
6291     @@@QName: xp.doctype.pubid.lita.lit.unmatched.2.test
6292     @@@DEnt:
6293     @@@@test:value:
6294     <!DOCTYPE a PUBLIC 'p" 's'>
6295     <a/>
6296     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 21)..(1, 25); }
6297     @@XMLTest:
6298     @@@QName: xp.doctype.public.s.lit.mdc.test
6299     @@@DEnt:
6300     @@@@test:value:
6301     <!DOCTYPE a PUBLIC "><a/>
6302     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 26); }
6303     @@XMLTest:
6304     @@@QName: xp.doctype.public.s.lita.mdc.test
6305     @@@DEnt:
6306     @@@@test:value:
6307     <!DOCTYPE a PUBLIC '><a/>
6308     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 26); }
6309     @@XMLTest:
6310     @@@QName: xp.doctype.public.lit.pubid.lit.mdc.test
6311     @@@DEnt:
6312     @@@@test:value:
6313     <!DOCTYPE a PUBLIC "p">
6314     <a/>
6315     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 23); }
6316     @@XMLTest:
6317     @@@QName: xp.doctype.public.lita.pubid.lita.mdc.test
6318     @@@DEnt:
6319     @@@@test:value:
6320     <!DOCTYPE a PUBLIC 'p'>
6321     <a/>
6322     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 23); }
6323     @@XMLTest:
6324     @@@QName: xp.doctype.public.lit.pubid.lit.s.mdc.test
6325     @@@DEnt:
6326     @@@@test:value:
6327     <!DOCTYPE a PUBLIC "p" >
6328     <a/>
6329     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 24); }
6330     @@XMLTest:
6331     @@@QName: xp.doctype.public.lita.pubid.lita.s.mdc.test
6332     @@@DEnt:
6333     @@@@test:value:
6334     <!DOCTYPE a PUBLIC 'p' >
6335     <a/>
6336     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 24); }
6337     @@XMLTest:
6338     @@@QName: xp.doctype.public.lit.pubid.lit.s.lit.mdc.test
6339     @@@DEnt:
6340     @@@@test:value:
6341     <!DOCTYPE a PUBLIC "p" "><a/>
6342     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 30); }
6343     @@XMLTest:
6344     @@@QName: xp.doctype.public.lit.pubid.lit.s.lita.mdc.test
6345     @@@DEnt:
6346     @@@@test:value:
6347     <!DOCTYPE a PUBLIC "p" '><a/>
6348     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 30); }
6349     @@XMLTest:
6350     @@@QName: xp.doctype.public.lita.pubid.lita.s.lit.mdc.test
6351     @@@DEnt:
6352     @@@@test:value:
6353     <!DOCTYPE a PUBLIC 'p' "><a/>
6354     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 30); }
6355     @@XMLTest:
6356     @@@QName: xp.doctype.public.lita.pubid.lita.s.lita.mdc.test
6357     @@@DEnt:
6358     @@@@test:value:
6359     <!DOCTYPE a PUBLIC 'p' '><a/>
6360     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 30); }
6361     @@XMLTest:
6362     @@@QName: xp.doctype.public.lit.pubid.lit.lit.lita.unmatched.mdc.test
6363     @@@DEnt:
6364     @@@@test:value:
6365     <!DOCTYPE a PUBLIC "p" "s'><a/>
6366     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 32); }
6367     @@XMLTest:
6368     @@@QName: xp.doctype.public.lita.pubid.lita.lita.lit.unmatched.mdc.test
6369     @@@DEnt:
6370     @@@@test:value:
6371     <!DOCTYPE a PUBLIC 'p' 's"><a/>
6372     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 32); }
6373     @@XMLTest:
6374     @@@QName: xp.doctype.pubid.sysid.stago.1.test
6375     @@@DEnt:
6376     @@@@test:value:
6377     <!DOCTYPE a PUBLIC "p" "s"<a/>
6378     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 27); }
6379     @@XMLTest:
6380     @@@QName: xp.doctype.pubid.sysid.stago.2.test
6381     @@@DEnt:
6382     @@@@test:value:
6383     <!DOCTYPE a PUBLIC "p" 's'<a/>
6384     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 27); }
6385     @@XMLTest:
6386     @@@QName: xp.doctype.pubid.sysid.stago.s.1.test
6387     @@@DEnt:
6388     @@@@test:value:
6389     <!DOCTYPE a PUBLIC "p" "s" <a/>
6390     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 28); }
6391     @@XMLTest:
6392     @@@QName: xp.doctype.pubid.sysid.stago.s.2.test
6393     @@@DEnt:
6394     @@@@test:value:
6395     <!DOCTYPE a PUBLIC "p" 's' <a/>
6396     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 28); }
6397 wakaba 1.16
6398     @@XMLTest:
6399     @@@QName: xp.endofline.1.0.crlf.test
6400     @@@DEnt:
6401     @@@@test:value:
6402     <?xml version="1.0"?>
6403     <p>aaa$u000D$u000Abbb</p>
6404 wakaba 1.6 @@@test:domTree:
6405     document {
6406     xml-version: '1.0';
6407 wakaba 1.16 element {
6408     text-content: 'aaa' U+000A 'bbb';
6409 wakaba 1.6 }
6410 wakaba 1.16 }
6411     @@XMLTest:
6412     @@@QName: xp.endofline.1.1.crlf.test
6413     @@@DEnt:
6414     @@@@test:value:
6415     <?xml version="1.1"?>
6416     <p>aaa$u000D$u000Abbb</p>
6417     @@@test:domTree:
6418     document {
6419     xml-version: '1.1';
6420 wakaba 1.6 element {
6421 wakaba 1.16 text-content: 'aaa' U+000A 'bbb';
6422 wakaba 1.6 }
6423     }
6424     @@XMLTest:
6425 wakaba 1.16 @@@QName: xp.endofline.1.0.crnl.test
6426 wakaba 1.6 @@@DEnt:
6427     @@@@test:value:
6428 wakaba 1.16 <?xml version="1.0"?>
6429     <p>aaa$u000D$u0085bbb</p>
6430 wakaba 1.6 @@@test:domTree:
6431     document {
6432     xml-version: '1.0';
6433 wakaba 1.16 element {
6434     text-content: 'aaa' U+000A U+0085 'bbb';
6435 wakaba 1.6 }
6436 wakaba 1.16 }
6437     @@XMLTest:
6438     @@@QName: xp.endofline.1.1.crnl.test
6439     @@@DEnt:
6440     @@@@test:value:
6441     <?xml version="1.1"?>
6442     <p>aaa$u000D$u0085bbb</p>
6443     @@@test:domTree:
6444     document {
6445     xml-version: '1.1';
6446 wakaba 1.6 element {
6447 wakaba 1.16 text-content: 'aaa' U+000A 'bbb';
6448 wakaba 1.6 }
6449     }
6450     @@XMLTest:
6451 wakaba 1.16 @@@QName: xp.endofline.1.0.nl.test
6452 wakaba 1.6 @@@DEnt:
6453     @@@@test:value:
6454 wakaba 1.16 <?xml version="1.0"?>
6455     <p>aaa$u0085bbb</p>
6456 wakaba 1.6 @@@test:domTree:
6457     document {
6458     xml-version: '1.0';
6459     element {
6460 wakaba 1.16 text-content: 'aaa' U+0085 'bbb';
6461 wakaba 1.6 }
6462     }
6463     @@XMLTest:
6464 wakaba 1.16 @@@QName: xp.endofline.1.1.nl.test
6465 wakaba 1.6 @@@DEnt:
6466     @@@@test:value:
6467 wakaba 1.16 <?xml version="1.1"?>
6468     <p>aaa$u0085bbb</p>
6469     @@@test:domTree:
6470     document {
6471     xml-version: '1.1';
6472     element {
6473     text-content: 'aaa' U+000A 'bbb';
6474     }
6475     }
6476     @@XMLTest:
6477     @@@QName: xp.endofline.1.0.ls.test
6478     @@@DEnt:
6479     @@@@test:value:
6480     <?xml version="1.0"?>
6481     <p>aaa$u2028bbb</p>
6482     @@@test:domTree:
6483     document {
6484     xml-version: '1.0';
6485     element {
6486     text-content: 'aaa' U+2028 'bbb';
6487     }
6488     }
6489     @@XMLTest:
6490     @@@QName: xp.endofline.1.1.ls.test
6491     @@@DEnt:
6492     @@@@test:value:
6493     <?xml version="1.1"?>
6494     <p>aaa$u2028bbb</p>
6495     @@@test:domTree:
6496     document {
6497     xml-version: '1.1';
6498     element {
6499     text-content: 'aaa' U+000A 'bbb';
6500     }
6501     }
6502     @@XMLTest:
6503     @@@QName: xp.endofline.1.0.cr.test
6504     @@@DEnt:
6505     @@@@test:value:
6506     <?xml version="1.0"?>
6507     <p>aaa$u000Dbbb</p>
6508     @@@test:domTree:
6509     document {
6510     xml-version: '1.0';
6511     element {
6512     text-content: 'aaa' U+000A 'bbb';
6513     }
6514     }
6515     @@XMLTest:
6516     @@@QName: xp.endofline.1.1.cr.test
6517     @@@DEnt:
6518     @@@@test:value:
6519     <?xml version="1.1"?>
6520     <p>aaa$u000Dbbb</p>
6521     @@@test:domTree:
6522     document {
6523     xml-version: '1.1';
6524     element {
6525     text-content: 'aaa' U+000A 'bbb';
6526     }
6527     }
6528     @@XMLTest:
6529     @@@QName: xp.endofline.1.0.lf.test
6530     @@@DEnt:
6531     @@@@test:value:
6532     <?xml version="1.0"?>
6533     <p>aaa$u000Abbb</p>
6534     @@@test:domTree:
6535     document {
6536     xml-version: '1.0';
6537     element {
6538     text-content: 'aaa' U+000A 'bbb';
6539     }
6540     }
6541     @@XMLTest:
6542     @@@QName: xp.endofline.1.1.lf.test
6543     @@@DEnt:
6544     @@@@test:value:
6545     <?xml version="1.1"?>
6546     <p>aaa$u000Abbb</p>
6547     @@@test:domTree:
6548     document {
6549     xml-version: '1.1';
6550     element {
6551     text-content: 'aaa' U+000A 'bbb';
6552     }
6553     }
6554     @@XMLTest:
6555     @@@QName: xp.xml10.endofline.nl.in.xmldecl.1.test
6556     @@@DEnt:
6557     @@@@test:value:
6558     <?xml$u0085version="1.0"?>
6559     <p/>
6560     @@@c:erred:
6561     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 6)..(2, 0); }
6562     @@@c:erred: <[[xp|wf-syntax-error]]> { }
6563     @@XMLTest:
6564     @@@QName: xp.xml11.endofline.nl.in.xmldecl.1.test
6565     @@@DEnt:
6566     @@@@test:value:
6567     <?xml$u0085version="1.1"?>
6568     (err)<p/>
6569     @@@c:erred:
6570     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 6)..(2, 0); }
6571     @@@c:erred: <[[xp|wf-syntax-error]]> { }
6572     @@XMLTest:
6573     @@@QName: xp.xml10.endofline.crnl.in.xmldecl.1.test
6574     @@@DEnt:
6575     @@@@test:value:
6576     <?xml$u000D$u0085version="1.0"?>
6577     <p/>
6578     @@@c:erred:
6579     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 6)..(2, 0); }
6580     @@@c:erred: <[[xp|wf-syntax-error]]> { }
6581     @@XMLTest:
6582     @@@QName: xp.xml11.endofline.crnl.in.xmldecl.1.test
6583     @@@DEnt:
6584     @@@@test:value:
6585     <?xml$u000D$u0085version="1.1"?>
6586     (err)<p/>
6587     @@@c:erred:
6588     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 6)..(2, 0); }
6589     @@@c:erred: <[[xp|wf-syntax-error]]> { }
6590     @@XMLTest:
6591     @@@QName: xp.xml10.endofline.ls.in.xmldecl.1.test
6592     @@@DEnt:
6593     @@@@test:value:
6594     <?xml$u2028version="1.0"?>
6595     <p/>
6596     @@@c:erred:
6597     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 6)..(2, 0); }
6598     @@@c:erred: <[[xp|wf-syntax-error]]> { }
6599     @@XMLTest:
6600     @@@QName: xp.xml11.endofline.ls.in.xmldecl.1.test
6601     @@@DEnt:
6602     @@@@test:value:
6603     <?xml$u2028version="1.1"?>
6604     (err)<p/>
6605     @@@c:erred:
6606     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 6)..(2, 0); }
6607     @@@c:erred: <[[xp|wf-syntax-error]]> { }
6608     @@XMLTest:
6609     @@@QName: xp.xml10.endofline.nl.in.xmldecl.2.test
6610     @@@DEnt:
6611     @@@@test:value:
6612     <?xml version="1.0"$u0085?>
6613     <p/>
6614     @@@c:erred:
6615     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 20)..(2, 0); }
6616     @@@c:erred: <[[xp|wf-syntax-error]]> { }
6617     @@XMLTest:
6618     @@@QName: xp.xml11.endofline.nl.in.xmldecl.2.test
6619     @@@DEnt:
6620     @@@@test:value:
6621     <?xml version="1.1"$u0085?>
6622     (err)<p/>
6623     @@@c:erred:
6624     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 20)..(2, 0); }
6625     @@@c:erred: <[[xp|wf-syntax-error]]> { }
6626     @@XMLTest:
6627     @@@QName: xp.xml10.endofline.crnl.in.xmldecl.2.test
6628     @@@DEnt:
6629     @@@@test:value:
6630     <?xml version="1.0"$u000D$u0085?>
6631     <p/>
6632     @@@c:erred:
6633     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 20)..(2, 0); }
6634     @@@c:erred: <[[xp|wf-syntax-error]]> { }
6635     @@XMLTest:
6636     @@@QName: xp.xml11.endofline.crnl.in.xmldecl.2.test
6637     @@@DEnt:
6638     @@@@test:value:
6639     <?xml version="1.1"$u000D$u0085?>
6640     (err)<p/>
6641     @@@c:erred:
6642     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 20)..(2, 0); }
6643     @@@c:erred: <[[xp|wf-syntax-error]]> { }
6644     @@XMLTest:
6645     @@@QName: xp.xml10.endofline.ls.in.xmldecl.2.test
6646     @@@DEnt:
6647     @@@@test:value:
6648     <?xml version="1.0"$u2028?>
6649     <p/>
6650     @@@c:erred:
6651     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 20)..(2, 0); }
6652     @@@c:erred: <[[xp|wf-syntax-error]]> { }
6653     @@XMLTest:
6654     @@@QName: xp.xml11.endofline.ls.in.xmldecl.2.test
6655     @@@DEnt:
6656     @@@@test:value:
6657     <?xml version="1.1"$u2028?>
6658     (err)<p/>
6659     @@@c:erred:
6660     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 20)..(2, 0); }
6661     @@@c:erred: <[[xp|wf-syntax-error]]> { }
6662     @@XMLTest:
6663     @@@QName: xp.xml10.endofline.nl.in.xmldecl.3.test
6664     @@@DEnt:
6665     @@@@test:value:
6666     <?xml $u0085version="1.0"?>
6667     <p/>
6668     @@@c:erred:
6669     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 7)..(2, 0); }
6670     @@@c:erred: <[[xp|wf-syntax-error]]> { }
6671     @@XMLTest:
6672     @@@QName: xp.xml11.endofline.nl.in.xmldecl.3.test
6673     @@@DEnt:
6674     @@@@test:value:
6675     <?xml $u0085version="1.1"?>
6676     (err)<p/>
6677     @@@c:erred:
6678     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 7)..(2, 0); }
6679     @@@c:erred: <[[xp|wf-syntax-error]]> { }
6680     @@XMLTest:
6681     @@@QName: xp.xml10.endofline.crnl.in.xmldecl.3.test
6682     @@@DEnt:
6683     @@@@test:value:
6684     <?xml $u000D$u0085version="1.0"?>
6685     <p/>
6686     @@@c:erred:
6687     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 7)..(2, 0); }
6688     @@@c:erred: <[[xp|wf-syntax-error]]> { }
6689     @@XMLTest:
6690     @@@QName: xp.xml11.endofline.crnl.in.xmldecl.3.test
6691     @@@DEnt:
6692     @@@@test:value:
6693     <?xml $u000D$u0085version="1.1"?>
6694     (err)<p/>
6695     @@@c:erred:
6696     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 7)..(2, 0); }
6697     @@@c:erred: <[[xp|wf-syntax-error]]> { }
6698     @@XMLTest:
6699     @@@QName: xp.xml10.endofline.ls.in.xmldecl.3.test
6700     @@@DEnt:
6701     @@@@test:value:
6702     <?xml $u2028version="1.0"?>
6703     <p/>
6704     @@@c:erred:
6705     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 7)..(2, 0); }
6706     @@@c:erred: <[[xp|wf-syntax-error]]> { }
6707     @@XMLTest:
6708     @@@QName: xp.xml11.endofline.ls.in.xmldecl.3.test
6709     @@@DEnt:
6710     @@@@test:value:
6711     <?xml $u2028version="1.1"?>
6712     (err)<p/>
6713     @@@c:erred:
6714     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 7)..(2, 0); }
6715     @@@c:erred: <[[xp|wf-syntax-error]]> { }
6716     @@XMLTest:
6717     @@@QName: xp.xml10implied.endofline.nl.in.pi.1.test
6718     @@@DEnt:
6719     @@@@test:value:
6720     <?xml-$u0085?>
6721     <p/>
6722     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 7)..(2, 0); }
6723     @@XMLTest:
6724     @@@QName: xp.xml10.endofline.nl.in.pi.1.test
6725     @@@DEnt:
6726     @@@@test:value:
6727     <?xml version="1.0"?>
6728     <?xml-$u0085?>
6729     <p/>
6730     @@@c:erred: <[[xp|wf-syntax-error]]> { (2, 7)..(3, 0); }
6731     @@XMLTest:
6732     @@@QName: xp.xml11.endofline.nl.in.pi.1.test
6733     @@@DEnt:
6734     @@@@test:value:
6735     <?xml version="1.1"?>
6736     <?xml-$u0085?>
6737     <p/>
6738     @@@test:domTree:
6739     document {
6740     xml-version: '1.1';
6741     pi {
6742     node-name: 'xml-';
6743     node-value: '';
6744     }
6745     element { }
6746     }
6747     @@XMLTest:
6748     @@@QName: xp.xml10implied.endofline.crnl.in.pi.1.test
6749     @@@DEnt:
6750     @@@@test:value:
6751     <?xml-$u000D$u0085?>
6752     <p/>
6753     @@@test:domTree:
6754     document {
6755     xml-version: '1.0';
6756     pi {
6757     node-name: 'xml-';
6758     node-value: U+0085;
6759     }
6760     element { }
6761     }
6762     @@XMLTest:
6763     @@@QName: xp.xml10.endofline.crnl.in.pi.1.test
6764     @@@DEnt:
6765     @@@@test:value:
6766     <?xml version="1.0"?>
6767     <?xml-$u000D$u0085?>
6768     <p/>
6769     @@@test:domTree:
6770     document {
6771     xml-version: '1.0';
6772     pi {
6773     node-name: 'xml-';
6774     node-value: U+0085;
6775     }
6776     element { }
6777     }
6778     @@XMLTest:
6779     @@@QName: xp.xml11.endofline.crnl.in.pi.1.test
6780     @@@DEnt:
6781     @@@@test:value:
6782     <?xml version="1.1"?>
6783     <?xml-$u000D$u0085?>
6784     <p/>
6785     @@@test:domTree:
6786     document {
6787     xml-version: '1.1';
6788     pi {
6789     node-name: 'xml-';
6790     node-value: '';
6791     }
6792     element { }
6793     }
6794     @@XMLTest:
6795     @@@QName: xp.xml10implied.endofline.ls.in.pi.1.test
6796     @@@DEnt:
6797     @@@@test:value:
6798     <?xml-$u2028?>
6799     <p/>
6800     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 7)..(2, 0); }
6801     @@XMLTest:
6802     @@@QName: xp.xml10.endofline.ls.in.pi.1.test
6803     @@@DEnt:
6804     @@@@test:value:
6805     <?xml version="1.0"?>
6806     <?xml-$u2028?>
6807     <p/>
6808     @@@c:erred: <[[xp|wf-syntax-error]]> { (2, 7)..(3, 0); }
6809     @@XMLTest:
6810     @@@QName: xp.xml11.endofline.ls.in.pi.1.test
6811     @@@DEnt:
6812     @@@@test:value:
6813     <?xml version="1.1"?>
6814     <?xml-$u2028?>
6815     <p/>
6816     @@@test:domTree:
6817     document {
6818     xml-version: '1.1';
6819     pi {
6820     node-name: 'xml-';
6821     node-value: '';
6822     }
6823     element { }
6824     }
6825     @@XMLTest:
6826     @@@QName: xp.noxmldecl.pi.pi.test
6827     @@@DEnt:
6828     @@@@test:value:
6829     <?noxml 1?><?noxml 2?><p/>
6830     @@@test:domTree:
6831     document {
6832     xml-version: '1.0';
6833     pi {
6834     node-name: 'noxml';
6835     node-value: '1';
6836     }
6837     pi {
6838     node-name: 'noxml';
6839     node-value: '2';
6840     }
6841     element { }
6842     }
6843     @@XMLTest:
6844     @@@QName: xp.noxmldecl.pi.pi.2.test
6845     @@@DEnt:
6846     @@@@test:value:
6847     <?xmlno 1?><?xmlno 2?><p/>
6848     @@@test:domTree:
6849     document {
6850     xml-version: '1.0';
6851     pi {
6852     node-name: 'xmlno';
6853     node-value: '1';
6854     }
6855     pi {
6856     node-name: 'xmlno';
6857     node-value: '2';
6858     }
6859     element { }
6860     }
6861     @@XMLTest:
6862     @@@QName: xp.noxmldecl.pi.pi.3.test
6863     @@@DEnt:
6864     @@@@test:value:
6865     <?xmln 1?><?xmln 2?><p/>
6866     @@@test:domTree:
6867     document {
6868     xml-version: '1.0';
6869     pi {
6870     node-name: 'xmln';
6871     node-value: '1';
6872     }
6873     pi {
6874     node-name: 'xmln';
6875     node-value: '2';
6876     }
6877     element { }
6878     }
6879     @@XMLTest:
6880     @@@QName: xp.noxml.s.nl.test
6881     @@@DEnt:
6882     @@@@test:value:
6883     $u0085<p/>
6884     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 1)..(2, 0); }
6885     @@XMLTest:
6886     @@@QName: xp.noxml.s.crnl.test
6887     @@@DEnt:
6888     @@@@test:value:
6889     $u000D$u0085<p/>
6890     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 1)..(2, 0); }
6891     @@XMLTest:
6892     @@@QName: xp.noxml.s.ls.test
6893     @@@DEnt:
6894     @@@@test:value:
6895     $u2028<p/>
6896     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 1)..(2, 0); }
6897     @@XMLTest:
6898     @@@QName: xp.xml10.decl.s.nl.test
6899     @@@DEnt:
6900     @@@@test:value:
6901     <?xml version="1.0"?>$u0085<p/>
6902     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 22)..(2, 0); }
6903     @@XMLTest:
6904     @@@QName: xp.xml10.decl.s.crnl.test
6905     @@@DEnt:
6906     @@@@test:value:
6907     <?xml version="1.0"?>$u000D$u0085<p/>
6908     @@@c:erred: <[[xp|wf-syntax-error]]> { (2, 0)..(3, 0); }
6909     @@XMLTest:
6910     @@@QName: xp.xml10.decl.s.ls.test
6911     @@@DEnt:
6912     @@@@test:value:
6913     <?xml version="1.0"?>$u2028<p/>
6914     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 22)..(2, 0); }
6915     @@XMLTest:
6916     @@@QName: xp.xml11.decl.s.nl.test
6917     @@@DEnt:
6918     @@@@test:value:
6919     <?xml version="1.1"?>$u0085<p/>
6920     @@@test:domTree:
6921     document {
6922     xml-version: '1.1';
6923     element { }
6924     }
6925     @@XMLTest:
6926     @@@QName: xp.xml11.decl.s.crnl.test
6927     @@@DEnt:
6928     @@@@test:value:
6929     <?xml version="1.1"?>$u000D$u0085<p/>
6930     @@@test:domTree:
6931     document {
6932     xml-version: '1.1';
6933     element { }
6934     }
6935     @@XMLTest:
6936     @@@QName: xp.xml11.decl.s.ls.test
6937     @@@DEnt:
6938     @@@@test:value:
6939     <?xml version="1.1"?>$u2028<p/>
6940     @@@test:domTree:
6941     document {
6942     xml-version: '1.1';
6943     element { }
6944     }
6945    
6946     @@XMLTest:
6947 wakaba 1.18 @@@QName: xp.element.type.match.1.test
6948     @@@DEnt:
6949     @@@@test:value:
6950     <p></pa>(err)
6951     @@@c:erred: <[[xp|wf-element-type-match]]> { (1, 4)..(1, 8); }
6952     @@@c:erred: <[[xp|wf-syntax-error]]> { }
6953     @@XMLTest:
6954     @@@QName: xp.element.type.match.2.test
6955     @@@DEnt:
6956     @@@@test:value:
6957     <p><pa></pa></pa>(err)
6958     @@@c:erred: <[[xp|wf-element-type-match]]> { (1, 13)..(1, 17); }
6959     @@@c:erred: <[[xp|wf-syntax-error]]> { }
6960     @@XMLTest:
6961     @@@QName: xp.element.type.match.3.test
6962     @@@DEnt:
6963     @@@@test:value:
6964     <p><pa></p></p>(err)
6965     @@@c:erred: <[[xp|wf-element-type-match]]> { (1, 8)..(1, 11); }
6966     @@@c:erred: <[[xp|wf-syntax-error]]> { }
6967     @@XMLTest:
6968     @@@QName: xp.element.type.match.4.test
6969     @@@DEnt:
6970     @@@@test:value:
6971     <a:p xmlns:a="about:1"></p>(err)
6972     @@@c:erred: <[[xp|wf-element-type-match]]> { (1, 24)..(1, 27); }
6973     @@@c:erred: <[[xp|wf-syntax-error]]> { }
6974     @@XMLTest:
6975     @@@QName: xp.element.type.match.5.test
6976     @@@DEnt:
6977     @@@@test:value:
6978     <a:p xmlns:a="about:1" xmlns:b="about:1"></b:p>(err)
6979     @@@c:erred: <[[xp|wf-element-type-match]]> { (1, 42)..(1, 47); }
6980     @@@c:erred: <[[xp|wf-syntax-error]]> { }
6981    
6982     @@XMLTest:
6983     @@@QName: xp.stag.stago.name.etago.test
6984     @@@DEnt:
6985     @@@@test:value:
6986     <a</a>
6987     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 3); }
6988     @@XMLTest:
6989     @@@QName: xp.stag.stago.name.s.etago.test
6990     @@@DEnt:
6991     @@@@test:value:
6992     <a </a>
6993     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 4); }
6994     @@XMLTest:
6995     @@@QName: xp.stag.stago.name.s.attr.etago.test
6996     @@@DEnt:
6997     @@@@test:value:
6998     <a a="b"</a>
6999     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 9); }
7000     @@XMLTest:
7001     @@@QName: xp.stag.stago.name.s.attr.s.attr.etago.test
7002     @@@DEnt:
7003     @@@@test:value:
7004     <a a="b" c="d"</a>
7005     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 15); }
7006     @@XMLTest:
7007     @@@QName: xp.stag.stago.name.s.attr.s.etago.test
7008     @@@DEnt:
7009     @@@@test:value:
7010     <a a="b" </a>
7011     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 10); }
7012     @@XMLTest:
7013     @@@QName: xp.stag.etag.1.test
7014 wakaba 1.16 @@@DEnt:
7015     @@@@test:value:
7016 wakaba 1.18 <root><a></a></root>
7017 wakaba 1.16 @@@test:domTree:
7018     document {
7019 wakaba 1.18 element {
7020     element {
7021     node-name: 'a';
7022 wakaba 1.16 }
7023     }
7024 wakaba 1.18 }
7025     @@XMLTest:
7026     @@@QName: xp.stag.etag.2.test
7027     @@@DEnt:
7028     @@@@test:value:
7029     <root><ab></ab></root>
7030     @@@test:domTree:
7031     document {
7032 wakaba 1.16 element {
7033 wakaba 1.18 element {
7034     node-name: 'ab';
7035     }
7036 wakaba 1.16 }
7037 wakaba 1.18 }
7038 wakaba 1.16 @@XMLTest:
7039 wakaba 1.18 @@@QName: xp.stag.etag.s.1.test
7040 wakaba 1.16 @@@DEnt:
7041     @@@@test:value:
7042 wakaba 1.18 <root><a ></a ></root>
7043 wakaba 1.16 @@@test:domTree:
7044     document {
7045 wakaba 1.18 element {
7046     element {
7047     node-name: 'a';
7048 wakaba 1.16 }
7049     }
7050 wakaba 1.18 }
7051     @@XMLTest:
7052     @@@QName: xp.etag.1.test
7053     @@@DEnt:
7054     @@@@test:value:
7055     <root><a/></root>
7056     @@@test:domTree:
7057     document {
7058 wakaba 1.16 element {
7059 wakaba 1.18 element {
7060     node-name: 'a';
7061     }
7062 wakaba 1.16 }
7063 wakaba 1.18 }
7064 wakaba 1.16 @@XMLTest:
7065 wakaba 1.18 @@@QName: xp.etag.2.test
7066 wakaba 1.16 @@@DEnt:
7067     @@@@test:value:
7068 wakaba 1.18 <root><a /></root>
7069 wakaba 1.16 @@@test:domTree:
7070     document {
7071     element {
7072 wakaba 1.18 element {
7073     node-name: 'a';
7074     }
7075 wakaba 1.16 }
7076 wakaba 1.18 }
7077 wakaba 1.16 @@XMLTest:
7078 wakaba 1.18 @@@QName: xp.stag.etag.attr.1.test
7079 wakaba 1.16 @@@DEnt:
7080     @@@@test:value:
7081 wakaba 1.18 <root><a at="v"></a></root>
7082 wakaba 1.16 @@@test:domTree:
7083     document {
7084 wakaba 1.18 element {
7085     element {
7086     node-name: 'a';
7087     attribute {
7088     node-name: 'at';
7089     value: 'v';
7090     }
7091 wakaba 1.16 }
7092     }
7093 wakaba 1.18 }
7094     @@XMLTest:
7095     @@@QName: xp.stag.etag.attr.2.test
7096     @@@DEnt:
7097     @@@@test:value:
7098     <root><a at="v" ></a></root>
7099     @@@test:domTree:
7100     document {
7101 wakaba 1.16 element {
7102 wakaba 1.18 element {
7103     node-name: 'a';
7104     attribute {
7105     node-name: 'at';
7106     value: 'v';
7107 wakaba 1.16 }
7108     }
7109     }
7110 wakaba 1.18 }
7111 wakaba 1.16 @@XMLTest:
7112 wakaba 1.18 @@@QName: xp.stag.etag.attr.3.test
7113 wakaba 1.16 @@@DEnt:
7114     @@@@test:value:
7115 wakaba 1.18 <root><a at ="v"></a></root>
7116 wakaba 1.16 @@@test:domTree:
7117     document {
7118 wakaba 1.18 element {
7119     element {
7120     node-name: 'a';
7121     attribute {
7122     node-name: 'at';
7123     value: 'v';
7124     }
7125 wakaba 1.16 }
7126     }
7127 wakaba 1.18 }
7128     @@XMLTest:
7129     @@@QName: xp.stag.etag.attr.4.test
7130     @@@DEnt:
7131     @@@@test:value:
7132     <root><a at= "v"></a></root>
7133     @@@test:domTree:
7134     document {
7135 wakaba 1.16 element {
7136 wakaba 1.18 element {
7137     node-name: 'a';
7138     attribute {
7139     node-name: 'at';
7140     value: 'v';
7141 wakaba 1.16 }
7142     }
7143 wakaba 1.18 }
7144     }
7145     @@XMLTest:
7146     @@@QName: xp.stag.etag.attr.5.test
7147     @@@DEnt:
7148     @@@@test:value:
7149     <root><a at='v'></a></root>
7150     @@@test:domTree:
7151     document {
7152     element {
7153     element {
7154     node-name: 'a';
7155     attribute {
7156     node-name: 'at';
7157     value: 'v';
7158 wakaba 1.16 }
7159     }
7160     }
7161 wakaba 1.18 }
7162 wakaba 1.16 @@XMLTest:
7163 wakaba 1.18 @@@QName: xp.stag.etag.attr.6.test
7164 wakaba 1.16 @@@DEnt:
7165     @@@@test:value:
7166 wakaba 1.18 <root><a at= 'v' ></a></root>
7167 wakaba 1.6 @@@test:domTree:
7168     document {
7169 wakaba 1.18 element {
7170     element {
7171     node-name: 'a';
7172     attribute {
7173     node-name: 'at';
7174     value: 'v';
7175     }
7176 wakaba 1.11 }
7177 wakaba 1.6 }
7178 wakaba 1.18 }
7179     @@XMLTest:
7180     @@@QName: xp.stag.etag.attr.attr.1.test
7181     @@@DEnt:
7182     @@@@test:value:
7183     <root><a at="v" tr="w"></a></root>
7184     @@@test:domTree:
7185     document {
7186 wakaba 1.6 element {
7187 wakaba 1.18 element {
7188     node-name: 'a';
7189     attribute {
7190     node-name: 'at';
7191     value: 'v';
7192 wakaba 1.6 }
7193 wakaba 1.18 attribute {
7194     node-name: 'tr';
7195     value: 'w';
7196 wakaba 1.6 }
7197     }
7198     }
7199 wakaba 1.18 }
7200 wakaba 1.6 @@XMLTest:
7201 wakaba 1.18 @@@QName: xp.stag.etag.attr.attr.2.test
7202 wakaba 1.6 @@@DEnt:
7203     @@@@test:value:
7204 wakaba 1.18 <root><a tr="w" at="v"></a></root>
7205 wakaba 1.6 @@@test:domTree:
7206     document {
7207 wakaba 1.18 element {
7208     element {
7209     node-name: 'a';
7210     attribute {
7211     node-name: 'at';
7212     value: 'v';
7213     }
7214     attribute {
7215     node-name: 'tr';
7216     value: 'w';
7217 wakaba 1.11 }
7218     }
7219 wakaba 1.6 }
7220 wakaba 1.18 }
7221     @@XMLTest:
7222     @@@QName: xp.stag.etag.attr.no.s.attr.test
7223     @@@DEnt:
7224     @@@@test:value:
7225     <root><a at="v"tr="w"></a></root>
7226     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 16)..(1, 17); }
7227     @@XMLTest:
7228     @@@QName: xp.etag.attr.1.test
7229     @@@DEnt:
7230     @@@@test:value:
7231     <root><a at="v" tr="w"></a b="c"></root>
7232     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 28); }
7233     @@XMLTest:
7234     @@@QName: xp.etag.no.etagc.1.test
7235     @@@DEnt:
7236     @@@@test:value:
7237     <root><a at="v" tr="w"></a</root>
7238     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 27)..(1, 28); }
7239     @@XMLTest:
7240     @@@QName: xp.etag.no.etagc.2.test
7241     @@@DEnt:
7242     @@@@test:value:
7243     <root><a at="v" tr="w"></a </root>
7244     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 29)..(1, 30); }
7245     @@XMLTest:
7246     @@@QName: xp.mtag.attr.1.test
7247     @@@DEnt:
7248     @@@@test:value:
7249     <root><a b="c"/></root>
7250     @@@test:domTree:
7251     document {
7252 wakaba 1.6 element {
7253 wakaba 1.18 element {
7254     node-name: 'a';
7255     attribute {
7256     node-name: 'b';
7257     value: 'c';
7258 wakaba 1.6 }
7259     }
7260 wakaba 1.8 }
7261 wakaba 1.18 }
7262 wakaba 1.11 @@XMLTest:
7263 wakaba 1.18 @@@QName: xp.mtag.attr.2.test
7264 wakaba 1.11 @@@DEnt:
7265     @@@@test:value:
7266 wakaba 1.18 <root><a b="c" /></root>
7267 wakaba 1.11 @@@test:domTree:
7268     document {
7269 wakaba 1.18 element {
7270     element {
7271     node-name: 'a';
7272     attribute {
7273     node-name: 'b';
7274     value: 'c';
7275     }
7276 wakaba 1.11 }
7277     }
7278 wakaba 1.18 }
7279 wakaba 1.11 @@XMLTest:
7280 wakaba 1.18 @@@QName: xp.mtag.attr.3.test
7281 wakaba 1.11 @@@DEnt:
7282     @@@@test:value:
7283 wakaba 1.18 <root><a b='c'/></root>
7284 wakaba 1.11 @@@test:domTree:
7285     document {
7286     element {
7287 wakaba 1.18 element {
7288     node-name: 'a';
7289     attribute {
7290     node-name: 'b';
7291     value: 'c';
7292     }
7293     }
7294 wakaba 1.11 }
7295 wakaba 1.18 }
7296 wakaba 1.11 @@XMLTest:
7297 wakaba 1.18 @@@QName: xp.mtag.attr.4.test
7298 wakaba 1.11 @@@DEnt:
7299     @@@@test:value:
7300 wakaba 1.18 <root><a b="c" d="e"/></root>
7301 wakaba 1.11 @@@test:domTree:
7302     document {
7303     element {
7304 wakaba 1.18 element {
7305     node-name: 'a';
7306     attribute {
7307     node-name: 'b';
7308     value: 'c';
7309     }
7310     attribute {
7311     node-name: 'd';
7312     value: 'e';
7313     }
7314 wakaba 1.11 }
7315     }
7316 wakaba 1.18 }
7317    
7318     @@XMLTest:
7319     @@@QName: xp.attvalue.lt.1.test
7320     @@@DEnt:
7321     @@@@test:value:
7322     <a b="aa<dd"/>
7323     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 9); }
7324     @@XMLTest:
7325     @@@QName: xp.attvalue.lt.2.test
7326     @@@DEnt:
7327     @@@@test:value:
7328     <a b='aa<dd'/>
7329     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 9); }
7330     @@XMLTest:
7331     @@@QName: xp.attvalue.amp.1.test
7332     @@@DEnt:
7333     @@@@test:value:
7334     <a b="aa& dd"/>
7335     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 9)..(1, 12); }
7336     @@XMLTest:
7337     @@@QName: xp.attvalue.amp.2.test
7338     @@@DEnt:
7339     @@@@test:value:
7340     <a b='aa& dd'/>
7341     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 9)..(1, 12); }
7342     @@XMLTest:
7343     @@@QName: xp.attvalue.amp.3.test
7344     @@@DEnt:
7345     @@@@test:value:
7346     <a b="aa&# dd"/>
7347     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 9)..(1, 13); }
7348     @@XMLTest:
7349     @@@QName: xp.attvalue.amp.4.test
7350     @@@DEnt:
7351     @@@@test:value:
7352     <a b="aa&#x dd"/>
7353     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 9)..(1, 14); }
7354    
7355     @@XMLTest:
7356     @@@QName: xp.unique.att.spec.1.test
7357     @@@DEnt:
7358     @@@@test:value:
7359     <a b="c" b="d"/>
7360     @@@c:erred: <[[xp|wf-unique-att-spec]]> { (1, 4)..(1, 14); }
7361     @@XMLTest:
7362     @@@QName: xp.unique.att.spec.2.test
7363     @@@DEnt:
7364     @@@@test:value:
7365     <a d:b="c" d:b="d" xmlns:d="about:2"/>
7366     @@@c:erred: <[[xp|wf-unique-att-spec]]> { (1, 4)..(1, 18); }
7367    
7368     @@XMLTest:
7369     @@@QName: xp.no.external.entity.references.1.test
7370     @@@DEnt:
7371     @@@@test:value:
7372     <!DOCTYPE a [
7373     <!ENTITY ent SYSTEM "something">
7374     ]>
7375     <a b="c&ent;"/>
7376     @@@c:erred: <[[xp|wf-no-external-entity-references]]> { (4, 8)..(4, 12); }
7377     @@XMLTest:
7378     @@@QName: xp.no.external.entity.references.2.test
7379     @@@DEnt:
7380     @@@@test:value:
7381     <!DOCTYPE a [
7382     <!NOTATION n SYSTEM "notation">
7383     <!ENTITY ent SYSTEM "something" NDATA n>
7384     ]>
7385     <a b="c&ent;"/>
7386     @@@c:erred: <[[xp|wf-no-external-entity-references]]> { (5, 8)..(5, 12); }
7387     @@XMLTest:
7388     @@@QName: xp.no.external.entity.references.3.test
7389     @@@DEnt:
7390     @@@@test:value:
7391     <!DOCTYPE a [
7392     <!ENTITY ent SYSTEM "something">
7393     <!ENTITY ent2 "ddd&ent;">
7394     ]>
7395     <a b="c&ent2;"/>
7396     @@@c:erred: <[[xp|wf-no-external-entity-references]]> { (1, 4)..(1, 8); }
7397     @@XMLTest:
7398     @@@QName: xp.no.external.entity.references.4.test
7399     @@@DEnt:
7400     @@@@test:value:
7401     <!DOCTYPE a [
7402     <!NOTATION n SYSTEM "notation">
7403     <!ENTITY ent SYSTEM "something" NDATA n>
7404     <!ENTITY ent2 "ddd&ent;">
7405     ]>
7406     <a b="c&ent2;"/>
7407     @@@c:erred: <[[xp|wf-no-external-entity-references]]> { (1, 4)..(1, 8); }
7408 wakaba 1.23 @@@c:erred: <[[xp|wf-parsed-entity]]> { }
7409 wakaba 1.18 @@XMLTest:
7410     @@@QName: xp.no.lt.in.attr.value.1.test
7411     @@@DEnt:
7412     @@@@test:value:
7413     <!DOCTYPE a [
7414     <!ENTITY ent "aa<bb">
7415     ]>
7416     <a b="c&ent;"/>
7417     @@@c:erred: <[[xp|wf-no-lt-in-attribute-values]]> { (1, 3); }
7418 wakaba 1.20 @@@c:erred:
7419     @@@@@: <[[xp|wf-syntax-error]]> { (1, 3)..(1, 6); }
7420     @@@@enImplNote: When entity node is created.
7421 wakaba 1.18 @@XMLTest:
7422     @@@QName: xp.no.lt.in.attr.value.2.test
7423     @@@DEnt:
7424     @@@@test:value:
7425     <!DOCTYPE a [
7426     <!ENTITY ent "aa<bb">
7427     <!ENTITY ent2 "ccc&ent;">
7428     ]>
7429     <a b="c&ent2;"/>
7430     @@@c:erred: <[[xp|wf-no-lt-in-attribute-values]]> { (1, 3); }
7431 wakaba 1.20 @@@c:erred:
7432     @@@@@: <[[xp|wf-syntax-error]]> { (1, 3)..(1, 6); }
7433     @@@@enImplNote: When entity node is created.
7434 wakaba 1.18 @@XMLTest:
7435     @@@QName: xp.no.lt.in.attr.value.3.test
7436     @@@DEnt:
7437     @@@@test:value:
7438     <!DOCTYPE a [
7439     <!ENTITY ent "aa&#x3C;bb">
7440     ]>
7441     <a b="c&ent;"/>
7442     @@@c:erred: <[[xp|wf-no-lt-in-attribute-values]]> { (1, 3); }
7443 wakaba 1.20 @@@c:erred:
7444     @@@@@: <[[xp|wf-syntax-error]]> { (1, 3)..(1, 6); }
7445     @@@@enImplNote: When entity node is created.
7446 wakaba 1.18 @@XMLTest:
7447     @@@QName: xp.no.lt.in.attr.value.4.test
7448     @@@DEnt:
7449     @@@@test:value:
7450     <!DOCTYPE a [
7451     <!ENTITY ent "aa&#x3C;bb">
7452     <!ENTITY ent2 "ccc&ent;">
7453     ]>
7454     <a b="c&ent2;"/>
7455     @@@c:erred: <[[xp|wf-no-lt-in-attribute-values]]> { (1, 3); }
7456 wakaba 1.20 @@@c:erred:
7457     @@@@@: <[[xp|wf-syntax-error]]> { (1, 3)..(1, 6); }
7458     @@@@enImplNote: When entity node is created.
7459 wakaba 1.11 @@XMLTest:
7460 wakaba 1.18 @@@QName: xp.ger.lt.in.attr.value.1.test
7461 wakaba 1.11 @@@DEnt:
7462     @@@@test:value:
7463     <!DOCTYPE a [
7464 wakaba 1.18 <!ENTITY ent "aa&lt;bb">
7465 wakaba 1.11 ]>
7466 wakaba 1.18 <a b="c&ent;"/>
7467 wakaba 1.11 @@@test:domTree:
7468     document {
7469     document-type {
7470     general-entity {
7471     node-name: 'ent';
7472 wakaba 1.18 text-content: 'aa<bb';
7473 wakaba 1.11 }
7474     }
7475     element {
7476 wakaba 1.18 attribute {
7477     node-name: 'b';
7478     text { data: 'c'; }
7479     general-entity-reference {
7480 wakaba 1.19 is-expanded: true;
7481 wakaba 1.18 node-name: 'ent';
7482     text-content: 'aa<bb';
7483     }
7484     }
7485 wakaba 1.11 }
7486     }
7487     @@XMLTest:
7488 wakaba 1.18 @@@QName: xp.ger.lt.in.attr.value.2.test
7489 wakaba 1.11 @@@DEnt:
7490     @@@@test:value:
7491     <!DOCTYPE a [
7492 wakaba 1.18 <!ENTITY ent "aa&lt;bb">
7493     <!ENTITY ent2 "ccc&ent;">
7494 wakaba 1.11 ]>
7495 wakaba 1.18 <a b="c&ent2;"/>
7496 wakaba 1.11 @@@test:domTree:
7497     document {
7498     document-type {
7499     general-entity {
7500 wakaba 1.18 node-name: 'ent';
7501     text-content: 'aa<bb';
7502     }
7503     general-entity {
7504     node-name: 'ent2';
7505     text { data: 'ccc'; }
7506     general-entity-reference {
7507     node-name: 'ent';
7508     text-content: 'aa<bb';
7509 wakaba 1.19 is-expanded: true;
7510 wakaba 1.18 }
7511 wakaba 1.11 }
7512     }
7513     element {
7514 wakaba 1.18 attribute {
7515     node-name: 'b';
7516     text { data: 'c'; }
7517     general-entity-reference {
7518     node-name: 'ent2';
7519     text { data: 'ccc'; }
7520     general-entity-reference {
7521     node-name: 'ent';
7522     text-content: 'aa<bb';
7523 wakaba 1.19 is-expanded: true;
7524 wakaba 1.18 }
7525 wakaba 1.19 is-expanded: true;
7526 wakaba 1.18 }
7527     }
7528 wakaba 1.11 }
7529     }
7530    
7531 wakaba 1.8 @@XMLTest:
7532 wakaba 1.18 @@@QName: xp.doctype.intsubset.pi.test
7533 wakaba 1.8 @@@DEnt:
7534     @@@@test:value:
7535     <!DOCTYPE a [
7536 wakaba 1.18 <?pi data ?>
7537 wakaba 1.8 ]>
7538     <a></a>
7539     @@@test:domTree:
7540     document {
7541     xml-version: '1.0';
7542     xml-encoding: null;
7543     xml-standalone: false;
7544     document-type {
7545     node-name: 'a';
7546 wakaba 1.18 pi {
7547     target: 'pi';
7548     data: 'data ';
7549 wakaba 1.8 }
7550     }
7551     element {
7552     namespace-uri: null;
7553 wakaba 1.18 prefix: null;
7554 wakaba 1.8 local-name: 'a';
7555 wakaba 1.18 text-content: '';
7556 wakaba 1.8 }
7557     }
7558 wakaba 1.18 @@@enImplNote:
7559     A DOM PI node in doctype node is a manakai extension.
7560    
7561    
7562 wakaba 1.8 @@XMLTest:
7563 wakaba 1.18 @@@QName: xp.doctype.intsubset.entity.general.internal.test
7564 wakaba 1.8 @@@DEnt:
7565     @@@@test:value:
7566     <!DOCTYPE a [
7567 wakaba 1.18 <!ENTITY entity "entity value">
7568 wakaba 1.8 ]>
7569     <a></a>
7570     @@@test:domTree:
7571     document {
7572     xml-version: '1.0';
7573     xml-encoding: null;
7574     xml-standalone: false;
7575     document-type {
7576     node-name: 'a';
7577 wakaba 1.18 general-entity {
7578     node-name: 'entity';
7579     text-content: 'entity value';
7580     has-replacement-tree: true;
7581 wakaba 1.8 }
7582     }
7583     element {
7584     namespace-uri: null;
7585 wakaba 1.18 prefix: null;
7586 wakaba 1.8 local-name: 'a';
7587 wakaba 1.18 text-content: '';
7588 wakaba 1.8 }
7589     }
7590     @@XMLTest:
7591 wakaba 1.18 @@@QName: xp.doctype.intsubset.entity.parameter.internal.test
7592 wakaba 1.8 @@@DEnt:
7593     @@@@test:value:
7594     <!DOCTYPE a [
7595 wakaba 1.18 <!ENTITY % entity "entity value">
7596 wakaba 1.8 ]>
7597     <a></a>
7598     @@@test:domTree:
7599     document {
7600     xml-version: '1.0';
7601     xml-encoding: null;
7602     xml-standalone: false;
7603     document-type {
7604     node-name: 'a';
7605     }
7606     element {
7607     namespace-uri: null;
7608 wakaba 1.18 prefix: null;
7609 wakaba 1.8 local-name: 'a';
7610 wakaba 1.18 text-content: '';
7611 wakaba 1.8 }
7612     }
7613 wakaba 1.18
7614 wakaba 1.8 @@XMLTest:
7615 wakaba 1.18 @@@QName: xp.doctype.internal.entity.root.element.text.only.test
7616 wakaba 1.8 @@@DEnt:
7617     @@@@test:value:
7618     <!DOCTYPE a [
7619 wakaba 1.18 <!ENTITY entity "entity value">
7620 wakaba 1.8 ]>
7621 wakaba 1.18 <a>&entity;</a>
7622 wakaba 1.8 @@@test:domTree:
7623     document {
7624     xml-version: '1.0';
7625     xml-encoding: null;
7626     xml-standalone: false;
7627     document-type {
7628     node-name: 'a';
7629 wakaba 1.18 general-entity {
7630     node-name: 'entity';
7631     text-content: 'entity value';
7632     has-replacement-tree: true;
7633 wakaba 1.8 }
7634     }
7635     element {
7636     namespace-uri: null;
7637 wakaba 1.18 prefix: null;
7638 wakaba 1.8 local-name: 'a';
7639 wakaba 1.18 general-entity-reference {
7640     node-name: 'entity';
7641     text {
7642     data: 'entity value';
7643     }
7644 wakaba 1.19 is-expanded: true;
7645 wakaba 1.10 }
7646 wakaba 1.9 }
7647     }
7648     @@XMLTest:
7649 wakaba 1.18 @@@QName: xp.doctype.internal.entity.root.element.text.mult.test
7650 wakaba 1.9 @@@DEnt:
7651     @@@@test:value:
7652     <!DOCTYPE a [
7653 wakaba 1.18 <!ENTITY entity "entity value">
7654 wakaba 1.9 ]>
7655 wakaba 1.18 <a>&entity; and &entity;</a>
7656 wakaba 1.9 @@@test:domTree:
7657     document {
7658     xml-version: '1.0';
7659     xml-encoding: null;
7660     xml-standalone: false;
7661     document-type {
7662     node-name: 'a';
7663 wakaba 1.18 general-entity {
7664     node-name: 'entity';
7665     text-content: 'entity value';
7666     has-replacement-tree: true;
7667 wakaba 1.9 }
7668     }
7669     element {
7670     namespace-uri: null;
7671 wakaba 1.18 prefix: null;
7672 wakaba 1.9 local-name: 'a';
7673 wakaba 1.18 general-entity-reference {
7674     node-name: 'entity';
7675     text {
7676     data: 'entity value';
7677     }
7678 wakaba 1.19 is-expanded: true;
7679 wakaba 1.18 }
7680     text { data: ' and '; }
7681     general-entity-reference {
7682     node-name: 'entity';
7683     text {
7684     data: 'entity value';
7685     }
7686 wakaba 1.19 is-expanded: true;
7687 wakaba 1.10 }
7688 wakaba 1.9 }
7689     }
7690     @@XMLTest:
7691 wakaba 1.18 @@@QName: xp.doctype.internal.entity.root.element.text.element.test
7692 wakaba 1.9 @@@DEnt:
7693     @@@@test:value:
7694     <!DOCTYPE a [
7695 wakaba 1.18 <!ENTITY entity "entity <p>value</p> with <e>element</e> ">
7696 wakaba 1.9 ]>
7697 wakaba 1.18 <a>&entity;</a>
7698     @@@test:domTree:
7699     document {
7700     xml-version: '1.0';
7701     xml-encoding: null;
7702     xml-standalone: false;
7703     document-type {
7704     node-name: 'a';
7705     general-entity {
7706     node-name: 'entity';
7707     has-replacement-tree: true;
7708     text { data: 'entity '; }
7709     element {
7710     node-name: 'p';
7711     text-content: 'value';
7712     }
7713     text { data: ' with '; }
7714     element {
7715     node-name: 'e';
7716     text-content: 'element';
7717     }
7718 wakaba 1.20 text { data: ' '; }
7719 wakaba 1.18 }
7720     }
7721     element {
7722     namespace-uri: null;
7723     prefix: null;
7724     local-name: 'a';
7725     general-entity-reference {
7726     node-name: 'entity';
7727 wakaba 1.19 is-expanded: true;
7728 wakaba 1.18 text {
7729     data: 'entity ';
7730     }
7731     element {
7732     namespace-uri: null;
7733     prefix: null;
7734     local-name: 'p';
7735     text {
7736     data: 'value';
7737     }
7738     }
7739     text {
7740     data: ' with ';
7741     }
7742     element {
7743     namespace-uri: null;
7744     prefix: null;
7745     local-name: 'e';
7746     text {
7747     data: 'element';
7748     }
7749     }
7750     text {
7751     data: ' ';
7752     }
7753     }
7754     }
7755     }
7756     @@XMLTest:
7757     @@@QName: xp.doctype.internal.entity.root.element.text.in.ent.test
7758     @@@DEnt:
7759     @@@@test:value:
7760     <!DOCTYPE a [
7761     <!ENTITY entity1 "entity value">
7762     <!ENTITY entity2 "e&entity1;n">
7763     ]>
7764     <a>&entity2;</a>
7765     @@@test:domTree:
7766     document {
7767     xml-version: '1.0';
7768     xml-encoding: null;
7769     xml-standalone: false;
7770     document-type {
7771     node-name: 'a';
7772     general-entity {
7773     node-name: 'entity1';
7774     text-content: 'entity value';
7775     }
7776     general-entity {
7777     node-name: 'entity2';
7778     text { data: 'e'; }
7779     general-entity-reference {
7780     node-name: 'entity1';
7781     text-content: 'entity value';
7782     is-expanded: true;
7783     }
7784     text { data: 'n'; }
7785     }
7786     }
7787     element {
7788     namespace-uri: null;
7789     prefix: null;
7790     local-name: 'a';
7791     general-entity-reference {
7792     node-name: 'entity2';
7793     text { data: 'e'; }
7794 wakaba 1.19 is-expanded: true;
7795 wakaba 1.18 general-entity-reference {
7796     node-name: 'entity1';
7797     text {
7798     data: 'entity value';
7799     }
7800 wakaba 1.19 is-expanded: true;
7801 wakaba 1.18 }
7802     text { data: 'n'; }
7803     }
7804     }
7805     }
7806    
7807     @@XMLTest:
7808     @@@QName: xp.doctype.entity.value.charref.test
7809     @@@DEnt:
7810     @@@@test:value:
7811     <!DOCTYPE a [
7812     <!ENTITY entity1 "entity &#x21;value&#35;">
7813     <!ENTITY entity2 '&#x21;value&#35;'>
7814     ]>
7815     <a></a>
7816     @@@test:domTree:
7817     document {
7818     document-type {
7819     general-entity {
7820     node-name: 'entity1';
7821     text-content: 'entity !value#';
7822     has-replacement-tree: true;
7823     }
7824     general-entity {
7825     node-name: 'entity2';
7826     text-content: '!value#';
7827     has-replacement-tree: true;
7828     }
7829     }
7830     element { }
7831     }
7832    
7833     @@XMLTest:
7834     @@@QName: xp.predefined.in.content.test
7835     @@@DEnt:
7836     @@@@test:value:
7837     <a>_&lt;_&gt;_&quot;_&apos;_&amp;_</a>
7838     @@@test:domTree:
7839     document {
7840     element {
7841     text-content: '_<_>_"_' U+0027 '_&_';
7842     }
7843     }
7844     @@XMLTest:
7845     @@@QName: xp.predefined.in.attr.test
7846     @@@DEnt:
7847     @@@@test:value:
7848     <a at="_&lt;_&gt;_&quot;_&apos;_&amp;_"></a>
7849     @@@test:domTree:
7850     document {
7851     element {
7852     attribute {
7853     node-name: 'at';
7854     text-content: '_<_>_"_' U+0027 '_&_';
7855     }
7856     }
7857     }
7858     @@XMLTest:
7859     @@@QName: xp.predefined.in.content.in.entity.test
7860     @@@DEnt:
7861     @@@@test:value:
7862     <!DOCTYPE a [
7863     <!ENTITY ent "_&lt;_&gt;_&quot;_&apos;_&amp;_">
7864     ]>
7865     <a>&ent;</a>
7866     @@@test:domTree:
7867     document {
7868     document-type {
7869     general-entity {
7870     node-name: 'ent';
7871     text-content: '_<_>_"_' U+0027 '_&_';
7872     }
7873     }
7874     element {
7875     text-content: '_<_>_"_' U+0027 '_&_';
7876     }
7877     }
7878     @@XMLTest:
7879     @@@QName: xp.predefined.decl.ignore.test
7880     @@@DEnt:
7881     @@@@test:value:
7882     <!DOCTYPE a [
7883     <!ENTITY lt "&#x26;#x3C;">
7884     <!ENTITY gt "&#x3E;">
7885     <!ENTITY amp "&#x26;#x26;">
7886     <!ENTITY quot "&#x22;">
7887     <!ENTITY apos "&#x27;">
7888     <!ENTITY other "other">
7889     ]>
7890     <a>_&lt;_&gt;_&quot;_&apos;_&amp;_&other;_</a>
7891     @@@test:domTree:
7892     document {
7893     document-type {
7894     general-entity {
7895     node-name: 'other';
7896     text-content: 'other';
7897     }
7898     }
7899     element {
7900     text-content: '_<_>_"_' U+0027 '_&_other_';
7901     }
7902     }
7903    
7904     @@XMLTest:
7905     @@@QName: xp.doctype.internal.attr.empty.test
7906     @@@DEnt:
7907     @@@@test:value:
7908     <!DOCTYPE a [
7909     <!ATTLIST a>
7910     ]>
7911     <a></a>
7912     @@@test:domTree:
7913     document {
7914     xml-version: '1.0';
7915     xml-encoding: null;
7916     xml-standalone: false;
7917     document-type {
7918     node-name: 'a';
7919     element-type-definition {
7920     node-name: 'a';
7921     }
7922     }
7923     element {
7924     namespace-uri: null;
7925     local-name: 'a';
7926     }
7927     }
7928     @@XMLTest:
7929     @@@QName: xp.doctype.internal.attr.cdata.implied.test
7930     @@@DEnt:
7931     @@@@test:value:
7932     <!DOCTYPE a [
7933     <!ATTLIST a
7934     at CDATA #IMPLIED
7935     >
7936     ]>
7937     <a></a>
7938 wakaba 1.9 @@@test:domTree:
7939     document {
7940     xml-version: '1.0';
7941     xml-encoding: null;
7942     xml-standalone: false;
7943     document-type {
7944     node-name: 'a';
7945     element-type-definition {
7946     node-name: 'a';
7947     attribute-definition {
7948     node-name: 'at';
7949 wakaba 1.18 declared-type: const (CDATA_ATTR);
7950 wakaba 1.9 allowed-tokens: DOMStringList ();
7951 wakaba 1.18 default-type: const (IMPLIED_DEFAULT);
7952     text-content: '';
7953 wakaba 1.9 }
7954     }
7955     }
7956     element {
7957     namespace-uri: null;
7958     local-name: 'a';
7959 wakaba 1.18 }
7960     }
7961     @@XMLTest:
7962     @@@QName: xp.doctype.internal.attr.types.implied.test
7963     @@@DEnt:
7964     @@@@test:value:
7965     <!DOCTYPE a [
7966     <!ATTLIST a
7967     at1 ID #IMPLIED
7968     at2 IDREF #IMPLIED
7969     at3 IDREFS #IMPLIED
7970     at4 ENTITY #IMPLIED
7971     at5 ENTITIES #IMPLIED
7972     at6 NMTOKEN #IMPLIED
7973     at7 NMTOKENS #IMPLIED
7974     at8 NOTATION (n1 | n2|n3) #IMPLIED
7975     at9 (e1| e2| e3 ) #IMPLIED
7976     >
7977     ]>
7978     <a></a>
7979     @@@test:domTree:
7980     document {
7981     xml-version: '1.0';
7982     xml-encoding: null;
7983     xml-standalone: false;
7984     document-type {
7985     node-name: 'a';
7986     element-type-definition {
7987     node-name: 'a';
7988     attribute-definition {
7989     node-name: 'at1';
7990     declared-type: const (ID_ATTR);
7991     allowed-tokens: DOMStringList ();
7992     default-type: const (IMPLIED_DEFAULT);
7993     text-content: '';
7994     }
7995     attribute-definition {
7996     node-name: 'at2';
7997     declared-type: const (IDREF_ATTR);
7998     allowed-tokens: DOMStringList ();
7999     default-type: const (IMPLIED_DEFAULT);
8000     text-content: '';
8001     }
8002     attribute-definition {
8003     node-name: 'at3';
8004     declared-type: const (IDREFS_ATTR);
8005     allowed-tokens: DOMStringList ();
8006     default-type: const (IMPLIED_DEFAULT);
8007     text-content: '';
8008     }
8009     attribute-definition {
8010     node-name: 'at4';
8011     declared-type: const (ENTITY_ATTR);
8012     allowed-tokens: DOMStringList ();
8013     default-type: const (IMPLIED_DEFAULT);
8014     text-content: '';
8015     }
8016     attribute-definition {
8017     node-name: 'at5';
8018     declared-type: const (ENTITIES_ATTR);
8019     allowed-tokens: DOMStringList ();
8020     default-type: const (IMPLIED_DEFAULT);
8021     text-content: '';
8022     }
8023     attribute-definition {
8024     node-name: 'at6';
8025     declared-type: const (NMTOKEN_ATTR);
8026     allowed-tokens: DOMStringList ();
8027     default-type: const (IMPLIED_DEFAULT);
8028     text-content: '';
8029     }
8030     attribute-definition {
8031     node-name: 'at7';
8032     declared-type: const (NMTOKENS_ATTR);
8033     allowed-tokens: DOMStringList ();
8034     default-type: const (IMPLIED_DEFAULT);
8035     text-content: '';
8036     }
8037     attribute-definition {
8038     node-name: 'at8';
8039     declared-type: const (NOTATION_ATTR);
8040     allowed-tokens: DOMStringList ('n1', 'n2', 'n3');
8041     default-type: const (IMPLIED_DEFAULT);
8042     text-content: '';
8043     }
8044     attribute-definition {
8045     node-name: 'at9';
8046     declared-type: const (ENUMERATION_ATTR);
8047     allowed-tokens: DOMStringList ('e1', 'e2', 'e3');
8048     default-type: const (IMPLIED_DEFAULT);
8049     text-content: '';
8050     }
8051     }
8052     }
8053     element {
8054     namespace-uri: null;
8055     local-name: 'a';
8056     }
8057     }
8058     @@XMLTest:
8059     @@@QName: xp.doctype.internal.attr.cdata.defaults.test
8060     @@@DEnt:
8061     @@@@test:value:
8062     <!DOCTYPE a [
8063     <!ATTLIST a
8064     at1 CDATA #IMPLIED
8065     at2 CDATA #REQUIRED
8066     at3 CDATA #FIXED "value3"
8067     at4 CDATA "value4"
8068     at5 CDATA #FIXED 'value5'
8069     at6 CDATA 'value6'
8070     >
8071     ]>
8072     <a></a>
8073     @@@test:domTree:
8074     document {
8075     xml-version: '1.0';
8076     xml-encoding: null;
8077     xml-standalone: false;
8078     document-type {
8079     node-name: 'a';
8080     element-type-definition {
8081     node-name: 'a';
8082     attribute-definition {
8083     node-name: 'at1';
8084     declared-type: const (CDATA_ATTR);
8085     allowed-tokens: DOMStringList ();
8086     default-type: const (IMPLIED_DEFAULT);
8087     text-content: '';
8088     }
8089     attribute-definition {
8090     node-name: 'at2';
8091     declared-type: const (CDATA_ATTR);
8092     allowed-tokens: DOMStringList ();
8093     default-type: const (REQUIRED_DEFAULT);
8094     text-content: '';
8095     }
8096     attribute-definition {
8097     node-name: 'at3';
8098     declared-type: const (CDATA_ATTR);
8099     allowed-tokens: DOMStringList ();
8100     default-type: const (FIXED_DEFAULT);
8101     text-content: 'value3';
8102     }
8103     attribute-definition {
8104     node-name: 'at4';
8105     declared-type: const (CDATA_ATTR);
8106     allowed-tokens: DOMStringList ();
8107     default-type: const (EXPLICIT_DEFAULT);
8108     text-content: 'value4';
8109     }
8110     attribute-definition {
8111     node-name: 'at5';
8112     declared-type: const (CDATA_ATTR);
8113     allowed-tokens: DOMStringList ();
8114     default-type: const (FIXED_DEFAULT);
8115     text-content: 'value5';
8116     }
8117     attribute-definition {
8118     node-name: 'at6';
8119     declared-type: const (CDATA_ATTR);
8120     allowed-tokens: DOMStringList ();
8121     default-type: const (EXPLICIT_DEFAULT);
8122     text-content: 'value6';
8123     }
8124     }
8125     }
8126     element {
8127     namespace-uri: null;
8128     local-name: 'a';
8129     attribute {
8130     node-name: 'at3';
8131     text-content: 'value3';
8132     specified: false;
8133     }
8134     attribute {
8135     node-name: 'at4';
8136     text-content: 'value4';
8137     specified: false;
8138     }
8139     attribute {
8140     node-name: 'at5';
8141     text-content: 'value5';
8142     specified: false;
8143     }
8144     attribute {
8145     node-name: 'at6';
8146     text-content: 'value6';
8147     specified: false;
8148     }
8149     }
8150     }
8151    
8152     @@XMLTest:
8153     @@@QName: xp.doctype.internal.attr.cdata.default.normalize.test
8154     @@@DEnt:
8155     @@@@test:value:
8156     <!DOCTYPE a [
8157     <!ATTLIST a
8158     at CDATA " default &#x0A;value "
8159     >
8160     ]>
8161     <a></a>
8162     @@@test:domTree:
8163     document {
8164     xml-version: '1.0';
8165     xml-encoding: null;
8166     xml-standalone: false;
8167     document-type {
8168     node-name: 'a';
8169     element-type-definition {
8170     node-name: 'a';
8171     attribute-definition {
8172     node-name: 'at';
8173     declared-type: const (CDATA_ATTR);
8174     allowed-tokens: DOMStringList ();
8175     default-type: const (EXPLICIT_DEFAULT);
8176     text-content: ' default ' U+000A 'value ';
8177     }
8178     }
8179     }
8180     element {
8181     namespace-uri: null;
8182     local-name: 'a';
8183     attribute {
8184     node-name: 'at';
8185     text-content: ' default ' U+000A 'value ';
8186     specified: false;
8187     }
8188     }
8189     }
8190     @@XMLTest:
8191     @@@QName: xp.doctype.internal.attr.nmtoken.default.normalize.test
8192     @@@DEnt:
8193     @@@@test:value:
8194     <!DOCTYPE a [
8195     <!ATTLIST a
8196     at NMTOKEN " default &#x0A;value "
8197     >
8198     ]>
8199     <a></a>
8200     @@@test:domTree:
8201     document {
8202     xml-version: '1.0';
8203     xml-encoding: null;
8204     xml-standalone: false;
8205     document-type {
8206     node-name: 'a';
8207     element-type-definition {
8208     node-name: 'a';
8209     attribute-definition {
8210     node-name: 'at';
8211     declared-type: const (NMTOKEN_ATTR);
8212     allowed-tokens: DOMStringList ();
8213     default-type: const (EXPLICIT_DEFAULT);
8214     text-content: ' default ' U+000A 'value ';
8215     }
8216     }
8217     }
8218     element {
8219     namespace-uri: null;
8220     local-name: 'a';
8221     attribute {
8222     node-name: 'at';
8223     text-content: ' default ' U+000A 'value ';
8224     specified: false;
8225     }
8226     }
8227     }
8228    
8229     @@XMLTest:
8230     @@@QName: xp.doctype.attrtype.no-value.test
8231     @@@DEnt:
8232     @@@@test:value:
8233     <!DOCTYPE a>
8234     <a at=" at value "></a>
8235     @@@test:domTree:
8236     document {
8237     xml-version: '1.0';
8238     xml-encoding: null;
8239     xml-standalone: false;
8240     document-type { }
8241     element {
8242     namespace-uri: null;
8243     local-name: 'a';
8244     attribute {
8245     namespace-uri: null;
8246     local-name: 'at';
8247     value: ' at value ';
8248     text {
8249     data: ' at value ';
8250     }
8251     schema-type-info: TypeInfo (null, null);
8252     specified: true;
8253     }
8254     }
8255     }
8256     @@XMLTest:
8257     @@@QName: xp.doctype.attrtype.cdata.test
8258     @@@DEnt:
8259     @@@@test:value:
8260     <!DOCTYPE a [
8261     <!ATTLIST a
8262     at CDATA #IMPLIED
8263     >
8264     ]>
8265     <a at=" at value "></a>
8266     @@@test:domTree:
8267     document {
8268     xml-version: '1.0';
8269     xml-encoding: null;
8270     xml-standalone: false;
8271     document-type { }
8272     element {
8273     namespace-uri: null;
8274     local-name: 'a';
8275     attribute {
8276     namespace-uri: null;
8277     local-name: 'at';
8278     value: ' at value ';
8279     text {
8280     data: ' at value ';
8281     }
8282     schema-type-info:
8283     TypeInfo ('http://www.w3.org/TR/REC-xml', 'CDATA');
8284     specified: true;
8285     }
8286     }
8287     }
8288     @@XMLTest:
8289     @@@QName: xp.doctype.attrtype.nmtoken.test
8290     @@@DEnt:
8291     @@@@test:value:
8292     <!DOCTYPE a [
8293     <!ATTLIST a
8294     at NMTOKEN #IMPLIED
8295     >
8296     ]>
8297     <a at=" at value "></a>
8298     @@@test:domTree:
8299     document {
8300     xml-version: '1.0';
8301     xml-encoding: null;
8302     xml-standalone: false;
8303     document-type { }
8304     element {
8305     namespace-uri: null;
8306     local-name: 'a';
8307     attribute {
8308     namespace-uri: null;
8309     local-name: 'at';
8310     value: 'at value';
8311     text {
8312     data: ' at value ';
8313     }
8314     schema-type-info:
8315     TypeInfo ('http://www.w3.org/TR/REC-xml', 'NMTOKEN');
8316     specified: true;
8317     }
8318     }
8319     }
8320    
8321     @@XMLTest:
8322     @@@QName: xp.doctype.attr.normalization.1.test
8323     @@@DEnt:
8324     @@@@test:value:
8325     <a at=" at &#xA;value "></a>
8326     @@@test:domTree:
8327     document {
8328     element {
8329     attribute {
8330     node-name: 'at';
8331     value: ' at ' U+000A 'value ';
8332     schema-type-info: TypeInfo (null, null);
8333     specified: true;
8334     }
8335     }
8336     }
8337     @@XMLTest:
8338     @@@QName: xp.doctype.attr.normalization.2.test
8339     @@@DEnt:
8340     @@@@test:value:
8341     <a at=" at &#xD;value "></a>
8342     @@@test:domTree:
8343     document {
8344     element {
8345     attribute {
8346     value: ' at ' U+000D 'value ';
8347     schema-type-info: TypeInfo (null, null);
8348     specified: true;
8349     }
8350     }
8351     }
8352     @@XMLTest:
8353     @@@QName: xp.doctype.attr.normalization.3.test
8354     @@@DEnt:
8355     @@@@test:value:
8356     <a at=" at &#x9;value "></a>
8357     @@@test:domTree:
8358     document {
8359     element {
8360     attribute {
8361     node-name: 'at';
8362     value: ' at ' U+0009 'value ';
8363     schema-type-info: TypeInfo (null, null);
8364     specified: true;
8365     }
8366     }
8367     }
8368    
8369     @@XMLTest:
8370     @@@QName: xp.doctype.attr.specified.1.test
8371     @@@DEnt:
8372     @@@@test:value:
8373     <!DOCTYPE a [
8374     <!ATTLIST a
8375     at CDATA "default"
8376     >
8377     ]>
8378     <a></a>
8379     @@@test:domTree:
8380     document {
8381     document-type { }
8382     element {
8383     attribute {
8384     node-name: 'at';
8385     value: 'default';
8386     specified: false;
8387     }
8388     }
8389     }
8390     @@XMLTest:
8391     @@@QName: xp.doctype.attr.specified.2.test
8392     @@@DEnt:
8393     @@@@test:value:
8394     <!DOCTYPE a [
8395     <!ATTLIST a
8396     at CDATA "default"
8397     >
8398     ]>
8399     <a at2="specified"></a>
8400     @@@test:domTree:
8401     document {
8402     document-type { }
8403     element {
8404     attribute {
8405     node-name: 'at';
8406     value: 'default';
8407     specified: false;
8408     }
8409     attribute {
8410     node-name: 'at2';
8411     value: 'specified';
8412     specified: true;
8413     }
8414     }
8415     }
8416     @@XMLTest:
8417     @@@QName: xp.doctype.attr.specified.3.test
8418     @@@DEnt:
8419     @@@@test:value:
8420     <!DOCTYPE a [
8421     <!ATTLIST a
8422     at CDATA "default"
8423     >
8424     ]>
8425     <a at="specified"></a>
8426     @@@test:domTree:
8427     document {
8428     document-type { }
8429     element {
8430     attribute {
8431     node-name: 'at';
8432     value: 'specified';
8433     specified: true;
8434     }
8435     }
8436     }
8437    
8438     @@XMLTest:
8439     @@@QName: xp.attr.literal.charref.test
8440     @@@DEnt:
8441     @@@@test:value:
8442     <a at1 = "value&#33;_&#x25;value"
8443     at2 = 'value&#x25;_&#33;value'></a>
8444     @@@test:domTree:
8445     document {
8446     element {
8447     attribute {
8448     node-name: 'at1';
8449     text-content: 'value!_%value';
8450     }
8451     attribute {
8452     node-name: 'at2';
8453     text-content: 'value%_!value';
8454     }
8455     }
8456     }
8457     @@XMLTest:
8458     @@@QName: xp.attr.literal.entref.test
8459     @@@DEnt:
8460     @@@@test:value:
8461     <!DOCTYPE a [
8462     <!ENTITY ent "entity&#x26;#33;_&#x26;#x29;value">
8463     ]>
8464     <a at1 = "value&ent;value"
8465     at2 = 'value&ent;value'></a>
8466     @@@test:domTree:
8467     document {
8468     document-type {
8469     general-entity {
8470     node-name: 'ent';
8471     text-content: 'entity!_)value';
8472     }
8473     }
8474     element {
8475     attribute {
8476     node-name: 'at1';
8477     text-content: 'valueentity!_)valuevalue';
8478     }
8479     attribute {
8480     node-name: 'at2';
8481     text-content: 'valueentity!_)valuevalue';
8482     }
8483     }
8484     }
8485     @@XMLTest:
8486     @@@QName: xp.attr.literal.entref.nest.test
8487     @@@DEnt:
8488     @@@@test:value:
8489     <!DOCTYPE a [
8490     <!ENTITY ent1 "entity&#x26;#33;_&#x26;#x29;value">
8491     <!ENTITY ent2 "@&ent1;@">
8492     ]>
8493     <a at1 = "value&ent2;value"
8494     at2 = 'value&ent2;value'></a>
8495     @@@test:domTree:
8496     document {
8497     document-type {
8498     general-entity {
8499     node-name: 'ent1';
8500     text-content: 'entity!_)value';
8501     }
8502     general-entity {
8503     node-name: 'ent2';
8504     text-content: '@entity!_)value@';
8505     }
8506     }
8507     element {
8508     attribute {
8509     node-name: 'at1';
8510     text-content: 'value@entity!_)value@value';
8511     }
8512     attribute {
8513     node-name: 'at2';
8514     text-content: 'value@entity!_)value@value';
8515     }
8516     }
8517     }
8518    
8519     @@XMLTest:
8520     @@@QName: xp.element.content.ncr.1.test
8521     @@@DEnt:
8522     @@@@test:value:
8523     <e>&#33;</e>
8524     @@@test:domTree:
8525     document {
8526     element {
8527     text-content: '!';
8528     }
8529     }
8530     @@XMLTest:
8531     @@@QName: xp.element.content.ncr.2.test
8532     @@@DEnt:
8533     @@@@test:value:
8534     <e>aaaa&#33;bbbb</e>
8535     @@@test:domTree:
8536     document {
8537     element {
8538     text-content: 'aaaa!bbbb';
8539     }
8540     }
8541     @@XMLTest:
8542     @@@QName: xp.attrval.ncr.1.test
8543     @@@DEnt:
8544     @@@@test:value:
8545     <e a="&#33;"/>
8546     @@@test:domTree:
8547     document {
8548     element {
8549     attribute {
8550     node-name: 'a';
8551     text-content: '!';
8552     }
8553     }
8554     }
8555     @@XMLTest:
8556     @@@QName: xp.attrval.ncr.2.test
8557     @@@DEnt:
8558     @@@@test:value:
8559     <e a="aaaaa&#33;bbbbb"/>
8560     @@@test:domTree:
8561     document {
8562     element {
8563     attribute {
8564     node-name: 'a';
8565     text-content: 'aaaaa!bbbbb';
8566     }
8567     }
8568     }
8569     @@XMLTest:
8570     @@@QName: xp.attrval.ncr.3.test
8571     @@@DEnt:
8572     @@@@test:value:
8573     <e a='&#33;'/>
8574     @@@test:domTree:
8575     document {
8576     element {
8577     attribute {
8578     node-name: 'a';
8579     text-content: '!';
8580     }
8581     }
8582     }
8583     @@XMLTest:
8584     @@@QName: xp.attrval.ncr.4.test
8585     @@@DEnt:
8586     @@@@test:value:
8587     <e a='aaaaa&#33;bbbbb'/>
8588     @@@test:domTree:
8589     document {
8590     element {
8591     attribute {
8592     node-name: 'a';
8593     text-content: 'aaaaa!bbbbb';
8594     }
8595     }
8596     }
8597     @@XMLTest:
8598     @@@QName: xp.entval.ncr.1.test
8599     @@@DEnt:
8600     @@@@test:value:
8601     <!DOCTYPE e [
8602     <!ENTITY ent "&#33;">
8603     ]>
8604     <e/>
8605     @@@test:domTree:
8606     document {
8607     document-type {
8608     general-entity {
8609     node-name: 'ent';
8610     text-content: '!';
8611     }
8612     }
8613     element { }
8614     }
8615     @@XMLTest:
8616     @@@QName: xp.entval.ncr.2.test
8617     @@@DEnt:
8618     @@@@test:value:
8619     <!DOCTYPE e [
8620     <!ENTITY ent "aaaaa&#33;bbbbb">
8621     ]>
8622     <e/>
8623     @@@test:domTree:
8624     document {
8625     document-type {
8626     general-entity {
8627     node-name: 'ent';
8628     text-content: 'aaaaa!bbbbb';
8629     }
8630     }
8631     element { }
8632     }
8633     @@XMLTest:
8634     @@@QName: xp.element.content.reptxt.ncr.1.test
8635     @@@DEnt:
8636     @@@@test:value:
8637     <!DOCTYPE e [
8638     <!ENTITY ent "&#38;#33;">
8639     ]>
8640     <e>&ent;</e>
8641     @@@test:domTree:
8642     document {
8643     document-type { }
8644     element {
8645     general-entity-reference {
8646     node-name: 'ent';
8647     text-content: '!';
8648 wakaba 1.19 is-expanded: true;
8649 wakaba 1.18 }
8650     }
8651     }
8652     @@XMLTest:
8653     @@@QName: xp.element.content.reptxt.ncr.2.test
8654     @@@DEnt:
8655     @@@@test:value:
8656     <!DOCTYPE e [
8657     <!ENTITY ent "aaaaa&#38;#33;bbbbb">
8658     ]>
8659     <e>&ent;</e>
8660     @@@test:domTree:
8661     document {
8662     document-type { }
8663     element {
8664     general-entity-reference {
8665     node-name: 'ent';
8666     text-content: 'aaaaa!bbbbb';
8667 wakaba 1.19 is-expanded: true;
8668 wakaba 1.18 }
8669     }
8670     }
8671     @@XMLTest:
8672     @@@QName: xp.element.content.reptxt.reptxt.ncr.1.test
8673     @@@DEnt:
8674     @@@@test:value:
8675     <!DOCTYPE e [
8676     <!ENTITY ent "&#38;#33;">
8677     <!ENTITY ent2 "&ent;">
8678     ]>
8679     <e>&ent2;</e>
8680     @@@test:domTree:
8681     document {
8682     document-type { }
8683     element {
8684     general-entity-reference {
8685     node-name: 'ent2';
8686     general-entity-reference {
8687     node-name: 'ent';
8688     text-content: '!';
8689 wakaba 1.19 is-expanded: true;
8690 wakaba 1.18 }
8691 wakaba 1.19 is-expanded: true;
8692 wakaba 1.18 }
8693     }
8694     }
8695     @@XMLTest:
8696     @@@QName: xp.element.content.reptxt.reptxt.ncr.2.test
8697     @@@DEnt:
8698     @@@@test:value:
8699     <!DOCTYPE e [
8700     <!ENTITY ent "aa&#38;#33;bb">
8701     <!ENTITY ent2 "&ent;">
8702     ]>
8703     <e>&ent2;</e>
8704     @@@test:domTree:
8705     document {
8706     document-type { }
8707     element {
8708     general-entity-reference {
8709     node-name: 'ent2';
8710     general-entity-reference {
8711     node-name: 'ent';
8712     text-content: 'aa!bb';
8713 wakaba 1.19 is-expanded: true;
8714 wakaba 1.18 }
8715 wakaba 1.19 is-expanded: true;
8716 wakaba 1.18 }
8717     }
8718     }
8719     @@XMLTest:
8720     @@@QName: xp.attval.reptxt.ncr.1.test
8721     @@@DEnt:
8722     @@@@test:value:
8723     <!DOCTYPE e [
8724     <!ENTITY ent "&#38;#33;">
8725     ]>
8726     <e a="&ent;"/>
8727     @@@test:domTree:
8728     document {
8729     document-type { }
8730     element {
8731     attribute {
8732     node-name: 'a';
8733     general-entity-reference {
8734     node-name: 'ent';
8735     text-content: '!';
8736 wakaba 1.19 is-expanded: true;
8737 wakaba 1.18 }
8738     }
8739     }
8740     }
8741     @@XMLTest:
8742     @@@QName: xp.attval.reptxt.ncr.2.test
8743     @@@DEnt:
8744     @@@@test:value:
8745     <!DOCTYPE e [
8746     <!ENTITY ent "aaaaa&#38;#33;bbbbb">
8747     ]>
8748     <e a="&ent;"/>
8749     @@@test:domTree:
8750     document {
8751     document-type { }
8752     element {
8753     attribute {
8754     node-name: 'a';
8755     general-entity-reference {
8756     node-name: 'ent';
8757     text-content: 'aaaaa!bbbbb';
8758 wakaba 1.19 is-expanded: true;
8759 wakaba 1.18 }
8760     }
8761     }
8762     }
8763     @@XMLTest:
8764     @@@QName: xp.attval.reptxt.reptxt.ncr.1.test
8765     @@@DEnt:
8766     @@@@test:value:
8767     <!DOCTYPE e [
8768     <!ENTITY ent "&#38;#33;">
8769     <!ENTITY ent2 "&ent;">
8770     ]>
8771     <e a="&ent2;"/>
8772     @@@test:domTree:
8773     document {
8774     document-type { }
8775     element {
8776     attribute {
8777     node-name: 'a';
8778     general-entity-reference {
8779     node-name: 'ent2';
8780 wakaba 1.19 is-expanded: true;
8781 wakaba 1.18 general-entity-reference {
8782     node-name: 'ent';
8783     text-content: '!';
8784 wakaba 1.19 is-expanded: true;
8785 wakaba 1.18 }
8786     }
8787     }
8788     }
8789     }
8790     @@XMLTest:
8791     @@@QName: xp.attval.reptxt.reptxt.ncr.2.test
8792     @@@DEnt:
8793     @@@@test:value:
8794     <!DOCTYPE e [
8795     <!ENTITY ent "aa&#38;#33;bb">
8796     <!ENTITY ent2 "&ent;">
8797     ]>
8798     <e a="&ent2;"/>
8799     @@@test:domTree:
8800     document {
8801     document-type { }
8802     element {
8803     attribute {
8804     node-name: 'a';
8805     general-entity-reference {
8806     node-name: 'ent2';
8807 wakaba 1.19 is-expanded: true;
8808 wakaba 1.18 general-entity-reference {
8809     node-name: 'ent';
8810     text-content: 'aa!bb';
8811 wakaba 1.19 is-expanded: true;
8812 wakaba 1.18 }
8813     }
8814     }
8815     }
8816     }
8817    
8818     @@XMLTest:
8819     @@@QName: xp.element.content.hcr.1.test
8820     @@@DEnt:
8821     @@@@test:value:
8822     <e>&#x21;</e>
8823     @@@test:domTree:
8824     document {
8825     element {
8826     text-content: '!';
8827     }
8828     }
8829     @@XMLTest:
8830     @@@QName: xp.element.content.hcr.2.test
8831     @@@DEnt:
8832     @@@@test:value:
8833     <e>aaaa&#x21;bbbb</e>
8834     @@@test:domTree:
8835     document {
8836     element {
8837     text-content: 'aaaa!bbbb';
8838     }
8839     }
8840     @@XMLTest:
8841     @@@QName: xp.attrval.hcr.1.test
8842     @@@DEnt:
8843     @@@@test:value:
8844     <e a="&#x21;"/>
8845     @@@test:domTree:
8846     document {
8847     element {
8848     attribute {
8849     node-name: 'a';
8850     text-content: '!';
8851     }
8852     }
8853     }
8854     @@XMLTest:
8855     @@@QName: xp.attrval.hcr.2.test
8856     @@@DEnt:
8857     @@@@test:value:
8858     <e a="aaaaa&#x21;bbbbb"/>
8859     @@@test:domTree:
8860     document {
8861     element {
8862     attribute {
8863     node-name: 'a';
8864     text-content: 'aaaaa!bbbbb';
8865     }
8866     }
8867     }
8868     @@XMLTest:
8869     @@@QName: xp.attrval.hcr.3.test
8870     @@@DEnt:
8871     @@@@test:value:
8872     <e a='&#x21;'/>
8873     @@@test:domTree:
8874     document {
8875     element {
8876     attribute {
8877     node-name: 'a';
8878     text-content: '!';
8879     }
8880     }
8881     }
8882     @@XMLTest:
8883     @@@QName: xp.attrval.hcr.4.test
8884     @@@DEnt:
8885     @@@@test:value:
8886     <e a='aaaaa&#x21;bbbbb'/>
8887     @@@test:domTree:
8888     document {
8889     element {
8890     attribute {
8891     node-name: 'a';
8892     text-content: 'aaaaa!bbbbb';
8893     }
8894     }
8895     }
8896     @@XMLTest:
8897     @@@QName: xp.entval.hcr.1.test
8898     @@@DEnt:
8899     @@@@test:value:
8900     <!DOCTYPE e [
8901     <!ENTITY ent "&#x21;">
8902     ]>
8903     <e/>
8904     @@@test:domTree:
8905     document {
8906     document-type {
8907     general-entity {
8908     node-name: 'ent';
8909     text-content: '!';
8910 wakaba 1.10 }
8911 wakaba 1.9 }
8912 wakaba 1.18 element { }
8913 wakaba 1.9 }
8914     @@XMLTest:
8915 wakaba 1.18 @@@QName: xp.entval.hcr.2.test
8916 wakaba 1.9 @@@DEnt:
8917     @@@@test:value:
8918 wakaba 1.18 <!DOCTYPE e [
8919     <!ENTITY ent "aaaaa&#x21;bbbbb">
8920     ]>
8921     <e/>
8922 wakaba 1.9 @@@test:domTree:
8923     document {
8924 wakaba 1.18 document-type {
8925     general-entity {
8926     node-name: 'ent';
8927     text-content: 'aaaaa!bbbbb';
8928 wakaba 1.9 }
8929     }
8930 wakaba 1.18 element { }
8931 wakaba 1.9 }
8932     @@XMLTest:
8933 wakaba 1.18 @@@QName: xp.element.content.reptxt.hcr.1.test
8934 wakaba 1.9 @@@DEnt:
8935     @@@@test:value:
8936 wakaba 1.18 <!DOCTYPE e [
8937     <!ENTITY ent "&#38;#x21;">
8938 wakaba 1.9 ]>
8939 wakaba 1.18 <e>&ent;</e>
8940 wakaba 1.9 @@@test:domTree:
8941     document {
8942     document-type { }
8943     element {
8944 wakaba 1.18 general-entity-reference {
8945     node-name: 'ent';
8946     text-content: '!';
8947 wakaba 1.19 is-expanded: true;
8948 wakaba 1.9 }
8949     }
8950     }
8951     @@XMLTest:
8952 wakaba 1.18 @@@QName: xp.element.content.reptxt.hcr.2.test
8953 wakaba 1.9 @@@DEnt:
8954     @@@@test:value:
8955 wakaba 1.18 <!DOCTYPE e [
8956     <!ENTITY ent "aaaaa&#38;#x21;bbbbb">
8957 wakaba 1.9 ]>
8958 wakaba 1.18 <e>&ent;</e>
8959 wakaba 1.9 @@@test:domTree:
8960     document {
8961     document-type { }
8962     element {
8963 wakaba 1.18 general-entity-reference {
8964     node-name: 'ent';
8965     text-content: 'aaaaa!bbbbb';
8966 wakaba 1.19 is-expanded: true;
8967 wakaba 1.9 }
8968     }
8969     }
8970     @@XMLTest:
8971 wakaba 1.18 @@@QName: xp.element.content.reptxt.reptxt.hcr.1.test
8972 wakaba 1.9 @@@DEnt:
8973     @@@@test:value:
8974 wakaba 1.18 <!DOCTYPE e [
8975     <!ENTITY ent "&#38;#x21;">
8976     <!ENTITY ent2 "&ent;">
8977     ]>
8978     <e>&ent2;</e>
8979 wakaba 1.9 @@@test:domTree:
8980     document {
8981 wakaba 1.18 document-type { }
8982 wakaba 1.9 element {
8983 wakaba 1.18 general-entity-reference {
8984     node-name: 'ent2';
8985 wakaba 1.19 is-expanded: true;
8986 wakaba 1.18 general-entity-reference {
8987     node-name: 'ent';
8988     text-content: '!';
8989 wakaba 1.19 is-expanded: true;
8990 wakaba 1.18 }
8991 wakaba 1.9 }
8992     }
8993     }
8994     @@XMLTest:
8995 wakaba 1.18 @@@QName: xp.element.content.reptxt.reptxt.hcr.2.test
8996 wakaba 1.9 @@@DEnt:
8997     @@@@test:value:
8998 wakaba 1.18 <!DOCTYPE e [
8999     <!ENTITY ent "aa&#38;#x21;bb">
9000     <!ENTITY ent2 "&ent;">
9001     ]>
9002     <e>&ent2;</e>
9003 wakaba 1.9 @@@test:domTree:
9004     document {
9005 wakaba 1.18 document-type { }
9006 wakaba 1.9 element {
9007 wakaba 1.18 general-entity-reference {
9008     node-name: 'ent2';
9009 wakaba 1.19 is-expanded: true;
9010 wakaba 1.18 general-entity-reference {
9011     node-name: 'ent';
9012 wakaba 1.19 is-expanded: true;
9013 wakaba 1.18 text-content: 'aa!bb';
9014     }
9015 wakaba 1.9 }
9016     }
9017     }
9018     @@XMLTest:
9019 wakaba 1.18 @@@QName: xp.attval.reptxt.hcr.1.test
9020 wakaba 1.9 @@@DEnt:
9021     @@@@test:value:
9022 wakaba 1.18 <!DOCTYPE e [
9023     <!ENTITY ent "&#38;#x21;">
9024     ]>
9025     <e a="&ent;"/>
9026 wakaba 1.9 @@@test:domTree:
9027     document {
9028 wakaba 1.18 document-type { }
9029 wakaba 1.9 element {
9030     attribute {
9031 wakaba 1.18 node-name: 'a';
9032     general-entity-reference {
9033     node-name: 'ent';
9034 wakaba 1.19 is-expanded: true;
9035 wakaba 1.18 text-content: '!';
9036     }
9037 wakaba 1.10 }
9038     }
9039     }
9040     @@XMLTest:
9041 wakaba 1.18 @@@QName: xp.attval.reptxt.hcr.2.test
9042 wakaba 1.10 @@@DEnt:
9043     @@@@test:value:
9044 wakaba 1.18 <!DOCTYPE e [
9045     <!ENTITY ent "aaaaa&#38;#x21;bbbbb">
9046 wakaba 1.10 ]>
9047 wakaba 1.18 <e a="&ent;"/>
9048 wakaba 1.10 @@@test:domTree:
9049     document {
9050     document-type { }
9051     element {
9052     attribute {
9053 wakaba 1.18 node-name: 'a';
9054     general-entity-reference {
9055     node-name: 'ent';
9056 wakaba 1.19 is-expanded: true;
9057 wakaba 1.18 text-content: 'aaaaa!bbbbb';
9058     }
9059 wakaba 1.10 }
9060     }
9061     }
9062     @@XMLTest:
9063 wakaba 1.18 @@@QName: xp.attval.reptxt.reptxt.hcr.1.test
9064 wakaba 1.10 @@@DEnt:
9065     @@@@test:value:
9066 wakaba 1.18 <!DOCTYPE e [
9067     <!ENTITY ent "&#38;#x21;">
9068     <!ENTITY ent2 "&ent;">
9069 wakaba 1.10 ]>
9070 wakaba 1.18 <e a="&ent2;"/>
9071 wakaba 1.10 @@@test:domTree:
9072     document {
9073     document-type { }
9074     element {
9075     attribute {
9076 wakaba 1.18 node-name: 'a';
9077     general-entity-reference {
9078     node-name: 'ent2';
9079 wakaba 1.19 is-expanded: true;
9080 wakaba 1.18 general-entity-reference {
9081     node-name: 'ent';
9082 wakaba 1.19 is-expanded: true;
9083 wakaba 1.18 text-content: '!';
9084     }
9085     }
9086 wakaba 1.10 }
9087     }
9088     }
9089     @@XMLTest:
9090 wakaba 1.18 @@@QName: xp.attval.reptxt.reptxt.hcr.2.test
9091 wakaba 1.10 @@@DEnt:
9092     @@@@test:value:
9093 wakaba 1.18 <!DOCTYPE e [
9094     <!ENTITY ent "aa&#38;#x21;bb">
9095     <!ENTITY ent2 "&ent;">
9096 wakaba 1.10 ]>
9097 wakaba 1.18 <e a="&ent2;"/>
9098 wakaba 1.10 @@@test:domTree:
9099     document {
9100     document-type { }
9101     element {
9102     attribute {
9103 wakaba 1.18 node-name: 'a';
9104     general-entity-reference {
9105     node-name: 'ent2';
9106 wakaba 1.19 is-expanded: true;
9107 wakaba 1.18 general-entity-reference {
9108     node-name: 'ent';
9109 wakaba 1.19 is-expanded: true;
9110 wakaba 1.18 text-content: 'aa!bb';
9111     }
9112     }
9113 wakaba 1.11 }
9114     }
9115     }
9116    
9117     @@XMLTest:
9118 wakaba 1.18 @@@QName: xp.element.content.ncr.legal.char.1.0.1.test
9119     @@@DEnt:
9120     @@@@test:value:
9121     <?xml version="1.0"?>
9122     <e>&#0;</e>
9123     @@@c:erred: <[[xp|wf-legal-character]]> { (2, 4)..(2, 7); }
9124     @@XMLTest:
9125     @@@QName: xp.element.content.ncr.legal.char.1.1.1.test
9126     @@@DEnt:
9127     @@@@test:value:
9128     <?xml version="1.1"?>
9129     <e>&#0;</e>
9130     @@@c:erred: <[[xp|wf-legal-character]]> { (2, 4)..(2, 7); }
9131     @@XMLTest:
9132     @@@QName: xp.element.content.ncr.legal.char.1.0.2.test
9133     @@@DEnt:
9134     @@@@test:value:
9135     <?xml version="1.0"?>
9136     <e>&#1;</e>
9137     @@@c:erred: <[[xp|wf-legal-character]]> { (2, 4)..(2, 7); }
9138     @@XMLTest:
9139     @@@QName: xp.element.content.ncr.legal.char.1.1.2.test
9140 wakaba 1.11 @@@DEnt:
9141     @@@@test:value:
9142 wakaba 1.18 <?xml version="1.1"?>
9143     <e>&#1;</e>
9144 wakaba 1.11 @@@test:domTree:
9145     document {
9146 wakaba 1.18 xml-version: '1.1';
9147 wakaba 1.11 element {
9148 wakaba 1.18 text-content: U+0001;
9149 wakaba 1.11 }
9150     }
9151     @@XMLTest:
9152 wakaba 1.18 @@@QName: xp.element.content.hcr.legal.char.1.0.1.test
9153     @@@DEnt:
9154     @@@@test:value:
9155     <?xml version="1.0"?>
9156     <e>&#x0;</e>
9157     @@@c:erred: <[[xp|wf-legal-character]]> { (2, 4)..(2, 8); }
9158     @@XMLTest:
9159     @@@QName: xp.element.content.hcr.legal.char.1.1.1.test
9160     @@@DEnt:
9161     @@@@test:value:
9162     <?xml version="1.1"?>
9163     <e>&#x0;</e>
9164     @@@c:erred: <[[xp|wf-legal-character]]> { (2, 4)..(2, 8); }
9165     @@XMLTest:
9166     @@@QName: xp.element.content.hcr.legal.char.1.0.2.test
9167 wakaba 1.11 @@@DEnt:
9168     @@@@test:value:
9169 wakaba 1.18 <?xml version="1.0"?>
9170     <e>&#x1;</e>
9171     @@@c:erred: <[[xp|wf-legal-character]]> { (2, 4)..(2, 8); }
9172 wakaba 1.11 @@XMLTest:
9173 wakaba 1.18 @@@QName: xp.element.content.hcr.legal.char.1.1.2.test
9174 wakaba 1.11 @@@DEnt:
9175     @@@@test:value:
9176 wakaba 1.18 <?xml version="1.1"?>
9177     <e>&#x1;</e>
9178 wakaba 1.11 @@@test:domTree:
9179     document {
9180 wakaba 1.18 xml-version: '1.1';
9181 wakaba 1.11 element {
9182 wakaba 1.18 text-content: U+0001;
9183 wakaba 1.6 }
9184     }
9185    
9186 wakaba 1.19 @@XMLTest:
9187     @@@QName: xp.element.content.ger.entity.declared.nodtd.1.test
9188     @@@DEnt:
9189     @@@@test:value:
9190     <p>&entity;</p>
9191     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 4)..(1, 11); }
9192     @@XMLTest:
9193     @@@QName: xp.element.content.ger.entity.declared.nodtd.2.test
9194     @@@DEnt:
9195     @@@@test:value:
9196     <?xml version="1.0" standalone="yes"?>
9197     <p>&entity;</p>
9198     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 4)..(2, 11); }
9199     @@XMLTest:
9200     @@@QName: xp.element.content.ger.entity.declared.nodtd.3.test
9201     @@@DEnt:
9202     @@@@test:value:
9203     <?xml version="1.0" standalone="no"?>
9204     <p>&entity;</p>
9205     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 4)..(2, 11); }
9206     @@XMLTest:
9207     @@@QName: xp.element.content.ger.entity.declared.nodtd.-1.test
9208     @@@DEnt:
9209     @@@@test:value:
9210     <p>&lt;&gt;&amp;&quot;&apos;</p>
9211     @@@test:domTree:
9212     document {
9213     element {
9214     text-content: '<>&"' U+0027;
9215     }
9216     }
9217     @@XMLTest:
9218     @@@QName: xp.element.content.ger.entity.declared.nopref.1.test
9219     @@@DEnt:
9220     @@@@test:value:
9221     <!DOCTYPE p []>
9222     <p>&entity;</p>
9223     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 4)..(2, 11); }
9224     @@XMLTest:
9225     @@@QName: xp.element.content.ger.entity.declared.nopref.2.test
9226     @@@DEnt:
9227     @@@@test:value:
9228     <!DOCTYPE p [
9229     <!ENTITY other "aa">
9230     <!ENTITY % another "aa">
9231     ]>
9232     <p>&entity;</p>
9233     @@@c:erred: <[[xp|wf-entity-declared]]> { (5, 4)..(5, 11); }
9234     @@XMLTest:
9235     @@@QName: xp.element.content.ger.entity.declared.nopref.3.test
9236     @@@DEnt:
9237     @@@@test:value:
9238     <?xml version="1.0" standalone="yes"?>
9239     <!DOCTYPE p []>
9240     <p>&entity;</p>
9241     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 4)..(3, 11); }
9242     @@XMLTest:
9243     @@@QName: xp.element.content.ger.entity.declared.nopref.4.test
9244     @@@DEnt:
9245     @@@@test:value:
9246     <?xml version="1.0" standalone="no"?>
9247     <!DOCTYPE p []>
9248     <p>&entity;</p>
9249     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 4)..(3, 11); }
9250     @@XMLTest:
9251     @@@QName: xp.element.content.ger.entity.declared.nopref.5.test
9252     @@@DEnt:
9253     @@@@test:value:
9254     <?xml version="1.0" standalone="yes"?>
9255     <!DOCTYPE p [
9256     <!ENTITY other "aa">
9257     <!ENTITY % another "aa">
9258     ]>
9259     <p>&entity;</p>
9260     @@@c:erred: <[[xp|wf-entity-declared]]> { (6, 4)..(6, 11); }
9261     @@XMLTest:
9262     @@@QName: xp.element.content.ger.entity.declared.nopref.6.test
9263     @@@DEnt:
9264     @@@@test:value:
9265     <?xml version="1.0" standalone="no"?>
9266     <!DOCTYPE p [
9267     <!ENTITY other "aa">
9268     <!ENTITY % another "aa">
9269     ]>
9270     <p>&entity;</p>
9271     @@@c:erred: <[[xp|wf-entity-declared]]> { (6, 4)..(6, 11); }
9272     @@XMLTest:
9273     @@@QName: xp.element.content.ger.entity.declared.nopref.-1.test
9274     @@@DEnt:
9275     @@@@test:value:
9276     <!DOCTYPE p [
9277     <!ENTITY entity "value">
9278     ]>
9279     <p>&entity;</p>
9280     @@@test:domTree:
9281     document {
9282     document-type {
9283     general-entity {
9284     node-name: 'entity';
9285     text-content: 'value';
9286     }
9287     }
9288     element {
9289 wakaba 1.20 general-entity-reference {
9290 wakaba 1.19 node-name: 'entity';
9291 wakaba 1.20 is-expanded: true;
9292 wakaba 1.19 text-content: 'value';
9293     }
9294     }
9295     }
9296     @@XMLTest:
9297     @@@QName: xp.element.content.ger.entity.declared.nopref.-2.test
9298     @@@DEnt:
9299     @@@@test:value:
9300     <!DOCTYPE p [
9301     <!ENTITY entity "value">
9302     <!ENTITY another SYSTEM "another">
9303     ]>
9304     <p>&entity;</p>
9305     @@@test:domTree:
9306     document {
9307     document-type {
9308     general-entity {
9309     node-name: 'entity';
9310     text-content: 'value';
9311     }
9312 wakaba 1.20 general-entity {
9313     node-name: 'another';
9314     public-id: null;
9315     system-id: 'another';
9316     }
9317 wakaba 1.19 }
9318     element {
9319 wakaba 1.20 general-entity-reference {
9320 wakaba 1.19 node-name: 'entity';
9321 wakaba 1.20 is-expanded: true;
9322 wakaba 1.19 text-content: 'value';
9323     }
9324     }
9325     }
9326     @@XMLTest:
9327     @@@QName: xp.element.content.ger.entity.declared.standalone.1.test
9328     @@@DEnt:
9329     @@@@test:value:
9330     <?xml version="1.0" standalone="yes"?>
9331     <p>&entity;</p>
9332     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 4)..(2, 11); }
9333     @@XMLTest:
9334     @@@QName: xp.element.content.ger.entity.declared.standalone.2.test
9335     @@@DEnt:
9336     @@@@test:value:
9337     <?xml version="1.0" standalone="yes"?>
9338     <!DOCTYPE p []>
9339     <p>&entity;</p>
9340     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 4)..(3, 11); }
9341     @@XMLTest:
9342     @@@QName: xp.element.content.ger.entity.declared.standalone.3.test
9343     @@@DEnt:
9344     @@@@test:value:
9345     <?xml version="1.0" standalone="yes"?>
9346     <!DOCTYPE p [
9347     <!ENTITY % para "<!-- -->">
9348     %para;
9349     ]>
9350     <p>&entity;</p>
9351     @@@c:erred: <[[xp|wf-entity-declared]]> { (6, 4)..(6, 11); }
9352     @@XMLTest:
9353     @@@QName: xp.element.content.ger.entity.declared.standalone.-1.test
9354     @@@DEnt:
9355     @@@@test:value:
9356     <?xml version="1.0" standalone="no"?>
9357     <!DOCTYPE p [
9358     <!ENTITY % para "<!-- -->">
9359     %para;
9360     ]>
9361     <p>&entity;</p>
9362     @@@test:domTree:
9363     document {
9364     document-type { }
9365     element {
9366     general-entity-reference {
9367     is-expanded: false;
9368     }
9369     }
9370     }
9371     @@XMLTest:
9372     @@@QName: xp.element.content.ger.entity.declared.standalone.-2.test
9373     @@@DEnt:
9374     @@@@test:value:
9375     <!DOCTYPE p [
9376     <!ENTITY % para "<!-- -->">
9377     %para;
9378     ]>
9379     <p>&entity;</p>
9380     @@@test:domTree:
9381     document {
9382     document-type { }
9383     element {
9384     general-entity-reference {
9385     is-expanded: false;
9386     }
9387     }
9388     }
9389     @@XMLTest:
9390     @@@QName: xp.element.content.ger.entity.declared.standalone.4.test
9391     @@@DEnt:
9392     @@@@test:value:
9393     <?xml version="1.0" standalone="yes"?>
9394     <!DOCTYPE p [
9395     <!ENTITY % para SYSTEM "para">
9396     %para;
9397     ]>
9398     <p>&entity;</p>
9399     @@@c:erred: <[[xp|wf-entity-declared]]> { (6, 4)..(6, 11); }
9400     @@XMLTest:
9401     @@@QName: xp.element.content.ger.entity.declared.standalone.-3.test
9402     @@@DEnt:
9403     @@@@test:value:
9404     <?xml version="1.0" standalone="no"?>
9405     <!DOCTYPE p [
9406     <!ENTITY % para SYSTEM "para">
9407     %para;
9408     ]>
9409     <p>&entity;</p>
9410     @@@test:domTree:
9411     document {
9412     document-type { }
9413     element {
9414     general-entity-reference {
9415     is-expanded: false;
9416     }
9417     }
9418     }
9419     @@XMLTest:
9420     @@@QName: xp.element.content.ger.entity.declared.standalone.-4.test
9421     @@@DEnt:
9422     @@@@test:value:
9423     <!DOCTYPE p [
9424     <!ENTITY % para SYSTEM "para">
9425     %para;
9426     ]>
9427     <p>&entity;</p>
9428     @@@test:domTree:
9429     document {
9430     document-type { }
9431     element {
9432     general-entity-reference {
9433     is-expanded: false;
9434     }
9435     }
9436     }
9437     @@XMLTest:
9438     @@@QName: xp.element.content.ger.entity.declared.standalone.5.test
9439     @@@DEnt:
9440     @@@@test:value:
9441     <?xml version="1.0" standalone="yes"?>
9442     <!DOCTYPE p SYSTEM "dtd">
9443     <p>&entity;</p>
9444     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 4)..(3, 11); }
9445     @@XMLTest:
9446     @@@QName: xp.element.content.ger.entity.declared.standalone.-5.test
9447     @@@DEnt:
9448     @@@@test:value:
9449     <?xml version="1.0" standalone="no"?>
9450     <!DOCTYPE p SYSTEM "dtd">
9451     <p>&entity;</p>
9452     @@@test:domTree:
9453     document {
9454     document-type { }
9455     element {
9456     general-entity-reference {
9457     is-expanded: false;
9458     }
9459     }
9460     }
9461     @@XMLTest:
9462     @@@QName: xp.element.content.ger.entity.declared.standalone.-6.test
9463     @@@DEnt:
9464     @@@@test:value:
9465     <!DOCTYPE p SYSTEM "dtd">
9466     <p>&entity;</p>
9467     @@@test:domTree:
9468     document {
9469     document-type { }
9470     element {
9471     general-entity-reference {
9472     is-expanded: false;
9473     }
9474     }
9475     }
9476    
9477 wakaba 1.20 @@XMLTest:
9478     @@@QName: xp.reptxt.element.content.ger.entity.declared.nopref.1.test
9479     @@@DEnt:
9480     @@@@test:value:
9481     <!DOCTYPE p [
9482     <!ENTITY c "&entity;">
9483     ]>
9484     <p>&c;</p>
9485     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
9486     @@XMLTest:
9487     @@@QName: xp.reptxt.element.content.ger.entity.declared.nopref.2.test
9488     @@@DEnt:
9489     @@@@test:value:
9490     <!DOCTYPE p [
9491     <!ENTITY other "aa">
9492     <!ENTITY % another "aa">
9493     <!ENTITY c "&entity;">
9494     ]>
9495     <p>&c;</p>
9496     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
9497     @@XMLTest:
9498     @@@QName: xp.reptxt.element.content.ger.entity.declared.nopref.3.test
9499     @@@DEnt:
9500     @@@@test:value:
9501     <?xml version="1.0" standalone="yes"?>
9502     <!DOCTYPE p [
9503     <!ENTITY c "&entity;">
9504     ]>
9505     <p>&c;</p>
9506     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
9507     @@XMLTest:
9508     @@@QName: xp.reptxt.element.content.ger.entity.declared.nopref.4.test
9509     @@@DEnt:
9510     @@@@test:value:
9511     <?xml version="1.0" standalone="no"?>
9512     <!DOCTYPE p [
9513     <!ENTITY c "&entity;">
9514     ]>
9515     <p>&c;</p>
9516     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
9517     @@XMLTest:
9518     @@@QName: xp.reptxt.element.content.ger.entity.declared.nopref.5.test
9519     @@@DEnt:
9520     @@@@test:value:
9521     <?xml version="1.0" standalone="yes"?>
9522     <!DOCTYPE p [
9523     <!ENTITY other "aa">
9524     <!ENTITY % another "aa">
9525     <!ENTITY c "&entity;">
9526     ]>
9527     <p>&c;</p>
9528     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
9529     @@XMLTest:
9530     @@@QName: xp.reptxt.element.content.ger.entity.declared.nopref.6.test
9531     @@@DEnt:
9532     @@@@test:value:
9533     <?xml version="1.0" standalone="no"?>
9534     <!DOCTYPE p [
9535     <!ENTITY other "aa">
9536     <!ENTITY % another "aa">
9537     <!ENTITY c "&entity;">
9538     ]>
9539     <p>&c;</p>
9540     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
9541     @@XMLTest:
9542     @@@QName: xp.reptxt.element.content.ger.entity.declared.nopref.-1.test
9543     @@@DEnt:
9544     @@@@test:value:
9545     <!DOCTYPE p [
9546     <!ENTITY entity "value">
9547     <!ENTITY c "&entity;">
9548     ]>
9549     <p>&c;</p>
9550     @@@test:domTree:
9551     document {
9552     document-type {
9553     general-entity {
9554     node-name: 'entity';
9555     text-content: 'value';
9556     }
9557     general-entity {
9558     node-name: 'c';
9559     general-entity-reference {
9560     node-name: 'entity';
9561     text-content: 'value';
9562     }
9563     }
9564     }
9565     element {
9566     general-entity-reference {
9567     node-name: 'c';
9568     general-entity-reference {
9569     node-name: 'entity';
9570     text-content: 'value';
9571     }
9572     }
9573     }
9574     }
9575     @@XMLTest:
9576     @@@QName: xp.reptxt.element.content.ger.entity.declared.nopref.-2.test
9577     @@@DEnt:
9578     @@@@test:value:
9579     <!DOCTYPE p [
9580     <!ENTITY entity "value">
9581     <!ENTITY another SYSTEM "another">
9582     <!ENTITY c "&entity;">
9583     ]>
9584     <p>&c;</p>
9585     @@@test:domTree:
9586     document {
9587     document-type {
9588     general-entity {
9589     node-name: 'entity';
9590     text-content: 'value';
9591     }
9592     general-entity {
9593     node-name: 'c';
9594     general-entity-reference {
9595     node-name: 'entity';
9596 wakaba 1.23 is-expanded: true;
9597 wakaba 1.20 text-content: 'value';
9598     }
9599     }
9600     general-entity {
9601     node-name: 'another';
9602     public-id: null;
9603     system-id: 'another';
9604     has-replacement-tree: false;
9605     }
9606     }
9607     element {
9608     general-entity-reference {
9609     node-name: 'c';
9610 wakaba 1.23 is-expanded: true;
9611 wakaba 1.20 general-entity-reference {
9612     node-name: 'entity';
9613 wakaba 1.23 is-expanded: true;
9614 wakaba 1.20 text-content: 'value';
9615     }
9616     }
9617     }
9618     }
9619     @@XMLTest:
9620     @@@QName: xp.reptxt.element.content.ger.entity.declared.standalone.2.test
9621     @@@DEnt:
9622     @@@@test:value:
9623     <?xml version="1.0" standalone="yes"?>
9624     <!DOCTYPE p [
9625     <!ENTITY c "&entity;">
9626     ]>
9627     <p>&c;</p>
9628     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
9629     @@XMLTest:
9630     @@@QName: xp.reptxt.element.content.ger.entity.declared.standalone.3.test
9631     @@@DEnt:
9632     @@@@test:value:
9633     <?xml version="1.0" standalone="yes"?>
9634     <!DOCTYPE p [
9635     <!ENTITY % para "<!-- -->">
9636     %para;
9637     <!ENTITY c "&entity;">
9638     ]>
9639     <p>&c;</p>
9640     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
9641     @@XMLTest:
9642     @@@QName: xp.reptxt.element.content.ger.entity.declared.standalone.-1.test
9643     @@@DEnt:
9644     @@@@test:value:
9645     <?xml version="1.0" standalone="no"?>
9646     <!DOCTYPE p [
9647     <!ENTITY c "&entity;">
9648     <!ENTITY % para "<!-- -->">
9649     %para;
9650     ]>
9651     <p>&c;</p>
9652     @@@test:domTree:
9653     document {
9654     document-type {
9655     general-entity {
9656     node-name: 'c';
9657     general-entity-reference {
9658     node-name: 'entity';
9659     is-expanded: false;
9660     }
9661     }
9662     }
9663     element {
9664     general-entity-reference {
9665     node-name: 'c';
9666     general-entity-reference {
9667     node-name: 'entity';
9668     is-expanded: false;
9669     }
9670     }
9671     }
9672     }
9673     @@XMLTest:
9674     @@@QName:
9675     xp.reptxt.element.content.ger.entity.declared.standalone.-1.2.test
9676     @@@DEnt:
9677     @@@@test:value:
9678     <?xml version="1.0" standalone="no"?>
9679     <!DOCTYPE p [
9680     <!ENTITY % para "<!-- -->">
9681     %para;
9682     <!ENTITY c "&entity;">
9683     ]>
9684     <p>&c;</p>
9685     @@@test:domTree:
9686     document {
9687     document-type { }
9688     element {
9689     general-entity-reference {
9690     node-name: 'c';
9691     is-expanded: false;
9692     }
9693     }
9694     }
9695     @@XMLTest:
9696     @@@QName: xp.reptxt.element.content.ger.entity.declared.standalone.-2.test
9697     @@@DEnt:
9698     @@@@test:value:
9699     <!DOCTYPE p [
9700     <!ENTITY c "&entity;">
9701     <!ENTITY % para "<!-- -->">
9702     %para;
9703     ]>
9704     <p>&c;</p>
9705     @@@test:domTree:
9706     document {
9707     document-type { }
9708     element {
9709     general-entity-reference {
9710     node-name: 'c';
9711     is-expanded: true;
9712     general-entity-reference {
9713     node-name: 'entity';
9714     is-expanded: false;
9715     }
9716     }
9717     }
9718     }
9719     @@XMLTest:
9720     @@@QName:
9721     xp.reptxt.element.content.ger.entity.declared.standalone.-2.2.test
9722     @@@DEnt:
9723     @@@@test:value:
9724     <!DOCTYPE p [
9725     <!ENTITY % para "<!-- -->">
9726     %para;
9727     <!ENTITY c "&entity;">
9728     ]>
9729     <p>&c;</p>
9730     @@@test:domTree:
9731     document {
9732     document-type { }
9733     element {
9734     general-entity-reference {
9735     node-name: 'c';
9736     is-expanded: false;
9737     }
9738     }
9739     }
9740     @@XMLTest:
9741     @@@QName: xp.reptxt.element.content.ger.entity.declared.standalone.4.test
9742     @@@DEnt:
9743     @@@@test:value:
9744     <?xml version="1.0" standalone="yes"?>
9745     <!DOCTYPE p [
9746     <!ENTITY % para SYSTEM "para">
9747     %para;
9748     <!ENTITY c "&entity;">
9749     ]>
9750     <p>&c;</p>
9751     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
9752     @@XMLTest:
9753     @@@QName: xp.reptxt.element.content.ger.entity.declared.standalone.-3.test
9754     @@@DEnt:
9755     @@@@test:value:
9756     <?xml version="1.0" standalone="no"?>
9757     <!DOCTYPE p [
9758     <!ENTITY c "&entity;">
9759     <!ENTITY % para SYSTEM "para">
9760     %para;
9761     ]>
9762     <p>&c;</p>
9763     @@@test:domTree:
9764     document {
9765     document-type { }
9766     element {
9767     general-entity-reference {
9768     node-name: 'c';
9769     is-expanded: true;
9770     general-entity-reference {
9771     node-name: 'entity';
9772     is-expanded: false;
9773     }
9774     }
9775     }
9776     }
9777     @@XMLTest:
9778     @@@QName:
9779     xp.reptxt.element.content.ger.entity.declared.standalone.-3.2.test
9780     @@@DEnt:
9781     @@@@test:value:
9782     <?xml version="1.0" standalone="no"?>
9783     <!DOCTYPE p [
9784     <!ENTITY % para SYSTEM "para">
9785     %para;
9786     <!ENTITY c "&entity;">
9787     ]>
9788     <p>&c;</p>
9789     @@@test:domTree:
9790     document {
9791     document-type { }
9792     element {
9793     general-entity-reference {
9794     node-name: 'c';
9795     is-expanded: false;
9796     }
9797     }
9798     }
9799     @@XMLTest:
9800     @@@QName: xp.reptxt.element.content.ger.entity.declared.standalone.-4.test
9801     @@@DEnt:
9802     @@@@test:value:
9803     <!DOCTYPE p [
9804     <!ENTITY c "&entity;">
9805     <!ENTITY % para SYSTEM "para">
9806     %para;
9807     ]>
9808     <p>&c;</p>
9809     @@@test:domTree:
9810     document {
9811     document-type { }
9812     element {
9813     general-entity-reference {
9814     node-name: 'c';
9815     is-expanded: true;
9816     general-entity-reference {
9817     node-name: 'entity';
9818     is-expanded: false;
9819     }
9820     }
9821     }
9822     }
9823     @@XMLTest:
9824     @@@QName:
9825     xp.reptxt.element.content.ger.entity.declared.standalone.-4.2.test
9826     @@@DEnt:
9827     @@@@test:value:
9828     <!DOCTYPE p [
9829     <!ENTITY % para SYSTEM "para">
9830     %para;
9831     <!ENTITY c "&entity;">
9832     ]>
9833     <p>&c;</p>
9834     @@@test:domTree:
9835     document {
9836     document-type { }
9837     element {
9838     general-entity-reference {
9839     node-name: 'c';
9840     is-expanded: false;
9841     }
9842     }
9843     }
9844     @@XMLTest:
9845     @@@QName: xp.reptxt.element.content.ger.entity.declared.standalone.5.test
9846     @@@DEnt:
9847     @@@@test:value:
9848     <?xml version="1.0" standalone="yes"?>
9849     <!DOCTYPE p SYSTEM "dtd" [
9850     <!ENTITY c "&entity;">
9851     ]>
9852     <p>&c;</p>
9853     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
9854     @@XMLTest:
9855     @@@QName: xp.reptxt.element.content.ger.entity.declared.standalone.-5.test
9856     @@@DEnt:
9857     @@@@test:value:
9858     <?xml version="1.0" standalone="no"?>
9859     <!DOCTYPE p SYSTEM "dtd" [
9860     <!ENTITY c "&entity;">
9861     ]>
9862     <p>&c;</p>
9863     @@@test:domTree:
9864     document {
9865     document-type { }
9866     element {
9867     general-entity-reference {
9868     node-name: 'c';
9869     is-expanded: true;
9870     general-entity-reference {
9871     node-name: 'entity';
9872     is-expanded: false;
9873     }
9874     }
9875     }
9876     }
9877     @@XMLTest:
9878     @@@QName: xp.reptxt.element.content.ger.entity.declared.standalone.-6.test
9879     @@@DEnt:
9880     @@@@test:value:
9881     <!DOCTYPE p SYSTEM "dtd" [<!ENTITY c "&entity;">]>
9882     <p>&c;</p>
9883     @@@test:domTree:
9884     document {
9885     document-type { }
9886     element {
9887     general-entity-reference {
9888     node-name: 'c';
9889     is-expanded: true;
9890     general-entity-reference {
9891     node-name: 'entity';
9892     is-expanded: false;
9893     }
9894     }
9895     }
9896     }
9897    
9898     @@XMLTest:
9899     @@@QName: xp.attval.ger.entity.declared.nodtd.1.test
9900     @@@DEnt:
9901     @@@@test:value:
9902     <p a="&entity;"/>
9903     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 7)..(1, 14); }
9904     @@XMLTest:
9905     @@@QName: xp.attval.ger.entity.declared.nodtd.2.test
9906     @@@DEnt:
9907     @@@@test:value:
9908     <?xml version="1.0" standalone="yes"?>
9909     <p a="&entity;"/>
9910     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 7)..(2, 14); }
9911     @@XMLTest:
9912     @@@QName: xp.attval.ger.entity.declared.nodtd.3.test
9913     @@@DEnt:
9914     @@@@test:value:
9915     <?xml version="1.0" standalone="no"?>
9916     <p a="&entity;"/>
9917     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 7)..(2, 14); }
9918     @@XMLTest:
9919     @@@QName: xp.attval.ger.entity.declared.nodtd.-1.test
9920     @@@DEnt:
9921     @@@@test:value:
9922     <p a="&lt;&gt;&amp;&quot;&apos;"/>
9923     @@@test:domTree:
9924     document {
9925     element {
9926     attribute {
9927     node-name: 'a';
9928     text-content: '<>&"' U+0027;
9929     }
9930     }
9931     }
9932     @@XMLTest:
9933     @@@QName: xp.attval.ger.entity.declared.nopref.1.test
9934     @@@DEnt:
9935     @@@@test:value:
9936     <!DOCTYPE p []>
9937     <p a="&entity;"/>
9938     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 7)..(2, 14); }
9939     @@XMLTest:
9940     @@@QName: xp.attval.ger.entity.declared.nopref.2.test
9941     @@@DEnt:
9942     @@@@test:value:
9943     <!DOCTYPE p [
9944     <!ENTITY other "aa">
9945     <!ENTITY % another "aa">
9946     ]>
9947     <p a="&entity;"/>
9948     @@@c:erred: <[[xp|wf-entity-declared]]> { (5, 7)..(5, 14); }
9949     @@XMLTest:
9950     @@@QName: xp.attval.ger.entity.declared.nopref.3.test
9951     @@@DEnt:
9952     @@@@test:value:
9953     <?xml version="1.0" standalone="yes"?>
9954     <!DOCTYPE p []>
9955     <p a="&entity;"/>
9956     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 7)..(3, 14); }
9957     @@XMLTest:
9958     @@@QName: xp.attval.ger.entity.declared.nopref.4.test
9959     @@@DEnt:
9960     @@@@test:value:
9961     <?xml version="1.0" standalone="no"?>
9962     <!DOCTYPE p []>
9963     <p a="&entity;"/>
9964     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 7)..(3, 14); }
9965     @@XMLTest:
9966     @@@QName: xp.attval.ger.entity.declared.nopref.5.test
9967     @@@DEnt:
9968     @@@@test:value:
9969     <?xml version="1.0" standalone="yes"?>
9970     <!DOCTYPE p [
9971     <!ENTITY other "aa">
9972     <!ENTITY % another "aa">
9973     ]>
9974     <p a="&entity;"/>
9975     @@@c:erred: <[[xp|wf-entity-declared]]> { (6, 7)..(6, 14); }
9976     @@XMLTest:
9977     @@@QName: xp.attval.ger.entity.declared.nopref.6.test
9978     @@@DEnt:
9979     @@@@test:value:
9980     <?xml version="1.0" standalone="no"?>
9981     <!DOCTYPE p [
9982     <!ENTITY other "aa">
9983     <!ENTITY % another "aa">
9984     ]>
9985     <p a="&entity;"/>
9986     @@@c:erred: <[[xp|wf-entity-declared]]> { (6, 7)..(6, 14); }
9987     @@XMLTest:
9988     @@@QName: xp.attval.ger.entity.declared.nopref.-1.test
9989     @@@DEnt:
9990     @@@@test:value:
9991     <!DOCTYPE p [
9992     <!ENTITY entity "value">
9993     ]>
9994     <p a="&entity;"/>
9995     @@@test:domTree:
9996     document {
9997     document-type {
9998     general-entity {
9999     node-name: 'entity';
10000     text-content: 'value';
10001     }
10002     }
10003     element {
10004     attribute {
10005     node-name: 'a';
10006     general-entity-reference {
10007     node-name: 'entity';
10008     is-expanded: true;
10009     text-content: 'value';
10010     }
10011     }
10012     }
10013     }
10014     @@XMLTest:
10015     @@@QName: xp.attval.ger.entity.declared.nopref.-2.test
10016     @@@DEnt:
10017     @@@@test:value:
10018     <!DOCTYPE p [
10019     <!ENTITY entity "value">
10020     <!ENTITY another SYSTEM "another">
10021     ]>
10022     <p a="&entity;"/>
10023     @@@test:domTree:
10024     document {
10025     document-type {
10026     general-entity {
10027     node-name: 'entity';
10028     text-content: 'value';
10029     has-replacement-tree: true;
10030     }
10031     general-entity {
10032     node-name: 'another';
10033     public-id: null;
10034     system-id: 'another';
10035     has-replacement-tree: false;
10036     }
10037     }
10038     element {
10039     attribute {
10040     node-name: 'a';
10041     general-entity-reference {
10042     node-name: 'entity';
10043     is-expanded: true;
10044     text-content: 'value';
10045     }
10046     }
10047     }
10048     }
10049     @@XMLTest:
10050     @@@QName: xp.attval.ger.entity.declared.standalone.1.test
10051     @@@DEnt:
10052     @@@@test:value:
10053     <?xml version="1.0" standalone="yes"?>
10054     <p a="&entity;"/>
10055     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 7)..(2, 14); }
10056     @@XMLTest:
10057     @@@QName: xp.attval.ger.entity.declared.standalone.2.test
10058     @@@DEnt:
10059     @@@@test:value:
10060     <?xml version="1.0" standalone="yes"?>
10061     <!DOCTYPE p []>
10062     <p a="&entity;"/>
10063     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 7)..(3, 14); }
10064     @@XMLTest:
10065     @@@QName: xp.attval.ger.entity.declared.standalone.3.test
10066     @@@DEnt:
10067     @@@@test:value:
10068     <?xml version="1.0" standalone="yes"?>
10069     <!DOCTYPE p [
10070     <!ENTITY % para "<!-- -->">
10071     %para;
10072     ]>
10073     <p a="&entity;"/>
10074     @@@c:erred: <[[xp|wf-entity-declared]]> { (6, 7)..(6, 14); }
10075     @@XMLTest:
10076     @@@QName: xp.attval.ger.entity.declared.standalone.-1.test
10077     @@@DEnt:
10078     @@@@test:value:
10079     <?xml version="1.0" standalone="no"?>
10080     <!DOCTYPE p [
10081     <!ENTITY % para "<!-- -->">
10082     %para;
10083     ]>
10084     <p a="&entity;"/>
10085     @@@test:domTree:
10086     document {
10087     document-type { }
10088     element {
10089     attribute {
10090     node-name: 'a';
10091     general-entity-reference {
10092     is-expanded: false;
10093     }
10094     }
10095     }
10096     }
10097     @@XMLTest:
10098     @@@QName: xp.attval.ger.entity.declared.standalone.-2.test
10099     @@@DEnt:
10100     @@@@test:value:
10101     <!DOCTYPE p [
10102     <!ENTITY % para "<!-- -->">
10103     %para;
10104     ]>
10105     <p a="&entity;"/>
10106     @@@test:domTree:
10107     document {
10108     document-type { }
10109     element {
10110     attribute {
10111     node-name: 'a';
10112     general-entity-reference {
10113     is-expanded: false;
10114     }
10115     }
10116     }
10117     }
10118     @@XMLTest:
10119     @@@QName: xp.attval.ger.entity.declared.standalone.4.test
10120     @@@DEnt:
10121     @@@@test:value:
10122     <?xml version="1.0" standalone="yes"?>
10123     <!DOCTYPE p [
10124     <!ENTITY % para SYSTEM "para">
10125     %para;
10126     ]>
10127     <p a="&entity;"/>
10128     @@@c:erred: <[[xp|wf-entity-declared]]> { (6, 7)..(6, 14); }
10129     @@XMLTest:
10130     @@@QName: xp.attval.ger.entity.declared.standalone.-3.test
10131     @@@DEnt:
10132     @@@@test:value:
10133     <?xml version="1.0" standalone="no"?>
10134     <!DOCTYPE p [
10135     <!ENTITY % para SYSTEM "para">
10136     %para;
10137     ]>
10138     <p a="&entity;"/>
10139     @@@test:domTree:
10140     document {
10141     document-type { }
10142     element {
10143     attribute {
10144     node-name: 'a';
10145     general-entity-reference {
10146     is-expanded: false;
10147     }
10148     }
10149     }
10150     }
10151     @@XMLTest:
10152     @@@QName: xp.attval.ger.entity.declared.standalone.-4.test
10153     @@@DEnt:
10154     @@@@test:value:
10155     <!DOCTYPE p [
10156     <!ENTITY % para SYSTEM "para">
10157     %para;
10158     ]>
10159     <p a="&entity;"/>
10160     @@@test:domTree:
10161     document {
10162     document-type { }
10163     element {
10164     attribute {
10165     node-name: 'a';
10166     general-entity-reference {
10167     is-expanded: false;
10168     }
10169     }
10170     }
10171     }
10172     @@XMLTest:
10173     @@@QName: xp.attval.ger.entity.declared.standalone.5.test
10174     @@@DEnt:
10175     @@@@test:value:
10176     <?xml version="1.0" standalone="yes"?>
10177     <!DOCTYPE p SYSTEM "dtd">
10178     <p a="&entity;"/>
10179     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 7)..(3, 14); }
10180     @@XMLTest:
10181     @@@QName: xp.attval.ger.entity.declared.standalone.-5.test
10182     @@@DEnt:
10183     @@@@test:value:
10184     <?xml version="1.0" standalone="no"?>
10185     <!DOCTYPE p SYSTEM "dtd">
10186     <p a="&entity;"/>
10187     @@@test:domTree:
10188     document {
10189     document-type { }
10190     element {
10191     attribute {
10192     node-name: 'a';
10193     general-entity-reference {
10194     is-expanded: false;
10195     }
10196     }
10197     }
10198     }
10199     @@XMLTest:
10200     @@@QName: xp.attval.ger.entity.declared.standalone.-6.test
10201     @@@DEnt:
10202     @@@@test:value:
10203     <!DOCTYPE p SYSTEM "dtd">
10204     <p a="&entity;"/>
10205     @@@test:domTree:
10206     document {
10207     document-type { }
10208     element {
10209     attribute {
10210     node-name: 'a';
10211     general-entity-reference {
10212     is-expanded: false;
10213     }
10214     }
10215     }
10216     }
10217    
10218 wakaba 1.21 @@XMLTest:
10219 wakaba 1.22 @@@QName: xp.reptxt.attval.ger.entity.declared.nopref.1.test
10220 wakaba 1.21 @@@DEnt:
10221     @@@@test:value:
10222     <!DOCTYPE p [
10223 wakaba 1.22 <!ENTITY c "&entity;">
10224 wakaba 1.21 ]>
10225 wakaba 1.22 <p a="&c;"/>
10226     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
10227 wakaba 1.21 @@XMLTest:
10228 wakaba 1.22 @@@QName: xp.reptxt.attval.ger.entity.declared.nopref.2.test
10229 wakaba 1.21 @@@DEnt:
10230     @@@@test:value:
10231     <!DOCTYPE p [
10232     <!ENTITY other "aa">
10233     <!ENTITY % another "aa">
10234 wakaba 1.22 <!ENTITY c "&entity;">
10235 wakaba 1.21 ]>
10236 wakaba 1.22 <p a="&c;"/>
10237     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
10238 wakaba 1.21 @@XMLTest:
10239 wakaba 1.22 @@@QName: xp.reptxt.attval.ger.entity.declared.nopref.3.test
10240 wakaba 1.21 @@@DEnt:
10241     @@@@test:value:
10242     <?xml version="1.0" standalone="yes"?>
10243     <!DOCTYPE p [
10244 wakaba 1.22 <!ENTITY c "&entity;">
10245 wakaba 1.21 ]>
10246 wakaba 1.22 <p a="&c;"/>
10247     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
10248 wakaba 1.21 @@XMLTest:
10249 wakaba 1.22 @@@QName: xp.reptxt.attval.ger.entity.declared.nopref.4.test
10250 wakaba 1.21 @@@DEnt:
10251     @@@@test:value:
10252     <?xml version="1.0" standalone="no"?>
10253     <!DOCTYPE p [
10254 wakaba 1.22 <!ENTITY c "&entity;">
10255 wakaba 1.21 ]>
10256 wakaba 1.22 <p a="&c;"/>
10257     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
10258 wakaba 1.21 @@XMLTest:
10259 wakaba 1.22 @@@QName: xp.reptxt.attval.ger.entity.declared.nopref.5.test
10260 wakaba 1.21 @@@DEnt:
10261     @@@@test:value:
10262     <?xml version="1.0" standalone="yes"?>
10263     <!DOCTYPE p [
10264     <!ENTITY other "aa">
10265     <!ENTITY % another "aa">
10266 wakaba 1.22 <!ENTITY c "&entity;">
10267 wakaba 1.21 ]>
10268 wakaba 1.22 <p a="&c;"/>
10269     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
10270 wakaba 1.21 @@XMLTest:
10271 wakaba 1.22 @@@QName: xp.reptxt.attval.ger.entity.declared.nopref.6.test
10272 wakaba 1.21 @@@DEnt:
10273     @@@@test:value:
10274     <?xml version="1.0" standalone="no"?>
10275     <!DOCTYPE p [
10276     <!ENTITY other "aa">
10277     <!ENTITY % another "aa">
10278 wakaba 1.22 <!ENTITY c "&entity;">
10279 wakaba 1.21 ]>
10280 wakaba 1.22 <p a="&c;"/>
10281     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
10282 wakaba 1.21 @@XMLTest:
10283 wakaba 1.22 @@@QName: xp.reptxt.attval.ger.entity.declared.nopref.-1.test
10284 wakaba 1.21 @@@DEnt:
10285     @@@@test:value:
10286     <!DOCTYPE p [
10287     <!ENTITY entity "value">
10288 wakaba 1.22 <!ENTITY c "&entity;">
10289 wakaba 1.21 ]>
10290 wakaba 1.22 <p a="&c;"/>
10291 wakaba 1.21 @@@test:domTree:
10292     document {
10293     document-type {
10294     general-entity {
10295     node-name: 'entity';
10296     text-content: 'value';
10297     }
10298 wakaba 1.22 general-entity {
10299     node-name: 'c';
10300     general-entity-reference {
10301     node-name: 'entity';
10302     text-content: 'value';
10303 wakaba 1.21 }
10304     }
10305     }
10306     element {
10307     attribute {
10308     node-name: 'a';
10309     general-entity-reference {
10310 wakaba 1.22 node-name: 'c';
10311     general-entity-reference {
10312     node-name: 'entity';
10313     text-content: 'value';
10314     }
10315 wakaba 1.21 }
10316     }
10317     }
10318     }
10319     @@XMLTest:
10320 wakaba 1.22 @@@QName: xp.reptxt.attval.ger.entity.declared.nopref.-2.test
10321 wakaba 1.21 @@@DEnt:
10322     @@@@test:value:
10323     <!DOCTYPE p [
10324     <!ENTITY entity "value">
10325     <!ENTITY another SYSTEM "another">
10326 wakaba 1.22 <!ENTITY c "&entity;">
10327 wakaba 1.21 ]>
10328 wakaba 1.22 <p a="&c;"/>
10329 wakaba 1.21 @@@test:domTree:
10330     document {
10331     document-type {
10332     general-entity {
10333     node-name: 'entity';
10334     text-content: 'value';
10335 wakaba 1.22 }
10336     general-entity {
10337     node-name: 'c';
10338     general-entity-reference {
10339     node-name: 'entity';
10340     text-content: 'value';
10341     }
10342 wakaba 1.21 }
10343     general-entity {
10344     node-name: 'another';
10345     public-id: null;
10346     system-id: 'another';
10347     has-replacement-tree: false;
10348     }
10349     }
10350     element {
10351     attribute {
10352     node-name: 'a';
10353     general-entity-reference {
10354 wakaba 1.22 node-name: 'c';
10355     general-entity-reference {
10356     node-name: 'entity';
10357     text-content: 'value';
10358     }
10359 wakaba 1.21 }
10360     }
10361     }
10362     }
10363     @@XMLTest:
10364 wakaba 1.22 @@@QName: xp.reptxt.attval.ger.entity.declared.standalone.2.test
10365 wakaba 1.21 @@@DEnt:
10366     @@@@test:value:
10367     <?xml version="1.0" standalone="yes"?>
10368     <!DOCTYPE p [
10369 wakaba 1.22 <!ENTITY c "&entity;">
10370 wakaba 1.21 ]>
10371 wakaba 1.22 <p a="&c;"/>
10372     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
10373 wakaba 1.21 @@XMLTest:
10374 wakaba 1.22 @@@QName: xp.reptxt.attval.ger.entity.declared.standalone.3.test
10375 wakaba 1.21 @@@DEnt:
10376     @@@@test:value:
10377     <?xml version="1.0" standalone="yes"?>
10378     <!DOCTYPE p [
10379     <!ENTITY % para "<!-- -->">
10380     %para;
10381 wakaba 1.22 <!ENTITY c "&entity;">
10382 wakaba 1.21 ]>
10383 wakaba 1.22 <p a="&c;"/>
10384     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
10385 wakaba 1.21 @@XMLTest:
10386 wakaba 1.22 @@@QName: xp.reptxt.attval.ger.entity.declared.standalone.-1.test
10387 wakaba 1.21 @@@DEnt:
10388     @@@@test:value:
10389 wakaba 1.22 <?xml version="1.0" standalone="no"?>
10390 wakaba 1.21 <!DOCTYPE p [
10391 wakaba 1.22 <!ENTITY c "&entity;">
10392 wakaba 1.21 <!ENTITY % para "<!-- -->">
10393     %para;
10394     ]>
10395 wakaba 1.22 <p a="&c;"/>
10396     @@@test:domTree:
10397     document {
10398     document-type {
10399     general-entity {
10400     node-name: 'c';
10401     general-entity-reference {
10402     node-name: 'entity';
10403     is-expanded: false;
10404     }
10405     }
10406     }
10407     element {
10408     attribute {
10409     node-name: 'a';
10410     general-entity-reference {
10411     node-name: 'c';
10412     general-entity-reference {
10413     node-name: 'entity';
10414     is-expanded: false;
10415     }
10416     }
10417     }
10418     }
10419     }
10420 wakaba 1.21 @@XMLTest:
10421 wakaba 1.22 @@@QName:
10422     xp.reptxt.attval.ger.entity.declared.standalone.-1.2.test
10423 wakaba 1.21 @@@DEnt:
10424     @@@@test:value:
10425     <?xml version="1.0" standalone="no"?>
10426     <!DOCTYPE p [
10427     <!ENTITY % para "<!-- -->">
10428     %para;
10429 wakaba 1.22 <!ENTITY c "&entity;">
10430 wakaba 1.21 ]>
10431 wakaba 1.22 <p a="&c;"/>
10432     @@@test:domTree:
10433     document {
10434     document-type { }
10435     element {
10436     attribute {
10437     node-name: 'a';
10438     general-entity-reference {
10439     node-name: 'c';
10440     is-expanded: false;
10441     }
10442     }
10443     }
10444     }
10445 wakaba 1.21 @@XMLTest:
10446 wakaba 1.22 @@@QName: xp.reptxt.attval.ger.entity.declared.standalone.-2.test
10447 wakaba 1.21 @@@DEnt:
10448     @@@@test:value:
10449     <!DOCTYPE p [
10450 wakaba 1.22 <!ENTITY c "&entity;">
10451     <!ENTITY % para "<!-- -->">
10452     %para;
10453     ]>
10454     <p a="&c;"/>
10455     @@@test:domTree:
10456     document {
10457     document-type { }
10458     element {
10459     attribute {
10460     node-name: 'a';
10461     general-entity-reference {
10462     node-name: 'c';
10463     is-expanded: true;
10464     general-entity-reference {
10465     node-name: 'entity';
10466     is-expanded: false;
10467     }
10468     }
10469     }
10470     }
10471     }
10472     @@XMLTest:
10473     @@@QName:
10474     xp.reptxt.attval.ger.entity.declared.standalone.-2.2.test
10475     @@@DEnt:
10476     @@@@test:value:
10477     <!DOCTYPE p [
10478     <!ENTITY % para "<!-- -->">
10479     %para;
10480     <!ENTITY c "&entity;">
10481     ]>
10482     <p a="&c;"/>
10483     @@@test:domTree:
10484     document {
10485     document-type { }
10486     element {
10487     attribute {
10488     node-name: 'a';
10489     general-entity-reference {
10490     node-name: 'c';
10491     is-expanded: false;
10492     }
10493     }
10494     }
10495     }
10496     @@XMLTest:
10497     @@@QName: xp.reptxt.attval.ger.entity.declared.standalone.4.test
10498     @@@DEnt:
10499     @@@@test:value:
10500     <?xml version="1.0" standalone="yes"?>
10501     <!DOCTYPE p [
10502     <!ENTITY % para SYSTEM "para">
10503     %para;
10504     <!ENTITY c "&entity;">
10505     ]>
10506     <p a="&c;"/>
10507     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
10508     @@XMLTest:
10509     @@@QName: xp.reptxt.attval.ger.entity.declared.standalone.-3.test
10510     @@@DEnt:
10511     @@@@test:value:
10512     <?xml version="1.0" standalone="no"?>
10513     <!DOCTYPE p [
10514     <!ENTITY c "&entity;">
10515     <!ENTITY % para SYSTEM "para">
10516     %para;
10517     ]>
10518     <p a="&c;"/>
10519     @@@test:domTree:
10520     document {
10521     document-type { }
10522     element {
10523     attribute {
10524     node-name: 'a';
10525     general-entity-reference {
10526     node-name: 'c';
10527     is-expanded: true;
10528     general-entity-reference {
10529     node-name: 'entity';
10530     is-expanded: false;
10531     }
10532     }
10533     }
10534     }
10535     }
10536     @@XMLTest:
10537     @@@QName:
10538     xp.reptxt.attval.ger.entity.declared.standalone.-3.2.test
10539     @@@DEnt:
10540     @@@@test:value:
10541     <?xml version="1.0" standalone="no"?>
10542     <!DOCTYPE p [
10543     <!ENTITY % para SYSTEM "para">
10544     %para;
10545     <!ENTITY c "&entity;">
10546     ]>
10547     <p a="&c;"/>
10548     @@@test:domTree:
10549     document {
10550     document-type { }
10551     element {
10552     attribute {
10553     node-name: 'a';
10554     general-entity-reference {
10555     node-name: 'c';
10556     is-expanded: false;
10557     }
10558     }
10559     }
10560     }
10561     @@XMLTest:
10562     @@@QName: xp.reptxt.attval.ger.entity.declared.standalone.-4.test
10563     @@@DEnt:
10564     @@@@test:value:
10565     <!DOCTYPE p [
10566     <!ENTITY c "&entity;">
10567     <!ENTITY % para SYSTEM "para">
10568     %para;
10569     ]>
10570     <p a="&c;"/>
10571     @@@test:domTree:
10572     document {
10573     document-type { }
10574     element {
10575     attribute {
10576     node-name: 'a';
10577     general-entity-reference {
10578     node-name: 'c';
10579     is-expanded: true;
10580     general-entity-reference {
10581     node-name: 'entity';
10582     is-expanded: false;
10583     }
10584     }
10585     }
10586     }
10587     }
10588     @@XMLTest:
10589     @@@QName:
10590     xp.reptxt.attval.ger.entity.declared.standalone.-4.2.test
10591     @@@DEnt:
10592     @@@@test:value:
10593     <!DOCTYPE p [
10594     <!ENTITY % para SYSTEM "para">
10595     %para;
10596     <!ENTITY c "&entity;">
10597     ]>
10598     <p a="&c;"/>
10599     @@@test:domTree:
10600     document {
10601     document-type { }
10602     element {
10603     attribute {
10604     node-name: 'a';
10605     general-entity-reference {
10606     node-name: 'c';
10607     is-expanded: false;
10608     }
10609     }
10610     }
10611     }
10612     @@XMLTest:
10613     @@@QName: xp.reptxt.attval.ger.entity.declared.standalone.5.test
10614     @@@DEnt:
10615     @@@@test:value:
10616     <?xml version="1.0" standalone="yes"?>
10617     <!DOCTYPE p SYSTEM "dtd" [
10618     <!ENTITY c "&entity;">
10619     ]>
10620     <p a="&c;"/>
10621     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
10622     @@XMLTest:
10623     @@@QName: xp.reptxt.attval.ger.entity.declared.standalone.-5.test
10624     @@@DEnt:
10625     @@@@test:value:
10626     <?xml version="1.0" standalone="no"?>
10627     <!DOCTYPE p SYSTEM "dtd" [
10628     <!ENTITY c "&entity;">
10629     ]>
10630     <p a="&c;"/>
10631     @@@test:domTree:
10632     document {
10633     document-type { }
10634     element {
10635     attribute {
10636     node-name: 'a';
10637     general-entity-reference {
10638     node-name: 'c';
10639     is-expanded: true;
10640     general-entity-reference {
10641     node-name: 'entity';
10642     is-expanded: false;
10643     }
10644     }
10645     }
10646     }
10647     }
10648     @@XMLTest:
10649     @@@QName: xp.reptxt.attval.ger.entity.declared.standalone.-6.test
10650     @@@DEnt:
10651     @@@@test:value:
10652     <!DOCTYPE p SYSTEM "dtd" [<!ENTITY c "&entity;">]>
10653     <p a="&c;"/>
10654     @@@test:domTree:
10655     document {
10656     document-type { }
10657     element {
10658     attribute {
10659     node-name: 'a';
10660     general-entity-reference {
10661     node-name: 'c';
10662     is-expanded: true;
10663     general-entity-reference {
10664     node-name: 'entity';
10665     is-expanded: false;
10666     }
10667     }
10668     }
10669     }
10670     }
10671    
10672     @@XMLTest:
10673     @@@QName: xp.attlist.dup.entity.declared.1.test
10674     @@@DEnt:
10675     @@@@test:value:
10676     <!DOCTYPE p [
10677     <!ATTLIST p a CDATA "no-entity">
10678     <!ATTLIST p a CDATA "&entity;">
10679     ]>
10680     <p/>
10681     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 21)..(3, 29); }
10682     @@XMLTest:
10683     @@@QName: xp.attlist.dup.entity.declared.2.test
10684     @@@DEnt:
10685     @@@@test:value:
10686     <!DOCTYPE p [
10687     <!ATTLIST p a CDATA "no-entity"
10688     a CDATA "&entity;">
10689     ]>
10690     <p/>
10691     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 21)..(3, 29); }
10692     @@XMLTest:
10693     @@@QName: xp.attlist.unused.entity.declared.1.test
10694     @@@DEnt:
10695     @@@@test:value:
10696     <!DOCTYPE p [
10697     <!ATTLIST q a CDATA "&entity;">
10698     ]>
10699     <p/>
10700     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 21)..(2, 29); }
10701     @@XMLTest:
10702     @@@QName: xp.attlist.unused.entity.declared.2.test
10703     @@@DEnt:
10704     @@@@test:value:
10705     <!DOCTYPE p [
10706     <!ATTLIST p a CDATA "&entity;">
10707     ]>
10708     <p a="bb"/>
10709     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 21)..(2, 29); }
10710    
10711     @@XMLTest:
10712     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.nopref.1.test
10713     @@@DEnt:
10714     @@@@test:value:
10715     <!DOCTYPE p [
10716     <!ENTITY c "&entity;">
10717     <!ATTLIST p a CDATA "&c;">
10718     ]>
10719     <p/>
10720     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
10721     @@XMLTest:
10722     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.nopref.2.test
10723     @@@DEnt:
10724     @@@@test:value:
10725     <!DOCTYPE p [
10726     <!ENTITY other "aa">
10727     <!ENTITY % another "aa">
10728     <!ENTITY c "&entity;">
10729     <!ATTLIST p a CDATA "&c;">
10730     ]>
10731     <p/>
10732     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
10733     @@XMLTest:
10734     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.nopref.3.test
10735     @@@DEnt:
10736     @@@@test:value:
10737     <?xml version="1.0" standalone="yes"?>
10738     <!DOCTYPE p [
10739     <!ENTITY c "&entity;">
10740     <!ATTLIST p a CDATA "&c;">
10741     ]>
10742     <p/>
10743     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
10744     @@XMLTest:
10745     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.nopref.4.test
10746     @@@DEnt:
10747     @@@@test:value:
10748     <?xml version="1.0" standalone="no"?>
10749     <!DOCTYPE p [
10750     <!ENTITY c "&entity;">
10751     <!ATTLIST p a CDATA "&c;">
10752     ]>
10753     <p/>
10754     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
10755     @@XMLTest:
10756     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.nopref.5.test
10757     @@@DEnt:
10758     @@@@test:value:
10759     <?xml version="1.0" standalone="yes"?>
10760     <!DOCTYPE p [
10761     <!ENTITY other "aa">
10762     <!ENTITY % another "aa">
10763     <!ENTITY c "&entity;">
10764     <!ATTLIST p a CDATA "&c;">
10765     ]>
10766     <p/>
10767     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
10768     @@XMLTest:
10769     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.nopref.6.test
10770     @@@DEnt:
10771     @@@@test:value:
10772     <?xml version="1.0" standalone="no"?>
10773     <!DOCTYPE p [
10774     <!ENTITY other "aa">
10775     <!ENTITY % another "aa">
10776     <!ENTITY c "&entity;">
10777     <!ATTLIST p a CDATA "&c;">
10778     ]>
10779     <p/>
10780     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
10781     @@XMLTest:
10782     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.nopref.-1.test
10783     @@@DEnt:
10784     @@@@test:value:
10785     <!DOCTYPE p [
10786     <!ENTITY entity "value">
10787     <!ENTITY c "&entity;">
10788     <!ATTLIST p a CDATA "&c;">
10789     ]>
10790     <p/>
10791     @@@test:domTree:
10792     document {
10793     document-type {
10794     general-entity {
10795     node-name: 'entity';
10796     text-content: 'value';
10797     }
10798     general-entity {
10799     node-name: 'c';
10800     general-entity-reference {
10801     node-name: 'entity';
10802     is-expanded: true;
10803     text-content: 'value';
10804     }
10805     }
10806     element-type-definition {
10807     node-name: 'p';
10808     attribute-definition {
10809     node-name: 'a';
10810     general-entity-reference {
10811     node-name: 'c';
10812     is-expanded: true;
10813     general-entity-reference {
10814     node-name: 'entity';
10815     is-expanded: true;
10816     text-content: 'value';
10817     }
10818     }
10819     }
10820     }
10821     }
10822     element {
10823     attribute {
10824     node-name: 'a';
10825     specified: false;
10826     general-entity-reference {
10827     node-name: 'c';
10828     general-entity-reference {
10829     node-name: 'entity';
10830     text-content: 'value';
10831     }
10832     }
10833     }
10834     }
10835     }
10836     @@XMLTest:
10837     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.nopref.-2.test
10838     @@@DEnt:
10839     @@@@test:value:
10840     <!DOCTYPE p [
10841     <!ENTITY entity "value">
10842     <!ENTITY another SYSTEM "another">
10843     <!ENTITY c "&entity;">
10844     <!ATTLIST p a CDATA "&c;">
10845     ]>
10846     <p/>
10847     @@@test:domTree:
10848     document {
10849     document-type {
10850     general-entity {
10851     node-name: 'entity';
10852     text-content: 'value';
10853     }
10854     general-entity {
10855     node-name: 'c';
10856     general-entity-reference {
10857     node-name: 'entity';
10858     text-content: 'value';
10859     }
10860     }
10861     general-entity {
10862     node-name: 'another';
10863     public-id: null;
10864     system-id: 'another';
10865     has-replacement-tree: false;
10866     }
10867     element-type-definition {
10868     node-name: 'p';
10869     attribute-definition {
10870     node-name: 'a';
10871     general-entity-reference {
10872     node-name: 'c';
10873     is-expanded: true;
10874     general-entity-reference {
10875     node-name: 'entity';
10876     is-expanded: true;
10877     text-content: 'value';
10878     }
10879     }
10880     }
10881     }
10882     }
10883     element {
10884     attribute {
10885     node-name: 'a';
10886     specified: false;
10887     general-entity-reference {
10888     node-name: 'c';
10889     general-entity-reference {
10890     node-name: 'entity';
10891     text-content: 'value';
10892     }
10893     }
10894     }
10895     }
10896     }
10897     @@XMLTest:
10898     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.standalone.2.test
10899     @@@DEnt:
10900     @@@@test:value:
10901     <?xml version="1.0" standalone="yes"?>
10902     <!DOCTYPE p [
10903     <!ENTITY c "&entity;">
10904     <!ATTLIST p a CDATA "&c;">
10905     ]>
10906     <p/>
10907     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
10908     @@XMLTest:
10909     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.standalone.3.test
10910     @@@DEnt:
10911     @@@@test:value:
10912     <?xml version="1.0" standalone="yes"?>
10913     <!DOCTYPE p [
10914     <!ENTITY % para "<!-- -->">
10915     %para;
10916     <!ENTITY c "&entity;">
10917     <!ATTLIST p a CDATA "&c;">
10918     ]>
10919     <p/>
10920     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
10921     @@XMLTest:
10922     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.standalone.-1.test
10923     @@@DEnt:
10924     @@@@test:value:
10925     <?xml version="1.0" standalone="no"?>
10926     <!DOCTYPE p [
10927     <!ENTITY c "&entity;">
10928     <!ATTLIST p a CDATA "&c;">
10929     <!ENTITY % para "<!-- -->">
10930     %para;
10931     ]>
10932     <p/>
10933     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
10934     @@XMLTest:
10935     @@@QName:
10936     xp.reptxt.attlist.attval.ger.entity.declared.standalone.-1.2.test
10937     @@@DEnt:
10938     @@@@test:value:
10939     <?xml version="1.0" standalone="no"?>
10940     <!DOCTYPE p [
10941     <!ENTITY % para "<!-- -->">
10942     %para;
10943     <!ENTITY c "&entity;">
10944     <!ATTLIST p a CDATA "&c;">
10945     ]>
10946     <p g="h"/>
10947     @@@test:domTree:
10948     document {
10949     document-type { }
10950     element {
10951     attribute {
10952     node-name: 'g';
10953     text-content: 'h';
10954     }
10955     }
10956     }
10957     @@XMLTest:
10958     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.standalone.-2.test
10959     @@@DEnt:
10960     @@@@test:value:
10961     <!DOCTYPE p [
10962     <!ENTITY c "&entity;">
10963     <!ATTLIST p a CDATA "&c;">
10964     <!ENTITY % para "<!-- -->">
10965     %para;
10966     ]>
10967     <p/>
10968     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
10969     @@XMLTest:
10970     @@@QName:
10971     xp.reptxt.attlist.attval.ger.entity.declared.standalone.-2.2.test
10972     @@@DEnt:
10973     @@@@test:value:
10974     <!DOCTYPE p [
10975     <!ENTITY % para "<!-- -->">
10976     %para;
10977     <!ENTITY c "&entity;">
10978     <!ATTLIST p a CDATA "&c;">
10979     ]>
10980     <p g="h"/>
10981     @@@test:domTree:
10982     document {
10983     document-type { }
10984     element {
10985     attribute {
10986     node-name: 'g';
10987     text-content: 'h';
10988     }
10989     }
10990     }
10991     @@XMLTest:
10992     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.standalone.4.test
10993     @@@DEnt:
10994     @@@@test:value:
10995     <?xml version="1.0" standalone="yes"?>
10996     <!DOCTYPE p [
10997     <!ENTITY % para SYSTEM "para">
10998     %para;
10999     <!ENTITY c "&entity;">
11000     <!ATTLIST p a CDATA "&c;">
11001     ]>
11002     <p/>
11003     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11004     @@XMLTest:
11005     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.standalone.-3.test
11006     @@@DEnt:
11007     @@@@test:value:
11008     <?xml version="1.0" standalone="no"?>
11009     <!DOCTYPE p [
11010     <!ENTITY c "&entity;">
11011     <!ATTLIST p a CDATA "&c;">
11012     <!ENTITY % para SYSTEM "para">
11013     %para;
11014     ]>
11015     <p/>
11016     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11017     @@XMLTest:
11018     @@@QName:
11019     xp.reptxt.attlist.attval.ger.entity.declared.standalone.-3.2.test
11020     @@@DEnt:
11021     @@@@test:value:
11022     <?xml version="1.0" standalone="no"?>
11023     <!DOCTYPE p [
11024     <!ENTITY % para SYSTEM "para">
11025     %para;
11026     <!ENTITY c "&entity;">
11027     <!ATTLIST p a CDATA "&c;">
11028     ]>
11029     <p g="h"/>
11030     @@@test:domTree:
11031     document {
11032     document-type { }
11033     element {
11034     attribute {
11035     node-name: 'g';
11036     text-content: 'h';
11037     }
11038     }
11039     }
11040     @@XMLTest:
11041     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.standalone.-4.test
11042     @@@DEnt:
11043     @@@@test:value:
11044     <!DOCTYPE p [
11045     <!ENTITY c "&entity;">
11046     <!ATTLIST p a CDATA "&c;">
11047     <!ENTITY % para SYSTEM "para">
11048     %para;
11049     ]>
11050     <p/>
11051     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11052     @@XMLTest:
11053     @@@QName:
11054     xp.reptxt.attlist.attval.ger.entity.declared.standalone.-4.2.test
11055     @@@DEnt:
11056     @@@@test:value:
11057     <!DOCTYPE p [
11058     <!ENTITY % para SYSTEM "para">
11059     %para;
11060     <!ENTITY c "&entity;">
11061     <!ATTLIST p a CDATA "&c;">
11062     ]>
11063     <p g="h"/>
11064     @@@test:domTree:
11065     document {
11066     document-type { }
11067     element {
11068     attribute {
11069     node-name: 'g';
11070     text-content: 'h';
11071     }
11072     }
11073     }
11074     @@XMLTest:
11075     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.standalone.5.test
11076     @@@DEnt:
11077     @@@@test:value:
11078     <?xml version="1.0" standalone="yes"?>
11079     <!DOCTYPE p SYSTEM "dtd" [
11080     <!ENTITY c "&entity;">
11081     <!ATTLIST p a CDATA "&c;">
11082     ]>
11083     <p/>
11084     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11085     @@XMLTest:
11086     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.standalone.-5.test
11087     @@@DEnt:
11088     @@@@test:value:
11089     <?xml version="1.0" standalone="no"?>
11090     <!DOCTYPE p SYSTEM "dtd" [
11091     <!ENTITY c "&entity;">
11092     <!ATTLIST p a CDATA "&c;">
11093     ]>
11094     <p/>
11095     @@@test:domTree:
11096     document {
11097     document-type { }
11098     element {
11099     attribute {
11100     node-name: 'a';
11101     specified: false;
11102     general-entity-reference {
11103     node-name: 'c';
11104     is-expanded: true;
11105     general-entity-reference {
11106     node-name: 'entity';
11107     is-expanded: false;
11108     }
11109     }
11110     }
11111     }
11112     }
11113     @@XMLTest:
11114     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.standalone.-6.test
11115     @@@DEnt:
11116     @@@@test:value:
11117     <!DOCTYPE p SYSTEM "dtd" [<!ENTITY c "&entity;">
11118     <!ATTLIST p a CDATA "&c;">
11119     ]>
11120     <p/>
11121     @@@test:domTree:
11122     document {
11123     document-type { }
11124     element {
11125     attribute {
11126     node-name: 'a';
11127     specified: false;
11128     general-entity-reference {
11129     node-name: 'c';
11130     is-expanded: true;
11131     general-entity-reference {
11132     node-name: 'entity';
11133     is-expanded: false;
11134     }
11135     }
11136     }
11137     }
11138     }
11139    
11140     @@XMLTest:
11141     @@@QName: xp.attlist.attval.ger.entity.declared.nopref.1.test
11142     @@@DEnt:
11143     @@@@test:value:
11144     <!DOCTYPE p [
11145     <!ATTLIST p a CDATA "&entity;">
11146     ]>
11147     <p/>
11148     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 22)..(2, 29); }
11149     @@XMLTest:
11150     @@@QName: xp.attlist.attval.ger.entity.declared.nopref.2.test
11151     @@@DEnt:
11152     @@@@test:value:
11153     <!DOCTYPE p [
11154     <!ENTITY other "aa">
11155     <!ENTITY % another "aa">
11156     <!ATTLIST p a CDATA "&entity;">
11157     ]>
11158     <p/>
11159     @@@c:erred: <[[xp|wf-entity-declared]]> { (4, 22)..(4, 29); }
11160     @@XMLTest:
11161     @@@QName: xp.attlist.attval.ger.entity.declared.nopref.3.test
11162     @@@DEnt:
11163     @@@@test:value:
11164     <?xml version="1.0" standalone="yes"?>
11165     <!DOCTYPE p [
11166     <!ATTLIST p a CDATA "&entity;">
11167     ]>
11168     <p/>
11169     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 22)..(3, 29); }
11170     @@XMLTest:
11171     @@@QName: xp.attlist.attval.ger.entity.declared.nopref.4.test
11172     @@@DEnt:
11173     @@@@test:value:
11174     <?xml version="1.0" standalone="no"?>
11175     <!DOCTYPE p [
11176     <!ATTLIST p a CDATA "&entity;">
11177     ]>
11178     <p/>
11179     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 22)..(3, 29); }
11180     @@XMLTest:
11181     @@@QName: xp.attlist.attval.ger.entity.declared.nopref.5.test
11182     @@@DEnt:
11183     @@@@test:value:
11184     <?xml version="1.0" standalone="yes"?>
11185     <!DOCTYPE p [
11186     <!ENTITY other "aa">
11187     <!ENTITY % another "aa">
11188     <!ATTLIST p a CDATA "&entity;">
11189     ]>
11190     <p/>
11191     @@@c:erred: <[[xp|wf-entity-declared]]> { (5, 22)..(5, 29); }
11192     @@XMLTest:
11193     @@@QName: xp.attlist.attval.ger.entity.declared.nopref.6.test
11194     @@@DEnt:
11195     @@@@test:value:
11196     <?xml version="1.0" standalone="no"?>
11197     <!DOCTYPE p [
11198     <!ENTITY other "aa">
11199     <!ENTITY % another "aa">
11200     <!ATTLIST p a CDATA "&entity;">
11201     ]>
11202     <p/>
11203     @@@c:erred: <[[xp|wf-entity-declared]]> { (5, 22)..(5, 29); }
11204     @@XMLTest:
11205     @@@QName: xp.attlist.attval.ger.entity.declared.nopref.-1.test
11206     @@@DEnt:
11207     @@@@test:value:
11208     <!DOCTYPE p [
11209     <!ENTITY entity "value">
11210     <!ATTLIST p a CDATA "&entity;">
11211     ]>
11212     <p/>
11213     @@@test:domTree:
11214     document {
11215     document-type {
11216     general-entity {
11217     node-name: 'entity';
11218     text-content: 'value';
11219     }
11220     element-type-definition {
11221     node-name: 'p';
11222     attribute-definition {
11223     node-name: 'a';
11224     general-entity-reference {
11225     node-name: 'entity';
11226     is-expanded: true;
11227     text-content: 'value';
11228     }
11229     }
11230     }
11231     }
11232     element {
11233     attribute {
11234     node-name: 'a';
11235     specified: false;
11236     general-entity-reference {
11237     node-name: 'entity';
11238     is-expanded: true;
11239     text-content: 'value';
11240     }
11241     }
11242     }
11243     }
11244     @@XMLTest:
11245     @@@QName: xp.attlist.attval.ger.entity.declared.nopref.-1.2.test
11246     @@@DEnt:
11247     @@@@test:value:
11248     <!DOCTYPE p [
11249     <!ATTLIST p a CDATA "&entity;">
11250     <!ENTITY entity "value">
11251     ]>
11252     <p/>
11253     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 22)..(2, 29); }
11254     @@XMLTest:
11255     @@@QName: xp.attlist.attval.ger.entity.declared.nopref.-2.test
11256     @@@DEnt:
11257     @@@@test:value:
11258     <!DOCTYPE p [
11259     <!ENTITY entity "value">
11260     <!ENTITY another SYSTEM "another">
11261     <!ATTLIST p a CDATA "&entity;">
11262     ]>
11263     <p/>
11264     @@@test:domTree:
11265     document {
11266     document-type {
11267     element-type-definition {
11268     node-name: 'p';
11269     attribute-definition {
11270     node-name: 'a';
11271     general-entity-reference {
11272     node-name: 'entity';
11273     is-expanded: true;
11274     text-content: 'value';
11275     }
11276     }
11277     }
11278     general-entity {
11279     node-name: 'entity';
11280     text-content: 'value';
11281     has-replacement-tree: true;
11282     }
11283     general-entity {
11284     node-name: 'another';
11285     public-id: null;
11286     system-id: 'another';
11287     has-replacement-tree: false;
11288     }
11289     }
11290     element {
11291     attribute {
11292     node-name: 'a';
11293     specified: false;
11294     general-entity-reference {
11295     node-name: 'entity';
11296     is-expanded: true;
11297     text-content: 'value';
11298     }
11299     }
11300     }
11301     }
11302     @@XMLTest:
11303     @@@QName: xp.attlist.attval.ger.entity.declared.nopref.-2.2.test
11304     @@@DEnt:
11305     @@@@test:value:
11306     <!DOCTYPE p [
11307     <!ATTLIST p a CDATA "&entity;">
11308     <!ENTITY entity "value">
11309     <!ENTITY another SYSTEM "another">
11310     ]>
11311     <p/>
11312     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 22)..(2, 29); }
11313     @@XMLTest:
11314     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.2.test
11315     @@@DEnt:
11316     @@@@test:value:
11317     <?xml version="1.0" standalone="yes"?>
11318     <!DOCTYPE p [
11319     <!ATTLIST p a CDATA "&entity;">
11320     ]>
11321     <p/>
11322     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 22)..(3, 29); }
11323     @@XMLTest:
11324     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.3.test
11325     @@@DEnt:
11326     @@@@test:value:
11327     <?xml version="1.0" standalone="yes"?>
11328     <!DOCTYPE p [
11329     <!ATTLIST p a CDATA "&entity;">
11330     <!ENTITY % para "<!-- -->">
11331     %para;
11332     ]>
11333     <p/>
11334     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 22)..(3, 29); }
11335     @@XMLTest:
11336     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.3.2.test
11337     @@@DEnt:
11338     @@@@test:value:
11339     <?xml version="1.0" standalone="yes"?>
11340     <!DOCTYPE p [
11341     <!ENTITY % para "<!-- -->">
11342     %para;
11343     <!ATTLIST p a CDATA "&entity;">
11344     ]>
11345     <p/>
11346     @@@c:erred: <[[xp|wf-entity-declared]]> { (5, 22)..(5, 29); }
11347     @@@enImplNote:
11348     The <XML::ATTLIST> declaration is processed since
11349     it is a <XA::standalone> document.
11350     @@XMLTest:
11351     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.-1.test
11352     @@@DEnt:
11353     @@@@test:value:
11354     <?xml version="1.0" standalone="no"?>
11355     <!DOCTYPE p [
11356     <!ATTLIST p a CDATA "&entity;">
11357     <!ENTITY % para "<!-- -->">
11358     %para;
11359     ]>
11360     <p/>
11361     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 22)..(3, 29); }
11362     @@XMLTest:
11363     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.-1.2.test
11364     @@@DEnt:
11365     @@@@test:value:
11366     <?xml version="1.0" standalone="no"?>
11367     <!DOCTYPE p [
11368 wakaba 1.25 <!ATTLIST p b CDATA #IMPLIED>
11369 wakaba 1.21 <!ENTITY % para "<!-- -->">
11370     %para;
11371     <!ATTLIST p a CDATA "&entity;">
11372     ]>
11373     <p c="d"/>
11374 wakaba 1.25 @@@c:erred:
11375     <[[xp|warning-attribute-definition-not-processed]]> { (6, 13)..(6, 30); }
11376 wakaba 1.21 @@@test:domTree:
11377     document {
11378     document-type {
11379     element-type-definition {
11380 wakaba 1.25 node-name: 'p';
11381 wakaba 1.21 attribute-definition {
11382     node-name: 'b';
11383     }
11384     }
11385     }
11386     element {
11387     attribute {
11388     node-name: 'c';
11389     text-content: 'd';
11390     }
11391     }
11392     }
11393     @@@enImplNote:
11394     The second <XML::ATTLIST> declaration is read but not processed
11395     and its <XML::&entity;> general entity reference violates
11396     entity declared validty constraint rather than well-formedness
11397     constraint.
11398     @@XMLTest:
11399     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.-2.test
11400     @@@DEnt:
11401     @@@@test:value:
11402     <!DOCTYPE p [
11403     <!ATTLIST p a CDATA "&entity;">
11404     <!ENTITY % para "<!-- -->">
11405     %para;
11406     ]>
11407     <p/>
11408     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 22)..(2, 29); }
11409     @@XMLTest:
11410     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.-2.2.test
11411     @@@DEnt:
11412     @@@@test:value:
11413     <!DOCTYPE p [
11414 wakaba 1.25 <!ATTLIST p b CDATA #IMPLIED>
11415 wakaba 1.21 <!ENTITY % para "<!-- -->">
11416     %para;
11417     <!ATTLIST p a CDATA "&entity;">
11418     ]>
11419     <p c="d"/>
11420 wakaba 1.25 @@@c:erred:
11421     <[[xp|warning-attribute-definition-not-processed]]> { (5, 13)..(5, 30); }
11422 wakaba 1.21 @@@test:domTree:
11423     document {
11424     document-type {
11425     element-type-definition {
11426 wakaba 1.25 node-name: 'p';
11427 wakaba 1.21 attribute-definition {
11428     node-name: 'b';
11429     }
11430     }
11431     }
11432     element {
11433     attribute {
11434     node-name: 'c';
11435     text-content: 'd';
11436     }
11437     }
11438     }
11439     @@XMLTest:
11440     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.4.test
11441     @@@DEnt:
11442     @@@@test:value:
11443     <?xml version="1.0" standalone="yes"?>
11444     <!DOCTYPE p [
11445     <!ATTLIST p a CDATA "&entity;">
11446     <!ENTITY % para SYSTEM "p">
11447     %para;
11448     ]>
11449     <p/>
11450     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 22)..(3, 29); }
11451     @@XMLTest:
11452     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.4.2.test
11453     @@@DEnt:
11454     @@@@test:value:
11455     <?xml version="1.0" standalone="yes"?>
11456     <!DOCTYPE p [
11457     <!ENTITY % para SYSTEM "p">
11458     %para;
11459     <!ATTLIST p a CDATA "&entity;">
11460     ]>
11461     <p/>
11462     @@@c:erred: <[[xp|wf-entity-declared]]> { (5, 22)..(5, 29); }
11463     @@@enImplNote:
11464     The <XML::ATTLIST> declaration is processed since
11465     it is a <XA::standalone> document.
11466     @@XMLTest:
11467     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.-3.test
11468     @@@DEnt:
11469     @@@@test:value:
11470     <?xml version="1.0" standalone="no"?>
11471     <!DOCTYPE p [
11472     <!ATTLIST p a CDATA "&entity;">
11473     <!ENTITY % para SYSTEM "p">
11474     %para;
11475     ]>
11476     <p/>
11477     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 22)..(3, 29); }
11478     @@@enImplNote:
11479     Is this well-formed? It has a parameter entity reference,
11480     therefore, it does not violates Entity Declared WFC, isn't it?
11481    
11482     Note that Firefox 1.5 and Opera 9 TP1 reports that this document has a
11483     fatal error (also note that they does not support unexpanded).
11484    
11485     See also:
11486     <URI::http://suika.fam.cx/gate/2005/sw/%E5%B1%9E%E6%80%A7%E5%80%A4%E8%A1%A8%E8%A8%98#anchor-8>
11487     @@XMLTest:
11488     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.-3.2.test
11489     @@@DEnt:
11490     @@@@test:value:
11491     <?xml version="1.0" standalone="no"?>
11492     <!DOCTYPE p [
11493 wakaba 1.25 <!ATTLIST p b CDATA #IMPLIED>
11494 wakaba 1.21 <!ENTITY % para SYSTEM "p">
11495     %para;
11496     <!ATTLIST p a CDATA "&entity;">
11497     ]>
11498     <p c="d"/>
11499 wakaba 1.25 @@@c:erred:
11500     <[[xp|warning-attribute-definition-not-processed]]> { (6, 13)..(6, 30); }
11501 wakaba 1.21 @@@test:domTree:
11502     document {
11503     document-type {
11504     element-type-definition {
11505 wakaba 1.25 node-name: 'p';
11506 wakaba 1.21 attribute-definition {
11507     node-name: 'b';
11508     }
11509     }
11510     }
11511     element {
11512     attribute {
11513     node-name: 'c';
11514     text-content: 'd';
11515     }
11516     }
11517     }
11518     @@@enImplNote:
11519     The second <XML::ATTLIST> declaration is read but not processed
11520     and its <XML::&entity;> general entity reference violates
11521     entity declared validty constraint rather than well-formedness
11522     constraint.
11523     @@XMLTest:
11524     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.-4.test
11525     @@@DEnt:
11526     @@@@test:value:
11527     <!DOCTYPE p [
11528     <!ATTLIST p a CDATA "&entity;">
11529     <!ENTITY % para SYSTEM "p">
11530     %para;
11531     ]>
11532     <p/>
11533     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 22)..(2, 29); }
11534     @@XMLTest:
11535     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.-4.2.test
11536     @@@DEnt:
11537     @@@@test:value:
11538     <!DOCTYPE p [
11539 wakaba 1.25 <!ATTLIST p b CDATA #IMPLIED>
11540 wakaba 1.21 <!ENTITY % para SYSTEM "p">
11541     %para;
11542     <!ATTLIST p a CDATA "&entity;">
11543     ]>
11544     <p c="d"/>
11545 wakaba 1.25 @@@c:erred:
11546     <[[xp|warning-attribute-definition-not-processed]]> { (5, 13)..(5, 30); }
11547 wakaba 1.21 @@@test:domTree:
11548     document {
11549     document-type {
11550     element-type-definition {
11551 wakaba 1.25 node-name: 'p';
11552 wakaba 1.21 attribute-definition {
11553     node-name: 'b';
11554     }
11555     }
11556     }
11557     element {
11558     attribute {
11559     node-name: 'c';
11560     text-content: 'd';
11561     }
11562     }
11563     }
11564     @@XMLTest:
11565     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.5.test
11566     @@@DEnt:
11567     @@@@test:value:
11568     <?xml version="1.0" standalone="yes"?>
11569     <!DOCTYPE p SYSTEM "dtd" [
11570     <!ATTLIST p a CDATA "&entity;">
11571     ]>
11572     <p/>
11573     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 22)..(3, 29); }
11574     @@@enImplNote:
11575     This document has an error - result is implementation dependent.
11576     @@XMLTest:
11577     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.-5.test
11578     @@@DEnt:
11579     @@@@test:value:
11580     <?xml version="1.0" standalone="no"?>
11581     <!DOCTYPE p SYSTEM "dtd" [
11582     <!ATTLIST p a CDATA "&entity;">
11583     ]>
11584     <p/>
11585     @@@test:domTree:
11586     document {
11587     document-type {
11588     element-type-definition {
11589     node-name: 'p';
11590     attribute-definition {
11591     node-name: 'a';
11592     general-entity-reference {
11593     node-name: 'entity';
11594     is-expanded: false;
11595     }
11596     }
11597     }
11598     }
11599     element {
11600     attribute {
11601     node-name: 'a';
11602     specified: false;
11603     general-entity-reference {
11604     node-name: 'entity';
11605     is-expanded: false;
11606     }
11607     }
11608     }
11609     }
11610     @@@enImplNote:
11611     This document has an error - result is implementation dependent.
11612     @@XMLTest:
11613     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.-6.test
11614     @@@DEnt:
11615     @@@@test:value:
11616     <!DOCTYPE p SYSTEM "dtd" [
11617     <!ATTLIST p a CDATA "&entity;">
11618     ]>
11619     <p/>
11620     @@@test:domTree:
11621     document {
11622     document-type {
11623     element-type-definition {
11624     node-name: 'p';
11625     attribute-definition {
11626     node-name: 'a';
11627     general-entity-reference {
11628     node-name: 'entity';
11629     is-expanded: false;
11630     }
11631     }
11632     }
11633     }
11634     element {
11635     attribute {
11636     node-name: 'a';
11637     specified: false;
11638     general-entity-reference {
11639     node-name: 'entity';
11640     is-expanded: false;
11641     }
11642     }
11643     }
11644     }
11645     @@@enImplNote:
11646     This document has an error - result is implementation dependent.
11647    
11648 wakaba 1.19 @@enImplNote:
11649     {TODO:: Entity declared WFC for
11650 wakaba 1.20
11651     - General entity references in entity value??
11652 wakaba 1.19
11653     }
11654    
11655 wakaba 1.23 @@XMLTest:
11656     @@@QName: xp.element.content.parsed.entity.reference.test
11657     @@@DEnt:
11658     @@@@test:value:
11659     <!DOCTYPE p [
11660     <!NOTATION n SYSTEM "notation">
11661     <!ENTITY ext SYSTEM "system" NDATA n>
11662     ]>
11663     <p>&ext;</p>
11664     @@@c:erred: <[[xp|wf-parsed-entity]]> { (5, 4)..(5, 8); }
11665     @@XMLTest:
11666     @@@QName: xp.attval.parsed.entity.reference.test
11667     @@@DEnt:
11668     @@@@test:value:
11669     <!DOCTYPE p [
11670     <!NOTATION n SYSTEM "notation">
11671     <!ENTITY ext SYSTEM "system" NDATA n>
11672     ]>
11673     <p a="&ext;"/>
11674     # @@@c:erred: <[[xp|wf-parsed-entity]]> { (5, 7)..(5, 11); }
11675     @@@c:erred: <[[xp|wf-no-external-entity-references]]> { (5, 7)..(5, 11); }
11676     @@XMLTest:
11677     @@@QName: xp.element.content.reptxt.parsed.entity.reference.test
11678     @@@DEnt:
11679     @@@@test:value:
11680     <!DOCTYPE p [
11681     <!NOTATION n SYSTEM "notation">
11682     <!ENTITY ext SYSTEM "system" NDATA n>
11683     <!ENTITY c "&#x26;ext;">
11684     ]>
11685     <p>&c;</p>
11686     @@@c:erred: <[[xp|wf-parsed-entity]]> { (1, 1)..(1, 5); }
11687     @@XMLTest:
11688     @@@QName: xp.attval.reptxt.parsed.entity.reference.test
11689     @@@DEnt:
11690     @@@@test:value:
11691     <!DOCTYPE p [
11692     <!NOTATION n SYSTEM "notation">
11693     <!ENTITY ext SYSTEM "system" NDATA n>
11694     <!ENTITY c "&#x26;ext;">
11695     ]>
11696     <p a="&c;"/>
11697     @@@c:erred: <[[xp|wf-no-external-entity-references]]> { (1, 1)..(1, 5); }
11698     @@@c:erred:
11699     @@@@@: <[[xp|wf-parsed-entity]]> { }
11700     @@@@enImplNote: During entity node construction.
11701     @@XMLTest:
11702     @@@QName: xp.element.content.entval.parsed.entity.reference.test
11703     @@@DEnt:
11704     @@@@test:value:
11705     <!DOCTYPE p [
11706     <!NOTATION n SYSTEM "notation">
11707     <!ENTITY ext SYSTEM "system" NDATA n>
11708     <!ENTITY c "&ext;">
11709     ]>
11710     <p>&c;</p>
11711     @@@c:erred: <[[xp|wf-parsed-entity]]> { }
11712     @@XMLTest:
11713     @@@QName: xp.attval.entval.parsed.entity.reference.test
11714     @@@DEnt:
11715     @@@@test:value:
11716     <!DOCTYPE p [
11717     <!NOTATION n SYSTEM "notation">
11718     <!ENTITY ext SYSTEM "system" NDATA n>
11719     <!ENTITY c "&ext;">
11720     ]>
11721     <p a="&c;"/>
11722     @@@c:erred: <[[xp|wf-no-external-entity-references]]> { }
11723     @@@c:erred: <[[xp|wf-parsed-entity]]> { }
11724    
11725     @@XMLTest:
11726     @@@QName: xp.element.content.no.recursion.direct.test
11727     @@@DEnt:
11728     @@@@test:value:
11729     <!DOCTYPE p [
11730     <!ENTITY c "&c;">
11731     ]>
11732     <p>&c;</p>
11733     @@@c:erred: <[[xp|wf-no-recursion]]> { (1, 1)..(1, 3); }
11734     @@XMLTest:
11735     @@@QName: xp.element.content.no.recursion.indirect.test
11736     @@@DEnt:
11737     @@@@test:value:
11738     <!DOCTYPE p [
11739     <!ENTITY d "&c;">
11740     <!ENTITY c "&d;">
11741     ]>
11742     <p>&c;</p>
11743     @@@c:erred: <[[xp|wf-no-recursion]]> { /* |d| */ (1, 1)..(1, 3); }
11744     @@XMLTest:
11745     @@@QName: xp.attval.no.recursion.direct.test
11746     @@@DEnt:
11747     @@@@test:value:
11748     <!DOCTYPE p [
11749     <!ENTITY c "&c;">
11750     ]>
11751     <p a="&c;"/>
11752     @@@c:erred: <[[xp|wf-no-recursion]]> { (1, 1)..(1, 3); }
11753     @@XMLTest:
11754     @@@QName: xp.attval.no.recursion.indirect.test
11755     @@@DEnt:
11756     @@@@test:value:
11757     <!DOCTYPE p [
11758     <!ENTITY d "&c;">
11759     <!ENTITY c "&d;">
11760     ]>
11761     <p a="&c;"/>
11762     @@@c:erred: <[[xp|wf-no-recursion]]> { /* |d| */ (1, 1)..(1, 3); }
11763     @@XMLTest:
11764     @@@QName: xp.reptxt.element.content.no.recursion.direct.test
11765     @@@DEnt:
11766     @@@@test:value:
11767     <!DOCTYPE p [
11768     <!ENTITY c "&c;">
11769     <!ENTITY e "&#x26;c;">
11770     ]>
11771     <p>&e;</p>
11772     @@@c:erred: <[[xp|wf-no-recursion]]> { /* |e| */ (1, 1)..(1, 3); }
11773     @@XMLTest:
11774     @@@QName: xp.reptxt.element.content.no.recursion.indirect.test
11775     @@@DEnt:
11776     @@@@test:value:
11777     <!DOCTYPE p [
11778     <!ENTITY d "&c;">
11779     <!ENTITY c "&d;">
11780     <!ENTITY e "&#x26;c;">
11781     ]>
11782     <p>&e;</p>
11783     @@@c:erred: <[[xp|wf-no-recursion]]> { /* |d| */ (1, 1)..(1, 3); }
11784     @@XMLTest:
11785     @@@QName: xp.reptxt.attval.no.recursion.direct.test
11786     @@@DEnt:
11787     @@@@test:value:
11788     <!DOCTYPE p [
11789     <!ENTITY c "&c;">
11790     <!ENTITY e "&#x26;c;">
11791     ]>
11792     <p a="&e;"/>
11793     @@@c:erred: <[[xp|wf-no-recursion]]> { /* |e| */ (1, 1)..(1, 3); }
11794     @@XMLTest:
11795     @@@QName: xp.reptxt.attval.no.recursion.indirect.test
11796     @@@DEnt:
11797     @@@@test:value:
11798     <!DOCTYPE p [
11799     <!ENTITY d "&c;">
11800     <!ENTITY c "&d;">
11801     <!ENTITY e "&#x26;c;">
11802     ]>
11803     <p a="&e;"/>
11804     @@@c:erred: <[[xp|wf-no-recursion]]> { /* |d| */ (1, 1)..(1, 3); }
11805    
11806     @@XMLTest:
11807     @@@QName: xp.ENTITY.system.ndata.name.test
11808     @@@DEnt:
11809     @@@@test:value:
11810     <!DOCTYPE a [
11811     <!NOTATION n SYSTEM "n">
11812     <!ENTITY % e SYSTEM "sys" NDATA n>
11813     ]><a/>
11814     @@@c:erred: <[[xp|wf-syntax-error]]> { (3, 26)..(3, 30); }
11815     @@XMLTest:
11816     @@@QName: xp.ENTITY.public.ndata.name.test
11817     @@@DEnt:
11818     @@@@test:value:
11819     <!DOCTYPE a [
11820     <!NOTATION n SYSTEM "n">
11821     <!ENTITY % e PUBLIC "pub" "sys" NDATA n>
11822     ]><a/>
11823     @@@c:erred: <[[xp|wf-syntax-error]]> { (3, 33)..(3, 37); }
11824     @@XMLTest:
11825     @@@QName: xp.ENTITY.public.ndata.name.-1.test
11826     @@@DEnt:
11827     @@@@test:value:
11828     <!DOCTYPE a [
11829     <!NOTATION n SYSTEM "n">
11830     <!ENTITY % e PUBLIC "pub" "sys" >
11831     ]><a/>
11832     @@@test:domTree:
11833     document { }
11834    
11835     @@XMLTest:
11836     @@@QName: xp.ENTITY.pubid.1.test
11837     @@@DEnt:
11838     @@@@test:value:
11839     <!DOCTYPE a [
11840     <!ENTITY e PUBLIC "p" "s">
11841     ]><a/>
11842     @@@test:domTree:
11843     document {
11844     document-type {
11845     general-entity {
11846     node-name: 'e';
11847     public-id: 'p';
11848     system-id: 's';
11849     }
11850     }
11851     element { }
11852     }
11853     @@XMLTest:
11854     @@@QName: xp.ENTITY.pubid.2.test
11855     @@@DEnt:
11856     @@@@test:value:
11857     <!DOCTYPE a [
11858     <!ENTITY e PUBLIC " p " "s">
11859     ]><a/>
11860     @@@test:domTree:
11861     document {
11862     document-type {
11863     general-entity {
11864     node-name: 'e';
11865     public-id: 'p';
11866     system-id: 's';
11867     }
11868     }
11869     element { }
11870     }
11871     @@XMLTest:
11872     @@@QName: xp.ENTITY.pubid.3.test
11873     @@@DEnt:
11874     @@@@test:value:
11875     <!DOCTYPE a [
11876     <!ENTITY e PUBLIC " p $u000Aq$u000A " "s">
11877     ]><a/>
11878     @@@test:domTree:
11879     document {
11880     document-type {
11881     general-entity {
11882     node-name: 'e';
11883     public-id: 'p q';
11884     system-id: 's';
11885     }
11886     }
11887     element { }
11888     }
11889     @@XMLTest:
11890     @@@QName: xp.ENTITY.pubid.4.test
11891     @@@DEnt:
11892     @@@@test:value:
11893     <!DOCTYPE a [
11894     <!ENTITY e PUBLIC " p $u000D$u000Aq" "s">
11895     ]><a/>
11896     @@@test:domTree:
11897     document {
11898     document-type {
11899     general-entity {
11900     node-name: 'e';
11901     public-id: 'p q';
11902     system-id: 's';
11903     }
11904     }
11905     element { }
11906     }
11907     @@XMLTest:
11908     @@@QName: xp.ENTITY.pubid.5.test
11909     @@@DEnt:
11910     @@@@test:value:
11911     <?xml version="1.1"?>
11912     <!DOCTYPE a [
11913     <!ENTITY e PUBLIC " p $u0085$u000Aq" "s">
11914     ]><a/>
11915     @@@test:domTree:
11916     document {
11917     document-type {
11918     general-entity {
11919     node-name: 'e';
11920     public-id: 'p q';
11921     system-id: 's';
11922     }
11923     }
11924     element { }
11925     }
11926    
11927 wakaba 1.24 @@XMLTest:
11928     @@@QName: xp.ENTITY.ignored.test
11929     @@@DEnt:
11930     @@@@test:value:
11931     <!DOCTYPE a [
11932     <!ENTITY e "a">
11933     <!ENTITY e "b">
11934     ]><a/>
11935     @@@test:domTree:
11936     document {
11937     document-type {
11938     general-entity {
11939     node-name: 'e';
11940     text-content: 'a';
11941     }
11942     }
11943     element { }
11944     }
11945     @@@c:erred:
11946     <[[xp|warning-entity-declaration-ignored]]> { (3, 1)..(3, 15); }
11947     @@XMLTest:
11948     @@@QName: xp.ENTITY.ignored.2.test
11949     @@@DEnt:
11950     @@@@test:value:
11951     <!DOCTYPE a [
11952     <!ENTITY % e "a">
11953     <!ENTITY % e "b">
11954     ]><a/>
11955     @@@test:domTree:
11956     document { }
11957     @@@c:erred:
11958     <[[xp|warning-entity-declaration-ignored]]> { (3, 1)..(3, 17); }
11959    
11960     @@XMLTest:
11961     @@@QName: xp.ENTITY.predefined.1.test
11962     @@@DEnt:
11963     @@@@test:value:
11964     <!DOCTYPE a [
11965     <!ENTITY lt "&#38;#60;">
11966     <!ENTITY gt "&#62;">
11967     <!ENTITY amp "&#38;#38;">
11968     <!ENTITY apos "&#39;">
11969     <!ENTITY quot "&#34;">
11970     <!ENTITY e "f">
11971     ]><a>&lt;&gt;&amp;&apos;&quot;</a>
11972     @@@test:domTree:
11973     document {
11974     document-type {
11975     general-entity {
11976     node-name: 'e';
11977     text-content: 'f';
11978     }
11979     }
11980     element {
11981     text-content: '<>&' U+0027 '"';
11982     }
11983     }
11984     @@XMLTest:
11985     @@@QName: xp.ENTITY.predefined.2.test
11986     @@@DEnt:
11987     @@@@test:value:
11988     <!DOCTYPE a [
11989     <!ENTITY lt "&#38;#60;">
11990     <!ENTITY gt "&#x26;#62;">
11991     <!ENTITY amp "&#38;#38;">
11992     <!ENTITY apos "&#x26;#39;">
11993     <!ENTITY quot "&#x26;#34;">
11994     <!ENTITY e "f">
11995     ]><a>&lt;&gt;&amp;&apos;&quot;</a>
11996     @@@test:domTree:
11997     document {
11998     document-type {
11999     general-entity {
12000     node-name: 'e';
12001     text-content: 'f';
12002     }
12003     }
12004     element {
12005     text-content: '<>&' U+0027 '"';
12006     }
12007     }
12008     @@XMLTest:
12009     @@@QName: xp.ENTITY.predefined.3.test
12010     @@@DEnt:
12011     @@@@test:value:
12012     <!DOCTYPE a [
12013     <!ENTITY lt "&#60;">
12014     <!ENTITY gt "&#62;">
12015     <!ENTITY amp "&#38;">
12016     <!ENTITY apos "&#39;">
12017     <!ENTITY quot "&#34;">
12018     <!ENTITY e "f">
12019     ]><a>&lt;&gt;&amp;&apos;&quot;</a>
12020     @@@c:erred: <[[xp|error-malformed-predefined-entity]]> { (2, 1)..(2, 24); }
12021     @@@c:erred: <[[xp|error-malformed-predefined-entity]]> { (4, 1)..(4, 24); }
12022     @@@test:domTree:
12023     document {
12024     document-type {
12025     general-entity {
12026     node-name: 'e';
12027     text-content: 'f';
12028     }
12029     }
12030     element {
12031     text-content: '<>&' U+0027 '"';
12032     }
12033     }
12034     @@XMLTest:
12035     @@@QName: xp.ENTITY.predefined.4.test
12036     @@@DEnt:
12037     @@@@test:value:
12038     <!DOCTYPE a [
12039     <!ENTITY lt "1">
12040     <!ENTITY gt "2">
12041     <!ENTITY amp "3">
12042     <!ENTITY apos "4">
12043     <!ENTITY quot "5">
12044     <!ENTITY e "f">
12045     ]><a>&lt;&gt;&amp;&apos;&quot;</a>
12046     @@@c:erred: <[[xp|error-malformed-predefined-entity]]> { (2, 1)..(2, 24); }
12047     @@@c:erred: <[[xp|error-malformed-predefined-entity]]> { (3, 1)..(3, 24); }
12048     @@@c:erred: <[[xp|error-malformed-predefined-entity]]> { (4, 1)..(4, 24); }
12049     @@@c:erred: <[[xp|error-malformed-predefined-entity]]> { (5, 1)..(5, 24); }
12050     @@@c:erred: <[[xp|error-malformed-predefined-entity]]> { (6, 1)..(6, 24); }
12051     @@@test:domTree:
12052     document {
12053     document-type {
12054     general-entity {
12055     node-name: 'e';
12056     text-content: 'f';
12057     }
12058     }
12059     element {
12060     text-content: '<>&' U+0027 '"';
12061     }
12062     }
12063     @@XMLTest:
12064     @@@QName: xp.ENTITY.predefined.5.test
12065     @@@DEnt:
12066     @@@@test:value:
12067     <!DOCTYPE a [
12068     <!ENTITY lt SYSTEM "1">
12069     <!ENTITY gt SYSTEM "2">
12070     <!ENTITY amp SYSTEM "3">
12071     <!ENTITY apos SYSTEM "4">
12072     <!ENTITY quot SYSTEM "5">
12073     <!ENTITY e "f">
12074     ]><a>&lt;&gt;&amp;&apos;&quot;</a>
12075     @@@c:erred: <[[xp|error-internal-predefined-entity]]> { (2, 1)..(2, 27); }
12076     @@@c:erred: <[[xp|error-internal-predefined-entity]]> { (3, 1)..(3, 27); }
12077     @@@c:erred: <[[xp|error-internal-predefined-entity]]> { (4, 1)..(4, 27); }
12078     @@@c:erred: <[[xp|error-internal-predefined-entity]]> { (5, 1)..(5, 27); }
12079     @@@c:erred: <[[xp|error-internal-predefined-entity]]> { (6, 1)..(6, 27); }
12080     @@@test:domTree:
12081     document {
12082     document-type {
12083     general-entity {
12084     node-name: 'e';
12085     text-content: 'f';
12086     }
12087     }
12088     element {
12089     text-content: '<>&' U+0027 '"';
12090     }
12091     }
12092     @@XMLTest:
12093     @@@QName: xp.ENTITY.predefined.6.test
12094     @@@DEnt:
12095     @@@@test:value:
12096     <!DOCTYPE a [
12097     <!ENTITY % lt SYSTEM "1">
12098     <!ENTITY % gt SYSTEM "2">
12099     <!ENTITY % amp SYSTEM "3">
12100     <!ENTITY % apos SYSTEM "4">
12101     <!ENTITY % quot SYSTEM "5">
12102     <!ENTITY e "f">
12103     ]><a>&lt;&gt;&amp;&apos;&quot;</a>
12104     @@@test:domTree:
12105     document {
12106     document-type {
12107     general-entity {
12108     node-name: 'e';
12109     text-content: 'f';
12110     }
12111     }
12112     element {
12113     text-content: '<>&' U+0027 '"';
12114     }
12115     }
12116     @@XMLTest:
12117     @@@QName: xp.ENTITY.predefined.7.test
12118     @@@DEnt:
12119     @@@@test:value:
12120     <!DOCTYPE a [
12121     <!ENTITY lt "&#38;#x3C;">
12122     <!ENTITY gt "&#x3E;">
12123     <!ENTITY amp "&#38;#x26;">
12124     <!ENTITY apos "&#x27;">
12125     <!ENTITY quot "&#x22;">
12126     <!ENTITY e "f">
12127     ]><a>&lt;&gt;&amp;&apos;&quot;</a>
12128     @@@test:domTree:
12129     document {
12130     document-type {
12131     general-entity {
12132     node-name: 'e';
12133     text-content: 'f';
12134     }
12135     }
12136     element {
12137     text-content: '<>&' U+0027 '"';
12138     }
12139     }
12140     @@XMLTest:
12141     @@@QName: xp.ENTITY.predefined.8.test
12142     @@@DEnt:
12143     @@@@test:value:
12144     <!DOCTYPE a [
12145     <!ENTITY lt "&#38;#x3c;">
12146     <!ENTITY gt "&#x3e;">
12147     <!ENTITY amp "&#38;#x26;">
12148     <!ENTITY apos "&#x27;">
12149     <!ENTITY quot "&#x22;">
12150     <!ENTITY e "f">
12151     ]><a>&lt;&gt;&amp;&apos;&quot;</a>
12152     @@@test:domTree:
12153     document {
12154     document-type {
12155     general-entity {
12156     node-name: 'e';
12157     text-content: 'f';
12158     }
12159     }
12160     element {
12161     text-content: '<>&' U+0027 '"';
12162     }
12163     }
12164     @@XMLTest:
12165     @@@QName: xp.ENTITY.predefined.9.test
12166     @@@DEnt:
12167     @@@@test:value:
12168     <!DOCTYPE a [
12169     <!ENTITY lt "&#38;#x00003C;">
12170     <!ENTITY gt "&#x0003E;">
12171     <!ENTITY amp "&#38;#x026;">
12172     <!ENTITY apos "&#x000027;">
12173     <!ENTITY quot "&#x0022;">
12174     <!ENTITY e "f">
12175     ]><a>&lt;&gt;&amp;&apos;&quot;</a>
12176     @@@test:domTree:
12177     document {
12178     document-type {
12179     general-entity {
12180     node-name: 'e';
12181     text-content: 'f';
12182     }
12183     }
12184     element {
12185     text-content: '<>&' U+0027 '"';
12186     }
12187     }
12188     @@XMLTest:
12189     @@@QName: xp.ENTITY.predefined.10.test
12190     @@@DEnt:
12191     @@@@test:value:
12192     <!DOCTYPE a [
12193     <!ENTITY lt "&#38;#00060;">
12194     <!ENTITY gt "&#062;">
12195     <!ENTITY amp "&#38;#000038;">
12196     <!ENTITY apos "&#0000039;">
12197     <!ENTITY quot "&#0034;">
12198     <!ENTITY e "f">
12199     ]><a>&lt;&gt;&amp;&apos;&quot;</a>
12200     @@@test:domTree:
12201     document {
12202     document-type {
12203     general-entity {
12204     node-name: 'e';
12205     text-content: 'f';
12206     }
12207     }
12208     element {
12209     text-content: '<>&' U+0027 '"';
12210     }
12211     }
12212    
12213 wakaba 1.25 @@XMLTest:
12214     @@@QName: xp.processed.1.test
12215     @@@DEnt:
12216     @@@@test:value:
12217     <a/>
12218     @@@test:domTree:
12219     document {
12220     all-declarations-processed: true;
12221     element { }
12222     }
12223     @@XMLTest:
12224     @@@QName: xp.processed.2.test
12225     @@@DEnt:
12226     @@@@test:value:
12227     <!DOCTYPE a [
12228     <!ENTITY e "f">
12229     <!ATTLIST a b NMTOKEN " c ">
12230     ]><a>&e;</a>
12231     @@@test:domTree:
12232     document {
12233     document-type {
12234     general-entity {
12235     node-name: 'e';
12236     }
12237     element-type-definition {
12238     node-name: 'a';
12239     attribute-definition {
12240     node-name: 'b';
12241     }
12242     }
12243     }
12244     all-declarations-processed: true;
12245     element {
12246     attribute {
12247     node-name: 'b';
12248     node-value: 'c';
12249     }
12250     text-content: 'f';
12251     }
12252     }
12253     @@XMLTest:
12254     @@@QName: xp.processed.3.test
12255     @@@DEnt:
12256     @@@@test:value:
12257     <!DOCTYPE a [
12258     <!ENTITY % p SYSTEM "p">
12259     %p;
12260     <!ENTITY e "f">
12261     <!ATTLIST a b NMTOKEN " c ">
12262     ]><a d="e">&e;</a>
12263     @@@test:domTree:
12264     document {
12265     document-type { }
12266     all-declarations-processed: false;
12267     element {
12268     attribute {
12269     node-name: 'd';
12270     node-value: 'e';
12271     }
12272     general-entity-reference {
12273     node-name: 'e';
12274     is-expanded: false;
12275     }
12276     }
12277     }
12278     @@@c:erred:
12279     <[[xp|warning-entity-declaration-not-processed]]> { (4, 1)..(4, 20); }
12280     @@@c:erred:
12281     <[[xp|warning-attribute-definition-not-processed]]> { (5, 13)..(5, 31); }
12282     @@XMLTest:
12283     @@@QName: xp.processed.4.test
12284     @@@DEnt:
12285     @@@@test:value:
12286     <?xml version="1.1" standalone="yes"?>
12287     <!DOCTYPE a [
12288     <!ENTITY % p SYSTEM "p">
12289     %p;
12290     <!ENTITY e "f">
12291     <!ATTLIST a b NMTOKEN " c ">
12292     ]><a>&e;</a>
12293     @@@test:domTree:
12294     document {
12295     document-type {
12296     general-entity {
12297     node-name: 'e';
12298     }
12299     element-type-definition {
12300     node-name: 'a';
12301     attribute-definition {
12302     node-name: 'b';
12303     }
12304     }
12305     }
12306     all-declarations-processed: false;
12307     element {
12308     attribute {
12309     node-name: 'b';
12310     node-value: 'c';
12311     }
12312     text-content: 'f';
12313     }
12314     }
12315     @@XMLTest:
12316     @@@QName: xp.processed.5.test
12317     @@@DEnt:
12318     @@@@test:value:
12319     <!DOCTYPE a SYSTEM "p" [
12320     <!ENTITY e "f">
12321     <!ATTLIST a b NMTOKEN " c ">
12322     ]><a>&e;</a>
12323     @@@test:domTree:
12324     document {
12325     document-type {
12326     general-entity {
12327     node-name: 'e';
12328     }
12329     element-type-definition {
12330     node-name: 'a';
12331     attribute-definition {
12332     node-name: 'b';
12333     }
12334     }
12335     }
12336     all-declarations-processed: false;
12337     element {
12338     attribute {
12339     node-name: 'b';
12340     node-value: 'c';
12341     }
12342     text-content: 'f';
12343     }
12344     }
12345    
12346     @@XMLTest:
12347     @@@QName: xp.PEs.in.internal.subset.1.test
12348     @@@DEnt:
12349     @@@@test:value:
12350     <!DOCTYPE a [
12351     <!ENTITY % p " ">
12352     <!ENTITY % q "%q;">
12353     ]><a/>
12354     @@@c:erred: <[[xp|wf-pes-in-internal-subset]]> { (3, 15)..(3, 17); }
12355     @@XMLTest:
12356     @@@QName: xp.PEs.in.internal.subset.2.test
12357     @@@DEnt:
12358     @@@@test:value:
12359     <!DOCTYPE a [
12360     <!ENTITY % p " ">
12361     <!ENTITY % q '%q;'>
12362     ]><a/>
12363     @@@c:erred: <[[xp|wf-pes-in-internal-subset]]> { (3, 15)..(3, 17); }
12364    
12365 wakaba 1.5 @@PerlDef:
12366     my $impl = $Message::DOM::ImplementationRegistry->get_implementation ({
12367     'Core' => '3.0',
12368     'XML' => '3.0',
12369     'XMLVersion' => ['1.0', '1.1'],
12370     });
12371     my $parser = <Class::ManakaiXMLParser>->new ($impl);
12372    
12373     for my $test_data (@$TestData) {
12374     $test->start_new_test ($test_data->{uri});
12375     my $doc_ent = $test_data->{entity}->{$test_data->{root_uri}};
12376 wakaba 1.14 my $not_ok;
12377 wakaba 1.12
12378     $parser->dom_config->set_parameter ('error-handler' => sub ($$) {
12379     my (undef, $err) = @_;
12380     my $err_type = $err->type;
12381     if ($test_data->{dom_error}->{$err_type}) {
12382     $test->assert_error_equals
12383     (actual_value => $err,
12384 wakaba 1.15 expected_hash => shift @{$test_data->{dom_error}
12385     ->{$err_type}});
12386 wakaba 1.12 } else { # Uncatched error
12387     warn $err;
12388 wakaba 1.14 unless ($err->severity == <C::c|DOMError.SEVERITY_WARNING>) {
12389     $test->failure_comment ('Unexpected error |'.$err->type.'|');
12390     $not_ok = true;
12391     }
12392 wakaba 1.12 }
12393     return true; # continue as far as possible
12394     });
12395    
12396     if ($test_data->{dom_tree}) { # Successful test
12397     try {
12398     my $doc = $parser->parse_string ($doc_ent->{<H::test:value>});
12399     $test->assert_dom_tree_equals
12400     (actual_value => $doc,
12401     expected_hash => $test_data->{dom_tree});
12402     for (values %{$test_data->{dom_error}||{}}) {
12403     if (@$_) {
12404     $test->failure_comment
12405     (@$_.' |DOMError|s of type |'.
12406 wakaba 1.13 $_->[0]->{type}->{value}.'| are not reported');
12407 wakaba 1.14 $not_ok = true;
12408 wakaba 1.12 }
12409     }
12410 wakaba 1.14 $not_ok ? $test->not_ok : $test->ok;
12411 wakaba 1.12 } catch Message::Util::IF::DTException with {
12412     #
12413     } catch Message::DOM::IF::LSException with {
12414 wakaba 1.14 # not_ok
12415     } otherwise {
12416     my $err = shift;
12417     warn $err;
12418     $test->not_ok;
12419 wakaba 1.12 };
12420     } else {
12421     try {
12422     my $doc = $parser->parse_string ($doc_ent->{<H::test:value>});
12423     } catch Message::Util::IF::DTException with {
12424     #
12425     } catch Message::DOM::IF::LSException with {
12426     #
12427 wakaba 1.14 } otherwise {
12428     my $err = shift;
12429     warn $err;
12430     $test->not_ok;
12431 wakaba 1.12 };
12432     for (values %{$test_data->{dom_error}||{}}) {
12433     if (@$_) {
12434     $test->failure_comment
12435     (@$_.' |DOMError|s of type |'.
12436 wakaba 1.13 $_->[0]->{type}->{value}.'| are not reported');
12437 wakaba 1.14 $not_ok = true;
12438 wakaba 1.12 }
12439     }
12440 wakaba 1.14 $not_ok ? $test->not_ok : $test->ok;
12441 wakaba 1.12 }
12442 wakaba 1.5 }
12443 wakaba 1.6
12444     @ResourceDef:
12445 wakaba 1.19 @@QName: getEmptyEntityState
12446     @@rdf:type: DISPerl|InlineCode
12447     @@ForCheck: ManakaiDOM|ForClass
12448     @@PerlDef:
12449     {reptxt => \'', line => 1, column => 1, pos => 0,
12450 wakaba 1.23 is_externally_declared => true, name => $name}
12451 wakaba 1.19
12452     @ResourceDef:
12453 wakaba 1.6 @@QName: getCopyOfEntityState
12454     @@rdf:type: DISPerl|InlineCode
12455     @@ForCheck: ManakaiDOM|ForClass
12456     @@PerlDef:
12457     {%{$self->{$entity_type}->{$entity_name}},
12458     line => 1, column => 1, pos => 0}
12459 wakaba 1.1 ##ManakaiXMLParser
12460 wakaba 1.5
12461     ElementTypeBinding:
12462     @Name: XMLTests
12463     @ElementType:
12464     dis:ResourceDef
12465     @ShadowContent:
12466     @@ForCheck: ManakaiDOM|ForClass
12467     @@rdf:type: test|ParserTestSet
12468    
12469     ElementTypeBinding:
12470     @Name: XMLTest
12471     @ElementType:
12472     dis:ResourceDef
12473     @ShadowContent:
12474     @@ForCheck: ManakaiDOM|ForClass
12475     @@rdf:type: test|ParserTest
12476    
12477     ElementTypeBinding:
12478     @Name: DEnt
12479     @ElementType:
12480     dis:ResourceDef
12481     @ShadowContent:
12482     @@rdf:type: test|RootEntity
12483    
12484     ElementTypeBinding:
12485     @Name: Ent
12486     @ElementType:
12487     dis:ResourceDef
12488     @ShadowContent:
12489     @@rdf:type: test|Entity
12490 wakaba 1.1
12491 wakaba 1.3 ResourceDef:
12492     @QName: xp|get-location-from-token
12493     @rdf:type: DISPerl|BlockCode
12494     @enDesc:
12495     Creates a <IF::DOMCore:DOMLocator> object from a token.
12496     @PerlDef:
12497 wakaba 1.14 my $__d = $token->{type} ne '#EOF'
12498     ? $token->{location}->{char_d}
12499     : 0;
12500 wakaba 1.15 $__d -= $token->{location_d} if $token->{location_d};
12501 wakaba 1.3 $result = {
12502 wakaba 1.14 utf32_offset => $token->{location}->{pos} - $__d,
12503     line_number => $token->{location}->{line},
12504     column_number => $token->{location}->{column} - $__d,
12505 wakaba 1.3 };
12506 wakaba 1.14 $result->{utf32_offset} = 0 if $result->{utf32_offset} < 0;
12507     $result->{column_number} = 0 if $result->{column_number} < 0;
12508     ## 0 or 1, which should be?
12509 wakaba 1.3 @For: ManakaiDOM|ManakaiDOM3
12510 wakaba 1.1
12511     ElementTypeBinding:
12512     @Name: RuleDef
12513     @ElementType:
12514     dis:ResourceDef
12515     @ShadowContent:
12516     @@ForCheck: ManakaiDOM|ForClass
12517     @@rdf:type: Muf2003|RuleDefClass
12518    
12519     ElementTypeBinding:
12520     @Name: RuleParam
12521     @ElementType:
12522     dis:ResourceDef
12523     @ShadowContent:
12524     @@rdf:type: Muf2003|RuleParameter
12525    
12526     ElementTypeBinding:
12527     @Name: enImplNote
12528     @ElementType:
12529     dis:ImplNote
12530     @ShadowContent:
12531     @@lang:en
12532    
12533     ElementTypeBinding:
12534 wakaba 1.24 @Name: WFErrDef
12535 wakaba 1.1 @ElementType:
12536     dis:ResourceDef
12537     @ShadowContent:
12538     @@rdf:type: DOMCore|DOMErrorType
12539     @@For: ManakaiDOM|DOM3
12540     @@ecore:textFormatter: ManakaiXMLParserExceptionFormatter
12541 wakaba 1.24 @@c:severity: c|SEVERITY_FATAL_ERROR
12542 wakaba 1.1
12543 wakaba 1.3 ElementTypeBinding:
12544 wakaba 1.24 @Name: FatalErrDef
12545 wakaba 1.3 @ElementType:
12546     dis:ResourceDef
12547     @ShadowContent:
12548     @@rdf:type: DOMCore|DOMErrorType
12549     @@For: ManakaiDOM|DOM3
12550     @@ecore:textFormatter: ManakaiXMLParserExceptionFormatter
12551 wakaba 1.24 @@c:severity: c|SEVERITY_FATAL_ERROR
12552    
12553     ElementTypeBinding:
12554     @Name: VCErrDef
12555     @ElementType:
12556     dis:ResourceDef
12557     @ShadowContent:
12558     @@rdf:type: c|DOMErrorType
12559     @@For: ManakaiDOM|DOM3
12560     @@ecore:textFormatter: ManakaiXMLParserExceptionFormatter
12561     @@c:severity: c|SEVERITY_ERROR
12562    
12563     ElementTypeBinding:
12564     @Name: ErrDef
12565     @ElementType:
12566     dis:ResourceDef
12567     @ShadowContent:
12568     @@rdf:type: c|DOMErrorType
12569     @@For: ManakaiDOM|DOM3
12570     @@ecore:textFormatter: ManakaiXMLParserExceptionFormatter
12571     @@c:severity: c|SEVERITY_ERROR
12572 wakaba 1.3
12573 wakaba 1.16 ElementTypeBinding:
12574 wakaba 1.24 @Name: WarnDef
12575 wakaba 1.16 @ElementType:
12576     dis:ResourceDef
12577     @ShadowContent:
12578 wakaba 1.24 @@rdf:type: c|DOMErrorType
12579 wakaba 1.16 @@For: ManakaiDOM|DOM3
12580     @@ecore:textFormatter: ManakaiXMLParserExceptionFormatter
12581 wakaba 1.24 @@c:severity: c|SEVERITY_WARNING
12582 wakaba 1.16
12583 wakaba 1.3 WFErrDef:
12584     @QName: xp|wf-syntax-error
12585     @enDesc:
12586     The entity does not match to the production rule; it is not
12587     well-formed.
12588     @enMufDef:
12589     |%xp-error-token-type;|%xp-error-token-value
12590     (prefix => { (|}, suffix => {|)}); is not
12591     allowed%xp-error-lines (prefix => { (|}, suffix => {|)});
12592     @ecore:hasParameter:
12593     @@@: xp|error-token
12594     @@enDesc:
12595     The token that is not allowed.
12596    
12597     WFErrDef:
12598     @QName: xp|wf-pi-target-is-xml
12599     @enDesc:
12600     A processing instruction has its <CODE::PITarget> of
12601     <XML::xml> (in any case) which is not allowed.
12602     @enMufDef:
12603     Processing instruction target name cannot be |%p
12604     (name => {<Q::xp|name>});|
12605     @ecore:hasParameter:
12606     @@@: xp|error-token
12607     @@enDesc:
12608     The token that contains the name.
12609     @ecore:hasParameter:
12610     @@@: xp|name
12611     @@enDesc:
12612     A string that is specified as target name of the
12613     processing instruction.
12614     @ecore:hasParameter: xp|parent
12615    
12616     WFErrDef:
12617     @QName: xp|wf-no-end-tag
12618     @enDesc:
12619     An end-tag is not found.
12620     @enMufDef:
12621     End-tag |</%p (name => {<Q::xp|expected-element-type>});>| is required
12622     @ecore:hasParameter: xp|error-token
12623     @ecore:hasParameter:
12624     @@@: xp|node
12625     @@enDesc:
12626     The element node that is not closed.
12627     @ecore:hasParameter:
12628     @@@: xp|expected-element-type
12629     @@enDesc:
12630     The element type name of the element that is not closed.
12631    
12632     WFErrDef:
12633     @QName: xp|wf-unsupported-xml-version
12634     @enDesc:
12635     The XML version specified in the version declaration is not supported.
12636     @enMufDef:
12637     XML version |%p (name => {<Q::infoset|version>});| is not supported
12638     @ecore:hasParameter: xp|bad-token
12639     @ecore:hasParameter:
12640     @@@: xp|parent
12641     @@enDesc:
12642     The document node.
12643     @ecore:hasParameter:
12644     @@@: infoset|version
12645     @@enDesc:
12646     The specified XML version.
12647    
12648     WFErrDef:
12649     @QName: xp|wf-malformed-enc-name
12650     @enDesc:
12651     An <XA::encoding> pseudo-attribute value does not match
12652     to the procduction rule <CODE::EncName>.
12653     @enMufDef:
12654     Encoding name |%p (name => {<Q::xp|name>});| is not allowed
12655     @ecore:hasParameter: xp|error-token
12656     @ecore:hasParameter:
12657     @@@: xp|parent
12658     @@enDesc: The document node.
12659     @ecore:hasParameter:
12660     @@@: xp|name
12661     @@enDesc:
12662     The <XA::encoding> value.
12663    
12664     WFErrDef:
12665     @QName: xp|wf-malformed-xml-standalone
12666     @enDesc:
12667     An <XA::standalone> pseudo-attribute value is neither <XML::yes>
12668     or <XML::no>.
12669     @enMufDef:
12670     |standalone| pseudo-attribute value |%p (name => {<Q::xp|name>});|
12671     is not allowed
12672     @ecore:hasParameter: xp|error-token
12673     @ecore:hasParameter:
12674     @@@: xp|parent
12675     @@enDesc: The document node.
12676     @ecore:hasParameter:
12677     @@@: xp|name
12678     @@enDesc:
12679     The <XA::standalone> value.
12680    
12681     WFErrDef:
12682     @QName: xp|wf-legal-literal-character
12683     @enDesc:
12684     Each character in XML entity must match to the production
12685     rule <CODE::Char - RestrictedChar>.
12686     @enMufDef:
12687     Character %character-code-point
12688     (v => {<Q::xp|character-number>}); is not allowed
12689     @ecore:hasParameter:
12690     @@@: xp|character-number
12691     @@enDesc:
12692     The code position of the character being referred.
12693    
12694     WFErrDef:
12695 wakaba 1.25 @QName: xp|wf-pes-in-internal-subset
12696     @enDesc:
12697     In the internal subset of the DTD, parameter entity references
12698     <kwd:MUST-NOT> occur within markup declarations.
12699     @enMufDef:
12700     Parameter entity reference |%percent;%param (name => {<Q::xp|name>});;|
12701     cannot occur within a markup declaration
12702     @ecore:hasParameter: xp|error-token
12703     @ecore:hasParameter:
12704     @@@: xp|name
12705     @@enDesc:
12706     The name of the parameter entity.
12707    
12708     WFErrDef:
12709 wakaba 1.3 @QName: xp|wf-element-type-match
12710 wakaba 1.1 @enDesc:
12711 wakaba 1.3 The <CODE::Name> in an element's end-tag must match the element type
12712     in the start-tag.
12713     @enMufDef:
12714     End-tag |</%p (name => {<Q::xp|actual-element-type>});>| does
12715     not match to start-tag |<%p (name => {<Q::xp|expected-element-type>});>|
12716     @ecore:hasParameter: xp|error-token
12717     @ecore:hasParameter:
12718     @@@: xp|node
12719     @@enDesc:
12720     The current opening element node.
12721     @ecore:hasParameter:
12722     @@@: xp|expected-element-type
12723     @@enDesc:
12724     The element type name of the current element.
12725     @ecore:hasParameter:
12726     @@@: xp|actual-element-type
12727     @@enDesc:
12728     The <CODE::Name> occurs in the end-tag.
12729    
12730     WFErrDef:
12731     @QName: xp|wf-unique-att-spec
12732     @enDesc:
12733     An attribute name <kwd:MUST-NOT> appear more than once in
12734     the same start-tag or empty-element tag.
12735 wakaba 1.1 @enMufDef:
12736 wakaba 1.3 Attribute |%p (name => {<Q::xp|name>});| is specified more
12737     than once in the same tag
12738     @ecore:hasParameter: xp|error-token
12739     @ecore:hasParameter:
12740     @@@: xp|name
12741     @@enDesc:
12742     The name of the attribute.
12743 wakaba 1.18
12744     WFErrDef:
12745     @QName: xp|wf-no-external-entity-references
12746     @enDesc:
12747     Attribute values <kwd:MUST-NOT> contain direct or indirect
12748     entity references to external entities.
12749     @enMufDef:
12750     External entity |%p (name => {<Q::xp|name>});| is referenced
12751     in an attribute value literal
12752     @ecore:hasParameter: xp|error-token
12753     @ecore:hasParameter:
12754     @@@: xp|name
12755     @@enDesc:
12756     The name of the entity.
12757    
12758     WFErrDef:
12759     @QName: xp|wf-no-lt-in-attribute-values
12760     @enDesc:
12761     The replacement text of any entity referred to directly or indirectly
12762     in an attribute value literal <kwd:MUST-NOT> contain a
12763     <CHAR::LESS-THAN SIGN>.
12764     @enMufDef:
12765     Entity replacement text cannot contain a
12766     |LESS-THAN SIGN| since it is referenced from an attribute
12767     value literal
12768     @ecore:hasParameter: xp|error-token
12769 wakaba 1.3
12770 wakaba 1.25 WarnDef:
12771     @QName: xp|warning-attribute-definition-ignored
12772     @enDesc:
12773     An attribute definition is ignored because the same attribute
12774     is declared before.
12775     @enMufDef:
12776     Attribute definition for |%p (name => {<Q::xp|name>});| is ignored
12777     @ecore:hasParameter: xp|error-token
12778     @ecore:hasParameter:
12779     @@@: xp|name
12780     @@enDesc:
12781     The name of the attribute.
12782    
12783 wakaba 1.3 WFErrDef:
12784     @QName: xp|wf-legal-character
12785     @enDesc:
12786     Characters referred to using character references <kwd:MUST>
12787     match the production for <CODE::Char>.
12788     @enMufDef:
12789     Reference to character %character-code-point
12790     (v => {<Q::xp|character-number>}); is not allowed
12791     @ecore:hasParameter: xp|error-token
12792     @ecore:hasParameter:
12793     @@@: xp|character-number
12794     @@enDesc:
12795     The code position of the character being referred.
12796     @ecore:hasParameter:
12797     @@@: xp|parent
12798     @@enDesc:
12799     The parent node in which the character reference has
12800     occurred, if available.
12801 wakaba 1.19
12802     WFErrDef:
12803     @QName: xp|wf-entity-declared
12804     @enDesc:
12805     {P:: In a document
12806    
12807     - without any DTD,
12808    
12809     - with only an internal DTD subset that contains no parameter
12810     entity references, or
12811    
12812     - with <XML::standalone="yes">,
12813    
12814     for an entity reference that does not occur within the external
12815     subset or a parameter entity, the <CODE::Name> given in the
12816     entity reference <kwd:MUST> match the <CODE::Name> does not
12817     occur within the external subset or a parameter entity,
12818     except that five predefined character entities need not
12819     be declared. The declaration of a general entity <kwd:MUST>
12820     precede any reference to it which appears in a default value
12821     in an attribute list declaration.
12822     @enMufDef:
12823     Entity |%p (name => {<Q::xp|name>});| must be declared
12824     in the internal subset
12825 wakaba 1.23 @ecore:hasParameter: xp|error-token
12826     @ecore:hasParameter:
12827     @@@: xp|name
12828     @@enDesc:
12829     The name of the entity.
12830    
12831     WFErrDef:
12832     @QName: xp|wf-parsed-entity
12833     @enDesc:
12834     An entity reference <kwd:MUST-NOT> contain the name of an
12835     unparsed entity.
12836     @enMufDef:
12837     Entity |%p (name => {<Q::xp|name>});| is an unparsed entity
12838     @ecore:hasParameter: xp|error-token
12839     @ecore:hasParameter:
12840     @@@: xp|name
12841     @@enDesc:
12842     The name of the entity.
12843    
12844     WFErrDef:
12845     @QName: xp|wf-no-recursion
12846     @enDesc:
12847     A parsed entity <kwd:MUST-NOT> contain a recursive reference
12848     to itself, either directly or indirectly.
12849     @enMufDef:
12850     Entity |%p (name => {<Q::xp|name>});| is recursively referenced
12851 wakaba 1.19 @ecore:hasParameter: xp|error-token
12852     @ecore:hasParameter:
12853     @@@: xp|name
12854     @@enDesc:
12855     The name of the entity.
12856 wakaba 1.16
12857     FatalErrDef:
12858     @QName: xp|fatal-xml11-end-of-line-in-xml-declaration
12859     @enDesc:
12860     An end-of-line character <CODE::U+0085> or <CODE::U+2028> is appeared
12861     within an XML declaration or text declaration.
12862     @enMufDef:
12863     End-of-line character %character-code-point
12864     (v => {<Q::xp|character-number>}); cannot be used within the
12865     XML or text declaration
12866     @ecore:hasParameter:
12867     @@@: xp|character-number
12868     @@enDesc:
12869     The code position of the end-of-line character.
12870 wakaba 1.24
12871     ErrDef:
12872     @QName: xp|error-internal-predefined-entity
12873     @enDesc:
12874     A general entity declaration whose <CODE::Name> equals to one
12875     of predefined entities <kwd:MUST> declare it as an internal entity.
12876     @enMufDef:
12877     Entity |%p (name => {<Q::xp|name>});| must be declared as an
12878     internal entity
12879     @ecore:hasParameter: xp|error-token
12880     @ecore:hasParameter:
12881     @@@: xp|name
12882     @@enDesc:
12883     The name of the entity.
12884    
12885     ErrDef:
12886     @QName: xp|error-malformed-predefined-entity
12887     @enDesc:
12888     A general entity declaration whose <CODE::Name> equals to one
12889     of predefined entities <kwd:MUST> declare it as a data
12890     character for the entity.
12891     @enMufDef:
12892     Entity declaration for |%p (name => {<Q::xp|name>});|
12893     (replacement text |%p (name => {<Q::xp|replacement-text>});|) is malformed
12894     @ecore:hasParameter: xp|error-token
12895     @ecore:hasParameter:
12896     @@@: xp|name
12897     @@enDesc:
12898     The name of the entity.
12899     @ecore:hasParameter:
12900     @@@: xp|replacement-text
12901     @@enDesc:
12902     The replacement text of the entity declaration.
12903    
12904     WarnDef:
12905     @QName: xp|warning-entity-declaration-ignored
12906     @enDesc:
12907     An entity declaration is ignored because the same entity
12908     is declared before.
12909     @enMufDef:
12910     Entity declaration for |%p (name => {<Q::xp|name>});| is ignored
12911     @ecore:hasParameter: xp|error-token
12912     @ecore:hasParameter:
12913     @@@: xp|name
12914     @@enDesc:
12915     The name of the entity.
12916    
12917     VCErrDef:
12918     @QName: xp|vc-unique-notation-name
12919     @enDesc:
12920     A <CODE::Name> <kwd:MUST-NOT> be declared in more than
12921     one notation declaration.
12922     @enMufDef:
12923     Notation |%p (name => {<Q::xp|name>});| is already declared
12924     @ecore:hasParameter: xp|error-token
12925     @ecore:hasParameter:
12926     @@@: xp|name
12927     @@enDesc:
12928     The name of the notation.
12929 wakaba 1.25
12930     WarnDef:
12931     @QName: xp|warning-entity-declaration-not-processed
12932     @enDesc:
12933     An entity declaration is not processed because there
12934     is a reference to parameter entity before the declaration
12935     and the entity is not read.
12936     @enMufDef:
12937     Entity declaration for |%p (name => {<Q::xp|name>});| is not processed
12938     @ecore:hasParameter: xp|error-token
12939     @ecore:hasParameter:
12940     @@@: xp|name
12941     @@enDesc:
12942     The name of the entity.
12943    
12944     WarnDef:
12945     @QName: xp|warning-attribute-definition-not-processed
12946     @enDesc:
12947     An attribute definition is not processed because there
12948     is a reference to parameter entity before the declaration
12949     and the entity is not read.
12950     @enMufDef:
12951     Attribute definition for |%p (name => {<Q::xp|name>});| is not processed
12952     @ecore:hasParameter: xp|error-token
12953     @ecore:hasParameter:
12954     @@@: xp|name
12955     @@enDesc:
12956     The name of the attribute.
12957 wakaba 1.24
12958     XWParam:
12959     @QName: xp|replacement-text
12960     @enDesc:
12961     The replacement text.
12962 wakaba 1.1
12963 wakaba 1.3 XWParam:
12964 wakaba 1.1 @QName: xp|error-token
12965     @enDesc:
12966     The token where the parser found an error.
12967    
12968 wakaba 1.3 XWParam:
12969     @QName: xp|name
12970     @enDesc:
12971     A name.
12972    
12973     XWParam:
12974     @QName: xp|parent
12975     @enDesc:
12976     The parent node in which the error occurs.
12977    
12978     XWParam:
12979     @QName: xp|node
12980     @enDesc:
12981     The current node.
12982    
12983     XWParam:
12984     @QName: xp|actual-element-type
12985     @enDesc:
12986     The actual element type name occured in the source.
12987    
12988     XWParam:
12989     @QName: xp|expected-element-type
12990 wakaba 1.1 @enDesc:
12991 wakaba 1.3 The element type name expected.
12992    
12993     XWParam:
12994     @QName: xp|character-number
12995     @enDesc:
12996     The character code position.
12997    
12998     ElementTypeBinding:
12999     @Name: XWParam
13000     @ElementType:
13001     dis:ResourceDef
13002     @ShadowContent:
13003     @@For: =ManakaiDOM|all
13004     @@rdf:type: ecore|Parameter
13005 wakaba 1.1
13006     ElementTypeBinding:
13007     @Name:enMufDef
13008     @ElementType:
13009     ecore:defaultMessage
13010     @ShadowContent:
13011     @@lang:en
13012     @@ContentType:
13013     lang:muf
13014    
13015     ResourceDef:
13016     @QName: DOMImpl
13017     @AliasFor: DOMCore|DOMImplementation
13018     @For: ManakaiDOM|DOM
13019    
13020     ElementTypeBinding:
13021     @Name: Attr
13022     @ElementType:
13023     dis:ResourceDef
13024     @ShadowContent:
13025     @@rdf:type: DISLang|Attribute
13026     @@ForCheck: !=ManakaiDOM|ManakaiDOM
13027    
13028     ElementTypeBinding:
13029     @Name: Get
13030     @ElementType:
13031     dis:ResourceDef
13032     @ShadowContent:
13033     @@rdf:type: DISLang|AttributeGet
13034    
13035     ElementTypeBinding:
13036     @Name: Set
13037     @ElementType:
13038     dis:ResourceDef
13039     @ShadowContent:
13040     @@rdf:type: DISLang|AttributeSet
13041    
13042     ElementTypeBinding:
13043     @Name: enDesc
13044     @ElementType:
13045     dis:Description
13046     @ShadowContent:
13047     @@lang:en
13048    
13049     ElementTypeBinding:
13050     @Name: Method
13051     @ElementType:
13052     dis:ResourceDef
13053     @ShadowContent:
13054     @@rdf:type: DISLang|Method
13055     @@For: !=ManakaiDOM|ManakaiDOM
13056    
13057     ElementTypeBinding:
13058     @Name: Return
13059     @ElementType:
13060     dis:ResourceDef
13061     @ShadowContent:
13062     @@rdf:type: DISLang|MethodReturn
13063    
13064     ElementTypeBinding:
13065     @Name: Param
13066     @ElementType:
13067     dis:ResourceDef
13068     @ShadowContent:
13069     @@rdf:type: DISLang|MethodParameter
13070    
13071     ElementTypeBinding:
13072     @Name: PerlDef
13073     @ElementType:
13074     dis:Def
13075     @ShadowContent:
13076     @@ContentType: lang|Perl
13077    
13078     ElementTypeBinding:
13079     @Name: PropDef
13080     @ElementType:
13081     dis:ResourceDef
13082     @ShadowContent:
13083     @@rdf:type: rdf|Property
13084    
13085     ClsDef:
13086     @ClsQName: ManakaiXMLParserExceptionFormatter
13087    
13088     @ClsISA: ecore|MUErrorFormatter||ManakaiDOM|Perl
13089    
13090     @RuleDef:
13091     @@Name: xp-error-token-type
13092     @@enDesc:
13093     The type of the token the parser is encountered.
13094    
13095     @@Method:
13096     @@@Name: after
13097     @@@Param:
13098     @@@@Name: name
13099     @@@@Type: DOMString
13100     @@@@enDesc: The name of the method.
13101     @@@Param:
13102     @@@@Name: p
13103     @@@@Type: DISPerl|HASH
13104     @@@@enDesc: The set of the parameters to the method.
13105     @@@Param:
13106     @@@@Name: o
13107     @@@@Type: DISPerl|HASH
13108     @@@@enDesc: The option value.
13109     @@@Return:
13110     @@@@PerlDef:
13111     $p->{-result} = $o->{<H::xp|error-token>}->{type}
13112     if defined $o->{<H::xp|error-token>}->{type};
13113    
13114     @RuleDef:
13115     @@Name: xp-error-token-value
13116     @@enDesc:
13117     The value of the token the parser is encountered, if any.
13118    
13119     @@Method:
13120     @@@Name: after
13121     @@@Param:
13122     @@@@Name: name
13123     @@@@Type: DOMString
13124     @@@@enDesc: The name of the method.
13125     @@@Param:
13126     @@@@Name: p
13127     @@@@Type: DISPerl|HASH
13128     @@@@enDesc: The set of the parameters to the method.
13129     @@@Param:
13130     @@@@Name: o
13131     @@@@Type: DISPerl|HASH
13132     @@@@enDesc: The option value.
13133     @@@Return:
13134     @@@@PerlDef:
13135     $p->{-result} = $o->{<H::xp|error-token>}->{value}
13136     if defined $o->{<H::xp|error-token>}->{value};
13137    
13138     @RuleDef:
13139     @@Name: xp-error-lines
13140     @@enDesc:
13141     A copy of fragment of the source text that contains the line
13142     where the error occurred, if available.
13143    
13144     @@Method:
13145     @@@Name: after
13146     @@@Param:
13147     @@@@Name: name
13148     @@@@Type: DOMString
13149     @@@@enDesc: The name of the method.
13150     @@@Param:
13151     @@@@Name: p
13152     @@@@Type: DISPerl|HASH
13153     @@@@enDesc: The set of the parameters to the method.
13154     @@@Param:
13155     @@@@Name: o
13156     @@@@Type: DISPerl|HASH
13157     @@@@enDesc: The option value.
13158     @@@Return:
13159     @@@@PerlDef:
13160     my $pos = $o-><AG::DOMCore|DOMError.location>
13161     -><AG::DOMCore|DOMLocator.utf32Offset>;
13162     if ($pos > -1) {
13163 wakaba 1.6 my $src = $o->{<H::ecore|object>}->{entity}->[-1]->{reptxt};
13164 wakaba 1.1 my $start = $pos;
13165     $start = rindex ($$src, "\x0A", $start - 1) for 0..2;
13166     $start++;
13167     my $end = $pos;
13168     $end = index ($$src, "\x0A", $end + 1) for 0..2;
13169     $end = length $$src if $end < 0;
13170     $p->{-result} = substr $$src, $start, $end - $start;
13171     }
13172 wakaba 1.3
13173     @RuleDef:
13174     @@Name: character-code-point
13175     @@enDesc:
13176     The character code position, in <CODE::U+<VAR::HHHH>> notation.
13177    
13178     @@Method:
13179     @@@Name: after
13180     @@@Param:
13181     @@@@Name: name
13182     @@@@Type: DOMString
13183     @@@@enDesc: The name of the method.
13184     @@@Param:
13185     @@@@Name: p
13186     @@@@Type: DISPerl|HASH
13187     @@@@enDesc: The set of the parameters to the method.
13188     @@@Param:
13189     @@@@Name: o
13190     @@@@Type: DISPerl|HASH
13191     @@@@enDesc: The option value.
13192     @@@RuleParam:
13193     @@@@Name: v
13194     @@@@Type: DISPerl|Number
13195     @@@@enDesc:
13196     The name of the error parameter that contains the character code.
13197     @@@Return:
13198     @@@@PerlDef:
13199     $p->{-result} = sprintf 'U+%04X', $o->{$p->{v}};
13200 wakaba 1.1 ##XMLParserExceptionFormatter

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24