/[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.24 - (hide annotations) (download)
Wed Feb 15 13:36:21 2006 UTC (18 years, 9 months ago) by wakaba
Branch: MAIN
Changes since 1.23: +455 -26 lines
++ manakai/lib/Message/DOM/ChangeLog	15 Feb 2006 13:28:44 -0000
2006-02-15  Wakaba  <wakaba@suika.fam.cx>

	* XMLParser.dis: Issues |xp:error-internal-predefined-entity| error
	if a predefined entity declaration references an external entity.
	Issues |xp:error-malformed-predefined-entity| error if
	a predefined entity declaration defines different thing than
	one as in XML specification.
	Issies |xp:warning-entity-declaration-ignored| warning if
	more than one entity declarations for an entity is found.
	(WFErrDef): Now all well-formedness errors are marked
	as |SEVERITY_FATAL_ERROR|.

	* XDoctype.dis (DocumentXDoctype.createDocumentTypeDefinition): Creates
	predefined entity declarations.
	(DocumentXDoctype.createNotation): New method.
	(DocumentTypeDefinition.notations): New attribute.
	(DocumentTypeDefinition.getNotationNode): New method.
	(DocumentTypeDefinition.setNotationNode): New method.
	(newNotationForTest): New code fragment.

	* Tree.dis (ManakaiDOMXML:ManakaiDOMNotations): Removed.
	(c:ManakaiDOMNotationMap): New class.
	(c:ManakaiDOMNotationMapArray): New class.
	(Document.allDeclarationsProcessed): New attribute.

	* DOMXML.dis (DocumentType.notations): Implemented.
	(Notation): Revised.
	(Notation.ownerDocumentTypeDefinition): New attribute.

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.24 $Date: 2006/02/13 17:03:22 $
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.17
302 wakaba 1.3 ## Well-formedness constraint Entity Declared takes effect?
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    
618     // *Misc
619 wakaba 1.2 ~* (CDO) {
620 wakaba 1.1 &_CommentDeclaration_ ($doc => $doc, $parent => $doc);
621    
622     ~ (MDC) {
623     ?lexmode DocumentMisc;
624     } else {
625     ?lexmode DocumentMisc;
626     }
627     } (PIO) {
628     &_ProcessingInstruction_ ($doc => $doc, $parent => $doc);
629    
630     ~ (PIC) {
631     ?lexmode 'DocumentMisc';
632     } else {
633     ?lexmode DocumentMisc;
634     }
635     } (S) {
636     //
637     }
638    
639     // Document element
640     ~ (STAGO) {
641     &Element_ ($doc => $doc, $parent => $doc)
642     : unshift-current-token;
643     ~ (TAGC) {
644     ?lexmode DocumentEnd;
645     } else {
646     ?lexmode DocumentEnd;
647     }
648     } else {
649     ?lexmode 'DocumentEnd';
650     }
651    
652     // *Misc
653 wakaba 1.2 ~* (CDO) {
654 wakaba 1.1 &_CommentDeclaration_ ($doc => $doc, $parent => $doc);
655    
656     ~ (MDC) {
657     ?lexmode DocumentEnd;
658     } else {
659     ?lexmode DocumentEnd;
660     }
661     } (PIO) {
662     &_ProcessingInstruction_ ($doc => $doc, $parent => $doc);
663     ~ (PIC) {
664     ?lexmode 'DocumentEnd';
665     } else {
666     ?lexmode DocumentEnd;
667     }
668     } (S) {
669     //
670     }
671    
672     ~ (#EOF) { }
673     } // DocumentEntity
674 wakaba 1.11
675     /*
676     Internal General Parsed Entity
677    
678     An internal general parsed entity is well-formed if its
679     replacement text matches the production labeled |content|.
680     */
681     rule InternalGeneralParsedEntity ($ent) : standalone {
682     ?lexmode ElementContent;
683    
684     my $ns;
685     lang:Perl {
686     $ns = {
687     xml => <Q::xml:>,
688     xmlns => <Q::xmlns:>,
689     };
690     }
691    
692     &content ($parent => $ent, $ns => $ns);
693    
694     ~ (#EOF) { }
695     } // InternalGeneralParsedEntity
696    
697 wakaba 1.1 /*
698     XML Declaration
699    
700     XMLDecl := '<?xml' VersionInfo
701     [EncodingDecl]
702     [SDDecl]
703     [S] '?>' ;; [23]
704    
705     NOTE: XML declaration is optional in XML 1.0
706     while it is required in XML 1.1.
707     */
708 wakaba 1.16 rule _XMLDeclaration_ {
709     // ~ (XDO) { }
710 wakaba 1.3 ?lexmode XMLDeclaration;
711 wakaba 1.16 //lang:Perl {
712     // $self->{entity}->[-1]->{no_xml11_eol} = true;
713     //}
714     //~ (S) { }
715 wakaba 1.3
716     ~ (Name == 'version') {
717     ~? (S) { }
718     ~ (VI) { }
719     ~? (S) { }
720 wakaba 1.1
721 wakaba 1.3 my $ver;
722     my $bad_token;
723    
724     ~ (LIT) {
725     ?lexmode AttributeValueLiteral;
726    
727     ~ (STRING) {
728     lang:Perl ($version => $token.value) {
729     $ver = $version;
730     $bad_token = $token;
731     }
732     }
733    
734     ~ (LIT) {
735     ?lexmode XMLDeclaration;
736     }
737     } (LITA) {
738     ?lexmode AttributeValueLiteralA;
739    
740     ~ (STRING) {
741     lang:Perl ($version => $token.value) {
742     $ver = $version;
743     $bad_token = $token;
744     }
745     }
746    
747     ~ (LITA) {
748     ?lexmode XMLDeclaration;
749     }
750     }
751    
752     lang:Perl : has-error {
753     unless ($ver eq '1.0' or $ver eq '1.1') {
754     my $location;
755     __CODE{xp|get-location-from-token::
756     $token => {$bad_token},
757     $result => {$location},
758     }__;
759     my $continue = __DOMCore:ERROR{xp|wf-unsupported-xml-version::
760     DOMCore|location => {$location},
761 wakaba 1.16 xp|parent => {$self->{doc}},
762 wakaba 1.3 infoset|version => {$ver},
763     xp|error-token => {$bad_token},
764     }__;
765     unless ($continue) {
766     __EXCEPTION{DOMLS|PARSE_ERR}__;
767     }
768     }
769 wakaba 1.16 $self->{doc}-><AS::Document.xmlVersion> ($ver);
770 wakaba 1.3 $self->{xml_version} = $ver;
771     }
772    
773     ~? (S) { }
774 wakaba 1.1 }
775    
776 wakaba 1.3 ~? (Name == 'encoding') {
777     ~? (S) { }
778     ~ (VI) { }
779     ~? (S) { }
780    
781     my $ver;
782     my $bad_token;
783    
784     ~ (LIT) {
785     ?lexmode AttributeValueLiteral;
786    
787     ~ (STRING) {
788     lang:Perl ($version => $token.value) {
789     $ver = $version;
790     $bad_token = $token;
791     }
792     }
793    
794     ~ (LIT) {
795     ?lexmode XMLDeclaration;
796     }
797     } (LITA) {
798     ?lexmode AttributeValueLiteralA;
799    
800     ~ (STRING) {
801     lang:Perl ($version => $token.value) {
802     $ver = $version;
803     $bad_token = $token;
804     }
805     }
806    
807     ~ (LITA) {
808     ?lexmode XMLDeclaration;
809     }
810     }
811    
812     lang:Perl : has-error {
813     unless ($ver =~ /\A[A-Za-z][A-Za-z0-9._-]*\z/) {
814     my $location;
815     __CODE{xp|get-location-from-token::
816     $token => {$bad_token},
817     $result => {$location},
818     }__;
819     my $continue = __DOMCore:ERROR{xp|wf-malformed-enc-name::
820     DOMCore|location => {$location},
821 wakaba 1.16 xp|parent => {$self->{doc}},
822 wakaba 1.3 xp|name => {$ver},
823     xp|error-token => {$bad_token},
824     }__;
825     unless ($continue) {
826     __EXCEPTION{DOMLS|PARSE_ERR}__;
827     }
828     }
829 wakaba 1.16 $self->{doc}-><AS::Document.xmlEncoding> ($ver);
830 wakaba 1.3 }
831    
832     ~? (S) { }
833 wakaba 1.1 }
834 wakaba 1.3
835     ~? (Name == 'standalone') {
836     ~? (S) { }
837     ~ (VI) { }
838     ~? (S) { }
839    
840     my $ver;
841     my $bad_token;
842    
843     ~ (LIT) {
844     ?lexmode AttributeValueLiteral;
845    
846     ~ (STRING) {
847     lang:Perl ($version => $token.value) {
848     $ver = $version;
849     $bad_token = $token;
850     }
851     }
852    
853     ~ (LIT) {
854     ?lexmode XMLDeclaration;
855     }
856     } (LITA) {
857     ?lexmode AttributeValueLiteralA;
858    
859     ~ (STRING) {
860     lang:Perl ($version => $token.value) {
861     $ver = $version;
862     $bad_token = $token;
863     }
864     }
865 wakaba 1.1
866 wakaba 1.3 ~ (LITA) {
867     ?lexmode XMLDeclaration;
868     }
869     }
870    
871     lang:Perl : has-error {
872     unless ($ver eq 'yes' or $ver eq 'no') {
873     my $location;
874     __CODE{xp|get-location-from-token::
875     $token => {$bad_token},
876     $result => {$location},
877     }__;
878     my $continue = __DOMCore:ERROR{xp|wf-malformed-xml-standalone::
879     DOMCore|location => {$location},
880 wakaba 1.16 xp|parent => {$self->{doc}},
881 wakaba 1.3 xp|name => {$ver},
882     xp|error-token => {$bad_token},
883     }__;
884     unless ($continue) {
885     __EXCEPTION{DOMLS|PARSE_ERR}__;
886     }
887     }
888 wakaba 1.13 if ($ver eq 'yes') {
889 wakaba 1.16 $self->{doc}-><AS::Document.xmlStandalone> (true);
890 wakaba 1.13 $self->{standalone} = true;
891     }
892 wakaba 1.3 }
893    
894     ~? (S) { }
895     }
896    
897 wakaba 1.16 ~ (PIC1) {
898     lang:Perl {
899     $self->{entity}->[-1]->{no_xml11_eol} = false;
900     }
901     } else {
902     lang:Perl {
903     $self->{entity}->[-1]->{no_xml11_eol} = false;
904     }
905     }
906    
907     // ~ (PIC2) { }
908 wakaba 1.3 } // _XMLDeclaration_
909 wakaba 1.1
910     /*
911     Comment Declaration
912    
913     Comment := '<!--' *(Char - '-' / '-' (Char - '-'))
914     '-->' ;; [15]
915 wakaba 1.4 */
916 wakaba 1.1 rule _CommentDeclaration_ ($doc, $parent) {
917     ?lexmode 'CommentDeclaration';
918    
919     ~? (STRING) {
920     lang:Perl ($data => $token.value) {
921     my $com = $doc-><M::Document.createComment> ($data);
922     $parent-><M::Node.appendChild> ($com);
923     }
924     } else {
925     lang:Perl {
926     my $com = $doc-><M::Document.createComment> ('');
927     $parent-><M::Node.appendChild> ($com);
928     }
929     }
930    
931     ~ (COM) {
932     ?lexmode MarkupDeclaration;
933     } else {
934     ?lexmode MarkupDeclaration;
935     }
936    
937     // ~ (MDC) { }
938 wakaba 1.4 } // _CommentDeclaration
939 wakaba 1.15
940     rule _CommentDeclarationDTD {
941     ?lexmode CommentDeclaration;
942 wakaba 1.4
943     ~? (STRING) {
944     //
945     }
946    
947     ~ (COM) {
948     ?lexmode MarkupDeclaration;
949     } else {
950     ?lexmode MarkupDeclaration;
951     }
952    
953     ~ (MDC) {
954     ?lexmode DTD;
955     } else {
956     ?lexmode DTD;
957     }
958     } // _CommentDeclarationDTD
959    
960 wakaba 1.1 /*
961     Processing Instruction
962    
963     PI := '<?' PITarget [S *Char - *Char '?>' *Char]
964     '?>' ;; [16]
965     */
966     rule _ProcessingInstruction_ ($doc, $parent) {
967     ?lexmode 'PIName';
968    
969     my $pi;
970    
971     ~ (Name) {
972 wakaba 1.3 lang:Perl ($name => $token.value) : has-error {
973 wakaba 1.1 if (lc $name eq 'xml') {
974 wakaba 1.3 my $location;
975     __CODE{xp|get-location-from-token::
976     $token => {$token},
977     $result => {$location},
978     }__;
979     my $continue = __DOMCore:ERROR{xp|wf-pi-target-is-xml::
980     xp|name => {$name},
981     DOMCore|location => {$location},
982     xp|parent => {$parent},
983     }__;
984     unless ($continue) {
985     __EXCEPTION{DOMLS|PARSE_ERR::
986     }__;
987     }
988 wakaba 1.1 }
989     ## TODO: Namespace well-formedness
990     $pi = $doc-><M::Document.createProcessingInstruction>
991     ($name);
992     }
993 wakaba 1.14 } else {
994     lang:Perl {
995     $pi = $doc-><M::Document.createProcessingInstruction> ('#INVALID');
996     }
997 wakaba 1.1 }
998    
999 wakaba 1.14 ~? (S) {
1000 wakaba 1.1 ?lexmode 'PIData';
1001    
1002     my $tdata;
1003    
1004     ~? (DATA) {
1005     lang:Perl ($data => $token.value) {
1006     $tdata = $data;
1007     }
1008     } else {
1009     lang:Perl {
1010     $tdata = '';
1011     }
1012     }
1013    
1014     lang:Perl {
1015     $pi-><AS::Node.nodeValue> ($tdata);
1016     }
1017     }
1018    
1019     lang:Perl {
1020     $parent-><M::Node.appendChild> ($pi);
1021     }
1022    
1023     // ~ (PIC) { }
1024     } // _ProcessingInstruction_
1025 wakaba 1.4
1026 wakaba 1.6 /*
1027     Processing instruction in DTD
1028     */
1029     rule _ProcessingInstructionDTD ($doc, $doctype) {
1030 wakaba 1.4 ?lexmode 'PIName';
1031 wakaba 1.6
1032     my $pi;
1033 wakaba 1.4
1034     ~ (Name) {
1035 wakaba 1.6 lang:Perl ($name => $token.value) : has-error {
1036     if (lc $name eq 'xml') {
1037     my $location;
1038     __CODE{xp|get-location-from-token::
1039     $token => {$token},
1040     $result => {$location},
1041     }__;
1042     my $continue = __DOMCore:ERROR{xp|wf-pi-target-is-xml::
1043     xp|name => {$name},
1044     DOMCore|location => {$location},
1045     xp|parent => {$doctype},
1046     }__;
1047     unless ($continue) {
1048     __EXCEPTION{DOMLS|PARSE_ERR::
1049     }__;
1050     }
1051     }
1052     ## TODO: Namespace well-formedness
1053     $pi = $doc-><M::Document.createProcessingInstruction>
1054     ($name);
1055     }
1056 wakaba 1.14 } else {
1057     lang:Perl {
1058     $pi = $doc-><M::Document.createProcessingInstruction> ('#INVALID');
1059     }
1060 wakaba 1.4 }
1061    
1062 wakaba 1.14 ~? (S) {
1063 wakaba 1.4 ?lexmode 'PIData';
1064    
1065 wakaba 1.6 my $tdata;
1066    
1067 wakaba 1.4 ~? (DATA) {
1068 wakaba 1.6 lang:Perl ($data => $token.value) {
1069     $tdata = $data;
1070     }
1071     } else {
1072     lang:Perl {
1073     $tdata = '';
1074     }
1075     }
1076    
1077     lang:Perl {
1078     $pi-><AS::Node.nodeValue> ($tdata);
1079 wakaba 1.4 }
1080     }
1081    
1082 wakaba 1.6 lang:Perl {
1083     $doctype-><M::Node.appendChild> ($pi);
1084     }
1085    
1086 wakaba 1.4 ~ (PIC) {
1087     ?lexmode DTD;
1088     } else {
1089     ?lexmode DTD;
1090     }
1091     } // _ProcessingInstructionDTD
1092 wakaba 1.1
1093     /*
1094     Element content parsing mode
1095    
1096     element := EmptyElemTag /
1097     STag content ETag ;; [39]
1098     content := (CharData / element / Reference / CDSect /
1099     PI / Comment) ;; [43]
1100     */
1101 wakaba 1.6 rule Element_ ($doc, $parent, $ns) : standalone {
1102 wakaba 1.1 ?lexmode 'ElementContent';
1103    
1104     my $node; // Current "parent" node
1105     my $nodes; // Node stack (w/o $current_node)
1106     my $type; // Current "parent" element type QName
1107     my $types; // Element type stack (w/o $current_type)
1108 wakaba 1.6 //my $ns; // Current in-scope namespace bindings
1109 wakaba 1.1 my $nses; // Namespace binding stack (w/o $current_ns)
1110    
1111     lang:Perl {
1112     $node = $parent;
1113     $nodes = [];
1114     $type = '';
1115     $types = [];
1116 wakaba 1.6 $ns ||= {
1117 wakaba 1.1 xml => <Q::xml:>,
1118     xmlns => <Q::xmlns:>,
1119     };
1120     $nses = [];
1121     }
1122    
1123     ~* : name => CONTENT
1124     (CharData) {
1125     // Character data
1126     lang:Perl ($data => $token.value) {
1127     $node-><M::Node.appendChild>
1128     ($doc-><M::Document.createTextNode> ($data));
1129     }
1130     } (STAGO) {
1131     // Start tag or empty element tag
1132    
1133     ?lexmode 'StartTag';
1134    
1135     ~ (Name) {
1136     my $attrs;
1137     lang:Perl ($name => $token.value) {
1138     push @{$types}, $type;
1139     $type = $name;
1140     $attrs = {};
1141     }
1142    
1143     ~? (S) {
1144     &AttributeSpecificationList
1145     ($doc => $doc, $attrs => $attrs);
1146     }
1147    
1148     my $el;
1149 wakaba 1.9
1150     /*
1151     Note that this implementation does not perform
1152     attribute value tokenization (but does white space
1153     normalization common to attribute types) and
1154     construct the tree as is. DOM Level 3 Core spec
1155     is unclear on this point. With tokenization,
1156     entity references cannot be preserved.
1157    
1158     The manakai Node.nodeValue and Attr.value attributes
1159     do tokenization according to attribute types.
1160     */
1161    
1162     /*
1163     ISSUE: Should |xml:id| attribute be typed?
1164     */
1165 wakaba 1.1
1166     lang:Perl {
1167     push @{$nses}, $ns;
1168     $ns = {%$ns};
1169    
1170     my %gattr;
1171     my %lattr;
1172     for my $atqname (keys %$attrs) {
1173     my ($pfx, $lname) = split /:/, $atqname;
1174 wakaba 1.9 $attrs->{$atqname}->{def} = $self->{attr}->{$type}->{$atqname};
1175 wakaba 1.1 if (defined $lname) { ## Global attribute
1176     ## TODO: Namespace well-formedness (lname is NCName)
1177     if ($pfx eq 'xmlns') {
1178     my $nsuri = $attrs->{$atqname}->{value};
1179     if ($lname eq 'xml' and
1180     $nsuri ne <Q::xml:>) {
1181     ## TODO: error
1182     } elsif ($lname eq 'xmlns') {
1183     ## TODO: error
1184     }
1185     if ($nsuri eq '') {
1186     ## TODO: error in XML 1.0
1187     } elsif ($nsuri eq <Q::xml:> and
1188     $lname ne 'xml') {
1189     ## TODO: error
1190     } elsif ($nsuri eq <Q::xmlns:>) {
1191     ## TODO: error
1192     }
1193     $ns->{$lname} = $attrs->{$atqname}->{value};
1194 wakaba 1.9 if ($attrs->{$atqname}->{def}) {
1195     my $dt = $attrs->{$atqname}->{def}-><AG::ATDef.declaredType>;
1196     if ({
1197     <C::ATDef.ID_ATTR> => true,
1198     <C::ATDef.IDREF_ATTR> => true,
1199     <C::ATDef.IDREFS_ATTR> => true,
1200     <C::ATDef.ENTITY_ATTR> => true,
1201     <C::ATDef.ENTITIES_ATTR> => true,
1202     <C::ATDef.NMTOKEN_ATTR> => true,
1203     <C::ATDef.NMTOKENS_ATTR> => true,
1204     <C::ATDef.NOTATION_ATTR> => true,
1205     <C::ATDef.ENUMERATION_ATTR> => true,
1206     }->{$dt}) {
1207     ## Tokenization (XML 1 3.3.3)
1208     for ($ns->{$lname}) {
1209     s/^\x20+//;
1210     s/\x20+\z//;
1211     s/\x20+/ /g;
1212     }
1213     }
1214     }
1215 wakaba 1.1 delete $ns->{$lname} unless length $ns->{$lname};
1216     } elsif ($pfx eq '') {
1217     ## TODO: pfx is not NCName error
1218     } else {
1219     if ($gattr{$pfx}->{$lname}) {
1220     ## TODO: Namespace well-formedness error
1221     }
1222     }
1223     $gattr{$pfx}->{$lname} = $attrs->{$atqname};
1224     } else { ## Local attribute
1225     if ($pfx eq 'xmlns') {
1226     $ns->{''} = $attrs->{xmlns}->{value};
1227 wakaba 1.9 if ($attrs->{$atqname}->{def}) {
1228     my $dt = $attrs->{$atqname}->{def}-><AG::ATDef.declaredType>;
1229     if ({
1230     <C::ATDef.ID_ATTR> => true,
1231     <C::ATDef.IDREF_ATTR> => true,
1232     <C::ATDef.IDREFS_ATTR> => true,
1233     <C::ATDef.ENTITY_ATTR> => true,
1234     <C::ATDef.ENTITIES_ATTR> => true,
1235     <C::ATDef.NMTOKEN_ATTR> => true,
1236     <C::ATDef.NMTOKENS_ATTR> => true,
1237     <C::ATDef.NOTATION_ATTR> => true,
1238     <C::ATDef.ENUMERATION_ATTR> => true,
1239     }->{$dt}) {
1240     ## Tokenization (XML 1 3.3.3)
1241     for ($ns->{''}) {
1242     s/^\x20+//;
1243     s/\x20+\z//;
1244     s/\x20+/ /g;
1245     }
1246     }
1247     }
1248 wakaba 1.1 delete $ns->{''} unless length $ns->{''};
1249     } else {
1250     $lattr{$pfx} = $attrs->{$atqname};
1251     }
1252     }
1253     }
1254    
1255     my ($pfx, $lname) = split /:/, $type;
1256     my $nsuri;
1257     ## TODO: lname is NCName?
1258     if (defined $lname) { ## Prefixed namespace
1259     if ($pfx eq '') {
1260     ## TODO: pfx is not NCName error
1261     }
1262     if (defined $ns->{$pfx}) {
1263     $nsuri = $ns->{$pfx};
1264     } else {
1265     ## TODO: namespace ill-formed
1266     }
1267     } else { ## Default namespace
1268     $nsuri = $ns->{''};
1269     }
1270    
1271     $el = $doc-><M::Document.createElementNS>
1272     ($nsuri, $type);
1273    
1274     if ($attrs->{xmlns}) {
1275     my $attr = $doc-><M::Document.createAttributeNS>
1276     (<Q::xmlns:>, 'xmlns');
1277     for (@{$attrs->{xmlns}->{nodes}}) {
1278     $attr-><M::Node.appendChild> ($_);
1279     }
1280 wakaba 1.9 if ($attrs->{xmlns}->{def}) {
1281     __CODE{t|setAttrType::
1282     $attr => $attr,
1283     $type => {$attrs->{xmlns}->{def}-><AG::ATDef.declaredType>},
1284     }__;
1285     }
1286 wakaba 1.1 $el-><M::Element.setAttributeNodeNS> ($attr);
1287     }
1288    
1289     for my $lname (keys %lattr) {
1290     my $attr = $doc-><M::Document.createAttributeNS>
1291     (null, $lname);
1292     for (@{$lattr{$lname}->{nodes}}) {
1293     $attr-><M::Node.appendChild> ($_);
1294     }
1295 wakaba 1.9 if ($attrs->{$lname}->{def}) {
1296     __CODE{t|setAttrType::
1297     $attr => $attr,
1298     $type => {$attrs->{$lname}->{def}-><AG::ATDef.declaredType>},
1299     }__;
1300     }
1301 wakaba 1.1 $el-><M::Element.setAttributeNodeNS> ($attr);
1302     }
1303    
1304     for my $pfx (keys %gattr) {
1305     for my $lname (keys %{$gattr{$pfx}}) {
1306     my $attr = $doc-><M::Document.createAttributeNS>
1307     ($ns->{$pfx}, $pfx.':'.$lname);
1308     for (@{$gattr{$pfx}->{$lname}->{nodes}}) {
1309     $attr-><M::Node.appendChild> ($_);
1310     }
1311 wakaba 1.9 if ($attrs->{$pfx}->{$lname}->{def}) {
1312     __CODE{t|setAttrType::
1313     $attr => $attr,
1314     $type => {$attrs->{$pfx}->{$lname}
1315     ->{def}-><AG::ATDef.declaredType>},
1316     }__;
1317     }
1318 wakaba 1.1 $el-><M::Element.setAttributeNodeNS> ($attr);
1319     }
1320     }
1321    
1322     $node-><M::Node.appendChild> ($el);
1323     }
1324    
1325     ~ (TAGC) {
1326     lang:Perl {
1327     push @{$nodes}, $node;
1328     $node = $el;
1329     }
1330     ?lexmode ElementContent;
1331 wakaba 1.6 } (NESTC) {
1332     my $is_docel;
1333 wakaba 1.1 lang:Perl {
1334     $ns = pop @{$nses};
1335     $type = pop @{$types};
1336 wakaba 1.6 $is_docel = (@{$types} == 0);
1337     }
1338    
1339     if-true ($is_docel) {
1340     return;
1341     }
1342    
1343     ~ (TAGC) {
1344     ?lexmode ElementContent;
1345     } else {
1346     ?lexmode ElementContent;
1347 wakaba 1.1 }
1348     } else {
1349     ?lexmode ElementContent;
1350     }
1351     } else {
1352     ?lexmode ElementContent;
1353     }
1354    
1355     } (ETAGO) {
1356     // End tag
1357    
1358     ?lexmode 'EndTag';
1359    
1360     my $is_docel;
1361    
1362     ~ (Name) {
1363 wakaba 1.3 lang:Perl ($name => $token.value) : has-error {
1364 wakaba 1.1 if ($name eq $type) {
1365     $type = pop @{$types};
1366     if ($type eq '') {
1367     $is_docel = true;
1368     }
1369     $node = pop @{$nodes};
1370     $ns = pop @{$nses};
1371     } else {
1372 wakaba 1.3 my $location;
1373     __CODE{xp|get-location-from-token::
1374     $token => $token,
1375     $result => $location,
1376     }__;
1377     my $continue = __DOMCore:ERROR{xp|wf-element-type-match::
1378     DOMCore:location => {$location},
1379     xp|token => {$token},
1380     xp|expected-element-type => {$type},
1381     xp|actual-element-type => {$name},
1382     xp|node => {$node},
1383     }__;
1384     unless ($continue) {
1385     __EXCEPTION{DOMLS|PARSE_ERR}__;
1386     }
1387 wakaba 1.1 }
1388     }
1389     }
1390    
1391     ~? (S) { }
1392    
1393     if-true ($is_docel) {
1394 wakaba 1.3 lang:Perl : has-error {
1395 wakaba 1.1 if (@{$types}) {
1396 wakaba 1.3 my $location;
1397     __CODE{xp|get-location-from-token::
1398     $token => $token,
1399     $result => $location,
1400     }__;
1401     for my $type (reverse @{$types}) {
1402     my $continue = __DOMCore:ERROR{xp|wf-no-end-tag::
1403     DOMCore:location => {$location},
1404     xp|token => {$token},
1405     xp|expected-element-type => {$type},
1406     xp|node => {$node},
1407     }__;
1408     unless ($continue) {
1409     __EXCEPTION{DOMLS|PARSE_ERR}__;
1410     }
1411     $node = shift @{$nodes};
1412     }
1413 wakaba 1.1 }
1414     }
1415     return;
1416     }
1417    
1418     ~ (TAGC) {
1419     ?lexmode ElementContent;
1420     } else {
1421     ?lexmode 'ElementContent';
1422     }
1423    
1424     } (HCRO) {
1425     &_HexadecimalCharacterReference_
1426     ($doc => $doc, $parent => $node);
1427    
1428     ~ (REFC) {
1429     ?lexmode 'ElementContent';
1430     } else {
1431     ?lexmode ElementContent;
1432     }
1433     } (CRO) {
1434     &_NumericCharacterReference_
1435     ($doc => $doc, $parent => $node);
1436    
1437     ~ (REFC) {
1438     ?lexmode 'ElementContent';
1439     } else {
1440     ?lexmode ElementContent;
1441     }
1442     } (ERO) {
1443 wakaba 1.6 &_GeneralEntityReferenceEC
1444     ($doc => $doc, $parent => $node, $ns => $ns);
1445 wakaba 1.1 } (CDO) {
1446     &_CommentDeclaration_ ($doc => $doc, $parent => $node);
1447    
1448     ~ (MDC) {
1449     ?lexmode ElementContent;
1450     } else {
1451     ?lexmode ElementContent;
1452     }
1453     } (CDSO) {
1454     &_CDATASection_ ($doc => $doc, $parent => $node);
1455    
1456     ~ (MSE) {
1457     ?lexmode 'ElementContent';
1458     } else {
1459     ?lexmode ElementContent;
1460     }
1461     } (PIO) {
1462     &_ProcessingInstruction_ ($doc => $doc, $parent => $node);
1463    
1464     ~ (PIC) {
1465     ?lexmode 'ElementContent';
1466     } else {
1467     ?lexmode ElementContent;
1468     }
1469     }
1470 wakaba 1.3
1471     ~ (#NONE) { }
1472 wakaba 1.1 } // Element_
1473 wakaba 1.11
1474     /*
1475     content := [CharData]
1476     *((element / Reference / CDSect / PI / Comment) [CharData])
1477     */
1478     rule content ($parent, $ns) {
1479     // ?lexmode ElementContent;
1480    
1481     my $doc;
1482     lang:Perl {
1483     $doc = $self->{doc};
1484     }
1485    
1486     ~* (CharData) {
1487     lang:Perl ($data => $token.value) {
1488     $parent-><M::Node.appendChild>
1489     ($self->{doc}-><M::Document.createTextNode> ($data));
1490     }
1491     } (STAGO) {
1492     &Element_ ($doc => $doc, $parent => $parent, $ns => $ns)
1493     : unshift-current-token;
1494     ~ (TAGC) {
1495     ?lexmode ElementContent;
1496     } else {
1497     ?lexmode ElementContent;
1498     }
1499     } (HCRO) {
1500     &_HexadecimalCharacterReference_
1501     ($doc => $doc, $parent => $parent);
1502    
1503     ~ (REFC) {
1504     ?lexmode 'ElementContent';
1505     } else {
1506     ?lexmode ElementContent;
1507     }
1508     } (CRO) {
1509     &_NumericCharacterReference_
1510     ($doc => $doc, $parent => $parent);
1511    
1512     ~ (REFC) {
1513     ?lexmode 'ElementContent';
1514     } else {
1515     ?lexmode ElementContent;
1516     }
1517     } (ERO) {
1518     &_GeneralEntityReferenceEC
1519     ($doc => $doc, $parent => $parent, $ns => $ns);
1520     } (CDO) {
1521     &_CommentDeclaration_ ($doc => $doc, $parent => $parent);
1522    
1523     ~ (MDC) {
1524     ?lexmode ElementContent;
1525     } else {
1526     ?lexmode ElementContent;
1527     }
1528     } (CDSO) {
1529     &_CDATASection_ ($doc => $doc, $parent => $parent);
1530    
1531     ~ (MSE) {
1532     ?lexmode 'ElementContent';
1533     } else {
1534     ?lexmode ElementContent;
1535     }
1536     } (PIO) {
1537     &_ProcessingInstruction_ ($doc => $doc, $parent => $parent);
1538    
1539     ~ (PIC) {
1540     ?lexmode 'ElementContent';
1541     } else {
1542     ?lexmode ElementContent;
1543     }
1544     }
1545     } // content
1546 wakaba 1.1
1547     rule AttributeSpecificationList ($doc, $attrs)
1548     : standalone
1549     {
1550     ?lexmode 'StartTag';
1551    
1552     my $i;
1553     lang:Perl {
1554     $i = 0;
1555     }
1556    
1557     ~* (Name) {
1558     my $atqname;
1559     lang:Perl ($name => $token.value) {
1560     $atqname = $name;
1561     }
1562    
1563     my $vals;
1564 wakaba 1.18 lang:Perl : has-error {
1565 wakaba 1.1 if ($attrs->{$atqname}) {
1566 wakaba 1.3 my $location;
1567     __CODE{xp|get-location-from-token::
1568     $token => $token,
1569     $result => $location,
1570     }__;
1571     my $continue = __DOMCore:ERROR{xp|wf-unique-att-spec::
1572     DOMCore:location => {$location},
1573     xp|token => {$token},
1574     xp|name => {$atqname},
1575     }__;
1576     unless ($continue) {
1577     __EXCEPTION{DOMLS|PARSE_ERR}__;
1578     }
1579 wakaba 1.1 }
1580    
1581     $vals = $attrs->{$atqname} = {
1582     nodes => [],
1583     value => '',
1584     index => $i++,
1585     };
1586     }
1587 wakaba 1.3
1588     ~? (S) { }
1589     ~ (VI) { }
1590     ~? (S) { }
1591 wakaba 1.1
1592     ~ (LIT) {
1593     &_AttributeValueSpecification_
1594     ($doc => $doc, $vals => $vals);
1595    
1596     ~ (LIT) {
1597     ?lexmode StartTag;
1598     } else {
1599     ?lexmode StartTag;
1600     }
1601     } (LITA) {
1602     &_AttributeValueSpecificationA_
1603     ($doc => $doc, $vals => $vals);
1604    
1605     ~ (LITA) {
1606     ?lexmode StartTag;
1607     } else {
1608     ?lexmode StartTag;
1609     }
1610     }
1611     } (S) : separator : terminator? { }
1612     } // AttributeSpecificationList
1613    
1614     rule _AttributeValueSpecification_ ($doc, $vals) {
1615     // ~ (LIT) { }
1616     ?lexmode 'AttributeValueLiteral';
1617    
1618     ~* (STRING) {
1619     lang:Perl ($value => $token.value) {
1620     $value =~ s/[\x09\x0A\x0D]/ /g;
1621     my $text = $doc-><M::Document.createTextNode> ($value);
1622     push @{$vals->{nodes}}, $text;
1623     $vals->{value} .= $value;
1624     }
1625     } (HCRO) {
1626     &_HexadecimalCharacterReferenceV_
1627     ($doc => $doc, $vals => $vals);
1628    
1629     ~ (REFC) {
1630     ?lexmode AttributeValueLiteral;
1631     } else {
1632     ?lexmode AttributeValueLiteral;
1633     }
1634     } (CRO) {
1635     &_NumericCharacterReferenceV_
1636     ($doc => $doc, $vals => $vals);
1637    
1638     ~ (REFC) {
1639     ?lexmode AttributeValueLiteral;
1640     } else {
1641     ?lexmode AttributeValueLiteral;
1642     }
1643     } (ERO) {
1644     // TODO: Attribute value normalization
1645     &_GeneralEntityReferenceV_
1646     ($doc => $doc, $vals => $vals);
1647    
1648     ~ (REFC) {
1649     ?lexmode AttributeValueLiteral;
1650     } else {
1651     ?lexmode AttributeValueLiteral;
1652     }
1653     }
1654    
1655     // ~ (LIT) { } (LITA) { }
1656     } // _AttributeValueSpecification_
1657    
1658     rule _AttributeValueSpecificationA_ ($doc, $vals) {
1659     // ~ (LITA) { }
1660     ?lexmode 'AttributeValueLiteralA';
1661    
1662     ~* (STRING) {
1663     lang:Perl ($value => $token.value) {
1664     $value =~ s/[\x09\x0A\x0D]/ /g;
1665     my $text = $doc-><M::Document.createTextNode> ($value);
1666     push @{$vals->{nodes}}, $text;
1667     $vals->{value} .= $value;
1668     }
1669     } (HCRO) {
1670     &_HexadecimalCharacterReferenceV_
1671     ($doc => $doc, $vals => $vals);
1672    
1673     ~ (REFC) {
1674     ?lexmode AttributeValueLiteralA;
1675     } else {
1676     ?lexmode AttributeValueLiteralA;
1677     }
1678     } (CRO) {
1679     &_NumericCharacterReferenceV_
1680     ($doc => $doc, $vals => $vals);
1681    
1682     ~ (REFC) {
1683     ?lexmode AttributeValueLiteralA;
1684     } else {
1685     ?lexmode AttributeValueLiteralA;
1686     }
1687     } (ERO) {
1688     // TODO: Attribute value normalization
1689     &_GeneralEntityReferenceV_
1690     ($doc => $doc, $vals => $vals);
1691    
1692     ~ (REFC) {
1693     ?lexmode AttributeValueLiteralA;
1694     } else {
1695     ?lexmode AttributeValueLiteralA;
1696     }
1697     }
1698    
1699     // ~ (LITA) { }
1700     } // _AttributeValueSpecificationA_
1701    
1702     /*
1703 wakaba 1.11 Parsing replacement text of an entity referenced in
1704     an attribute value specification.
1705     */
1706     rule AttributeValueLiteralE_ ($parent, $vals)
1707     : recursive
1708     {
1709     // ?lexmode AttributeValueLiteralE;
1710    
1711     ~* (STRING) {
1712     lang:Perl ($value => $token.value) {
1713     $value =~ s/[\x09\x0A\x0D]/ /g;
1714     my $text = $self->{doc}-><M::Document.createTextNode> ($value);
1715     $parent-><M::Node.appendChild> ($text);
1716     $vals->{value} .= $value;
1717     }
1718     } (HCRO) {
1719     &_HexadecimalCharacterReferenceAE_
1720     ($parent => $parent, $vals => $vals);
1721    
1722     ~ (REFC) {
1723     ?lexmode AttributeValueLiteralE;
1724     } else {
1725     ?lexmode AttributeValueLiteralE;
1726     }
1727     } (CRO) {
1728     &_NumericCharacterReferenceAE_
1729     ($parent => $parent, $vals => $vals);
1730    
1731     ~ (REFC) {
1732     ?lexmode AttributeValueLiteralE;
1733     } else {
1734     ?lexmode AttributeValueLiteralE;
1735     }
1736     } (ERO) {
1737     &_GeneralEntityReferenceAE_ ($parent => $parent, $vals => $vals);
1738    
1739     ~ (REFC) {
1740     ?lexmode AttributeValueLiteralE;
1741     } else {
1742     ?lexmode AttributeValueLiteralE;
1743     }
1744 wakaba 1.18 } (#INVALID == '<') {
1745     lang:Perl : has-error {
1746     my $location;
1747     __CODE{xp|get-location-from-token::
1748     $token => $token,
1749     $result => $location,
1750     }__;
1751     my $continue = __DOMCore:ERROR{xp|wf-no-lt-in-attribute-values::
1752     c|location => {$location},
1753     xp|token => {$token},
1754     }__;
1755     unless ($continue) {
1756     __EXCEPTION{DOMLS|PARSE_ERR}__;
1757     }
1758    
1759     my $text = $self->{doc}-><M::Document.createTextNode> ('<');
1760     $parent-><M::Node.appendChild> ($text);
1761     $vals->{value} .= '<';
1762     }
1763 wakaba 1.11 }
1764    
1765     // ~ (#EOF) { }
1766     } // AttributeValueLiteralE_
1767    
1768     /*
1769 wakaba 1.1 CDATA Section Content Parsing Mode
1770     */
1771     rule _CDATASection_ ($doc, $parent) {
1772     ?lexmode 'CDATASectionContent';
1773    
1774     my $cdata;
1775    
1776 wakaba 1.2 ~? (CData) {
1777 wakaba 1.1 lang:Perl ($data => $token.value) {
1778     $cdata = $data;
1779     }
1780     } else {
1781     lang:Perl {
1782     $cdata = '';
1783     }
1784     }
1785    
1786     lang:Perl {
1787     my $cdsect = $doc-><M::Document.createCDATASection>
1788     ($cdata);
1789     $parent-><M::Node.appendChild> ($cdsect);
1790     }
1791    
1792     // ~ (MSE) { }
1793     } // _CDATASection_
1794    
1795     rule _NumericCharacterReference_ ($doc, $parent) {
1796     ?lexmode 'NumericCharacterReference';
1797    
1798     ~ (NUMBER) {
1799 wakaba 1.3 lang:Perl ($num => $token.value) : has-error {
1800     $num += 0;
1801     unless (
1802     ($self->{xml_version} eq '1.0' and
1803     ((0x0020 <= $num and $num <= 0xD7FF) or
1804     (0xE000 <= $num and $num <= 0xFFFD) or
1805     (0x10000 <= $num and $num <= 0x10FFFF) or
1806     $num == 0x9 or $num == 0xA or $num == 0xD)) or
1807     ($self->{xml_version} eq '1.1' and
1808     ((0x0001 <= $num and $num <= 0xD7FF) or
1809     (0xE000 <= $num and $num <= 0xFFFD) or
1810     (0x10000 <= $num and $num <= 0x10FFFF)))
1811     ) {
1812     my $location;
1813     __CODE{xp|get-location-from-token::
1814     $token => $token,
1815     $result => $location,
1816     }__;
1817     my $continue = __DOMCore:ERROR{xp|wf-legal-character::
1818     DOMCore:location => {$location},
1819     xp|token => {$token},
1820     xp|character-number => {$num},
1821     xp|parent => {$parent},
1822     }__;
1823     unless ($continue) {
1824     __EXCEPTION{DOMLS|PARSE_ERR}__;
1825     }
1826     }
1827     my $ncr = $doc-><M::Document.createTextNode> (chr $num);
1828 wakaba 1.1 $parent-><M::Node.appendChild> ($ncr);
1829     }
1830     }
1831    
1832     // ~ (REFC) { }
1833     } // _NumericCharacterReference_
1834    
1835     rule _NumericCharacterReferenceV_ ($doc, $vals) {
1836     ?lexmode 'NumericCharacterReference';
1837    
1838     ~ (NUMBER) {
1839 wakaba 1.3 lang:Perl ($num => $token.value) : has-error {
1840     $num += 0;
1841     unless (
1842     ($self->{xml_version} eq '1.0' and
1843     ((0x0020 <= $num and $num <= 0xD7FF) or
1844     (0xE000 <= $num and $num <= 0xFFFD) or
1845     (0x10000 <= $num and $num <= 0x10FFFF) or
1846     $num == 0x9 or $num == 0xA or $num == 0xD)) or
1847     ($self->{xml_version} eq '1.1' and
1848     ((0x0001 <= $num and $num <= 0xD7FF) or
1849     (0xE000 <= $num and $num <= 0xFFFD) or
1850     (0x10000 <= $num and $num <= 0x10FFFF)))
1851     ) {
1852     my $location;
1853     __CODE{xp|get-location-from-token::
1854     $token => $token,
1855     $result => $location,
1856     }__;
1857     my $continue = __DOMCore:ERROR{xp|wf-legal-character::
1858     DOMCore:location => {$location},
1859     xp|token => {$token},
1860     xp|character-number => {$num},
1861     }__;
1862     unless ($continue) {
1863     __EXCEPTION{DOMLS|PARSE_ERR}__;
1864     }
1865     }
1866 wakaba 1.1 my $ncr = $doc-><M::Document.createTextNode>
1867 wakaba 1.9 (my $char = chr $num);
1868 wakaba 1.1 push @{$vals->{nodes}}, $ncr;
1869     $vals->{value} .= $char;
1870     }
1871     }
1872    
1873     // ~ (REFC) { }
1874     } // _NumericCharacterReferenceV_
1875    
1876 wakaba 1.11 /*
1877     Numeric character reference in the replacement text
1878     of the entity referenced in an attribute value specification
1879     */
1880     rule _NumericCharacterReferenceAE_ ($parent, $vals)
1881     {
1882     ?lexmode NumericCharacterReference;
1883    
1884     ~ (NUMBER) {
1885     lang:Perl ($num => $token.value) : has-error {
1886     $num += 0;
1887     unless (
1888     ($self->{xml_version} eq '1.0' and
1889     ((0x0020 <= $num and $num <= 0xD7FF) or
1890     (0xE000 <= $num and $num <= 0xFFFD) or
1891     (0x10000 <= $num and $num <= 0x10FFFF) or
1892     $num == 0x9 or $num == 0xA or $num == 0xD)) or
1893     ($self->{xml_version} eq '1.1' and
1894     ((0x0001 <= $num and $num <= 0xD7FF) or
1895     (0xE000 <= $num and $num <= 0xFFFD) or
1896     (0x10000 <= $num and $num <= 0x10FFFF)))
1897     ) {
1898     my $location;
1899     __CODE{xp|get-location-from-token::
1900     $token => $token,
1901     $result => $location,
1902     }__;
1903     my $continue = __DOMCore:ERROR{xp|wf-legal-character::
1904     DOMCore:location => {$location},
1905     xp|token => {$token},
1906     xp|character-number => {$num},
1907     }__;
1908     unless ($continue) {
1909     __EXCEPTION{DOMLS|PARSE_ERR}__;
1910     }
1911     }
1912     my $ncr = $self->{doc}-><M::Document.createTextNode>
1913     (my $char = chr $num);
1914     $parent-><M::Node.appendChild> ($ncr);
1915     $vals->{value} .= $char;
1916     }
1917     }
1918    
1919     // ~ (REFC) { }
1920     } // _NumericCharacterReferenceAE_
1921    
1922     rule _NumericCharacterReferenceEV_ ($vals)
1923     {
1924     ?lexmode 'NumericCharacterReference';
1925    
1926     ~ (NUMBER) {
1927     lang:Perl ($num => $token.value) : has-error {
1928     $num += 0;
1929     unless (
1930     ($self->{xml_version} eq '1.0' and
1931     ((0x0020 <= $num and $num <= 0xD7FF) or
1932     (0xE000 <= $num and $num <= 0xFFFD) or
1933     (0x10000 <= $num and $num <= 0x10FFFF) or
1934     $num == 0x9 or $num == 0xA or $num == 0xD)) or
1935     ($self->{xml_version} eq '1.1' and
1936     ((0x0001 <= $num and $num <= 0xD7FF) or
1937     (0xE000 <= $num and $num <= 0xFFFD) or
1938     (0x10000 <= $num and $num <= 0x10FFFF)))
1939     ) {
1940     my $location;
1941     __CODE{xp|get-location-from-token::
1942     $token => $token,
1943     $result => $location,
1944     }__;
1945     my $continue = __DOMCore:ERROR{xp|wf-legal-character::
1946     DOMCore:location => {$location},
1947     xp|token => {$token},
1948     xp|character-number => {$num},
1949     }__;
1950     unless ($continue) {
1951     __EXCEPTION{DOMLS|PARSE_ERR}__;
1952     }
1953     }
1954     push @{$vals}, chr $num;
1955     }
1956     }
1957    
1958     // ~ (REFC) { }
1959     } // _NumericCharacterReferenceEV_
1960    
1961 wakaba 1.1 rule _HexadecimalCharacterReference_ ($doc, $parent) {
1962     ?lexmode 'HexadecimalCharacterReference';
1963    
1964     ~ (Hex) {
1965 wakaba 1.9 lang:Perl ($v => $token.value) : has-error {
1966     my $num = hex $v;
1967 wakaba 1.3 unless (
1968     ($self->{xml_version} eq '1.0' and
1969     ((0x0020 <= $num and $num <= 0xD7FF) or
1970     (0xE000 <= $num and $num <= 0xFFFD) or
1971     (0x10000 <= $num and $num <= 0x10FFFF) or
1972     $num == 0x9 or $num == 0xA or $num == 0xD)) or
1973     ($self->{xml_version} eq '1.1' and
1974     ((0x0001 <= $num and $num <= 0xD7FF) or
1975     (0xE000 <= $num and $num <= 0xFFFD) or
1976     (0x10000 <= $num and $num <= 0x10FFFF)))
1977     ) {
1978     my $location;
1979     __CODE{xp|get-location-from-token::
1980     $token => $token,
1981     $result => $location,
1982     }__;
1983     my $continue = __DOMCore:ERROR{xp|wf-legal-character::
1984     DOMCore:location => {$location},
1985     xp|token => {$token},
1986     xp|character-number => {$num},
1987     xp|parent => {$parent},
1988     }__;
1989     unless ($continue) {
1990     __EXCEPTION{DOMLS|PARSE_ERR}__;
1991     }
1992     }
1993 wakaba 1.1 my $ncr = $doc-><M::Document.createTextNode>
1994 wakaba 1.9 (chr $num);
1995 wakaba 1.1 $parent-><M::Node.appendChild> ($ncr);
1996     }
1997     }
1998    
1999     // ~ (REFC) { }
2000     } // _HexadecimalCharacterReference_
2001    
2002 wakaba 1.3 rule _HexadecimalCharacterReferenceV_ ($doc, $vals) {
2003 wakaba 1.1 ?lexmode 'HexadecimalCharacterReference';
2004    
2005     ~ (Hex) {
2006 wakaba 1.9 lang:Perl ($v => $token.value) : has-error {
2007     my $num = hex $v;
2008 wakaba 1.3 unless (
2009     ($self->{xml_version} eq '1.0' and
2010     ((0x0020 <= $num and $num <= 0xD7FF) or
2011     (0xE000 <= $num and $num <= 0xFFFD) or
2012     (0x10000 <= $num and $num <= 0x10FFFF) or
2013     $num == 0x9 or $num == 0xA or $num == 0xD)) or
2014     ($self->{xml_version} eq '1.1' and
2015     ((0x0001 <= $num and $num <= 0xD7FF) or
2016     (0xE000 <= $num and $num <= 0xFFFD) or
2017     (0x10000 <= $num and $num <= 0x10FFFF)))
2018     ) {
2019     my $location;
2020     __CODE{xp|get-location-from-token::
2021     $token => $token,
2022     $result => $location,
2023     }__;
2024     my $continue = __DOMCore:ERROR{xp|wf-legal-character::
2025     DOMCore:location => {$location},
2026     xp|token => {$token},
2027     xp|character-number => {$num},
2028     }__;
2029     unless ($continue) {
2030     __EXCEPTION{DOMLS|PARSE_ERR}__;
2031     }
2032     }
2033 wakaba 1.1 my $ncr = $doc-><M::Document.createTextNode>
2034 wakaba 1.9 (my $char = chr $num);
2035 wakaba 1.1 push @{$vals->{nodes}}, $ncr;
2036     $vals->{value} .= $char;
2037     }
2038     }
2039    
2040     // ~ (REFC) { }
2041 wakaba 1.11 } // _HexadecimalCharacterReferenceV_
2042    
2043     /*
2044     Hexadecimal character reference in the replacement text
2045     of the entity referenced in an attribute value literal
2046     */
2047     rule _HexadecimalCharacterReferenceAE_ ($parent, $vals)
2048     {
2049     ?lexmode HexadecimalCharacterReference;
2050    
2051     ~ (Hex) {
2052     lang:Perl ($v => $token.value) : has-error {
2053     my $num = hex $v;
2054     unless (
2055     ($self->{xml_version} eq '1.0' and
2056     ((0x0020 <= $num and $num <= 0xD7FF) or
2057     (0xE000 <= $num and $num <= 0xFFFD) or
2058     (0x10000 <= $num and $num <= 0x10FFFF) or
2059     $num == 0x9 or $num == 0xA or $num == 0xD)) or
2060     ($self->{xml_version} eq '1.1' and
2061     ((0x0001 <= $num and $num <= 0xD7FF) or
2062     (0xE000 <= $num and $num <= 0xFFFD) or
2063     (0x10000 <= $num and $num <= 0x10FFFF)))
2064     ) {
2065     my $location;
2066     __CODE{xp|get-location-from-token::
2067     $token => $token,
2068     $result => $location,
2069     }__;
2070     my $continue = __DOMCore:ERROR{xp|wf-legal-character::
2071     DOMCore:location => {$location},
2072     xp|token => {$token},
2073     xp|character-number => {$num},
2074     }__;
2075     unless ($continue) {
2076     __EXCEPTION{DOMLS|PARSE_ERR}__;
2077     }
2078     }
2079     my $ncr = $self->{doc}-><M::Document.createTextNode>
2080     (my $char = chr $num);
2081     $parent-><M::Node.appendChild> ($ncr);
2082     $vals->{value} .= $char;
2083     }
2084     }
2085    
2086     // ~ (REFC) { }
2087     } // _HexadecimalCharacterReferenceAE_
2088    
2089     rule _HexadecimalCharacterReferenceEV_ ($vals) {
2090     ?lexmode HexadecimalCharacterReference;
2091    
2092     ~ (Hex) {
2093     lang:Perl ($v => $token.value) : has-error {
2094     my $num = hex $v;
2095     unless (
2096     ($self->{xml_version} eq '1.0' and
2097     ((0x0020 <= $num and $num <= 0xD7FF) or
2098     (0xE000 <= $num and $num <= 0xFFFD) or
2099     (0x10000 <= $num and $num <= 0x10FFFF) or
2100     $num == 0x9 or $num == 0xA or $num == 0xD)) or
2101     ($self->{xml_version} eq '1.1' and
2102     ((0x0001 <= $num and $num <= 0xD7FF) or
2103     (0xE000 <= $num and $num <= 0xFFFD) or
2104     (0x10000 <= $num and $num <= 0x10FFFF)))
2105     ) {
2106     my $location;
2107     __CODE{xp|get-location-from-token::
2108     $token => $token,
2109     $result => $location,
2110     }__;
2111     my $continue = __DOMCore:ERROR{xp|wf-legal-character::
2112     DOMCore:location => {$location},
2113     xp|token => {$token},
2114     xp|character-number => {$num},
2115     }__;
2116     unless ($continue) {
2117     __EXCEPTION{DOMLS|PARSE_ERR}__;
2118     }
2119     }
2120     push @{$vals}, chr $num;
2121     }
2122     }
2123    
2124     // ~ (REFC) { }
2125     } // _HexadecimalCharacterReferenceEV_
2126    
2127     /*
2128     General entity reference in element's content
2129     */
2130     rule _GeneralEntityReferenceEC ($doc, $parent, $ns)
2131     : recursive
2132     {
2133     ?lexmode 'EntityReference';
2134    
2135     ~ (Name == 'lt') {
2136     lang:Perl {
2137     $parent-><M::Node.appendChild>
2138     ($self->{doc}-><M::Document.createTextNode> ('<'));
2139     }
2140     } (Name == 'gt') {
2141     lang:Perl {
2142     $parent-><M::Node.appendChild>
2143     ($self->{doc}-><M::Document.createTextNode> ('>'));
2144     }
2145     } (Name == 'amp') {
2146     lang:Perl {
2147     $parent-><M::Node.appendChild>
2148     ($self->{doc}-><M::Document.createTextNode> ('&'));
2149     }
2150     } (Name == 'quot') {
2151     lang:Perl {
2152     $parent-><M::Node.appendChild>
2153     ($self->{doc}-><M::Document.createTextNode> ('"'));
2154     }
2155     } (Name == 'apos') {
2156     lang:Perl {
2157     $parent-><M::Node.appendChild>
2158     ($self->{doc}-><M::Document.createTextNode> ("'"));
2159     }
2160     } (Name) {
2161     my $er;
2162 wakaba 1.19 lang:Perl ($name => $token.value) : has-error {
2163 wakaba 1.11 ## TODO: Namespace well-formedness
2164     $er = $doc-><M::Document.createEntityReference>
2165     ($name);
2166 wakaba 1.20 $er-><AS::Node.textContent> ('');
2167     ## NOTE: When document entity (and entities referenced directly
2168     ## or indirectly from it) is parsed, no general entity
2169     ## node have its replacement tree. During general
2170     ## entity node collection construction, however,
2171     ## some entity node has replacement tree.
2172 wakaba 1.11 $parent-><M::Node.appendChild> ($er);
2173 wakaba 1.19
2174     my $ent = $self->{general_entity}->{$name};
2175     if (not $ent) { # no entity declaration
2176     if ($self->{standalone} or not $self->{has_xref}) { # WFC error
2177     my $location;
2178     __CODE{xp|get-location-from-token::
2179     $token => {$token},
2180     $result => {$location},
2181     }__;
2182     my $continue = __DOMCore:ERROR{xp|wf-entity-declared::
2183     xp|error-token => {$token},
2184     c|location => {$location},
2185     xp|name => {$name},
2186     }__;
2187     unless ($continue) {
2188     __EXCEPTION{DOMLS|PARSE_ERR}__;
2189     }
2190     } # Otherwise VC error
2191 wakaba 1.23 push @{$self->{entity}}, <Code::getEmptyEntityState::
2192     $name = $name>;
2193 wakaba 1.20 $er-><AS::x|EntityReference.isExpanded> (false);
2194 wakaba 1.19
2195     } else { # there IS entity declaration
2196     if (($self->{standalone} or not $self->{has_xref}) and
2197     $ent->{is_externally_declared} and
2198     not $self->{entity}->[-1]->{is_externally_declared}) {
2199     my $location;
2200     __CODE{xp|get-location-from-token::
2201     $token => {$token},
2202     $result => {$location},
2203     }__;
2204     my $continue = __DOMCore:ERROR{xp|wf-entity-declared::
2205     xp|error-token => {$token},
2206     c|location => {$location},
2207     xp|name => {$name},
2208     }__;
2209     unless ($continue) {
2210     __EXCEPTION{DOMLS|PARSE_ERR}__;
2211     }
2212     }
2213     $er-><AS::x|EntityReference.isExpanded>
2214     ($ent->{has_replacement_text});
2215     push @{$self->{entity}}, <Code::getCopyOfEntityState::
2216 wakaba 1.11 $entity_type = 'general_entity',
2217     $entity_name = $name>;
2218 wakaba 1.23
2219     if (defined $ent->{notation}) {
2220     my $location;
2221     __CODE{xp|get-location-from-token::
2222     $token => {$token},
2223     $result => {$location},
2224     }__;
2225     my $continue = __c|ERROR{xp|wf-parsed-entity::
2226     xp|error-token => {$token},
2227     c|location => {$location},
2228     xp|name => {$name},
2229     }__;
2230     unless ($continue) {
2231     __EXCEPTION{DOMLS|PARSE_ERR::
2232     }__;
2233     }
2234     } # if unparsed entity
2235    
2236     if ($ent->{is_opened}) {
2237     my $location;
2238     __CODE{xp|get-location-from-token::
2239     $token => {$token},
2240     $result => {$location},
2241     }__;
2242     my $continue = __c|ERROR{xp|wf-no-recursion::
2243     xp|error-token => {$token},
2244     c|location => {$location},
2245     xp|name => {$name},
2246     }__;
2247     unless ($continue) {
2248     __EXCEPTION{DOMLS|PARSE_ERR::
2249     }__;
2250     }
2251     $self->{entity}->[-1]->{reptxt} = \'';
2252     $er-><AS::x|EntityReference.isExpanded> (false);
2253     } # recursive
2254     $ent->{is_opened} = true;
2255     } # entity declared
2256 wakaba 1.14 $self->{location} = $self->{entity}->[-1];
2257 wakaba 1.11 push @{$self->{entity_token}}, $self->{token};
2258     $self->{token} = [];
2259     push @{$self->{entity_char}}, $self->{char};
2260     $self->{char} = [];
2261     }
2262    
2263     ?lexmode ElementContent;
2264     &content ($doc => $doc, $parent => $er, $ns => $ns);
2265     ~ (#EOF) { }
2266     lang:Perl {
2267 wakaba 1.23 $self->{general_entity}->{$self->{entity}->[-1]->{name}}
2268     ->{is_opened} = false
2269     if $self->{general_entity}->{$self->{entity}->[-1]->{name}};
2270 wakaba 1.11 $self->{token} = pop @{$self->{entity_token}};
2271     $self->{char} = pop @{$self->{entity_char}};
2272     pop @{$self->{entity}};
2273 wakaba 1.14 $self->{location} = $self->{entity}->[-1];
2274 wakaba 1.11 }
2275    
2276     // TODO: Set read-only flag
2277    
2278     ?lexmode EntityReference;
2279     ?requires-next-token;
2280     }
2281    
2282     ~ (REFC) {
2283     ?lexmode ElementContent;
2284     } else {
2285     ?lexmode ElementContent;
2286     }
2287     } // _GeneralEntityReferenceEC
2288    
2289     /*
2290     General entity reference in an attribute value literal
2291     */
2292     rule _GeneralEntityReferenceV_ ($vals) {
2293     ?lexmode EntityReference;
2294    
2295     ~ (Name == 'lt') {
2296     lang:Perl {
2297     push @{$vals->{nodes}}, $self->{doc}-><M::Document.createTextNode>
2298     ('<');
2299     $vals->{value} .= '<';
2300     }
2301     } (Name == 'gt') {
2302     lang:Perl {
2303     push @{$vals->{nodes}}, $self->{doc}-><M::Document.createTextNode>
2304     ('>');
2305     $vals->{value} .= '>';
2306     }
2307     } (Name == 'amp') {
2308     lang:Perl {
2309     push @{$vals->{nodes}}, $self->{doc}-><M::Document.createTextNode>
2310     ('&');
2311     $vals->{value} .= '&';
2312     }
2313     } (Name == 'quot') {
2314     lang:Perl {
2315     push @{$vals->{nodes}}, $self->{doc}-><M::Document.createTextNode>
2316     ('"');
2317     $vals->{value} .= '"';
2318     }
2319     } (Name == 'apos') {
2320     lang:Perl {
2321     push @{$vals->{nodes}}, $self->{doc}-><M::Document.createTextNode>
2322     ("'");
2323     $vals->{value} .= "'";
2324     }
2325     } (Name) {
2326     my $er;
2327 wakaba 1.18 lang:Perl ($name => $token.value) : has-error {
2328 wakaba 1.11 ## TODO: Namespace well-formedness
2329 wakaba 1.18
2330 wakaba 1.11 $er = $self->{doc}-><M::Document.createEntityReference> ($name);
2331 wakaba 1.20 $er-><AS::Node.textContent> ('');
2332     ## NOTE: When document entity (and entities referenced directly
2333     ## or indirectly from it) is parsed, no general entity
2334     ## node have its replacement tree. During general
2335     ## entity node collection construction, however,
2336     ## some entity node has replacement tree.
2337 wakaba 1.19 my $ent = $self->{general_entity}->{$name};
2338 wakaba 1.20 if (not $ent) { # no entity declaration
2339     if ($self->{standalone} or not $self->{has_xref}) { # WFC error
2340     my $location;
2341     __CODE{xp|get-location-from-token::
2342     $token => {$token},
2343     $result => {$location},
2344     }__;
2345     my $continue = __DOMCore:ERROR{xp|wf-entity-declared::
2346     xp|error-token => {$token},
2347     c|location => {$location},
2348     xp|name => {$name},
2349     }__;
2350     unless ($continue) {
2351     __EXCEPTION{DOMLS|PARSE_ERR}__;
2352     }
2353     } # Otherwise VC error
2354 wakaba 1.23 push @{$self->{entity}}, <Code::getEmptyEntityState::
2355     $name = $name>;
2356 wakaba 1.20 $er-><AS::x|EntityReference.isExpanded> (false);
2357    
2358     } else { # there IS entity declaration
2359     if (($self->{standalone} or not $self->{has_xref}) and
2360     $ent->{is_externally_declared} and
2361     not $self->{entity}->[-1]->{is_externally_declared}) {
2362     my $location;
2363     __CODE{xp|get-location-from-token::
2364     $token => {$token},
2365     $result => {$location},
2366     }__;
2367     my $continue = __DOMCore:ERROR{xp|wf-entity-declared::
2368     xp|error-token => {$token},
2369     c|location => {$location},
2370     xp|name => {$name},
2371     }__;
2372     unless ($continue) {
2373     __EXCEPTION{DOMLS|PARSE_ERR}__;
2374     }
2375     }
2376    
2377     if ($ent->{is_external_entity}) {
2378     my $location;
2379     __CODE{xp|get-location-from-token::
2380     $token => {$token},
2381     $result => {$location},
2382     }__;
2383     my $continue = __c|ERROR{xp|wf-no-external-entity-references::
2384     xp|error-token => {$token},
2385     c|location => {$location},
2386     xp|name => {$name},
2387     }__;
2388     unless ($continue) {
2389     __EXCEPTION{DOMLS|PARSE_ERR::
2390     }__;
2391     }
2392 wakaba 1.23 ## NOTE: |xp:wf-parsed-entity| is not checked
2393 wakaba 1.20 } # if external entity
2394    
2395     $er-><AS::x|EntityReference.isExpanded>
2396 wakaba 1.19 ($ent->{has_replacement_text});
2397 wakaba 1.20 push @{$self->{entity}}, <Code::getCopyOfEntityState::
2398 wakaba 1.11 $entity_type = 'general_entity',
2399     $entity_name = $name>;
2400 wakaba 1.23
2401     if ($ent->{is_opened}) {
2402     my $location;
2403     __CODE{xp|get-location-from-token::
2404     $token => {$token},
2405     $result => {$location},
2406     }__;
2407     my $continue = __c|ERROR{xp|wf-no-recursion::
2408     xp|error-token => {$token},
2409     c|location => {$location},
2410     xp|name => {$name},
2411     }__;
2412     unless ($continue) {
2413     __EXCEPTION{DOMLS|PARSE_ERR::
2414     }__;
2415     }
2416     $self->{entity}->[-1]->{reptxt} = \'';
2417     $er-><AS::x|EntityReference.isExpanded> (false);
2418     } # recursive
2419     $ent->{is_opened} = true;
2420 wakaba 1.20 }
2421     push @{$vals->{nodes}}, $er;
2422 wakaba 1.14 $self->{location} = $self->{entity}->[-1];
2423 wakaba 1.11 push @{$self->{entity_token}}, $self->{token};
2424     $self->{token} = [];
2425     push @{$self->{entity_char}}, $self->{char};
2426     $self->{char} = [];
2427     }
2428    
2429     ?lexmode AttributeValueLiteralE;
2430     &AttributeValueLiteralE_ ($parent => $er, $vals => $vals);
2431     ~ (#EOF) { }
2432     lang:Perl {
2433 wakaba 1.23 $self->{general_entity}->{$self->{entity}->[-1]->{name}}
2434     ->{is_opened} = false
2435     if $self->{general_entity}->{$self->{entity}->[-1]->{name}};
2436 wakaba 1.11 $self->{token} = pop @{$self->{entity_token}};
2437     $self->{char} = pop @{$self->{entity_char}};
2438     pop @{$self->{entity}};
2439 wakaba 1.14 $self->{location} = $self->{entity}->[-1];
2440 wakaba 1.11 }
2441    
2442     // TODO: Set read-only flag
2443    
2444     ?lexmode EntityReference;
2445     ?requires-next-token;
2446     }
2447    
2448     // ~ (REFC) { }
2449     } // _GeneralEntityReferenceV_
2450 wakaba 1.1
2451 wakaba 1.6 /*
2452 wakaba 1.11 General entity reference in the replacement text
2453     of the entity referenced in an attribute value literal
2454 wakaba 1.6 */
2455 wakaba 1.11 rule _GeneralEntityReferenceAE_ ($parent, $vals)
2456 wakaba 1.6 {
2457 wakaba 1.11 ?lexmode EntityReference;
2458 wakaba 1.1
2459 wakaba 1.11 ~ (Name == 'lt') {
2460     lang:Perl {
2461     $parent-><M::Node.appendChild>
2462     ($self->{doc}-><M::Document.createTextNode> ('<'));
2463     $vals->{value} .= '<';
2464     }
2465     } (Name == 'gt') {
2466     lang:Perl {
2467     $parent-><M::Node.appendChild>
2468     ($self->{doc}-><M::Document.createTextNode> ('>'));
2469     $vals->{value} .= '>';
2470     }
2471     } (Name == 'amp') {
2472     lang:Perl {
2473     $parent-><M::Node.appendChild>
2474     ($self->{doc}-><M::Document.createTextNode> ('&'));
2475     $vals->{value} .= '&';
2476     }
2477     } (Name == 'quot') {
2478     lang:Perl {
2479     $parent-><M::Node.appendChild>
2480     ($self->{doc}-><M::Document.createTextNode> ('"'));
2481     $vals->{value} .= '"';
2482     }
2483     } (Name == 'apos') {
2484     lang:Perl {
2485     $parent-><M::Node.appendChild>
2486     ($self->{doc}-><M::Document.createTextNode> ("'"));
2487     $vals->{value} .= "'";
2488     }
2489     } (Name) {
2490 wakaba 1.6 my $er;
2491 wakaba 1.1 lang:Perl ($name => $token.value) {
2492     ## TODO: Namespace well-formedness
2493 wakaba 1.18
2494 wakaba 1.11 $er = $self->{doc}-><M::Document.createEntityReference> ($name);
2495 wakaba 1.20 $er-><AS::Node.textContent> ('');
2496     ## NOTE: When document entity (and entities referenced directly
2497     ## or indirectly from it) is parsed, no general entity
2498     ## node have its replacement tree. During general
2499     ## entity node collection construction, however,
2500     ## some entity node has replacement tree.
2501 wakaba 1.19 my $ent = $self->{general_entity}->{$name};
2502 wakaba 1.22 if (not $ent) { # no entity declaration
2503     if ($self->{standalone} or not $self->{has_xref}) { # WFC error
2504     my $location;
2505     __CODE{xp|get-location-from-token::
2506     $token => {$token},
2507     $result => {$location},
2508     }__;
2509     my $continue = __DOMCore:ERROR{xp|wf-entity-declared::
2510     xp|error-token => {$token},
2511     c|location => {$location},
2512     xp|name => {$name},
2513     }__;
2514     unless ($continue) {
2515     __EXCEPTION{DOMLS|PARSE_ERR}__;
2516     }
2517     } # Otherwise VC error
2518 wakaba 1.23 push @{$self->{entity}}, <Code::getEmptyEntityState::
2519     $name = $name>;
2520 wakaba 1.22 $er-><AS::x|EntityReference.isExpanded> (false);
2521    
2522     } else { # there IS entity declaration
2523     if (($self->{standalone} or not $self->{has_xref}) and
2524     $ent->{is_externally_declared} and
2525     not $self->{entity}->[-1]->{is_externally_declared}) {
2526     my $location;
2527     __CODE{xp|get-location-from-token::
2528     $token => {$token},
2529     $result => {$location},
2530     }__;
2531     my $continue = __DOMCore:ERROR{xp|wf-entity-declared::
2532     xp|error-token => {$token},
2533     c|location => {$location},
2534     xp|name => {$name},
2535     }__;
2536     unless ($continue) {
2537     __EXCEPTION{DOMLS|PARSE_ERR}__;
2538     }
2539     }
2540    
2541     if ($ent->{is_external_entity}) {
2542     my $location;
2543     __CODE{xp|get-location-from-token::
2544     $token => {$token},
2545     $result => {$location},
2546     }__;
2547     my $continue = __c|ERROR{xp|wf-no-external-entity-references::
2548     xp|error-token => {$token},
2549     c|location => {$location},
2550     xp|name => {$name},
2551     }__;
2552     unless ($continue) {
2553     __EXCEPTION{DOMLS|PARSE_ERR::
2554     }__;
2555     }
2556 wakaba 1.23 ## NOTE: |xp:wf-parsed-entity| is not checked
2557 wakaba 1.22 } # if external entity
2558    
2559     $er-><AS::x|EntityReference.isExpanded>
2560 wakaba 1.19 ($ent->{has_replacement_text});
2561 wakaba 1.22 push @{$self->{entity}}, <Code::getCopyOfEntityState::
2562 wakaba 1.6 $entity_type = 'general_entity',
2563     $entity_name = $name>;
2564 wakaba 1.23
2565     if ($ent->{is_opened}) {
2566     my $location;
2567     __CODE{xp|get-location-from-token::
2568     $token => {$token},
2569     $result => {$location},
2570     }__;
2571     my $continue = __c|ERROR{xp|wf-no-recursion::
2572     xp|error-token => {$token},
2573     c|location => {$location},
2574     xp|name => {$name},
2575     }__;
2576     unless ($continue) {
2577     __EXCEPTION{DOMLS|PARSE_ERR::
2578     }__;
2579     }
2580     $self->{entity}->[-1]->{reptxt} = \'';
2581     $er-><AS::x|EntityReference.isExpanded> (false);
2582     } # recursive
2583     $ent->{is_opened} = true;
2584 wakaba 1.22 }
2585     $parent-><M::Node.appendChild> ($er);
2586 wakaba 1.14 $self->{location} = $self->{entity}->[-1];
2587 wakaba 1.6 push @{$self->{entity_token}}, $self->{token};
2588     $self->{token} = [];
2589     push @{$self->{entity_char}}, $self->{char};
2590     $self->{char} = [];
2591     }
2592    
2593 wakaba 1.11 ?lexmode AttributeValueLiteralE;
2594     &AttributeValueLiteralE_ ($parent => $er, $vals => $vals);
2595 wakaba 1.6 ~ (#EOF) { }
2596     lang:Perl {
2597 wakaba 1.23 $self->{general_entity}->{$self->{entity}->[-1]->{name}}
2598     ->{is_opened} = false
2599     if $self->{general_entity}->{$self->{entity}->[-1]->{name}};
2600 wakaba 1.6 $self->{token} = pop @{$self->{entity_token}};
2601     $self->{char} = pop @{$self->{entity_char}};
2602     pop @{$self->{entity}};
2603 wakaba 1.14 $self->{location} = $self->{entity}->[-1];
2604 wakaba 1.6 }
2605    
2606 wakaba 1.11 // TODO: Set read-only flag
2607    
2608 wakaba 1.6 ?lexmode EntityReference;
2609     ?requires-next-token;
2610 wakaba 1.1 }
2611    
2612     // ~ (REFC) { }
2613 wakaba 1.11 } // _GeneralEntityReferenceAE_
2614 wakaba 1.6
2615     /*
2616 wakaba 1.24 General Entity Reference in Literal Entity Value in Entity Declaration
2617 wakaba 1.6 */
2618 wakaba 1.11 rule _GeneralEntityReferenceEV_ ($vals) {
2619 wakaba 1.6 ?lexmode 'EntityReference';
2620    
2621     ~ (Name) {
2622     lang:Perl ($name => $token.value) {
2623     ## TODO: Namespace well-formedness
2624     push @$vals, $name;
2625     }
2626 wakaba 1.24 /*
2627     WFCs such as Entity Declared are not checked
2628     <http://www.w3.org/TR/xml11/#bypass>
2629    
2630     Note that violation to the Parsed Entity WFC is an error
2631     rather than fatal error here.
2632     */
2633 wakaba 1.6 }
2634 wakaba 1.11
2635     // No expansion
2636 wakaba 1.6
2637     // ~ (REFC) { }
2638     } // _GeneralEntityReferenceEV_
2639 wakaba 1.1
2640     /*
2641 wakaba 1.4 Document Type Declaration
2642 wakaba 1.1 */
2643 wakaba 1.4 rule _DocumentTypeDeclaration_ ($doc) {
2644     ?lexmode MarkupDeclaration;
2645    
2646     ~ (Name == 'DOCTYPE') { }
2647    
2648     ~ (S) { }
2649    
2650     // Document type name
2651 wakaba 1.6 my $name;
2652 wakaba 1.4 ~ (Name) {
2653 wakaba 1.6 lang:Perl ($v => $token.value) {
2654     $name = $v;
2655     }
2656     }
2657 wakaba 1.17
2658     my $node;
2659     my $decl;
2660 wakaba 1.6 lang:Perl {
2661 wakaba 1.11 $self->{docx} = $self->{doc}
2662     -><M::Node.getFeature> (<Q::fe:XDoctype>, '3.0');
2663     $node = $self->{docx}-><M::DocumentXDoctype.createDocumentTypeDefinition>
2664     ($name);
2665 wakaba 1.17 $decl = $self->{dtdecl} = $node-><M::Node.getFeature>
2666     (<Q::fe:XDoctypeDeclaration>, '3.0');
2667 wakaba 1.4 }
2668    
2669     ~? (S) {
2670     ~? (Name == 'PUBLIC') {
2671     ~ (S) { }
2672    
2673 wakaba 1.17 &PubidLiteral ($decl => $decl);
2674 wakaba 1.4
2675     ~ (S) { }
2676    
2677 wakaba 1.17 &SystemLiteral ($decl => $decl);
2678 wakaba 1.4
2679     ~? (S) { }
2680 wakaba 1.19
2681     lang:Perl {
2682     $self->{has_xref} = true;
2683     }
2684 wakaba 1.4 } (Name == 'SYSTEM') {
2685     ~ (S) { }
2686    
2687 wakaba 1.17 &SystemLiteral ($decl => $decl);
2688 wakaba 1.4
2689     ~? (S) { }
2690 wakaba 1.19
2691     lang:Perl {
2692     $self->{has_xref} = true;
2693     }
2694 wakaba 1.4 }
2695     }
2696 wakaba 1.17
2697 wakaba 1.11 lang:Perl {
2698     $self->{dtdef} = $node;
2699 wakaba 1.21 $self->{doc}-><M::Node.appendChild> ($node);
2700     $self->{doc_cfg}-><M::c|DOMConfiguration.setParameter>
2701     ('schema-type' => <Q::xml-dtd:>);
2702     ## ISSUE: Should default schema language information be
2703     ## preserved by some other flag?
2704 wakaba 1.11 }
2705    
2706 wakaba 1.4 ~? (DSO) {
2707 wakaba 1.6 &InternalSubset ($doc => $doc, $doctype => $node);
2708 wakaba 1.4
2709     ~ (DSC) {
2710     ?lexmode MarkupDeclaration;
2711     } else {
2712     ?lexmode MarkupDeclaration;
2713     }
2714    
2715     ~? (S) { }
2716     }
2717    
2718     // ~ (MDC) { }
2719     } // _DocumentTypeDeclaration_
2720    
2721 wakaba 1.17 /*
2722     Public Identifier Literal
2723     */
2724     rule PubidLiteral ($decl) {
2725     my $pubid;
2726     my $pubid_token;
2727 wakaba 1.4 ~ (LIT) {
2728     ?lexmode SystemLiteral;
2729    
2730     ~? (STRING) {
2731 wakaba 1.17 lang:Perl ($v => $token.value) {
2732     $pubid = $v;
2733     $pubid_token = $token;
2734     }
2735 wakaba 1.4 }
2736    
2737     ~ (LIT) {
2738     ?lexmode MarkupDeclaration;
2739     } else {
2740     ?lexmode MarkupDeclaration;
2741     }
2742     } (LITA) {
2743     ?lexmode SystemLiteralA;
2744    
2745     ~? (STRING) {
2746 wakaba 1.17 lang:Perl ($v => $token.value) {
2747     $pubid = $v;
2748     $pubid_token = $token;
2749     }
2750 wakaba 1.4 }
2751    
2752     ~ (LITA) {
2753     ?lexmode MarkupDeclaration;
2754     } else {
2755     ?lexmode MarkupDeclaration;
2756     }
2757     }
2758 wakaba 1.17
2759     if-true ($pubid_token) {
2760     lang:Perl : has-error {
2761     if ($pubid =~ m{[^\x20\x0D\x0Aa-zA-Z0-9'()+,./:=?;!*#\@\$_%-]}s) {
2762     my $location;
2763     __CODE{xp|get-location-from-token::
2764     $token => {$pubid_token},
2765     $result => {$location},
2766     }__;
2767     ## Should this be other (new) error type?
2768     my $continue = __DOMCore:ERROR{xp|wf-syntax-error::
2769     xp|error-token => {$token},
2770     c|location => {$location},
2771     }__;
2772     unless ($continue) {
2773     __EXCEPTION{DOMLS|PARSE_ERR::
2774     }__;
2775     }
2776     }
2777    
2778     ## NOTE: U+0009 is syntactically illegal.
2779 wakaba 1.23 $pubid =~ s/[\x09\x0A\x0D\x20]+/\x20/gs;
2780 wakaba 1.17 $pubid =~ s/\A\x20//s;
2781     $pubid =~ s/\x20\z//s;
2782     ## NOTE: Bare attribute name is written.
2783     $decl->public_id ($pubid);
2784     }
2785     }
2786 wakaba 1.4 } // PubidLiteral
2787    
2788 wakaba 1.17 /*
2789     System Identifier Literal
2790     */
2791     rule SystemLiteral ($decl) {
2792 wakaba 1.4 ~ (LIT) {
2793     ?lexmode SystemLiteral;
2794 wakaba 1.17 &_SystemLiteral ($decl => $decl);
2795 wakaba 1.4 } (LITA) {
2796     ?lexmode SystemLiteralA;
2797 wakaba 1.17 &_SystemLiteral ($decl => $decl);
2798 wakaba 1.4 }
2799     } // SystemLiteral
2800    
2801 wakaba 1.17 /*
2802     System Identifier Literal Content
2803     */
2804     rule _SystemLiteral ($decl) {
2805     // LIT or LITA
2806    
2807 wakaba 1.4 ~? (STRING) {
2808 wakaba 1.17 lang:Perl ($v => $token.value) {
2809     ## NOTE: Bare attribute name is written.
2810     $decl->system_id ($v);
2811     }
2812 wakaba 1.4 }
2813    
2814     ~ (LIT) {
2815     ?lexmode MarkupDeclaration;
2816     } (LITA) {
2817     ?lexmode MarkupDeclaration;
2818     } else {
2819     ?lexmode MarkupDeclaration;
2820     }
2821     } // _SystemLiteral
2822    
2823     /*
2824     DTD Internal Subset
2825    
2826     intSubset := *(markupdecl / DeclSep) ;; [28b]
2827     */
2828 wakaba 1.6 rule InternalSubset ($doc, $doctype) {
2829 wakaba 1.4 ?lexmode DTD;
2830    
2831     ~* (MDO) {
2832     ?lexmode MarkupDeclaration;
2833    
2834     ~ (Name == 'ELEMENT') {
2835     &_ElementDeclaration ($doc => $doc);
2836     } (Name == 'ATTLIST') {
2837 wakaba 1.8 &_AttlistDeclaration ($doc => $doc, $doctype => $doctype);
2838 wakaba 1.4 } (Name == 'ENTITY') {
2839     &_EntityDeclaration ($doc => $doc);
2840     } (Name == 'NOTATION') {
2841     &_NotationDeclaration ($doc => $doc);
2842     }
2843     } (S) {
2844     //
2845     } (CDO) {
2846     &_CommentDeclarationDTD ($doc => $doc);
2847     } (PIO) {
2848 wakaba 1.6 &_ProcessingInstructionDTD ($doc => $doc, $doctype => $doctype);
2849 wakaba 1.4 } (PERO) {
2850     ?lexmode EntityReference;
2851    
2852 wakaba 1.19 lang:Perl {
2853     $self->{has_xref} = true;
2854     }
2855    
2856 wakaba 1.4 ~ (Name) {
2857    
2858     }
2859    
2860     ~ (REFC) {
2861     ?lexmode DTD;
2862     } else {
2863     ?lexmode DTD;
2864     }
2865     }
2866     } // InternalSubset
2867    
2868     rule _ElementDeclaration ($doc) {
2869     // ~ (MDO) { }
2870     // ?lexmode MarkupDeclaration
2871     // ~ (Name == 'Element') { }
2872    
2873     ~ (S) { }
2874    
2875     ~ (Name) {
2876    
2877     }
2878    
2879     ?lexmode ElementDeclaration;
2880    
2881     ~ (S) { }
2882    
2883     // contentspec
2884     ~ (MGO) {
2885     &_ContentModel ($doc => $doc);
2886     } (Name == 'EMPTY') {
2887    
2888     } (Name == 'ANY') {
2889    
2890     }
2891    
2892     ~? (S) { }
2893    
2894     ~ (MDC) {
2895     ?lexmode DTD;
2896     } else {
2897     ?lexmode DTD;
2898     }
2899     } // _ElementDeclaration
2900    
2901     rule _ContentModel ($doc) {
2902     // ~ (MGO) { }
2903    
2904     ~? (S) { }
2905    
2906     ~ (Name) {
2907     // Element content model
2908     &_ModelGroup ($doc => $doc)
2909     : unshift-current-token;
2910    
2911     ~? (OPT) {
2912    
2913     } (REP) {
2914    
2915     } (PLUS) {
2916    
2917     }
2918    
2919     } (MDO) {
2920     &_ModelGroup ($doc => $doc)
2921     : unshift-current-token;
2922    
2923     ~? (OPT) {
2924    
2925     } (REP) {
2926    
2927     } (PLUS) {
2928    
2929     }
2930    
2931     } (PCDATA) {
2932     // Mixed content declaration
2933     ~? (S) { }
2934    
2935     ~* (OR) {
2936     ~? (S) { }
2937    
2938     ~ (Name) {
2939    
2940     }
2941    
2942     ~? (S) { }
2943     }
2944    
2945     ~ (MGC) { }
2946    
2947     ~? (REP) {
2948    
2949     } else {
2950     // TODO: error if |Name|
2951     }
2952    
2953    
2954     }
2955     } // _ContentModel
2956    
2957     rule _ModelGroup ($doc)
2958     : standalone
2959     : recursive
2960     {
2961     // ~ (MGO) { }
2962     // ~? (S) { }
2963    
2964     &ContentParticle ($doc => $doc);
2965    
2966     ~? (S) { }
2967    
2968     ~? (OR) {
2969     ~? (S) { }
2970    
2971     &ContentParticle ($doc => $doc);
2972    
2973     ~? (S) { }
2974    
2975     ~* (OR) {
2976     ~? (S) { }
2977    
2978     &ContentParticle ($doc => $doc);
2979    
2980     ~? (S) { }
2981     }
2982    
2983     } (SEQ) {
2984     ~? (S) { }
2985    
2986     &ContentParticle ($doc => $doc);
2987    
2988     ~? (S) { }
2989    
2990     ~* (SEQ) {
2991     ~? (S) { }
2992    
2993     &ContentParticle ($doc => $doc);
2994    
2995     ~? (S) { }
2996     }
2997    
2998     }
2999    
3000     ~ (MGC) { }
3001     } // _ModelGroup
3002    
3003     rule ContentParticle ($doc) {
3004     ~ (Name) {
3005    
3006     } (MGO) {
3007     ~? (S) { }
3008    
3009     &_ModelGroup ($doc => $doc);
3010     }
3011    
3012     ~? (OPT) {
3013    
3014     } (REP) {
3015    
3016     } (PLUS) {
3017    
3018     }
3019     } // ContentParticle
3020    
3021 wakaba 1.8 /*
3022     Attribute list declaration
3023     */
3024     rule _AttlistDeclaration ($doc, $doctype) {
3025 wakaba 1.4 // ~ (MDO) { }
3026     // ~ (Name == 'ATTLIST') { }
3027    
3028     ?lexmode AttlistDeclaration;
3029    
3030     ~ (S) { }
3031    
3032 wakaba 1.8 my $name;
3033 wakaba 1.4 ~ (Name) {
3034 wakaba 1.8 lang:Perl ($v => $token.value) {
3035     $name = $v;
3036     }
3037     } else {
3038     lang:Perl { $name = '#ILLEGAL' }
3039     }
3040 wakaba 1.4
3041 wakaba 1.8 my $docxd;
3042     my $et;
3043     lang:Perl {
3044     $et = $doctype-><M::DTDef.getElementTypeDefinitionNode> ($name);
3045     unless ($et) {
3046 wakaba 1.11 $docxd = $doc-><M::Node.getFeature> (<Q::fe:XDoctype>, '3.0');
3047 wakaba 1.8 $et = $docxd-><M::DocumentXDoctype.createElementTypeDefinition>
3048     ($name);
3049     $doctype-><M::DTDef.setElementTypeDefinitionNode> ($et)
3050     unless $name eq '#ILLEGAL';
3051     }
3052 wakaba 1.4 }
3053    
3054     ~? (S) { }
3055    
3056     ~* (Name) {
3057 wakaba 1.8 my $at;
3058     lang:Perl ($v => $token.value) {
3059     $docxd ||= $doc-><M::Node.getFeature>
3060 wakaba 1.11 (<Q::fe:XDoctype>, '3.0');
3061 wakaba 1.8 $at = $docxd-><M::DocumentXDoctype.createAttributeDefinition> ($v);
3062 wakaba 1.9 unless (exists $et-><AG::ETDef.attributeDefinitions>->{$v}) {
3063     $et-><M::ETDef.setAttributeDefinitionNode> ($at);
3064     $self->{attr}->{$name}->{$v} = $at;
3065     }
3066 wakaba 1.8 }
3067 wakaba 1.4
3068     ~ (S) { }
3069    
3070     // AttType
3071     ~ (Name == 'NOTATION') {
3072     ~ (S) { }
3073    
3074 wakaba 1.8 my $kwd;
3075     lang:Perl {
3076     $at-><AS::ATDef.declaredType> (<C::ATDef.NOTATION_ATTR>);
3077     $kwd = $at-><AG::ATDef.allowedTokens>;
3078     }
3079    
3080 wakaba 1.4 ~ (EGO) {
3081     ~? (S) { }
3082    
3083 wakaba 1.8 ~+ (Name) {
3084     lang:Perl ($v => $token.value) {
3085     push @$kwd, $v;
3086     }
3087 wakaba 1.4
3088     ~? (S) { }
3089     } (OR) : separator {
3090     ~? (S) { }
3091     }
3092    
3093     ~ (EGC) { }
3094     }
3095 wakaba 1.8
3096 wakaba 1.4 } (Name) {
3097 wakaba 1.8 my $type;
3098     lang:Perl ($v => $token.value) : has-error {
3099     my $map = {
3100     CDATA => <C::ATDef.CDATA_ATTR>,
3101     ID => <C::ATDef.ID_ATTR>,
3102     IDREF => <C::ATDef.IDREF_ATTR>,
3103     IDREFS => <C::ATDef.IDREFS_ATTR>,
3104     ENTITY => <C::ATDef.ENTITY_ATTR>,
3105     ENTITIES => <C::ATDef.ENTITIES_ATTR>,
3106     NMTOKEN => <C::ATDef.NMTOKEN_ATTR>,
3107     NMTOKENS => <C::ATDef.NMTOKENS_ATTR>,
3108     };
3109     if ($map->{$v}) {
3110     $at-><AS::ATDef.declaredType> ($map->{$v});
3111     } else {
3112     ## TODO: Exception
3113     }
3114     }
3115 wakaba 1.4
3116     } (EGO) {
3117     ?lexmode Enumeration;
3118    
3119     ~? (S) { }
3120    
3121 wakaba 1.8 my $kwd;
3122     lang:Perl {
3123     $at-><AS::ATDef.declaredType> (<C::ATDef.ENUMERATION_ATTR>);
3124     $kwd = $at-><AG::ATDef.allowedTokens>;
3125     }
3126    
3127     ~+ (Nmtoken) {
3128     lang:Perl ($v => $token.value) {
3129     push @$kwd, $v;
3130     }
3131 wakaba 1.4
3132     ~? (S) { }
3133     } (OR) : separator {
3134     ~? (S) { }
3135     }
3136    
3137     ~ (EGC) {
3138     ?lexmode AttlistDeclaration;
3139     } else {
3140     ?lexmode AttlistDeclaration;
3141     }
3142    
3143     }
3144    
3145     ~ (S) { }
3146    
3147     // DefaultDecl
3148     ~ (RNI) {
3149     ~ (Name == 'REQUIRED') {
3150 wakaba 1.8 lang:Perl {
3151     $at-><AS::ATDef.defaultType> (<C::ATDef.REQUIRED_DEFAULT>);
3152     }
3153 wakaba 1.4 } (Name == 'IMPLIED') {
3154 wakaba 1.8 lang:Perl {
3155     $at-><AS::ATDef.defaultType> (<C::ATDef.IMPLIED_DEFAULT>);
3156     }
3157 wakaba 1.4 } (Name == 'FIXED') {
3158     ~ (S) { }
3159 wakaba 1.8
3160     lang:Perl {
3161     $at-><AS::ATDef.defaultType> (<C::ATDef.FIXED_DEFAULT>);
3162     }
3163 wakaba 1.4
3164     ~ (LIT) {
3165     my $vals;
3166     lang:Perl {
3167 wakaba 1.8 $vals = {nodes => [], value => ''};
3168 wakaba 1.4 }
3169    
3170     &_AttributeValueSpecification_ ($doc => $doc, $vals => $vals);
3171    
3172 wakaba 1.8 lang:Perl {
3173     for (@{$vals->{nodes}}) {
3174     $at-><M::Node.appendChild> ($_);
3175     }
3176     }
3177    
3178 wakaba 1.4 ~ (LIT) {
3179     ?lexmode AttlistDeclaration;
3180     } else {
3181     ?lexmode AttlistDeclaration;
3182     }
3183     } (LITA) {
3184     my $vals;
3185     lang:Perl {
3186 wakaba 1.8 $vals = {nodes => [], value => ''};
3187 wakaba 1.4 }
3188    
3189     &_AttributeValueSpecificationA_ ($doc => $doc, $vals => $vals);
3190    
3191 wakaba 1.8 lang:Perl {
3192     for (@{$vals->{nodes}}) {
3193     $at-><M::Node.appendChild> ($_);
3194     }
3195     }
3196    
3197     ~ (LITA) {
3198 wakaba 1.4 ?lexmode AttlistDeclaration;
3199     } else {
3200     ?lexmode AttlistDeclaration;
3201     }
3202     }
3203     }
3204    
3205     } (LIT) {
3206     my $vals;
3207     lang:Perl {
3208 wakaba 1.8 $at-><AS::ATDef.defaultType> (<C::ATDef.EXPLICIT_DEFAULT>);
3209     $vals = {nodes => [], value => ''};
3210 wakaba 1.4 }
3211    
3212     &_AttributeValueSpecification_ ($doc => $doc, $vals => $vals);
3213    
3214 wakaba 1.8 lang:Perl {
3215     for (@{$vals->{nodes}}) {
3216     $at-><M::Node.appendChild> ($_);
3217     }
3218     }
3219    
3220 wakaba 1.4 ~ (LIT) {
3221     ?lexmode AttlistDeclaration;
3222     } else {
3223     ?lexmode AttlistDeclaration;
3224     }
3225     } (LITA) {
3226     my $vals;
3227     lang:Perl {
3228 wakaba 1.8 $at-><AS::ATDef.defaultType> (<C::ATDef.EXPLICIT_DEFAULT>);
3229     $vals = {nodes => [], value => ''};
3230 wakaba 1.4 }
3231    
3232     &_AttributeValueSpecificationA_ ($doc => $doc, $vals => $vals);
3233    
3234 wakaba 1.8 lang:Perl {
3235     for (@{$vals->{nodes}}) {
3236     $at-><M::Node.appendChild> ($_);
3237     }
3238     }
3239    
3240 wakaba 1.4 ~ (LITA) {
3241     ?lexmode AttlistDeclaration;
3242     } else {
3243     ?lexmode AttlistDeclaration;
3244     }
3245     }
3246    
3247     } (S) : separator : terminator? {
3248     //
3249     }
3250    
3251     ~ (MDC) {
3252     ?lexmode DTD;
3253     } else {
3254     ?lexmode DTD;
3255     }
3256     } // _AttlistDeclaration
3257    
3258 wakaba 1.11 /*
3259     Entity declaration
3260     */
3261 wakaba 1.4 rule _EntityDeclaration ($doc) {
3262     // ~ (MDO) { }
3263     // ~ (Name == ENTITY) { }
3264    
3265     ~ (S) { }
3266    
3267 wakaba 1.23 my $is_param_entity;
3268 wakaba 1.6 my $decl;
3269 wakaba 1.18 lang:Perl { $decl = { name => '#ILLEGAL', reptxt => \'' }; }
3270 wakaba 1.6
3271 wakaba 1.4 ~? (PERO) {
3272     ~ (S) { }
3273 wakaba 1.6 lang:Perl {
3274 wakaba 1.23 $is_param_entity = $decl->{is_param_entity} = true;
3275 wakaba 1.6 }
3276 wakaba 1.4 }
3277    
3278 wakaba 1.19 /*
3279     TODO: Set |$decl->{is_externally_declared}| flag
3280     and |Entity.isExternallyDeclared| attribute
3281     for entity declarations in external subset or
3282     in parameter entity.
3283     */
3284    
3285 wakaba 1.4 ~ (Name) {
3286 wakaba 1.6 lang:Perl ($v => $token.value) {
3287     $decl->{name} = $v;
3288     }
3289 wakaba 1.4 }
3290    
3291 wakaba 1.18 my $node;
3292 wakaba 1.11 lang:Perl {
3293 wakaba 1.18 $node =
3294 wakaba 1.11 $decl->{node} = $self->{docx}-><M::DocumentXDoctype.createGeneralEntity>
3295     ($decl->{name});
3296     ## TODO: Parameter entity...
3297     }
3298    
3299 wakaba 1.4 ~ (S) { }
3300    
3301     ~ (LIT) {
3302 wakaba 1.6 &_EntityValue ($doc => $doc, $decl => $decl);
3303 wakaba 1.4 } (LITA) {
3304 wakaba 1.6 &_EntityValueA ($doc => $doc, $decl => $decl);
3305 wakaba 1.4 } (Name == 'PUBLIC') {
3306     ~ (S) { }
3307    
3308 wakaba 1.18 &PubidLiteral ($decl => $node);
3309 wakaba 1.4
3310     ~ (S) { }
3311    
3312 wakaba 1.18 &SystemLiteral ($decl => $node);
3313    
3314     lang:Perl {
3315     $decl->{is_external_entity} = true;
3316     }
3317 wakaba 1.4 } (Name == 'SYSTEM') {
3318     ~ (S) { }
3319    
3320 wakaba 1.18 &SystemLiteral ($decl => $node);
3321    
3322     lang:Perl {
3323     $decl->{is_external_entity} = true;
3324     }
3325 wakaba 1.4 }
3326    
3327     ~? (S) {
3328     ~? (Name == 'NDATA') {
3329 wakaba 1.23 if-true ($is_param_entity) {
3330     lang:Perl : has-error {
3331     my $location;
3332     __CODE{xp|get-location-from-token::
3333     $token => {$token},
3334     $result => {$location},
3335     }__;
3336     my $continue = __DOMCore:ERROR{xp|wf-syntax-error::
3337     xp|error-token => {$token},
3338     c|location => {$location},
3339     }__;
3340     unless ($continue) {
3341     __EXCEPTION{DOMLS|PARSE_ERR::
3342     }__;
3343     }
3344     }
3345     }
3346 wakaba 1.4
3347     ~ (S) { }
3348    
3349     ~ (Name) {
3350 wakaba 1.6 lang:Perl ($v => $token.value) {
3351     $decl->{notation} = $v;
3352 wakaba 1.11 $decl->{node}-><AG::x|Entity.notationName> ($v);
3353 wakaba 1.6 }
3354 wakaba 1.4 }
3355    
3356     ~? (S) { }
3357     }
3358     }
3359    
3360 wakaba 1.24 lang:Perl : has-error {
3361 wakaba 1.6 if ($self->{$decl->{is_param_entity} ? 'param_entity' : 'general_entity'}
3362     ->{$decl->{name}}) {
3363 wakaba 1.24 ## Predefined entity
3364     if (not $decl->{is_param_entity} and
3365     {lt => true, gt => true, amp => true,
3366     quot => true, apos => true}->{$decl->{name}}) {
3367     if ($decl->{is_external_entity}) {
3368     my $location;
3369     __CODE{xp|get-location-from-token::
3370     $token => {$token},
3371     $result => {$location},
3372     }__;
3373     my $continue = __c|ERROR{xp|error-internal-predefined-entity::
3374     xp|error-token => {$token},
3375     c|location => {$location},
3376     xp|name => {$decl->{name}},
3377     }__;
3378     unless ($continue) {
3379     __EXCEPTION{DOMLS|PARSE_ERR::
3380     }__;
3381     }
3382     } elsif (
3383     not ({gt => true, apos => true, quot => true}->{$decl->{name}} and
3384     ${$decl->{reptxt}} eq {
3385     gt => '>', apos => "'", quot => '"',
3386     }->{$decl->{name}}) and
3387     not (${$decl->{reptxt}} =~ /\A&#0*@{[{
3388     lt => '60', gt => '62', amp => '38',
3389     apos => '39', quot => '34',
3390     }->{$decl->{name}}]};\z/) and
3391     not (${$decl->{reptxt}} =~ /\A&#x0*(?:(?i)@{[{
3392     lt => '3C', gt => '3E', amp => '26',
3393     apos => '27', quot => '22',
3394     }->{$decl->{name}}]});\z/)
3395     ) {
3396     ## NOTE: See "SuikaWiki - Predefined Entities"
3397     ## "http://suika.fam.cx/gate/2005/sw/%E5%AE%9A%E7%BE%A9%E6%B8%88%E5%AE%9F%E4%BD%93".
3398     my $location;
3399     __CODE{xp|get-location-from-token::
3400     $token => {$token},
3401     $result => {$location},
3402     }__;
3403     my $continue = __c|ERROR{xp|error-malformed-predefined-entity::
3404     xp|error-token => {$token},
3405     c|location => {$location},
3406     xp|name => {$decl->{name}},
3407     xp|replacement-text => {${$decl->{reptxt}}},
3408     }__;
3409     unless ($continue) {
3410     __EXCEPTION{DOMLS|PARSE_ERR::
3411     }__;
3412     }
3413     }
3414     ## TODO:
3415     } else { ## Dupulicating declaration
3416     my $location;
3417     __CODE{xp|get-location-from-token::
3418     $token => {$token},
3419     $result => {$location},
3420     }__;
3421     my $continue = __c|ERROR{xp|warning-entity-declaration-ignored::
3422     xp|error-token => {$token},
3423     c|location => {$location},
3424     xp|name => {$decl->{name}},
3425     }__;
3426     unless ($continue) {
3427     __EXCEPTION{DOMLS|PARSE_ERR::
3428     }__;
3429     }
3430     }
3431 wakaba 1.6 } else {
3432     $self->{$decl->{is_param_entity} ? 'param_entity' : 'general_entity'}
3433     ->{$decl->{name}} = $decl;
3434 wakaba 1.11 $self->{dtdef}-><M::DTDef.setGeneralEntityNode> ($decl->{node})
3435     unless $decl->{is_param_entity};
3436 wakaba 1.6 }
3437     }
3438    
3439 wakaba 1.4 ~ (MDC) {
3440     ?lexmode DTD;
3441     } else {
3442     ?lexmode DTD;
3443     }
3444     } // _EntityDeclaration
3445    
3446     rule _NotationDeclaration ($doc) {
3447     // ~ (MDO) { }
3448     // ~ (Name == NOTATION) { }
3449    
3450     ~ (S) { }
3451    
3452     ~ (Name) {
3453    
3454     }
3455    
3456     ~ (S) { }
3457    
3458 wakaba 1.17 my $decl;
3459     lang:Perl {
3460     $decl = $self->{docx}-><M::DocumentXDoctype.createGeneralEntity>
3461     ($decl->{name});
3462     ## Temporary: to avoid error.
3463     }
3464    
3465 wakaba 1.4 ~ (Name == 'PUBLIC') {
3466     ~ (S) { }
3467    
3468 wakaba 1.17 &PubidLiteral ($decl => $decl);
3469 wakaba 1.4
3470     ~? (S) {
3471     ~? (LIT) {
3472     ?lexmode SystemLiteral;
3473 wakaba 1.17 &_SystemLiteral ($decl => $decl);
3474 wakaba 1.4
3475     ~? (S) { }
3476     } (LITA) {
3477     ?lexmode SystemLiteralA;
3478 wakaba 1.17 &_SystemLiteral ($decl => $decl);
3479 wakaba 1.4
3480     ~? (S) { }
3481     }
3482     }
3483     } (Name == 'SYSTEM') {
3484     ~ (S) { }
3485    
3486 wakaba 1.17 &SystemLiteral ($decl => $decl);
3487 wakaba 1.4
3488     ~? (S) { }
3489     }
3490    
3491     ~ (MDC) {
3492     ?lexmode DTD;
3493     } else {
3494     ?lexmode DTD;
3495     }
3496     } // _NotationDeclaration
3497    
3498 wakaba 1.11 rule _EntityValue ($decl) {
3499 wakaba 1.4 ?lexmode EntityValue;
3500    
3501     my $vals;
3502 wakaba 1.6 my $reptxt;
3503 wakaba 1.4 lang:Perl {
3504     $vals = [];
3505 wakaba 1.6 $reptxt = '';
3506 wakaba 1.4 }
3507    
3508     ~* (STRING) {
3509 wakaba 1.6 lang:Perl ($v => $token.value) {
3510     $reptxt .= $v;
3511     }
3512 wakaba 1.4 } (PERO) {
3513     ?lexmode EntityDeclaration;
3514 wakaba 1.19
3515     lang:Perl {
3516     $self->{has_xref} = true;
3517     }
3518 wakaba 1.6
3519     // TODO: Expand or wferror if internal subset
3520 wakaba 1.4
3521     ~ (Name) {
3522    
3523     }
3524    
3525     ~ (REFC) {
3526     ?lexmode EntityValue;
3527     } else {
3528     ?lexmode EntityValue;
3529     }
3530     } (HCRO) {
3531 wakaba 1.11 &_HexadecimalCharacterReferenceEV_ ($vals => $vals);
3532 wakaba 1.4
3533 wakaba 1.6 lang:Perl {
3534 wakaba 1.11 $reptxt .= $vals->[-1];
3535 wakaba 1.6 }
3536    
3537 wakaba 1.4 ~ (REFC) {
3538     ?lexmode EntityValue;
3539     } else {
3540     ?lexmode EntityValue;
3541     }
3542     } (CRO) {
3543 wakaba 1.11 &_NumericCharacterReferenceEV_ ($vals => $vals);
3544 wakaba 1.6
3545     lang:Perl {
3546 wakaba 1.11 $reptxt .= $vals->[-1];
3547 wakaba 1.6 }
3548 wakaba 1.4
3549     ~ (REFC) {
3550     ?lexmode EntityValue;
3551     } else {
3552     ?lexmode EntityValue;
3553     }
3554     } (ERO) {
3555 wakaba 1.11 &_GeneralEntityReferenceEV_ ($vals => $vals);
3556 wakaba 1.4
3557 wakaba 1.6 lang:Perl {
3558 wakaba 1.11 $reptxt .= '&' . $vals->[-1] . ';';
3559 wakaba 1.6 }
3560    
3561 wakaba 1.4 ~ (REFC) {
3562     ?lexmode EntityValue;
3563     } else {
3564     ?lexmode EntityValue;
3565     }
3566     }
3567    
3568     ~ (LIT) {
3569     ?lexmode MarkupDeclaration;
3570     } (LITA) {
3571     ?lexmode MarkupDeclaration;
3572     } else {
3573     ?lexmode MarkupDeclaration;
3574     }
3575 wakaba 1.6
3576     lang:Perl {
3577     $decl->{reptxt} = \$reptxt;
3578 wakaba 1.19 $decl->{has_replacement_text} = true;
3579 wakaba 1.6 }
3580 wakaba 1.4 } // _EntityValue
3581    
3582 wakaba 1.11 rule _EntityValueA ($decl) {
3583 wakaba 1.4 ?lexmode EntityValueA;
3584    
3585     my $vals;
3586 wakaba 1.6 my $reptxt;
3587 wakaba 1.4 lang:Perl {
3588     $vals = [];
3589 wakaba 1.6 $reptxt = '';
3590 wakaba 1.4 }
3591    
3592     ~* (STRING) {
3593 wakaba 1.6 lang:Perl ($v => $token.value) {
3594     $reptxt .= $v;
3595     }
3596 wakaba 1.4 } (PERO) {
3597     ?lexmode EntityDeclaration;
3598    
3599 wakaba 1.19 lang:Perl {
3600     $self->{has_xref} = true;
3601     }
3602    
3603 wakaba 1.6 // TODO: implement this
3604 wakaba 1.4 ~ (Name) {
3605    
3606     }
3607    
3608     ~ (REFC) {
3609     ?lexmode EntityValueA;
3610     } else {
3611     ?lexmode EntityValueA;
3612     }
3613     } (HCRO) {
3614 wakaba 1.11 &_HexadecimalCharacterReferenceEV_ ($vals => $vals);
3615 wakaba 1.4
3616 wakaba 1.6 lang:Perl {
3617 wakaba 1.11 $reptxt .= $vals->[-1];
3618 wakaba 1.6 }
3619    
3620    
3621 wakaba 1.4 ~ (REFC) {
3622     ?lexmode EntityValueA;
3623     } else {
3624     ?lexmode EntityValueA;
3625     }
3626     } (CRO) {
3627 wakaba 1.11 &_NumericCharacterReferenceEV_ ($vals => $vals);
3628 wakaba 1.4
3629 wakaba 1.6 lang:Perl {
3630 wakaba 1.11 $reptxt .= $vals->[-1];
3631 wakaba 1.6 }
3632    
3633 wakaba 1.4 ~ (REFC) {
3634     ?lexmode EntityValueA;
3635     } else {
3636     ?lexmode EntityValueA;
3637     }
3638     } (ERO) {
3639 wakaba 1.11 &_GeneralEntityReferenceEV_ ($vals => $vals);
3640 wakaba 1.4
3641 wakaba 1.6 lang:Perl {
3642 wakaba 1.11 $reptxt .= '&' . $vals->[-1] . ';';
3643 wakaba 1.6 }
3644    
3645 wakaba 1.4 ~ (REFC) {
3646     ?lexmode EntityValueA;
3647     } else {
3648     ?lexmode EntityValueA;
3649     }
3650     }
3651    
3652     ~ (LITA) {
3653     ?lexmode MarkupDeclaration;
3654     } else {
3655     ?lexmode MarkupDeclaration;
3656     }
3657 wakaba 1.6
3658     lang:Perl {
3659     $decl->{reptxt} = \$reptxt;
3660 wakaba 1.19 $decl->{has_replacement_text} = true;
3661 wakaba 1.6 }
3662 wakaba 1.4 } // _EntityValueA
3663    
3664    
3665     /*
3666     XML Name
3667     */
3668     lexmode NameChar {
3669     $NameStartChar10 := [
3670     '_' ':'
3671     // Letter
3672     // BaseChar
3673     U+0041..U+005A U+0061..U+007A U+00C0..U+00D6
3674     U+00D8..U+00F6 U+00F8..U+00FF U+0100..U+0131
3675     U+0134..U+013E U+0141..U+0148 U+014A..U+017E
3676     U+0180..U+01C3 U+01CD..U+01F0 U+01F4..U+01F5
3677     U+01FA..U+0217 U+0250..U+02A8 U+02BB..U+02C1
3678     U+0386 U+0388..U+038A U+038C U+038E..U+03A1
3679     U+03A3..U+03CE U+03D0..U+03D6 U+03DA U+03DC
3680     U+03DE U+03E0 U+03E2..U+03F3 U+0401..U+040C
3681     U+040E..U+044F U+0451..U+045C U+045E..U+0481
3682     U+0490..U+04C4 U+04C7..U+04C8 U+04CB..U+04CC
3683     U+04D0..U+04EB U+04EE..U+04F5 U+04F8..U+04F9
3684     U+0531..U+0556 U+0559 U+0561..U+0586
3685     U+05D0..U+05EA U+05F0..U+05F2 U+0621..U+063A
3686     U+0641..U+064A U+0671..U+06B7 U+06BA..U+06BE
3687     U+06C0..U+06CE U+06D0..U+06D3 U+06D5
3688     U+06E5..U+06E6 U+0905..U+0939 U+093D
3689     U+0958..U+0961 U+0985..U+098C U+098F..U+0990
3690     U+0993..U+09A8 U+09AA..U+09B0 U+09B2
3691     U+09B6..U+09B9 U+09DC..U+09DD U+09DF..U+09E1
3692     U+09F0..U+09F1 U+0A05..U+0A0A U+0A0F..U+0A10
3693     U+0A13..U+0A28 U+0A2A..U+0A30 U+0A32..U+0A33
3694     U+0A35..U+0A36 U+0A38..U+0A39 U+0A59..U+0A5C
3695     U+0A5E U+0A72..U+0A74 U+0A85..U+0A8B U+0A8D
3696     U+0A8F..U+0A91 U+0A93..U+0AA8 U+0AAA..U+0AB0
3697     U+0AB2..U+0AB3 U+0AB5..U+0AB9 U+0ABD U+0AE0
3698     U+0B05..U+0B0C U+0B0F..U+0B10 U+0B13..U+0B28
3699     U+0B2A..U+0B30 U+0B32..U+0B33 U+0B36..U+0B39
3700     U+0B3D U+0B5C..U+0B5D U+0B5F..U+0B61
3701     U+0B85..U+0B8A U+0B8E..U+0B90 U+0B92..U+0B95
3702     U+0B99..U+0B9A U+0B9C U+0B9E..U+0B9F
3703     U+0BA3..U+0BA4 U+0BA8..U+0BAA U+0BAE..U+0BB5
3704     U+0BB7..U+0BB9 U+0C05..U+0C0C U+0C0E..U+0C10
3705     U+0C12..U+0C28 U+0C2A..U+0C33 U+0C35..U+0C39
3706     U+0C60..U+0C61 U+0C85..U+0C8C U+0C8E..U+0C90
3707     U+0C92..U+0CA8 U+0CAA..U+0CB3 U+0CB5..U+0CB9
3708     U+0CDE U+0CE0..U+0CE1 U+0D05..U+0D0C
3709     U+0D0E..U+0D10 U+0D12..U+0D28 U+0D2A..U+0D39
3710     U+0D60..U+0D61 U+0E01..U+0E2E U+0E30
3711     U+0E32..U+0E33 U+0E40..U+0E45 U+0E81..U+0E82
3712     U+0E84 U+0E87..U+0E88 U+0E8A U+0E8D
3713     U+0E94..U+0E97 U+0E99..U+0E9F U+0EA1..U+0EA3
3714     U+0EA5 U+0EA7 U+0EAA..U+0EAB U+0EAD..U+0EAE
3715     U+0EB0 U+0EB2..U+0EB3 U+0EBD U+0EC0..U+0EC4
3716     U+0F40..U+0F47 U+0F49..U+0F69 U+10A0..U+10C5
3717     U+10D0..U+10F6 U+1100 U+1102..U+1103
3718     U+1105..U+1107 U+1109 U+110B..U+110C
3719     U+110E..U+1112 U+113C U+113E U+1140 U+114C
3720     U+114E U+1150 U+1154..U+1155 U+1159
3721     U+115F..U+1161 U+1163 U+1165 U+1167 U+1169
3722     U+116D..U+116E U+1172..U+1173 U+1175 U+119E
3723     U+11A8 U+11AB U+11AE..U+11AF U+11B7..U+11B8
3724     U+11BA U+11BC..U+11C2 U+11EB U+11F0 U+11F9
3725     U+1E00..U+1E9B U+1EA0..U+1EF9 U+1F00..U+1F15
3726     U+1F18..U+1F1D U+1F20..U+1F45 U+1F48..U+1F4D
3727     U+1F50..U+1F57 U+1F59 U+1F5B U+1F5D
3728     U+1F5F..U+1F7D U+1F80..U+1FB4 U+1FB6..U+1FBC
3729     U+1FBE U+1FC2..U+1FC4 U+1FC6..U+1FCC
3730     U+1FD0..U+1FD3 U+1FD6..U+1FDB U+1FE0..U+1FEC
3731     U+1FF2..U+1FF4 U+1FF6..U+1FFC U+2126
3732     U+212A..U+212B U+212E U+2180..U+2182
3733     U+3041..U+3094 U+30A1..U+30FA U+3105..U+312C
3734     U+AC00..U+D7A3
3735     // Ideographic
3736     U+4E00..U+9FA5 U+3007 U+3021..U+3029
3737     ];
3738     $NameChar10 := [
3739     '.' '-' '_' ':'
3740     // Letter
3741     // BaseChar
3742     U+0041..U+005A U+0061..U+007A U+00C0..U+00D6
3743     U+00D8..U+00F6 U+00F8..U+00FF U+0100..U+0131
3744     U+0134..U+013E U+0141..U+0148 U+014A..U+017E
3745     U+0180..U+01C3 U+01CD..U+01F0 U+01F4..U+01F5
3746     U+01FA..U+0217 U+0250..U+02A8 U+02BB..U+02C1
3747     U+0386 U+0388..U+038A U+038C U+038E..U+03A1
3748     U+03A3..U+03CE U+03D0..U+03D6 U+03DA U+03DC
3749     U+03DE U+03E0 U+03E2..U+03F3 U+0401..U+040C
3750     U+040E..U+044F U+0451..U+045C U+045E..U+0481
3751     U+0490..U+04C4 U+04C7..U+04C8 U+04CB..U+04CC
3752     U+04D0..U+04EB U+04EE..U+04F5 U+04F8..U+04F9
3753     U+0531..U+0556 U+0559 U+0561..U+0586
3754     U+05D0..U+05EA U+05F0..U+05F2 U+0621..U+063A
3755     U+0641..U+064A U+0671..U+06B7 U+06BA..U+06BE
3756     U+06C0..U+06CE U+06D0..U+06D3 U+06D5
3757     U+06E5..U+06E6 U+0905..U+0939 U+093D
3758     U+0958..U+0961 U+0985..U+098C U+098F..U+0990
3759     U+0993..U+09A8 U+09AA..U+09B0 U+09B2
3760     U+09B6..U+09B9 U+09DC..U+09DD U+09DF..U+09E1
3761     U+09F0..U+09F1 U+0A05..U+0A0A U+0A0F..U+0A10
3762     U+0A13..U+0A28 U+0A2A..U+0A30 U+0A32..U+0A33
3763     U+0A35..U+0A36 U+0A38..U+0A39 U+0A59..U+0A5C
3764     U+0A5E U+0A72..U+0A74 U+0A85..U+0A8B U+0A8D
3765     U+0A8F..U+0A91 U+0A93..U+0AA8 U+0AAA..U+0AB0
3766     U+0AB2..U+0AB3 U+0AB5..U+0AB9 U+0ABD U+0AE0
3767     U+0B05..U+0B0C U+0B0F..U+0B10 U+0B13..U+0B28
3768     U+0B2A..U+0B30 U+0B32..U+0B33 U+0B36..U+0B39
3769     U+0B3D U+0B5C..U+0B5D U+0B5F..U+0B61
3770     U+0B85..U+0B8A U+0B8E..U+0B90 U+0B92..U+0B95
3771     U+0B99..U+0B9A U+0B9C U+0B9E..U+0B9F
3772     U+0BA3..U+0BA4 U+0BA8..U+0BAA U+0BAE..U+0BB5
3773     U+0BB7..U+0BB9 U+0C05..U+0C0C U+0C0E..U+0C10
3774     U+0C12..U+0C28 U+0C2A..U+0C33 U+0C35..U+0C39
3775     U+0C60..U+0C61 U+0C85..U+0C8C U+0C8E..U+0C90
3776     U+0C92..U+0CA8 U+0CAA..U+0CB3 U+0CB5..U+0CB9
3777     U+0CDE U+0CE0..U+0CE1 U+0D05..U+0D0C
3778     U+0D0E..U+0D10 U+0D12..U+0D28 U+0D2A..U+0D39
3779     U+0D60..U+0D61 U+0E01..U+0E2E U+0E30
3780     U+0E32..U+0E33 U+0E40..U+0E45 U+0E81..U+0E82
3781     U+0E84 U+0E87..U+0E88 U+0E8A U+0E8D
3782     U+0E94..U+0E97 U+0E99..U+0E9F U+0EA1..U+0EA3
3783     U+0EA5 U+0EA7 U+0EAA..U+0EAB U+0EAD..U+0EAE
3784     U+0EB0 U+0EB2..U+0EB3 U+0EBD U+0EC0..U+0EC4
3785     U+0F40..U+0F47 U+0F49..U+0F69 U+10A0..U+10C5
3786     U+10D0..U+10F6 U+1100 U+1102..U+1103
3787     U+1105..U+1107 U+1109 U+110B..U+110C
3788     U+110E..U+1112 U+113C U+113E U+1140 U+114C
3789     U+114E U+1150 U+1154..U+1155 U+1159
3790     U+115F..U+1161 U+1163 U+1165 U+1167 U+1169
3791     U+116D..U+116E U+1172..U+1173 U+1175 U+119E
3792     U+11A8 U+11AB U+11AE..U+11AF U+11B7..U+11B8
3793     U+11BA U+11BC..U+11C2 U+11EB U+11F0 U+11F9
3794     U+1E00..U+1E9B U+1EA0..U+1EF9 U+1F00..U+1F15
3795     U+1F18..U+1F1D U+1F20..U+1F45 U+1F48..U+1F4D
3796     U+1F50..U+1F57 U+1F59 U+1F5B U+1F5D
3797     U+1F5F..U+1F7D U+1F80..U+1FB4 U+1FB6..U+1FBC
3798     U+1FBE U+1FC2..U+1FC4 U+1FC6..U+1FCC
3799     U+1FD0..U+1FD3 U+1FD6..U+1FDB U+1FE0..U+1FEC
3800     U+1FF2..U+1FF4 U+1FF6..U+1FFC U+2126
3801     U+212A..U+212B U+212E U+2180..U+2182
3802     U+3041..U+3094 U+30A1..U+30FA U+3105..U+312C
3803     U+AC00..U+D7A3
3804     // Ideographic
3805     U+4E00..U+9FA5 U+3007 U+3021..U+3029
3806     // Digit
3807     U+0030..U+0039 U+0660..U+0669 U+06F0..U+06F9
3808     U+0966..U+096F U+09E6..U+09EF U+0A66..U+0A6F
3809     U+0AE6..U+0AEF U+0B66..U+0B6F U+0BE7..U+0BEF
3810     U+0C66..U+0C6F U+0CE6..U+0CEF U+0D66..U+0D6F
3811     U+0E50..U+0E59 U+0ED0..U+0ED9 U+0F20..U+0F29
3812     // CombiningChar
3813     U+0300..U+0345 U+0360..U+0361 U+0483..U+0486
3814     U+0591..U+05A1 U+05A3..U+05B9 U+05BB..U+05BD
3815     U+05BF U+05C1..U+05C2 U+05C4 U+064B..U+0652
3816     U+0670 U+06D6..U+06DC U+06DD..U+06DF
3817     U+06E0..U+06E4 U+06E7..U+06E8 U+06EA..U+06ED
3818     U+0901..U+0903 U+093C U+093E..U+094C U+094D
3819     U+0951..U+0954 U+0962..U+0963 U+0981..U+0983
3820     U+09BC U+09BE U+09BF U+09C0..U+09C4
3821     U+09C7..U+09C8 U+09CB..U+09CD U+09D7
3822     U+09E2..U+09E3 U+0A02 U+0A3C U+0A3E U+0A3F
3823     U+0A40..U+0A42 U+0A47..U+0A48 U+0A4B..U+0A4D
3824     U+0A70..U+0A71 U+0A81..U+0A83 U+0ABC
3825     U+0ABE..U+0AC5 U+0AC7..U+0AC9 U+0ACB..U+0ACD
3826     U+0B01..U+0B03 U+0B3C U+0B3E..U+0B43
3827     U+0B47..U+0B48 U+0B4B..U+0B4D U+0B56..U+0B57
3828     U+0B82..U+0B83 U+0BBE..U+0BC2 U+0BC6..U+0BC8
3829     U+0BCA..U+0BCD U+0BD7 U+0C01..U+0C03
3830     U+0C3E..U+0C44 U+0C46..U+0C48 U+0C4A..U+0C4D
3831     U+0C55..U+0C56 U+0C82..U+0C83 U+0CBE..U+0CC4
3832     U+0CC6..U+0CC8 U+0CCA..U+0CCD U+0CD5..U+0CD6
3833     U+0D02..U+0D03 U+0D3E..U+0D43 U+0D46..U+0D48
3834     U+0D4A..U+0D4D U+0D57 U+0E31 U+0E34..U+0E3A
3835     U+0E47..U+0E4E U+0EB1 U+0EB4..U+0EB9
3836     U+0EBB..U+0EBC U+0EC8..U+0ECD U+0F18..U+0F19
3837     U+0F35 U+0F37 U+0F39 U+0F3E U+0F3F
3838     U+0F71..U+0F84 U+0F86..U+0F8B U+0F90..U+0F95
3839     U+0F97 U+0F99..U+0FAD U+0FB1..U+0FB7 U+0FB9
3840     U+20D0..U+20DC U+20E1 U+302A..U+302F U+3099
3841     U+309A
3842     // Extender
3843     U+00B7 U+02D0 U+02D1 U+0387 U+0640 U+0E46
3844     U+0EC6 U+3005 U+3031..U+3035 U+309D..U+309E
3845     U+30FC..U+30FE
3846     ];
3847 wakaba 1.1
3848     $NameStartChar11 := [
3849     ':' '_'
3850     'A' 'B' 'C' 'D' 'E' 'F' 'G' 'H' 'I' 'J' 'K' 'L' 'M'
3851     'N' 'O' 'P' 'Q' 'R' 'S' 'T' 'U' 'V' 'W' 'X' 'Y' 'Z'
3852     'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm'
3853     'n' 'o' 'p' 'q' 'r' 's' 't' 'u' 'v' 'w' 'x' 'y' 'z'
3854     U+00C0..U+00D6 U+00D8..U+00F6 U+00F8..U+02FF
3855     U+0370..U+037D U+037F..U+1FFF U+200C..U+200D
3856     U+2070..U+218F U+2C00..U+2FEF U+3001..U+D7FF
3857     U+F900..U+FDCF U+FDF0..U+FFFD U+10000..U+EFFFF
3858     ];
3859     $NameChar11 := [
3860     '-' '.' '0' '1' '2' '3' '4' '5' '6' '7' '8' '9'
3861     U+00B7 U+0300..U+036F U+203F..U+2040
3862     // NameStartChar
3863     ':' '_'
3864     'A' 'B' 'C' 'D' 'E' 'F' 'G' 'H' 'I' 'J' 'K' 'L' 'M'
3865     'N' 'O' 'P' 'Q' 'R' 'S' 'T' 'U' 'V' 'W' 'X' 'Y' 'Z'
3866     'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm'
3867     'n' 'o' 'p' 'q' 'r' 's' 't' 'u' 'v' 'w' 'x' 'y' 'z'
3868     U+00C0..U+00D6 U+00D8..U+00F6 U+00F8..U+02FF
3869     U+0370..U+037D U+037F..U+1FFF U+200C..U+200D
3870     U+2070..U+218F U+2C00..U+2FEF U+3001..U+D7FF
3871     U+F900..U+FDCF U+FDF0..U+FFFD U+10000..U+EFFFF
3872     ];
3873 wakaba 1.4 } // NameChar
3874    
3875     lexmode Name
3876     : extends => 'NameChar'
3877     {
3878 wakaba 1.1 Name : value := $NameStartChar11 $NameChar11*;
3879     } // Name
3880 wakaba 1.4
3881     lexmode Nmtoken
3882     : extends => 'NameChar'
3883     {
3884     Nmtoken : value := $NameChar11*;
3885     } // Nmtoken
3886 wakaba 1.1
3887     /*
3888 wakaba 1.14 S
3889 wakaba 1.1 */
3890     lexmode S {
3891 wakaba 1.14 $s := [U+0009 U+000A U+000D U+0020];
3892     S := $s+;
3893 wakaba 1.1 } // S
3894    
3895     /*
3896     Document end scanning mode
3897     */
3898     lexmode DocumentEnd
3899     : standalone
3900     : extends => 'S'
3901     {
3902     /*
3903     Processing instruction
3904     */
3905     PIO := ['<'] ['?'];
3906    
3907     /*
3908     Comment declaration
3909     */
3910     CDO := ['<'] ['!'] ['-'] ['-'];
3911     } // DocumentEnd
3912    
3913     /*
3914     Document misc scanning mode
3915    
3916     This mode scans |Misc| constructions as well
3917     as document element's start tag.
3918     */
3919     lexmode DocumentMisc
3920     : standalone
3921     : extends => 'DocumentEnd'
3922     {
3923     /*
3924     Document element start tag
3925     */
3926     STAGO := ['<'];
3927     } // DocumentMisc
3928    
3929     /*
3930     Document prolog scanning mode
3931     */
3932     lexmode DocumentProlog
3933     : standalone
3934     : extends => 'DocumentMisc'
3935     {
3936     /*
3937     |DOCTYPE| declaration
3938     */
3939     MDO := ['<'] ['!'];
3940     } // DocumentProlog
3941 wakaba 1.16
3942 wakaba 1.1 /*
3943 wakaba 1.16 Document Start Scanning Mode
3944 wakaba 1.1 */
3945     lexmode DocumentStart
3946     : standalone
3947     : extends => 'DocumentProlog'
3948     {
3949     /*
3950     XML declaration
3951     */
3952 wakaba 1.16 XDO := ['<'] ['?'] ['x'] ['m'] ['l'];
3953 wakaba 1.1 } // DocumentStart
3954    
3955     /*
3956     Comment declaration scanning mode
3957     */
3958     lexmode CommentDeclaration
3959     : standalone
3960     {
3961     /*
3962     Comment close
3963     */
3964     COM := ['-'] ['-'];
3965    
3966     /*
3967     Comment data
3968     */
3969 wakaba 1.15 ?default-token STRING : value;
3970 wakaba 1.1 } // CommentDeclaration
3971    
3972     /*
3973     Processing instruction name and |S| scanning mode
3974     */
3975     lexmode PIName
3976     : standalone
3977     : extends => 'Name'
3978     : extends => 'S'
3979     {
3980     /*
3981     Processing instruction close
3982     */
3983     PIC := ['?'] ['>'];
3984     } // PIName
3985    
3986     /*
3987 wakaba 1.16 Processing instruction name and |S| scanning mode
3988     */
3989     lexmode PINmtoken
3990     : standalone
3991     : extends => 'Nmtoken'
3992     : extends => 'S'
3993     {
3994     /*
3995     Processing instruction close
3996     */
3997     PIC := ['?'] ['>'];
3998     } // PINmtoken
3999    
4000     /*
4001 wakaba 1.1 Processing instruction data scanning mode
4002     */
4003     lexmode PIData
4004     : standalone
4005     {
4006     /*
4007     Processing instruction close
4008     */
4009     PIC := ['?'] ['>'];
4010    
4011     /*
4012     Processing instruction target data
4013     */
4014 wakaba 1.2 ?default-token DATA : value;
4015 wakaba 1.1 } // PIData
4016    
4017     /*
4018     Content of element scanning mode
4019     */
4020     lexmode ElementContent
4021     : standalone
4022     {
4023     /*
4024     Start tag open
4025     */
4026     STAGO := ['<'];
4027    
4028     /*
4029     End tag open
4030     */
4031     ETAGO := ['<'] ['/'];
4032    
4033     /*
4034     Hexadecimal character reference open
4035     */
4036     HCRO := ['&'] ['#'] ['x'];
4037    
4038     /*
4039     Numeric character reference open
4040     */
4041     CRO := ['&'] ['#'];
4042    
4043     /*
4044     General entity reference open
4045     */
4046     ERO := ['&'];
4047    
4048     /*
4049     Comment declaration open
4050     */
4051     CDO := ['<'] ['!'] ['-'] ['-'];
4052    
4053     /*
4054     CDATA section open
4055     */
4056     CDSO := ['<'] ['!'] ['[']
4057     ['C'] ['D'] ['A'] ['T'] ['A'] ['['];
4058    
4059     /*
4060     Processing instruction open
4061     */
4062     PIO := ['<'] ['?'];
4063 wakaba 1.2
4064     /*
4065     Markup section end
4066     */
4067     MSE := [']'] [']'] ['>'];
4068    
4069     /*
4070     Character data
4071     */
4072     /*
4073     Character data and/or |MSE|
4074     */
4075     ?default-token CharData : value;
4076 wakaba 1.1 } // ElementContent
4077    
4078     /*
4079     CDATA section content scanning mode
4080     */
4081     lexmode CDATASectionContent
4082     : standalone
4083     {
4084     /*
4085     Markup section end
4086     */
4087     MSE := [']'] [']'] ['>'];
4088    
4089     /*
4090     Character data
4091 wakaba 1.2 */
4092     ?default-token CData : value;
4093 wakaba 1.1 } // CDATASectionContent
4094    
4095     lexmode EntityReference
4096     : standalone
4097     : extends => 'Name'
4098     {
4099     /*
4100     Reference close
4101     */
4102     REFC := [';'];
4103     } // EntityReference
4104    
4105     lexmode NumericCharacterReference
4106     : standalone
4107     {
4108     /*
4109     Decimal number
4110     */
4111     $digit := ['0' '1' '2' '3' '4' '5' '6' '7' '8' '9'];
4112     NUMBER : value := $digit+;
4113    
4114     /*
4115     Reference close
4116     */
4117     REFC := [';'];
4118     } // NumericCharacterReference
4119    
4120     lexmode HexadecimalCharacterReference
4121     : standalone
4122     {
4123     /*
4124     Hexadecimal number
4125     */
4126     $hexdigit := ['0' '1' '2' '3' '4' '5' '6' '7' '8' '9'
4127     'A' 'B' 'C' 'D' 'E' 'F'
4128     'a' 'b' 'c' 'd' 'e' 'f'];
4129     Hex : value := $hexdigit+;
4130    
4131     /*
4132     Reference close
4133     */
4134     REFC := [';'];
4135     } // HexadecimalCharacterReference
4136    
4137 wakaba 1.16 /*
4138     The XML Declaration and Text Declaration Scanning Mode
4139     */
4140 wakaba 1.3 lexmode XMLDeclaration
4141     : standalone
4142     : extends => 'Name'
4143     : extends => 'S'
4144     {
4145    
4146     /*
4147     Value indicator
4148     */
4149     VI := ['='];
4150    
4151     /*
4152     Literal open
4153     */
4154     LIT := ['"'];
4155     LITA := [U+0027];
4156    
4157     /*
4158     Processing instruction close
4159 wakaba 1.16
4160     The |PIC|, i.e. |?>|, is split into two tokens |PIC1| and |PIC2|
4161     in this scanning mode to set |no_xml11_eol| flag in the
4162     |_XMLDeclaration_| |rule|.
4163 wakaba 1.3 */
4164 wakaba 1.16 PIC1 := ['?'];
4165     PIC2 := ['>'];
4166 wakaba 1.3 } // XMLDeclaration
4167 wakaba 1.16
4168     /*
4169     The XML Declaration or Processing Instruction Scanning Mode
4170    
4171     '<?xml' S ...
4172     (DocumentStart) (XMLDeclarationOrPI) (XMLDeclaration)
4173     '<?xml' '1' S ...
4174     (DocumentStart) (XMLDeclarationOrPI) (PINmtoken)(PIName) (PITarget)
4175     '<?xml' '-' 'stylesheet' S ...
4176     (DocumentStart) (XMLDeclarationOrPI) (PINmtoken) (PIName) (PITarget)
4177     */
4178     lexmode XMLDeclarationOrPI
4179     : standalone
4180     : extends => 'NameChar'
4181     : extends => 'S'
4182     {
4183     NameChar : value := $NameChar11;
4184     } // XMLDeclarationOrPI
4185 wakaba 1.3
4186 wakaba 1.1 lexmode StartTag
4187     : standalone
4188     : extends => 'Name'
4189     : extends => 'S'
4190     {
4191    
4192     /*
4193     Value indicator
4194     */
4195     VI := ['='];
4196    
4197     /*
4198     Literal open
4199     */
4200     LIT := ['"'];
4201     LITA := [U+0027];
4202    
4203     /*
4204     Tag close
4205     */
4206     TAGC := ['>'];
4207    
4208     /*
4209 wakaba 1.6 Null end-tag enabled start-tag close
4210 wakaba 1.1 */
4211 wakaba 1.6 NESTC := ['/'];
4212 wakaba 1.1 } // StartTag
4213    
4214     lexmode EndTag
4215     : standalone
4216     : extends => 'Name'
4217     : extends => 'S'
4218     {
4219     /*
4220     Tag close
4221     */
4222     TAGC := ['>'];
4223     } // EndTag
4224    
4225     lexmode AttributeValueLiteral_ {
4226     ERO := ['&'];
4227     CRO := ['&'] ['#'];
4228     HCRO := ['&'] ['#'] ['x'];
4229     } // AttributeValueLiteral_
4230    
4231     lexmode AttributeValueLiteral
4232     : standalone
4233     : extends => 'AttributeValueLiteral_'
4234     {
4235     LIT := ['"'];
4236 wakaba 1.3 STRING : value := [^'"' '&' '<']+;
4237 wakaba 1.1 } // AttributeValueLiteral
4238    
4239     lexmode AttributeValueLiteralA
4240     : standalone
4241     : extends => 'AttributeValueLiteral_'
4242     {
4243 wakaba 1.4 LITA := [U+0027];
4244 wakaba 1.3 STRING : value := [^U+0027 '&' '<']+;
4245 wakaba 1.1 } // AttributeValueLiteralA
4246 wakaba 1.11
4247     lexmode AttributeValueLiteralE
4248     : standalone
4249     : extends => 'AttributeValueLiteral_'
4250     {
4251     STRING : value := [^'&' '<']+;
4252     } // AttributeValueLiteralE
4253 wakaba 1.4
4254     lexmode EntityValue_ {
4255     PERO := ['%'];
4256     ERO := ['&'];
4257     CRO := ['&'] ['#'];
4258     HCRO := ['&'] ['#'] ['x'];
4259     } // EntityValue_
4260    
4261     lexmode EntityValue
4262     : standalone
4263     : extends => 'EntityValue_'
4264     {
4265     LIT := ['"'];
4266     STRING : value := [^'"' '&' '%']+;
4267     } // EntityValue
4268    
4269     lexmode EntityValueA
4270     : standalone
4271     : extends => 'EntityValue_'
4272     {
4273     LITA := [U+0027];
4274     STRING : value := [^U+0027 '&' '%']+;
4275     } // EntityValueA
4276    
4277     lexmode SystemLiteral
4278     : standalone
4279     {
4280     LIT := ['"'];
4281     ?default-token STRING : value;
4282     } // SystemLiteral
4283    
4284     lexmode SystemLiteralA
4285     : standalone
4286     {
4287     LITA := [U+0027];
4288     ?default-token STRING : value;
4289     } // SystemLiteralA
4290    
4291     lexmode DTD
4292     : standalone
4293     : extends => 'S'
4294     {
4295     /*
4296     Markup declaration open
4297     */
4298     MDO := ['<'] ['!'];
4299    
4300     /*
4301     Comment declaration open
4302     */
4303     CDO := ['<'] ['!'] ['-'] ['-'];
4304    
4305     /*
4306     Processing instruction open
4307     */
4308     PIO := ['<'] ['?'];
4309    
4310     /*
4311     Parameter entity reference open
4312     */
4313     PERO := ['%'];
4314    
4315     /*
4316     Declaration subset close
4317     */
4318     DSC := [']'];
4319    
4320     /*
4321     Contition section open
4322     */
4323     CSO := ['<'] ['!'] ['['];
4324     } // DTD
4325    
4326     /*
4327     Markup declaration scanning mode
4328    
4329     This mode is used to recognize |MDC| that terminates
4330     a comment declaration as well as the base |lexmode|
4331     for e.g. document type declaration scanning mode.
4332     */
4333     lexmode MarkupDeclaration
4334     : standalone
4335     : extends => 'Name'
4336     : extends => 'S'
4337     {
4338     /*
4339     Markup declaration close
4340     */
4341     MDC := ['>'];
4342    
4343     /*
4344     Literal open
4345     */
4346     LIT := ['"'];
4347    
4348     /*
4349     Alternative literal open
4350     */
4351     LITA := [U+0027];
4352    
4353     /*
4354     Parameter entity reference open
4355     */
4356     PERO := ['%'];
4357    
4358     /*
4359     Declaration subset open
4360     */
4361     DSO := ['['];
4362     } // MarkupDeclaration
4363    
4364     lexmode ElementDeclaration
4365     : standalone
4366     : extends => 'MarkupDeclaration'
4367     {
4368     /*
4369     Model group open
4370     */
4371     MGO := ['('];
4372    
4373     /*
4374     Model group close
4375     */
4376     MGC := [')'];
4377    
4378     /*
4379     Reserved name indicator
4380     */
4381     RNI := ['#'];
4382    
4383     /*
4384     Occurence indicators
4385     */
4386     OPT := ['?'];
4387     REP := ['*'];
4388     PLUS := ['+'];
4389    
4390     /*
4391     Connectors
4392     */
4393     OR := ['|'];
4394     SEQ := [','];
4395     } // ElementDeclaration
4396    
4397     lexmode AttlistDeclaration
4398     : standalone
4399     : extends => 'MarkupDeclaration'
4400     {
4401     /*
4402     Enumeration group open
4403     */
4404     EGO := ['('];
4405    
4406     /*
4407     Enumeration group close
4408     */
4409     EGC := [')'];
4410    
4411     /*
4412     Enumeration choice delimiter
4413     */
4414     OR := ['|'];
4415    
4416     /*
4417     Reserved name indicator
4418     */
4419     RNI := ['#'];
4420     } // AttlistDeclaration
4421    
4422     lexmode Enumeration
4423     : standalone
4424     : extends => 'Nmtoken'
4425     : extends => 'S'
4426     {
4427     /*
4428     Enumeration group close
4429     */
4430     EGC := [')'];
4431    
4432     /*
4433     Enumeration choice delimiter
4434     */
4435     OR := ['|'];
4436     } // Enumeration
4437    
4438 wakaba 1.1
4439     token-error default : default {
4440     lang:Perl {
4441 wakaba 1.3 my $location;
4442     __CODE{xp|get-location-from-token::
4443     $token => {$token},
4444     $result => {$location},
4445     }__;
4446     my $continue = __DOMCore:ERROR{xp|wf-syntax-error::
4447 wakaba 1.1 xp|error-token => {$token},
4448     DOMCore|location => {$location},
4449     }__;
4450     unless ($continue) {
4451     __EXCEPTION{DOMLS|PARSE_ERR::
4452     }__;
4453     }
4454     }
4455     } // default
4456 wakaba 1.5
4457     @XMLTests:
4458     @@XMLTest:
4459 wakaba 1.15 @@@QName: xp.char.xml10.test
4460     @@@DEnt:
4461     @@@@test:value:
4462     <?xml version="1.0"?>
4463     <p>$u0009$u000A$u000D$u0020$uD7FF$uE000$uFFFD$U00010000$U0010FFFF</p>
4464     @@@test:domTree:
4465     document {
4466     xml-version: '1.0';
4467     element {
4468     text-content: U+0009 U+000A U+000A U+0020 U+D7FF
4469     U+E000 U+FFFD U+10000 U+10FFFF;
4470     }
4471     }
4472     @@XMLTest:
4473     @@@QName: xp.char.xml11.test
4474     @@@DEnt:
4475     @@@@test:value:
4476     <?xml version="1.1"?>
4477     <p>$u0009$u000A$u000D$u0020$uD7FF$uE000$uFFFD$U00010000$U0010FFFF</p>
4478     @@@test:domTree:
4479     document {
4480     xml-version: '1.1';
4481     element {
4482     text-content: U+0009 U+000A U+000A U+0020 U+D7FF
4483     U+E000 U+FFFD U+10000 U+10FFFF;
4484     }
4485     }
4486     @@XMLTest:
4487     @@@QName: xp.char.xml10.c0.test
4488     @@@DEnt:
4489     @@@@test:value:
4490     <?xml version="1.0"?>
4491     <p>$u0000$u0001$u0002$u0003$u0004$u0005$u0006$u0007$u0008$u000B$
4492     $u000C$u000E$u000F$u0010$u0011$u0012$u0013$u0014$u0015$u0016$
4493     $u0017$u0018$u0019$u001A$u001B$u001C$u001D$u001E$u001F</p>
4494     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 4); } /* U+0000 */
4495     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 5); } /* U+0001 */
4496     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 6); } /* U+0002 */
4497     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 7); } /* U+0003 */
4498     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 8); } /* U+0004 */
4499     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 9); } /* U+0005 */
4500     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 10); } /* U+0006 */
4501     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 11); } /* U+0007 */
4502     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 12); } /* U+0008 */
4503     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 13); } /* U+000B */
4504     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 14); } /* U+000C */
4505     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 15); } /* U+000E */
4506     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 16); } /* U+000F */
4507     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 17); } /* U+0010 */
4508     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 18); } /* U+0011 */
4509     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 19); } /* U+0012 */
4510     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 20); } /* U+0013 */
4511     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 21); } /* U+0014 */
4512     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 22); } /* U+0015 */
4513     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 23); } /* U+0016 */
4514     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 24); } /* U+0017 */
4515     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 25); } /* U+0018 */
4516     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 26); } /* U+0019 */
4517     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 27); } /* U+001A */
4518     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 28); } /* U+001B */
4519     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 29); } /* U+001C */
4520     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 30); } /* U+001D */
4521     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 31); } /* U+001E */
4522     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 32); } /* U+001F */
4523     @@XMLTest:
4524     @@@QName: xp.char.xml11.c0.test
4525     @@@DEnt:
4526     @@@@test:value:
4527     <?xml version="1.1"?>
4528     <p>$u0000$u0001$u0002$u0003$u0004$u0005$u0006$u0007$u0008$u000B$
4529     $u000C$u000E$u000F$u0010$u0011$u0012$u0013$u0014$u0015$u0016$
4530     $u0017$u0018$u0019$u001A$u001B$u001C$u001D$u001E$u001F</p>
4531     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 4); } /* U+0000 */
4532     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 5); } /* U+0001 */
4533     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 6); } /* U+0002 */
4534     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 7); } /* U+0003 */
4535     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 8); } /* U+0004 */
4536     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 9); } /* U+0005 */
4537     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 10); } /* U+0006 */
4538     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 11); } /* U+0007 */
4539     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 12); } /* U+0008 */
4540     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 13); } /* U+000B */
4541     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 14); } /* U+000C */
4542     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 15); } /* U+000E */
4543     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 16); } /* U+000F */
4544     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 17); } /* U+0010 */
4545     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 18); } /* U+0011 */
4546     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 19); } /* U+0012 */
4547     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 20); } /* U+0013 */
4548     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 21); } /* U+0014 */
4549     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 22); } /* U+0015 */
4550     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 23); } /* U+0016 */
4551     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 24); } /* U+0017 */
4552     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 25); } /* U+0018 */
4553     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 26); } /* U+0019 */
4554     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 27); } /* U+001A */
4555     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 28); } /* U+001B */
4556     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 29); } /* U+001C */
4557     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 30); } /* U+001D */
4558     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 31); } /* U+001E */
4559     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 32); } /* U+001F */
4560     @@XMLTest:
4561     @@@QName: xp.char.xml10.c1.test
4562     @@@DEnt:
4563     @@@@test:value:
4564     <?xml version="1.0"?>
4565     <p>$u007F$u0080$u0081$u0082$u0083$u0084$u0086$u0087$u0088$
4566     $u0089$u008A$u008B$u008C$
4567     $u008D$u008E$u008F$u0090$u0091$u0092$u0093$u0094$u0095$u0096$
4568     $u0097$u0098$u0099$u009A$u009B$u009C$u009D$u009E$u009F$u0085</p>
4569     @@@test:domTree:
4570     document {
4571     xml-version: '1.0';
4572     element {
4573     text-content: U+007F U+0080 U+0081 U+0082 U+0083 U+0084 U+0086
4574     U+0087 U+0088 U+0089 U+008A U+008B U+008C U+008D
4575     U+008E U+008F U+0090 U+0091 U+0092 U+0093 U+0094
4576     U+0095 U+0096 U+0097 U+0098 U+0099 U+009A U+009B
4577     U+009C U+009D U+009E U+009F U+0085;
4578     }
4579     }
4580     @@XMLTest:
4581     @@@QName: xp.char.xml11.c1.test
4582     @@@DEnt:
4583     @@@@test:value:
4584     <?xml version="1.1"?>
4585     <p>$u007F$u0080$u0081$u0082$u0083$u0084$u0086$u0087$u0088$
4586     $u0089$u008A$u008B$u008C$
4587     $u008D$u008E$u008F$u0090$u0091$u0092$u0093$u0094$u0095$u0096$
4588     $u0097$u0098$u0099$u009A$u009B$u009C$u009D$u009E$u009F$u0085</p>
4589     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 4); } /* U+007F */
4590     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 5); } /* U+0080 */
4591     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 6); } /* U+0081 */
4592     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 7); } /* U+0082 */
4593     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 8); } /* U+0083 */
4594     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 9); } /* U+0084 */
4595     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 10); } /* U+0086 */
4596     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 11); } /* U+0087 */
4597     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 12); } /* U+0088 */
4598     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 13); } /* U+0089 */
4599     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 14); } /* U+008A */
4600     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 15); } /* U+008B */
4601     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 16); } /* U+008C */
4602     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 17); } /* U+008D */
4603     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 18); } /* U+008E */
4604     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 19); } /* U+008F */
4605     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 20); } /* U+0090 */
4606     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 21); } /* U+0091 */
4607     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 22); } /* U+0092 */
4608     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 23); } /* U+0093 */
4609     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 24); } /* U+0094 */
4610     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 25); } /* U+0095 */
4611     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 26); } /* U+0096 */
4612     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 27); } /* U+0097 */
4613     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 28); } /* U+0098 */
4614     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 29); } /* U+0099 */
4615     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 30); } /* U+009A */
4616     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 31); } /* U+009B */
4617     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 32); } /* U+009C */
4618     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 33); } /* U+009D */
4619     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 34); } /* U+009E */
4620     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 35); } /* U+009F */
4621    
4622     @@XMLTest:
4623 wakaba 1.12 @@@QName: xp.syntax.empty.test
4624     @@@DEnt:
4625     @@@@test:value: \
4626     @@@c:erred:
4627     <[[xp:wf-syntax-error]]> { (1, 1); }
4628     @@XMLTest:
4629     @@@QName: xp.syntax.space.test
4630     @@@DEnt:
4631 wakaba 1.13 @@@@test:value: \
4632 wakaba 1.12 @@@c:erred:
4633     <[[xp:wf-syntax-error]]> { (1, 4); }
4634     @@XMLTest:
4635     @@@QName: xp.syntax.newlines.test
4636     @@@DEnt:
4637     @@@@test:value:
4638     \
4639     \
4640     \
4641     @@@c:erred:
4642     <[[xp:wf-syntax-error]]> { (3, 1); }
4643    
4644     @@XMLTest:
4645 wakaba 1.6 @@@QName: xp.only.docel.test
4646 wakaba 1.5 @@@DEnt:
4647     @@@@test:value:
4648     <p></p>
4649     @@@test:domTree:
4650     document {
4651     xml-version: '1.0';
4652 wakaba 1.6 xml-encoding: null;
4653     xml-standalone: false;
4654     element {
4655     namespace-uri: null;
4656     prefix: null;
4657     local-name: 'p';
4658     text-content: '';
4659     }
4660     }
4661     @@XMLTest:
4662     @@@QName: xp.only.docel.emptyelemtag.test
4663     @@@DEnt:
4664     @@@@test:value:
4665     <p/>
4666     @@@test:domTree:
4667     document {
4668     xml-version: '1.0';
4669     xml-encoding: null;
4670     xml-standalone: false;
4671 wakaba 1.5 element {
4672     namespace-uri: null;
4673     prefix: null;
4674     local-name: 'p';
4675     text-content: '';
4676     }
4677     }
4678 wakaba 1.15 @@XMLTest:
4679     @@@QName: xp.root.s.1.test
4680     @@@DEnt:
4681     @@@@test:value:
4682     <?xml version="1.0"?>$u0020$u000D$u000A$u0009
4683     <p></p>
4684     @@@test:domTree:
4685     document {
4686     element { }
4687     }
4688    
4689     @@XMLTest:
4690     @@@QName: xp.Name.1.test
4691     @@@DEnt:
4692     @@@@test:value: <name/>
4693     @@@test:domTree:
4694     document {
4695     element {
4696     node-name: 'name';
4697     }
4698     }
4699     @@XMLTest:
4700     @@@QName: xp.Name.2.test
4701     @@@DEnt:
4702     @@@@test:value: <name0/>
4703     @@@test:domTree:
4704     document {
4705     element {
4706     node-name: 'name0';
4707     }
4708     }
4709     @@enImplNote:
4710     @@@ddid: xml11name
4711     @@@@:
4712     {TODO:: XML 1.1 Name tests required
4713     }
4714    
4715     @@XMLTest:
4716     @@@QName: xp.content.mse.1.test
4717     @@@DEnt:
4718     @@@@test:value:
4719     <p>]]></p>
4720     @@@c:erred:
4721     <[[xp|wf-syntax-error]]> { (1, 4)..(1, 6); }
4722     @@XMLTest:
4723     @@@QName: xp.content.mse.2.test
4724     @@@DEnt:
4725     @@@@test:value:
4726     <p>aaa]]>bbb</p>
4727     @@@c:erred:
4728     <[[xp|wf-syntax-error]]> { (1, 7)..(1, 9); }
4729    
4730     @@XMLTest:
4731     @@@QName: xp.root.comment.1.test
4732     @@@DEnt:
4733     @@@@test:value:
4734     <!--comment data-->
4735     <p/>
4736     @@@test:domTree:
4737     document {
4738     comment {
4739     data: 'comment data';
4740     }
4741     element { }
4742     }
4743     @@XMLTest:
4744     @@@QName: xp.root.comment.2.test
4745     @@@DEnt:
4746     @@@@test:value:
4747     <!---->
4748     <p/>
4749     @@@test:domTree:
4750     document {
4751     comment {
4752     data: '';
4753     }
4754     element { }
4755     }
4756     @@XMLTest:
4757     @@@QName: xp.root.after.pi.comment.1.test
4758     @@@DEnt:
4759     @@@@test:value:
4760     <?pi?>
4761     <!--comment data-->
4762     <p/>
4763     @@@test:domTree:
4764     document {
4765     pi { }
4766     comment {
4767     data: 'comment data';
4768     }
4769     element { }
4770     }
4771     @@XMLTest:
4772     @@@QName: xp.root.after.pi.comment.2.test
4773     @@@DEnt:
4774     @@@@test:value:
4775     <?pi?>
4776     <!---->
4777     <p/>
4778     @@@test:domTree:
4779     document {
4780     pi { }
4781     comment {
4782     data: '';
4783     }
4784     element { }
4785     }
4786     @@XMLTest:
4787     @@@QName: xp.root.after.element.comment.1.test
4788     @@@DEnt:
4789     @@@@test:value:
4790     <p/>
4791     <!--comment data-->
4792     @@@test:domTree:
4793     document {
4794     element { }
4795     comment {
4796     data: 'comment data';
4797     }
4798     }
4799     @@XMLTest:
4800     @@@QName: xp.root.after.element.comment.2.test
4801     @@@DEnt:
4802     @@@@test:value:
4803     <p/>
4804     <!---->
4805     @@@test:domTree:
4806     document {
4807     element { }
4808     comment {
4809     data: '';
4810     }
4811     }
4812     @@XMLTest:
4813     @@@QName: xp.doctype.intsubset.comment.1.test
4814     @@@DEnt:
4815     @@@@test:value:
4816     <!DOCTYPE a [
4817     <!--comment data-->
4818     ]>
4819     <p/>
4820     @@@test:domTree:
4821     document {
4822     document-type { }
4823     element { }
4824     }
4825     @@XMLTest:
4826     @@@QName: xp.doctype.intsubset.comment.2.test
4827     @@@DEnt:
4828     @@@@test:value:
4829     <!DOCTYPE a [
4830     <!---->
4831     ]>
4832     <p/>
4833     @@@test:domTree:
4834     document {
4835     document-type { }
4836     element { }
4837     }
4838     @@XMLTest:
4839     @@@QName: xp.doctype.intsubset.comment.3.test
4840     @@@DEnt:
4841     @@@@test:value:
4842     <!DOCTYPE a [
4843     <?pi?>
4844     <!---->
4845     ]>
4846     <p/>
4847     @@@test:domTree:
4848     document {
4849     document-type {
4850     pi { }
4851     }
4852     element { }
4853     }
4854     @@XMLTest:
4855     @@@QName: xp.content.comment.1.test
4856     @@@DEnt:
4857     @@@@test:value:
4858     <p><!--comment data--></p>
4859     @@@test:domTree:
4860     document {
4861     element {
4862     comment {
4863     data: 'comment data';
4864     }
4865     }
4866     }
4867     @@XMLTest:
4868     @@@QName: xp.content.comment.2.test
4869     @@@DEnt:
4870     @@@@test:value:
4871     <p><!----></p>
4872     @@@test:domTree:
4873     document {
4874     element {
4875     comment {
4876     data: '';
4877     }
4878     }
4879     }
4880     @@XMLTest:
4881     @@@QName: xp.content.comment.3.test
4882     @@@DEnt:
4883     @@@@test:value:
4884     <p>aaaaa<!---->bbbbb</p>
4885     @@@test:domTree:
4886     document {
4887     element {
4888     text {
4889     data: 'aaaaa';
4890     }
4891     comment {
4892     data: '';
4893     }
4894     text {
4895     data: 'bbbbb';
4896     }
4897     }
4898     }
4899     @@XMLTest:
4900     @@@QName: xp.content.comment.--.1.test
4901     @@@DEnt:
4902     @@@@test:value:
4903     <p><!--data--data--></p>
4904     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 12)..(1, 17); }
4905     @@XMLTest:
4906     @@@QName: xp.content.comment.---gt.test
4907     @@@DEnt:
4908     @@@@test:value:
4909     <p><!--data---></p>
4910     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 12)..(1, 15); }
4911 wakaba 1.13
4912     @@XMLTest:
4913     @@@QName: xp.xmldecl.version.1.0.test
4914     @@@DEnt:
4915     @@@@test:value:
4916     <?xml version="1.0"?>
4917     <p></p>
4918     @@@test:domTree:
4919     document {
4920     xml-version: '1.0';
4921     xml-encoding: null;
4922     xml-standalone: false;
4923     element { }
4924     }
4925     @@XMLTest:
4926     @@@QName: xp.xmldecl.version.1.0.lita.test
4927     @@@DEnt:
4928     @@@@test:value:
4929     <?xml version='1.0'?>
4930     <p></p>
4931     @@@test:domTree:
4932     document {
4933     xml-version: '1.0';
4934     xml-encoding: null;
4935     xml-standalone: false;
4936     element { }
4937     }
4938     @@XMLTest:
4939     @@@QName: xp.xmldecl.version.1.0.s.test
4940     @@@DEnt:
4941     @@@@test:value:
4942     <?xml version = "1.0" ?>
4943     <p></p>
4944     @@@test:domTree:
4945     document {
4946     xml-version: '1.0';
4947     xml-encoding: null;
4948     xml-standalone: false;
4949     element { }
4950     }
4951     @@XMLTest:
4952     @@@QName: xp.xmldecl.version.1.1.test
4953     @@@DEnt:
4954     @@@@test:value:
4955     <?xml version="1.1"?>
4956     <p></p>
4957     @@@test:domTree:
4958     document {
4959     xml-version: '1.1';
4960     xml-encoding: null;
4961     xml-standalone: false;
4962     element { }
4963     }
4964    
4965     @@XMLTest:
4966     @@@QName: xp.xmldecl.version.1.0.encoding.usascii.test
4967     @@@DEnt:
4968     @@@@test:value:
4969     <?xml version="1.0" encoding="US-ascii"?>
4970     <p></p>
4971     @@@test:domTree:
4972     document {
4973     xml-version: '1.0';
4974     xml-encoding: 'US-ascii';
4975     xml-standalone: false;
4976     element { }
4977     }
4978     @@XMLTest:
4979     @@@QName: xp.xmldecl.version.1.0.encoding.usascii.lita.test
4980     @@@DEnt:
4981     @@@@test:value:
4982     <?xml version="1.0" encoding='US-ascii'?>
4983     <p></p>
4984     @@@test:domTree:
4985     document {
4986     xml-version: '1.0';
4987     xml-encoding: 'US-ascii';
4988     xml-standalone: false;
4989     element { }
4990     }
4991     @@XMLTest:
4992     @@@QName: xp.xmldecl.version.1.0.encoding.usascii.s.test
4993     @@@DEnt:
4994     @@@@test:value:
4995     <?xml version="1.0" encoding = "US-ascii" ?>
4996     <p></p>
4997     @@@test:domTree:
4998     document {
4999     xml-version: '1.0';
5000     xml-encoding: 'US-ascii';
5001     xml-standalone: false;
5002     element { }
5003     }
5004    
5005     @@XMLTest:
5006     @@@QName: xp.xmldecl.version.1.0.encoding.usascii.standalone.yes.test
5007     @@@DEnt:
5008     @@@@test:value:
5009     <?xml version="1.0" encoding="us-ascii" standalone="yes"?>
5010     <p></p>
5011     @@@test:domTree:
5012     document {
5013     xml-version: '1.0';
5014     xml-encoding: 'us-ascii';
5015     xml-standalone: true;
5016     element { }
5017     }
5018     @@XMLTest:
5019     @@@QName: xp.xmldecl.version.1.0.encoding.usascii.standalone.no.test
5020     @@@DEnt:
5021     @@@@test:value:
5022     <?xml version="1.0" encoding="us-ascii" standalone="no"?>
5023     <p></p>
5024     @@@test:domTree:
5025     document {
5026     xml-version: '1.0';
5027     xml-encoding: 'us-ascii';
5028     xml-standalone: false;
5029     element { }
5030     }
5031     @@XMLTest:
5032     @@@QName: xp.xmldecl.version.1.0.encoding.usascii.standalone.yes.lita.test
5033     @@@DEnt:
5034     @@@@test:value:
5035     <?xml version="1.0" encoding="us-ascii" standalone='yes'?>
5036     <p></p>
5037     @@@test:domTree:
5038     document {
5039     xml-version: '1.0';
5040     xml-encoding: 'us-ascii';
5041     xml-standalone: true;
5042     element { }
5043     }
5044     @@XMLTest:
5045     @@@QName: xp.xmldecl.version.1.0.encoding.usascii.standalone.yes.s.test
5046     @@@DEnt:
5047     @@@@test:value:
5048     <?xml version="1.0" encoding="us-ascii" standalone = "yes" ?>
5049     <p></p>
5050     @@@test:domTree:
5051     document {
5052     xml-version: '1.0';
5053     xml-encoding: 'us-ascii';
5054     xml-standalone: true;
5055     element { }
5056     }
5057 wakaba 1.14 @@XMLTest:
5058     @@@QName: xp.xmldecl.no.encoding.but.standalone.attr.test
5059     @@@DEnt:
5060     @@@@test:value:
5061     <?xml version="1.0" standalone="yes"?>
5062     <p></p>
5063     @@@test:domTree:
5064     document {
5065     xml-version: '1.0';
5066     xml-encoding: null;
5067     xml-standalone: true;
5068     element { }
5069     }
5070     @@XMLTest:
5071     @@@QName: xp.xmldecl.encoding.encname.test
5072     @@@DEnt:
5073     @@@@test:value:
5074     <?xml version="1.0" encoding="a-._01-"?>
5075     <p></p>
5076     @@@test:domTree:
5077     document {
5078     xml-version: '1.0';
5079     xml-encoding: 'a-._01-';
5080     xml-standalone: false;
5081     element { }
5082     }
5083    
5084     @@XMLTest:
5085     @@@QName: xp.xmldecl.no.s.no.attr.test
5086     @@@DEnt:
5087     @@@@test:value:
5088     <?xml?>
5089     <p></p>
5090     @@@c:erred:
5091 wakaba 1.16 <[[xp:wf-syntax-error]]> { (1, 1)..(1, 7); }
5092 wakaba 1.14 @@XMLTest:
5093     @@@QName: xp.xmldecl.s.no.attr.test
5094     @@@DEnt:
5095     @@@@test:value:
5096     <?xml ?>
5097     <p></p>
5098     @@@c:erred:
5099     <[[xp:wf-syntax-error]]> { (1, 8)..(1, 9); }
5100     @@XMLTest:
5101     @@@QName: xp.xmldecl.unknown.attr.test
5102     @@@DEnt:
5103     @@@@test:value:
5104     <?xml unknown="value"?>
5105     <p></p>
5106     @@@c:erred:
5107     <[[xp:wf-syntax-error]]> { (1, 8)..(1, 22); }
5108     @@XMLTest:
5109     @@@QName: xp.xmldecl.version.unknown.attr.test
5110     @@@DEnt:
5111     @@@@test:value:
5112     <?xml version="1.0" unknown="value"?>
5113     <p></p>
5114     @@@c:erred:
5115     <[[xp:wf-syntax-error]]> { (1, 21)..(1, 35); }
5116     @@XMLTest:
5117     @@@QName: xp.xmldecl.version.encoding.unknown.attr.test
5118     @@@DEnt:
5119     @@@@test:value:
5120     <?xml version="1.0" encoding="us-ascii" unknown="value"?>
5121     <p></p>
5122     @@@c:erred:
5123     <[[xp:wf-syntax-error]]> { (1, 41)..(1, 55); }
5124     @@XMLTest:
5125     @@@QName: xp.xmldecl.version.encoding.standalone.unknown.attr.test
5126     @@@DEnt:
5127     @@@@test:value:
5128     <?xml version="1.0" encoding="us-ascii" standalone="yes"
5129     unknown="value"?>
5130     <p></p>
5131     @@@c:erred:
5132     <[[xp:wf-syntax-error]]> { (2, 1)..(2, 15); }
5133     @@XMLTest:
5134     @@@QName: xp.xmldecl.no.version.but.encoding.attr.test
5135     @@@DEnt:
5136     @@@@test:value:
5137     <?xml encoding="us-ascii"?>
5138     <p></p>
5139     @@@c:erred:
5140     <[[xp:wf-syntax-error]]> { (1, 7)..(1, 25); }
5141     @@XMLTest:
5142     @@@QName: xp.xmldecl.no.version.but.standalone.attr.test
5143     @@@DEnt:
5144     @@@@test:value:
5145     <?xml standalone="yes"?>
5146     <p></p>
5147     @@@c:erred:
5148     <[[xp:wf-syntax-error]]> { (1, 7)..(1, 24); }
5149     @@XMLTest:
5150     @@@QName: xp.xmldecl.version.unsupported.test
5151     @@@DEnt:
5152     @@@@test:value:
5153     <?xml version="1.2"?>
5154     <p></p>
5155     @@@c:erred:
5156     <[[xp:wf-unsupported-xml-version]]> { (1, 7)..(1, 19); }
5157     @@XMLTest:
5158     @@@QName: xp.xmldecl.version.unsupported.2.test
5159     @@@DEnt:
5160     @@@@test:value:
5161     <?xml version=" 1.0 "?>
5162     <p></p>
5163     @@@c:erred:
5164     <[[xp:wf-unsupported-xml-version]]> { (1, 7)..(1, 21); }
5165     @@XMLTest:
5166     @@@QName: xp.xmldecl.version.unsupported.3.test
5167     @@@DEnt:
5168     @@@@test:value:
5169     <?xml version="01.00"?>
5170     <p></p>
5171     @@@c:erred:
5172     <[[xp:wf-unsupported-xml-version]]> { (1, 7)..(1, 21); }
5173     @@XMLTest:
5174     @@@QName: xp.xmldecl.encoding.malformed.1.test
5175     @@@DEnt:
5176     @@@@test:value:
5177     <?xml version="1.0" encoding="0088"?>
5178     <p></p>
5179     @@@c:erred:
5180     <[[xp:wf-malformed-enc-name]]> { (1, 21)..(1, 35); }
5181     @@XMLTest:
5182     @@@QName: xp.xmldecl.encoding.malformed.2.test
5183     @@@DEnt:
5184     @@@@test:value:
5185     <?xml version="1.0" encoding="D.V.D!"?>
5186     <p></p>
5187     @@@c:erred:
5188     <[[xp:wf-malformed-enc-name]]> { (1, 21)..(1, 38); }
5189     @@XMLTest:
5190     @@@QName: xp.xmldecl.standalone.malformed.1.test
5191     @@@DEnt:
5192     @@@@test:value:
5193     <?xml version="1.0" standalone="true"?>
5194     <p></p>
5195     @@@c:erred:
5196     <[[xp:wf-malformed-xml-standalone]]> { (1, 21)..(1, 38); }
5197     @@XMLTest:
5198     @@@QName: xp.xmldecl.standalone.malformed.2.test
5199     @@@DEnt:
5200     @@@@test:value:
5201     <?xml version="1.0" standalone="YES"?>
5202     <p></p>
5203     @@@c:erred:
5204     <[[xp:wf-malformed-xml-standalone]]> { (1, 21)..(1, 37); }
5205     @@XMLTest:
5206     @@@QName: xp.xmldecl.standalone.malformed.3.test
5207     @@@DEnt:
5208     @@@@test:value:
5209     <?xml version="1.0" standalone="no "?>
5210     <p></p>
5211     @@@c:erred:
5212     <[[xp:wf-malformed-xml-standalone]]> { (1, 21)..(1, 38); }
5213 wakaba 1.6
5214     @@XMLTest:
5215 wakaba 1.14 @@@QName: xp.no-xmldecl.xml...-pi.test
5216     @@@DEnt:
5217     @@@@test:value:
5218     <?xmldeclaration?>
5219     <a></a>
5220     @@@test:domTree:
5221     document {
5222     pi {
5223     node-name: 'xmldeclaration';
5224     node-value: '';
5225     }
5226     element { }
5227     }
5228     @@XMLTest:
5229     @@@QName: xp.no-xmldecl.xml...-pi.after.document.element.test
5230     @@@DEnt:
5231     @@@@test:value:
5232     <a></a>
5233     <?xmldeclaration?>
5234     @@@test:domTree:
5235     document {
5236     element { }
5237     pi {
5238     node-name: 'xmldeclaration';
5239     node-value: '';
5240     }
5241     }
5242     @@XMLTest:
5243     @@@QName: xp.no-xmldecl.xml...-pi.in.document.element.test
5244     @@@DEnt:
5245     @@@@test:value:
5246     <a>
5247     <?xmldeclaration?>
5248     </a>
5249     @@@test:domTree:
5250     document {
5251     element {
5252     text { }
5253     pi {
5254     node-name: 'xmldeclaration';
5255     node-value: '';
5256     }
5257     text { }
5258     }
5259     }
5260     @@XMLTest:
5261     @@@QName: xp.no-xmldecl.xml...-pi.in.doctype.test
5262     @@@DEnt:
5263     @@@@test:value:
5264     <!DOCTYPE a [
5265     <?xmldeclaration?>
5266     ]>
5267     <a></a>
5268     @@@test:domTree:
5269     document {
5270     document-type {
5271     pi {
5272     node-name: 'xmldeclaration';
5273     node-value: '';
5274     }
5275     }
5276     element { }
5277     }
5278    
5279     @@XMLTest:
5280     @@@QName: xp.XMLdecl.test
5281     @@@DEnt:
5282     @@@@test:value:
5283     <?XML version="1.0"?>
5284     <p></p>
5285     @@@c:erred:
5286     <[[xp:wf-pi-target-is-xml]]> { (1, 1)..(1, 5); }
5287     @@XMLTest:
5288     @@@QName: xp.Xmldecl.test
5289     @@@DEnt:
5290     @@@@test:value:
5291     <?Xml version="1.0"?>
5292     <p></p>
5293     @@@c:erred:
5294     <[[xp:wf-pi-target-is-xml]]> { (1, 1)..(1, 5); }
5295     @@XMLTest:
5296     @@@QName: xp.xmldecl.after.document.element.empty.test
5297     @@@DEnt:
5298     @@@@test:value:
5299     <p></p>
5300     <?xml?>
5301     @@@c:erred:
5302     <[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); }
5303     @@XMLTest:
5304     @@@QName: xp.xmldecl.after.document.element.test
5305     @@@DEnt:
5306     @@@@test:value:
5307     <p></p>
5308     <?xml version="1.0"?>
5309     @@@c:erred:
5310     <[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); }
5311     @@XMLTest:
5312     @@@QName: xp.xmldecl.in.element.empty.test
5313     @@@DEnt:
5314     @@@@test:value:
5315     <p>
5316     <?xml?>
5317     </p>
5318     @@@c:erred:
5319     <[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); }
5320     @@XMLTest:
5321     @@@QName: xp.xmldecl.in.element.test
5322     @@@DEnt:
5323     @@@@test:value:
5324     <p>
5325     <?xml version="1.0"?>
5326     </p>
5327     @@@c:erred:
5328     <[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); }
5329     @@XMLTest:
5330     @@@QName: xp.xmldecl.after.comment.test
5331     @@@DEnt:
5332     @@@@test:value:
5333     <!---->
5334     <?xml version="1.0"?>
5335     <p></p>
5336     @@@c:erred:
5337     <[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); }
5338     @@XMLTest:
5339     @@@QName: xp.xmldecl.after.comment.empty.test
5340     @@@DEnt:
5341     @@@@test:value:
5342     <!---->
5343     <?xml?>
5344     <p></p>
5345     @@@c:erred:
5346     <[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); }
5347     @@XMLTest:
5348     @@@QName: xp.xmldecl.after.pi.test
5349     @@@DEnt:
5350     @@@@test:value:
5351     <?xml-declaration?>
5352     <?xml version="1.0"?>
5353     <p></p>
5354     @@@c:erred:
5355     <[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); }
5356     @@XMLTest:
5357     @@@QName: xp.xmldecl.after.pi.empty.test
5358     @@@DEnt:
5359     @@@@test:value:
5360     <?xml-declaration?>
5361     <?xml?>
5362     <p></p>
5363     @@@c:erred:
5364     <[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); }
5365     @@XMLTest:
5366 wakaba 1.16 @@@QName: xp.xmldecl.after.pi.2.test
5367     @@@DEnt:
5368     @@@@test:value:
5369     <?declaration?>
5370     <?xml version="1.0"?>
5371     <p></p>
5372     @@@c:erred:
5373     <[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); }
5374     @@XMLTest:
5375     @@@QName: xp.xmldecl.after.pi.empty.2.test
5376     @@@DEnt:
5377     @@@@test:value:
5378     <?declaration?>
5379     <?xml?>
5380     <p></p>
5381     @@@c:erred:
5382     <[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); }
5383     @@XMLTest:
5384 wakaba 1.14 @@@QName: xp.xmldecl.after.doctype.test
5385     @@@DEnt:
5386     @@@@test:value:
5387     <!DOCTYPE a>
5388     <?xml version="1.0"?>
5389     <p></p>
5390     @@@c:erred:
5391     <[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); }
5392     @@XMLTest:
5393     @@@QName: xp.xmldecl.after.doctype.empty.test
5394     @@@DEnt:
5395     @@@@test:value:
5396     <!DOCTYPE a>
5397     <?xml?>
5398     <p></p>
5399     @@@c:erred:
5400     <[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); }
5401     @@XMLTest:
5402     @@@QName: xp.xmldecl.in.doctype.test
5403     @@@DEnt:
5404     @@@@test:value:
5405     <!DOCTYPE a [
5406     <?xml version="1.0"?>
5407     ]>
5408     <p></p>
5409     @@@c:erred:
5410     <[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); }
5411     @@XMLTest:
5412     @@@QName: xp.xmldecl.in.doctype.empty.test
5413     @@@DEnt:
5414     @@@@test:value:
5415     <!DOCTYPE a [
5416     <?xml?>
5417     ]>
5418     <p></p>
5419     @@@c:erred:
5420     <[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); }
5421    
5422     @@XMLTest:
5423     @@@QName: xp.pi.before.element.empty.test
5424     @@@DEnt:
5425     @@@@test:value:
5426     <?target?>
5427     <a></a>
5428     @@@test:domTree:
5429     document {
5430     pi {
5431     node-name: 'target';
5432     node-value: '';
5433     }
5434     element { }
5435     }
5436     @@XMLTest:
5437     @@@QName: xp.pi.before.element.s.test
5438     @@@DEnt:
5439     @@@@test:value:
5440     <?target ?>
5441     <a></a>
5442     @@@test:domTree:
5443     document {
5444     pi {
5445     node-name: 'target';
5446     node-value: '';
5447     }
5448     element { }
5449     }
5450     @@XMLTest:
5451     @@@QName: xp.pi.before.element.string.test
5452     @@@DEnt:
5453     @@@@test:value:
5454     <?target string?>
5455     <a></a>
5456     @@@test:domTree:
5457     document {
5458     pi {
5459     node-name: 'target';
5460     node-value: 'string';
5461     }
5462     element { }
5463     }
5464     @@XMLTest:
5465     @@@QName: xp.pi.before.element.string.s.test
5466     @@@DEnt:
5467     @@@@test:value:
5468     <?target string ?>
5469     <a></a>
5470     @@@test:domTree:
5471     document {
5472     pi {
5473     node-name: 'target';
5474     node-value: 'string ';
5475     }
5476     element { }
5477     }
5478     @@XMLTest:
5479     @@@QName: xp.pi.before.element.gt.test
5480     @@@DEnt:
5481     @@@@test:value:
5482     <?target string>string?>
5483     <a></a>
5484     @@@test:domTree:
5485     document {
5486     pi {
5487     node-name: 'target';
5488     node-value: 'string>string';
5489     }
5490     element { }
5491     }
5492     @@XMLTest:
5493     @@@QName: xp.pi.doctype.empty.test
5494     @@@DEnt:
5495     @@@@test:value:
5496     <!DOCTYPE a [
5497     <?target?>
5498     ]>
5499     <a></a>
5500     @@@test:domTree:
5501     document {
5502     document-type {
5503     pi {
5504     node-name: 'target';
5505     node-value: '';
5506     }
5507     }
5508     element { }
5509     }
5510    
5511     @@XMLTest:
5512     @@@QName: xp.pi.no.target.test
5513     @@@DEnt:
5514     @@@@test:value:
5515     <??>
5516     <p></p>
5517     @@@c:erred:
5518     <[[xp:wf-syntax-error]]> { (1, 3)..(1, 4); }
5519     @@XMLTest:
5520     @@@QName: xp.pi.no.target.2.test
5521     @@@DEnt:
5522     @@@@test:value:
5523     <? ?>
5524     <p></p>
5525     @@@c:erred:
5526     <[[xp:wf-syntax-error]]> { (1, 3)..(1, 4); }
5527     @@XMLTest:
5528     @@@QName: xp.pi.bad.target.1.test
5529     @@@DEnt:
5530     @@@@test:value:
5531     <?target! ?>
5532     <p></p>
5533     @@@c:erred:
5534     <[[xp:wf-syntax-error]]> { (1, 9)..(1, 9); }
5535     @@XMLTest:
5536     @@@QName: xp.pi.bad.target.2.test
5537     @@@DEnt:
5538     @@@@test:value:
5539     <?0target ?>
5540     <p></p>
5541     @@@c:erred:
5542     <[[xp:wf-syntax-error]]> { (1, 3)..(1, 3); }
5543    
5544     @@XMLTest:
5545 wakaba 1.15 @@@QName: xp.cdatasection.empty.1.test
5546     @@@DEnt:
5547     @@@@test:value:
5548     <p><![CDATA[]]></p>
5549     @@@test:domTree:
5550     document {
5551     element {
5552     cdata-section {
5553     data: '';
5554     }
5555     }
5556     }
5557     @@XMLTest:
5558     @@@QName: xp.cdatasection.empty.2.test
5559     @@@DEnt:
5560     @@@@test:value:
5561     <p>aa<![CDATA[]]>bb</p>
5562     @@@test:domTree:
5563     document {
5564     element {
5565     text { data: 'aa'; }
5566     cdata-section {
5567     data: '';
5568     }
5569     text { data: 'bb'; }
5570     }
5571     }
5572     @@XMLTest:
5573     @@@QName: xp.cdatasection.1.test
5574     @@@DEnt:
5575     @@@@test:value:
5576     <p><![CDATA[abcdefg]]></p>
5577     @@@test:domTree:
5578     document {
5579     element {
5580     cdata-section {
5581     data: 'abcdefg';
5582     }
5583     }
5584     }
5585     @@XMLTest:
5586     @@@QName: xp.cdatasection.2.test
5587     @@@DEnt:
5588     @@@@test:value:
5589     <p>aa<![CDATA[abcdefg]]>bb</p>
5590     @@@test:domTree:
5591     document {
5592     element {
5593     text { data: 'aa'; }
5594     cdata-section {
5595     data: 'abcdefg';
5596     }
5597     text { data: 'bb'; }
5598     }
5599     }
5600     @@XMLTest:
5601     @@@QName: xp.cdatasection.ref.1.test
5602     @@@DEnt:
5603     @@@@test:value:
5604     <p><![CDATA[a&amp;&#x32;&#32;%abc;&def;]]&gt;b]]></p>
5605     @@@test:domTree:
5606     document {
5607     element {
5608     cdata-section {
5609     data: 'a&amp;&#x32;&#32;%abc;&def;]]&gt;b';
5610     }
5611     }
5612     }
5613     @@XMLTest:
5614     @@@QName: xp.cdatasection.in.general.entity.test
5615     @@@DEnt:
5616     @@@@test:value:
5617     <!DOCTYPE p [
5618     <!ENTITY cdata "<![CDATA[text]]>">
5619     ]>
5620     <p>&cdata;</p>
5621     @@@test:domTree:
5622     document {
5623     document-type {
5624     general-entity {
5625     node-name: 'cdata';
5626     cdata-section {
5627     data: 'text';
5628     }
5629     }
5630     }
5631     element {
5632     general-entity-reference {
5633 wakaba 1.23 node-name: 'cdata';
5634 wakaba 1.19 is-expanded: true;
5635 wakaba 1.15 cdata-section {
5636     data: 'text';
5637     }
5638     }
5639     }
5640     }
5641     @@XMLTest:
5642     @@@QName: xp.cdatasection.no.mse.test
5643     @@@DEnt:
5644     @@@@test:value:
5645     <p><![CDATA[text</p>
5646     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 21); }
5647     @@XMLTest:
5648     @@@QName: xp.cdatasection.nest.test
5649     @@@DEnt:
5650     @@@@test:value:
5651     <p><![CDATA[text01<![CDATA[txt2]]>text3]]></p>
5652     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 40)..(1, 42); }
5653    
5654     @@XMLTest:
5655 wakaba 1.6 @@@QName: xp.doctype.empty.test
5656     @@@DEnt:
5657     @@@@test:value:
5658     <!DOCTYPE a>
5659     <a></a>
5660     @@@test:domTree:
5661     document {
5662     xml-version: '1.0';
5663     xml-encoding: null;
5664     xml-standalone: false;
5665     document-type {
5666     node-name: 'a';
5667 wakaba 1.17 public-id: null;
5668     system-id: null;
5669 wakaba 1.6 }
5670     element {
5671     namespace-uri: null;
5672     prefix: null;
5673     local-name: 'a';
5674     text-content: '';
5675     }
5676     }
5677 wakaba 1.15 @@XMLTest:
5678     @@@QName: xp.doctype.empty.after.document.element.test
5679     @@@DEnt:
5680     @@@@test:value:
5681     <a></a>
5682     <!DOCTYPE a>
5683     @@@c:erred: <[[xp|wf-syntax-error]]> { (2, 1)..(2, 12); }
5684     @@XMLTest:
5685     @@@QName: xp.doctype.empty.in.element.test
5686     @@@DEnt:
5687     @@@@test:value:
5688     <a>
5689     <!DOCTYPE a>
5690     </a>
5691     @@@c:erred: <[[xp|wf-syntax-error]]> { (2, 1)..(2, 12); }
5692     @@XMLTest:
5693     @@@QName: xp.doctype.empty.dup.test
5694     @@@DEnt:
5695     @@@@test:value:
5696     <!DOCTYPE a>
5697     <!DOCTYPE a>
5698     <a></a>
5699     @@@c:erred: <[[xp|wf-syntax-error]]> { (2, 1)..(2, 12); }
5700     @@XMLTest:
5701     @@@QName: xp.doctype.empty.in.intsubset.test
5702     @@@DEnt:
5703     @@@@test:value:
5704     <!DOCTYPE a [
5705     <!DOCTYPE a>
5706     ]>
5707     <a></a>
5708     @@@c:erred: <[[xp|wf-syntax-error]]> { (2, 1)..(2, 12); }
5709 wakaba 1.16 @@XMLTest:
5710     @@@QName: xp.doctype.no.s.no.name.test
5711     @@@DEnt:
5712     @@@@test:value:
5713     <!DOCTYPE>
5714     <a></a>
5715     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 10); }
5716     @@XMLTest:
5717     @@@QName: xp.doctype.no.name.test
5718     @@@DEnt:
5719     @@@@test:value:
5720     <!DOCTYPE >
5721     <a></a>
5722     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 11); }
5723     @@XMLTest:
5724     @@@QName: xp.doctype.name.s.test
5725     @@@DEnt:
5726     @@@@test:value:
5727     <!DOCTYPE aa >
5728     <aa></aa>
5729     @@@test:domTree:
5730     document {
5731     document-type {
5732     node-name: 'aa';
5733 wakaba 1.17 public-id: null;
5734     system-id: null;
5735 wakaba 1.16 }
5736     element { }
5737     }
5738     @@XMLTest:
5739     @@@QName: xp.doctype.no.mdc.test
5740     @@@DEnt:
5741     @@@@test:value:
5742     <!DOCTYPE aa
5743     <aa></aa>
5744     @@@c:erred: <[[xp|wf-syntax-error]]> { (2, 1); }
5745 wakaba 1.6
5746     @@XMLTest:
5747 wakaba 1.16 @@@QName: xp.doctype.intsubset.empty.1.test
5748 wakaba 1.6 @@@DEnt:
5749     @@@@test:value:
5750 wakaba 1.16 <!DOCTYPE a []>
5751 wakaba 1.6 <a></a>
5752     @@@test:domTree:
5753     document {
5754     xml-version: '1.0';
5755     xml-encoding: null;
5756     xml-standalone: false;
5757     document-type {
5758     node-name: 'a';
5759 wakaba 1.17 public-id: null;
5760     system-id: null;
5761 wakaba 1.6 }
5762     element {
5763     namespace-uri: null;
5764     prefix: null;
5765     local-name: 'a';
5766     text-content: '';
5767     }
5768     }
5769     @@XMLTest:
5770 wakaba 1.16 @@@QName: xp.doctype.intsubset.empty.2.test
5771 wakaba 1.6 @@@DEnt:
5772     @@@@test:value:
5773     <!DOCTYPE a [
5774 wakaba 1.16
5775 wakaba 1.6 ]>
5776     <a></a>
5777     @@@test:domTree:
5778     document {
5779     xml-version: '1.0';
5780     xml-encoding: null;
5781     xml-standalone: false;
5782     document-type {
5783     node-name: 'a';
5784 wakaba 1.17 public-id: null;
5785     system-id: null;
5786 wakaba 1.6 }
5787     element {
5788     namespace-uri: null;
5789     prefix: null;
5790     local-name: 'a';
5791     text-content: '';
5792     }
5793     }
5794     @@XMLTest:
5795 wakaba 1.16 @@@QName: xp.doctype.intsubset.empty.3.test
5796 wakaba 1.6 @@@DEnt:
5797     @@@@test:value:
5798 wakaba 1.16 <!DOCTYPE a[]>
5799 wakaba 1.6 <a></a>
5800     @@@test:domTree:
5801     document {
5802     document-type {
5803     node-name: 'a';
5804 wakaba 1.17 public-id: null;
5805     system-id: null;
5806 wakaba 1.6 }
5807 wakaba 1.16 element { }
5808     }
5809     @@XMLTest:
5810     @@@QName: xp.doctype.intsubset.empty.4.test
5811     @@@DEnt:
5812     @@@@test:value:
5813     <!DOCTYPE a[] >
5814     <a></a>
5815     @@@test:domTree:
5816     document {
5817     document-type {
5818     node-name: 'a';
5819 wakaba 1.17 public-id: null;
5820     system-id: null;
5821 wakaba 1.6 }
5822 wakaba 1.16 element { }
5823 wakaba 1.6 }
5824     @@XMLTest:
5825 wakaba 1.16 @@@QName: xp.doctype.intsubset.no.dsc.1.test
5826     @@@DEnt:
5827     @@@@test:value:
5828     <!DOCTYPE a [>
5829     <a></a>
5830     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 14); }
5831     @@XMLTest:
5832     @@@QName: xp.doctype.intsubset.no.dsc.2.test
5833 wakaba 1.6 @@@DEnt:
5834     @@@@test:value:
5835     <!DOCTYPE a [
5836     <a></a>
5837 wakaba 1.16 @@@c:erred: <[[xp|wf-syntax-error]]> { (2, 1); }
5838     @@XMLTest:
5839     @@@QName: xp.doctype.intsubset.no.dsc.3.test
5840     @@@DEnt:
5841     @@@@test:value:
5842     <!DOCTYPE a [
5843     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 14); }
5844     @@XMLTest:
5845     @@@QName: xp.doctype.intsubset.no.mdc.1.test
5846     @@@DEnt:
5847     @@@@test:value:
5848     <!DOCTYPE a []
5849     <a/>
5850     @@@c:erred: <[[xp|wf-syntax-error]]> { (2, 1); }
5851     @@XMLTest:
5852     @@@QName: xp.doctype.intsubset.no.mdc.2.test
5853     @@@DEnt:
5854     @@@@test:value:
5855     <!DOCTYPE a []]>
5856     <a/>
5857     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 15); }
5858 wakaba 1.17 @@XMLTest:
5859     @@@QName: xp.doctype.pubid.sysid.1.test
5860     @@@DEnt:
5861     @@@@test:value:
5862     <!DOCTYPE a PUBLIC "pubid" "sysid">
5863     <a/>
5864     @@@test:domTree:
5865     document {
5866     document-type {
5867     node-name: 'a';
5868     public-id: 'pubid';
5869     system-id: 'sysid';
5870     }
5871     element { }
5872     }
5873     @@XMLTest:
5874     @@@QName: xp.doctype.pubid.sysid.2.test
5875     @@@DEnt:
5876     @@@@test:value:
5877     <!DOCTYPE a PUBLIC 'pubid' "sysid">
5878     <a/>
5879     @@@test:domTree:
5880     document {
5881     document-type {
5882     node-name: 'a';
5883     public-id: 'pubid';
5884     system-id: 'sysid';
5885     }
5886     element { }
5887     }
5888     @@XMLTest:
5889     @@@QName: xp.doctype.pubid.sysid.3.test
5890     @@@DEnt:
5891     @@@@test:value:
5892     <!DOCTYPE a PUBLIC "pubid" 'sysid'>
5893     <a/>
5894     @@@test:domTree:
5895     document {
5896     document-type {
5897     node-name: 'a';
5898     public-id: 'pubid';
5899     system-id: 'sysid';
5900     }
5901     element { }
5902     }
5903     @@XMLTest:
5904     @@@QName: xp.doctype.pubid.sysid.4.test
5905     @@@DEnt:
5906     @@@@test:value:
5907     <!DOCTYPE a PUBLIC 'pubid' 'sysid'>
5908     <a/>
5909     @@@test:domTree:
5910     document {
5911     document-type {
5912     node-name: 'a';
5913     public-id: 'pubid';
5914     system-id: 'sysid';
5915     }
5916     element { }
5917     }
5918     @@XMLTest:
5919     @@@QName: xp.doctype.pubid.sysid.5.test
5920     @@@DEnt:
5921     @@@@test:value:
5922     <!DOCTYPE a PUBLIC "pubid" "sysid" >
5923     <a/>
5924     @@@test:domTree:
5925     document {
5926     document-type {
5927     node-name: 'a';
5928     public-id: 'pubid';
5929     system-id: 'sysid';
5930     }
5931     element { }
5932     }
5933     @@XMLTest:
5934     @@@QName: xp.doctype.pubid.sysid.6.test
5935     @@@DEnt:
5936     @@@@test:value:
5937     <!DOCTYPE a PUBLIC 'pubid' 'sysid' >
5938     <a/>
5939     @@@test:domTree:
5940     document {
5941     document-type {
5942     node-name: 'a';
5943     public-id: 'pubid';
5944     system-id: 'sysid';
5945     }
5946     element { }
5947     }
5948     @@XMLTest:
5949     @@@QName: xp.doctype.pubid.sysid.intsubset.1.test
5950     @@@DEnt:
5951     @@@@test:value:
5952     <!DOCTYPE a PUBLIC "pubid" "sysid"[]>
5953     <a/>
5954     @@@test:domTree:
5955     document {
5956     document-type {
5957     node-name: 'a';
5958     public-id: 'pubid';
5959     system-id: 'sysid';
5960     }
5961     element { }
5962     }
5963     @@XMLTest:
5964     @@@QName: xp.doctype.pubid.sysid.intsubset.2.test
5965     @@@DEnt:
5966     @@@@test:value:
5967     <!DOCTYPE a PUBLIC "pubid" "sysid" []>
5968     <a/>
5969     @@@test:domTree:
5970     document {
5971     document-type {
5972     node-name: 'a';
5973     public-id: 'pubid';
5974     system-id: 'sysid';
5975     }
5976     element { }
5977     }
5978     @@XMLTest:
5979     @@@QName: xp.doctype.pubid.sysid.intsubset.3.test
5980     @@@DEnt:
5981     @@@@test:value:
5982     <!DOCTYPE a PUBLIC 'pubid' 'sysid'[]>
5983     <a/>
5984     @@@test:domTree:
5985     document {
5986     document-type {
5987     node-name: 'a';
5988     public-id: 'pubid';
5989     system-id: 'sysid';
5990     }
5991     element { }
5992     }
5993     @@XMLTest:
5994     @@@QName: xp.doctype.pubid.sysid.intsubset.4.test
5995     @@@DEnt:
5996     @@@@test:value:
5997     <!DOCTYPE a PUBLIC 'pubid' 'sysid' []>
5998     <a/>
5999     @@@test:domTree:
6000     document {
6001     document-type {
6002     node-name: 'a';
6003     public-id: 'pubid';
6004     system-id: 'sysid';
6005     }
6006     element { }
6007     }
6008     @@XMLTest:
6009     @@@QName: xp.doctype.sysid.1.test
6010     @@@DEnt:
6011     @@@@test:value:
6012     <!DOCTYPE a SYSTEM "sysid">
6013     <a/>
6014     @@@test:domTree:
6015     document {
6016     document-type {
6017     node-name: 'a';
6018     public-id: null;
6019     system-id: 'sysid';
6020     }
6021     element { }
6022     }
6023     @@XMLTest:
6024     @@@QName: xp.doctype.sysid.2.test
6025     @@@DEnt:
6026     @@@@test:value:
6027     <!DOCTYPE a SYSTEM 'sysid'>
6028     <a/>
6029     @@@test:domTree:
6030     document {
6031     document-type {
6032     node-name: 'a';
6033     public-id: null;
6034     system-id: 'sysid';
6035     }
6036     element { }
6037     }
6038     @@XMLTest:
6039     @@@QName: xp.doctype.sysid.3.test
6040     @@@DEnt:
6041     @@@@test:value:
6042     <!DOCTYPE a SYSTEM "sysid" >
6043     <a/>
6044     @@@test:domTree:
6045     document {
6046     document-type {
6047     node-name: 'a';
6048     public-id: null;
6049     system-id: 'sysid';
6050     }
6051     element { }
6052     }
6053     @@XMLTest:
6054     @@@QName: xp.doctype.sysid.4.test
6055     @@@DEnt:
6056     @@@@test:value:
6057     <!DOCTYPE a SYSTEM 'sysid' >
6058     <a/>
6059     @@@test:domTree:
6060     document {
6061     document-type {
6062     node-name: 'a';
6063     public-id: null;
6064     system-id: 'sysid';
6065     }
6066     element { }
6067     }
6068     @@XMLTest:
6069     @@@QName: xp.doctype.sysid.intsubset.1.test
6070     @@@DEnt:
6071     @@@@test:value:
6072     <!DOCTYPE a SYSTEM "sysid"[]>
6073     <a/>
6074     @@@test:domTree:
6075     document {
6076     document-type {
6077     node-name: 'a';
6078     public-id: null;
6079     system-id: 'sysid';
6080     }
6081     element { }
6082     }
6083     @@XMLTest:
6084     @@@QName: xp.doctype.sysid.intsubset.2.test
6085     @@@DEnt:
6086     @@@@test:value:
6087     <!DOCTYPE a SYSTEM "sysid" []>
6088     <a/>
6089     @@@test:domTree:
6090     document {
6091     document-type {
6092     node-name: 'a';
6093     public-id: null;
6094     system-id: 'sysid';
6095     }
6096     element { }
6097     }
6098     @@XMLTest:
6099     @@@QName: xp.doctype.sysid.intsubset.3.test
6100     @@@DEnt:
6101     @@@@test:value:
6102     <!DOCTYPE a SYSTEM 'sysid'[]>
6103     <a/>
6104     @@@test:domTree:
6105     document {
6106     document-type {
6107     node-name: 'a';
6108     public-id: null;
6109     system-id: 'sysid';
6110     }
6111     element { }
6112     }
6113     @@XMLTest:
6114     @@@QName: xp.doctype.sysid.intsubset.4.test
6115     @@@DEnt:
6116     @@@@test:value:
6117     <!DOCTYPE a SYSTEM 'sysid' []>
6118     <a/>
6119     @@@test:domTree:
6120     document {
6121     document-type {
6122     node-name: 'a';
6123     public-id: null;
6124     system-id: 'sysid';
6125     }
6126     element { }
6127     }
6128     @@XMLTest:
6129     @@@QName: xp.doctype.public.stago.test
6130     @@@DEnt:
6131     @@@@test:value:
6132     <!DOCTYPE a PUBLIC<a/>
6133     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 19); }
6134     @@XMLTest:
6135     @@@QName: xp.doctype.public.mdc.test
6136     @@@DEnt:
6137     @@@@test:value:
6138     <!DOCTYPE a PUBLIC>
6139     <a/>
6140     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 19); }
6141     @@XMLTest:
6142     @@@QName: xp.doctype.public.s.stago.test
6143     @@@DEnt:
6144     @@@@test:value:
6145     <!DOCTYPE a PUBLIC <a/>
6146     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 20); }
6147     @@XMLTest:
6148     @@@QName: xp.doctype.public.s.mdc.test
6149     @@@DEnt:
6150     @@@@test:value:
6151     <!DOCTYPE a PUBLIC >
6152     <a/>
6153     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 20); }
6154     @@XMLTest:
6155     @@@QName: xp.doctype.public.lit.test
6156     @@@DEnt:
6157     @@@@test:value:
6158     <!DOCTYPE a PUBLIC"p" "s">
6159     <a/>
6160     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 19); }
6161     @@XMLTest:
6162     @@@QName: xp.doctype.public.lita.test
6163     @@@DEnt:
6164     @@@@test:value:
6165     <!DOCTYPE a PUBLIC'p' "s">
6166     <a/>
6167     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 19); }
6168     @@XMLTest:
6169     @@@QName: xp.doctype.pubid.lit.lita.unmatched.1.test
6170     @@@DEnt:
6171     @@@@test:value:
6172     <!DOCTYPE a PUBLIC "p' "s">
6173     <a/>
6174     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 25); }
6175     @@XMLTest:
6176     @@@QName: xp.doctype.pubid.lit.lita.unmatched.2.test
6177     @@@DEnt:
6178     @@@@test:value:
6179     <!DOCTYPE a PUBLIC "p' 's'><a/>
6180     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 32); }
6181     @@XMLTest:
6182     @@@QName: xp.doctype.pubid.lita.lit.unmatched.1.test
6183     @@@DEnt:
6184     @@@@test:value:
6185     <!DOCTYPE a PUBLIC 'p" "s"><a/>
6186     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 32); }
6187     @@XMLTest:
6188     @@@QName: xp.doctype.pubid.lita.lit.unmatched.2.test
6189     @@@DEnt:
6190     @@@@test:value:
6191     <!DOCTYPE a PUBLIC 'p" 's'>
6192     <a/>
6193     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 21)..(1, 25); }
6194     @@XMLTest:
6195     @@@QName: xp.doctype.public.s.lit.mdc.test
6196     @@@DEnt:
6197     @@@@test:value:
6198     <!DOCTYPE a PUBLIC "><a/>
6199     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 26); }
6200     @@XMLTest:
6201     @@@QName: xp.doctype.public.s.lita.mdc.test
6202     @@@DEnt:
6203     @@@@test:value:
6204     <!DOCTYPE a PUBLIC '><a/>
6205     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 26); }
6206     @@XMLTest:
6207     @@@QName: xp.doctype.public.lit.pubid.lit.mdc.test
6208     @@@DEnt:
6209     @@@@test:value:
6210     <!DOCTYPE a PUBLIC "p">
6211     <a/>
6212     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 23); }
6213     @@XMLTest:
6214     @@@QName: xp.doctype.public.lita.pubid.lita.mdc.test
6215     @@@DEnt:
6216     @@@@test:value:
6217     <!DOCTYPE a PUBLIC 'p'>
6218     <a/>
6219     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 23); }
6220     @@XMLTest:
6221     @@@QName: xp.doctype.public.lit.pubid.lit.s.mdc.test
6222     @@@DEnt:
6223     @@@@test:value:
6224     <!DOCTYPE a PUBLIC "p" >
6225     <a/>
6226     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 24); }
6227     @@XMLTest:
6228     @@@QName: xp.doctype.public.lita.pubid.lita.s.mdc.test
6229     @@@DEnt:
6230     @@@@test:value:
6231     <!DOCTYPE a PUBLIC 'p' >
6232     <a/>
6233     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 24); }
6234     @@XMLTest:
6235     @@@QName: xp.doctype.public.lit.pubid.lit.s.lit.mdc.test
6236     @@@DEnt:
6237     @@@@test:value:
6238     <!DOCTYPE a PUBLIC "p" "><a/>
6239     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 30); }
6240     @@XMLTest:
6241     @@@QName: xp.doctype.public.lit.pubid.lit.s.lita.mdc.test
6242     @@@DEnt:
6243     @@@@test:value:
6244     <!DOCTYPE a PUBLIC "p" '><a/>
6245     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 30); }
6246     @@XMLTest:
6247     @@@QName: xp.doctype.public.lita.pubid.lita.s.lit.mdc.test
6248     @@@DEnt:
6249     @@@@test:value:
6250     <!DOCTYPE a PUBLIC 'p' "><a/>
6251     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 30); }
6252     @@XMLTest:
6253     @@@QName: xp.doctype.public.lita.pubid.lita.s.lita.mdc.test
6254     @@@DEnt:
6255     @@@@test:value:
6256     <!DOCTYPE a PUBLIC 'p' '><a/>
6257     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 30); }
6258     @@XMLTest:
6259     @@@QName: xp.doctype.public.lit.pubid.lit.lit.lita.unmatched.mdc.test
6260     @@@DEnt:
6261     @@@@test:value:
6262     <!DOCTYPE a PUBLIC "p" "s'><a/>
6263     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 32); }
6264     @@XMLTest:
6265     @@@QName: xp.doctype.public.lita.pubid.lita.lita.lit.unmatched.mdc.test
6266     @@@DEnt:
6267     @@@@test:value:
6268     <!DOCTYPE a PUBLIC 'p' 's"><a/>
6269     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 32); }
6270     @@XMLTest:
6271     @@@QName: xp.doctype.pubid.sysid.stago.1.test
6272     @@@DEnt:
6273     @@@@test:value:
6274     <!DOCTYPE a PUBLIC "p" "s"<a/>
6275     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 27); }
6276     @@XMLTest:
6277     @@@QName: xp.doctype.pubid.sysid.stago.2.test
6278     @@@DEnt:
6279     @@@@test:value:
6280     <!DOCTYPE a PUBLIC "p" 's'<a/>
6281     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 27); }
6282     @@XMLTest:
6283     @@@QName: xp.doctype.pubid.sysid.stago.s.1.test
6284     @@@DEnt:
6285     @@@@test:value:
6286     <!DOCTYPE a PUBLIC "p" "s" <a/>
6287     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 28); }
6288     @@XMLTest:
6289     @@@QName: xp.doctype.pubid.sysid.stago.s.2.test
6290     @@@DEnt:
6291     @@@@test:value:
6292     <!DOCTYPE a PUBLIC "p" 's' <a/>
6293     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 28); }
6294 wakaba 1.16
6295     @@XMLTest:
6296     @@@QName: xp.endofline.1.0.crlf.test
6297     @@@DEnt:
6298     @@@@test:value:
6299     <?xml version="1.0"?>
6300     <p>aaa$u000D$u000Abbb</p>
6301 wakaba 1.6 @@@test:domTree:
6302     document {
6303     xml-version: '1.0';
6304 wakaba 1.16 element {
6305     text-content: 'aaa' U+000A 'bbb';
6306 wakaba 1.6 }
6307 wakaba 1.16 }
6308     @@XMLTest:
6309     @@@QName: xp.endofline.1.1.crlf.test
6310     @@@DEnt:
6311     @@@@test:value:
6312     <?xml version="1.1"?>
6313     <p>aaa$u000D$u000Abbb</p>
6314     @@@test:domTree:
6315     document {
6316     xml-version: '1.1';
6317 wakaba 1.6 element {
6318 wakaba 1.16 text-content: 'aaa' U+000A 'bbb';
6319 wakaba 1.6 }
6320     }
6321     @@XMLTest:
6322 wakaba 1.16 @@@QName: xp.endofline.1.0.crnl.test
6323 wakaba 1.6 @@@DEnt:
6324     @@@@test:value:
6325 wakaba 1.16 <?xml version="1.0"?>
6326     <p>aaa$u000D$u0085bbb</p>
6327 wakaba 1.6 @@@test:domTree:
6328     document {
6329     xml-version: '1.0';
6330 wakaba 1.16 element {
6331     text-content: 'aaa' U+000A U+0085 'bbb';
6332 wakaba 1.6 }
6333 wakaba 1.16 }
6334     @@XMLTest:
6335     @@@QName: xp.endofline.1.1.crnl.test
6336     @@@DEnt:
6337     @@@@test:value:
6338     <?xml version="1.1"?>
6339     <p>aaa$u000D$u0085bbb</p>
6340     @@@test:domTree:
6341     document {
6342     xml-version: '1.1';
6343 wakaba 1.6 element {
6344 wakaba 1.16 text-content: 'aaa' U+000A 'bbb';
6345 wakaba 1.6 }
6346     }
6347     @@XMLTest:
6348 wakaba 1.16 @@@QName: xp.endofline.1.0.nl.test
6349 wakaba 1.6 @@@DEnt:
6350     @@@@test:value:
6351 wakaba 1.16 <?xml version="1.0"?>
6352     <p>aaa$u0085bbb</p>
6353 wakaba 1.6 @@@test:domTree:
6354     document {
6355     xml-version: '1.0';
6356     element {
6357 wakaba 1.16 text-content: 'aaa' U+0085 'bbb';
6358 wakaba 1.6 }
6359     }
6360     @@XMLTest:
6361 wakaba 1.16 @@@QName: xp.endofline.1.1.nl.test
6362 wakaba 1.6 @@@DEnt:
6363     @@@@test:value:
6364 wakaba 1.16 <?xml version="1.1"?>
6365     <p>aaa$u0085bbb</p>
6366     @@@test:domTree:
6367     document {
6368     xml-version: '1.1';
6369     element {
6370     text-content: 'aaa' U+000A 'bbb';
6371     }
6372     }
6373     @@XMLTest:
6374     @@@QName: xp.endofline.1.0.ls.test
6375     @@@DEnt:
6376     @@@@test:value:
6377     <?xml version="1.0"?>
6378     <p>aaa$u2028bbb</p>
6379     @@@test:domTree:
6380     document {
6381     xml-version: '1.0';
6382     element {
6383     text-content: 'aaa' U+2028 'bbb';
6384     }
6385     }
6386     @@XMLTest:
6387     @@@QName: xp.endofline.1.1.ls.test
6388     @@@DEnt:
6389     @@@@test:value:
6390     <?xml version="1.1"?>
6391     <p>aaa$u2028bbb</p>
6392     @@@test:domTree:
6393     document {
6394     xml-version: '1.1';
6395     element {
6396     text-content: 'aaa' U+000A 'bbb';
6397     }
6398     }
6399     @@XMLTest:
6400     @@@QName: xp.endofline.1.0.cr.test
6401     @@@DEnt:
6402     @@@@test:value:
6403     <?xml version="1.0"?>
6404     <p>aaa$u000Dbbb</p>
6405     @@@test:domTree:
6406     document {
6407     xml-version: '1.0';
6408     element {
6409     text-content: 'aaa' U+000A 'bbb';
6410     }
6411     }
6412     @@XMLTest:
6413     @@@QName: xp.endofline.1.1.cr.test
6414     @@@DEnt:
6415     @@@@test:value:
6416     <?xml version="1.1"?>
6417     <p>aaa$u000Dbbb</p>
6418     @@@test:domTree:
6419     document {
6420     xml-version: '1.1';
6421     element {
6422     text-content: 'aaa' U+000A 'bbb';
6423     }
6424     }
6425     @@XMLTest:
6426     @@@QName: xp.endofline.1.0.lf.test
6427     @@@DEnt:
6428     @@@@test:value:
6429     <?xml version="1.0"?>
6430     <p>aaa$u000Abbb</p>
6431     @@@test:domTree:
6432     document {
6433     xml-version: '1.0';
6434     element {
6435     text-content: 'aaa' U+000A 'bbb';
6436     }
6437     }
6438     @@XMLTest:
6439     @@@QName: xp.endofline.1.1.lf.test
6440     @@@DEnt:
6441     @@@@test:value:
6442     <?xml version="1.1"?>
6443     <p>aaa$u000Abbb</p>
6444     @@@test:domTree:
6445     document {
6446     xml-version: '1.1';
6447     element {
6448     text-content: 'aaa' U+000A 'bbb';
6449     }
6450     }
6451     @@XMLTest:
6452     @@@QName: xp.xml10.endofline.nl.in.xmldecl.1.test
6453     @@@DEnt:
6454     @@@@test:value:
6455     <?xml$u0085version="1.0"?>
6456     <p/>
6457     @@@c:erred:
6458     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 6)..(2, 0); }
6459     @@@c:erred: <[[xp|wf-syntax-error]]> { }
6460     @@XMLTest:
6461     @@@QName: xp.xml11.endofline.nl.in.xmldecl.1.test
6462     @@@DEnt:
6463     @@@@test:value:
6464     <?xml$u0085version="1.1"?>
6465     (err)<p/>
6466     @@@c:erred:
6467     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 6)..(2, 0); }
6468     @@@c:erred: <[[xp|wf-syntax-error]]> { }
6469     @@XMLTest:
6470     @@@QName: xp.xml10.endofline.crnl.in.xmldecl.1.test
6471     @@@DEnt:
6472     @@@@test:value:
6473     <?xml$u000D$u0085version="1.0"?>
6474     <p/>
6475     @@@c:erred:
6476     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 6)..(2, 0); }
6477     @@@c:erred: <[[xp|wf-syntax-error]]> { }
6478     @@XMLTest:
6479     @@@QName: xp.xml11.endofline.crnl.in.xmldecl.1.test
6480     @@@DEnt:
6481     @@@@test:value:
6482     <?xml$u000D$u0085version="1.1"?>
6483     (err)<p/>
6484     @@@c:erred:
6485     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 6)..(2, 0); }
6486     @@@c:erred: <[[xp|wf-syntax-error]]> { }
6487     @@XMLTest:
6488     @@@QName: xp.xml10.endofline.ls.in.xmldecl.1.test
6489     @@@DEnt:
6490     @@@@test:value:
6491     <?xml$u2028version="1.0"?>
6492     <p/>
6493     @@@c:erred:
6494     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 6)..(2, 0); }
6495     @@@c:erred: <[[xp|wf-syntax-error]]> { }
6496     @@XMLTest:
6497     @@@QName: xp.xml11.endofline.ls.in.xmldecl.1.test
6498     @@@DEnt:
6499     @@@@test:value:
6500     <?xml$u2028version="1.1"?>
6501     (err)<p/>
6502     @@@c:erred:
6503     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 6)..(2, 0); }
6504     @@@c:erred: <[[xp|wf-syntax-error]]> { }
6505     @@XMLTest:
6506     @@@QName: xp.xml10.endofline.nl.in.xmldecl.2.test
6507     @@@DEnt:
6508     @@@@test:value:
6509     <?xml version="1.0"$u0085?>
6510     <p/>
6511     @@@c:erred:
6512     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 20)..(2, 0); }
6513     @@@c:erred: <[[xp|wf-syntax-error]]> { }
6514     @@XMLTest:
6515     @@@QName: xp.xml11.endofline.nl.in.xmldecl.2.test
6516     @@@DEnt:
6517     @@@@test:value:
6518     <?xml version="1.1"$u0085?>
6519     (err)<p/>
6520     @@@c:erred:
6521     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 20)..(2, 0); }
6522     @@@c:erred: <[[xp|wf-syntax-error]]> { }
6523     @@XMLTest:
6524     @@@QName: xp.xml10.endofline.crnl.in.xmldecl.2.test
6525     @@@DEnt:
6526     @@@@test:value:
6527     <?xml version="1.0"$u000D$u0085?>
6528     <p/>
6529     @@@c:erred:
6530     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 20)..(2, 0); }
6531     @@@c:erred: <[[xp|wf-syntax-error]]> { }
6532     @@XMLTest:
6533     @@@QName: xp.xml11.endofline.crnl.in.xmldecl.2.test
6534     @@@DEnt:
6535     @@@@test:value:
6536     <?xml version="1.1"$u000D$u0085?>
6537     (err)<p/>
6538     @@@c:erred:
6539     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 20)..(2, 0); }
6540     @@@c:erred: <[[xp|wf-syntax-error]]> { }
6541     @@XMLTest:
6542     @@@QName: xp.xml10.endofline.ls.in.xmldecl.2.test
6543     @@@DEnt:
6544     @@@@test:value:
6545     <?xml version="1.0"$u2028?>
6546     <p/>
6547     @@@c:erred:
6548     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 20)..(2, 0); }
6549     @@@c:erred: <[[xp|wf-syntax-error]]> { }
6550     @@XMLTest:
6551     @@@QName: xp.xml11.endofline.ls.in.xmldecl.2.test
6552     @@@DEnt:
6553     @@@@test:value:
6554     <?xml version="1.1"$u2028?>
6555     (err)<p/>
6556     @@@c:erred:
6557     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 20)..(2, 0); }
6558     @@@c:erred: <[[xp|wf-syntax-error]]> { }
6559     @@XMLTest:
6560     @@@QName: xp.xml10.endofline.nl.in.xmldecl.3.test
6561     @@@DEnt:
6562     @@@@test:value:
6563     <?xml $u0085version="1.0"?>
6564     <p/>
6565     @@@c:erred:
6566     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 7)..(2, 0); }
6567     @@@c:erred: <[[xp|wf-syntax-error]]> { }
6568     @@XMLTest:
6569     @@@QName: xp.xml11.endofline.nl.in.xmldecl.3.test
6570     @@@DEnt:
6571     @@@@test:value:
6572     <?xml $u0085version="1.1"?>
6573     (err)<p/>
6574     @@@c:erred:
6575     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 7)..(2, 0); }
6576     @@@c:erred: <[[xp|wf-syntax-error]]> { }
6577     @@XMLTest:
6578     @@@QName: xp.xml10.endofline.crnl.in.xmldecl.3.test
6579     @@@DEnt:
6580     @@@@test:value:
6581     <?xml $u000D$u0085version="1.0"?>
6582     <p/>
6583     @@@c:erred:
6584     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 7)..(2, 0); }
6585     @@@c:erred: <[[xp|wf-syntax-error]]> { }
6586     @@XMLTest:
6587     @@@QName: xp.xml11.endofline.crnl.in.xmldecl.3.test
6588     @@@DEnt:
6589     @@@@test:value:
6590     <?xml $u000D$u0085version="1.1"?>
6591     (err)<p/>
6592     @@@c:erred:
6593     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 7)..(2, 0); }
6594     @@@c:erred: <[[xp|wf-syntax-error]]> { }
6595     @@XMLTest:
6596     @@@QName: xp.xml10.endofline.ls.in.xmldecl.3.test
6597     @@@DEnt:
6598     @@@@test:value:
6599     <?xml $u2028version="1.0"?>
6600     <p/>
6601     @@@c:erred:
6602     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 7)..(2, 0); }
6603     @@@c:erred: <[[xp|wf-syntax-error]]> { }
6604     @@XMLTest:
6605     @@@QName: xp.xml11.endofline.ls.in.xmldecl.3.test
6606     @@@DEnt:
6607     @@@@test:value:
6608     <?xml $u2028version="1.1"?>
6609     (err)<p/>
6610     @@@c:erred:
6611     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 7)..(2, 0); }
6612     @@@c:erred: <[[xp|wf-syntax-error]]> { }
6613     @@XMLTest:
6614     @@@QName: xp.xml10implied.endofline.nl.in.pi.1.test
6615     @@@DEnt:
6616     @@@@test:value:
6617     <?xml-$u0085?>
6618     <p/>
6619     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 7)..(2, 0); }
6620     @@XMLTest:
6621     @@@QName: xp.xml10.endofline.nl.in.pi.1.test
6622     @@@DEnt:
6623     @@@@test:value:
6624     <?xml version="1.0"?>
6625     <?xml-$u0085?>
6626     <p/>
6627     @@@c:erred: <[[xp|wf-syntax-error]]> { (2, 7)..(3, 0); }
6628     @@XMLTest:
6629     @@@QName: xp.xml11.endofline.nl.in.pi.1.test
6630     @@@DEnt:
6631     @@@@test:value:
6632     <?xml version="1.1"?>
6633     <?xml-$u0085?>
6634     <p/>
6635     @@@test:domTree:
6636     document {
6637     xml-version: '1.1';
6638     pi {
6639     node-name: 'xml-';
6640     node-value: '';
6641     }
6642     element { }
6643     }
6644     @@XMLTest:
6645     @@@QName: xp.xml10implied.endofline.crnl.in.pi.1.test
6646     @@@DEnt:
6647     @@@@test:value:
6648     <?xml-$u000D$u0085?>
6649     <p/>
6650     @@@test:domTree:
6651     document {
6652     xml-version: '1.0';
6653     pi {
6654     node-name: 'xml-';
6655     node-value: U+0085;
6656     }
6657     element { }
6658     }
6659     @@XMLTest:
6660     @@@QName: xp.xml10.endofline.crnl.in.pi.1.test
6661     @@@DEnt:
6662     @@@@test:value:
6663     <?xml version="1.0"?>
6664     <?xml-$u000D$u0085?>
6665     <p/>
6666     @@@test:domTree:
6667     document {
6668     xml-version: '1.0';
6669     pi {
6670     node-name: 'xml-';
6671     node-value: U+0085;
6672     }
6673     element { }
6674     }
6675     @@XMLTest:
6676     @@@QName: xp.xml11.endofline.crnl.in.pi.1.test
6677     @@@DEnt:
6678     @@@@test:value:
6679     <?xml version="1.1"?>
6680     <?xml-$u000D$u0085?>
6681     <p/>
6682     @@@test:domTree:
6683     document {
6684     xml-version: '1.1';
6685     pi {
6686     node-name: 'xml-';
6687     node-value: '';
6688     }
6689     element { }
6690     }
6691     @@XMLTest:
6692     @@@QName: xp.xml10implied.endofline.ls.in.pi.1.test
6693     @@@DEnt:
6694     @@@@test:value:
6695     <?xml-$u2028?>
6696     <p/>
6697     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 7)..(2, 0); }
6698     @@XMLTest:
6699     @@@QName: xp.xml10.endofline.ls.in.pi.1.test
6700     @@@DEnt:
6701     @@@@test:value:
6702     <?xml version="1.0"?>
6703     <?xml-$u2028?>
6704     <p/>
6705     @@@c:erred: <[[xp|wf-syntax-error]]> { (2, 7)..(3, 0); }
6706     @@XMLTest:
6707     @@@QName: xp.xml11.endofline.ls.in.pi.1.test
6708     @@@DEnt:
6709     @@@@test:value:
6710     <?xml version="1.1"?>
6711     <?xml-$u2028?>
6712     <p/>
6713     @@@test:domTree:
6714     document {
6715     xml-version: '1.1';
6716     pi {
6717     node-name: 'xml-';
6718     node-value: '';
6719     }
6720     element { }
6721     }
6722     @@XMLTest:
6723     @@@QName: xp.noxmldecl.pi.pi.test
6724     @@@DEnt:
6725     @@@@test:value:
6726     <?noxml 1?><?noxml 2?><p/>
6727     @@@test:domTree:
6728     document {
6729     xml-version: '1.0';
6730     pi {
6731     node-name: 'noxml';
6732     node-value: '1';
6733     }
6734     pi {
6735     node-name: 'noxml';
6736     node-value: '2';
6737     }
6738     element { }
6739     }
6740     @@XMLTest:
6741     @@@QName: xp.noxmldecl.pi.pi.2.test
6742     @@@DEnt:
6743     @@@@test:value:
6744     <?xmlno 1?><?xmlno 2?><p/>
6745     @@@test:domTree:
6746     document {
6747     xml-version: '1.0';
6748     pi {
6749     node-name: 'xmlno';
6750     node-value: '1';
6751     }
6752     pi {
6753     node-name: 'xmlno';
6754     node-value: '2';
6755     }
6756     element { }
6757     }
6758     @@XMLTest:
6759     @@@QName: xp.noxmldecl.pi.pi.3.test
6760     @@@DEnt:
6761     @@@@test:value:
6762     <?xmln 1?><?xmln 2?><p/>
6763     @@@test:domTree:
6764     document {
6765     xml-version: '1.0';
6766     pi {
6767     node-name: 'xmln';
6768     node-value: '1';
6769     }
6770     pi {
6771     node-name: 'xmln';
6772     node-value: '2';
6773     }
6774     element { }
6775     }
6776     @@XMLTest:
6777     @@@QName: xp.noxml.s.nl.test
6778     @@@DEnt:
6779     @@@@test:value:
6780     $u0085<p/>
6781     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 1)..(2, 0); }
6782     @@XMLTest:
6783     @@@QName: xp.noxml.s.crnl.test
6784     @@@DEnt:
6785     @@@@test:value:
6786     $u000D$u0085<p/>
6787     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 1)..(2, 0); }
6788     @@XMLTest:
6789     @@@QName: xp.noxml.s.ls.test
6790     @@@DEnt:
6791     @@@@test:value:
6792     $u2028<p/>
6793     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 1)..(2, 0); }
6794     @@XMLTest:
6795     @@@QName: xp.xml10.decl.s.nl.test
6796     @@@DEnt:
6797     @@@@test:value:
6798     <?xml version="1.0"?>$u0085<p/>
6799     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 22)..(2, 0); }
6800     @@XMLTest:
6801     @@@QName: xp.xml10.decl.s.crnl.test
6802     @@@DEnt:
6803     @@@@test:value:
6804     <?xml version="1.0"?>$u000D$u0085<p/>
6805     @@@c:erred: <[[xp|wf-syntax-error]]> { (2, 0)..(3, 0); }
6806     @@XMLTest:
6807     @@@QName: xp.xml10.decl.s.ls.test
6808     @@@DEnt:
6809     @@@@test:value:
6810     <?xml version="1.0"?>$u2028<p/>
6811     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 22)..(2, 0); }
6812     @@XMLTest:
6813     @@@QName: xp.xml11.decl.s.nl.test
6814     @@@DEnt:
6815     @@@@test:value:
6816     <?xml version="1.1"?>$u0085<p/>
6817     @@@test:domTree:
6818     document {
6819     xml-version: '1.1';
6820     element { }
6821     }
6822     @@XMLTest:
6823     @@@QName: xp.xml11.decl.s.crnl.test
6824     @@@DEnt:
6825     @@@@test:value:
6826     <?xml version="1.1"?>$u000D$u0085<p/>
6827     @@@test:domTree:
6828     document {
6829     xml-version: '1.1';
6830     element { }
6831     }
6832     @@XMLTest:
6833     @@@QName: xp.xml11.decl.s.ls.test
6834     @@@DEnt:
6835     @@@@test:value:
6836     <?xml version="1.1"?>$u2028<p/>
6837     @@@test:domTree:
6838     document {
6839     xml-version: '1.1';
6840     element { }
6841     }
6842    
6843     @@XMLTest:
6844 wakaba 1.18 @@@QName: xp.element.type.match.1.test
6845     @@@DEnt:
6846     @@@@test:value:
6847     <p></pa>(err)
6848     @@@c:erred: <[[xp|wf-element-type-match]]> { (1, 4)..(1, 8); }
6849     @@@c:erred: <[[xp|wf-syntax-error]]> { }
6850     @@XMLTest:
6851     @@@QName: xp.element.type.match.2.test
6852     @@@DEnt:
6853     @@@@test:value:
6854     <p><pa></pa></pa>(err)
6855     @@@c:erred: <[[xp|wf-element-type-match]]> { (1, 13)..(1, 17); }
6856     @@@c:erred: <[[xp|wf-syntax-error]]> { }
6857     @@XMLTest:
6858     @@@QName: xp.element.type.match.3.test
6859     @@@DEnt:
6860     @@@@test:value:
6861     <p><pa></p></p>(err)
6862     @@@c:erred: <[[xp|wf-element-type-match]]> { (1, 8)..(1, 11); }
6863     @@@c:erred: <[[xp|wf-syntax-error]]> { }
6864     @@XMLTest:
6865     @@@QName: xp.element.type.match.4.test
6866     @@@DEnt:
6867     @@@@test:value:
6868     <a:p xmlns:a="about:1"></p>(err)
6869     @@@c:erred: <[[xp|wf-element-type-match]]> { (1, 24)..(1, 27); }
6870     @@@c:erred: <[[xp|wf-syntax-error]]> { }
6871     @@XMLTest:
6872     @@@QName: xp.element.type.match.5.test
6873     @@@DEnt:
6874     @@@@test:value:
6875     <a:p xmlns:a="about:1" xmlns:b="about:1"></b:p>(err)
6876     @@@c:erred: <[[xp|wf-element-type-match]]> { (1, 42)..(1, 47); }
6877     @@@c:erred: <[[xp|wf-syntax-error]]> { }
6878    
6879     @@XMLTest:
6880     @@@QName: xp.stag.stago.name.etago.test
6881     @@@DEnt:
6882     @@@@test:value:
6883     <a</a>
6884     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 3); }
6885     @@XMLTest:
6886     @@@QName: xp.stag.stago.name.s.etago.test
6887     @@@DEnt:
6888     @@@@test:value:
6889     <a </a>
6890     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 4); }
6891     @@XMLTest:
6892     @@@QName: xp.stag.stago.name.s.attr.etago.test
6893     @@@DEnt:
6894     @@@@test:value:
6895     <a a="b"</a>
6896     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 9); }
6897     @@XMLTest:
6898     @@@QName: xp.stag.stago.name.s.attr.s.attr.etago.test
6899     @@@DEnt:
6900     @@@@test:value:
6901     <a a="b" c="d"</a>
6902     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 15); }
6903     @@XMLTest:
6904     @@@QName: xp.stag.stago.name.s.attr.s.etago.test
6905     @@@DEnt:
6906     @@@@test:value:
6907     <a a="b" </a>
6908     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 10); }
6909     @@XMLTest:
6910     @@@QName: xp.stag.etag.1.test
6911 wakaba 1.16 @@@DEnt:
6912     @@@@test:value:
6913 wakaba 1.18 <root><a></a></root>
6914 wakaba 1.16 @@@test:domTree:
6915     document {
6916 wakaba 1.18 element {
6917     element {
6918     node-name: 'a';
6919 wakaba 1.16 }
6920     }
6921 wakaba 1.18 }
6922     @@XMLTest:
6923     @@@QName: xp.stag.etag.2.test
6924     @@@DEnt:
6925     @@@@test:value:
6926     <root><ab></ab></root>
6927     @@@test:domTree:
6928     document {
6929 wakaba 1.16 element {
6930 wakaba 1.18 element {
6931     node-name: 'ab';
6932     }
6933 wakaba 1.16 }
6934 wakaba 1.18 }
6935 wakaba 1.16 @@XMLTest:
6936 wakaba 1.18 @@@QName: xp.stag.etag.s.1.test
6937 wakaba 1.16 @@@DEnt:
6938     @@@@test:value:
6939 wakaba 1.18 <root><a ></a ></root>
6940 wakaba 1.16 @@@test:domTree:
6941     document {
6942 wakaba 1.18 element {
6943     element {
6944     node-name: 'a';
6945 wakaba 1.16 }
6946     }
6947 wakaba 1.18 }
6948     @@XMLTest:
6949     @@@QName: xp.etag.1.test
6950     @@@DEnt:
6951     @@@@test:value:
6952     <root><a/></root>
6953     @@@test:domTree:
6954     document {
6955 wakaba 1.16 element {
6956 wakaba 1.18 element {
6957     node-name: 'a';
6958     }
6959 wakaba 1.16 }
6960 wakaba 1.18 }
6961 wakaba 1.16 @@XMLTest:
6962 wakaba 1.18 @@@QName: xp.etag.2.test
6963 wakaba 1.16 @@@DEnt:
6964     @@@@test:value:
6965 wakaba 1.18 <root><a /></root>
6966 wakaba 1.16 @@@test:domTree:
6967     document {
6968     element {
6969 wakaba 1.18 element {
6970     node-name: 'a';
6971     }
6972 wakaba 1.16 }
6973 wakaba 1.18 }
6974 wakaba 1.16 @@XMLTest:
6975 wakaba 1.18 @@@QName: xp.stag.etag.attr.1.test
6976 wakaba 1.16 @@@DEnt:
6977     @@@@test:value:
6978 wakaba 1.18 <root><a at="v"></a></root>
6979 wakaba 1.16 @@@test:domTree:
6980     document {
6981 wakaba 1.18 element {
6982     element {
6983     node-name: 'a';
6984     attribute {
6985     node-name: 'at';
6986     value: 'v';
6987     }
6988 wakaba 1.16 }
6989     }
6990 wakaba 1.18 }
6991     @@XMLTest:
6992     @@@QName: xp.stag.etag.attr.2.test
6993     @@@DEnt:
6994     @@@@test:value:
6995     <root><a at="v" ></a></root>
6996     @@@test:domTree:
6997     document {
6998 wakaba 1.16 element {
6999 wakaba 1.18 element {
7000     node-name: 'a';
7001     attribute {
7002     node-name: 'at';
7003     value: 'v';
7004 wakaba 1.16 }
7005     }
7006     }
7007 wakaba 1.18 }
7008 wakaba 1.16 @@XMLTest:
7009 wakaba 1.18 @@@QName: xp.stag.etag.attr.3.test
7010 wakaba 1.16 @@@DEnt:
7011     @@@@test:value:
7012 wakaba 1.18 <root><a at ="v"></a></root>
7013 wakaba 1.16 @@@test:domTree:
7014     document {
7015 wakaba 1.18 element {
7016     element {
7017     node-name: 'a';
7018     attribute {
7019     node-name: 'at';
7020     value: 'v';
7021     }
7022 wakaba 1.16 }
7023     }
7024 wakaba 1.18 }
7025     @@XMLTest:
7026     @@@QName: xp.stag.etag.attr.4.test
7027     @@@DEnt:
7028     @@@@test:value:
7029     <root><a at= "v"></a></root>
7030     @@@test:domTree:
7031     document {
7032 wakaba 1.16 element {
7033 wakaba 1.18 element {
7034     node-name: 'a';
7035     attribute {
7036     node-name: 'at';
7037     value: 'v';
7038 wakaba 1.16 }
7039     }
7040 wakaba 1.18 }
7041     }
7042     @@XMLTest:
7043     @@@QName: xp.stag.etag.attr.5.test
7044     @@@DEnt:
7045     @@@@test:value:
7046     <root><a at='v'></a></root>
7047     @@@test:domTree:
7048     document {
7049     element {
7050     element {
7051     node-name: 'a';
7052     attribute {
7053     node-name: 'at';
7054     value: 'v';
7055 wakaba 1.16 }
7056     }
7057     }
7058 wakaba 1.18 }
7059 wakaba 1.16 @@XMLTest:
7060 wakaba 1.18 @@@QName: xp.stag.etag.attr.6.test
7061 wakaba 1.16 @@@DEnt:
7062     @@@@test:value:
7063 wakaba 1.18 <root><a at= 'v' ></a></root>
7064 wakaba 1.6 @@@test:domTree:
7065     document {
7066 wakaba 1.18 element {
7067     element {
7068     node-name: 'a';
7069     attribute {
7070     node-name: 'at';
7071     value: 'v';
7072     }
7073 wakaba 1.11 }
7074 wakaba 1.6 }
7075 wakaba 1.18 }
7076     @@XMLTest:
7077     @@@QName: xp.stag.etag.attr.attr.1.test
7078     @@@DEnt:
7079     @@@@test:value:
7080     <root><a at="v" tr="w"></a></root>
7081     @@@test:domTree:
7082     document {
7083 wakaba 1.6 element {
7084 wakaba 1.18 element {
7085     node-name: 'a';
7086     attribute {
7087     node-name: 'at';
7088     value: 'v';
7089 wakaba 1.6 }
7090 wakaba 1.18 attribute {
7091     node-name: 'tr';
7092     value: 'w';
7093 wakaba 1.6 }
7094     }
7095     }
7096 wakaba 1.18 }
7097 wakaba 1.6 @@XMLTest:
7098 wakaba 1.18 @@@QName: xp.stag.etag.attr.attr.2.test
7099 wakaba 1.6 @@@DEnt:
7100     @@@@test:value:
7101 wakaba 1.18 <root><a tr="w" at="v"></a></root>
7102 wakaba 1.6 @@@test:domTree:
7103     document {
7104 wakaba 1.18 element {
7105     element {
7106     node-name: 'a';
7107     attribute {
7108     node-name: 'at';
7109     value: 'v';
7110     }
7111     attribute {
7112     node-name: 'tr';
7113     value: 'w';
7114 wakaba 1.11 }
7115     }
7116 wakaba 1.6 }
7117 wakaba 1.18 }
7118     @@XMLTest:
7119     @@@QName: xp.stag.etag.attr.no.s.attr.test
7120     @@@DEnt:
7121     @@@@test:value:
7122     <root><a at="v"tr="w"></a></root>
7123     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 16)..(1, 17); }
7124     @@XMLTest:
7125     @@@QName: xp.etag.attr.1.test
7126     @@@DEnt:
7127     @@@@test:value:
7128     <root><a at="v" tr="w"></a b="c"></root>
7129     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 28); }
7130     @@XMLTest:
7131     @@@QName: xp.etag.no.etagc.1.test
7132     @@@DEnt:
7133     @@@@test:value:
7134     <root><a at="v" tr="w"></a</root>
7135     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 27)..(1, 28); }
7136     @@XMLTest:
7137     @@@QName: xp.etag.no.etagc.2.test
7138     @@@DEnt:
7139     @@@@test:value:
7140     <root><a at="v" tr="w"></a </root>
7141     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 29)..(1, 30); }
7142     @@XMLTest:
7143     @@@QName: xp.mtag.attr.1.test
7144     @@@DEnt:
7145     @@@@test:value:
7146     <root><a b="c"/></root>
7147     @@@test:domTree:
7148     document {
7149 wakaba 1.6 element {
7150 wakaba 1.18 element {
7151     node-name: 'a';
7152     attribute {
7153     node-name: 'b';
7154     value: 'c';
7155 wakaba 1.6 }
7156     }
7157 wakaba 1.8 }
7158 wakaba 1.18 }
7159 wakaba 1.11 @@XMLTest:
7160 wakaba 1.18 @@@QName: xp.mtag.attr.2.test
7161 wakaba 1.11 @@@DEnt:
7162     @@@@test:value:
7163 wakaba 1.18 <root><a b="c" /></root>
7164 wakaba 1.11 @@@test:domTree:
7165     document {
7166 wakaba 1.18 element {
7167     element {
7168     node-name: 'a';
7169     attribute {
7170     node-name: 'b';
7171     value: 'c';
7172     }
7173 wakaba 1.11 }
7174     }
7175 wakaba 1.18 }
7176 wakaba 1.11 @@XMLTest:
7177 wakaba 1.18 @@@QName: xp.mtag.attr.3.test
7178 wakaba 1.11 @@@DEnt:
7179     @@@@test:value:
7180 wakaba 1.18 <root><a b='c'/></root>
7181 wakaba 1.11 @@@test:domTree:
7182     document {
7183     element {
7184 wakaba 1.18 element {
7185     node-name: 'a';
7186     attribute {
7187     node-name: 'b';
7188     value: 'c';
7189     }
7190     }
7191 wakaba 1.11 }
7192 wakaba 1.18 }
7193 wakaba 1.11 @@XMLTest:
7194 wakaba 1.18 @@@QName: xp.mtag.attr.4.test
7195 wakaba 1.11 @@@DEnt:
7196     @@@@test:value:
7197 wakaba 1.18 <root><a b="c" d="e"/></root>
7198 wakaba 1.11 @@@test:domTree:
7199     document {
7200     element {
7201 wakaba 1.18 element {
7202     node-name: 'a';
7203     attribute {
7204     node-name: 'b';
7205     value: 'c';
7206     }
7207     attribute {
7208     node-name: 'd';
7209     value: 'e';
7210     }
7211 wakaba 1.11 }
7212     }
7213 wakaba 1.18 }
7214    
7215     @@XMLTest:
7216     @@@QName: xp.attvalue.lt.1.test
7217     @@@DEnt:
7218     @@@@test:value:
7219     <a b="aa<dd"/>
7220     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 9); }
7221     @@XMLTest:
7222     @@@QName: xp.attvalue.lt.2.test
7223     @@@DEnt:
7224     @@@@test:value:
7225     <a b='aa<dd'/>
7226     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 9); }
7227     @@XMLTest:
7228     @@@QName: xp.attvalue.amp.1.test
7229     @@@DEnt:
7230     @@@@test:value:
7231     <a b="aa& dd"/>
7232     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 9)..(1, 12); }
7233     @@XMLTest:
7234     @@@QName: xp.attvalue.amp.2.test
7235     @@@DEnt:
7236     @@@@test:value:
7237     <a b='aa& dd'/>
7238     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 9)..(1, 12); }
7239     @@XMLTest:
7240     @@@QName: xp.attvalue.amp.3.test
7241     @@@DEnt:
7242     @@@@test:value:
7243     <a b="aa&# dd"/>
7244     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 9)..(1, 13); }
7245     @@XMLTest:
7246     @@@QName: xp.attvalue.amp.4.test
7247     @@@DEnt:
7248     @@@@test:value:
7249     <a b="aa&#x dd"/>
7250     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 9)..(1, 14); }
7251    
7252     @@XMLTest:
7253     @@@QName: xp.unique.att.spec.1.test
7254     @@@DEnt:
7255     @@@@test:value:
7256     <a b="c" b="d"/>
7257     @@@c:erred: <[[xp|wf-unique-att-spec]]> { (1, 4)..(1, 14); }
7258     @@XMLTest:
7259     @@@QName: xp.unique.att.spec.2.test
7260     @@@DEnt:
7261     @@@@test:value:
7262     <a d:b="c" d:b="d" xmlns:d="about:2"/>
7263     @@@c:erred: <[[xp|wf-unique-att-spec]]> { (1, 4)..(1, 18); }
7264    
7265     @@XMLTest:
7266     @@@QName: xp.no.external.entity.references.1.test
7267     @@@DEnt:
7268     @@@@test:value:
7269     <!DOCTYPE a [
7270     <!ENTITY ent SYSTEM "something">
7271     ]>
7272     <a b="c&ent;"/>
7273     @@@c:erred: <[[xp|wf-no-external-entity-references]]> { (4, 8)..(4, 12); }
7274     @@XMLTest:
7275     @@@QName: xp.no.external.entity.references.2.test
7276     @@@DEnt:
7277     @@@@test:value:
7278     <!DOCTYPE a [
7279     <!NOTATION n SYSTEM "notation">
7280     <!ENTITY ent SYSTEM "something" NDATA n>
7281     ]>
7282     <a b="c&ent;"/>
7283     @@@c:erred: <[[xp|wf-no-external-entity-references]]> { (5, 8)..(5, 12); }
7284     @@XMLTest:
7285     @@@QName: xp.no.external.entity.references.3.test
7286     @@@DEnt:
7287     @@@@test:value:
7288     <!DOCTYPE a [
7289     <!ENTITY ent SYSTEM "something">
7290     <!ENTITY ent2 "ddd&ent;">
7291     ]>
7292     <a b="c&ent2;"/>
7293     @@@c:erred: <[[xp|wf-no-external-entity-references]]> { (1, 4)..(1, 8); }
7294     @@XMLTest:
7295     @@@QName: xp.no.external.entity.references.4.test
7296     @@@DEnt:
7297     @@@@test:value:
7298     <!DOCTYPE a [
7299     <!NOTATION n SYSTEM "notation">
7300     <!ENTITY ent SYSTEM "something" NDATA n>
7301     <!ENTITY ent2 "ddd&ent;">
7302     ]>
7303     <a b="c&ent2;"/>
7304     @@@c:erred: <[[xp|wf-no-external-entity-references]]> { (1, 4)..(1, 8); }
7305 wakaba 1.23 @@@c:erred: <[[xp|wf-parsed-entity]]> { }
7306 wakaba 1.18 @@XMLTest:
7307     @@@QName: xp.no.lt.in.attr.value.1.test
7308     @@@DEnt:
7309     @@@@test:value:
7310     <!DOCTYPE a [
7311     <!ENTITY ent "aa<bb">
7312     ]>
7313     <a b="c&ent;"/>
7314     @@@c:erred: <[[xp|wf-no-lt-in-attribute-values]]> { (1, 3); }
7315 wakaba 1.20 @@@c:erred:
7316     @@@@@: <[[xp|wf-syntax-error]]> { (1, 3)..(1, 6); }
7317     @@@@enImplNote: When entity node is created.
7318 wakaba 1.18 @@XMLTest:
7319     @@@QName: xp.no.lt.in.attr.value.2.test
7320     @@@DEnt:
7321     @@@@test:value:
7322     <!DOCTYPE a [
7323     <!ENTITY ent "aa<bb">
7324     <!ENTITY ent2 "ccc&ent;">
7325     ]>
7326     <a b="c&ent2;"/>
7327     @@@c:erred: <[[xp|wf-no-lt-in-attribute-values]]> { (1, 3); }
7328 wakaba 1.20 @@@c:erred:
7329     @@@@@: <[[xp|wf-syntax-error]]> { (1, 3)..(1, 6); }
7330     @@@@enImplNote: When entity node is created.
7331 wakaba 1.18 @@XMLTest:
7332     @@@QName: xp.no.lt.in.attr.value.3.test
7333     @@@DEnt:
7334     @@@@test:value:
7335     <!DOCTYPE a [
7336     <!ENTITY ent "aa&#x3C;bb">
7337     ]>
7338     <a b="c&ent;"/>
7339     @@@c:erred: <[[xp|wf-no-lt-in-attribute-values]]> { (1, 3); }
7340 wakaba 1.20 @@@c:erred:
7341     @@@@@: <[[xp|wf-syntax-error]]> { (1, 3)..(1, 6); }
7342     @@@@enImplNote: When entity node is created.
7343 wakaba 1.18 @@XMLTest:
7344     @@@QName: xp.no.lt.in.attr.value.4.test
7345     @@@DEnt:
7346     @@@@test:value:
7347     <!DOCTYPE a [
7348     <!ENTITY ent "aa&#x3C;bb">
7349     <!ENTITY ent2 "ccc&ent;">
7350     ]>
7351     <a b="c&ent2;"/>
7352     @@@c:erred: <[[xp|wf-no-lt-in-attribute-values]]> { (1, 3); }
7353 wakaba 1.20 @@@c:erred:
7354     @@@@@: <[[xp|wf-syntax-error]]> { (1, 3)..(1, 6); }
7355     @@@@enImplNote: When entity node is created.
7356 wakaba 1.11 @@XMLTest:
7357 wakaba 1.18 @@@QName: xp.ger.lt.in.attr.value.1.test
7358 wakaba 1.11 @@@DEnt:
7359     @@@@test:value:
7360     <!DOCTYPE a [
7361 wakaba 1.18 <!ENTITY ent "aa&lt;bb">
7362 wakaba 1.11 ]>
7363 wakaba 1.18 <a b="c&ent;"/>
7364 wakaba 1.11 @@@test:domTree:
7365     document {
7366     document-type {
7367     general-entity {
7368     node-name: 'ent';
7369 wakaba 1.18 text-content: 'aa<bb';
7370 wakaba 1.11 }
7371     }
7372     element {
7373 wakaba 1.18 attribute {
7374     node-name: 'b';
7375     text { data: 'c'; }
7376     general-entity-reference {
7377 wakaba 1.19 is-expanded: true;
7378 wakaba 1.18 node-name: 'ent';
7379     text-content: 'aa<bb';
7380     }
7381     }
7382 wakaba 1.11 }
7383     }
7384     @@XMLTest:
7385 wakaba 1.18 @@@QName: xp.ger.lt.in.attr.value.2.test
7386 wakaba 1.11 @@@DEnt:
7387     @@@@test:value:
7388     <!DOCTYPE a [
7389 wakaba 1.18 <!ENTITY ent "aa&lt;bb">
7390     <!ENTITY ent2 "ccc&ent;">
7391 wakaba 1.11 ]>
7392 wakaba 1.18 <a b="c&ent2;"/>
7393 wakaba 1.11 @@@test:domTree:
7394     document {
7395     document-type {
7396     general-entity {
7397 wakaba 1.18 node-name: 'ent';
7398     text-content: 'aa<bb';
7399     }
7400     general-entity {
7401     node-name: 'ent2';
7402     text { data: 'ccc'; }
7403     general-entity-reference {
7404     node-name: 'ent';
7405     text-content: 'aa<bb';
7406 wakaba 1.19 is-expanded: true;
7407 wakaba 1.18 }
7408 wakaba 1.11 }
7409     }
7410     element {
7411 wakaba 1.18 attribute {
7412     node-name: 'b';
7413     text { data: 'c'; }
7414     general-entity-reference {
7415     node-name: 'ent2';
7416     text { data: 'ccc'; }
7417     general-entity-reference {
7418     node-name: 'ent';
7419     text-content: 'aa<bb';
7420 wakaba 1.19 is-expanded: true;
7421 wakaba 1.18 }
7422 wakaba 1.19 is-expanded: true;
7423 wakaba 1.18 }
7424     }
7425 wakaba 1.11 }
7426     }
7427    
7428 wakaba 1.8 @@XMLTest:
7429 wakaba 1.18 @@@QName: xp.doctype.intsubset.pi.test
7430 wakaba 1.8 @@@DEnt:
7431     @@@@test:value:
7432     <!DOCTYPE a [
7433 wakaba 1.18 <?pi data ?>
7434 wakaba 1.8 ]>
7435     <a></a>
7436     @@@test:domTree:
7437     document {
7438     xml-version: '1.0';
7439     xml-encoding: null;
7440     xml-standalone: false;
7441     document-type {
7442     node-name: 'a';
7443 wakaba 1.18 pi {
7444     target: 'pi';
7445     data: 'data ';
7446 wakaba 1.8 }
7447     }
7448     element {
7449     namespace-uri: null;
7450 wakaba 1.18 prefix: null;
7451 wakaba 1.8 local-name: 'a';
7452 wakaba 1.18 text-content: '';
7453 wakaba 1.8 }
7454     }
7455 wakaba 1.18 @@@enImplNote:
7456     A DOM PI node in doctype node is a manakai extension.
7457    
7458    
7459 wakaba 1.8 @@XMLTest:
7460 wakaba 1.18 @@@QName: xp.doctype.intsubset.entity.general.internal.test
7461 wakaba 1.8 @@@DEnt:
7462     @@@@test:value:
7463     <!DOCTYPE a [
7464 wakaba 1.18 <!ENTITY entity "entity value">
7465 wakaba 1.8 ]>
7466     <a></a>
7467     @@@test:domTree:
7468     document {
7469     xml-version: '1.0';
7470     xml-encoding: null;
7471     xml-standalone: false;
7472     document-type {
7473     node-name: 'a';
7474 wakaba 1.18 general-entity {
7475     node-name: 'entity';
7476     text-content: 'entity value';
7477     has-replacement-tree: true;
7478 wakaba 1.8 }
7479     }
7480     element {
7481     namespace-uri: null;
7482 wakaba 1.18 prefix: null;
7483 wakaba 1.8 local-name: 'a';
7484 wakaba 1.18 text-content: '';
7485 wakaba 1.8 }
7486     }
7487     @@XMLTest:
7488 wakaba 1.18 @@@QName: xp.doctype.intsubset.entity.parameter.internal.test
7489 wakaba 1.8 @@@DEnt:
7490     @@@@test:value:
7491     <!DOCTYPE a [
7492 wakaba 1.18 <!ENTITY % entity "entity value">
7493 wakaba 1.8 ]>
7494     <a></a>
7495     @@@test:domTree:
7496     document {
7497     xml-version: '1.0';
7498     xml-encoding: null;
7499     xml-standalone: false;
7500     document-type {
7501     node-name: 'a';
7502     }
7503     element {
7504     namespace-uri: null;
7505 wakaba 1.18 prefix: null;
7506 wakaba 1.8 local-name: 'a';
7507 wakaba 1.18 text-content: '';
7508 wakaba 1.8 }
7509     }
7510 wakaba 1.18
7511 wakaba 1.8 @@XMLTest:
7512 wakaba 1.18 @@@QName: xp.doctype.internal.entity.root.element.text.only.test
7513 wakaba 1.8 @@@DEnt:
7514     @@@@test:value:
7515     <!DOCTYPE a [
7516 wakaba 1.18 <!ENTITY entity "entity value">
7517 wakaba 1.8 ]>
7518 wakaba 1.18 <a>&entity;</a>
7519 wakaba 1.8 @@@test:domTree:
7520     document {
7521     xml-version: '1.0';
7522     xml-encoding: null;
7523     xml-standalone: false;
7524     document-type {
7525     node-name: 'a';
7526 wakaba 1.18 general-entity {
7527     node-name: 'entity';
7528     text-content: 'entity value';
7529     has-replacement-tree: true;
7530 wakaba 1.8 }
7531     }
7532     element {
7533     namespace-uri: null;
7534 wakaba 1.18 prefix: null;
7535 wakaba 1.8 local-name: 'a';
7536 wakaba 1.18 general-entity-reference {
7537     node-name: 'entity';
7538     text {
7539     data: 'entity value';
7540     }
7541 wakaba 1.19 is-expanded: true;
7542 wakaba 1.10 }
7543 wakaba 1.9 }
7544     }
7545     @@XMLTest:
7546 wakaba 1.18 @@@QName: xp.doctype.internal.entity.root.element.text.mult.test
7547 wakaba 1.9 @@@DEnt:
7548     @@@@test:value:
7549     <!DOCTYPE a [
7550 wakaba 1.18 <!ENTITY entity "entity value">
7551 wakaba 1.9 ]>
7552 wakaba 1.18 <a>&entity; and &entity;</a>
7553 wakaba 1.9 @@@test:domTree:
7554     document {
7555     xml-version: '1.0';
7556     xml-encoding: null;
7557     xml-standalone: false;
7558     document-type {
7559     node-name: 'a';
7560 wakaba 1.18 general-entity {
7561     node-name: 'entity';
7562     text-content: 'entity value';
7563     has-replacement-tree: true;
7564 wakaba 1.9 }
7565     }
7566     element {
7567     namespace-uri: null;
7568 wakaba 1.18 prefix: null;
7569 wakaba 1.9 local-name: 'a';
7570 wakaba 1.18 general-entity-reference {
7571     node-name: 'entity';
7572     text {
7573     data: 'entity value';
7574     }
7575 wakaba 1.19 is-expanded: true;
7576 wakaba 1.18 }
7577     text { data: ' and '; }
7578     general-entity-reference {
7579     node-name: 'entity';
7580     text {
7581     data: 'entity value';
7582     }
7583 wakaba 1.19 is-expanded: true;
7584 wakaba 1.10 }
7585 wakaba 1.9 }
7586     }
7587     @@XMLTest:
7588 wakaba 1.18 @@@QName: xp.doctype.internal.entity.root.element.text.element.test
7589 wakaba 1.9 @@@DEnt:
7590     @@@@test:value:
7591     <!DOCTYPE a [
7592 wakaba 1.18 <!ENTITY entity "entity <p>value</p> with <e>element</e> ">
7593 wakaba 1.9 ]>
7594 wakaba 1.18 <a>&entity;</a>
7595     @@@test:domTree:
7596     document {
7597     xml-version: '1.0';
7598     xml-encoding: null;
7599     xml-standalone: false;
7600     document-type {
7601     node-name: 'a';
7602     general-entity {
7603     node-name: 'entity';
7604     has-replacement-tree: true;
7605     text { data: 'entity '; }
7606     element {
7607     node-name: 'p';
7608     text-content: 'value';
7609     }
7610     text { data: ' with '; }
7611     element {
7612     node-name: 'e';
7613     text-content: 'element';
7614     }
7615 wakaba 1.20 text { data: ' '; }
7616 wakaba 1.18 }
7617     }
7618     element {
7619     namespace-uri: null;
7620     prefix: null;
7621     local-name: 'a';
7622     general-entity-reference {
7623     node-name: 'entity';
7624 wakaba 1.19 is-expanded: true;
7625 wakaba 1.18 text {
7626     data: 'entity ';
7627     }
7628     element {
7629     namespace-uri: null;
7630     prefix: null;
7631     local-name: 'p';
7632     text {
7633     data: 'value';
7634     }
7635     }
7636     text {
7637     data: ' with ';
7638     }
7639     element {
7640     namespace-uri: null;
7641     prefix: null;
7642     local-name: 'e';
7643     text {
7644     data: 'element';
7645     }
7646     }
7647     text {
7648     data: ' ';
7649     }
7650     }
7651     }
7652     }
7653     @@XMLTest:
7654     @@@QName: xp.doctype.internal.entity.root.element.text.in.ent.test
7655     @@@DEnt:
7656     @@@@test:value:
7657     <!DOCTYPE a [
7658     <!ENTITY entity1 "entity value">
7659     <!ENTITY entity2 "e&entity1;n">
7660     ]>
7661     <a>&entity2;</a>
7662     @@@test:domTree:
7663     document {
7664     xml-version: '1.0';
7665     xml-encoding: null;
7666     xml-standalone: false;
7667     document-type {
7668     node-name: 'a';
7669     general-entity {
7670     node-name: 'entity1';
7671     text-content: 'entity value';
7672     }
7673     general-entity {
7674     node-name: 'entity2';
7675     text { data: 'e'; }
7676     general-entity-reference {
7677     node-name: 'entity1';
7678     text-content: 'entity value';
7679     is-expanded: true;
7680     }
7681     text { data: 'n'; }
7682     }
7683     }
7684     element {
7685     namespace-uri: null;
7686     prefix: null;
7687     local-name: 'a';
7688     general-entity-reference {
7689     node-name: 'entity2';
7690     text { data: 'e'; }
7691 wakaba 1.19 is-expanded: true;
7692 wakaba 1.18 general-entity-reference {
7693     node-name: 'entity1';
7694     text {
7695     data: 'entity value';
7696     }
7697 wakaba 1.19 is-expanded: true;
7698 wakaba 1.18 }
7699     text { data: 'n'; }
7700     }
7701     }
7702     }
7703    
7704     @@XMLTest:
7705     @@@QName: xp.doctype.entity.value.charref.test
7706     @@@DEnt:
7707     @@@@test:value:
7708     <!DOCTYPE a [
7709     <!ENTITY entity1 "entity &#x21;value&#35;">
7710     <!ENTITY entity2 '&#x21;value&#35;'>
7711     ]>
7712     <a></a>
7713     @@@test:domTree:
7714     document {
7715     document-type {
7716     general-entity {
7717     node-name: 'entity1';
7718     text-content: 'entity !value#';
7719     has-replacement-tree: true;
7720     }
7721     general-entity {
7722     node-name: 'entity2';
7723     text-content: '!value#';
7724     has-replacement-tree: true;
7725     }
7726     }
7727     element { }
7728     }
7729    
7730     @@XMLTest:
7731     @@@QName: xp.predefined.in.content.test
7732     @@@DEnt:
7733     @@@@test:value:
7734     <a>_&lt;_&gt;_&quot;_&apos;_&amp;_</a>
7735     @@@test:domTree:
7736     document {
7737     element {
7738     text-content: '_<_>_"_' U+0027 '_&_';
7739     }
7740     }
7741     @@XMLTest:
7742     @@@QName: xp.predefined.in.attr.test
7743     @@@DEnt:
7744     @@@@test:value:
7745     <a at="_&lt;_&gt;_&quot;_&apos;_&amp;_"></a>
7746     @@@test:domTree:
7747     document {
7748     element {
7749     attribute {
7750     node-name: 'at';
7751     text-content: '_<_>_"_' U+0027 '_&_';
7752     }
7753     }
7754     }
7755     @@XMLTest:
7756     @@@QName: xp.predefined.in.content.in.entity.test
7757     @@@DEnt:
7758     @@@@test:value:
7759     <!DOCTYPE a [
7760     <!ENTITY ent "_&lt;_&gt;_&quot;_&apos;_&amp;_">
7761     ]>
7762     <a>&ent;</a>
7763     @@@test:domTree:
7764     document {
7765     document-type {
7766     general-entity {
7767     node-name: 'ent';
7768     text-content: '_<_>_"_' U+0027 '_&_';
7769     }
7770     }
7771     element {
7772     text-content: '_<_>_"_' U+0027 '_&_';
7773     }
7774     }
7775     @@XMLTest:
7776     @@@QName: xp.predefined.decl.ignore.test
7777     @@@DEnt:
7778     @@@@test:value:
7779     <!DOCTYPE a [
7780     <!ENTITY lt "&#x26;#x3C;">
7781     <!ENTITY gt "&#x3E;">
7782     <!ENTITY amp "&#x26;#x26;">
7783     <!ENTITY quot "&#x22;">
7784     <!ENTITY apos "&#x27;">
7785     <!ENTITY other "other">
7786     ]>
7787     <a>_&lt;_&gt;_&quot;_&apos;_&amp;_&other;_</a>
7788     @@@test:domTree:
7789     document {
7790     document-type {
7791     general-entity {
7792     node-name: 'other';
7793     text-content: 'other';
7794     }
7795     }
7796     element {
7797     text-content: '_<_>_"_' U+0027 '_&_other_';
7798     }
7799     }
7800    
7801     @@XMLTest:
7802     @@@QName: xp.doctype.internal.attr.empty.test
7803     @@@DEnt:
7804     @@@@test:value:
7805     <!DOCTYPE a [
7806     <!ATTLIST a>
7807     ]>
7808     <a></a>
7809     @@@test:domTree:
7810     document {
7811     xml-version: '1.0';
7812     xml-encoding: null;
7813     xml-standalone: false;
7814     document-type {
7815     node-name: 'a';
7816     element-type-definition {
7817     node-name: 'a';
7818     }
7819     }
7820     element {
7821     namespace-uri: null;
7822     local-name: 'a';
7823     }
7824     }
7825     @@XMLTest:
7826     @@@QName: xp.doctype.internal.attr.cdata.implied.test
7827     @@@DEnt:
7828     @@@@test:value:
7829     <!DOCTYPE a [
7830     <!ATTLIST a
7831     at CDATA #IMPLIED
7832     >
7833     ]>
7834     <a></a>
7835 wakaba 1.9 @@@test:domTree:
7836     document {
7837     xml-version: '1.0';
7838     xml-encoding: null;
7839     xml-standalone: false;
7840     document-type {
7841     node-name: 'a';
7842     element-type-definition {
7843     node-name: 'a';
7844     attribute-definition {
7845     node-name: 'at';
7846 wakaba 1.18 declared-type: const (CDATA_ATTR);
7847 wakaba 1.9 allowed-tokens: DOMStringList ();
7848 wakaba 1.18 default-type: const (IMPLIED_DEFAULT);
7849     text-content: '';
7850 wakaba 1.9 }
7851     }
7852     }
7853     element {
7854     namespace-uri: null;
7855     local-name: 'a';
7856 wakaba 1.18 }
7857     }
7858     @@XMLTest:
7859     @@@QName: xp.doctype.internal.attr.types.implied.test
7860     @@@DEnt:
7861     @@@@test:value:
7862     <!DOCTYPE a [
7863     <!ATTLIST a
7864     at1 ID #IMPLIED
7865     at2 IDREF #IMPLIED
7866     at3 IDREFS #IMPLIED
7867     at4 ENTITY #IMPLIED
7868     at5 ENTITIES #IMPLIED
7869     at6 NMTOKEN #IMPLIED
7870     at7 NMTOKENS #IMPLIED
7871     at8 NOTATION (n1 | n2|n3) #IMPLIED
7872     at9 (e1| e2| e3 ) #IMPLIED
7873     >
7874     ]>
7875     <a></a>
7876     @@@test:domTree:
7877     document {
7878     xml-version: '1.0';
7879     xml-encoding: null;
7880     xml-standalone: false;
7881     document-type {
7882     node-name: 'a';
7883     element-type-definition {
7884     node-name: 'a';
7885     attribute-definition {
7886     node-name: 'at1';
7887     declared-type: const (ID_ATTR);
7888     allowed-tokens: DOMStringList ();
7889     default-type: const (IMPLIED_DEFAULT);
7890     text-content: '';
7891     }
7892     attribute-definition {
7893     node-name: 'at2';
7894     declared-type: const (IDREF_ATTR);
7895     allowed-tokens: DOMStringList ();
7896     default-type: const (IMPLIED_DEFAULT);
7897     text-content: '';
7898     }
7899     attribute-definition {
7900     node-name: 'at3';
7901     declared-type: const (IDREFS_ATTR);
7902     allowed-tokens: DOMStringList ();
7903     default-type: const (IMPLIED_DEFAULT);
7904     text-content: '';
7905     }
7906     attribute-definition {
7907     node-name: 'at4';
7908     declared-type: const (ENTITY_ATTR);
7909     allowed-tokens: DOMStringList ();
7910     default-type: const (IMPLIED_DEFAULT);
7911     text-content: '';
7912     }
7913     attribute-definition {
7914     node-name: 'at5';
7915     declared-type: const (ENTITIES_ATTR);
7916     allowed-tokens: DOMStringList ();
7917     default-type: const (IMPLIED_DEFAULT);
7918     text-content: '';
7919     }
7920     attribute-definition {
7921     node-name: 'at6';
7922     declared-type: const (NMTOKEN_ATTR);
7923     allowed-tokens: DOMStringList ();
7924     default-type: const (IMPLIED_DEFAULT);
7925     text-content: '';
7926     }
7927     attribute-definition {
7928     node-name: 'at7';
7929     declared-type: const (NMTOKENS_ATTR);
7930     allowed-tokens: DOMStringList ();
7931     default-type: const (IMPLIED_DEFAULT);
7932     text-content: '';
7933     }
7934     attribute-definition {
7935     node-name: 'at8';
7936     declared-type: const (NOTATION_ATTR);
7937     allowed-tokens: DOMStringList ('n1', 'n2', 'n3');
7938     default-type: const (IMPLIED_DEFAULT);
7939     text-content: '';
7940     }
7941     attribute-definition {
7942     node-name: 'at9';
7943     declared-type: const (ENUMERATION_ATTR);
7944     allowed-tokens: DOMStringList ('e1', 'e2', 'e3');
7945     default-type: const (IMPLIED_DEFAULT);
7946     text-content: '';
7947     }
7948     }
7949     }
7950     element {
7951     namespace-uri: null;
7952     local-name: 'a';
7953     }
7954     }
7955     @@XMLTest:
7956     @@@QName: xp.doctype.internal.attr.cdata.defaults.test
7957     @@@DEnt:
7958     @@@@test:value:
7959     <!DOCTYPE a [
7960     <!ATTLIST a
7961     at1 CDATA #IMPLIED
7962     at2 CDATA #REQUIRED
7963     at3 CDATA #FIXED "value3"
7964     at4 CDATA "value4"
7965     at5 CDATA #FIXED 'value5'
7966     at6 CDATA 'value6'
7967     >
7968     ]>
7969     <a></a>
7970     @@@test:domTree:
7971     document {
7972     xml-version: '1.0';
7973     xml-encoding: null;
7974     xml-standalone: false;
7975     document-type {
7976     node-name: 'a';
7977     element-type-definition {
7978     node-name: 'a';
7979     attribute-definition {
7980     node-name: 'at1';
7981     declared-type: const (CDATA_ATTR);
7982     allowed-tokens: DOMStringList ();
7983     default-type: const (IMPLIED_DEFAULT);
7984     text-content: '';
7985     }
7986     attribute-definition {
7987     node-name: 'at2';
7988     declared-type: const (CDATA_ATTR);
7989     allowed-tokens: DOMStringList ();
7990     default-type: const (REQUIRED_DEFAULT);
7991     text-content: '';
7992     }
7993     attribute-definition {
7994     node-name: 'at3';
7995     declared-type: const (CDATA_ATTR);
7996     allowed-tokens: DOMStringList ();
7997     default-type: const (FIXED_DEFAULT);
7998     text-content: 'value3';
7999     }
8000     attribute-definition {
8001     node-name: 'at4';
8002     declared-type: const (CDATA_ATTR);
8003     allowed-tokens: DOMStringList ();
8004     default-type: const (EXPLICIT_DEFAULT);
8005     text-content: 'value4';
8006     }
8007     attribute-definition {
8008     node-name: 'at5';
8009     declared-type: const (CDATA_ATTR);
8010     allowed-tokens: DOMStringList ();
8011     default-type: const (FIXED_DEFAULT);
8012     text-content: 'value5';
8013     }
8014     attribute-definition {
8015     node-name: 'at6';
8016     declared-type: const (CDATA_ATTR);
8017     allowed-tokens: DOMStringList ();
8018     default-type: const (EXPLICIT_DEFAULT);
8019     text-content: 'value6';
8020     }
8021     }
8022     }
8023     element {
8024     namespace-uri: null;
8025     local-name: 'a';
8026     attribute {
8027     node-name: 'at3';
8028     text-content: 'value3';
8029     specified: false;
8030     }
8031     attribute {
8032     node-name: 'at4';
8033     text-content: 'value4';
8034     specified: false;
8035     }
8036     attribute {
8037     node-name: 'at5';
8038     text-content: 'value5';
8039     specified: false;
8040     }
8041     attribute {
8042     node-name: 'at6';
8043     text-content: 'value6';
8044     specified: false;
8045     }
8046     }
8047     }
8048    
8049     @@XMLTest:
8050     @@@QName: xp.doctype.internal.attr.cdata.default.normalize.test
8051     @@@DEnt:
8052     @@@@test:value:
8053     <!DOCTYPE a [
8054     <!ATTLIST a
8055     at CDATA " default &#x0A;value "
8056     >
8057     ]>
8058     <a></a>
8059     @@@test:domTree:
8060     document {
8061     xml-version: '1.0';
8062     xml-encoding: null;
8063     xml-standalone: false;
8064     document-type {
8065     node-name: 'a';
8066     element-type-definition {
8067     node-name: 'a';
8068     attribute-definition {
8069     node-name: 'at';
8070     declared-type: const (CDATA_ATTR);
8071     allowed-tokens: DOMStringList ();
8072     default-type: const (EXPLICIT_DEFAULT);
8073     text-content: ' default ' U+000A 'value ';
8074     }
8075     }
8076     }
8077     element {
8078     namespace-uri: null;
8079     local-name: 'a';
8080     attribute {
8081     node-name: 'at';
8082     text-content: ' default ' U+000A 'value ';
8083     specified: false;
8084     }
8085     }
8086     }
8087     @@XMLTest:
8088     @@@QName: xp.doctype.internal.attr.nmtoken.default.normalize.test
8089     @@@DEnt:
8090     @@@@test:value:
8091     <!DOCTYPE a [
8092     <!ATTLIST a
8093     at NMTOKEN " default &#x0A;value "
8094     >
8095     ]>
8096     <a></a>
8097     @@@test:domTree:
8098     document {
8099     xml-version: '1.0';
8100     xml-encoding: null;
8101     xml-standalone: false;
8102     document-type {
8103     node-name: 'a';
8104     element-type-definition {
8105     node-name: 'a';
8106     attribute-definition {
8107     node-name: 'at';
8108     declared-type: const (NMTOKEN_ATTR);
8109     allowed-tokens: DOMStringList ();
8110     default-type: const (EXPLICIT_DEFAULT);
8111     text-content: ' default ' U+000A 'value ';
8112     }
8113     }
8114     }
8115     element {
8116     namespace-uri: null;
8117     local-name: 'a';
8118     attribute {
8119     node-name: 'at';
8120     text-content: ' default ' U+000A 'value ';
8121     specified: false;
8122     }
8123     }
8124     }
8125    
8126     @@XMLTest:
8127     @@@QName: xp.doctype.attrtype.no-value.test
8128     @@@DEnt:
8129     @@@@test:value:
8130     <!DOCTYPE a>
8131     <a at=" at value "></a>
8132     @@@test:domTree:
8133     document {
8134     xml-version: '1.0';
8135     xml-encoding: null;
8136     xml-standalone: false;
8137     document-type { }
8138     element {
8139     namespace-uri: null;
8140     local-name: 'a';
8141     attribute {
8142     namespace-uri: null;
8143     local-name: 'at';
8144     value: ' at value ';
8145     text {
8146     data: ' at value ';
8147     }
8148     schema-type-info: TypeInfo (null, null);
8149     specified: true;
8150     }
8151     }
8152     }
8153     @@XMLTest:
8154     @@@QName: xp.doctype.attrtype.cdata.test
8155     @@@DEnt:
8156     @@@@test:value:
8157     <!DOCTYPE a [
8158     <!ATTLIST a
8159     at CDATA #IMPLIED
8160     >
8161     ]>
8162     <a at=" at value "></a>
8163     @@@test:domTree:
8164     document {
8165     xml-version: '1.0';
8166     xml-encoding: null;
8167     xml-standalone: false;
8168     document-type { }
8169     element {
8170     namespace-uri: null;
8171     local-name: 'a';
8172     attribute {
8173     namespace-uri: null;
8174     local-name: 'at';
8175     value: ' at value ';
8176     text {
8177     data: ' at value ';
8178     }
8179     schema-type-info:
8180     TypeInfo ('http://www.w3.org/TR/REC-xml', 'CDATA');
8181     specified: true;
8182     }
8183     }
8184     }
8185     @@XMLTest:
8186     @@@QName: xp.doctype.attrtype.nmtoken.test
8187     @@@DEnt:
8188     @@@@test:value:
8189     <!DOCTYPE a [
8190     <!ATTLIST a
8191     at NMTOKEN #IMPLIED
8192     >
8193     ]>
8194     <a at=" at value "></a>
8195     @@@test:domTree:
8196     document {
8197     xml-version: '1.0';
8198     xml-encoding: null;
8199     xml-standalone: false;
8200     document-type { }
8201     element {
8202     namespace-uri: null;
8203     local-name: 'a';
8204     attribute {
8205     namespace-uri: null;
8206     local-name: 'at';
8207     value: 'at value';
8208     text {
8209     data: ' at value ';
8210     }
8211     schema-type-info:
8212     TypeInfo ('http://www.w3.org/TR/REC-xml', 'NMTOKEN');
8213     specified: true;
8214     }
8215     }
8216     }
8217    
8218     @@XMLTest:
8219     @@@QName: xp.doctype.attr.normalization.1.test
8220     @@@DEnt:
8221     @@@@test:value:
8222     <a at=" at &#xA;value "></a>
8223     @@@test:domTree:
8224     document {
8225     element {
8226     attribute {
8227     node-name: 'at';
8228     value: ' at ' U+000A 'value ';
8229     schema-type-info: TypeInfo (null, null);
8230     specified: true;
8231     }
8232     }
8233     }
8234     @@XMLTest:
8235     @@@QName: xp.doctype.attr.normalization.2.test
8236     @@@DEnt:
8237     @@@@test:value:
8238     <a at=" at &#xD;value "></a>
8239     @@@test:domTree:
8240     document {
8241     element {
8242     attribute {
8243     value: ' at ' U+000D 'value ';
8244     schema-type-info: TypeInfo (null, null);
8245     specified: true;
8246     }
8247     }
8248     }
8249     @@XMLTest:
8250     @@@QName: xp.doctype.attr.normalization.3.test
8251     @@@DEnt:
8252     @@@@test:value:
8253     <a at=" at &#x9;value "></a>
8254     @@@test:domTree:
8255     document {
8256     element {
8257     attribute {
8258     node-name: 'at';
8259     value: ' at ' U+0009 'value ';
8260     schema-type-info: TypeInfo (null, null);
8261     specified: true;
8262     }
8263     }
8264     }
8265    
8266     @@XMLTest:
8267     @@@QName: xp.doctype.attr.specified.1.test
8268     @@@DEnt:
8269     @@@@test:value:
8270     <!DOCTYPE a [
8271     <!ATTLIST a
8272     at CDATA "default"
8273     >
8274     ]>
8275     <a></a>
8276     @@@test:domTree:
8277     document {
8278     document-type { }
8279     element {
8280     attribute {
8281     node-name: 'at';
8282     value: 'default';
8283     specified: false;
8284     }
8285     }
8286     }
8287     @@XMLTest:
8288     @@@QName: xp.doctype.attr.specified.2.test
8289     @@@DEnt:
8290     @@@@test:value:
8291     <!DOCTYPE a [
8292     <!ATTLIST a
8293     at CDATA "default"
8294     >
8295     ]>
8296     <a at2="specified"></a>
8297     @@@test:domTree:
8298     document {
8299     document-type { }
8300     element {
8301     attribute {
8302     node-name: 'at';
8303     value: 'default';
8304     specified: false;
8305     }
8306     attribute {
8307     node-name: 'at2';
8308     value: 'specified';
8309     specified: true;
8310     }
8311     }
8312     }
8313     @@XMLTest:
8314     @@@QName: xp.doctype.attr.specified.3.test
8315     @@@DEnt:
8316     @@@@test:value:
8317     <!DOCTYPE a [
8318     <!ATTLIST a
8319     at CDATA "default"
8320     >
8321     ]>
8322     <a at="specified"></a>
8323     @@@test:domTree:
8324     document {
8325     document-type { }
8326     element {
8327     attribute {
8328     node-name: 'at';
8329     value: 'specified';
8330     specified: true;
8331     }
8332     }
8333     }
8334    
8335     @@XMLTest:
8336     @@@QName: xp.attr.literal.charref.test
8337     @@@DEnt:
8338     @@@@test:value:
8339     <a at1 = "value&#33;_&#x25;value"
8340     at2 = 'value&#x25;_&#33;value'></a>
8341     @@@test:domTree:
8342     document {
8343     element {
8344     attribute {
8345     node-name: 'at1';
8346     text-content: 'value!_%value';
8347     }
8348     attribute {
8349     node-name: 'at2';
8350     text-content: 'value%_!value';
8351     }
8352     }
8353     }
8354     @@XMLTest:
8355     @@@QName: xp.attr.literal.entref.test
8356     @@@DEnt:
8357     @@@@test:value:
8358     <!DOCTYPE a [
8359     <!ENTITY ent "entity&#x26;#33;_&#x26;#x29;value">
8360     ]>
8361     <a at1 = "value&ent;value"
8362     at2 = 'value&ent;value'></a>
8363     @@@test:domTree:
8364     document {
8365     document-type {
8366     general-entity {
8367     node-name: 'ent';
8368     text-content: 'entity!_)value';
8369     }
8370     }
8371     element {
8372     attribute {
8373     node-name: 'at1';
8374     text-content: 'valueentity!_)valuevalue';
8375     }
8376     attribute {
8377     node-name: 'at2';
8378     text-content: 'valueentity!_)valuevalue';
8379     }
8380     }
8381     }
8382     @@XMLTest:
8383     @@@QName: xp.attr.literal.entref.nest.test
8384     @@@DEnt:
8385     @@@@test:value:
8386     <!DOCTYPE a [
8387     <!ENTITY ent1 "entity&#x26;#33;_&#x26;#x29;value">
8388     <!ENTITY ent2 "@&ent1;@">
8389     ]>
8390     <a at1 = "value&ent2;value"
8391     at2 = 'value&ent2;value'></a>
8392     @@@test:domTree:
8393     document {
8394     document-type {
8395     general-entity {
8396     node-name: 'ent1';
8397     text-content: 'entity!_)value';
8398     }
8399     general-entity {
8400     node-name: 'ent2';
8401     text-content: '@entity!_)value@';
8402     }
8403     }
8404     element {
8405     attribute {
8406     node-name: 'at1';
8407     text-content: 'value@entity!_)value@value';
8408     }
8409     attribute {
8410     node-name: 'at2';
8411     text-content: 'value@entity!_)value@value';
8412     }
8413     }
8414     }
8415    
8416     @@XMLTest:
8417     @@@QName: xp.element.content.ncr.1.test
8418     @@@DEnt:
8419     @@@@test:value:
8420     <e>&#33;</e>
8421     @@@test:domTree:
8422     document {
8423     element {
8424     text-content: '!';
8425     }
8426     }
8427     @@XMLTest:
8428     @@@QName: xp.element.content.ncr.2.test
8429     @@@DEnt:
8430     @@@@test:value:
8431     <e>aaaa&#33;bbbb</e>
8432     @@@test:domTree:
8433     document {
8434     element {
8435     text-content: 'aaaa!bbbb';
8436     }
8437     }
8438     @@XMLTest:
8439     @@@QName: xp.attrval.ncr.1.test
8440     @@@DEnt:
8441     @@@@test:value:
8442     <e a="&#33;"/>
8443     @@@test:domTree:
8444     document {
8445     element {
8446     attribute {
8447     node-name: 'a';
8448     text-content: '!';
8449     }
8450     }
8451     }
8452     @@XMLTest:
8453     @@@QName: xp.attrval.ncr.2.test
8454     @@@DEnt:
8455     @@@@test:value:
8456     <e a="aaaaa&#33;bbbbb"/>
8457     @@@test:domTree:
8458     document {
8459     element {
8460     attribute {
8461     node-name: 'a';
8462     text-content: 'aaaaa!bbbbb';
8463     }
8464     }
8465     }
8466     @@XMLTest:
8467     @@@QName: xp.attrval.ncr.3.test
8468     @@@DEnt:
8469     @@@@test:value:
8470     <e a='&#33;'/>
8471     @@@test:domTree:
8472     document {
8473     element {
8474     attribute {
8475     node-name: 'a';
8476     text-content: '!';
8477     }
8478     }
8479     }
8480     @@XMLTest:
8481     @@@QName: xp.attrval.ncr.4.test
8482     @@@DEnt:
8483     @@@@test:value:
8484     <e a='aaaaa&#33;bbbbb'/>
8485     @@@test:domTree:
8486     document {
8487     element {
8488     attribute {
8489     node-name: 'a';
8490     text-content: 'aaaaa!bbbbb';
8491     }
8492     }
8493     }
8494     @@XMLTest:
8495     @@@QName: xp.entval.ncr.1.test
8496     @@@DEnt:
8497     @@@@test:value:
8498     <!DOCTYPE e [
8499     <!ENTITY ent "&#33;">
8500     ]>
8501     <e/>
8502     @@@test:domTree:
8503     document {
8504     document-type {
8505     general-entity {
8506     node-name: 'ent';
8507     text-content: '!';
8508     }
8509     }
8510     element { }
8511     }
8512     @@XMLTest:
8513     @@@QName: xp.entval.ncr.2.test
8514     @@@DEnt:
8515     @@@@test:value:
8516     <!DOCTYPE e [
8517     <!ENTITY ent "aaaaa&#33;bbbbb">
8518     ]>
8519     <e/>
8520     @@@test:domTree:
8521     document {
8522     document-type {
8523     general-entity {
8524     node-name: 'ent';
8525     text-content: 'aaaaa!bbbbb';
8526     }
8527     }
8528     element { }
8529     }
8530     @@XMLTest:
8531     @@@QName: xp.element.content.reptxt.ncr.1.test
8532     @@@DEnt:
8533     @@@@test:value:
8534     <!DOCTYPE e [
8535     <!ENTITY ent "&#38;#33;">
8536     ]>
8537     <e>&ent;</e>
8538     @@@test:domTree:
8539     document {
8540     document-type { }
8541     element {
8542     general-entity-reference {
8543     node-name: 'ent';
8544     text-content: '!';
8545 wakaba 1.19 is-expanded: true;
8546 wakaba 1.18 }
8547     }
8548     }
8549     @@XMLTest:
8550     @@@QName: xp.element.content.reptxt.ncr.2.test
8551     @@@DEnt:
8552     @@@@test:value:
8553     <!DOCTYPE e [
8554     <!ENTITY ent "aaaaa&#38;#33;bbbbb">
8555     ]>
8556     <e>&ent;</e>
8557     @@@test:domTree:
8558     document {
8559     document-type { }
8560     element {
8561     general-entity-reference {
8562     node-name: 'ent';
8563     text-content: 'aaaaa!bbbbb';
8564 wakaba 1.19 is-expanded: true;
8565 wakaba 1.18 }
8566     }
8567     }
8568     @@XMLTest:
8569     @@@QName: xp.element.content.reptxt.reptxt.ncr.1.test
8570     @@@DEnt:
8571     @@@@test:value:
8572     <!DOCTYPE e [
8573     <!ENTITY ent "&#38;#33;">
8574     <!ENTITY ent2 "&ent;">
8575     ]>
8576     <e>&ent2;</e>
8577     @@@test:domTree:
8578     document {
8579     document-type { }
8580     element {
8581     general-entity-reference {
8582     node-name: 'ent2';
8583     general-entity-reference {
8584     node-name: 'ent';
8585     text-content: '!';
8586 wakaba 1.19 is-expanded: true;
8587 wakaba 1.18 }
8588 wakaba 1.19 is-expanded: true;
8589 wakaba 1.18 }
8590     }
8591     }
8592     @@XMLTest:
8593     @@@QName: xp.element.content.reptxt.reptxt.ncr.2.test
8594     @@@DEnt:
8595     @@@@test:value:
8596     <!DOCTYPE e [
8597     <!ENTITY ent "aa&#38;#33;bb">
8598     <!ENTITY ent2 "&ent;">
8599     ]>
8600     <e>&ent2;</e>
8601     @@@test:domTree:
8602     document {
8603     document-type { }
8604     element {
8605     general-entity-reference {
8606     node-name: 'ent2';
8607     general-entity-reference {
8608     node-name: 'ent';
8609     text-content: 'aa!bb';
8610 wakaba 1.19 is-expanded: true;
8611 wakaba 1.18 }
8612 wakaba 1.19 is-expanded: true;
8613 wakaba 1.18 }
8614     }
8615     }
8616     @@XMLTest:
8617     @@@QName: xp.attval.reptxt.ncr.1.test
8618     @@@DEnt:
8619     @@@@test:value:
8620     <!DOCTYPE e [
8621     <!ENTITY ent "&#38;#33;">
8622     ]>
8623     <e a="&ent;"/>
8624     @@@test:domTree:
8625     document {
8626     document-type { }
8627     element {
8628     attribute {
8629     node-name: 'a';
8630     general-entity-reference {
8631     node-name: 'ent';
8632     text-content: '!';
8633 wakaba 1.19 is-expanded: true;
8634 wakaba 1.18 }
8635     }
8636     }
8637     }
8638     @@XMLTest:
8639     @@@QName: xp.attval.reptxt.ncr.2.test
8640     @@@DEnt:
8641     @@@@test:value:
8642     <!DOCTYPE e [
8643     <!ENTITY ent "aaaaa&#38;#33;bbbbb">
8644     ]>
8645     <e a="&ent;"/>
8646     @@@test:domTree:
8647     document {
8648     document-type { }
8649     element {
8650     attribute {
8651     node-name: 'a';
8652     general-entity-reference {
8653     node-name: 'ent';
8654     text-content: 'aaaaa!bbbbb';
8655 wakaba 1.19 is-expanded: true;
8656 wakaba 1.18 }
8657     }
8658     }
8659     }
8660     @@XMLTest:
8661     @@@QName: xp.attval.reptxt.reptxt.ncr.1.test
8662     @@@DEnt:
8663     @@@@test:value:
8664     <!DOCTYPE e [
8665     <!ENTITY ent "&#38;#33;">
8666     <!ENTITY ent2 "&ent;">
8667     ]>
8668     <e a="&ent2;"/>
8669     @@@test:domTree:
8670     document {
8671     document-type { }
8672     element {
8673     attribute {
8674     node-name: 'a';
8675     general-entity-reference {
8676     node-name: 'ent2';
8677 wakaba 1.19 is-expanded: true;
8678 wakaba 1.18 general-entity-reference {
8679     node-name: 'ent';
8680     text-content: '!';
8681 wakaba 1.19 is-expanded: true;
8682 wakaba 1.18 }
8683     }
8684     }
8685     }
8686     }
8687     @@XMLTest:
8688     @@@QName: xp.attval.reptxt.reptxt.ncr.2.test
8689     @@@DEnt:
8690     @@@@test:value:
8691     <!DOCTYPE e [
8692     <!ENTITY ent "aa&#38;#33;bb">
8693     <!ENTITY ent2 "&ent;">
8694     ]>
8695     <e a="&ent2;"/>
8696     @@@test:domTree:
8697     document {
8698     document-type { }
8699     element {
8700     attribute {
8701     node-name: 'a';
8702     general-entity-reference {
8703     node-name: 'ent2';
8704 wakaba 1.19 is-expanded: true;
8705 wakaba 1.18 general-entity-reference {
8706     node-name: 'ent';
8707     text-content: 'aa!bb';
8708 wakaba 1.19 is-expanded: true;
8709 wakaba 1.18 }
8710     }
8711     }
8712     }
8713     }
8714    
8715     @@XMLTest:
8716     @@@QName: xp.element.content.hcr.1.test
8717     @@@DEnt:
8718     @@@@test:value:
8719     <e>&#x21;</e>
8720     @@@test:domTree:
8721     document {
8722     element {
8723     text-content: '!';
8724     }
8725     }
8726     @@XMLTest:
8727     @@@QName: xp.element.content.hcr.2.test
8728     @@@DEnt:
8729     @@@@test:value:
8730     <e>aaaa&#x21;bbbb</e>
8731     @@@test:domTree:
8732     document {
8733     element {
8734     text-content: 'aaaa!bbbb';
8735     }
8736     }
8737     @@XMLTest:
8738     @@@QName: xp.attrval.hcr.1.test
8739     @@@DEnt:
8740     @@@@test:value:
8741     <e a="&#x21;"/>
8742     @@@test:domTree:
8743     document {
8744     element {
8745     attribute {
8746     node-name: 'a';
8747     text-content: '!';
8748     }
8749     }
8750     }
8751     @@XMLTest:
8752     @@@QName: xp.attrval.hcr.2.test
8753     @@@DEnt:
8754     @@@@test:value:
8755     <e a="aaaaa&#x21;bbbbb"/>
8756     @@@test:domTree:
8757     document {
8758     element {
8759     attribute {
8760     node-name: 'a';
8761     text-content: 'aaaaa!bbbbb';
8762     }
8763     }
8764     }
8765     @@XMLTest:
8766     @@@QName: xp.attrval.hcr.3.test
8767     @@@DEnt:
8768     @@@@test:value:
8769     <e a='&#x21;'/>
8770     @@@test:domTree:
8771     document {
8772     element {
8773     attribute {
8774     node-name: 'a';
8775     text-content: '!';
8776     }
8777     }
8778     }
8779     @@XMLTest:
8780     @@@QName: xp.attrval.hcr.4.test
8781     @@@DEnt:
8782     @@@@test:value:
8783     <e a='aaaaa&#x21;bbbbb'/>
8784     @@@test:domTree:
8785     document {
8786     element {
8787     attribute {
8788     node-name: 'a';
8789     text-content: 'aaaaa!bbbbb';
8790     }
8791     }
8792     }
8793     @@XMLTest:
8794     @@@QName: xp.entval.hcr.1.test
8795     @@@DEnt:
8796     @@@@test:value:
8797     <!DOCTYPE e [
8798     <!ENTITY ent "&#x21;">
8799     ]>
8800     <e/>
8801     @@@test:domTree:
8802     document {
8803     document-type {
8804     general-entity {
8805     node-name: 'ent';
8806     text-content: '!';
8807 wakaba 1.10 }
8808 wakaba 1.9 }
8809 wakaba 1.18 element { }
8810 wakaba 1.9 }
8811     @@XMLTest:
8812 wakaba 1.18 @@@QName: xp.entval.hcr.2.test
8813 wakaba 1.9 @@@DEnt:
8814     @@@@test:value:
8815 wakaba 1.18 <!DOCTYPE e [
8816     <!ENTITY ent "aaaaa&#x21;bbbbb">
8817     ]>
8818     <e/>
8819 wakaba 1.9 @@@test:domTree:
8820     document {
8821 wakaba 1.18 document-type {
8822     general-entity {
8823     node-name: 'ent';
8824     text-content: 'aaaaa!bbbbb';
8825 wakaba 1.9 }
8826     }
8827 wakaba 1.18 element { }
8828 wakaba 1.9 }
8829     @@XMLTest:
8830 wakaba 1.18 @@@QName: xp.element.content.reptxt.hcr.1.test
8831 wakaba 1.9 @@@DEnt:
8832     @@@@test:value:
8833 wakaba 1.18 <!DOCTYPE e [
8834     <!ENTITY ent "&#38;#x21;">
8835 wakaba 1.9 ]>
8836 wakaba 1.18 <e>&ent;</e>
8837 wakaba 1.9 @@@test:domTree:
8838     document {
8839     document-type { }
8840     element {
8841 wakaba 1.18 general-entity-reference {
8842     node-name: 'ent';
8843     text-content: '!';
8844 wakaba 1.19 is-expanded: true;
8845 wakaba 1.9 }
8846     }
8847     }
8848     @@XMLTest:
8849 wakaba 1.18 @@@QName: xp.element.content.reptxt.hcr.2.test
8850 wakaba 1.9 @@@DEnt:
8851     @@@@test:value:
8852 wakaba 1.18 <!DOCTYPE e [
8853     <!ENTITY ent "aaaaa&#38;#x21;bbbbb">
8854 wakaba 1.9 ]>
8855 wakaba 1.18 <e>&ent;</e>
8856 wakaba 1.9 @@@test:domTree:
8857     document {
8858     document-type { }
8859     element {
8860 wakaba 1.18 general-entity-reference {
8861     node-name: 'ent';
8862     text-content: 'aaaaa!bbbbb';
8863 wakaba 1.19 is-expanded: true;
8864 wakaba 1.9 }
8865     }
8866     }
8867     @@XMLTest:
8868 wakaba 1.18 @@@QName: xp.element.content.reptxt.reptxt.hcr.1.test
8869 wakaba 1.9 @@@DEnt:
8870     @@@@test:value:
8871 wakaba 1.18 <!DOCTYPE e [
8872     <!ENTITY ent "&#38;#x21;">
8873     <!ENTITY ent2 "&ent;">
8874     ]>
8875     <e>&ent2;</e>
8876 wakaba 1.9 @@@test:domTree:
8877     document {
8878 wakaba 1.18 document-type { }
8879 wakaba 1.9 element {
8880 wakaba 1.18 general-entity-reference {
8881     node-name: 'ent2';
8882 wakaba 1.19 is-expanded: true;
8883 wakaba 1.18 general-entity-reference {
8884     node-name: 'ent';
8885     text-content: '!';
8886 wakaba 1.19 is-expanded: true;
8887 wakaba 1.18 }
8888 wakaba 1.9 }
8889     }
8890     }
8891     @@XMLTest:
8892 wakaba 1.18 @@@QName: xp.element.content.reptxt.reptxt.hcr.2.test
8893 wakaba 1.9 @@@DEnt:
8894     @@@@test:value:
8895 wakaba 1.18 <!DOCTYPE e [
8896     <!ENTITY ent "aa&#38;#x21;bb">
8897     <!ENTITY ent2 "&ent;">
8898     ]>
8899     <e>&ent2;</e>
8900 wakaba 1.9 @@@test:domTree:
8901     document {
8902 wakaba 1.18 document-type { }
8903 wakaba 1.9 element {
8904 wakaba 1.18 general-entity-reference {
8905     node-name: 'ent2';
8906 wakaba 1.19 is-expanded: true;
8907 wakaba 1.18 general-entity-reference {
8908     node-name: 'ent';
8909 wakaba 1.19 is-expanded: true;
8910 wakaba 1.18 text-content: 'aa!bb';
8911     }
8912 wakaba 1.9 }
8913     }
8914     }
8915     @@XMLTest:
8916 wakaba 1.18 @@@QName: xp.attval.reptxt.hcr.1.test
8917 wakaba 1.9 @@@DEnt:
8918     @@@@test:value:
8919 wakaba 1.18 <!DOCTYPE e [
8920     <!ENTITY ent "&#38;#x21;">
8921     ]>
8922     <e a="&ent;"/>
8923 wakaba 1.9 @@@test:domTree:
8924     document {
8925 wakaba 1.18 document-type { }
8926 wakaba 1.9 element {
8927     attribute {
8928 wakaba 1.18 node-name: 'a';
8929     general-entity-reference {
8930     node-name: 'ent';
8931 wakaba 1.19 is-expanded: true;
8932 wakaba 1.18 text-content: '!';
8933     }
8934 wakaba 1.10 }
8935     }
8936     }
8937     @@XMLTest:
8938 wakaba 1.18 @@@QName: xp.attval.reptxt.hcr.2.test
8939 wakaba 1.10 @@@DEnt:
8940     @@@@test:value:
8941 wakaba 1.18 <!DOCTYPE e [
8942     <!ENTITY ent "aaaaa&#38;#x21;bbbbb">
8943 wakaba 1.10 ]>
8944 wakaba 1.18 <e a="&ent;"/>
8945 wakaba 1.10 @@@test:domTree:
8946     document {
8947     document-type { }
8948     element {
8949     attribute {
8950 wakaba 1.18 node-name: 'a';
8951     general-entity-reference {
8952     node-name: 'ent';
8953 wakaba 1.19 is-expanded: true;
8954 wakaba 1.18 text-content: 'aaaaa!bbbbb';
8955     }
8956 wakaba 1.10 }
8957     }
8958     }
8959     @@XMLTest:
8960 wakaba 1.18 @@@QName: xp.attval.reptxt.reptxt.hcr.1.test
8961 wakaba 1.10 @@@DEnt:
8962     @@@@test:value:
8963 wakaba 1.18 <!DOCTYPE e [
8964     <!ENTITY ent "&#38;#x21;">
8965     <!ENTITY ent2 "&ent;">
8966 wakaba 1.10 ]>
8967 wakaba 1.18 <e a="&ent2;"/>
8968 wakaba 1.10 @@@test:domTree:
8969     document {
8970     document-type { }
8971     element {
8972     attribute {
8973 wakaba 1.18 node-name: 'a';
8974     general-entity-reference {
8975     node-name: 'ent2';
8976 wakaba 1.19 is-expanded: true;
8977 wakaba 1.18 general-entity-reference {
8978     node-name: 'ent';
8979 wakaba 1.19 is-expanded: true;
8980 wakaba 1.18 text-content: '!';
8981     }
8982     }
8983 wakaba 1.10 }
8984     }
8985     }
8986     @@XMLTest:
8987 wakaba 1.18 @@@QName: xp.attval.reptxt.reptxt.hcr.2.test
8988 wakaba 1.10 @@@DEnt:
8989     @@@@test:value:
8990 wakaba 1.18 <!DOCTYPE e [
8991     <!ENTITY ent "aa&#38;#x21;bb">
8992     <!ENTITY ent2 "&ent;">
8993 wakaba 1.10 ]>
8994 wakaba 1.18 <e a="&ent2;"/>
8995 wakaba 1.10 @@@test:domTree:
8996     document {
8997     document-type { }
8998     element {
8999     attribute {
9000 wakaba 1.18 node-name: 'a';
9001     general-entity-reference {
9002     node-name: 'ent2';
9003 wakaba 1.19 is-expanded: true;
9004 wakaba 1.18 general-entity-reference {
9005     node-name: 'ent';
9006 wakaba 1.19 is-expanded: true;
9007 wakaba 1.18 text-content: 'aa!bb';
9008     }
9009     }
9010 wakaba 1.11 }
9011     }
9012     }
9013    
9014     @@XMLTest:
9015 wakaba 1.18 @@@QName: xp.element.content.ncr.legal.char.1.0.1.test
9016     @@@DEnt:
9017     @@@@test:value:
9018     <?xml version="1.0"?>
9019     <e>&#0;</e>
9020     @@@c:erred: <[[xp|wf-legal-character]]> { (2, 4)..(2, 7); }
9021     @@XMLTest:
9022     @@@QName: xp.element.content.ncr.legal.char.1.1.1.test
9023     @@@DEnt:
9024     @@@@test:value:
9025     <?xml version="1.1"?>
9026     <e>&#0;</e>
9027     @@@c:erred: <[[xp|wf-legal-character]]> { (2, 4)..(2, 7); }
9028     @@XMLTest:
9029     @@@QName: xp.element.content.ncr.legal.char.1.0.2.test
9030     @@@DEnt:
9031     @@@@test:value:
9032     <?xml version="1.0"?>
9033     <e>&#1;</e>
9034     @@@c:erred: <[[xp|wf-legal-character]]> { (2, 4)..(2, 7); }
9035     @@XMLTest:
9036     @@@QName: xp.element.content.ncr.legal.char.1.1.2.test
9037 wakaba 1.11 @@@DEnt:
9038     @@@@test:value:
9039 wakaba 1.18 <?xml version="1.1"?>
9040     <e>&#1;</e>
9041 wakaba 1.11 @@@test:domTree:
9042     document {
9043 wakaba 1.18 xml-version: '1.1';
9044 wakaba 1.11 element {
9045 wakaba 1.18 text-content: U+0001;
9046 wakaba 1.11 }
9047     }
9048     @@XMLTest:
9049 wakaba 1.18 @@@QName: xp.element.content.hcr.legal.char.1.0.1.test
9050     @@@DEnt:
9051     @@@@test:value:
9052     <?xml version="1.0"?>
9053     <e>&#x0;</e>
9054     @@@c:erred: <[[xp|wf-legal-character]]> { (2, 4)..(2, 8); }
9055     @@XMLTest:
9056     @@@QName: xp.element.content.hcr.legal.char.1.1.1.test
9057     @@@DEnt:
9058     @@@@test:value:
9059     <?xml version="1.1"?>
9060     <e>&#x0;</e>
9061     @@@c:erred: <[[xp|wf-legal-character]]> { (2, 4)..(2, 8); }
9062     @@XMLTest:
9063     @@@QName: xp.element.content.hcr.legal.char.1.0.2.test
9064 wakaba 1.11 @@@DEnt:
9065     @@@@test:value:
9066 wakaba 1.18 <?xml version="1.0"?>
9067     <e>&#x1;</e>
9068     @@@c:erred: <[[xp|wf-legal-character]]> { (2, 4)..(2, 8); }
9069 wakaba 1.11 @@XMLTest:
9070 wakaba 1.18 @@@QName: xp.element.content.hcr.legal.char.1.1.2.test
9071 wakaba 1.11 @@@DEnt:
9072     @@@@test:value:
9073 wakaba 1.18 <?xml version="1.1"?>
9074     <e>&#x1;</e>
9075 wakaba 1.11 @@@test:domTree:
9076     document {
9077 wakaba 1.18 xml-version: '1.1';
9078 wakaba 1.11 element {
9079 wakaba 1.18 text-content: U+0001;
9080 wakaba 1.6 }
9081     }
9082    
9083 wakaba 1.19 @@XMLTest:
9084     @@@QName: xp.element.content.ger.entity.declared.nodtd.1.test
9085     @@@DEnt:
9086     @@@@test:value:
9087     <p>&entity;</p>
9088     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 4)..(1, 11); }
9089     @@XMLTest:
9090     @@@QName: xp.element.content.ger.entity.declared.nodtd.2.test
9091     @@@DEnt:
9092     @@@@test:value:
9093     <?xml version="1.0" standalone="yes"?>
9094     <p>&entity;</p>
9095     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 4)..(2, 11); }
9096     @@XMLTest:
9097     @@@QName: xp.element.content.ger.entity.declared.nodtd.3.test
9098     @@@DEnt:
9099     @@@@test:value:
9100     <?xml version="1.0" standalone="no"?>
9101     <p>&entity;</p>
9102     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 4)..(2, 11); }
9103     @@XMLTest:
9104     @@@QName: xp.element.content.ger.entity.declared.nodtd.-1.test
9105     @@@DEnt:
9106     @@@@test:value:
9107     <p>&lt;&gt;&amp;&quot;&apos;</p>
9108     @@@test:domTree:
9109     document {
9110     element {
9111     text-content: '<>&"' U+0027;
9112     }
9113     }
9114     @@XMLTest:
9115     @@@QName: xp.element.content.ger.entity.declared.nopref.1.test
9116     @@@DEnt:
9117     @@@@test:value:
9118     <!DOCTYPE p []>
9119     <p>&entity;</p>
9120     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 4)..(2, 11); }
9121     @@XMLTest:
9122     @@@QName: xp.element.content.ger.entity.declared.nopref.2.test
9123     @@@DEnt:
9124     @@@@test:value:
9125     <!DOCTYPE p [
9126     <!ENTITY other "aa">
9127     <!ENTITY % another "aa">
9128     ]>
9129     <p>&entity;</p>
9130     @@@c:erred: <[[xp|wf-entity-declared]]> { (5, 4)..(5, 11); }
9131     @@XMLTest:
9132     @@@QName: xp.element.content.ger.entity.declared.nopref.3.test
9133     @@@DEnt:
9134     @@@@test:value:
9135     <?xml version="1.0" standalone="yes"?>
9136     <!DOCTYPE p []>
9137     <p>&entity;</p>
9138     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 4)..(3, 11); }
9139     @@XMLTest:
9140     @@@QName: xp.element.content.ger.entity.declared.nopref.4.test
9141     @@@DEnt:
9142     @@@@test:value:
9143     <?xml version="1.0" standalone="no"?>
9144     <!DOCTYPE p []>
9145     <p>&entity;</p>
9146     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 4)..(3, 11); }
9147     @@XMLTest:
9148     @@@QName: xp.element.content.ger.entity.declared.nopref.5.test
9149     @@@DEnt:
9150     @@@@test:value:
9151     <?xml version="1.0" standalone="yes"?>
9152     <!DOCTYPE p [
9153     <!ENTITY other "aa">
9154     <!ENTITY % another "aa">
9155     ]>
9156     <p>&entity;</p>
9157     @@@c:erred: <[[xp|wf-entity-declared]]> { (6, 4)..(6, 11); }
9158     @@XMLTest:
9159     @@@QName: xp.element.content.ger.entity.declared.nopref.6.test
9160     @@@DEnt:
9161     @@@@test:value:
9162     <?xml version="1.0" standalone="no"?>
9163     <!DOCTYPE p [
9164     <!ENTITY other "aa">
9165     <!ENTITY % another "aa">
9166     ]>
9167     <p>&entity;</p>
9168     @@@c:erred: <[[xp|wf-entity-declared]]> { (6, 4)..(6, 11); }
9169     @@XMLTest:
9170     @@@QName: xp.element.content.ger.entity.declared.nopref.-1.test
9171     @@@DEnt:
9172     @@@@test:value:
9173     <!DOCTYPE p [
9174     <!ENTITY entity "value">
9175     ]>
9176     <p>&entity;</p>
9177     @@@test:domTree:
9178     document {
9179     document-type {
9180     general-entity {
9181     node-name: 'entity';
9182     text-content: 'value';
9183     }
9184     }
9185     element {
9186 wakaba 1.20 general-entity-reference {
9187 wakaba 1.19 node-name: 'entity';
9188 wakaba 1.20 is-expanded: true;
9189 wakaba 1.19 text-content: 'value';
9190     }
9191     }
9192     }
9193     @@XMLTest:
9194     @@@QName: xp.element.content.ger.entity.declared.nopref.-2.test
9195     @@@DEnt:
9196     @@@@test:value:
9197     <!DOCTYPE p [
9198     <!ENTITY entity "value">
9199     <!ENTITY another SYSTEM "another">
9200     ]>
9201     <p>&entity;</p>
9202     @@@test:domTree:
9203     document {
9204     document-type {
9205     general-entity {
9206     node-name: 'entity';
9207     text-content: 'value';
9208     }
9209 wakaba 1.20 general-entity {
9210     node-name: 'another';
9211     public-id: null;
9212     system-id: 'another';
9213     }
9214 wakaba 1.19 }
9215     element {
9216 wakaba 1.20 general-entity-reference {
9217 wakaba 1.19 node-name: 'entity';
9218 wakaba 1.20 is-expanded: true;
9219 wakaba 1.19 text-content: 'value';
9220     }
9221     }
9222     }
9223     @@XMLTest:
9224     @@@QName: xp.element.content.ger.entity.declared.standalone.1.test
9225     @@@DEnt:
9226     @@@@test:value:
9227     <?xml version="1.0" standalone="yes"?>
9228     <p>&entity;</p>
9229     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 4)..(2, 11); }
9230     @@XMLTest:
9231     @@@QName: xp.element.content.ger.entity.declared.standalone.2.test
9232     @@@DEnt:
9233     @@@@test:value:
9234     <?xml version="1.0" standalone="yes"?>
9235     <!DOCTYPE p []>
9236     <p>&entity;</p>
9237     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 4)..(3, 11); }
9238     @@XMLTest:
9239     @@@QName: xp.element.content.ger.entity.declared.standalone.3.test
9240     @@@DEnt:
9241     @@@@test:value:
9242     <?xml version="1.0" standalone="yes"?>
9243     <!DOCTYPE p [
9244     <!ENTITY % para "<!-- -->">
9245     %para;
9246     ]>
9247     <p>&entity;</p>
9248     @@@c:erred: <[[xp|wf-entity-declared]]> { (6, 4)..(6, 11); }
9249     @@XMLTest:
9250     @@@QName: xp.element.content.ger.entity.declared.standalone.-1.test
9251     @@@DEnt:
9252     @@@@test:value:
9253     <?xml version="1.0" standalone="no"?>
9254     <!DOCTYPE p [
9255     <!ENTITY % para "<!-- -->">
9256     %para;
9257     ]>
9258     <p>&entity;</p>
9259     @@@test:domTree:
9260     document {
9261     document-type { }
9262     element {
9263     general-entity-reference {
9264     is-expanded: false;
9265     }
9266     }
9267     }
9268     @@XMLTest:
9269     @@@QName: xp.element.content.ger.entity.declared.standalone.-2.test
9270     @@@DEnt:
9271     @@@@test:value:
9272     <!DOCTYPE p [
9273     <!ENTITY % para "<!-- -->">
9274     %para;
9275     ]>
9276     <p>&entity;</p>
9277     @@@test:domTree:
9278     document {
9279     document-type { }
9280     element {
9281     general-entity-reference {
9282     is-expanded: false;
9283     }
9284     }
9285     }
9286     @@XMLTest:
9287     @@@QName: xp.element.content.ger.entity.declared.standalone.4.test
9288     @@@DEnt:
9289     @@@@test:value:
9290     <?xml version="1.0" standalone="yes"?>
9291     <!DOCTYPE p [
9292     <!ENTITY % para SYSTEM "para">
9293     %para;
9294     ]>
9295     <p>&entity;</p>
9296     @@@c:erred: <[[xp|wf-entity-declared]]> { (6, 4)..(6, 11); }
9297     @@XMLTest:
9298     @@@QName: xp.element.content.ger.entity.declared.standalone.-3.test
9299     @@@DEnt:
9300     @@@@test:value:
9301     <?xml version="1.0" standalone="no"?>
9302     <!DOCTYPE p [
9303     <!ENTITY % para SYSTEM "para">
9304     %para;
9305     ]>
9306     <p>&entity;</p>
9307     @@@test:domTree:
9308     document {
9309     document-type { }
9310     element {
9311     general-entity-reference {
9312     is-expanded: false;
9313     }
9314     }
9315     }
9316     @@XMLTest:
9317     @@@QName: xp.element.content.ger.entity.declared.standalone.-4.test
9318     @@@DEnt:
9319     @@@@test:value:
9320     <!DOCTYPE p [
9321     <!ENTITY % para SYSTEM "para">
9322     %para;
9323     ]>
9324     <p>&entity;</p>
9325     @@@test:domTree:
9326     document {
9327     document-type { }
9328     element {
9329     general-entity-reference {
9330     is-expanded: false;
9331     }
9332     }
9333     }
9334     @@XMLTest:
9335     @@@QName: xp.element.content.ger.entity.declared.standalone.5.test
9336     @@@DEnt:
9337     @@@@test:value:
9338     <?xml version="1.0" standalone="yes"?>
9339     <!DOCTYPE p SYSTEM "dtd">
9340     <p>&entity;</p>
9341     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 4)..(3, 11); }
9342     @@XMLTest:
9343     @@@QName: xp.element.content.ger.entity.declared.standalone.-5.test
9344     @@@DEnt:
9345     @@@@test:value:
9346     <?xml version="1.0" standalone="no"?>
9347     <!DOCTYPE p SYSTEM "dtd">
9348     <p>&entity;</p>
9349     @@@test:domTree:
9350     document {
9351     document-type { }
9352     element {
9353     general-entity-reference {
9354     is-expanded: false;
9355     }
9356     }
9357     }
9358     @@XMLTest:
9359     @@@QName: xp.element.content.ger.entity.declared.standalone.-6.test
9360     @@@DEnt:
9361     @@@@test:value:
9362     <!DOCTYPE p SYSTEM "dtd">
9363     <p>&entity;</p>
9364     @@@test:domTree:
9365     document {
9366     document-type { }
9367     element {
9368     general-entity-reference {
9369     is-expanded: false;
9370     }
9371     }
9372     }
9373    
9374 wakaba 1.20 @@XMLTest:
9375     @@@QName: xp.reptxt.element.content.ger.entity.declared.nopref.1.test
9376     @@@DEnt:
9377     @@@@test:value:
9378     <!DOCTYPE p [
9379     <!ENTITY c "&entity;">
9380     ]>
9381     <p>&c;</p>
9382     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
9383     @@XMLTest:
9384     @@@QName: xp.reptxt.element.content.ger.entity.declared.nopref.2.test
9385     @@@DEnt:
9386     @@@@test:value:
9387     <!DOCTYPE p [
9388     <!ENTITY other "aa">
9389     <!ENTITY % another "aa">
9390     <!ENTITY c "&entity;">
9391     ]>
9392     <p>&c;</p>
9393     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
9394     @@XMLTest:
9395     @@@QName: xp.reptxt.element.content.ger.entity.declared.nopref.3.test
9396     @@@DEnt:
9397     @@@@test:value:
9398     <?xml version="1.0" standalone="yes"?>
9399     <!DOCTYPE p [
9400     <!ENTITY c "&entity;">
9401     ]>
9402     <p>&c;</p>
9403     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
9404     @@XMLTest:
9405     @@@QName: xp.reptxt.element.content.ger.entity.declared.nopref.4.test
9406     @@@DEnt:
9407     @@@@test:value:
9408     <?xml version="1.0" standalone="no"?>
9409     <!DOCTYPE p [
9410     <!ENTITY c "&entity;">
9411     ]>
9412     <p>&c;</p>
9413     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
9414     @@XMLTest:
9415     @@@QName: xp.reptxt.element.content.ger.entity.declared.nopref.5.test
9416     @@@DEnt:
9417     @@@@test:value:
9418     <?xml version="1.0" standalone="yes"?>
9419     <!DOCTYPE p [
9420     <!ENTITY other "aa">
9421     <!ENTITY % another "aa">
9422     <!ENTITY c "&entity;">
9423     ]>
9424     <p>&c;</p>
9425     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
9426     @@XMLTest:
9427     @@@QName: xp.reptxt.element.content.ger.entity.declared.nopref.6.test
9428     @@@DEnt:
9429     @@@@test:value:
9430     <?xml version="1.0" standalone="no"?>
9431     <!DOCTYPE p [
9432     <!ENTITY other "aa">
9433     <!ENTITY % another "aa">
9434     <!ENTITY c "&entity;">
9435     ]>
9436     <p>&c;</p>
9437     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
9438     @@XMLTest:
9439     @@@QName: xp.reptxt.element.content.ger.entity.declared.nopref.-1.test
9440     @@@DEnt:
9441     @@@@test:value:
9442     <!DOCTYPE p [
9443     <!ENTITY entity "value">
9444     <!ENTITY c "&entity;">
9445     ]>
9446     <p>&c;</p>
9447     @@@test:domTree:
9448     document {
9449     document-type {
9450     general-entity {
9451     node-name: 'entity';
9452     text-content: 'value';
9453     }
9454     general-entity {
9455     node-name: 'c';
9456     general-entity-reference {
9457     node-name: 'entity';
9458     text-content: 'value';
9459     }
9460     }
9461     }
9462     element {
9463     general-entity-reference {
9464     node-name: 'c';
9465     general-entity-reference {
9466     node-name: 'entity';
9467     text-content: 'value';
9468     }
9469     }
9470     }
9471     }
9472     @@XMLTest:
9473     @@@QName: xp.reptxt.element.content.ger.entity.declared.nopref.-2.test
9474     @@@DEnt:
9475     @@@@test:value:
9476     <!DOCTYPE p [
9477     <!ENTITY entity "value">
9478     <!ENTITY another SYSTEM "another">
9479     <!ENTITY c "&entity;">
9480     ]>
9481     <p>&c;</p>
9482     @@@test:domTree:
9483     document {
9484     document-type {
9485     general-entity {
9486     node-name: 'entity';
9487     text-content: 'value';
9488     }
9489     general-entity {
9490     node-name: 'c';
9491     general-entity-reference {
9492     node-name: 'entity';
9493 wakaba 1.23 is-expanded: true;
9494 wakaba 1.20 text-content: 'value';
9495     }
9496     }
9497     general-entity {
9498     node-name: 'another';
9499     public-id: null;
9500     system-id: 'another';
9501     has-replacement-tree: false;
9502     }
9503     }
9504     element {
9505     general-entity-reference {
9506     node-name: 'c';
9507 wakaba 1.23 is-expanded: true;
9508 wakaba 1.20 general-entity-reference {
9509     node-name: 'entity';
9510 wakaba 1.23 is-expanded: true;
9511 wakaba 1.20 text-content: 'value';
9512     }
9513     }
9514     }
9515     }
9516     @@XMLTest:
9517     @@@QName: xp.reptxt.element.content.ger.entity.declared.standalone.2.test
9518     @@@DEnt:
9519     @@@@test:value:
9520     <?xml version="1.0" standalone="yes"?>
9521     <!DOCTYPE p [
9522     <!ENTITY c "&entity;">
9523     ]>
9524     <p>&c;</p>
9525     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
9526     @@XMLTest:
9527     @@@QName: xp.reptxt.element.content.ger.entity.declared.standalone.3.test
9528     @@@DEnt:
9529     @@@@test:value:
9530     <?xml version="1.0" standalone="yes"?>
9531     <!DOCTYPE p [
9532     <!ENTITY % para "<!-- -->">
9533     %para;
9534     <!ENTITY c "&entity;">
9535     ]>
9536     <p>&c;</p>
9537     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
9538     @@XMLTest:
9539     @@@QName: xp.reptxt.element.content.ger.entity.declared.standalone.-1.test
9540     @@@DEnt:
9541     @@@@test:value:
9542     <?xml version="1.0" standalone="no"?>
9543     <!DOCTYPE p [
9544     <!ENTITY c "&entity;">
9545     <!ENTITY % para "<!-- -->">
9546     %para;
9547     ]>
9548     <p>&c;</p>
9549     @@@test:domTree:
9550     document {
9551     document-type {
9552     general-entity {
9553     node-name: 'c';
9554     general-entity-reference {
9555     node-name: 'entity';
9556     is-expanded: false;
9557     }
9558     }
9559     }
9560     element {
9561     general-entity-reference {
9562     node-name: 'c';
9563     general-entity-reference {
9564     node-name: 'entity';
9565     is-expanded: false;
9566     }
9567     }
9568     }
9569     }
9570     @@XMLTest:
9571     @@@QName:
9572     xp.reptxt.element.content.ger.entity.declared.standalone.-1.2.test
9573     @@@DEnt:
9574     @@@@test:value:
9575     <?xml version="1.0" standalone="no"?>
9576     <!DOCTYPE p [
9577     <!ENTITY % para "<!-- -->">
9578     %para;
9579     <!ENTITY c "&entity;">
9580     ]>
9581     <p>&c;</p>
9582     @@@test:domTree:
9583     document {
9584     document-type { }
9585     element {
9586     general-entity-reference {
9587     node-name: 'c';
9588     is-expanded: false;
9589     }
9590     }
9591     }
9592     @@XMLTest:
9593     @@@QName: xp.reptxt.element.content.ger.entity.declared.standalone.-2.test
9594     @@@DEnt:
9595     @@@@test:value:
9596     <!DOCTYPE p [
9597     <!ENTITY c "&entity;">
9598     <!ENTITY % para "<!-- -->">
9599     %para;
9600     ]>
9601     <p>&c;</p>
9602     @@@test:domTree:
9603     document {
9604     document-type { }
9605     element {
9606     general-entity-reference {
9607     node-name: 'c';
9608     is-expanded: true;
9609     general-entity-reference {
9610     node-name: 'entity';
9611     is-expanded: false;
9612     }
9613     }
9614     }
9615     }
9616     @@XMLTest:
9617     @@@QName:
9618     xp.reptxt.element.content.ger.entity.declared.standalone.-2.2.test
9619     @@@DEnt:
9620     @@@@test:value:
9621     <!DOCTYPE p [
9622     <!ENTITY % para "<!-- -->">
9623     %para;
9624     <!ENTITY c "&entity;">
9625     ]>
9626     <p>&c;</p>
9627     @@@test:domTree:
9628     document {
9629     document-type { }
9630     element {
9631     general-entity-reference {
9632     node-name: 'c';
9633     is-expanded: false;
9634     }
9635     }
9636     }
9637     @@XMLTest:
9638     @@@QName: xp.reptxt.element.content.ger.entity.declared.standalone.4.test
9639     @@@DEnt:
9640     @@@@test:value:
9641     <?xml version="1.0" standalone="yes"?>
9642     <!DOCTYPE p [
9643     <!ENTITY % para SYSTEM "para">
9644     %para;
9645     <!ENTITY c "&entity;">
9646     ]>
9647     <p>&c;</p>
9648     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
9649     @@XMLTest:
9650     @@@QName: xp.reptxt.element.content.ger.entity.declared.standalone.-3.test
9651     @@@DEnt:
9652     @@@@test:value:
9653     <?xml version="1.0" standalone="no"?>
9654     <!DOCTYPE p [
9655     <!ENTITY c "&entity;">
9656     <!ENTITY % para SYSTEM "para">
9657     %para;
9658     ]>
9659     <p>&c;</p>
9660     @@@test:domTree:
9661     document {
9662     document-type { }
9663     element {
9664     general-entity-reference {
9665     node-name: 'c';
9666     is-expanded: true;
9667     general-entity-reference {
9668     node-name: 'entity';
9669     is-expanded: false;
9670     }
9671     }
9672     }
9673     }
9674     @@XMLTest:
9675     @@@QName:
9676     xp.reptxt.element.content.ger.entity.declared.standalone.-3.2.test
9677     @@@DEnt:
9678     @@@@test:value:
9679     <?xml version="1.0" standalone="no"?>
9680     <!DOCTYPE p [
9681     <!ENTITY % para SYSTEM "para">
9682     %para;
9683     <!ENTITY c "&entity;">
9684     ]>
9685     <p>&c;</p>
9686     @@@test:domTree:
9687     document {
9688     document-type { }
9689     element {
9690     general-entity-reference {
9691     node-name: 'c';
9692     is-expanded: false;
9693     }
9694     }
9695     }
9696     @@XMLTest:
9697     @@@QName: xp.reptxt.element.content.ger.entity.declared.standalone.-4.test
9698     @@@DEnt:
9699     @@@@test:value:
9700     <!DOCTYPE p [
9701     <!ENTITY c "&entity;">
9702     <!ENTITY % para SYSTEM "para">
9703     %para;
9704     ]>
9705     <p>&c;</p>
9706     @@@test:domTree:
9707     document {
9708     document-type { }
9709     element {
9710     general-entity-reference {
9711     node-name: 'c';
9712     is-expanded: true;
9713     general-entity-reference {
9714     node-name: 'entity';
9715     is-expanded: false;
9716     }
9717     }
9718     }
9719     }
9720     @@XMLTest:
9721     @@@QName:
9722     xp.reptxt.element.content.ger.entity.declared.standalone.-4.2.test
9723     @@@DEnt:
9724     @@@@test:value:
9725     <!DOCTYPE p [
9726     <!ENTITY % para SYSTEM "para">
9727     %para;
9728     <!ENTITY c "&entity;">
9729     ]>
9730     <p>&c;</p>
9731     @@@test:domTree:
9732     document {
9733     document-type { }
9734     element {
9735     general-entity-reference {
9736     node-name: 'c';
9737     is-expanded: false;
9738     }
9739     }
9740     }
9741     @@XMLTest:
9742     @@@QName: xp.reptxt.element.content.ger.entity.declared.standalone.5.test
9743     @@@DEnt:
9744     @@@@test:value:
9745     <?xml version="1.0" standalone="yes"?>
9746     <!DOCTYPE p SYSTEM "dtd" [
9747     <!ENTITY c "&entity;">
9748     ]>
9749     <p>&c;</p>
9750     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
9751     @@XMLTest:
9752     @@@QName: xp.reptxt.element.content.ger.entity.declared.standalone.-5.test
9753     @@@DEnt:
9754     @@@@test:value:
9755     <?xml version="1.0" standalone="no"?>
9756     <!DOCTYPE p SYSTEM "dtd" [
9757     <!ENTITY c "&entity;">
9758     ]>
9759     <p>&c;</p>
9760     @@@test:domTree:
9761     document {
9762     document-type { }
9763     element {
9764     general-entity-reference {
9765     node-name: 'c';
9766     is-expanded: true;
9767     general-entity-reference {
9768     node-name: 'entity';
9769     is-expanded: false;
9770     }
9771     }
9772     }
9773     }
9774     @@XMLTest:
9775     @@@QName: xp.reptxt.element.content.ger.entity.declared.standalone.-6.test
9776     @@@DEnt:
9777     @@@@test:value:
9778     <!DOCTYPE p SYSTEM "dtd" [<!ENTITY c "&entity;">]>
9779     <p>&c;</p>
9780     @@@test:domTree:
9781     document {
9782     document-type { }
9783     element {
9784     general-entity-reference {
9785     node-name: 'c';
9786     is-expanded: true;
9787     general-entity-reference {
9788     node-name: 'entity';
9789     is-expanded: false;
9790     }
9791     }
9792     }
9793     }
9794    
9795     @@XMLTest:
9796     @@@QName: xp.attval.ger.entity.declared.nodtd.1.test
9797     @@@DEnt:
9798     @@@@test:value:
9799     <p a="&entity;"/>
9800     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 7)..(1, 14); }
9801     @@XMLTest:
9802     @@@QName: xp.attval.ger.entity.declared.nodtd.2.test
9803     @@@DEnt:
9804     @@@@test:value:
9805     <?xml version="1.0" standalone="yes"?>
9806     <p a="&entity;"/>
9807     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 7)..(2, 14); }
9808     @@XMLTest:
9809     @@@QName: xp.attval.ger.entity.declared.nodtd.3.test
9810     @@@DEnt:
9811     @@@@test:value:
9812     <?xml version="1.0" standalone="no"?>
9813     <p a="&entity;"/>
9814     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 7)..(2, 14); }
9815     @@XMLTest:
9816     @@@QName: xp.attval.ger.entity.declared.nodtd.-1.test
9817     @@@DEnt:
9818     @@@@test:value:
9819     <p a="&lt;&gt;&amp;&quot;&apos;"/>
9820     @@@test:domTree:
9821     document {
9822     element {
9823     attribute {
9824     node-name: 'a';
9825     text-content: '<>&"' U+0027;
9826     }
9827     }
9828     }
9829     @@XMLTest:
9830     @@@QName: xp.attval.ger.entity.declared.nopref.1.test
9831     @@@DEnt:
9832     @@@@test:value:
9833     <!DOCTYPE p []>
9834     <p a="&entity;"/>
9835     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 7)..(2, 14); }
9836     @@XMLTest:
9837     @@@QName: xp.attval.ger.entity.declared.nopref.2.test
9838     @@@DEnt:
9839     @@@@test:value:
9840     <!DOCTYPE p [
9841     <!ENTITY other "aa">
9842     <!ENTITY % another "aa">
9843     ]>
9844     <p a="&entity;"/>
9845     @@@c:erred: <[[xp|wf-entity-declared]]> { (5, 7)..(5, 14); }
9846     @@XMLTest:
9847     @@@QName: xp.attval.ger.entity.declared.nopref.3.test
9848     @@@DEnt:
9849     @@@@test:value:
9850     <?xml version="1.0" standalone="yes"?>
9851     <!DOCTYPE p []>
9852     <p a="&entity;"/>
9853     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 7)..(3, 14); }
9854     @@XMLTest:
9855     @@@QName: xp.attval.ger.entity.declared.nopref.4.test
9856     @@@DEnt:
9857     @@@@test:value:
9858     <?xml version="1.0" standalone="no"?>
9859     <!DOCTYPE p []>
9860     <p a="&entity;"/>
9861     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 7)..(3, 14); }
9862     @@XMLTest:
9863     @@@QName: xp.attval.ger.entity.declared.nopref.5.test
9864     @@@DEnt:
9865     @@@@test:value:
9866     <?xml version="1.0" standalone="yes"?>
9867     <!DOCTYPE p [
9868     <!ENTITY other "aa">
9869     <!ENTITY % another "aa">
9870     ]>
9871     <p a="&entity;"/>
9872     @@@c:erred: <[[xp|wf-entity-declared]]> { (6, 7)..(6, 14); }
9873     @@XMLTest:
9874     @@@QName: xp.attval.ger.entity.declared.nopref.6.test
9875     @@@DEnt:
9876     @@@@test:value:
9877     <?xml version="1.0" standalone="no"?>
9878     <!DOCTYPE p [
9879     <!ENTITY other "aa">
9880     <!ENTITY % another "aa">
9881     ]>
9882     <p a="&entity;"/>
9883     @@@c:erred: <[[xp|wf-entity-declared]]> { (6, 7)..(6, 14); }
9884     @@XMLTest:
9885     @@@QName: xp.attval.ger.entity.declared.nopref.-1.test
9886     @@@DEnt:
9887     @@@@test:value:
9888     <!DOCTYPE p [
9889     <!ENTITY entity "value">
9890     ]>
9891     <p a="&entity;"/>
9892     @@@test:domTree:
9893     document {
9894     document-type {
9895     general-entity {
9896     node-name: 'entity';
9897     text-content: 'value';
9898     }
9899     }
9900     element {
9901     attribute {
9902     node-name: 'a';
9903     general-entity-reference {
9904     node-name: 'entity';
9905     is-expanded: true;
9906     text-content: 'value';
9907     }
9908     }
9909     }
9910     }
9911     @@XMLTest:
9912     @@@QName: xp.attval.ger.entity.declared.nopref.-2.test
9913     @@@DEnt:
9914     @@@@test:value:
9915     <!DOCTYPE p [
9916     <!ENTITY entity "value">
9917     <!ENTITY another SYSTEM "another">
9918     ]>
9919     <p a="&entity;"/>
9920     @@@test:domTree:
9921     document {
9922     document-type {
9923     general-entity {
9924     node-name: 'entity';
9925     text-content: 'value';
9926     has-replacement-tree: true;
9927     }
9928     general-entity {
9929     node-name: 'another';
9930     public-id: null;
9931     system-id: 'another';
9932     has-replacement-tree: false;
9933     }
9934     }
9935     element {
9936     attribute {
9937     node-name: 'a';
9938     general-entity-reference {
9939     node-name: 'entity';
9940     is-expanded: true;
9941     text-content: 'value';
9942     }
9943     }
9944     }
9945     }
9946     @@XMLTest:
9947     @@@QName: xp.attval.ger.entity.declared.standalone.1.test
9948     @@@DEnt:
9949     @@@@test:value:
9950     <?xml version="1.0" standalone="yes"?>
9951     <p a="&entity;"/>
9952     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 7)..(2, 14); }
9953     @@XMLTest:
9954     @@@QName: xp.attval.ger.entity.declared.standalone.2.test
9955     @@@DEnt:
9956     @@@@test:value:
9957     <?xml version="1.0" standalone="yes"?>
9958     <!DOCTYPE p []>
9959     <p a="&entity;"/>
9960     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 7)..(3, 14); }
9961     @@XMLTest:
9962     @@@QName: xp.attval.ger.entity.declared.standalone.3.test
9963     @@@DEnt:
9964     @@@@test:value:
9965     <?xml version="1.0" standalone="yes"?>
9966     <!DOCTYPE p [
9967     <!ENTITY % para "<!-- -->">
9968     %para;
9969     ]>
9970     <p a="&entity;"/>
9971     @@@c:erred: <[[xp|wf-entity-declared]]> { (6, 7)..(6, 14); }
9972     @@XMLTest:
9973     @@@QName: xp.attval.ger.entity.declared.standalone.-1.test
9974     @@@DEnt:
9975     @@@@test:value:
9976     <?xml version="1.0" standalone="no"?>
9977     <!DOCTYPE p [
9978     <!ENTITY % para "<!-- -->">
9979     %para;
9980     ]>
9981     <p a="&entity;"/>
9982     @@@test:domTree:
9983     document {
9984     document-type { }
9985     element {
9986     attribute {
9987     node-name: 'a';
9988     general-entity-reference {
9989     is-expanded: false;
9990     }
9991     }
9992     }
9993     }
9994     @@XMLTest:
9995     @@@QName: xp.attval.ger.entity.declared.standalone.-2.test
9996     @@@DEnt:
9997     @@@@test:value:
9998     <!DOCTYPE p [
9999     <!ENTITY % para "<!-- -->">
10000     %para;
10001     ]>
10002     <p a="&entity;"/>
10003     @@@test:domTree:
10004     document {
10005     document-type { }
10006     element {
10007     attribute {
10008     node-name: 'a';
10009     general-entity-reference {
10010     is-expanded: false;
10011     }
10012     }
10013     }
10014     }
10015     @@XMLTest:
10016     @@@QName: xp.attval.ger.entity.declared.standalone.4.test
10017     @@@DEnt:
10018     @@@@test:value:
10019     <?xml version="1.0" standalone="yes"?>
10020     <!DOCTYPE p [
10021     <!ENTITY % para SYSTEM "para">
10022     %para;
10023     ]>
10024     <p a="&entity;"/>
10025     @@@c:erred: <[[xp|wf-entity-declared]]> { (6, 7)..(6, 14); }
10026     @@XMLTest:
10027     @@@QName: xp.attval.ger.entity.declared.standalone.-3.test
10028     @@@DEnt:
10029     @@@@test:value:
10030     <?xml version="1.0" standalone="no"?>
10031     <!DOCTYPE p [
10032     <!ENTITY % para SYSTEM "para">
10033     %para;
10034     ]>
10035     <p a="&entity;"/>
10036     @@@test:domTree:
10037     document {
10038     document-type { }
10039     element {
10040     attribute {
10041     node-name: 'a';
10042     general-entity-reference {
10043     is-expanded: false;
10044     }
10045     }
10046     }
10047     }
10048     @@XMLTest:
10049     @@@QName: xp.attval.ger.entity.declared.standalone.-4.test
10050     @@@DEnt:
10051     @@@@test:value:
10052     <!DOCTYPE p [
10053     <!ENTITY % para SYSTEM "para">
10054     %para;
10055     ]>
10056     <p a="&entity;"/>
10057     @@@test:domTree:
10058     document {
10059     document-type { }
10060     element {
10061     attribute {
10062     node-name: 'a';
10063     general-entity-reference {
10064     is-expanded: false;
10065     }
10066     }
10067     }
10068     }
10069     @@XMLTest:
10070     @@@QName: xp.attval.ger.entity.declared.standalone.5.test
10071     @@@DEnt:
10072     @@@@test:value:
10073     <?xml version="1.0" standalone="yes"?>
10074     <!DOCTYPE p SYSTEM "dtd">
10075     <p a="&entity;"/>
10076     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 7)..(3, 14); }
10077     @@XMLTest:
10078     @@@QName: xp.attval.ger.entity.declared.standalone.-5.test
10079     @@@DEnt:
10080     @@@@test:value:
10081     <?xml version="1.0" standalone="no"?>
10082     <!DOCTYPE p SYSTEM "dtd">
10083     <p a="&entity;"/>
10084     @@@test:domTree:
10085     document {
10086     document-type { }
10087     element {
10088     attribute {
10089     node-name: 'a';
10090     general-entity-reference {
10091     is-expanded: false;
10092     }
10093     }
10094     }
10095     }
10096     @@XMLTest:
10097     @@@QName: xp.attval.ger.entity.declared.standalone.-6.test
10098     @@@DEnt:
10099     @@@@test:value:
10100     <!DOCTYPE p SYSTEM "dtd">
10101     <p a="&entity;"/>
10102     @@@test:domTree:
10103     document {
10104     document-type { }
10105     element {
10106     attribute {
10107     node-name: 'a';
10108     general-entity-reference {
10109     is-expanded: false;
10110     }
10111     }
10112     }
10113     }
10114    
10115 wakaba 1.21 @@XMLTest:
10116 wakaba 1.22 @@@QName: xp.reptxt.attval.ger.entity.declared.nopref.1.test
10117 wakaba 1.21 @@@DEnt:
10118     @@@@test:value:
10119     <!DOCTYPE p [
10120 wakaba 1.22 <!ENTITY c "&entity;">
10121 wakaba 1.21 ]>
10122 wakaba 1.22 <p a="&c;"/>
10123     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
10124 wakaba 1.21 @@XMLTest:
10125 wakaba 1.22 @@@QName: xp.reptxt.attval.ger.entity.declared.nopref.2.test
10126 wakaba 1.21 @@@DEnt:
10127     @@@@test:value:
10128     <!DOCTYPE p [
10129     <!ENTITY other "aa">
10130     <!ENTITY % another "aa">
10131 wakaba 1.22 <!ENTITY c "&entity;">
10132 wakaba 1.21 ]>
10133 wakaba 1.22 <p a="&c;"/>
10134     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
10135 wakaba 1.21 @@XMLTest:
10136 wakaba 1.22 @@@QName: xp.reptxt.attval.ger.entity.declared.nopref.3.test
10137 wakaba 1.21 @@@DEnt:
10138     @@@@test:value:
10139     <?xml version="1.0" standalone="yes"?>
10140     <!DOCTYPE p [
10141 wakaba 1.22 <!ENTITY c "&entity;">
10142 wakaba 1.21 ]>
10143 wakaba 1.22 <p a="&c;"/>
10144     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
10145 wakaba 1.21 @@XMLTest:
10146 wakaba 1.22 @@@QName: xp.reptxt.attval.ger.entity.declared.nopref.4.test
10147 wakaba 1.21 @@@DEnt:
10148     @@@@test:value:
10149     <?xml version="1.0" standalone="no"?>
10150     <!DOCTYPE p [
10151 wakaba 1.22 <!ENTITY c "&entity;">
10152 wakaba 1.21 ]>
10153 wakaba 1.22 <p a="&c;"/>
10154     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
10155 wakaba 1.21 @@XMLTest:
10156 wakaba 1.22 @@@QName: xp.reptxt.attval.ger.entity.declared.nopref.5.test
10157 wakaba 1.21 @@@DEnt:
10158     @@@@test:value:
10159     <?xml version="1.0" standalone="yes"?>
10160     <!DOCTYPE p [
10161     <!ENTITY other "aa">
10162     <!ENTITY % another "aa">
10163 wakaba 1.22 <!ENTITY c "&entity;">
10164 wakaba 1.21 ]>
10165 wakaba 1.22 <p a="&c;"/>
10166     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
10167 wakaba 1.21 @@XMLTest:
10168 wakaba 1.22 @@@QName: xp.reptxt.attval.ger.entity.declared.nopref.6.test
10169 wakaba 1.21 @@@DEnt:
10170     @@@@test:value:
10171     <?xml version="1.0" standalone="no"?>
10172     <!DOCTYPE p [
10173     <!ENTITY other "aa">
10174     <!ENTITY % another "aa">
10175 wakaba 1.22 <!ENTITY c "&entity;">
10176 wakaba 1.21 ]>
10177 wakaba 1.22 <p a="&c;"/>
10178     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
10179 wakaba 1.21 @@XMLTest:
10180 wakaba 1.22 @@@QName: xp.reptxt.attval.ger.entity.declared.nopref.-1.test
10181 wakaba 1.21 @@@DEnt:
10182     @@@@test:value:
10183     <!DOCTYPE p [
10184     <!ENTITY entity "value">
10185 wakaba 1.22 <!ENTITY c "&entity;">
10186 wakaba 1.21 ]>
10187 wakaba 1.22 <p a="&c;"/>
10188 wakaba 1.21 @@@test:domTree:
10189     document {
10190     document-type {
10191     general-entity {
10192     node-name: 'entity';
10193     text-content: 'value';
10194     }
10195 wakaba 1.22 general-entity {
10196     node-name: 'c';
10197     general-entity-reference {
10198     node-name: 'entity';
10199     text-content: 'value';
10200 wakaba 1.21 }
10201     }
10202     }
10203     element {
10204     attribute {
10205     node-name: 'a';
10206     general-entity-reference {
10207 wakaba 1.22 node-name: 'c';
10208     general-entity-reference {
10209     node-name: 'entity';
10210     text-content: 'value';
10211     }
10212 wakaba 1.21 }
10213     }
10214     }
10215     }
10216     @@XMLTest:
10217 wakaba 1.22 @@@QName: xp.reptxt.attval.ger.entity.declared.nopref.-2.test
10218 wakaba 1.21 @@@DEnt:
10219     @@@@test:value:
10220     <!DOCTYPE p [
10221     <!ENTITY entity "value">
10222     <!ENTITY another SYSTEM "another">
10223 wakaba 1.22 <!ENTITY c "&entity;">
10224 wakaba 1.21 ]>
10225 wakaba 1.22 <p a="&c;"/>
10226 wakaba 1.21 @@@test:domTree:
10227     document {
10228     document-type {
10229     general-entity {
10230     node-name: 'entity';
10231     text-content: 'value';
10232 wakaba 1.22 }
10233     general-entity {
10234     node-name: 'c';
10235     general-entity-reference {
10236     node-name: 'entity';
10237     text-content: 'value';
10238     }
10239 wakaba 1.21 }
10240     general-entity {
10241     node-name: 'another';
10242     public-id: null;
10243     system-id: 'another';
10244     has-replacement-tree: false;
10245     }
10246     }
10247     element {
10248     attribute {
10249     node-name: 'a';
10250     general-entity-reference {
10251 wakaba 1.22 node-name: 'c';
10252     general-entity-reference {
10253     node-name: 'entity';
10254     text-content: 'value';
10255     }
10256 wakaba 1.21 }
10257     }
10258     }
10259     }
10260     @@XMLTest:
10261 wakaba 1.22 @@@QName: xp.reptxt.attval.ger.entity.declared.standalone.2.test
10262 wakaba 1.21 @@@DEnt:
10263     @@@@test:value:
10264     <?xml version="1.0" standalone="yes"?>
10265     <!DOCTYPE p [
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.standalone.3.test
10272 wakaba 1.21 @@@DEnt:
10273     @@@@test:value:
10274     <?xml version="1.0" standalone="yes"?>
10275     <!DOCTYPE p [
10276     <!ENTITY % para "<!-- -->">
10277     %para;
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.standalone.-1.test
10284 wakaba 1.21 @@@DEnt:
10285     @@@@test:value:
10286 wakaba 1.22 <?xml version="1.0" standalone="no"?>
10287 wakaba 1.21 <!DOCTYPE p [
10288 wakaba 1.22 <!ENTITY c "&entity;">
10289 wakaba 1.21 <!ENTITY % para "<!-- -->">
10290     %para;
10291     ]>
10292 wakaba 1.22 <p a="&c;"/>
10293     @@@test:domTree:
10294     document {
10295     document-type {
10296     general-entity {
10297     node-name: 'c';
10298     general-entity-reference {
10299     node-name: 'entity';
10300     is-expanded: false;
10301     }
10302     }
10303     }
10304     element {
10305     attribute {
10306     node-name: 'a';
10307     general-entity-reference {
10308     node-name: 'c';
10309     general-entity-reference {
10310     node-name: 'entity';
10311     is-expanded: false;
10312     }
10313     }
10314     }
10315     }
10316     }
10317 wakaba 1.21 @@XMLTest:
10318 wakaba 1.22 @@@QName:
10319     xp.reptxt.attval.ger.entity.declared.standalone.-1.2.test
10320 wakaba 1.21 @@@DEnt:
10321     @@@@test:value:
10322     <?xml version="1.0" standalone="no"?>
10323     <!DOCTYPE p [
10324     <!ENTITY % para "<!-- -->">
10325     %para;
10326 wakaba 1.22 <!ENTITY c "&entity;">
10327 wakaba 1.21 ]>
10328 wakaba 1.22 <p a="&c;"/>
10329     @@@test:domTree:
10330     document {
10331     document-type { }
10332     element {
10333     attribute {
10334     node-name: 'a';
10335     general-entity-reference {
10336     node-name: 'c';
10337     is-expanded: false;
10338     }
10339     }
10340     }
10341     }
10342 wakaba 1.21 @@XMLTest:
10343 wakaba 1.22 @@@QName: xp.reptxt.attval.ger.entity.declared.standalone.-2.test
10344 wakaba 1.21 @@@DEnt:
10345     @@@@test:value:
10346     <!DOCTYPE p [
10347 wakaba 1.22 <!ENTITY c "&entity;">
10348     <!ENTITY % para "<!-- -->">
10349     %para;
10350     ]>
10351     <p a="&c;"/>
10352     @@@test:domTree:
10353     document {
10354     document-type { }
10355     element {
10356     attribute {
10357     node-name: 'a';
10358     general-entity-reference {
10359     node-name: 'c';
10360     is-expanded: true;
10361     general-entity-reference {
10362     node-name: 'entity';
10363     is-expanded: false;
10364     }
10365     }
10366     }
10367     }
10368     }
10369     @@XMLTest:
10370     @@@QName:
10371     xp.reptxt.attval.ger.entity.declared.standalone.-2.2.test
10372     @@@DEnt:
10373     @@@@test:value:
10374     <!DOCTYPE p [
10375     <!ENTITY % para "<!-- -->">
10376     %para;
10377     <!ENTITY c "&entity;">
10378     ]>
10379     <p a="&c;"/>
10380     @@@test:domTree:
10381     document {
10382     document-type { }
10383     element {
10384     attribute {
10385     node-name: 'a';
10386     general-entity-reference {
10387     node-name: 'c';
10388     is-expanded: false;
10389     }
10390     }
10391     }
10392     }
10393     @@XMLTest:
10394     @@@QName: xp.reptxt.attval.ger.entity.declared.standalone.4.test
10395     @@@DEnt:
10396     @@@@test:value:
10397     <?xml version="1.0" standalone="yes"?>
10398     <!DOCTYPE p [
10399     <!ENTITY % para SYSTEM "para">
10400     %para;
10401     <!ENTITY c "&entity;">
10402     ]>
10403     <p a="&c;"/>
10404     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
10405     @@XMLTest:
10406     @@@QName: xp.reptxt.attval.ger.entity.declared.standalone.-3.test
10407     @@@DEnt:
10408     @@@@test:value:
10409     <?xml version="1.0" standalone="no"?>
10410     <!DOCTYPE p [
10411     <!ENTITY c "&entity;">
10412     <!ENTITY % para SYSTEM "para">
10413     %para;
10414     ]>
10415     <p a="&c;"/>
10416     @@@test:domTree:
10417     document {
10418     document-type { }
10419     element {
10420     attribute {
10421     node-name: 'a';
10422     general-entity-reference {
10423     node-name: 'c';
10424     is-expanded: true;
10425     general-entity-reference {
10426     node-name: 'entity';
10427     is-expanded: false;
10428     }
10429     }
10430     }
10431     }
10432     }
10433     @@XMLTest:
10434     @@@QName:
10435     xp.reptxt.attval.ger.entity.declared.standalone.-3.2.test
10436     @@@DEnt:
10437     @@@@test:value:
10438     <?xml version="1.0" standalone="no"?>
10439     <!DOCTYPE p [
10440     <!ENTITY % para SYSTEM "para">
10441     %para;
10442     <!ENTITY c "&entity;">
10443     ]>
10444     <p a="&c;"/>
10445     @@@test:domTree:
10446     document {
10447     document-type { }
10448     element {
10449     attribute {
10450     node-name: 'a';
10451     general-entity-reference {
10452     node-name: 'c';
10453     is-expanded: false;
10454     }
10455     }
10456     }
10457     }
10458     @@XMLTest:
10459     @@@QName: xp.reptxt.attval.ger.entity.declared.standalone.-4.test
10460     @@@DEnt:
10461     @@@@test:value:
10462     <!DOCTYPE p [
10463     <!ENTITY c "&entity;">
10464     <!ENTITY % para SYSTEM "para">
10465     %para;
10466     ]>
10467     <p a="&c;"/>
10468     @@@test:domTree:
10469     document {
10470     document-type { }
10471     element {
10472     attribute {
10473     node-name: 'a';
10474     general-entity-reference {
10475     node-name: 'c';
10476     is-expanded: true;
10477     general-entity-reference {
10478     node-name: 'entity';
10479     is-expanded: false;
10480     }
10481     }
10482     }
10483     }
10484     }
10485     @@XMLTest:
10486     @@@QName:
10487     xp.reptxt.attval.ger.entity.declared.standalone.-4.2.test
10488     @@@DEnt:
10489     @@@@test:value:
10490     <!DOCTYPE p [
10491     <!ENTITY % para SYSTEM "para">
10492     %para;
10493     <!ENTITY c "&entity;">
10494     ]>
10495     <p a="&c;"/>
10496     @@@test:domTree:
10497     document {
10498     document-type { }
10499     element {
10500     attribute {
10501     node-name: 'a';
10502     general-entity-reference {
10503     node-name: 'c';
10504     is-expanded: false;
10505     }
10506     }
10507     }
10508     }
10509     @@XMLTest:
10510     @@@QName: xp.reptxt.attval.ger.entity.declared.standalone.5.test
10511     @@@DEnt:
10512     @@@@test:value:
10513     <?xml version="1.0" standalone="yes"?>
10514     <!DOCTYPE p SYSTEM "dtd" [
10515     <!ENTITY c "&entity;">
10516     ]>
10517     <p a="&c;"/>
10518     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
10519     @@XMLTest:
10520     @@@QName: xp.reptxt.attval.ger.entity.declared.standalone.-5.test
10521     @@@DEnt:
10522     @@@@test:value:
10523     <?xml version="1.0" standalone="no"?>
10524     <!DOCTYPE p SYSTEM "dtd" [
10525     <!ENTITY c "&entity;">
10526     ]>
10527     <p a="&c;"/>
10528     @@@test:domTree:
10529     document {
10530     document-type { }
10531     element {
10532     attribute {
10533     node-name: 'a';
10534     general-entity-reference {
10535     node-name: 'c';
10536     is-expanded: true;
10537     general-entity-reference {
10538     node-name: 'entity';
10539     is-expanded: false;
10540     }
10541     }
10542     }
10543     }
10544     }
10545     @@XMLTest:
10546     @@@QName: xp.reptxt.attval.ger.entity.declared.standalone.-6.test
10547     @@@DEnt:
10548     @@@@test:value:
10549     <!DOCTYPE p SYSTEM "dtd" [<!ENTITY c "&entity;">]>
10550     <p a="&c;"/>
10551     @@@test:domTree:
10552     document {
10553     document-type { }
10554     element {
10555     attribute {
10556     node-name: 'a';
10557     general-entity-reference {
10558     node-name: 'c';
10559     is-expanded: true;
10560     general-entity-reference {
10561     node-name: 'entity';
10562     is-expanded: false;
10563     }
10564     }
10565     }
10566     }
10567     }
10568    
10569     @@XMLTest:
10570     @@@QName: xp.attlist.dup.entity.declared.1.test
10571     @@@DEnt:
10572     @@@@test:value:
10573     <!DOCTYPE p [
10574     <!ATTLIST p a CDATA "no-entity">
10575     <!ATTLIST p a CDATA "&entity;">
10576     ]>
10577     <p/>
10578     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 21)..(3, 29); }
10579     @@XMLTest:
10580     @@@QName: xp.attlist.dup.entity.declared.2.test
10581     @@@DEnt:
10582     @@@@test:value:
10583     <!DOCTYPE p [
10584     <!ATTLIST p a CDATA "no-entity"
10585     a CDATA "&entity;">
10586     ]>
10587     <p/>
10588     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 21)..(3, 29); }
10589     @@XMLTest:
10590     @@@QName: xp.attlist.unused.entity.declared.1.test
10591     @@@DEnt:
10592     @@@@test:value:
10593     <!DOCTYPE p [
10594     <!ATTLIST q a CDATA "&entity;">
10595     ]>
10596     <p/>
10597     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 21)..(2, 29); }
10598     @@XMLTest:
10599     @@@QName: xp.attlist.unused.entity.declared.2.test
10600     @@@DEnt:
10601     @@@@test:value:
10602     <!DOCTYPE p [
10603     <!ATTLIST p a CDATA "&entity;">
10604     ]>
10605     <p a="bb"/>
10606     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 21)..(2, 29); }
10607    
10608     @@XMLTest:
10609     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.nopref.1.test
10610     @@@DEnt:
10611     @@@@test:value:
10612     <!DOCTYPE p [
10613     <!ENTITY c "&entity;">
10614     <!ATTLIST p a CDATA "&c;">
10615     ]>
10616     <p/>
10617     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
10618     @@XMLTest:
10619     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.nopref.2.test
10620     @@@DEnt:
10621     @@@@test:value:
10622     <!DOCTYPE p [
10623     <!ENTITY other "aa">
10624     <!ENTITY % another "aa">
10625     <!ENTITY c "&entity;">
10626     <!ATTLIST p a CDATA "&c;">
10627     ]>
10628     <p/>
10629     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
10630     @@XMLTest:
10631     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.nopref.3.test
10632     @@@DEnt:
10633     @@@@test:value:
10634     <?xml version="1.0" standalone="yes"?>
10635     <!DOCTYPE p [
10636     <!ENTITY c "&entity;">
10637     <!ATTLIST p a CDATA "&c;">
10638     ]>
10639     <p/>
10640     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
10641     @@XMLTest:
10642     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.nopref.4.test
10643     @@@DEnt:
10644     @@@@test:value:
10645     <?xml version="1.0" standalone="no"?>
10646     <!DOCTYPE p [
10647     <!ENTITY c "&entity;">
10648     <!ATTLIST p a CDATA "&c;">
10649     ]>
10650     <p/>
10651     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
10652     @@XMLTest:
10653     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.nopref.5.test
10654     @@@DEnt:
10655     @@@@test:value:
10656     <?xml version="1.0" standalone="yes"?>
10657     <!DOCTYPE p [
10658     <!ENTITY other "aa">
10659     <!ENTITY % another "aa">
10660     <!ENTITY c "&entity;">
10661     <!ATTLIST p a CDATA "&c;">
10662     ]>
10663     <p/>
10664     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
10665     @@XMLTest:
10666     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.nopref.6.test
10667     @@@DEnt:
10668     @@@@test:value:
10669     <?xml version="1.0" standalone="no"?>
10670     <!DOCTYPE p [
10671     <!ENTITY other "aa">
10672     <!ENTITY % another "aa">
10673     <!ENTITY c "&entity;">
10674     <!ATTLIST p a CDATA "&c;">
10675     ]>
10676     <p/>
10677     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
10678     @@XMLTest:
10679     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.nopref.-1.test
10680     @@@DEnt:
10681     @@@@test:value:
10682     <!DOCTYPE p [
10683     <!ENTITY entity "value">
10684     <!ENTITY c "&entity;">
10685     <!ATTLIST p a CDATA "&c;">
10686     ]>
10687     <p/>
10688     @@@test:domTree:
10689     document {
10690     document-type {
10691     general-entity {
10692     node-name: 'entity';
10693     text-content: 'value';
10694     }
10695     general-entity {
10696     node-name: 'c';
10697     general-entity-reference {
10698     node-name: 'entity';
10699     is-expanded: true;
10700     text-content: 'value';
10701     }
10702     }
10703     element-type-definition {
10704     node-name: 'p';
10705     attribute-definition {
10706     node-name: 'a';
10707     general-entity-reference {
10708     node-name: 'c';
10709     is-expanded: true;
10710     general-entity-reference {
10711     node-name: 'entity';
10712     is-expanded: true;
10713     text-content: 'value';
10714     }
10715     }
10716     }
10717     }
10718     }
10719     element {
10720     attribute {
10721     node-name: 'a';
10722     specified: false;
10723     general-entity-reference {
10724     node-name: 'c';
10725     general-entity-reference {
10726     node-name: 'entity';
10727     text-content: 'value';
10728     }
10729     }
10730     }
10731     }
10732     }
10733     @@XMLTest:
10734     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.nopref.-2.test
10735     @@@DEnt:
10736     @@@@test:value:
10737     <!DOCTYPE p [
10738     <!ENTITY entity "value">
10739     <!ENTITY another SYSTEM "another">
10740     <!ENTITY c "&entity;">
10741     <!ATTLIST p a CDATA "&c;">
10742     ]>
10743     <p/>
10744     @@@test:domTree:
10745     document {
10746     document-type {
10747     general-entity {
10748     node-name: 'entity';
10749     text-content: 'value';
10750     }
10751     general-entity {
10752     node-name: 'c';
10753     general-entity-reference {
10754     node-name: 'entity';
10755     text-content: 'value';
10756     }
10757     }
10758     general-entity {
10759     node-name: 'another';
10760     public-id: null;
10761     system-id: 'another';
10762     has-replacement-tree: false;
10763     }
10764     element-type-definition {
10765     node-name: 'p';
10766     attribute-definition {
10767     node-name: 'a';
10768     general-entity-reference {
10769     node-name: 'c';
10770     is-expanded: true;
10771     general-entity-reference {
10772     node-name: 'entity';
10773     is-expanded: true;
10774     text-content: 'value';
10775     }
10776     }
10777     }
10778     }
10779     }
10780     element {
10781     attribute {
10782     node-name: 'a';
10783     specified: false;
10784     general-entity-reference {
10785     node-name: 'c';
10786     general-entity-reference {
10787     node-name: 'entity';
10788     text-content: 'value';
10789     }
10790     }
10791     }
10792     }
10793     }
10794     @@XMLTest:
10795     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.standalone.2.test
10796     @@@DEnt:
10797     @@@@test:value:
10798     <?xml version="1.0" standalone="yes"?>
10799     <!DOCTYPE p [
10800     <!ENTITY c "&entity;">
10801     <!ATTLIST p a CDATA "&c;">
10802     ]>
10803     <p/>
10804     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
10805     @@XMLTest:
10806     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.standalone.3.test
10807     @@@DEnt:
10808     @@@@test:value:
10809     <?xml version="1.0" standalone="yes"?>
10810     <!DOCTYPE p [
10811     <!ENTITY % para "<!-- -->">
10812     %para;
10813     <!ENTITY c "&entity;">
10814     <!ATTLIST p a CDATA "&c;">
10815     ]>
10816     <p/>
10817     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
10818     @@XMLTest:
10819     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.standalone.-1.test
10820     @@@DEnt:
10821     @@@@test:value:
10822     <?xml version="1.0" standalone="no"?>
10823     <!DOCTYPE p [
10824     <!ENTITY c "&entity;">
10825     <!ATTLIST p a CDATA "&c;">
10826     <!ENTITY % para "<!-- -->">
10827     %para;
10828     ]>
10829     <p/>
10830     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
10831     @@XMLTest:
10832     @@@QName:
10833     xp.reptxt.attlist.attval.ger.entity.declared.standalone.-1.2.test
10834     @@@DEnt:
10835     @@@@test:value:
10836     <?xml version="1.0" standalone="no"?>
10837     <!DOCTYPE p [
10838     <!ENTITY % para "<!-- -->">
10839     %para;
10840     <!ENTITY c "&entity;">
10841     <!ATTLIST p a CDATA "&c;">
10842     ]>
10843     <p g="h"/>
10844     @@@test:domTree:
10845     document {
10846     document-type { }
10847     element {
10848     attribute {
10849     node-name: 'g';
10850     text-content: 'h';
10851     }
10852     }
10853     }
10854     @@XMLTest:
10855     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.standalone.-2.test
10856     @@@DEnt:
10857     @@@@test:value:
10858     <!DOCTYPE p [
10859     <!ENTITY c "&entity;">
10860     <!ATTLIST p a CDATA "&c;">
10861     <!ENTITY % para "<!-- -->">
10862     %para;
10863     ]>
10864     <p/>
10865     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
10866     @@XMLTest:
10867     @@@QName:
10868     xp.reptxt.attlist.attval.ger.entity.declared.standalone.-2.2.test
10869     @@@DEnt:
10870     @@@@test:value:
10871     <!DOCTYPE p [
10872     <!ENTITY % para "<!-- -->">
10873     %para;
10874     <!ENTITY c "&entity;">
10875     <!ATTLIST p a CDATA "&c;">
10876     ]>
10877     <p g="h"/>
10878     @@@test:domTree:
10879     document {
10880     document-type { }
10881     element {
10882     attribute {
10883     node-name: 'g';
10884     text-content: 'h';
10885     }
10886     }
10887     }
10888     @@XMLTest:
10889     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.standalone.4.test
10890     @@@DEnt:
10891     @@@@test:value:
10892     <?xml version="1.0" standalone="yes"?>
10893     <!DOCTYPE p [
10894     <!ENTITY % para SYSTEM "para">
10895     %para;
10896     <!ENTITY c "&entity;">
10897     <!ATTLIST p a CDATA "&c;">
10898     ]>
10899     <p/>
10900     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
10901     @@XMLTest:
10902     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.standalone.-3.test
10903     @@@DEnt:
10904     @@@@test:value:
10905     <?xml version="1.0" standalone="no"?>
10906     <!DOCTYPE p [
10907     <!ENTITY c "&entity;">
10908     <!ATTLIST p a CDATA "&c;">
10909     <!ENTITY % para SYSTEM "para">
10910     %para;
10911     ]>
10912     <p/>
10913     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
10914     @@XMLTest:
10915     @@@QName:
10916     xp.reptxt.attlist.attval.ger.entity.declared.standalone.-3.2.test
10917     @@@DEnt:
10918     @@@@test:value:
10919     <?xml version="1.0" standalone="no"?>
10920     <!DOCTYPE p [
10921     <!ENTITY % para SYSTEM "para">
10922     %para;
10923     <!ENTITY c "&entity;">
10924     <!ATTLIST p a CDATA "&c;">
10925     ]>
10926     <p g="h"/>
10927     @@@test:domTree:
10928     document {
10929     document-type { }
10930     element {
10931     attribute {
10932     node-name: 'g';
10933     text-content: 'h';
10934     }
10935     }
10936     }
10937     @@XMLTest:
10938     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.standalone.-4.test
10939     @@@DEnt:
10940     @@@@test:value:
10941     <!DOCTYPE p [
10942     <!ENTITY c "&entity;">
10943     <!ATTLIST p a CDATA "&c;">
10944     <!ENTITY % para SYSTEM "para">
10945     %para;
10946     ]>
10947     <p/>
10948     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
10949     @@XMLTest:
10950     @@@QName:
10951     xp.reptxt.attlist.attval.ger.entity.declared.standalone.-4.2.test
10952     @@@DEnt:
10953     @@@@test:value:
10954     <!DOCTYPE p [
10955     <!ENTITY % para SYSTEM "para">
10956     %para;
10957     <!ENTITY c "&entity;">
10958     <!ATTLIST p a CDATA "&c;">
10959     ]>
10960     <p g="h"/>
10961     @@@test:domTree:
10962     document {
10963     document-type { }
10964     element {
10965     attribute {
10966     node-name: 'g';
10967     text-content: 'h';
10968     }
10969     }
10970     }
10971     @@XMLTest:
10972     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.standalone.5.test
10973     @@@DEnt:
10974     @@@@test:value:
10975     <?xml version="1.0" standalone="yes"?>
10976     <!DOCTYPE p SYSTEM "dtd" [
10977     <!ENTITY c "&entity;">
10978     <!ATTLIST p a CDATA "&c;">
10979     ]>
10980     <p/>
10981     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
10982     @@XMLTest:
10983     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.standalone.-5.test
10984     @@@DEnt:
10985     @@@@test:value:
10986     <?xml version="1.0" standalone="no"?>
10987     <!DOCTYPE p SYSTEM "dtd" [
10988     <!ENTITY c "&entity;">
10989     <!ATTLIST p a CDATA "&c;">
10990     ]>
10991     <p/>
10992     @@@test:domTree:
10993     document {
10994     document-type { }
10995     element {
10996     attribute {
10997     node-name: 'a';
10998     specified: false;
10999     general-entity-reference {
11000     node-name: 'c';
11001     is-expanded: true;
11002     general-entity-reference {
11003     node-name: 'entity';
11004     is-expanded: false;
11005     }
11006     }
11007     }
11008     }
11009     }
11010     @@XMLTest:
11011     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.standalone.-6.test
11012     @@@DEnt:
11013     @@@@test:value:
11014     <!DOCTYPE p SYSTEM "dtd" [<!ENTITY c "&entity;">
11015     <!ATTLIST p a CDATA "&c;">
11016     ]>
11017     <p/>
11018     @@@test:domTree:
11019     document {
11020     document-type { }
11021     element {
11022     attribute {
11023     node-name: 'a';
11024     specified: false;
11025     general-entity-reference {
11026     node-name: 'c';
11027     is-expanded: true;
11028     general-entity-reference {
11029     node-name: 'entity';
11030     is-expanded: false;
11031     }
11032     }
11033     }
11034     }
11035     }
11036    
11037     @@XMLTest:
11038     @@@QName: xp.attlist.attval.ger.entity.declared.nopref.1.test
11039     @@@DEnt:
11040     @@@@test:value:
11041     <!DOCTYPE p [
11042     <!ATTLIST p a CDATA "&entity;">
11043     ]>
11044     <p/>
11045     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 22)..(2, 29); }
11046     @@XMLTest:
11047     @@@QName: xp.attlist.attval.ger.entity.declared.nopref.2.test
11048     @@@DEnt:
11049     @@@@test:value:
11050     <!DOCTYPE p [
11051     <!ENTITY other "aa">
11052     <!ENTITY % another "aa">
11053     <!ATTLIST p a CDATA "&entity;">
11054     ]>
11055     <p/>
11056     @@@c:erred: <[[xp|wf-entity-declared]]> { (4, 22)..(4, 29); }
11057     @@XMLTest:
11058     @@@QName: xp.attlist.attval.ger.entity.declared.nopref.3.test
11059     @@@DEnt:
11060     @@@@test:value:
11061     <?xml version="1.0" standalone="yes"?>
11062     <!DOCTYPE p [
11063     <!ATTLIST p a CDATA "&entity;">
11064     ]>
11065     <p/>
11066     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 22)..(3, 29); }
11067     @@XMLTest:
11068     @@@QName: xp.attlist.attval.ger.entity.declared.nopref.4.test
11069     @@@DEnt:
11070     @@@@test:value:
11071     <?xml version="1.0" standalone="no"?>
11072     <!DOCTYPE p [
11073     <!ATTLIST p a CDATA "&entity;">
11074     ]>
11075     <p/>
11076     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 22)..(3, 29); }
11077     @@XMLTest:
11078     @@@QName: xp.attlist.attval.ger.entity.declared.nopref.5.test
11079     @@@DEnt:
11080     @@@@test:value:
11081     <?xml version="1.0" standalone="yes"?>
11082     <!DOCTYPE p [
11083     <!ENTITY other "aa">
11084     <!ENTITY % another "aa">
11085     <!ATTLIST p a CDATA "&entity;">
11086     ]>
11087     <p/>
11088     @@@c:erred: <[[xp|wf-entity-declared]]> { (5, 22)..(5, 29); }
11089     @@XMLTest:
11090     @@@QName: xp.attlist.attval.ger.entity.declared.nopref.6.test
11091     @@@DEnt:
11092     @@@@test:value:
11093     <?xml version="1.0" standalone="no"?>
11094     <!DOCTYPE p [
11095     <!ENTITY other "aa">
11096     <!ENTITY % another "aa">
11097     <!ATTLIST p a CDATA "&entity;">
11098     ]>
11099     <p/>
11100     @@@c:erred: <[[xp|wf-entity-declared]]> { (5, 22)..(5, 29); }
11101     @@XMLTest:
11102     @@@QName: xp.attlist.attval.ger.entity.declared.nopref.-1.test
11103     @@@DEnt:
11104     @@@@test:value:
11105     <!DOCTYPE p [
11106     <!ENTITY entity "value">
11107     <!ATTLIST p a CDATA "&entity;">
11108     ]>
11109     <p/>
11110     @@@test:domTree:
11111     document {
11112     document-type {
11113     general-entity {
11114     node-name: 'entity';
11115     text-content: 'value';
11116     }
11117     element-type-definition {
11118     node-name: 'p';
11119     attribute-definition {
11120     node-name: 'a';
11121     general-entity-reference {
11122     node-name: 'entity';
11123     is-expanded: true;
11124     text-content: 'value';
11125     }
11126     }
11127     }
11128     }
11129     element {
11130     attribute {
11131     node-name: 'a';
11132     specified: false;
11133     general-entity-reference {
11134     node-name: 'entity';
11135     is-expanded: true;
11136     text-content: 'value';
11137     }
11138     }
11139     }
11140     }
11141     @@XMLTest:
11142     @@@QName: xp.attlist.attval.ger.entity.declared.nopref.-1.2.test
11143     @@@DEnt:
11144     @@@@test:value:
11145     <!DOCTYPE p [
11146     <!ATTLIST p a CDATA "&entity;">
11147     <!ENTITY entity "value">
11148     ]>
11149     <p/>
11150     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 22)..(2, 29); }
11151     @@XMLTest:
11152     @@@QName: xp.attlist.attval.ger.entity.declared.nopref.-2.test
11153     @@@DEnt:
11154     @@@@test:value:
11155     <!DOCTYPE p [
11156     <!ENTITY entity "value">
11157     <!ENTITY another SYSTEM "another">
11158     <!ATTLIST p a CDATA "&entity;">
11159     ]>
11160     <p/>
11161     @@@test:domTree:
11162     document {
11163     document-type {
11164     element-type-definition {
11165     node-name: 'p';
11166     attribute-definition {
11167     node-name: 'a';
11168     general-entity-reference {
11169     node-name: 'entity';
11170     is-expanded: true;
11171     text-content: 'value';
11172     }
11173     }
11174     }
11175     general-entity {
11176     node-name: 'entity';
11177     text-content: 'value';
11178     has-replacement-tree: true;
11179     }
11180     general-entity {
11181     node-name: 'another';
11182     public-id: null;
11183     system-id: 'another';
11184     has-replacement-tree: false;
11185     }
11186     }
11187     element {
11188     attribute {
11189     node-name: 'a';
11190     specified: false;
11191     general-entity-reference {
11192     node-name: 'entity';
11193     is-expanded: true;
11194     text-content: 'value';
11195     }
11196     }
11197     }
11198     }
11199     @@XMLTest:
11200     @@@QName: xp.attlist.attval.ger.entity.declared.nopref.-2.2.test
11201     @@@DEnt:
11202     @@@@test:value:
11203     <!DOCTYPE p [
11204     <!ATTLIST p a CDATA "&entity;">
11205     <!ENTITY entity "value">
11206     <!ENTITY another SYSTEM "another">
11207     ]>
11208     <p/>
11209     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 22)..(2, 29); }
11210     @@XMLTest:
11211     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.2.test
11212     @@@DEnt:
11213     @@@@test:value:
11214     <?xml version="1.0" standalone="yes"?>
11215     <!DOCTYPE p [
11216     <!ATTLIST p a CDATA "&entity;">
11217     ]>
11218     <p/>
11219     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 22)..(3, 29); }
11220     @@XMLTest:
11221     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.3.test
11222     @@@DEnt:
11223     @@@@test:value:
11224     <?xml version="1.0" standalone="yes"?>
11225     <!DOCTYPE p [
11226     <!ATTLIST p a CDATA "&entity;">
11227     <!ENTITY % para "<!-- -->">
11228     %para;
11229     ]>
11230     <p/>
11231     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 22)..(3, 29); }
11232     @@XMLTest:
11233     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.3.2.test
11234     @@@DEnt:
11235     @@@@test:value:
11236     <?xml version="1.0" standalone="yes"?>
11237     <!DOCTYPE p [
11238     <!ENTITY % para "<!-- -->">
11239     %para;
11240     <!ATTLIST p a CDATA "&entity;">
11241     ]>
11242     <p/>
11243     @@@c:erred: <[[xp|wf-entity-declared]]> { (5, 22)..(5, 29); }
11244     @@@enImplNote:
11245     The <XML::ATTLIST> declaration is processed since
11246     it is a <XA::standalone> document.
11247     @@XMLTest:
11248     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.-1.test
11249     @@@DEnt:
11250     @@@@test:value:
11251     <?xml version="1.0" standalone="no"?>
11252     <!DOCTYPE p [
11253     <!ATTLIST p a CDATA "&entity;">
11254     <!ENTITY % para "<!-- -->">
11255     %para;
11256     ]>
11257     <p/>
11258     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 22)..(3, 29); }
11259     @@XMLTest:
11260     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.-1.2.test
11261     @@@DEnt:
11262     @@@@test:value:
11263     <?xml version="1.0" standalone="no"?>
11264     <!DOCTYPE p [
11265     <!ATTLIST q b CDATA #IMPLIED>
11266 wakaba 1.21 <!ENTITY % para "<!-- -->">
11267     %para;
11268     <!ATTLIST p a CDATA "&entity;">
11269     ]>
11270     <p c="d"/>
11271     @@@test:domTree:
11272     document {
11273     document-type {
11274     element-type-definition {
11275     node-name: 'q';
11276     attribute-definition {
11277     node-name: 'b';
11278     }
11279     }
11280     }
11281     element {
11282     attribute {
11283     node-name: 'c';
11284     text-content: 'd';
11285     }
11286     }
11287     }
11288     @@@enImplNote:
11289     The second <XML::ATTLIST> declaration is read but not processed
11290     and its <XML::&entity;> general entity reference violates
11291     entity declared validty constraint rather than well-formedness
11292     constraint.
11293     @@XMLTest:
11294     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.-2.test
11295     @@@DEnt:
11296     @@@@test:value:
11297     <!DOCTYPE p [
11298     <!ATTLIST p a CDATA "&entity;">
11299     <!ENTITY % para "<!-- -->">
11300     %para;
11301     ]>
11302     <p/>
11303     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 22)..(2, 29); }
11304     @@XMLTest:
11305     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.-2.2.test
11306     @@@DEnt:
11307     @@@@test:value:
11308     <!DOCTYPE p [
11309     <!ATTLIST q b CDATA #IMPLIED>
11310     <!ENTITY % para "<!-- -->">
11311     %para;
11312     <!ATTLIST p a CDATA "&entity;">
11313     ]>
11314     <p c="d"/>
11315     @@@test:domTree:
11316     document {
11317     document-type {
11318     element-type-definition {
11319     node-name: 'q';
11320     attribute-definition {
11321     node-name: 'b';
11322     }
11323     }
11324     }
11325     element {
11326     attribute {
11327     node-name: 'c';
11328     text-content: 'd';
11329     }
11330     }
11331     }
11332     @@XMLTest:
11333     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.4.test
11334     @@@DEnt:
11335     @@@@test:value:
11336     <?xml version="1.0" standalone="yes"?>
11337     <!DOCTYPE p [
11338     <!ATTLIST p a CDATA "&entity;">
11339     <!ENTITY % para SYSTEM "p">
11340     %para;
11341     ]>
11342     <p/>
11343     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 22)..(3, 29); }
11344     @@XMLTest:
11345     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.4.2.test
11346     @@@DEnt:
11347     @@@@test:value:
11348     <?xml version="1.0" standalone="yes"?>
11349     <!DOCTYPE p [
11350     <!ENTITY % para SYSTEM "p">
11351     %para;
11352     <!ATTLIST p a CDATA "&entity;">
11353     ]>
11354     <p/>
11355     @@@c:erred: <[[xp|wf-entity-declared]]> { (5, 22)..(5, 29); }
11356     @@@enImplNote:
11357     The <XML::ATTLIST> declaration is processed since
11358     it is a <XA::standalone> document.
11359     @@XMLTest:
11360     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.-3.test
11361     @@@DEnt:
11362     @@@@test:value:
11363     <?xml version="1.0" standalone="no"?>
11364     <!DOCTYPE p [
11365     <!ATTLIST p a CDATA "&entity;">
11366     <!ENTITY % para SYSTEM "p">
11367     %para;
11368     ]>
11369     <p/>
11370     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 22)..(3, 29); }
11371     @@@enImplNote:
11372     Is this well-formed? It has a parameter entity reference,
11373     therefore, it does not violates Entity Declared WFC, isn't it?
11374    
11375     Note that Firefox 1.5 and Opera 9 TP1 reports that this document has a
11376     fatal error (also note that they does not support unexpanded).
11377    
11378     See also:
11379     <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>
11380     @@XMLTest:
11381     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.-3.2.test
11382     @@@DEnt:
11383     @@@@test:value:
11384     <?xml version="1.0" standalone="no"?>
11385     <!DOCTYPE p [
11386     <!ATTLIST q b CDATA #IMPLIED>
11387     <!ENTITY % para SYSTEM "p">
11388     %para;
11389     <!ATTLIST p a CDATA "&entity;">
11390     ]>
11391     <p c="d"/>
11392     @@@test:domTree:
11393     document {
11394     document-type {
11395     element-type-definition {
11396     node-name: 'q';
11397     attribute-definition {
11398     node-name: 'b';
11399     }
11400     }
11401     }
11402     element {
11403     attribute {
11404     node-name: 'c';
11405     text-content: 'd';
11406     }
11407     }
11408     }
11409     @@@enImplNote:
11410     The second <XML::ATTLIST> declaration is read but not processed
11411     and its <XML::&entity;> general entity reference violates
11412     entity declared validty constraint rather than well-formedness
11413     constraint.
11414     @@XMLTest:
11415     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.-4.test
11416     @@@DEnt:
11417     @@@@test:value:
11418     <!DOCTYPE p [
11419     <!ATTLIST p a CDATA "&entity;">
11420     <!ENTITY % para SYSTEM "p">
11421     %para;
11422     ]>
11423     <p/>
11424     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 22)..(2, 29); }
11425     @@XMLTest:
11426     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.-4.2.test
11427     @@@DEnt:
11428     @@@@test:value:
11429     <!DOCTYPE p [
11430     <!ATTLIST q b CDATA #IMPLIED>
11431     <!ENTITY % para SYSTEM "p">
11432     %para;
11433     <!ATTLIST p a CDATA "&entity;">
11434     ]>
11435     <p c="d"/>
11436     @@@test:domTree:
11437     document {
11438     document-type {
11439     element-type-definition {
11440     node-name: 'q';
11441     attribute-definition {
11442     node-name: 'b';
11443     }
11444     }
11445     }
11446     element {
11447     attribute {
11448     node-name: 'c';
11449     text-content: 'd';
11450     }
11451     }
11452     }
11453     @@XMLTest:
11454     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.5.test
11455     @@@DEnt:
11456     @@@@test:value:
11457     <?xml version="1.0" standalone="yes"?>
11458     <!DOCTYPE p SYSTEM "dtd" [
11459     <!ATTLIST p a CDATA "&entity;">
11460     ]>
11461     <p/>
11462     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 22)..(3, 29); }
11463     @@@enImplNote:
11464     This document has an error - result is implementation dependent.
11465     @@XMLTest:
11466     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.-5.test
11467     @@@DEnt:
11468     @@@@test:value:
11469     <?xml version="1.0" standalone="no"?>
11470     <!DOCTYPE p SYSTEM "dtd" [
11471     <!ATTLIST p a CDATA "&entity;">
11472     ]>
11473     <p/>
11474     @@@test:domTree:
11475     document {
11476     document-type {
11477     element-type-definition {
11478     node-name: 'p';
11479     attribute-definition {
11480     node-name: 'a';
11481     general-entity-reference {
11482     node-name: 'entity';
11483     is-expanded: false;
11484     }
11485     }
11486     }
11487     }
11488     element {
11489     attribute {
11490     node-name: 'a';
11491     specified: false;
11492     general-entity-reference {
11493     node-name: 'entity';
11494     is-expanded: false;
11495     }
11496     }
11497     }
11498     }
11499     @@@enImplNote:
11500     This document has an error - result is implementation dependent.
11501     @@XMLTest:
11502     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.-6.test
11503     @@@DEnt:
11504     @@@@test:value:
11505     <!DOCTYPE p SYSTEM "dtd" [
11506     <!ATTLIST p a CDATA "&entity;">
11507     ]>
11508     <p/>
11509     @@@test:domTree:
11510     document {
11511     document-type {
11512     element-type-definition {
11513     node-name: 'p';
11514     attribute-definition {
11515     node-name: 'a';
11516     general-entity-reference {
11517     node-name: 'entity';
11518     is-expanded: false;
11519     }
11520     }
11521     }
11522     }
11523     element {
11524     attribute {
11525     node-name: 'a';
11526     specified: false;
11527     general-entity-reference {
11528     node-name: 'entity';
11529     is-expanded: false;
11530     }
11531     }
11532     }
11533     }
11534     @@@enImplNote:
11535     This document has an error - result is implementation dependent.
11536    
11537 wakaba 1.19 @@enImplNote:
11538     {TODO:: Entity declared WFC for
11539 wakaba 1.20
11540     - General entity references in entity value??
11541 wakaba 1.19
11542     }
11543    
11544 wakaba 1.23 @@XMLTest:
11545     @@@QName: xp.element.content.parsed.entity.reference.test
11546     @@@DEnt:
11547     @@@@test:value:
11548     <!DOCTYPE p [
11549     <!NOTATION n SYSTEM "notation">
11550     <!ENTITY ext SYSTEM "system" NDATA n>
11551     ]>
11552     <p>&ext;</p>
11553     @@@c:erred: <[[xp|wf-parsed-entity]]> { (5, 4)..(5, 8); }
11554     @@XMLTest:
11555     @@@QName: xp.attval.parsed.entity.reference.test
11556     @@@DEnt:
11557     @@@@test:value:
11558     <!DOCTYPE p [
11559     <!NOTATION n SYSTEM "notation">
11560     <!ENTITY ext SYSTEM "system" NDATA n>
11561     ]>
11562     <p a="&ext;"/>
11563     # @@@c:erred: <[[xp|wf-parsed-entity]]> { (5, 7)..(5, 11); }
11564     @@@c:erred: <[[xp|wf-no-external-entity-references]]> { (5, 7)..(5, 11); }
11565     @@XMLTest:
11566     @@@QName: xp.element.content.reptxt.parsed.entity.reference.test
11567     @@@DEnt:
11568     @@@@test:value:
11569     <!DOCTYPE p [
11570     <!NOTATION n SYSTEM "notation">
11571     <!ENTITY ext SYSTEM "system" NDATA n>
11572     <!ENTITY c "&#x26;ext;">
11573     ]>
11574     <p>&c;</p>
11575     @@@c:erred: <[[xp|wf-parsed-entity]]> { (1, 1)..(1, 5); }
11576     @@XMLTest:
11577     @@@QName: xp.attval.reptxt.parsed.entity.reference.test
11578     @@@DEnt:
11579     @@@@test:value:
11580     <!DOCTYPE p [
11581     <!NOTATION n SYSTEM "notation">
11582     <!ENTITY ext SYSTEM "system" NDATA n>
11583     <!ENTITY c "&#x26;ext;">
11584     ]>
11585     <p a="&c;"/>
11586     @@@c:erred: <[[xp|wf-no-external-entity-references]]> { (1, 1)..(1, 5); }
11587     @@@c:erred:
11588     @@@@@: <[[xp|wf-parsed-entity]]> { }
11589     @@@@enImplNote: During entity node construction.
11590     @@XMLTest:
11591     @@@QName: xp.element.content.entval.parsed.entity.reference.test
11592     @@@DEnt:
11593     @@@@test:value:
11594     <!DOCTYPE p [
11595     <!NOTATION n SYSTEM "notation">
11596     <!ENTITY ext SYSTEM "system" NDATA n>
11597     <!ENTITY c "&ext;">
11598     ]>
11599     <p>&c;</p>
11600     @@@c:erred: <[[xp|wf-parsed-entity]]> { }
11601     @@XMLTest:
11602     @@@QName: xp.attval.entval.parsed.entity.reference.test
11603     @@@DEnt:
11604     @@@@test:value:
11605     <!DOCTYPE p [
11606     <!NOTATION n SYSTEM "notation">
11607     <!ENTITY ext SYSTEM "system" NDATA n>
11608     <!ENTITY c "&ext;">
11609     ]>
11610     <p a="&c;"/>
11611     @@@c:erred: <[[xp|wf-no-external-entity-references]]> { }
11612     @@@c:erred: <[[xp|wf-parsed-entity]]> { }
11613    
11614     @@XMLTest:
11615     @@@QName: xp.element.content.no.recursion.direct.test
11616     @@@DEnt:
11617     @@@@test:value:
11618     <!DOCTYPE p [
11619     <!ENTITY c "&c;">
11620     ]>
11621     <p>&c;</p>
11622     @@@c:erred: <[[xp|wf-no-recursion]]> { (1, 1)..(1, 3); }
11623     @@XMLTest:
11624     @@@QName: xp.element.content.no.recursion.indirect.test
11625     @@@DEnt:
11626     @@@@test:value:
11627     <!DOCTYPE p [
11628     <!ENTITY d "&c;">
11629     <!ENTITY c "&d;">
11630     ]>
11631     <p>&c;</p>
11632     @@@c:erred: <[[xp|wf-no-recursion]]> { /* |d| */ (1, 1)..(1, 3); }
11633     @@XMLTest:
11634     @@@QName: xp.attval.no.recursion.direct.test
11635     @@@DEnt:
11636     @@@@test:value:
11637     <!DOCTYPE p [
11638     <!ENTITY c "&c;">
11639     ]>
11640     <p a="&c;"/>
11641     @@@c:erred: <[[xp|wf-no-recursion]]> { (1, 1)..(1, 3); }
11642     @@XMLTest:
11643     @@@QName: xp.attval.no.recursion.indirect.test
11644     @@@DEnt:
11645     @@@@test:value:
11646     <!DOCTYPE p [
11647     <!ENTITY d "&c;">
11648     <!ENTITY c "&d;">
11649     ]>
11650     <p a="&c;"/>
11651     @@@c:erred: <[[xp|wf-no-recursion]]> { /* |d| */ (1, 1)..(1, 3); }
11652     @@XMLTest:
11653     @@@QName: xp.reptxt.element.content.no.recursion.direct.test
11654     @@@DEnt:
11655     @@@@test:value:
11656     <!DOCTYPE p [
11657     <!ENTITY c "&c;">
11658     <!ENTITY e "&#x26;c;">
11659     ]>
11660     <p>&e;</p>
11661     @@@c:erred: <[[xp|wf-no-recursion]]> { /* |e| */ (1, 1)..(1, 3); }
11662     @@XMLTest:
11663     @@@QName: xp.reptxt.element.content.no.recursion.indirect.test
11664     @@@DEnt:
11665     @@@@test:value:
11666     <!DOCTYPE p [
11667     <!ENTITY d "&c;">
11668     <!ENTITY c "&d;">
11669     <!ENTITY e "&#x26;c;">
11670     ]>
11671     <p>&e;</p>
11672     @@@c:erred: <[[xp|wf-no-recursion]]> { /* |d| */ (1, 1)..(1, 3); }
11673     @@XMLTest:
11674     @@@QName: xp.reptxt.attval.no.recursion.direct.test
11675     @@@DEnt:
11676     @@@@test:value:
11677     <!DOCTYPE p [
11678     <!ENTITY c "&c;">
11679     <!ENTITY e "&#x26;c;">
11680     ]>
11681     <p a="&e;"/>
11682     @@@c:erred: <[[xp|wf-no-recursion]]> { /* |e| */ (1, 1)..(1, 3); }
11683     @@XMLTest:
11684     @@@QName: xp.reptxt.attval.no.recursion.indirect.test
11685     @@@DEnt:
11686     @@@@test:value:
11687     <!DOCTYPE p [
11688     <!ENTITY d "&c;">
11689     <!ENTITY c "&d;">
11690     <!ENTITY e "&#x26;c;">
11691     ]>
11692     <p a="&e;"/>
11693     @@@c:erred: <[[xp|wf-no-recursion]]> { /* |d| */ (1, 1)..(1, 3); }
11694    
11695     @@XMLTest:
11696     @@@QName: xp.ENTITY.system.ndata.name.test
11697     @@@DEnt:
11698     @@@@test:value:
11699     <!DOCTYPE a [
11700     <!NOTATION n SYSTEM "n">
11701     <!ENTITY % e SYSTEM "sys" NDATA n>
11702     ]><a/>
11703     @@@c:erred: <[[xp|wf-syntax-error]]> { (3, 26)..(3, 30); }
11704     @@XMLTest:
11705     @@@QName: xp.ENTITY.public.ndata.name.test
11706     @@@DEnt:
11707     @@@@test:value:
11708     <!DOCTYPE a [
11709     <!NOTATION n SYSTEM "n">
11710     <!ENTITY % e PUBLIC "pub" "sys" NDATA n>
11711     ]><a/>
11712     @@@c:erred: <[[xp|wf-syntax-error]]> { (3, 33)..(3, 37); }
11713     @@XMLTest:
11714     @@@QName: xp.ENTITY.public.ndata.name.-1.test
11715     @@@DEnt:
11716     @@@@test:value:
11717     <!DOCTYPE a [
11718     <!NOTATION n SYSTEM "n">
11719     <!ENTITY % e PUBLIC "pub" "sys" >
11720     ]><a/>
11721     @@@test:domTree:
11722     document { }
11723    
11724     @@XMLTest:
11725     @@@QName: xp.ENTITY.pubid.1.test
11726     @@@DEnt:
11727     @@@@test:value:
11728     <!DOCTYPE a [
11729     <!ENTITY e PUBLIC "p" "s">
11730     ]><a/>
11731     @@@test:domTree:
11732     document {
11733     document-type {
11734     general-entity {
11735     node-name: 'e';
11736     public-id: 'p';
11737     system-id: 's';
11738     }
11739     }
11740     element { }
11741     }
11742     @@XMLTest:
11743     @@@QName: xp.ENTITY.pubid.2.test
11744     @@@DEnt:
11745     @@@@test:value:
11746     <!DOCTYPE a [
11747     <!ENTITY e PUBLIC " p " "s">
11748     ]><a/>
11749     @@@test:domTree:
11750     document {
11751     document-type {
11752     general-entity {
11753     node-name: 'e';
11754     public-id: 'p';
11755     system-id: 's';
11756     }
11757     }
11758     element { }
11759     }
11760     @@XMLTest:
11761     @@@QName: xp.ENTITY.pubid.3.test
11762     @@@DEnt:
11763     @@@@test:value:
11764     <!DOCTYPE a [
11765     <!ENTITY e PUBLIC " p $u000Aq$u000A " "s">
11766     ]><a/>
11767     @@@test:domTree:
11768     document {
11769     document-type {
11770     general-entity {
11771     node-name: 'e';
11772     public-id: 'p q';
11773     system-id: 's';
11774     }
11775     }
11776     element { }
11777     }
11778     @@XMLTest:
11779     @@@QName: xp.ENTITY.pubid.4.test
11780     @@@DEnt:
11781     @@@@test:value:
11782     <!DOCTYPE a [
11783     <!ENTITY e PUBLIC " p $u000D$u000Aq" "s">
11784     ]><a/>
11785     @@@test:domTree:
11786     document {
11787     document-type {
11788     general-entity {
11789     node-name: 'e';
11790     public-id: 'p q';
11791     system-id: 's';
11792     }
11793     }
11794     element { }
11795     }
11796     @@XMLTest:
11797     @@@QName: xp.ENTITY.pubid.5.test
11798     @@@DEnt:
11799     @@@@test:value:
11800     <?xml version="1.1"?>
11801     <!DOCTYPE a [
11802     <!ENTITY e PUBLIC " p $u0085$u000Aq" "s">
11803     ]><a/>
11804     @@@test:domTree:
11805     document {
11806     document-type {
11807     general-entity {
11808     node-name: 'e';
11809     public-id: 'p q';
11810     system-id: 's';
11811     }
11812     }
11813     element { }
11814     }
11815    
11816 wakaba 1.24 @@XMLTest:
11817     @@@QName: xp.ENTITY.ignored.test
11818     @@@DEnt:
11819     @@@@test:value:
11820     <!DOCTYPE a [
11821     <!ENTITY e "a">
11822     <!ENTITY e "b">
11823     ]><a/>
11824     @@@test:domTree:
11825     document {
11826     document-type {
11827     general-entity {
11828     node-name: 'e';
11829     text-content: 'a';
11830     }
11831     }
11832     element { }
11833     }
11834     @@@c:erred:
11835     <[[xp|warning-entity-declaration-ignored]]> { (3, 1)..(3, 15); }
11836     @@XMLTest:
11837     @@@QName: xp.ENTITY.ignored.2.test
11838     @@@DEnt:
11839     @@@@test:value:
11840     <!DOCTYPE a [
11841     <!ENTITY % e "a">
11842     <!ENTITY % e "b">
11843     ]><a/>
11844     @@@test:domTree:
11845     document { }
11846     @@@c:erred:
11847     <[[xp|warning-entity-declaration-ignored]]> { (3, 1)..(3, 17); }
11848    
11849     @@XMLTest:
11850     @@@QName: xp.ENTITY.predefined.1.test
11851     @@@DEnt:
11852     @@@@test:value:
11853     <!DOCTYPE a [
11854     <!ENTITY lt "&#38;#60;">
11855     <!ENTITY gt "&#62;">
11856     <!ENTITY amp "&#38;#38;">
11857     <!ENTITY apos "&#39;">
11858     <!ENTITY quot "&#34;">
11859     <!ENTITY e "f">
11860     ]><a>&lt;&gt;&amp;&apos;&quot;</a>
11861     @@@test:domTree:
11862     document {
11863     document-type {
11864     general-entity {
11865     node-name: 'e';
11866     text-content: 'f';
11867     }
11868     }
11869     element {
11870     text-content: '<>&' U+0027 '"';
11871     }
11872     }
11873     @@XMLTest:
11874     @@@QName: xp.ENTITY.predefined.2.test
11875     @@@DEnt:
11876     @@@@test:value:
11877     <!DOCTYPE a [
11878     <!ENTITY lt "&#38;#60;">
11879     <!ENTITY gt "&#x26;#62;">
11880     <!ENTITY amp "&#38;#38;">
11881     <!ENTITY apos "&#x26;#39;">
11882     <!ENTITY quot "&#x26;#34;">
11883     <!ENTITY e "f">
11884     ]><a>&lt;&gt;&amp;&apos;&quot;</a>
11885     @@@test:domTree:
11886     document {
11887     document-type {
11888     general-entity {
11889     node-name: 'e';
11890     text-content: 'f';
11891     }
11892     }
11893     element {
11894     text-content: '<>&' U+0027 '"';
11895     }
11896     }
11897     @@XMLTest:
11898     @@@QName: xp.ENTITY.predefined.3.test
11899     @@@DEnt:
11900     @@@@test:value:
11901     <!DOCTYPE a [
11902     <!ENTITY lt "&#60;">
11903     <!ENTITY gt "&#62;">
11904     <!ENTITY amp "&#38;">
11905     <!ENTITY apos "&#39;">
11906     <!ENTITY quot "&#34;">
11907     <!ENTITY e "f">
11908     ]><a>&lt;&gt;&amp;&apos;&quot;</a>
11909     @@@c:erred: <[[xp|error-malformed-predefined-entity]]> { (2, 1)..(2, 24); }
11910     @@@c:erred: <[[xp|error-malformed-predefined-entity]]> { (4, 1)..(4, 24); }
11911     @@@test:domTree:
11912     document {
11913     document-type {
11914     general-entity {
11915     node-name: 'e';
11916     text-content: 'f';
11917     }
11918     }
11919     element {
11920     text-content: '<>&' U+0027 '"';
11921     }
11922     }
11923     @@XMLTest:
11924     @@@QName: xp.ENTITY.predefined.4.test
11925     @@@DEnt:
11926     @@@@test:value:
11927     <!DOCTYPE a [
11928     <!ENTITY lt "1">
11929     <!ENTITY gt "2">
11930     <!ENTITY amp "3">
11931     <!ENTITY apos "4">
11932     <!ENTITY quot "5">
11933     <!ENTITY e "f">
11934     ]><a>&lt;&gt;&amp;&apos;&quot;</a>
11935     @@@c:erred: <[[xp|error-malformed-predefined-entity]]> { (2, 1)..(2, 24); }
11936     @@@c:erred: <[[xp|error-malformed-predefined-entity]]> { (3, 1)..(3, 24); }
11937     @@@c:erred: <[[xp|error-malformed-predefined-entity]]> { (4, 1)..(4, 24); }
11938     @@@c:erred: <[[xp|error-malformed-predefined-entity]]> { (5, 1)..(5, 24); }
11939     @@@c:erred: <[[xp|error-malformed-predefined-entity]]> { (6, 1)..(6, 24); }
11940     @@@test:domTree:
11941     document {
11942     document-type {
11943     general-entity {
11944     node-name: 'e';
11945     text-content: 'f';
11946     }
11947     }
11948     element {
11949     text-content: '<>&' U+0027 '"';
11950     }
11951     }
11952     @@XMLTest:
11953     @@@QName: xp.ENTITY.predefined.5.test
11954     @@@DEnt:
11955     @@@@test:value:
11956     <!DOCTYPE a [
11957     <!ENTITY lt SYSTEM "1">
11958     <!ENTITY gt SYSTEM "2">
11959     <!ENTITY amp SYSTEM "3">
11960     <!ENTITY apos SYSTEM "4">
11961     <!ENTITY quot SYSTEM "5">
11962     <!ENTITY e "f">
11963     ]><a>&lt;&gt;&amp;&apos;&quot;</a>
11964     @@@c:erred: <[[xp|error-internal-predefined-entity]]> { (2, 1)..(2, 27); }
11965     @@@c:erred: <[[xp|error-internal-predefined-entity]]> { (3, 1)..(3, 27); }
11966     @@@c:erred: <[[xp|error-internal-predefined-entity]]> { (4, 1)..(4, 27); }
11967     @@@c:erred: <[[xp|error-internal-predefined-entity]]> { (5, 1)..(5, 27); }
11968     @@@c:erred: <[[xp|error-internal-predefined-entity]]> { (6, 1)..(6, 27); }
11969     @@@test:domTree:
11970     document {
11971     document-type {
11972     general-entity {
11973     node-name: 'e';
11974     text-content: 'f';
11975     }
11976     }
11977     element {
11978     text-content: '<>&' U+0027 '"';
11979     }
11980     }
11981     @@XMLTest:
11982     @@@QName: xp.ENTITY.predefined.6.test
11983     @@@DEnt:
11984     @@@@test:value:
11985     <!DOCTYPE a [
11986     <!ENTITY % lt SYSTEM "1">
11987     <!ENTITY % gt SYSTEM "2">
11988     <!ENTITY % amp SYSTEM "3">
11989     <!ENTITY % apos SYSTEM "4">
11990     <!ENTITY % quot SYSTEM "5">
11991     <!ENTITY e "f">
11992     ]><a>&lt;&gt;&amp;&apos;&quot;</a>
11993     @@@test:domTree:
11994     document {
11995     document-type {
11996     general-entity {
11997     node-name: 'e';
11998     text-content: 'f';
11999     }
12000     }
12001     element {
12002     text-content: '<>&' U+0027 '"';
12003     }
12004     }
12005     @@XMLTest:
12006     @@@QName: xp.ENTITY.predefined.7.test
12007     @@@DEnt:
12008     @@@@test:value:
12009     <!DOCTYPE a [
12010     <!ENTITY lt "&#38;#x3C;">
12011     <!ENTITY gt "&#x3E;">
12012     <!ENTITY amp "&#38;#x26;">
12013     <!ENTITY apos "&#x27;">
12014     <!ENTITY quot "&#x22;">
12015     <!ENTITY e "f">
12016     ]><a>&lt;&gt;&amp;&apos;&quot;</a>
12017     @@@test:domTree:
12018     document {
12019     document-type {
12020     general-entity {
12021     node-name: 'e';
12022     text-content: 'f';
12023     }
12024     }
12025     element {
12026     text-content: '<>&' U+0027 '"';
12027     }
12028     }
12029     @@XMLTest:
12030     @@@QName: xp.ENTITY.predefined.8.test
12031     @@@DEnt:
12032     @@@@test:value:
12033     <!DOCTYPE a [
12034     <!ENTITY lt "&#38;#x3c;">
12035     <!ENTITY gt "&#x3e;">
12036     <!ENTITY amp "&#38;#x26;">
12037     <!ENTITY apos "&#x27;">
12038     <!ENTITY quot "&#x22;">
12039     <!ENTITY e "f">
12040     ]><a>&lt;&gt;&amp;&apos;&quot;</a>
12041     @@@test:domTree:
12042     document {
12043     document-type {
12044     general-entity {
12045     node-name: 'e';
12046     text-content: 'f';
12047     }
12048     }
12049     element {
12050     text-content: '<>&' U+0027 '"';
12051     }
12052     }
12053     @@XMLTest:
12054     @@@QName: xp.ENTITY.predefined.9.test
12055     @@@DEnt:
12056     @@@@test:value:
12057     <!DOCTYPE a [
12058     <!ENTITY lt "&#38;#x00003C;">
12059     <!ENTITY gt "&#x0003E;">
12060     <!ENTITY amp "&#38;#x026;">
12061     <!ENTITY apos "&#x000027;">
12062     <!ENTITY quot "&#x0022;">
12063     <!ENTITY e "f">
12064     ]><a>&lt;&gt;&amp;&apos;&quot;</a>
12065     @@@test:domTree:
12066     document {
12067     document-type {
12068     general-entity {
12069     node-name: 'e';
12070     text-content: 'f';
12071     }
12072     }
12073     element {
12074     text-content: '<>&' U+0027 '"';
12075     }
12076     }
12077     @@XMLTest:
12078     @@@QName: xp.ENTITY.predefined.10.test
12079     @@@DEnt:
12080     @@@@test:value:
12081     <!DOCTYPE a [
12082     <!ENTITY lt "&#38;#00060;">
12083     <!ENTITY gt "&#062;">
12084     <!ENTITY amp "&#38;#000038;">
12085     <!ENTITY apos "&#0000039;">
12086     <!ENTITY quot "&#0034;">
12087     <!ENTITY e "f">
12088     ]><a>&lt;&gt;&amp;&apos;&quot;</a>
12089     @@@test:domTree:
12090     document {
12091     document-type {
12092     general-entity {
12093     node-name: 'e';
12094     text-content: 'f';
12095     }
12096     }
12097     element {
12098     text-content: '<>&' U+0027 '"';
12099     }
12100     }
12101    
12102 wakaba 1.5 @@PerlDef:
12103     my $impl = $Message::DOM::ImplementationRegistry->get_implementation ({
12104     'Core' => '3.0',
12105     'XML' => '3.0',
12106     'XMLVersion' => ['1.0', '1.1'],
12107     });
12108     my $parser = <Class::ManakaiXMLParser>->new ($impl);
12109    
12110     for my $test_data (@$TestData) {
12111     $test->start_new_test ($test_data->{uri});
12112     my $doc_ent = $test_data->{entity}->{$test_data->{root_uri}};
12113 wakaba 1.14 my $not_ok;
12114 wakaba 1.12
12115     $parser->dom_config->set_parameter ('error-handler' => sub ($$) {
12116     my (undef, $err) = @_;
12117     my $err_type = $err->type;
12118     if ($test_data->{dom_error}->{$err_type}) {
12119     $test->assert_error_equals
12120     (actual_value => $err,
12121 wakaba 1.15 expected_hash => shift @{$test_data->{dom_error}
12122     ->{$err_type}});
12123 wakaba 1.12 } else { # Uncatched error
12124     warn $err;
12125 wakaba 1.14 unless ($err->severity == <C::c|DOMError.SEVERITY_WARNING>) {
12126     $test->failure_comment ('Unexpected error |'.$err->type.'|');
12127     $not_ok = true;
12128     }
12129 wakaba 1.12 }
12130     return true; # continue as far as possible
12131     });
12132    
12133     if ($test_data->{dom_tree}) { # Successful test
12134     try {
12135     my $doc = $parser->parse_string ($doc_ent->{<H::test:value>});
12136     $test->assert_dom_tree_equals
12137     (actual_value => $doc,
12138     expected_hash => $test_data->{dom_tree});
12139     for (values %{$test_data->{dom_error}||{}}) {
12140     if (@$_) {
12141     $test->failure_comment
12142     (@$_.' |DOMError|s of type |'.
12143 wakaba 1.13 $_->[0]->{type}->{value}.'| are not reported');
12144 wakaba 1.14 $not_ok = true;
12145 wakaba 1.12 }
12146     }
12147 wakaba 1.14 $not_ok ? $test->not_ok : $test->ok;
12148 wakaba 1.12 } catch Message::Util::IF::DTException with {
12149     #
12150     } catch Message::DOM::IF::LSException with {
12151 wakaba 1.14 # not_ok
12152     } otherwise {
12153     my $err = shift;
12154     warn $err;
12155     $test->not_ok;
12156 wakaba 1.12 };
12157     } else {
12158     try {
12159     my $doc = $parser->parse_string ($doc_ent->{<H::test:value>});
12160     } catch Message::Util::IF::DTException with {
12161     #
12162     } catch Message::DOM::IF::LSException with {
12163     #
12164 wakaba 1.14 } otherwise {
12165     my $err = shift;
12166     warn $err;
12167     $test->not_ok;
12168 wakaba 1.12 };
12169     for (values %{$test_data->{dom_error}||{}}) {
12170     if (@$_) {
12171     $test->failure_comment
12172     (@$_.' |DOMError|s of type |'.
12173 wakaba 1.13 $_->[0]->{type}->{value}.'| are not reported');
12174 wakaba 1.14 $not_ok = true;
12175 wakaba 1.12 }
12176     }
12177 wakaba 1.14 $not_ok ? $test->not_ok : $test->ok;
12178 wakaba 1.12 }
12179 wakaba 1.5 }
12180 wakaba 1.6
12181     @ResourceDef:
12182 wakaba 1.19 @@QName: getEmptyEntityState
12183     @@rdf:type: DISPerl|InlineCode
12184     @@ForCheck: ManakaiDOM|ForClass
12185     @@PerlDef:
12186     {reptxt => \'', line => 1, column => 1, pos => 0,
12187 wakaba 1.23 is_externally_declared => true, name => $name}
12188 wakaba 1.19
12189     @ResourceDef:
12190 wakaba 1.6 @@QName: getCopyOfEntityState
12191     @@rdf:type: DISPerl|InlineCode
12192     @@ForCheck: ManakaiDOM|ForClass
12193     @@PerlDef:
12194     {%{$self->{$entity_type}->{$entity_name}},
12195     line => 1, column => 1, pos => 0}
12196 wakaba 1.1 ##ManakaiXMLParser
12197 wakaba 1.5
12198     ElementTypeBinding:
12199     @Name: XMLTests
12200     @ElementType:
12201     dis:ResourceDef
12202     @ShadowContent:
12203     @@ForCheck: ManakaiDOM|ForClass
12204     @@rdf:type: test|ParserTestSet
12205    
12206     ElementTypeBinding:
12207     @Name: XMLTest
12208     @ElementType:
12209     dis:ResourceDef
12210     @ShadowContent:
12211     @@ForCheck: ManakaiDOM|ForClass
12212     @@rdf:type: test|ParserTest
12213    
12214     ElementTypeBinding:
12215     @Name: DEnt
12216     @ElementType:
12217     dis:ResourceDef
12218     @ShadowContent:
12219     @@rdf:type: test|RootEntity
12220    
12221     ElementTypeBinding:
12222     @Name: Ent
12223     @ElementType:
12224     dis:ResourceDef
12225     @ShadowContent:
12226     @@rdf:type: test|Entity
12227 wakaba 1.1
12228 wakaba 1.3 ResourceDef:
12229     @QName: xp|get-location-from-token
12230     @rdf:type: DISPerl|BlockCode
12231     @enDesc:
12232     Creates a <IF::DOMCore:DOMLocator> object from a token.
12233     @PerlDef:
12234 wakaba 1.14 my $__d = $token->{type} ne '#EOF'
12235     ? $token->{location}->{char_d}
12236     : 0;
12237 wakaba 1.15 $__d -= $token->{location_d} if $token->{location_d};
12238 wakaba 1.3 $result = {
12239 wakaba 1.14 utf32_offset => $token->{location}->{pos} - $__d,
12240     line_number => $token->{location}->{line},
12241     column_number => $token->{location}->{column} - $__d,
12242 wakaba 1.3 };
12243 wakaba 1.14 $result->{utf32_offset} = 0 if $result->{utf32_offset} < 0;
12244     $result->{column_number} = 0 if $result->{column_number} < 0;
12245     ## 0 or 1, which should be?
12246 wakaba 1.3 @For: ManakaiDOM|ManakaiDOM3
12247 wakaba 1.1
12248     ElementTypeBinding:
12249     @Name: RuleDef
12250     @ElementType:
12251     dis:ResourceDef
12252     @ShadowContent:
12253     @@ForCheck: ManakaiDOM|ForClass
12254     @@rdf:type: Muf2003|RuleDefClass
12255    
12256     ElementTypeBinding:
12257     @Name: RuleParam
12258     @ElementType:
12259     dis:ResourceDef
12260     @ShadowContent:
12261     @@rdf:type: Muf2003|RuleParameter
12262    
12263     ElementTypeBinding:
12264     @Name: enImplNote
12265     @ElementType:
12266     dis:ImplNote
12267     @ShadowContent:
12268     @@lang:en
12269    
12270     ElementTypeBinding:
12271 wakaba 1.24 @Name: WFErrDef
12272 wakaba 1.1 @ElementType:
12273     dis:ResourceDef
12274     @ShadowContent:
12275     @@rdf:type: DOMCore|DOMErrorType
12276     @@For: ManakaiDOM|DOM3
12277     @@ecore:textFormatter: ManakaiXMLParserExceptionFormatter
12278 wakaba 1.24 @@c:severity: c|SEVERITY_FATAL_ERROR
12279 wakaba 1.1
12280 wakaba 1.3 ElementTypeBinding:
12281 wakaba 1.24 @Name: FatalErrDef
12282 wakaba 1.3 @ElementType:
12283     dis:ResourceDef
12284     @ShadowContent:
12285     @@rdf:type: DOMCore|DOMErrorType
12286     @@For: ManakaiDOM|DOM3
12287     @@ecore:textFormatter: ManakaiXMLParserExceptionFormatter
12288 wakaba 1.24 @@c:severity: c|SEVERITY_FATAL_ERROR
12289    
12290     ElementTypeBinding:
12291     @Name: VCErrDef
12292     @ElementType:
12293     dis:ResourceDef
12294     @ShadowContent:
12295     @@rdf:type: c|DOMErrorType
12296     @@For: ManakaiDOM|DOM3
12297     @@ecore:textFormatter: ManakaiXMLParserExceptionFormatter
12298     @@c:severity: c|SEVERITY_ERROR
12299    
12300     ElementTypeBinding:
12301     @Name: ErrDef
12302     @ElementType:
12303     dis:ResourceDef
12304     @ShadowContent:
12305     @@rdf:type: c|DOMErrorType
12306     @@For: ManakaiDOM|DOM3
12307     @@ecore:textFormatter: ManakaiXMLParserExceptionFormatter
12308     @@c:severity: c|SEVERITY_ERROR
12309 wakaba 1.3
12310 wakaba 1.16 ElementTypeBinding:
12311 wakaba 1.24 @Name: WarnDef
12312 wakaba 1.16 @ElementType:
12313     dis:ResourceDef
12314     @ShadowContent:
12315 wakaba 1.24 @@rdf:type: c|DOMErrorType
12316 wakaba 1.16 @@For: ManakaiDOM|DOM3
12317     @@ecore:textFormatter: ManakaiXMLParserExceptionFormatter
12318 wakaba 1.24 @@c:severity: c|SEVERITY_WARNING
12319 wakaba 1.16
12320 wakaba 1.3 WFErrDef:
12321     @QName: xp|wf-syntax-error
12322     @enDesc:
12323     The entity does not match to the production rule; it is not
12324     well-formed.
12325     @enMufDef:
12326     |%xp-error-token-type;|%xp-error-token-value
12327     (prefix => { (|}, suffix => {|)}); is not
12328     allowed%xp-error-lines (prefix => { (|}, suffix => {|)});
12329     @ecore:hasParameter:
12330     @@@: xp|error-token
12331     @@enDesc:
12332     The token that is not allowed.
12333    
12334     WFErrDef:
12335     @QName: xp|wf-pi-target-is-xml
12336     @enDesc:
12337     A processing instruction has its <CODE::PITarget> of
12338     <XML::xml> (in any case) which is not allowed.
12339     @enMufDef:
12340     Processing instruction target name cannot be |%p
12341     (name => {<Q::xp|name>});|
12342     @ecore:hasParameter:
12343     @@@: xp|error-token
12344     @@enDesc:
12345     The token that contains the name.
12346     @ecore:hasParameter:
12347     @@@: xp|name
12348     @@enDesc:
12349     A string that is specified as target name of the
12350     processing instruction.
12351     @ecore:hasParameter: xp|parent
12352    
12353     WFErrDef:
12354     @QName: xp|wf-no-end-tag
12355     @enDesc:
12356     An end-tag is not found.
12357     @enMufDef:
12358     End-tag |</%p (name => {<Q::xp|expected-element-type>});>| is required
12359     @ecore:hasParameter: xp|error-token
12360     @ecore:hasParameter:
12361     @@@: xp|node
12362     @@enDesc:
12363     The element node that is not closed.
12364     @ecore:hasParameter:
12365     @@@: xp|expected-element-type
12366     @@enDesc:
12367     The element type name of the element that is not closed.
12368    
12369     WFErrDef:
12370     @QName: xp|wf-unsupported-xml-version
12371     @enDesc:
12372     The XML version specified in the version declaration is not supported.
12373     @enMufDef:
12374     XML version |%p (name => {<Q::infoset|version>});| is not supported
12375     @ecore:hasParameter: xp|bad-token
12376     @ecore:hasParameter:
12377     @@@: xp|parent
12378     @@enDesc:
12379     The document node.
12380     @ecore:hasParameter:
12381     @@@: infoset|version
12382     @@enDesc:
12383     The specified XML version.
12384    
12385     WFErrDef:
12386     @QName: xp|wf-malformed-enc-name
12387     @enDesc:
12388     An <XA::encoding> pseudo-attribute value does not match
12389     to the procduction rule <CODE::EncName>.
12390     @enMufDef:
12391     Encoding name |%p (name => {<Q::xp|name>});| is not allowed
12392     @ecore:hasParameter: xp|error-token
12393     @ecore:hasParameter:
12394     @@@: xp|parent
12395     @@enDesc: The document node.
12396     @ecore:hasParameter:
12397     @@@: xp|name
12398     @@enDesc:
12399     The <XA::encoding> value.
12400    
12401     WFErrDef:
12402     @QName: xp|wf-malformed-xml-standalone
12403     @enDesc:
12404     An <XA::standalone> pseudo-attribute value is neither <XML::yes>
12405     or <XML::no>.
12406     @enMufDef:
12407     |standalone| pseudo-attribute value |%p (name => {<Q::xp|name>});|
12408     is not allowed
12409     @ecore:hasParameter: xp|error-token
12410     @ecore:hasParameter:
12411     @@@: xp|parent
12412     @@enDesc: The document node.
12413     @ecore:hasParameter:
12414     @@@: xp|name
12415     @@enDesc:
12416     The <XA::standalone> value.
12417    
12418     WFErrDef:
12419     @QName: xp|wf-legal-literal-character
12420     @enDesc:
12421     Each character in XML entity must match to the production
12422     rule <CODE::Char - RestrictedChar>.
12423     @enMufDef:
12424     Character %character-code-point
12425     (v => {<Q::xp|character-number>}); is not allowed
12426     @ecore:hasParameter:
12427     @@@: xp|character-number
12428     @@enDesc:
12429     The code position of the character being referred.
12430    
12431     WFErrDef:
12432     @QName: xp|wf-element-type-match
12433 wakaba 1.1 @enDesc:
12434 wakaba 1.3 The <CODE::Name> in an element's end-tag must match the element type
12435     in the start-tag.
12436     @enMufDef:
12437     End-tag |</%p (name => {<Q::xp|actual-element-type>});>| does
12438     not match to start-tag |<%p (name => {<Q::xp|expected-element-type>});>|
12439     @ecore:hasParameter: xp|error-token
12440     @ecore:hasParameter:
12441     @@@: xp|node
12442     @@enDesc:
12443     The current opening element node.
12444     @ecore:hasParameter:
12445     @@@: xp|expected-element-type
12446     @@enDesc:
12447     The element type name of the current element.
12448     @ecore:hasParameter:
12449     @@@: xp|actual-element-type
12450     @@enDesc:
12451     The <CODE::Name> occurs in the end-tag.
12452    
12453     WFErrDef:
12454     @QName: xp|wf-unique-att-spec
12455     @enDesc:
12456     An attribute name <kwd:MUST-NOT> appear more than once in
12457     the same start-tag or empty-element tag.
12458 wakaba 1.1 @enMufDef:
12459 wakaba 1.3 Attribute |%p (name => {<Q::xp|name>});| is specified more
12460     than once in the same tag
12461     @ecore:hasParameter: xp|error-token
12462     @ecore:hasParameter:
12463     @@@: xp|name
12464     @@enDesc:
12465     The name of the attribute.
12466 wakaba 1.18
12467     WFErrDef:
12468     @QName: xp|wf-no-external-entity-references
12469     @enDesc:
12470     Attribute values <kwd:MUST-NOT> contain direct or indirect
12471     entity references to external entities.
12472     @enMufDef:
12473     External entity |%p (name => {<Q::xp|name>});| is referenced
12474     in an attribute value literal
12475     @ecore:hasParameter: xp|error-token
12476     @ecore:hasParameter:
12477     @@@: xp|name
12478     @@enDesc:
12479     The name of the entity.
12480    
12481     WFErrDef:
12482     @QName: xp|wf-no-lt-in-attribute-values
12483     @enDesc:
12484     The replacement text of any entity referred to directly or indirectly
12485     in an attribute value literal <kwd:MUST-NOT> contain a
12486     <CHAR::LESS-THAN SIGN>.
12487     @enMufDef:
12488     Entity replacement text cannot contain a
12489     |LESS-THAN SIGN| since it is referenced from an attribute
12490     value literal
12491     @ecore:hasParameter: xp|error-token
12492 wakaba 1.3
12493     WFErrDef:
12494     @QName: xp|wf-legal-character
12495     @enDesc:
12496     Characters referred to using character references <kwd:MUST>
12497     match the production for <CODE::Char>.
12498     @enMufDef:
12499     Reference to character %character-code-point
12500     (v => {<Q::xp|character-number>}); is not allowed
12501     @ecore:hasParameter: xp|error-token
12502     @ecore:hasParameter:
12503     @@@: xp|character-number
12504     @@enDesc:
12505     The code position of the character being referred.
12506     @ecore:hasParameter:
12507     @@@: xp|parent
12508     @@enDesc:
12509     The parent node in which the character reference has
12510     occurred, if available.
12511 wakaba 1.19
12512     WFErrDef:
12513     @QName: xp|wf-entity-declared
12514     @enDesc:
12515     {P:: In a document
12516    
12517     - without any DTD,
12518    
12519     - with only an internal DTD subset that contains no parameter
12520     entity references, or
12521    
12522     - with <XML::standalone="yes">,
12523    
12524     for an entity reference that does not occur within the external
12525     subset or a parameter entity, the <CODE::Name> given in the
12526     entity reference <kwd:MUST> match the <CODE::Name> does not
12527     occur within the external subset or a parameter entity,
12528     except that five predefined character entities need not
12529     be declared. The declaration of a general entity <kwd:MUST>
12530     precede any reference to it which appears in a default value
12531     in an attribute list declaration.
12532     @enMufDef:
12533     Entity |%p (name => {<Q::xp|name>});| must be declared
12534     in the internal subset
12535 wakaba 1.23 @ecore:hasParameter: xp|error-token
12536     @ecore:hasParameter:
12537     @@@: xp|name
12538     @@enDesc:
12539     The name of the entity.
12540    
12541     WFErrDef:
12542     @QName: xp|wf-parsed-entity
12543     @enDesc:
12544     An entity reference <kwd:MUST-NOT> contain the name of an
12545     unparsed entity.
12546     @enMufDef:
12547     Entity |%p (name => {<Q::xp|name>});| is an unparsed entity
12548     @ecore:hasParameter: xp|error-token
12549     @ecore:hasParameter:
12550     @@@: xp|name
12551     @@enDesc:
12552     The name of the entity.
12553    
12554     WFErrDef:
12555     @QName: xp|wf-no-recursion
12556     @enDesc:
12557     A parsed entity <kwd:MUST-NOT> contain a recursive reference
12558     to itself, either directly or indirectly.
12559     @enMufDef:
12560     Entity |%p (name => {<Q::xp|name>});| is recursively referenced
12561 wakaba 1.19 @ecore:hasParameter: xp|error-token
12562     @ecore:hasParameter:
12563     @@@: xp|name
12564     @@enDesc:
12565     The name of the entity.
12566 wakaba 1.16
12567     FatalErrDef:
12568     @QName: xp|fatal-xml11-end-of-line-in-xml-declaration
12569     @enDesc:
12570     An end-of-line character <CODE::U+0085> or <CODE::U+2028> is appeared
12571     within an XML declaration or text declaration.
12572     @enMufDef:
12573     End-of-line character %character-code-point
12574     (v => {<Q::xp|character-number>}); cannot be used within the
12575     XML or text declaration
12576     @ecore:hasParameter:
12577     @@@: xp|character-number
12578     @@enDesc:
12579     The code position of the end-of-line character.
12580 wakaba 1.24
12581     ErrDef:
12582     @QName: xp|error-internal-predefined-entity
12583     @enDesc:
12584     A general entity declaration whose <CODE::Name> equals to one
12585     of predefined entities <kwd:MUST> declare it as an internal entity.
12586     @enMufDef:
12587     Entity |%p (name => {<Q::xp|name>});| must be declared as an
12588     internal entity
12589     @ecore:hasParameter: xp|error-token
12590     @ecore:hasParameter:
12591     @@@: xp|name
12592     @@enDesc:
12593     The name of the entity.
12594    
12595     ErrDef:
12596     @QName: xp|error-malformed-predefined-entity
12597     @enDesc:
12598     A general entity declaration whose <CODE::Name> equals to one
12599     of predefined entities <kwd:MUST> declare it as a data
12600     character for the entity.
12601     @enMufDef:
12602     Entity declaration for |%p (name => {<Q::xp|name>});|
12603     (replacement text |%p (name => {<Q::xp|replacement-text>});|) is malformed
12604     @ecore:hasParameter: xp|error-token
12605     @ecore:hasParameter:
12606     @@@: xp|name
12607     @@enDesc:
12608     The name of the entity.
12609     @ecore:hasParameter:
12610     @@@: xp|replacement-text
12611     @@enDesc:
12612     The replacement text of the entity declaration.
12613    
12614     WarnDef:
12615     @QName: xp|warning-entity-declaration-ignored
12616     @enDesc:
12617     An entity declaration is ignored because the same entity
12618     is declared before.
12619     @enMufDef:
12620     Entity declaration for |%p (name => {<Q::xp|name>});| is ignored
12621     @ecore:hasParameter: xp|error-token
12622     @ecore:hasParameter:
12623     @@@: xp|name
12624     @@enDesc:
12625     The name of the entity.
12626    
12627     VCErrDef:
12628     @QName: xp|vc-unique-notation-name
12629     @enDesc:
12630     A <CODE::Name> <kwd:MUST-NOT> be declared in more than
12631     one notation declaration.
12632     @enMufDef:
12633     Notation |%p (name => {<Q::xp|name>});| is already declared
12634     @ecore:hasParameter: xp|error-token
12635     @ecore:hasParameter:
12636     @@@: xp|name
12637     @@enDesc:
12638     The name of the notation.
12639    
12640     XWParam:
12641     @QName: xp|replacement-text
12642     @enDesc:
12643     The replacement text.
12644 wakaba 1.1
12645 wakaba 1.3 XWParam:
12646 wakaba 1.1 @QName: xp|error-token
12647     @enDesc:
12648     The token where the parser found an error.
12649    
12650 wakaba 1.3 XWParam:
12651     @QName: xp|name
12652     @enDesc:
12653     A name.
12654    
12655     XWParam:
12656     @QName: xp|parent
12657     @enDesc:
12658     The parent node in which the error occurs.
12659    
12660     XWParam:
12661     @QName: xp|node
12662     @enDesc:
12663     The current node.
12664    
12665     XWParam:
12666     @QName: xp|actual-element-type
12667     @enDesc:
12668     The actual element type name occured in the source.
12669    
12670     XWParam:
12671     @QName: xp|expected-element-type
12672 wakaba 1.1 @enDesc:
12673 wakaba 1.3 The element type name expected.
12674    
12675     XWParam:
12676     @QName: xp|character-number
12677     @enDesc:
12678     The character code position.
12679    
12680     ElementTypeBinding:
12681     @Name: XWParam
12682     @ElementType:
12683     dis:ResourceDef
12684     @ShadowContent:
12685     @@For: =ManakaiDOM|all
12686     @@rdf:type: ecore|Parameter
12687 wakaba 1.1
12688     ElementTypeBinding:
12689     @Name:enMufDef
12690     @ElementType:
12691     ecore:defaultMessage
12692     @ShadowContent:
12693     @@lang:en
12694     @@ContentType:
12695     lang:muf
12696    
12697     ResourceDef:
12698     @QName: DOMImpl
12699     @AliasFor: DOMCore|DOMImplementation
12700     @For: ManakaiDOM|DOM
12701    
12702     ElementTypeBinding:
12703     @Name: Attr
12704     @ElementType:
12705     dis:ResourceDef
12706     @ShadowContent:
12707     @@rdf:type: DISLang|Attribute
12708     @@ForCheck: !=ManakaiDOM|ManakaiDOM
12709    
12710     ElementTypeBinding:
12711     @Name: Get
12712     @ElementType:
12713     dis:ResourceDef
12714     @ShadowContent:
12715     @@rdf:type: DISLang|AttributeGet
12716    
12717     ElementTypeBinding:
12718     @Name: Set
12719     @ElementType:
12720     dis:ResourceDef
12721     @ShadowContent:
12722     @@rdf:type: DISLang|AttributeSet
12723    
12724     ElementTypeBinding:
12725     @Name: enDesc
12726     @ElementType:
12727     dis:Description
12728     @ShadowContent:
12729     @@lang:en
12730    
12731     ElementTypeBinding:
12732     @Name: Method
12733     @ElementType:
12734     dis:ResourceDef
12735     @ShadowContent:
12736     @@rdf:type: DISLang|Method
12737     @@For: !=ManakaiDOM|ManakaiDOM
12738    
12739     ElementTypeBinding:
12740     @Name: Return
12741     @ElementType:
12742     dis:ResourceDef
12743     @ShadowContent:
12744     @@rdf:type: DISLang|MethodReturn
12745    
12746     ElementTypeBinding:
12747     @Name: Param
12748     @ElementType:
12749     dis:ResourceDef
12750     @ShadowContent:
12751     @@rdf:type: DISLang|MethodParameter
12752    
12753     ElementTypeBinding:
12754     @Name: PerlDef
12755     @ElementType:
12756     dis:Def
12757     @ShadowContent:
12758     @@ContentType: lang|Perl
12759    
12760     ElementTypeBinding:
12761     @Name: PropDef
12762     @ElementType:
12763     dis:ResourceDef
12764     @ShadowContent:
12765     @@rdf:type: rdf|Property
12766    
12767     ClsDef:
12768     @ClsQName: ManakaiXMLParserExceptionFormatter
12769    
12770     @ClsISA: ecore|MUErrorFormatter||ManakaiDOM|Perl
12771    
12772     @RuleDef:
12773     @@Name: xp-error-token-type
12774     @@enDesc:
12775     The type of the token the parser is encountered.
12776    
12777     @@Method:
12778     @@@Name: after
12779     @@@Param:
12780     @@@@Name: name
12781     @@@@Type: DOMString
12782     @@@@enDesc: The name of the method.
12783     @@@Param:
12784     @@@@Name: p
12785     @@@@Type: DISPerl|HASH
12786     @@@@enDesc: The set of the parameters to the method.
12787     @@@Param:
12788     @@@@Name: o
12789     @@@@Type: DISPerl|HASH
12790     @@@@enDesc: The option value.
12791     @@@Return:
12792     @@@@PerlDef:
12793     $p->{-result} = $o->{<H::xp|error-token>}->{type}
12794     if defined $o->{<H::xp|error-token>}->{type};
12795    
12796     @RuleDef:
12797     @@Name: xp-error-token-value
12798     @@enDesc:
12799     The value of the token the parser is encountered, if any.
12800    
12801     @@Method:
12802     @@@Name: after
12803     @@@Param:
12804     @@@@Name: name
12805     @@@@Type: DOMString
12806     @@@@enDesc: The name of the method.
12807     @@@Param:
12808     @@@@Name: p
12809     @@@@Type: DISPerl|HASH
12810     @@@@enDesc: The set of the parameters to the method.
12811     @@@Param:
12812     @@@@Name: o
12813     @@@@Type: DISPerl|HASH
12814     @@@@enDesc: The option value.
12815     @@@Return:
12816     @@@@PerlDef:
12817     $p->{-result} = $o->{<H::xp|error-token>}->{value}
12818     if defined $o->{<H::xp|error-token>}->{value};
12819    
12820     @RuleDef:
12821     @@Name: xp-error-lines
12822     @@enDesc:
12823     A copy of fragment of the source text that contains the line
12824     where the error occurred, if available.
12825    
12826     @@Method:
12827     @@@Name: after
12828     @@@Param:
12829     @@@@Name: name
12830     @@@@Type: DOMString
12831     @@@@enDesc: The name of the method.
12832     @@@Param:
12833     @@@@Name: p
12834     @@@@Type: DISPerl|HASH
12835     @@@@enDesc: The set of the parameters to the method.
12836     @@@Param:
12837     @@@@Name: o
12838     @@@@Type: DISPerl|HASH
12839     @@@@enDesc: The option value.
12840     @@@Return:
12841     @@@@PerlDef:
12842     my $pos = $o-><AG::DOMCore|DOMError.location>
12843     -><AG::DOMCore|DOMLocator.utf32Offset>;
12844     if ($pos > -1) {
12845 wakaba 1.6 my $src = $o->{<H::ecore|object>}->{entity}->[-1]->{reptxt};
12846 wakaba 1.1 my $start = $pos;
12847     $start = rindex ($$src, "\x0A", $start - 1) for 0..2;
12848     $start++;
12849     my $end = $pos;
12850     $end = index ($$src, "\x0A", $end + 1) for 0..2;
12851     $end = length $$src if $end < 0;
12852     $p->{-result} = substr $$src, $start, $end - $start;
12853     }
12854 wakaba 1.3
12855     @RuleDef:
12856     @@Name: character-code-point
12857     @@enDesc:
12858     The character code position, in <CODE::U+<VAR::HHHH>> notation.
12859    
12860     @@Method:
12861     @@@Name: after
12862     @@@Param:
12863     @@@@Name: name
12864     @@@@Type: DOMString
12865     @@@@enDesc: The name of the method.
12866     @@@Param:
12867     @@@@Name: p
12868     @@@@Type: DISPerl|HASH
12869     @@@@enDesc: The set of the parameters to the method.
12870     @@@Param:
12871     @@@@Name: o
12872     @@@@Type: DISPerl|HASH
12873     @@@@enDesc: The option value.
12874     @@@RuleParam:
12875     @@@@Name: v
12876     @@@@Type: DISPerl|Number
12877     @@@@enDesc:
12878     The name of the error parameter that contains the character code.
12879     @@@Return:
12880     @@@@PerlDef:
12881     $p->{-result} = sprintf 'U+%04X', $o->{$p->{v}};
12882 wakaba 1.1 ##XMLParserExceptionFormatter

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24