/[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.29 - (hide annotations) (download)
Sun Mar 5 12:42:48 2006 UTC (18 years, 8 months ago) by wakaba
Branch: MAIN
Changes since 1.28: +215 -5 lines
++ manakai/lib/Message/DOM/ChangeLog	5 Mar 2006 12:42:29 -0000
	* XMLParser.dis (parse): Sets |Document.documentURI|
	and |Document.manakaiEntityBaseURI| attributes of the
	document created.
	(_ProcessingInstructionDTD): Sets the |manakaiBaseURI|
	property of the created node.
	(_SystemLiteral): Sets the |manakaiDeclarationBaseURI|
	of the created node.
	(ls-input-to-input-file.default): Sets the resolved
	system identifier to the |documentURI| attribute if available.
	Sets the |baseURI| attribute if available.

2006-03-05  Wakaba  <wakaba@suika.fam.cx>

++ manakai/lib/Message/URI/ChangeLog	5 Mar 2006 12:42:42 -0000
2006-03-05  Wakaba  <wakaba@suika.fam.cx>

	* Generic.dis (new): New method.

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.29 $Date: 2006/02/18 07:39:04 $
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.29 @urigen:
75     http://suika.fam.cx/~wakaba/archive/2005/manakai/URI/Generic/
76 wakaba 1.8 @x:
77     http://suika.fam.cx/~wakaba/archive/2004/dom/xml#
78 wakaba 1.1 @xml:
79     http://www.w3.org/XML/1998/namespace
80 wakaba 1.9 @xml-dtd:
81     http://www.w3.org/TR/REC-xml
82 wakaba 1.1 @xmlns:
83     http://www.w3.org/2000/xmlns/
84     @xp:
85     http://suika.fam.cx/~wakaba/archive/2004/dom/xml-parser#
86    
87     ## -- Features
88    
89     ElementTypeBinding:
90     @Name: FeatureDef
91     @ElementType:
92     dis:ResourceDef
93     @ShadowContent:
94     @@rdf:type: f|Feature
95     @@For: =ManakaiDOM|all
96    
97     ElementTypeBinding:
98     @Name: FeatureVerDef
99     @ElementType:
100     dis:ResourceDef
101     @ShadowContent:
102     @@rdf:type: f|Feature
103    
104     ElementTypeBinding:
105     @Name: featureQName
106     @ElementType:
107     f:name
108     @ShadowContent:
109     @@ContentType: DISCore|QName
110    
111     ResourceDef:
112     @QName: DOMString
113     @AliasFor: DOMMain|DOMString
114     @For: ManakaiDOM|DOM
115    
116     ResourceDef:
117     @QName: Node
118     @AliasFor: t|Node
119     @For: ManakaiDOM|DOM
120    
121     ResourceDef:
122     @QName: Element
123     @AliasFor: t|Element
124     @For: ManakaiDOM|DOM
125    
126     ResourceDef:
127     @QName: Document
128     @AliasFor: t|Document
129     @For: ManakaiDOM|DOM
130    
131 wakaba 1.6 ResourceDef:
132     @QName: DocumentXDoctype
133     @AliasFor: d|DocumentXDoctype
134     @For: ManakaiDOM|DOM
135    
136 wakaba 1.8 ResourceDef:
137     @QName: DTDef
138     @AliasFor: d|DocumentTypeDefinition
139     @For: ManakaiDOM|DOM
140    
141     ResourceDef:
142     @QName: ETDef
143     @AliasFor: d|ElementTypeDefinition
144     @For: ManakaiDOM|DOM
145    
146     ResourceDef:
147     @QName: ATDef
148     @AliasFor: d|AttributeDefinition
149     @For: ManakaiDOM|DOM
150    
151 wakaba 1.1 ElementTypeBinding:
152     @Name: ClsDef
153     @ElementType:
154     dis:ResourceDef
155     @ShadowContent:
156     @@rdf:type:
157     @@@@: dis|MultipleResource
158     @@@ForCheck: !ManakaiDOM|ForIF !ManakaiDOM|ForClass
159     @@resourceFor:
160     @@@@: ManakaiDOM|ForClass
161     @@@ForCheck: ManakaiDOM|ManakaiDOM !=ManakaiDOM|ManakaiDOM
162     @@For: ManakaiDOM|DOM3
163     @@For: =ManakaiDOM|ManakaiDOM
164    
165     @@rdf:type:
166     @@@@: DISLang|Class
167     @@@ForCheck: ManakaiDOM|ForClass
168    
169     ElementTypeBinding:
170     @Name: ClsQName
171     @ElementType:
172     dis:QName
173     @ShadowContent:
174     @@ForCheck: ManakaiDOM|ForClass
175    
176     ElementTypeBinding:
177     @Name: ClsISA
178     @ElementType:
179     dis:ISA
180     @ShadowContent:
181     @@ForCheck: ManakaiDOM|ForClass
182    
183     ElementTypeBinding:
184     @Name: nullCase
185     @ElementType:
186     dis:ResourceDef
187     @ShadowContent:
188     @@rdf:type: ManakaiDOM|InCase
189     @@Value:
190     @@@is-null:1
191    
192 wakaba 1.27 ElementTypeBinding:
193     @Name: TrueCase
194     @ElementType:
195     dis:ResourceDef
196     @ShadowContent:
197     @@rdf:type:
198     ManakaiDOM:InCase
199     @@Value:
200     @@@@: 1
201     @@@ContentType: DISCore|Boolean
202     @@Type: idl|boolean||ManakaiDOM|all
203    
204     ElementTypeBinding:
205     @Name: FalseCase
206     @ElementType:
207     dis:ResourceDef
208     @ShadowContent:
209     @@rdf:type:
210     ManakaiDOM:InCase
211     @@Value:
212     @@@@: 0
213     @@@ContentType: DISCore|Boolean
214     @@Type: idl|boolean||ManakaiDOM|all
215    
216 wakaba 1.1 ResourceDef:
217     @QName: LSParser
218     @AliasFor: DOMLS|LSParser
219     @For: ManakaiDOM|DOM3
220    
221     ClsDef:
222     @ClsQName: ManakaiXMLParser
223    
224     @Implement: DOMLS|LSParser
225    
226 wakaba 1.28 @f:implements: DOMLS|LSFeature30
227     @f:implements: DOMLS|ParseString10
228     @enImplNote:
229     @@ddid: dtdfeature
230     @@@:
231     {TODO::
232     Once DTD validation is implemented, add <Q::f:implements>
233     for XML-DTD-feature.
234     }
235 wakaba 1.1
236 wakaba 1.11 @DISLang:role: gls|ParserRole
237 wakaba 1.1
238 wakaba 1.3 @enDesc:
239     Note that the <Class::ManakaiXMLParser> reports any XML errors
240     (syntax errors and / or well-formedness constraint errors)
241     via the <IF::DOMCore:error-handler> registered to
242     the <A::DOMLS:LSParser.domConfig> object. Each error has
243     its <A::DOMCore:DOMError.severity>, either <C::DOMCore:SEVERITY_ERROR>
244     or <C::DOMCore:SEVERITY_FATAL_ERROR>. However, their semantics
245     are slight different from the ones of <QUOTE::error> and
246     <QUOTE::fatal error> in XML; in this implemenetation,
247     <C::DOMCore:SEVERITY_ERROR> implies that the parsing process
248     can effectively be continued to detect more errors while
249     <C::DOMCore:SEVERITY_FATAL_ERROR> implies that the error
250     is serious so that the result document tree and any errors
251     might be far from the ones obtained when the error would not
252     be found.
253 wakaba 1.28
254     @Test:
255     @@QName: GLSImpl.createGLSParser.LS.test
256     @@enDesc:
257     Since there is at least one implementation of the feature (i.e.
258     this class), the <M::gls|GLSImplementation.createGLSParser>
259     must not throw an exception.
260     @@PerlDef:
261     my $impl;
262     __CODE{DOMLS|createImplForTest:: $impl => $impl}__;
263    
264     my $p = $impl-><M::gls|GLSImplementation.createGLSParser>
265     ({LS => '3.0'});
266    
267     $test->assert_isa ($p, <IFName::LSParser>);
268     @Test:
269     @@QName: GLSImpl.createGLSParser.ParseXMLString.test
270     @@enDesc:
271     Since there is at least one implementation of the feature (i.e.
272     this class), the <M::gls|GLSImplementation.createGLSParser>
273     must not throw an exception.
274     @@PerlDef:
275     my $impl;
276     __CODE{DOMLS|createImplForTest:: $impl => $impl}__;
277    
278     my $p = $impl-><M::gls|GLSImplementation.createGLSParser>
279     ({<Q::fe|ParseXMLString> => '1.0'});
280    
281     $test->assert_not_null ($p);
282     @Test:
283     @@QName: GLSImpl.createGLSParser.LS.ParseXMLString.test
284     @@enDesc:
285     Since there is at least one implementation of the feature (i.e.
286     this class), the <M::gls|GLSImplementation.createGLSParser>
287     must not throw an exception.
288     @@PerlDef:
289     my $impl;
290     __CODE{DOMLS|createImplForTest:: $impl => $impl}__;
291    
292     my $p = $impl-><M::gls|GLSImplementation.createGLSParser>
293     ({LS => '3.0', <Q::fe|ParseXMLString> => '1.0'});
294    
295     $test->assert_isa ($p, <IFName::LSParser>);
296    
297     @Test:
298     @@QName: DOMImplLS.createLSParser.1.test
299     @@enDesc:
300     Since there is at least one implementation of the feature (i.e.
301     this class), the <M::gls|GLSImplementation.createGLSParser>
302     must not throw an exception.
303     @@PerlDef:
304     my $impl;
305     __CODE{DOMLS|createImplForTest:: $impl => $impl}__;
306    
307     my $p = $impl-><M::DOMLS|DOMImplementationLS.createLSParser>
308     (<C::DOMLS|DOMImplementationLS.MODE_SYNCHRONOUS>);
309     $test->assert_isa ($p, <IFName::LSParser>);
310     @enImplNote:
311     @@ddid: lsparsertext
312     @@@:
313     Future version should add test:
314     @@QName: DOMImplLS.createLSParser.2.test
315     @@enDesc:
316     Since there is at least one implementation of the feature (i.e.
317     this class), the <M::gls|GLSImplementation.createGLSParser>
318     must not throw an exception.
319     @@PerlDef:
320     my $impl;
321     __CODE{DOMLS|createImplForTest:: $impl => $impl}__;
322    
323     my $p = $impl-><M::DOMLS|DOMImplementationLS.createLSParser>
324     (<C::DOMLS|DOMImplementationLS.MODE_SYNCHRONOUS>,
325     <Q::xml-dtd:>);
326     $test->assert_isa ($p, <IFName::LSParser>);
327 wakaba 1.3
328 wakaba 1.27 @Test:
329     @@QName: Perl.open.utf8.strref.1.test
330     @@enDesc:
331     Does PerlIO works as intended?
332     @@PerlDef:
333     my $s = qq<\x{3001}\x0A\x{10001}>;
334     #open my $a, '<'.':utf8', \$s;
335     require IO::String;
336     my $a = IO::String->new ($s);
337     $test->assert_num_equals
338     (actual_value => ord getc $a,
339     expected_value => 0x3001);
340     $test->assert_num_equals
341     (actual_value => ord getc $a,
342     expected_value => 0x000A);
343     $test->assert_num_equals
344     (actual_value => ord getc $a,
345     expected_value => 0x10001);
346     $a->ungetc (0x10001);
347     $test->assert_num_equals
348     (actual_value => ord getc $a,
349     expected_value => 0x10001);
350     $test->assert_null (getc $a);
351     close $a;
352     @Test:
353     @@QName: Perl.open.8859.strref.2.test
354     @@enDesc:
355     Does PerlIO works as intended?
356     @@PerlDef:
357     my $s = qq<\x{0080}\x0A\x{00A9}>;
358     #open my $a, '<', \$s;
359     require IO::String;
360     my $a = IO::String->new ($s);
361     $test->assert_num_equals
362     (actual_value => ord getc $a,
363     expected_value => 0x0080);
364     $test->assert_num_equals
365     (actual_value => ord getc $a,
366     expected_value => 0x000A);
367     $test->assert_num_equals
368     (actual_value => ord getc $a,
369     expected_value => 0x00A9);
370     $a->ungetc (0x00A9);
371     $test->assert_num_equals
372     (actual_value => ord getc $a,
373     expected_value => 0x00A9);
374     $test->assert_null (getc $a);
375     close $a;
376    
377 wakaba 1.1 @Attr:
378     @@Name: domConfig
379     @@enDesc:
380     The configuration of the parser.
381    
382     @@Get:
383     @@@Type: DOMCore|DOMConfiguration
384     @@@enDesc: The DOM configuration object.
385     @@@PerlDef:
386     __CODE{DOMCore|getConfigObject::
387     $target => $self,
388     $targetHash => $self,
389 wakaba 1.27 $targetType => {<ClassName::xp|ManakaiXMLParser>},
390 wakaba 1.1 $result => $r,
391     }__;
392    
393 wakaba 1.27 @Attr:
394     @@ForCheck: ManakaiDOM|ForClass
395     @@Name: async
396     @@enDesc:
397     Whether the parser is asynchronous or not.
398     @@Type: idl|boolean||ManakaiDOM|all
399     @@Get:
400     @@@FalseCase:
401     @@@@enDesc:
402     The parser does not in asynchronous mode.
403     @@@PerlDef: \
404     @@Test:
405     @@@QName: XMLParser.async.test
406     @@@PerlDef:
407     my $xp;
408     __CODE{createParserForTest:: $xp => $xp}__;
409    
410     $test->assert_false ($xp-><AG::DOMLS|LSParser.async>);
411    
412     @Attr:
413     @@ForCheck: ManakaiDOM|ForClass
414     @@Name: busy
415     @@enDesc:
416     Whether the parser is currently busy loading a document or not.
417     @@Type: idl|boolean||ManakaiDOM|all
418     @@Get:
419     @@@TrueCase:
420     @@@@enDesc:
421     The parser is currently busy.
422     @@@FalseCase:
423     @@@@enDesc:
424     The parser is not busy.
425     @@@PerlDef:
426     $r = $self->{<H::DOMLS|busy>};
427    
428     @enImplNote:
429     @@ddid: abort
430     @@@:
431     {ISSUE::
432     LSParser.abort:
433    
434     Is it required to support even in synchronous mode?
435     }
436    
437     {TODO::
438     LSParser.filter
439     }
440    
441     @ResourceDef:
442     @@QName: createParserForTest
443     @@ForCheck: ManakaiDOM|ForClass
444     @@rdf:type: DISPerl|BlockCode
445     @@PerlDef:
446     require Message::DOM::GenericLS;
447     $xp = <Class::ManakaiXMLParser>
448     ->new (<Class::gls|ManakaiGLSImplementation>->_new, '');
449    
450 wakaba 1.1 @Method:
451     @@ManakaiDOM:isForInternal:1
452     @@ForCheck: ManakaiDOM|ForClass
453     @@Operator: DISPerl|NewMethod
454     @@enDesc:
455     Creates a new instance of the object.
456     @@Param:
457     @@@Name: impl
458 wakaba 1.11 @@@Type: gls|GLSImplementation
459 wakaba 1.1 @@@enDesc:
460     The implementation from which the parser is created.
461     @@Param:
462     @@@Name: features
463     @@@Type: DOMString
464     @@@dis:actualType: f|FeaturesString
465     @@@enDesc:
466     The set of features requested for the parser.
467     @@Return:
468     @@@Type: DOMMain|DOMObject
469     @@@dis:actualType: LSParser
470     @@@enDesc:
471     The newly created parser.
472     @@@PerlDef:
473     $r = bless {
474     <H::DOMCore:implementation> => $impl,
475     }, $self;
476    
477     @Method:
478 wakaba 1.27 @@Name: parseURI
479     @@enDesc:
480     Parses an XML document identified by a DOM URI.
481 wakaba 1.1
482 wakaba 1.27 It is equivalent to <M::.parse> method with its <P::input>
483     parameter set to a <IF::LSInput> object whose
484     <A::LSInput.systemId> set to <P::uri>.
485 wakaba 1.1 @@Param:
486 wakaba 1.27 @@@Name: uri
487 wakaba 1.1 @@@Type: DOMString
488 wakaba 1.27 @@@enDesc:
489     The DOM URI of the XML document to be read.
490 wakaba 1.1 @@Return:
491     @@@Type: Document
492 wakaba 1.27 @@@enDesc:
493     The newly created and populated <IF::Document> node.
494     @@@dx:raises:
495     @@@@@: ManakaiDOMLS|MDOMLS_BUSY
496     @@@@enDesc:
497     If <A::LSParser.busy> is <DOM::true>.
498     @@@dx:raises:
499     @@@@@: DOMLS|PARSE_ERR
500     @@@@enDesc:
501     If the <IF::LSParser> was unable to load the document.
502     @@@PerlDef:
503     __DEEP{
504     $r = $self-><M::LSParser.parse> ({system_id => $uri});
505     }__;
506    
507     @Method:
508     @@Name: parse
509     @@enDesc:
510     Parses an XML document from a resource identified
511     by a <IF::LSInput>.
512     @@Param:
513     @@@Name: input
514     @@@Type: LSInput
515     @@@enDesc:
516     The <IF::LSInput> from which the source of the document
517     is to be read.
518     @@Return:
519     @@@Type: Document
520     @@@enDesc:
521     The newly created and populated <IF::Document> node.
522     @@@dx:raises:
523     @@@@@: ManakaiDOMLS|MDOMLS_BUSY
524     @@@@enDesc:
525     If the <A::LSParser.busy> is <DOM::true>.
526     @@@dx:raises:
527     @@@@@: DOMLS|PARSE_ERR
528     @@@@enDesc:
529     If the <IF::LSParser> was unable to load the document.
530 wakaba 1.1 @@@PerlDef:
531 wakaba 1.27 if ($self->{<H::DOMLS|busy>}) {
532     __EXCEPTION{ManakaiDOMLS|MDOMLS_BUSY}__;
533     }
534     local $self->{<H::DOMLS|busy>} = true;
535    
536     my $in;
537     __DEEP{
538     $self->{parser_cfg} = $self-><AG::LSParser.domConfig>;
539     ## Parser's |domConfig| object.
540     $self->{in_in} = $self->{parser_cfg}
541     -><M::c|DOMConfiguration.getParameter>
542     (<Q::xp|ls-input-to-input-file>);
543     $in = $self->{in_in}-><M::ManakaiDOMLSInputToInputFile.resolveLSInput>
544     ($input,
545     $self->{parser_cfg}
546     -><M::c|DOMConfiguration.getParameter>
547     ('error-handler'));
548     }__;
549     unless (defined $in) {
550     __c|ERROR{DOMLS|no-input-specified::
551     MDOMX:param-name => 'input',
552     }__;
553     __CODE{ParseError}__;
554     }
555    
556     require IO::Handle;
557 wakaba 1.1
558     $self->{char} = [];
559     $self->{token} = [];
560 wakaba 1.6 $self->{entity} = [{
561 wakaba 1.27 fh => $in-><AG::ManakaiDOMInputFile.filehandle>,
562     base_uri => $in-><AG::ManakaiDOMInputFile.baseURI>,
563     doc_uri => $in-><AG::ManakaiDOMInputFile.documentURI>,
564 wakaba 1.6 line => 1,
565     column => 1,
566     pos => 0,
567 wakaba 1.27 close_file => sub { $in-><M::ManakaiDOMInputFile.close> },
568     reptxt => \'',
569     is_external_entity => true,
570 wakaba 1.6 }];
571 wakaba 1.27 ## Entity stack.
572 wakaba 1.14 $self->{location} = $self->{entity}->[-1];
573 wakaba 1.27 ## Parsing location object as required by DPG.
574     ## It must always be equal to |{entity}->[-1]|.
575 wakaba 1.6 $self->{entity_char} = [];
576 wakaba 1.27 ## Stack for |{char}| stacks analog to |{entity}| stack.
577 wakaba 1.6 $self->{entity_token} = [];
578 wakaba 1.27 ## Stack for |{token}| stacks analog to |{entity}| stack.
579 wakaba 1.3 $self->{xml_version} = '1.0';
580 wakaba 1.27 ## Document XML version: either |1.0| or |1.1|.
581 wakaba 1.3 $self->{standalone} = false;
582 wakaba 1.27 ## True iff |standalone=yes| is explicitly specified.
583 wakaba 1.19 $self->{has_xref} = false;
584 wakaba 1.27 ## There is an unread external entity.
585     $self->{dont_process} = false;
586     ## So, don't process |ENTITY| and |ATTLIST| declarations.
587 wakaba 1.11 $self->{general_entity} = {
588     lt => {is_predefined => true},
589     gt => {is_predefined => true},
590     amp => {is_predefined => true},
591     quot => {is_predefined => true},
592     apos => {is_predefined => true},
593     };
594 wakaba 1.27 ## Declared general entities.
595 wakaba 1.6 $self->{param_entity} = {};
596 wakaba 1.27 ## Declared parameter entities.
597 wakaba 1.9 $self->{attr} = {};
598     # $self->{attr}->{$element_type_name}->{$attr_name} = $attr_def
599 wakaba 1.27 ## Declared attributes.
600 wakaba 1.1
601     __DEEP{
602 wakaba 1.11 $r = $self->{<H::c|implementation>}-><M::DOMImpl.createDocument>;
603     $self->{doc} = $r;
604 wakaba 1.27 ## |Document| object.
605     CORE::delete $self->{docx};
606     ## |DocumentXDoctype| object (if necessary).
607 wakaba 1.21 $self->{doc_cfg} = $r-><AG::Document.domConfig>;
608 wakaba 1.27 ## |Document|'s configuration.
609 wakaba 1.11 CORE::delete $self->{dtdef};
610 wakaba 1.27 ## |DocumentTypeDefinition| object (if created).
611 wakaba 1.17 CORE::delete $self->{dtdecl};
612 wakaba 1.27 ## |DocumentTypeDeclaration| object (if created).
613 wakaba 1.21
614     $r-><AS::Document.strictErrorChecking> (false);
615     ## NOTE: Any checks such as |Name| validity done by
616     ## methods on DOM nodes are disabled. It might result
617     ## in creating an ill-formed DOM tree when parser
618     ## errors are traped by |error-handler|.
619     $self->{doc_cfg}-><M::c|DOMConfiguration.setParameter>
620     (<Q::cfg|entity-reference-read-only> => false);
621     ## NOTE: Turn this configuration parameter off is required
622     ## because entity reference subtree is created by
623     ## the parser rather than |createEntityReference|'s
624     ## cloning. Parser's |cfg:entity-reference-read-only|
625     ## configuration parameter controls whether generated
626     ## subtree is then marked as read-only or not.
627     $self->{doc_cfg}-><M::c|DOMConfiguration.setParameter>
628     (<Q::cfg|clone-entity-reference-subtree> => true);
629     ## NOTE: Turn this configuration parameter on makes
630     ## entity reference subtrees in attribute default values
631     ## cloned as is into default attribute node subtrees.
632 wakaba 1.26 $self->{doc_cfg}-><M::c|DOMConfiguration.setParameter>
633     (<Q::cfg|dtd-default-attributes> => false);
634     ## NOTE: Don't create DTD default attributes by
635     ## |createElementNS| method.
636     $self->{doc_cfg}-><M::c|DOMConfiguration.setParameter>
637     ('error-handler' => sub {
638     my (undef, $err) = @_;
639     return ($err-><AG::c|DOMError.severity> !=
640     <C::c|DOMError.SEVERITY_FATAL_ERROR>);
641     })
642     unless $Message::DOM::XMLParser::DEBUG;
643 wakaba 1.29 ## NOTE: The default error handler in manakai |warn|s error
644 wakaba 1.26 ## description.
645 wakaba 1.11
646 wakaba 1.29 ## Document entity's URI and base URI
647     $r-><AS::Document.documentURI> ($self->{entity}->[0]->{doc_uri});
648     $r-><AS::Document.manakaiEntityBaseURI>
649     ($self->{entity}->[0]->{base_uri});
650    
651 wakaba 1.11 ## Document entity -> |Document| node
652     $self->_parse_DocumentEntity;
653    
654 wakaba 1.27 for (@{$self->{entity}}) {
655     $_->{close_file}->();
656     ## NOTE: There should be only the document entity.
657     }
658    
659 wakaba 1.11 ## Replacement tree for general |Entity| nodes
660 wakaba 1.20 my @ent = values %{$self->{general_entity}};
661     for my $ent (@ent) {
662     if (exists $ent->{has_replacement_text}) {
663 wakaba 1.11 my $ent_name = $ent->{name};
664     $self->{entity} = [<Code::getCopyOfEntityState::
665     $entity_type = 'general_entity',
666     $entity_name = $ent_name>];
667 wakaba 1.14 $self->{location} = $self->{entity}->[-1];
668 wakaba 1.11 $self->{token} = [];
669     $self->{char} = [];
670 wakaba 1.23 local $ent->{is_opened} = true;
671 wakaba 1.11 ## TODO: External entity support
672     $self->_parse_InternalGeneralParsedEntity ($ent->{node});
673     $ent->{node}-><AS::x|Entity.hasReplacementTree> (true);
674 wakaba 1.27 $self->{entity}->[-1]->{close_file}->();
675 wakaba 1.21 ## ISSUE: Should errors detected by this phase result
676     ## in |DOMLS:PARSE_ERR| exception thrown?
677 wakaba 1.20 }
678 wakaba 1.11 ## TODO: Read-only if configuration (for all entities)
679     }
680    
681 wakaba 1.21 ## Turns flags to their default value
682     $self->{doc_cfg}-><M::c|DOMConfiguration.setParameter>
683     (<Q::cfg|entity-reference-read-only> => null);
684     $self->{doc_cfg}-><M::c|DOMConfiguration.setParameter>
685     (<Q::cfg|clone-entity-reference-subtree> => null);
686 wakaba 1.26 $self->{doc_cfg}-><M::c|DOMConfiguration.setParameter>
687     (<Q::cfg|dtd-default-attributes> => null);
688     $self->{doc_cfg}-><M::c|DOMConfiguration.setParameter>
689     ('error-handler' => null);
690 wakaba 1.11 $r-><AS::Document.strictErrorChecking> (true);
691 wakaba 1.1 }__;
692    
693     @Method:
694     @@Name: shiftChar
695     @@ManakaiDOM:isForInternal:1
696     @@ForCheck: ManakaiDOM|ForClass
697     @@enDesc:
698     Returns the next character.
699     @@Return:
700     @@@Type: idl|long||ManakaiDOM|all
701     @@@enDesc:
702     The code position number of the next character, if any,
703 wakaba 1.6 or <CODE::-1>.
704 wakaba 1.1 @@@PerlDef:
705     if (@{$self->{char}}) {
706     $r = shift @{$self->{char}};
707     } else {
708 wakaba 1.6 GETCHAR: {
709 wakaba 1.27 no warnings 'closed'; # getc() on closed filehandle warning
710     my $ent = $self->{entity}->[-1];
711     my $char = getc $ent->{fh};
712 wakaba 1.6
713 wakaba 1.7 if (defined $char and length $char) {
714 wakaba 1.27 $ent->{pos}++;
715 wakaba 1.6 $r = ord $char;
716     if ($r == 0x000A) {
717 wakaba 1.27 $ent->{line}++;
718     $ent->{column} = 1;
719 wakaba 1.6 } elsif ($r == 0x000D) {
720 wakaba 1.27 my $next_char = getc $ent->{fh};
721 wakaba 1.6 if ($next_char eq "\x0A") {
722 wakaba 1.27 if ($ent->{is_external_entity}) {
723     $ent->{pos}++;
724     $ent->{line}++;
725     $ent->{column} = 1;
726     $r = 0x000A; # ^ U+000D U+000A -> U+000A ^
727     } else { # Internal entity
728     $ent->{column}++;
729     ## Line number will be increased by next |shiftChar|.
730     $ent->{fh}->ungetc (0x000A);
731     #$r = 0x000D; # ^ U+000D U+000A -> U+000D ^ U+000A
732     # no change
733     }
734 wakaba 1.6 } elsif ($next_char eq "\x85") {
735     if ($self->{xml_version} eq '1.1') {
736 wakaba 1.27 if ($ent->{is_external_entity}) {
737     if ($ent->{no_xml11_eol}) {
738     my $location = {
739     utf32_offset => $ent->{pos} - 1,
740     line_number => $ent->{line},
741     column_number => $ent->{column},
742     };
743     my $continue = __c|ERROR{
744     xp|fatal-xml11-end-of-line-in-xml-declaration::
745     c|location => {$location},
746     xp|character-number => {$r},
747     }__;
748     unless ($continue) {
749     __CODE{ParseError}__;
750     }
751     } # no_xml11_eol
752     $ent->{pos}++;
753     $ent->{line}++;
754     $ent->{column} = 1;
755     $r = 0x000A; # ^ U+000D U+0085 -> U+000A ^
756     } else { # internal entity
757     $ent->{column}++;
758     ## Line number will be increased by next |shiftChar|.
759     $ent->{fh}->ungetc (0x0085);
760     #$r = 0x000D; # ^ U+000D U+0085 -> U+000D ^ U+0085
761     # no change
762     }
763     } else { # XML 1.0
764 wakaba 1.16 ## |no_xml11_eol| will be tested later.
765 wakaba 1.27 $ent->{column}++;
766     ## Line number will be increased by next |shiftChar|.
767     $ent->{fh}->ungetc (0x0085);
768     $r = 0x000A if $ent->{is_external_entity};
769     # external: ^ U+000D U+0085 -> U+000A ^ U+0085
770     # internal: ^ U+000D U+0085 -> U+000D ^ U+0085 (as is)
771 wakaba 1.6 }
772 wakaba 1.27 } else { # neither U+000A nor U+0085
773     $ent->{line}++;
774     $ent->{column} = 1;
775     $ent->{fh}->ungetc (ord $next_char);
776     $r = 0x000A if $ent->{is_external_entity};
777     # external: ^ U+000D _ -> U+000A ^ _
778     # internal: ^ U+000D _ -> U+000D ^ _ (as is)
779 wakaba 1.6 }
780 wakaba 1.27 } elsif ($r == 0x0085 or $r == 0x2028) {
781     if ($ent->{no_xml11_eol}) {
782     my $location = {
783     utf32_offset => $ent->{pos} - 1,
784     line_number => $ent->{line},
785     column_number => $ent->{column},
786     };
787     my $continue = __c|ERROR{
788     xp|fatal-xml11-end-of-line-in-xml-declaration::
789     c|location => {$location},
790     xp|character-number => {$r},
791     }__;
792     unless ($continue) {
793     __CODE{ParseError}__;
794     }
795     } # no_xml11_eol
796     $r = 0x000A if $self->{xml_version} eq '1.1' and
797     $ent->{is_external_entity};
798     ## Even in XML 1.0 it increases the line number.
799     $ent->{line}++;
800     $ent->{column} = 1;
801 wakaba 1.6 } elsif (
802     not ((0x0020 <= $r and $r <= 0x007E) or
803     (0x00A0 <= $r and $r <= 0xD7FF) or
804     (0xE000 <= $r and $r <= 0xFFFD) or
805     (0x10000 <= $r and $r <= 0x10FFFF)) and
806 wakaba 1.27 $r != 0x0009 and
807     not (($self->{xml_version} eq '1.0' or
808     not $ent->{is_external_entity}) and
809     (0x007F <= $r and $r <= 0x009F)) and
810     not ($self->{xml_version} eq '1.1' and
811     not $ent->{is_external_entity} and
812     0x0001 <= $r and $r <= 0x001F)
813 wakaba 1.6 ) {
814     my $location = {
815 wakaba 1.27 utf32_offset => $ent->{pos} - 1,
816     line_number => $ent->{line},
817     column_number => $ent->{column},
818 wakaba 1.6 };
819 wakaba 1.27 my $continue = __c|ERROR{xp|wf-legal-literal-character::
820     c|location => {$location},
821 wakaba 1.6 xp|character-number => {$r},
822     }__;
823     unless ($continue) {
824 wakaba 1.27 __CODE{ParseError}__;
825 wakaba 1.3 }
826 wakaba 1.27 $ent->{column}++;
827     } else { # XML |Char|
828     $ent->{column}++;
829 wakaba 1.3 }
830     } else {
831 wakaba 1.6 $r = -1;
832 wakaba 1.3 }
833 wakaba 1.6 } # GETCHAR
834 wakaba 1.1 }
835    
836     @Method:
837     @@ManakaiDOM:isForInternal: 1
838     @@Operator: ManakaiDOM|MUErrorHandler
839     @@enDesc:
840     When a <IF::ecore|ErrorInterface||ManakaiDOM|Perl> is <Perl::report>ed,
841     then this method is invoked.
842    
843     The method calls the <cfg::DOMCore|error-handler> if the error is of
844     <IF::DOMCore|DOMError>. Otherwise, the error is re-thrown so that
845     corresponding <Perl::catch> clause, if any, can catch the error.
846     @@Param:
847     @@@Name: err
848     @@@Type: ecore|ErrorInterface||ManakaiDOM|Perl
849     @@@enDesc:
850     The reported error object.
851     @@Return:
852     @@@Type: DISPerl|Any
853     @@@enDesc:
854     If the <P::err> is a <IF::DOMCore|DOMError>, then the return value
855     of the error handler.
856    
857     {NOTE:: If the error is thrown, the method never returns.
858     }
859     @@@nullCase:
860     @@@@enDesc:
861     No error handler.
862     @@@PerlDef:
863     if ($err->isa (<IFName::DOMCore|DOMError||ManakaiDOM|ManakaiDOM>)) {
864     __DEEP{
865     A: {
866     my $cfg = $self-><AG::LSParser.domConfig>;
867     my $h = $cfg-><M::DOMCore|DOMConfiguration.getParameter>
868     ('error-handler');
869     $r = $h-><M::DOMCore|DOMErrorHandler.handleError> ($err);
870     } # A
871     }__;
872     } else {
873     $err-><M::ecore|ErrorInterface||ManakaiDOM|Perl.throw>;
874     }
875    
876     @DISPerl:dpgDef:
877    
878     /*
879     XML Document Entity
880    
881     document := prolog element *Misc
882     - *Char RestrictedChar *Char ;; [1]
883     */
884 wakaba 1.11 rule DocumentEntity : standalone {
885 wakaba 1.1 /*
886     prolog := XMLDecl? *Misc [doctypedecl *Misc] ;; [22]
887     */
888 wakaba 1.16 ?lexmode DocumentStart;
889 wakaba 1.11
890     my $doc;
891     lang:Perl {
892     $doc = $self->{doc};
893     }
894 wakaba 1.1
895 wakaba 1.3 ~? (XDO) {
896 wakaba 1.16 ?lexmode XMLDeclarationOrPI;
897     lang:Perl {
898     $self->{entity}->[-1]->{no_xml11_eol} = true;
899     }
900     ~ (S) { // XML declaration
901     &_XMLDeclaration_ ($doc => $doc);
902     ~ (PIC2) {
903     ?lexmode DocumentProlog;
904     } else {
905     ?lexmode DocumentProlog;
906     }
907     } (NameChar) { // Processing instruction whose target begins with |xml|
908     my $target_token;
909     lang:Perl ($v => $token.value) {
910     $target_token = $token;
911     $target_token->{value} = 'xml'.$target_token->{value};
912     $self->{entity}->[-1]->{no_xml11_eol} = false;
913     }
914     ?lexmode PINmtoken;
915     ~? (Nmtoken) {
916     lang:Perl ($v => $token.value) {
917     $target_token->{value} .= $v;
918     }
919     ?lexmode PIName;
920     }
921     lang:Perl {
922     $target_token->{type} = 'Name';
923     $target_token->{location_d} += 3; # 'xml'
924     unshift @{$self->{token}}, $token;
925     $token = $target_token;
926     }
927     &_ProcessingInstruction_ ($doc => $doc, $parent => $doc);
928     ~ (PIC) {
929     ?lexmode DocumentProlog;
930     } else {
931     ?lexmode DocumentProlog;
932     }
933 wakaba 1.3 } else {
934 wakaba 1.16 lang:Perl {
935     $self->{entity}->[-1]->{no_xml11_eol} = false;
936     }
937 wakaba 1.3 }
938     } else {
939     ?lexmode 'DocumentProlog';
940     }
941 wakaba 1.1
942     // *Misc
943 wakaba 1.2 ~* (CDO) {
944 wakaba 1.1 &_CommentDeclaration_ ($doc => $doc, $parent => $doc);
945    
946     ~ (MDC) {
947     ?lexmode DocumentProlog;
948     } else {
949     ?lexmode DocumentProlog;
950     }
951     } (PIO) {
952     &_ProcessingInstruction_ ($doc => $doc, $parent => $doc);
953    
954     ~ (PIC) {
955     ?lexmode 'DocumentProlog';
956     } else {
957     ?lexmode DocumentProlog;
958     }
959     } (S) {
960     //
961     }
962    
963     // doctypedecl
964     ~? (MDO) {
965     &_DocumentTypeDeclaration_ ($doc => $doc);
966    
967 wakaba 1.3 ~ (MDC) {
968     ?lexmode DocumentMisc;
969     } else {
970     ?lexmode DocumentMisc;
971     }
972     } else {
973     ?lexmode DocumentMisc;
974 wakaba 1.1 }
975 wakaba 1.25
976     lang:Perl {
977     $self->{doc}-><AS::Document.allDeclarationsProcessed> (true)
978     unless $self->{dont_process};
979     }
980 wakaba 1.1
981     // *Misc
982 wakaba 1.2 ~* (CDO) {
983 wakaba 1.1 &_CommentDeclaration_ ($doc => $doc, $parent => $doc);
984    
985     ~ (MDC) {
986     ?lexmode DocumentMisc;
987     } else {
988     ?lexmode DocumentMisc;
989     }
990     } (PIO) {
991     &_ProcessingInstruction_ ($doc => $doc, $parent => $doc);
992    
993     ~ (PIC) {
994     ?lexmode 'DocumentMisc';
995     } else {
996     ?lexmode DocumentMisc;
997     }
998     } (S) {
999     //
1000     }
1001    
1002     // Document element
1003     ~ (STAGO) {
1004     &Element_ ($doc => $doc, $parent => $doc)
1005     : unshift-current-token;
1006     ~ (TAGC) {
1007     ?lexmode DocumentEnd;
1008     } else {
1009     ?lexmode DocumentEnd;
1010     }
1011     } else {
1012     ?lexmode 'DocumentEnd';
1013     }
1014    
1015     // *Misc
1016 wakaba 1.2 ~* (CDO) {
1017 wakaba 1.1 &_CommentDeclaration_ ($doc => $doc, $parent => $doc);
1018    
1019     ~ (MDC) {
1020     ?lexmode DocumentEnd;
1021     } else {
1022     ?lexmode DocumentEnd;
1023     }
1024     } (PIO) {
1025     &_ProcessingInstruction_ ($doc => $doc, $parent => $doc);
1026     ~ (PIC) {
1027     ?lexmode 'DocumentEnd';
1028     } else {
1029     ?lexmode DocumentEnd;
1030     }
1031     } (S) {
1032     //
1033     }
1034    
1035     ~ (#EOF) { }
1036     } // DocumentEntity
1037 wakaba 1.11
1038     /*
1039     Internal General Parsed Entity
1040    
1041     An internal general parsed entity is well-formed if its
1042     replacement text matches the production labeled |content|.
1043     */
1044     rule InternalGeneralParsedEntity ($ent) : standalone {
1045     ?lexmode ElementContent;
1046    
1047     my $ns;
1048     lang:Perl {
1049     $ns = {
1050     xml => <Q::xml:>,
1051     xmlns => <Q::xmlns:>,
1052     };
1053     }
1054    
1055     &content ($parent => $ent, $ns => $ns);
1056    
1057     ~ (#EOF) { }
1058     } // InternalGeneralParsedEntity
1059    
1060 wakaba 1.1 /*
1061     XML Declaration
1062    
1063     XMLDecl := '<?xml' VersionInfo
1064     [EncodingDecl]
1065     [SDDecl]
1066     [S] '?>' ;; [23]
1067    
1068     NOTE: XML declaration is optional in XML 1.0
1069     while it is required in XML 1.1.
1070     */
1071 wakaba 1.16 rule _XMLDeclaration_ {
1072     // ~ (XDO) { }
1073 wakaba 1.3 ?lexmode XMLDeclaration;
1074 wakaba 1.16 //lang:Perl {
1075     // $self->{entity}->[-1]->{no_xml11_eol} = true;
1076     //}
1077     //~ (S) { }
1078 wakaba 1.3
1079     ~ (Name == 'version') {
1080     ~? (S) { }
1081     ~ (VI) { }
1082     ~? (S) { }
1083 wakaba 1.1
1084 wakaba 1.3 my $ver;
1085     my $bad_token;
1086    
1087     ~ (LIT) {
1088     ?lexmode AttributeValueLiteral;
1089    
1090     ~ (STRING) {
1091     lang:Perl ($version => $token.value) {
1092     $ver = $version;
1093     $bad_token = $token;
1094     }
1095     }
1096    
1097     ~ (LIT) {
1098     ?lexmode XMLDeclaration;
1099     }
1100     } (LITA) {
1101     ?lexmode AttributeValueLiteralA;
1102    
1103     ~ (STRING) {
1104     lang:Perl ($version => $token.value) {
1105     $ver = $version;
1106     $bad_token = $token;
1107     }
1108     }
1109    
1110     ~ (LITA) {
1111     ?lexmode XMLDeclaration;
1112     }
1113     }
1114    
1115     lang:Perl : has-error {
1116     unless ($ver eq '1.0' or $ver eq '1.1') {
1117     my $location;
1118     __CODE{xp|get-location-from-token::
1119     $token => {$bad_token},
1120     $result => {$location},
1121     }__;
1122     my $continue = __DOMCore:ERROR{xp|wf-unsupported-xml-version::
1123     DOMCore|location => {$location},
1124 wakaba 1.16 xp|parent => {$self->{doc}},
1125 wakaba 1.3 infoset|version => {$ver},
1126     xp|error-token => {$bad_token},
1127     }__;
1128     unless ($continue) {
1129 wakaba 1.27 __CODE{ParseError}__;
1130 wakaba 1.3 }
1131     }
1132 wakaba 1.16 $self->{doc}-><AS::Document.xmlVersion> ($ver);
1133 wakaba 1.3 $self->{xml_version} = $ver;
1134     }
1135    
1136     ~? (S) { }
1137 wakaba 1.1 }
1138    
1139 wakaba 1.3 ~? (Name == 'encoding') {
1140     ~? (S) { }
1141     ~ (VI) { }
1142     ~? (S) { }
1143    
1144     my $ver;
1145     my $bad_token;
1146    
1147     ~ (LIT) {
1148     ?lexmode AttributeValueLiteral;
1149    
1150     ~ (STRING) {
1151     lang:Perl ($version => $token.value) {
1152     $ver = $version;
1153     $bad_token = $token;
1154     }
1155     }
1156    
1157     ~ (LIT) {
1158     ?lexmode XMLDeclaration;
1159     }
1160     } (LITA) {
1161     ?lexmode AttributeValueLiteralA;
1162    
1163     ~ (STRING) {
1164     lang:Perl ($version => $token.value) {
1165     $ver = $version;
1166     $bad_token = $token;
1167     }
1168     }
1169    
1170     ~ (LITA) {
1171     ?lexmode XMLDeclaration;
1172     }
1173     }
1174    
1175     lang:Perl : has-error {
1176     unless ($ver =~ /\A[A-Za-z][A-Za-z0-9._-]*\z/) {
1177     my $location;
1178     __CODE{xp|get-location-from-token::
1179     $token => {$bad_token},
1180     $result => {$location},
1181     }__;
1182     my $continue = __DOMCore:ERROR{xp|wf-malformed-enc-name::
1183     DOMCore|location => {$location},
1184 wakaba 1.16 xp|parent => {$self->{doc}},
1185 wakaba 1.3 xp|name => {$ver},
1186     xp|error-token => {$bad_token},
1187     }__;
1188     unless ($continue) {
1189 wakaba 1.27 __CODE{ParseError}__;
1190 wakaba 1.3 }
1191     }
1192 wakaba 1.16 $self->{doc}-><AS::Document.xmlEncoding> ($ver);
1193 wakaba 1.3 }
1194    
1195     ~? (S) { }
1196 wakaba 1.1 }
1197 wakaba 1.3
1198     ~? (Name == 'standalone') {
1199     ~? (S) { }
1200     ~ (VI) { }
1201     ~? (S) { }
1202    
1203     my $ver;
1204     my $bad_token;
1205    
1206     ~ (LIT) {
1207     ?lexmode AttributeValueLiteral;
1208    
1209     ~ (STRING) {
1210     lang:Perl ($version => $token.value) {
1211     $ver = $version;
1212     $bad_token = $token;
1213     }
1214     }
1215    
1216     ~ (LIT) {
1217     ?lexmode XMLDeclaration;
1218     }
1219     } (LITA) {
1220     ?lexmode AttributeValueLiteralA;
1221    
1222     ~ (STRING) {
1223     lang:Perl ($version => $token.value) {
1224     $ver = $version;
1225     $bad_token = $token;
1226     }
1227     }
1228 wakaba 1.1
1229 wakaba 1.3 ~ (LITA) {
1230     ?lexmode XMLDeclaration;
1231     }
1232     }
1233    
1234     lang:Perl : has-error {
1235     unless ($ver eq 'yes' or $ver eq 'no') {
1236     my $location;
1237     __CODE{xp|get-location-from-token::
1238     $token => {$bad_token},
1239     $result => {$location},
1240     }__;
1241     my $continue = __DOMCore:ERROR{xp|wf-malformed-xml-standalone::
1242     DOMCore|location => {$location},
1243 wakaba 1.16 xp|parent => {$self->{doc}},
1244 wakaba 1.3 xp|name => {$ver},
1245     xp|error-token => {$bad_token},
1246     }__;
1247     unless ($continue) {
1248 wakaba 1.27 __CODE{ParseError}__;
1249 wakaba 1.3 }
1250     }
1251 wakaba 1.13 if ($ver eq 'yes') {
1252 wakaba 1.16 $self->{doc}-><AS::Document.xmlStandalone> (true);
1253 wakaba 1.13 $self->{standalone} = true;
1254     }
1255 wakaba 1.3 }
1256    
1257     ~? (S) { }
1258     }
1259    
1260 wakaba 1.16 ~ (PIC1) {
1261     lang:Perl {
1262     $self->{entity}->[-1]->{no_xml11_eol} = false;
1263     }
1264     } else {
1265     lang:Perl {
1266     $self->{entity}->[-1]->{no_xml11_eol} = false;
1267     }
1268     }
1269    
1270     // ~ (PIC2) { }
1271 wakaba 1.3 } // _XMLDeclaration_
1272 wakaba 1.1
1273     /*
1274     Comment Declaration
1275    
1276     Comment := '<!--' *(Char - '-' / '-' (Char - '-'))
1277     '-->' ;; [15]
1278 wakaba 1.4 */
1279 wakaba 1.1 rule _CommentDeclaration_ ($doc, $parent) {
1280     ?lexmode 'CommentDeclaration';
1281    
1282     ~? (STRING) {
1283     lang:Perl ($data => $token.value) {
1284     my $com = $doc-><M::Document.createComment> ($data);
1285     $parent-><M::Node.appendChild> ($com);
1286     }
1287     } else {
1288     lang:Perl {
1289     my $com = $doc-><M::Document.createComment> ('');
1290     $parent-><M::Node.appendChild> ($com);
1291     }
1292     }
1293    
1294     ~ (COM) {
1295     ?lexmode MarkupDeclaration;
1296     } else {
1297     ?lexmode MarkupDeclaration;
1298     }
1299    
1300     // ~ (MDC) { }
1301 wakaba 1.4 } // _CommentDeclaration
1302 wakaba 1.15
1303     rule _CommentDeclarationDTD {
1304     ?lexmode CommentDeclaration;
1305 wakaba 1.4
1306     ~? (STRING) {
1307     //
1308     }
1309    
1310     ~ (COM) {
1311     ?lexmode MarkupDeclaration;
1312     } else {
1313     ?lexmode MarkupDeclaration;
1314     }
1315    
1316     ~ (MDC) {
1317     ?lexmode DTD;
1318     } else {
1319     ?lexmode DTD;
1320     }
1321     } // _CommentDeclarationDTD
1322    
1323 wakaba 1.1 /*
1324     Processing Instruction
1325    
1326     PI := '<?' PITarget [S *Char - *Char '?>' *Char]
1327     '?>' ;; [16]
1328     */
1329     rule _ProcessingInstruction_ ($doc, $parent) {
1330     ?lexmode 'PIName';
1331    
1332     my $pi;
1333    
1334     ~ (Name) {
1335 wakaba 1.3 lang:Perl ($name => $token.value) : has-error {
1336 wakaba 1.1 if (lc $name eq 'xml') {
1337 wakaba 1.3 my $location;
1338     __CODE{xp|get-location-from-token::
1339     $token => {$token},
1340     $result => {$location},
1341     }__;
1342     my $continue = __DOMCore:ERROR{xp|wf-pi-target-is-xml::
1343     xp|name => {$name},
1344     DOMCore|location => {$location},
1345     xp|parent => {$parent},
1346     }__;
1347     unless ($continue) {
1348 wakaba 1.27 __CODE{ParseError}__;
1349 wakaba 1.3 }
1350 wakaba 1.1 }
1351 wakaba 1.26 __CODE{checkNCName:: $name => $name}__;
1352    
1353 wakaba 1.1 $pi = $doc-><M::Document.createProcessingInstruction>
1354     ($name);
1355     }
1356 wakaba 1.14 } else {
1357     lang:Perl {
1358     $pi = $doc-><M::Document.createProcessingInstruction> ('#INVALID');
1359     }
1360 wakaba 1.1 }
1361    
1362 wakaba 1.14 ~? (S) {
1363 wakaba 1.1 ?lexmode 'PIData';
1364    
1365     my $tdata;
1366    
1367     ~? (DATA) {
1368     lang:Perl ($data => $token.value) {
1369     $tdata = $data;
1370     }
1371     } else {
1372     lang:Perl {
1373     $tdata = '';
1374     }
1375     }
1376    
1377     lang:Perl {
1378     $pi-><AS::Node.nodeValue> ($tdata);
1379     }
1380     }
1381    
1382     lang:Perl {
1383     $parent-><M::Node.appendChild> ($pi);
1384     }
1385    
1386     // ~ (PIC) { }
1387     } // _ProcessingInstruction_
1388 wakaba 1.4
1389 wakaba 1.6 /*
1390     Processing instruction in DTD
1391     */
1392     rule _ProcessingInstructionDTD ($doc, $doctype) {
1393 wakaba 1.4 ?lexmode 'PIName';
1394 wakaba 1.6
1395     my $pi;
1396 wakaba 1.4
1397     ~ (Name) {
1398 wakaba 1.6 lang:Perl ($name => $token.value) : has-error {
1399     if (lc $name eq 'xml') {
1400     my $location;
1401     __CODE{xp|get-location-from-token::
1402     $token => {$token},
1403     $result => {$location},
1404     }__;
1405     my $continue = __DOMCore:ERROR{xp|wf-pi-target-is-xml::
1406     xp|name => {$name},
1407     DOMCore|location => {$location},
1408     xp|parent => {$doctype},
1409     }__;
1410     unless ($continue) {
1411 wakaba 1.27 __CODE{ParseError}__;
1412 wakaba 1.6 }
1413     }
1414 wakaba 1.26 __CODE{checkNCName:: $name => $name}__;
1415    
1416 wakaba 1.6 $pi = $doc-><M::Document.createProcessingInstruction>
1417     ($name);
1418 wakaba 1.29 $pi-><AS::x|ProcessingInstruction.manakaiBaseURI>
1419     ($self->{location}->{base_uri});
1420 wakaba 1.6 }
1421 wakaba 1.14 } else {
1422     lang:Perl {
1423     $pi = $doc-><M::Document.createProcessingInstruction> ('#INVALID');
1424     }
1425 wakaba 1.4 }
1426    
1427 wakaba 1.14 ~? (S) {
1428 wakaba 1.4 ?lexmode 'PIData';
1429    
1430 wakaba 1.6 my $tdata;
1431    
1432 wakaba 1.4 ~? (DATA) {
1433 wakaba 1.6 lang:Perl ($data => $token.value) {
1434     $tdata = $data;
1435     }
1436     } else {
1437     lang:Perl {
1438     $tdata = '';
1439     }
1440     }
1441    
1442     lang:Perl {
1443     $pi-><AS::Node.nodeValue> ($tdata);
1444 wakaba 1.4 }
1445     }
1446    
1447 wakaba 1.6 lang:Perl {
1448     $doctype-><M::Node.appendChild> ($pi);
1449     }
1450    
1451 wakaba 1.4 ~ (PIC) {
1452     ?lexmode DTD;
1453     } else {
1454     ?lexmode DTD;
1455     }
1456     } // _ProcessingInstructionDTD
1457 wakaba 1.1
1458     /*
1459     Element content parsing mode
1460    
1461     element := EmptyElemTag /
1462     STag content ETag ;; [39]
1463     content := (CharData / element / Reference / CDSect /
1464     PI / Comment) ;; [43]
1465     */
1466 wakaba 1.6 rule Element_ ($doc, $parent, $ns) : standalone {
1467 wakaba 1.1 ?lexmode 'ElementContent';
1468    
1469     my $node; // Current "parent" node
1470     my $nodes; // Node stack (w/o $current_node)
1471     my $type; // Current "parent" element type QName
1472     my $types; // Element type stack (w/o $current_type)
1473 wakaba 1.6 //my $ns; // Current in-scope namespace bindings
1474 wakaba 1.1 my $nses; // Namespace binding stack (w/o $current_ns)
1475    
1476     lang:Perl {
1477     $node = $parent;
1478     $nodes = [];
1479     $type = '';
1480     $types = [];
1481 wakaba 1.6 $ns ||= {
1482 wakaba 1.1 xml => <Q::xml:>,
1483     xmlns => <Q::xmlns:>,
1484     };
1485     $nses = [];
1486     }
1487    
1488     ~* : name => CONTENT
1489     (CharData) {
1490     // Character data
1491     lang:Perl ($data => $token.value) {
1492     $node-><M::Node.appendChild>
1493     ($doc-><M::Document.createTextNode> ($data));
1494     }
1495     } (STAGO) {
1496     // Start tag or empty element tag
1497    
1498     ?lexmode 'StartTag';
1499    
1500     ~ (Name) {
1501     my $attrs;
1502 wakaba 1.26 lang:Perl ($name => $token.value) : has-error {
1503     __CODE{checkQName:: $name => $name}__;
1504 wakaba 1.1 push @{$types}, $type;
1505     $type = $name;
1506     $attrs = {};
1507     }
1508    
1509     ~? (S) {
1510     &AttributeSpecificationList
1511     ($doc => $doc, $attrs => $attrs);
1512     }
1513    
1514     my $el;
1515 wakaba 1.9
1516     /*
1517     Note that this implementation does not perform
1518     attribute value tokenization (but does white space
1519     normalization common to attribute types) and
1520     construct the tree as is. DOM Level 3 Core spec
1521     is unclear on this point. With tokenization,
1522     entity references cannot be preserved.
1523    
1524     The manakai Node.nodeValue and Attr.value attributes
1525     do tokenization according to attribute types.
1526     */
1527    
1528     /*
1529     ISSUE: Should |xml:id| attribute be typed?
1530     */
1531 wakaba 1.1
1532     lang:Perl {
1533     push @{$nses}, $ns;
1534     $ns = {%$ns};
1535 wakaba 1.26
1536     ## Default attributes
1537     DA: for my $atqname (%{$self->{attr}->{$type}}) {
1538     next DA unless $self->{attr}->{$type}->{$atqname};
1539     next DA if exists $attrs->{$atqname}; # specified
1540     my $dtype = $self->{attr}->{$type}->{$atqname}
1541     -><AG::ATDef.defaultType>;
1542     next DA unless $dtype == <C::ATDef.EXPLICIT_DEFAULT> or
1543     $dtype == <C::ATDef.FIXED_DEFAULT>;
1544     $attrs->{$atqname} = {is_default => true, nodes => []};
1545     for (@{$self->{attr}->{$type}->{$atqname}
1546     -><AG::Node.childNodes>}) {
1547     push @{$attrs->{$atqname}->{nodes}},
1548     $_-><M::Node.cloneNode> (true);
1549     }
1550     }
1551 wakaba 1.1
1552     my %gattr;
1553     my %lattr;
1554     for my $atqname (keys %$attrs) {
1555     my ($pfx, $lname) = split /:/, $atqname;
1556 wakaba 1.9 $attrs->{$atqname}->{def} = $self->{attr}->{$type}->{$atqname};
1557 wakaba 1.1 if (defined $lname) { ## Global attribute
1558     if ($pfx eq 'xmlns') {
1559 wakaba 1.26 my $nsuri = $attrs->{$atqname}->{is_default}
1560     ? $attrs->{$atqname}->{def}-><AG::Node.nodeValue>
1561     : $attrs->{$atqname}->{value};
1562     if (not $attrs->{$atqname}->{is_default} and
1563     $attrs->{$atqname}->{def}) {
1564 wakaba 1.9 my $dt = $attrs->{$atqname}->{def}-><AG::ATDef.declaredType>;
1565     if ({
1566     <C::ATDef.ID_ATTR> => true,
1567     <C::ATDef.IDREF_ATTR> => true,
1568     <C::ATDef.IDREFS_ATTR> => true,
1569     <C::ATDef.ENTITY_ATTR> => true,
1570     <C::ATDef.ENTITIES_ATTR> => true,
1571     <C::ATDef.NMTOKEN_ATTR> => true,
1572     <C::ATDef.NMTOKENS_ATTR> => true,
1573     <C::ATDef.NOTATION_ATTR> => true,
1574     <C::ATDef.ENUMERATION_ATTR> => true,
1575     }->{$dt}) {
1576     ## Tokenization (XML 1 3.3.3)
1577 wakaba 1.26 for ($nsuri) {
1578 wakaba 1.9 s/^\x20+//;
1579     s/\x20+\z//;
1580     s/\x20+/ /g;
1581     }
1582     }
1583     }
1584 wakaba 1.26 if ($lname eq 'xml' and
1585     $nsuri ne <Q::xml:>) {
1586     my $location;
1587     __CODE{xp|get-location-from-token::
1588     $token => $token,
1589     $result => $location,
1590     }__;
1591     my $continue = __c|ERROR{xp|nsc-reserved-prefix-xml::
1592     c|location => {$location},
1593     xp|token => {$token},
1594     infoset|prefix => {$lname},
1595     infoset|namespaceName => {$nsuri},
1596     }__;
1597     unless ($continue) {
1598 wakaba 1.27 __CODE{ParseError}__;
1599 wakaba 1.26 }
1600     } elsif ($lname eq 'xmlns') {
1601     my $location;
1602     __CODE{xp|get-location-from-token::
1603     $token => $token,
1604     $result => $location,
1605     }__;
1606     my $continue = __c|ERROR{xp|nsc-reserved-prefix-xmlns::
1607     c|location => {$location},
1608     xp|token => {$token},
1609     infoset|prefix => {$lname},
1610     infoset|namespaceName => {$nsuri},
1611     }__;
1612     unless ($continue) {
1613 wakaba 1.27 __CODE{ParseError}__;
1614 wakaba 1.26 }
1615     }
1616     if ($nsuri eq '') {
1617     if ($self->{xml_version} eq '1.0') {
1618     my $location;
1619     __CODE{xp|get-location-from-token::
1620     $token => $token,
1621     $result => $location,
1622     }__;
1623     my $continue = __c|ERROR{xp|nswf-empty-namespace-name::
1624     c|location => {$location},
1625     xp|token => {$token},
1626     infoset|namespaceName => {$nsuri},
1627     infoset|prefix => {$lname},
1628     }__;
1629     unless ($continue) {
1630 wakaba 1.27 __CODE{ParseError}__;
1631 wakaba 1.26 }
1632     }
1633     } elsif ($nsuri eq <Q::xml:> and
1634     $lname ne 'xml') {
1635     my $location;
1636     __CODE{xp|get-location-from-token::
1637     $token => $token,
1638     $result => $location,
1639     }__;
1640     my $continue = __c|ERROR{
1641     xp|nsc-reserved-namespace-name-xml::
1642     c|location => {$location},
1643     xp|token => {$token},
1644     infoset|prefix => {$lname},
1645     infoset|namespaceName => {$nsuri},
1646     }__;
1647     unless ($continue) {
1648 wakaba 1.27 __CODE{ParseError}__;
1649 wakaba 1.26 }
1650     } elsif ($nsuri eq <Q::xmlns:>) {
1651     my $location;
1652     __CODE{xp|get-location-from-token::
1653     $token => $token,
1654     $result => $location,
1655     }__;
1656     my $continue = __c|ERROR{
1657     xp|nsc-reserved-namespace-name-xmlns::
1658     c|location => {$location},
1659     xp|token => {$token},
1660     infoset|prefix => {$lname},
1661     infoset|namespaceName => {$nsuri},
1662     }__;
1663     unless ($continue) {
1664 wakaba 1.27 __CODE{ParseError}__;
1665 wakaba 1.26 }
1666     }
1667     $ns->{$lname} = $nsuri;
1668 wakaba 1.1 delete $ns->{$lname} unless length $ns->{$lname};
1669     }
1670     $gattr{$pfx}->{$lname} = $attrs->{$atqname};
1671     } else { ## Local attribute
1672     if ($pfx eq 'xmlns') {
1673 wakaba 1.26 $ns->{''} = $attrs->{xmlns}->{is_default}
1674     ? $attrs->{xmlns}->{def}-><AG::Node.nodeValue>
1675     : $attrs->{xmlns}->{value};
1676     if (not $attrs->{$atqname}->{is_default} and
1677     $attrs->{$atqname}->{def}) {
1678 wakaba 1.9 my $dt = $attrs->{$atqname}->{def}-><AG::ATDef.declaredType>;
1679     if ({
1680     <C::ATDef.ID_ATTR> => true,
1681     <C::ATDef.IDREF_ATTR> => true,
1682     <C::ATDef.IDREFS_ATTR> => true,
1683     <C::ATDef.ENTITY_ATTR> => true,
1684     <C::ATDef.ENTITIES_ATTR> => true,
1685     <C::ATDef.NMTOKEN_ATTR> => true,
1686     <C::ATDef.NMTOKENS_ATTR> => true,
1687     <C::ATDef.NOTATION_ATTR> => true,
1688     <C::ATDef.ENUMERATION_ATTR> => true,
1689     }->{$dt}) {
1690     ## Tokenization (XML 1 3.3.3)
1691     for ($ns->{''}) {
1692     s/^\x20+//;
1693     s/\x20+\z//;
1694     s/\x20+/ /g;
1695     }
1696     }
1697     }
1698 wakaba 1.26 unless ($ns->{''}) {
1699     delete $ns->{''};
1700     } elsif ($ns->{''} eq <Q::xml:>) {
1701     my $location;
1702     __CODE{xp|get-location-from-token::
1703     $token => $token,
1704     $result => $location,
1705     }__;
1706     my $continue = __c|ERROR{
1707     xp|nsc-reserved-namespace-name-xml::
1708     c|location => {$location},
1709     xp|token => {$token},
1710     infoset|prefix => {null},
1711     infoset|namespaceName => {<Q::xml:>},
1712     }__;
1713     unless ($continue) {
1714 wakaba 1.27 __CODE{ParseError}__;
1715 wakaba 1.26 }
1716     } elsif ($ns->{''} eq <Q::xmlns:>) {
1717     my $location;
1718     __CODE{xp|get-location-from-token::
1719     $token => $token,
1720     $result => $location,
1721     }__;
1722     my $continue = __c|ERROR{
1723     xp|nsc-reserved-namespace-name-xmlns::
1724     c|location => {$location},
1725     xp|token => {$token},
1726     infoset|prefix => {null},
1727     infoset|namespaceName => {<Q::xmlns:>},
1728     }__;
1729     unless ($continue) {
1730 wakaba 1.27 __CODE{ParseError}__;
1731 wakaba 1.26 }
1732     }
1733 wakaba 1.1 } else {
1734     $lattr{$pfx} = $attrs->{$atqname};
1735     }
1736     }
1737     }
1738    
1739     my ($pfx, $lname) = split /:/, $type;
1740     my $nsuri;
1741     if (defined $lname) { ## Prefixed namespace
1742     if (defined $ns->{$pfx}) {
1743     $nsuri = $ns->{$pfx};
1744     } else {
1745 wakaba 1.26 my $location;
1746     __CODE{xp|get-location-from-token::
1747     $token => $token,
1748     $result => $location,
1749     }__;
1750     my $continue = __c|ERROR{xp|nsc-prefix-declared::
1751     c|location => {$location},
1752     xp|token => {$token},
1753     infoset|prefix => {$pfx},
1754     xp|name => {$type},
1755     }__;
1756     unless ($continue) {
1757 wakaba 1.27 __CODE{ParseError}__;
1758 wakaba 1.26 }
1759 wakaba 1.1 }
1760     } else { ## Default namespace
1761     $nsuri = $ns->{''};
1762     }
1763    
1764     $el = $doc-><M::Document.createElementNS>
1765     ($nsuri, $type);
1766    
1767     if ($attrs->{xmlns}) {
1768     my $attr = $doc-><M::Document.createAttributeNS>
1769     (<Q::xmlns:>, 'xmlns');
1770     for (@{$attrs->{xmlns}->{nodes}}) {
1771     $attr-><M::Node.appendChild> ($_);
1772     }
1773 wakaba 1.9 if ($attrs->{xmlns}->{def}) {
1774     __CODE{t|setAttrType::
1775     $attr => $attr,
1776     $type => {$attrs->{xmlns}->{def}-><AG::ATDef.declaredType>},
1777     }__;
1778     }
1779 wakaba 1.1 $el-><M::Element.setAttributeNodeNS> ($attr);
1780 wakaba 1.26 $attr-><AS::t|Attr.specified> (false)
1781     if $attrs->{xmlns}->{is_default};
1782 wakaba 1.1 }
1783    
1784     for my $lname (keys %lattr) {
1785     my $attr = $doc-><M::Document.createAttributeNS>
1786     (null, $lname);
1787     for (@{$lattr{$lname}->{nodes}}) {
1788     $attr-><M::Node.appendChild> ($_);
1789     }
1790 wakaba 1.9 if ($attrs->{$lname}->{def}) {
1791     __CODE{t|setAttrType::
1792     $attr => $attr,
1793     $type => {$attrs->{$lname}->{def}-><AG::ATDef.declaredType>},
1794     }__;
1795     }
1796 wakaba 1.1 $el-><M::Element.setAttributeNodeNS> ($attr);
1797 wakaba 1.26 $attr-><AS::t|Attr.specified> (false)
1798     if $attrs->{$lname}->{is_default};
1799 wakaba 1.1 }
1800    
1801     for my $pfx (keys %gattr) {
1802 wakaba 1.26 LN: for my $lname (keys %{$gattr{$pfx}}) {
1803     my $name = $pfx.':'.$lname;
1804     unless (defined $ns->{$pfx}) {
1805     my $location;
1806     __CODE{xp|get-location-from-token::
1807     $token => $token,
1808     $result => $location,
1809     }__;
1810     my $continue = __c|ERROR{xp|nsc-prefix-declared::
1811     c|location => {$location},
1812     xp|token => {$token},
1813     xp|name => {$name},
1814     infoset|prefix => {$pfx},
1815     }__;
1816     unless ($continue) {
1817 wakaba 1.27 __CODE{ParseError}__;
1818 wakaba 1.26 }
1819     }
1820     my $attr = $el-><M::Element.getAttributeNodeNS>
1821     ($ns->{$pfx}, $lname);
1822     if ($attr) {
1823     my $another_name = $attr-><AG::Node.nodeName>;
1824     if ($name ne $another_name) {
1825     my $location;
1826     __CODE{xp|get-location-from-token::
1827     $token => $token,
1828     $result => $location,
1829     }__;
1830     my $continue = __c|ERROR{
1831     xp|nswf-unique-att-spec-expanded-name::
1832     c|location => {$location},
1833     xp|token => {$token},
1834     xp|another-attribute-name => {$another_name},
1835     xp|name => {$name},
1836     infoset|namespaceName => {$ns->{$pfx}},
1837     infoset|localName => {$lname},
1838     }__;
1839     unless ($continue) {
1840 wakaba 1.27 __CODE{ParseError}__;
1841 wakaba 1.26 }
1842     unless ($attr-><AG::t|Attr.specified>) {
1843     ## It is a default attribute
1844     $attr = $doc-><M::Document.createAttributeNS>
1845     ($ns->{$pfx}, $name);
1846     } else {
1847     ## It is a specified attribute
1848     next LN;
1849     }
1850     } else { ## There is default attribute
1851     $attr = $doc-><M::Document.createAttributeNS>
1852     ($ns->{$pfx}, $name);
1853     }
1854     } else {
1855     $attr = $doc-><M::Document.createAttributeNS>
1856     ($ns->{$pfx}, $name);
1857     }
1858 wakaba 1.1 for (@{$gattr{$pfx}->{$lname}->{nodes}}) {
1859     $attr-><M::Node.appendChild> ($_);
1860     }
1861 wakaba 1.26 if ($gattr{$pfx}->{$lname}->{def}) {
1862 wakaba 1.9 __CODE{t|setAttrType::
1863     $attr => $attr,
1864 wakaba 1.26 $type => {$gattr{$pfx}->{$lname}
1865 wakaba 1.9 ->{def}-><AG::ATDef.declaredType>},
1866     }__;
1867     }
1868 wakaba 1.1 $el-><M::Element.setAttributeNodeNS> ($attr);
1869 wakaba 1.26 $attr-><AS::t|Attr.specified> (false)
1870     if $gattr{$pfx}->{$lname}->{is_default};
1871     } # PFX
1872 wakaba 1.1 }
1873    
1874     $node-><M::Node.appendChild> ($el);
1875     }
1876    
1877     ~ (TAGC) {
1878     lang:Perl {
1879     push @{$nodes}, $node;
1880     $node = $el;
1881     }
1882     ?lexmode ElementContent;
1883 wakaba 1.6 } (NESTC) {
1884     my $is_docel;
1885 wakaba 1.1 lang:Perl {
1886     $ns = pop @{$nses};
1887     $type = pop @{$types};
1888 wakaba 1.6 $is_docel = (@{$types} == 0);
1889     }
1890    
1891     if-true ($is_docel) {
1892     return;
1893     }
1894    
1895     ~ (TAGC) {
1896     ?lexmode ElementContent;
1897     } else {
1898     ?lexmode ElementContent;
1899 wakaba 1.1 }
1900     } else {
1901     ?lexmode ElementContent;
1902     }
1903     } else {
1904     ?lexmode ElementContent;
1905     }
1906    
1907     } (ETAGO) {
1908     // End tag
1909    
1910     ?lexmode 'EndTag';
1911    
1912     my $is_docel;
1913    
1914     ~ (Name) {
1915 wakaba 1.26 // No NCName & QName check (it must match to start-tag)
1916 wakaba 1.3 lang:Perl ($name => $token.value) : has-error {
1917 wakaba 1.1 if ($name eq $type) {
1918     $type = pop @{$types};
1919     if ($type eq '') {
1920     $is_docel = true;
1921     }
1922     $node = pop @{$nodes};
1923     $ns = pop @{$nses};
1924     } else {
1925 wakaba 1.3 my $location;
1926     __CODE{xp|get-location-from-token::
1927     $token => $token,
1928     $result => $location,
1929     }__;
1930     my $continue = __DOMCore:ERROR{xp|wf-element-type-match::
1931     DOMCore:location => {$location},
1932     xp|token => {$token},
1933     xp|expected-element-type => {$type},
1934     xp|actual-element-type => {$name},
1935     xp|node => {$node},
1936     }__;
1937     unless ($continue) {
1938 wakaba 1.27 __CODE{ParseError}__;
1939 wakaba 1.3 }
1940 wakaba 1.1 }
1941     }
1942     }
1943    
1944     ~? (S) { }
1945    
1946     if-true ($is_docel) {
1947 wakaba 1.3 lang:Perl : has-error {
1948 wakaba 1.1 if (@{$types}) {
1949 wakaba 1.3 my $location;
1950     __CODE{xp|get-location-from-token::
1951     $token => $token,
1952     $result => $location,
1953     }__;
1954     for my $type (reverse @{$types}) {
1955     my $continue = __DOMCore:ERROR{xp|wf-no-end-tag::
1956     DOMCore:location => {$location},
1957     xp|token => {$token},
1958     xp|expected-element-type => {$type},
1959     xp|node => {$node},
1960     }__;
1961     unless ($continue) {
1962 wakaba 1.27 __CODE{ParseError}__;
1963 wakaba 1.3 }
1964     $node = shift @{$nodes};
1965     }
1966 wakaba 1.1 }
1967     }
1968     return;
1969     }
1970    
1971     ~ (TAGC) {
1972     ?lexmode ElementContent;
1973     } else {
1974     ?lexmode 'ElementContent';
1975     }
1976    
1977     } (HCRO) {
1978     &_HexadecimalCharacterReference_
1979     ($doc => $doc, $parent => $node);
1980    
1981     ~ (REFC) {
1982     ?lexmode 'ElementContent';
1983     } else {
1984     ?lexmode ElementContent;
1985     }
1986     } (CRO) {
1987     &_NumericCharacterReference_
1988     ($doc => $doc, $parent => $node);
1989    
1990     ~ (REFC) {
1991     ?lexmode 'ElementContent';
1992     } else {
1993     ?lexmode ElementContent;
1994     }
1995     } (ERO) {
1996 wakaba 1.6 &_GeneralEntityReferenceEC
1997     ($doc => $doc, $parent => $node, $ns => $ns);
1998 wakaba 1.1 } (CDO) {
1999     &_CommentDeclaration_ ($doc => $doc, $parent => $node);
2000    
2001     ~ (MDC) {
2002     ?lexmode ElementContent;
2003     } else {
2004     ?lexmode ElementContent;
2005     }
2006     } (CDSO) {
2007     &_CDATASection_ ($doc => $doc, $parent => $node);
2008    
2009     ~ (MSE) {
2010     ?lexmode 'ElementContent';
2011     } else {
2012     ?lexmode ElementContent;
2013     }
2014     } (PIO) {
2015     &_ProcessingInstruction_ ($doc => $doc, $parent => $node);
2016    
2017     ~ (PIC) {
2018     ?lexmode 'ElementContent';
2019     } else {
2020     ?lexmode ElementContent;
2021     }
2022     }
2023 wakaba 1.3
2024     ~ (#NONE) { }
2025 wakaba 1.1 } // Element_
2026 wakaba 1.11
2027     /*
2028     content := [CharData]
2029     *((element / Reference / CDSect / PI / Comment) [CharData])
2030     */
2031     rule content ($parent, $ns) {
2032     // ?lexmode ElementContent;
2033    
2034     my $doc;
2035     lang:Perl {
2036     $doc = $self->{doc};
2037     }
2038    
2039     ~* (CharData) {
2040     lang:Perl ($data => $token.value) {
2041     $parent-><M::Node.appendChild>
2042     ($self->{doc}-><M::Document.createTextNode> ($data));
2043     }
2044     } (STAGO) {
2045     &Element_ ($doc => $doc, $parent => $parent, $ns => $ns)
2046     : unshift-current-token;
2047     ~ (TAGC) {
2048     ?lexmode ElementContent;
2049     } else {
2050     ?lexmode ElementContent;
2051     }
2052     } (HCRO) {
2053     &_HexadecimalCharacterReference_
2054     ($doc => $doc, $parent => $parent);
2055    
2056     ~ (REFC) {
2057     ?lexmode 'ElementContent';
2058     } else {
2059     ?lexmode ElementContent;
2060     }
2061     } (CRO) {
2062     &_NumericCharacterReference_
2063     ($doc => $doc, $parent => $parent);
2064    
2065     ~ (REFC) {
2066     ?lexmode 'ElementContent';
2067     } else {
2068     ?lexmode ElementContent;
2069     }
2070     } (ERO) {
2071     &_GeneralEntityReferenceEC
2072     ($doc => $doc, $parent => $parent, $ns => $ns);
2073     } (CDO) {
2074     &_CommentDeclaration_ ($doc => $doc, $parent => $parent);
2075    
2076     ~ (MDC) {
2077     ?lexmode ElementContent;
2078     } else {
2079     ?lexmode ElementContent;
2080     }
2081     } (CDSO) {
2082     &_CDATASection_ ($doc => $doc, $parent => $parent);
2083    
2084     ~ (MSE) {
2085     ?lexmode 'ElementContent';
2086     } else {
2087     ?lexmode ElementContent;
2088     }
2089     } (PIO) {
2090     &_ProcessingInstruction_ ($doc => $doc, $parent => $parent);
2091    
2092     ~ (PIC) {
2093     ?lexmode 'ElementContent';
2094     } else {
2095     ?lexmode ElementContent;
2096     }
2097     }
2098     } // content
2099 wakaba 1.1
2100     rule AttributeSpecificationList ($doc, $attrs)
2101     : standalone
2102     {
2103     ?lexmode 'StartTag';
2104    
2105     my $i;
2106     lang:Perl {
2107     $i = 0;
2108     }
2109    
2110     ~* (Name) {
2111     my $atqname;
2112 wakaba 1.26 lang:Perl ($name => $token.value) : has-error {
2113     __CODE{checkQName:: $name => $name}__;
2114 wakaba 1.1 $atqname = $name;
2115     }
2116    
2117     my $vals;
2118 wakaba 1.18 lang:Perl : has-error {
2119 wakaba 1.1 if ($attrs->{$atqname}) {
2120 wakaba 1.3 my $location;
2121     __CODE{xp|get-location-from-token::
2122     $token => $token,
2123     $result => $location,
2124     }__;
2125     my $continue = __DOMCore:ERROR{xp|wf-unique-att-spec::
2126     DOMCore:location => {$location},
2127     xp|token => {$token},
2128     xp|name => {$atqname},
2129     }__;
2130     unless ($continue) {
2131 wakaba 1.27 __CODE{ParseError}__;
2132 wakaba 1.3 }
2133 wakaba 1.1 }
2134    
2135     $vals = $attrs->{$atqname} = {
2136     nodes => [],
2137     value => '',
2138     index => $i++,
2139     };
2140     }
2141 wakaba 1.3
2142     ~? (S) { }
2143     ~ (VI) { }
2144     ~? (S) { }
2145 wakaba 1.1
2146     ~ (LIT) {
2147     &_AttributeValueSpecification_
2148     ($doc => $doc, $vals => $vals);
2149    
2150     ~ (LIT) {
2151     ?lexmode StartTag;
2152     } else {
2153     ?lexmode StartTag;
2154     }
2155     } (LITA) {
2156     &_AttributeValueSpecificationA_
2157     ($doc => $doc, $vals => $vals);
2158    
2159     ~ (LITA) {
2160     ?lexmode StartTag;
2161     } else {
2162     ?lexmode StartTag;
2163     }
2164     }
2165     } (S) : separator : terminator? { }
2166     } // AttributeSpecificationList
2167    
2168     rule _AttributeValueSpecification_ ($doc, $vals) {
2169     // ~ (LIT) { }
2170     ?lexmode 'AttributeValueLiteral';
2171    
2172     ~* (STRING) {
2173     lang:Perl ($value => $token.value) {
2174     $value =~ s/[\x09\x0A\x0D]/ /g;
2175     my $text = $doc-><M::Document.createTextNode> ($value);
2176     push @{$vals->{nodes}}, $text;
2177     $vals->{value} .= $value;
2178     }
2179     } (HCRO) {
2180     &_HexadecimalCharacterReferenceV_
2181     ($doc => $doc, $vals => $vals);
2182    
2183     ~ (REFC) {
2184     ?lexmode AttributeValueLiteral;
2185     } else {
2186     ?lexmode AttributeValueLiteral;
2187     }
2188     } (CRO) {
2189     &_NumericCharacterReferenceV_
2190     ($doc => $doc, $vals => $vals);
2191    
2192     ~ (REFC) {
2193     ?lexmode AttributeValueLiteral;
2194     } else {
2195     ?lexmode AttributeValueLiteral;
2196     }
2197     } (ERO) {
2198     // TODO: Attribute value normalization
2199     &_GeneralEntityReferenceV_
2200     ($doc => $doc, $vals => $vals);
2201    
2202     ~ (REFC) {
2203     ?lexmode AttributeValueLiteral;
2204     } else {
2205     ?lexmode AttributeValueLiteral;
2206     }
2207     }
2208    
2209     // ~ (LIT) { } (LITA) { }
2210     } // _AttributeValueSpecification_
2211    
2212     rule _AttributeValueSpecificationA_ ($doc, $vals) {
2213     // ~ (LITA) { }
2214     ?lexmode 'AttributeValueLiteralA';
2215    
2216     ~* (STRING) {
2217     lang:Perl ($value => $token.value) {
2218     $value =~ s/[\x09\x0A\x0D]/ /g;
2219     my $text = $doc-><M::Document.createTextNode> ($value);
2220     push @{$vals->{nodes}}, $text;
2221     $vals->{value} .= $value;
2222     }
2223     } (HCRO) {
2224     &_HexadecimalCharacterReferenceV_
2225     ($doc => $doc, $vals => $vals);
2226    
2227     ~ (REFC) {
2228     ?lexmode AttributeValueLiteralA;
2229     } else {
2230     ?lexmode AttributeValueLiteralA;
2231     }
2232     } (CRO) {
2233     &_NumericCharacterReferenceV_
2234     ($doc => $doc, $vals => $vals);
2235    
2236     ~ (REFC) {
2237     ?lexmode AttributeValueLiteralA;
2238     } else {
2239     ?lexmode AttributeValueLiteralA;
2240     }
2241     } (ERO) {
2242     // TODO: Attribute value normalization
2243     &_GeneralEntityReferenceV_
2244     ($doc => $doc, $vals => $vals);
2245    
2246     ~ (REFC) {
2247     ?lexmode AttributeValueLiteralA;
2248     } else {
2249     ?lexmode AttributeValueLiteralA;
2250     }
2251     }
2252    
2253     // ~ (LITA) { }
2254     } // _AttributeValueSpecificationA_
2255    
2256     /*
2257 wakaba 1.11 Parsing replacement text of an entity referenced in
2258     an attribute value specification.
2259     */
2260     rule AttributeValueLiteralE_ ($parent, $vals)
2261     : recursive
2262     {
2263     // ?lexmode AttributeValueLiteralE;
2264    
2265     ~* (STRING) {
2266     lang:Perl ($value => $token.value) {
2267     $value =~ s/[\x09\x0A\x0D]/ /g;
2268     my $text = $self->{doc}-><M::Document.createTextNode> ($value);
2269     $parent-><M::Node.appendChild> ($text);
2270     $vals->{value} .= $value;
2271     }
2272     } (HCRO) {
2273     &_HexadecimalCharacterReferenceAE_
2274     ($parent => $parent, $vals => $vals);
2275    
2276     ~ (REFC) {
2277     ?lexmode AttributeValueLiteralE;
2278     } else {
2279     ?lexmode AttributeValueLiteralE;
2280     }
2281     } (CRO) {
2282     &_NumericCharacterReferenceAE_
2283     ($parent => $parent, $vals => $vals);
2284    
2285     ~ (REFC) {
2286     ?lexmode AttributeValueLiteralE;
2287     } else {
2288     ?lexmode AttributeValueLiteralE;
2289     }
2290     } (ERO) {
2291     &_GeneralEntityReferenceAE_ ($parent => $parent, $vals => $vals);
2292    
2293     ~ (REFC) {
2294     ?lexmode AttributeValueLiteralE;
2295     } else {
2296     ?lexmode AttributeValueLiteralE;
2297     }
2298 wakaba 1.18 } (#INVALID == '<') {
2299     lang:Perl : has-error {
2300     my $location;
2301     __CODE{xp|get-location-from-token::
2302     $token => $token,
2303     $result => $location,
2304     }__;
2305     my $continue = __DOMCore:ERROR{xp|wf-no-lt-in-attribute-values::
2306     c|location => {$location},
2307     xp|token => {$token},
2308     }__;
2309     unless ($continue) {
2310 wakaba 1.27 __CODE{ParseError}__;
2311 wakaba 1.18 }
2312    
2313     my $text = $self->{doc}-><M::Document.createTextNode> ('<');
2314     $parent-><M::Node.appendChild> ($text);
2315     $vals->{value} .= '<';
2316     }
2317 wakaba 1.11 }
2318    
2319     // ~ (#EOF) { }
2320     } // AttributeValueLiteralE_
2321    
2322     /*
2323 wakaba 1.1 CDATA Section Content Parsing Mode
2324     */
2325     rule _CDATASection_ ($doc, $parent) {
2326     ?lexmode 'CDATASectionContent';
2327    
2328     my $cdata;
2329    
2330 wakaba 1.2 ~? (CData) {
2331 wakaba 1.1 lang:Perl ($data => $token.value) {
2332     $cdata = $data;
2333     }
2334     } else {
2335     lang:Perl {
2336     $cdata = '';
2337     }
2338     }
2339    
2340     lang:Perl {
2341     my $cdsect = $doc-><M::Document.createCDATASection>
2342     ($cdata);
2343     $parent-><M::Node.appendChild> ($cdsect);
2344     }
2345    
2346     // ~ (MSE) { }
2347     } // _CDATASection_
2348    
2349     rule _NumericCharacterReference_ ($doc, $parent) {
2350     ?lexmode 'NumericCharacterReference';
2351    
2352     ~ (NUMBER) {
2353 wakaba 1.3 lang:Perl ($num => $token.value) : has-error {
2354     $num += 0;
2355     unless (
2356     ($self->{xml_version} eq '1.0' and
2357     ((0x0020 <= $num and $num <= 0xD7FF) or
2358     (0xE000 <= $num and $num <= 0xFFFD) or
2359     (0x10000 <= $num and $num <= 0x10FFFF) or
2360     $num == 0x9 or $num == 0xA or $num == 0xD)) or
2361     ($self->{xml_version} eq '1.1' and
2362     ((0x0001 <= $num and $num <= 0xD7FF) or
2363     (0xE000 <= $num and $num <= 0xFFFD) or
2364     (0x10000 <= $num and $num <= 0x10FFFF)))
2365     ) {
2366     my $location;
2367     __CODE{xp|get-location-from-token::
2368     $token => $token,
2369     $result => $location,
2370     }__;
2371     my $continue = __DOMCore:ERROR{xp|wf-legal-character::
2372     DOMCore:location => {$location},
2373     xp|token => {$token},
2374     xp|character-number => {$num},
2375     xp|parent => {$parent},
2376     }__;
2377     unless ($continue) {
2378 wakaba 1.27 __CODE{ParseError}__;
2379 wakaba 1.3 }
2380     }
2381     my $ncr = $doc-><M::Document.createTextNode> (chr $num);
2382 wakaba 1.1 $parent-><M::Node.appendChild> ($ncr);
2383     }
2384     }
2385    
2386     // ~ (REFC) { }
2387     } // _NumericCharacterReference_
2388    
2389     rule _NumericCharacterReferenceV_ ($doc, $vals) {
2390     ?lexmode 'NumericCharacterReference';
2391    
2392     ~ (NUMBER) {
2393 wakaba 1.3 lang:Perl ($num => $token.value) : has-error {
2394     $num += 0;
2395     unless (
2396     ($self->{xml_version} eq '1.0' and
2397     ((0x0020 <= $num and $num <= 0xD7FF) or
2398     (0xE000 <= $num and $num <= 0xFFFD) or
2399     (0x10000 <= $num and $num <= 0x10FFFF) or
2400     $num == 0x9 or $num == 0xA or $num == 0xD)) or
2401     ($self->{xml_version} eq '1.1' and
2402     ((0x0001 <= $num and $num <= 0xD7FF) or
2403     (0xE000 <= $num and $num <= 0xFFFD) or
2404     (0x10000 <= $num and $num <= 0x10FFFF)))
2405     ) {
2406     my $location;
2407     __CODE{xp|get-location-from-token::
2408     $token => $token,
2409     $result => $location,
2410     }__;
2411     my $continue = __DOMCore:ERROR{xp|wf-legal-character::
2412     DOMCore:location => {$location},
2413     xp|token => {$token},
2414     xp|character-number => {$num},
2415     }__;
2416     unless ($continue) {
2417 wakaba 1.27 __CODE{ParseError}__;
2418 wakaba 1.3 }
2419     }
2420 wakaba 1.1 my $ncr = $doc-><M::Document.createTextNode>
2421 wakaba 1.9 (my $char = chr $num);
2422 wakaba 1.1 push @{$vals->{nodes}}, $ncr;
2423     $vals->{value} .= $char;
2424     }
2425     }
2426    
2427     // ~ (REFC) { }
2428     } // _NumericCharacterReferenceV_
2429    
2430 wakaba 1.11 /*
2431     Numeric character reference in the replacement text
2432     of the entity referenced in an attribute value specification
2433     */
2434     rule _NumericCharacterReferenceAE_ ($parent, $vals)
2435     {
2436     ?lexmode NumericCharacterReference;
2437    
2438     ~ (NUMBER) {
2439     lang:Perl ($num => $token.value) : has-error {
2440     $num += 0;
2441     unless (
2442     ($self->{xml_version} eq '1.0' and
2443     ((0x0020 <= $num and $num <= 0xD7FF) or
2444     (0xE000 <= $num and $num <= 0xFFFD) or
2445     (0x10000 <= $num and $num <= 0x10FFFF) or
2446     $num == 0x9 or $num == 0xA or $num == 0xD)) or
2447     ($self->{xml_version} eq '1.1' and
2448     ((0x0001 <= $num and $num <= 0xD7FF) or
2449     (0xE000 <= $num and $num <= 0xFFFD) or
2450     (0x10000 <= $num and $num <= 0x10FFFF)))
2451     ) {
2452     my $location;
2453     __CODE{xp|get-location-from-token::
2454     $token => $token,
2455     $result => $location,
2456     }__;
2457     my $continue = __DOMCore:ERROR{xp|wf-legal-character::
2458     DOMCore:location => {$location},
2459     xp|token => {$token},
2460     xp|character-number => {$num},
2461     }__;
2462     unless ($continue) {
2463 wakaba 1.27 __CODE{ParseError}__;
2464 wakaba 1.11 }
2465     }
2466     my $ncr = $self->{doc}-><M::Document.createTextNode>
2467     (my $char = chr $num);
2468     $parent-><M::Node.appendChild> ($ncr);
2469     $vals->{value} .= $char;
2470     }
2471     }
2472    
2473     // ~ (REFC) { }
2474     } // _NumericCharacterReferenceAE_
2475    
2476     rule _NumericCharacterReferenceEV_ ($vals)
2477     {
2478     ?lexmode 'NumericCharacterReference';
2479    
2480     ~ (NUMBER) {
2481     lang:Perl ($num => $token.value) : has-error {
2482     $num += 0;
2483     unless (
2484     ($self->{xml_version} eq '1.0' and
2485     ((0x0020 <= $num and $num <= 0xD7FF) or
2486     (0xE000 <= $num and $num <= 0xFFFD) or
2487     (0x10000 <= $num and $num <= 0x10FFFF) or
2488     $num == 0x9 or $num == 0xA or $num == 0xD)) or
2489     ($self->{xml_version} eq '1.1' and
2490     ((0x0001 <= $num and $num <= 0xD7FF) or
2491     (0xE000 <= $num and $num <= 0xFFFD) or
2492     (0x10000 <= $num and $num <= 0x10FFFF)))
2493     ) {
2494     my $location;
2495     __CODE{xp|get-location-from-token::
2496     $token => $token,
2497     $result => $location,
2498     }__;
2499     my $continue = __DOMCore:ERROR{xp|wf-legal-character::
2500     DOMCore:location => {$location},
2501     xp|token => {$token},
2502     xp|character-number => {$num},
2503     }__;
2504     unless ($continue) {
2505 wakaba 1.27 __CODE{ParseError}__;
2506 wakaba 1.11 }
2507     }
2508     push @{$vals}, chr $num;
2509     }
2510     }
2511    
2512     // ~ (REFC) { }
2513     } // _NumericCharacterReferenceEV_
2514    
2515 wakaba 1.1 rule _HexadecimalCharacterReference_ ($doc, $parent) {
2516     ?lexmode 'HexadecimalCharacterReference';
2517    
2518     ~ (Hex) {
2519 wakaba 1.9 lang:Perl ($v => $token.value) : has-error {
2520     my $num = hex $v;
2521 wakaba 1.3 unless (
2522     ($self->{xml_version} eq '1.0' and
2523     ((0x0020 <= $num and $num <= 0xD7FF) or
2524     (0xE000 <= $num and $num <= 0xFFFD) or
2525     (0x10000 <= $num and $num <= 0x10FFFF) or
2526     $num == 0x9 or $num == 0xA or $num == 0xD)) or
2527     ($self->{xml_version} eq '1.1' and
2528     ((0x0001 <= $num and $num <= 0xD7FF) or
2529     (0xE000 <= $num and $num <= 0xFFFD) or
2530     (0x10000 <= $num and $num <= 0x10FFFF)))
2531     ) {
2532     my $location;
2533     __CODE{xp|get-location-from-token::
2534     $token => $token,
2535     $result => $location,
2536     }__;
2537     my $continue = __DOMCore:ERROR{xp|wf-legal-character::
2538     DOMCore:location => {$location},
2539     xp|token => {$token},
2540     xp|character-number => {$num},
2541     xp|parent => {$parent},
2542     }__;
2543     unless ($continue) {
2544 wakaba 1.27 __CODE{ParseError}__;
2545 wakaba 1.3 }
2546     }
2547 wakaba 1.1 my $ncr = $doc-><M::Document.createTextNode>
2548 wakaba 1.9 (chr $num);
2549 wakaba 1.1 $parent-><M::Node.appendChild> ($ncr);
2550     }
2551     }
2552    
2553     // ~ (REFC) { }
2554     } // _HexadecimalCharacterReference_
2555    
2556 wakaba 1.3 rule _HexadecimalCharacterReferenceV_ ($doc, $vals) {
2557 wakaba 1.1 ?lexmode 'HexadecimalCharacterReference';
2558    
2559     ~ (Hex) {
2560 wakaba 1.9 lang:Perl ($v => $token.value) : has-error {
2561     my $num = hex $v;
2562 wakaba 1.3 unless (
2563     ($self->{xml_version} eq '1.0' and
2564     ((0x0020 <= $num and $num <= 0xD7FF) or
2565     (0xE000 <= $num and $num <= 0xFFFD) or
2566     (0x10000 <= $num and $num <= 0x10FFFF) or
2567     $num == 0x9 or $num == 0xA or $num == 0xD)) or
2568     ($self->{xml_version} eq '1.1' and
2569     ((0x0001 <= $num and $num <= 0xD7FF) or
2570     (0xE000 <= $num and $num <= 0xFFFD) or
2571     (0x10000 <= $num and $num <= 0x10FFFF)))
2572     ) {
2573     my $location;
2574     __CODE{xp|get-location-from-token::
2575     $token => $token,
2576     $result => $location,
2577     }__;
2578     my $continue = __DOMCore:ERROR{xp|wf-legal-character::
2579     DOMCore:location => {$location},
2580     xp|token => {$token},
2581     xp|character-number => {$num},
2582     }__;
2583     unless ($continue) {
2584 wakaba 1.27 __CODE{ParseError}__;
2585 wakaba 1.3 }
2586     }
2587 wakaba 1.1 my $ncr = $doc-><M::Document.createTextNode>
2588 wakaba 1.9 (my $char = chr $num);
2589 wakaba 1.1 push @{$vals->{nodes}}, $ncr;
2590     $vals->{value} .= $char;
2591     }
2592     }
2593    
2594     // ~ (REFC) { }
2595 wakaba 1.11 } // _HexadecimalCharacterReferenceV_
2596    
2597     /*
2598     Hexadecimal character reference in the replacement text
2599     of the entity referenced in an attribute value literal
2600     */
2601     rule _HexadecimalCharacterReferenceAE_ ($parent, $vals)
2602     {
2603     ?lexmode HexadecimalCharacterReference;
2604    
2605     ~ (Hex) {
2606     lang:Perl ($v => $token.value) : has-error {
2607     my $num = hex $v;
2608     unless (
2609     ($self->{xml_version} eq '1.0' and
2610     ((0x0020 <= $num and $num <= 0xD7FF) or
2611     (0xE000 <= $num and $num <= 0xFFFD) or
2612     (0x10000 <= $num and $num <= 0x10FFFF) or
2613     $num == 0x9 or $num == 0xA or $num == 0xD)) or
2614     ($self->{xml_version} eq '1.1' and
2615     ((0x0001 <= $num and $num <= 0xD7FF) or
2616     (0xE000 <= $num and $num <= 0xFFFD) or
2617     (0x10000 <= $num and $num <= 0x10FFFF)))
2618     ) {
2619     my $location;
2620     __CODE{xp|get-location-from-token::
2621     $token => $token,
2622     $result => $location,
2623     }__;
2624     my $continue = __DOMCore:ERROR{xp|wf-legal-character::
2625     DOMCore:location => {$location},
2626     xp|token => {$token},
2627     xp|character-number => {$num},
2628     }__;
2629     unless ($continue) {
2630 wakaba 1.27 __CODE{ParseError}__;
2631 wakaba 1.11 }
2632     }
2633     my $ncr = $self->{doc}-><M::Document.createTextNode>
2634     (my $char = chr $num);
2635     $parent-><M::Node.appendChild> ($ncr);
2636     $vals->{value} .= $char;
2637     }
2638     }
2639    
2640     // ~ (REFC) { }
2641     } // _HexadecimalCharacterReferenceAE_
2642    
2643     rule _HexadecimalCharacterReferenceEV_ ($vals) {
2644     ?lexmode HexadecimalCharacterReference;
2645    
2646     ~ (Hex) {
2647     lang:Perl ($v => $token.value) : has-error {
2648     my $num = hex $v;
2649     unless (
2650     ($self->{xml_version} eq '1.0' and
2651     ((0x0020 <= $num and $num <= 0xD7FF) or
2652     (0xE000 <= $num and $num <= 0xFFFD) or
2653     (0x10000 <= $num and $num <= 0x10FFFF) or
2654     $num == 0x9 or $num == 0xA or $num == 0xD)) or
2655     ($self->{xml_version} eq '1.1' and
2656     ((0x0001 <= $num and $num <= 0xD7FF) or
2657     (0xE000 <= $num and $num <= 0xFFFD) or
2658     (0x10000 <= $num and $num <= 0x10FFFF)))
2659     ) {
2660     my $location;
2661     __CODE{xp|get-location-from-token::
2662     $token => $token,
2663     $result => $location,
2664     }__;
2665     my $continue = __DOMCore:ERROR{xp|wf-legal-character::
2666     DOMCore:location => {$location},
2667     xp|token => {$token},
2668     xp|character-number => {$num},
2669     }__;
2670     unless ($continue) {
2671 wakaba 1.27 __CODE{ParseError}__;
2672 wakaba 1.11 }
2673     }
2674     push @{$vals}, chr $num;
2675     }
2676     }
2677    
2678     // ~ (REFC) { }
2679     } // _HexadecimalCharacterReferenceEV_
2680    
2681     /*
2682     General entity reference in element's content
2683     */
2684     rule _GeneralEntityReferenceEC ($doc, $parent, $ns)
2685     : recursive
2686     {
2687     ?lexmode 'EntityReference';
2688    
2689     ~ (Name == 'lt') {
2690     lang:Perl {
2691     $parent-><M::Node.appendChild>
2692     ($self->{doc}-><M::Document.createTextNode> ('<'));
2693     }
2694     } (Name == 'gt') {
2695     lang:Perl {
2696     $parent-><M::Node.appendChild>
2697     ($self->{doc}-><M::Document.createTextNode> ('>'));
2698     }
2699     } (Name == 'amp') {
2700     lang:Perl {
2701     $parent-><M::Node.appendChild>
2702     ($self->{doc}-><M::Document.createTextNode> ('&'));
2703     }
2704     } (Name == 'quot') {
2705     lang:Perl {
2706     $parent-><M::Node.appendChild>
2707     ($self->{doc}-><M::Document.createTextNode> ('"'));
2708     }
2709     } (Name == 'apos') {
2710     lang:Perl {
2711     $parent-><M::Node.appendChild>
2712     ($self->{doc}-><M::Document.createTextNode> ("'"));
2713     }
2714     } (Name) {
2715     my $er;
2716 wakaba 1.19 lang:Perl ($name => $token.value) : has-error {
2717 wakaba 1.26 __CODE{checkNCName:: $name => $name}__;
2718    
2719 wakaba 1.11 $er = $doc-><M::Document.createEntityReference>
2720     ($name);
2721 wakaba 1.20 $er-><AS::Node.textContent> ('');
2722     ## NOTE: When document entity (and entities referenced directly
2723     ## or indirectly from it) is parsed, no general entity
2724     ## node have its replacement tree. During general
2725     ## entity node collection construction, however,
2726     ## some entity node has replacement tree.
2727 wakaba 1.11 $parent-><M::Node.appendChild> ($er);
2728 wakaba 1.19
2729     my $ent = $self->{general_entity}->{$name};
2730     if (not $ent) { # no entity declaration
2731     if ($self->{standalone} or not $self->{has_xref}) { # WFC error
2732     my $location;
2733     __CODE{xp|get-location-from-token::
2734     $token => {$token},
2735     $result => {$location},
2736     }__;
2737     my $continue = __DOMCore:ERROR{xp|wf-entity-declared::
2738     xp|error-token => {$token},
2739     c|location => {$location},
2740     xp|name => {$name},
2741     }__;
2742     unless ($continue) {
2743 wakaba 1.27 __CODE{ParseError}__;
2744 wakaba 1.19 }
2745     } # Otherwise VC error
2746 wakaba 1.23 push @{$self->{entity}}, <Code::getEmptyEntityState::
2747     $name = $name>;
2748 wakaba 1.20 $er-><AS::x|EntityReference.isExpanded> (false);
2749 wakaba 1.19
2750     } else { # there IS entity declaration
2751     if (($self->{standalone} or not $self->{has_xref}) and
2752     $ent->{is_externally_declared} and
2753     not $self->{entity}->[-1]->{is_externally_declared}) {
2754     my $location;
2755     __CODE{xp|get-location-from-token::
2756     $token => {$token},
2757     $result => {$location},
2758     }__;
2759     my $continue = __DOMCore:ERROR{xp|wf-entity-declared::
2760     xp|error-token => {$token},
2761     c|location => {$location},
2762     xp|name => {$name},
2763     }__;
2764     unless ($continue) {
2765 wakaba 1.27 __CODE{ParseError}__;
2766 wakaba 1.19 }
2767     }
2768     $er-><AS::x|EntityReference.isExpanded>
2769     ($ent->{has_replacement_text});
2770     push @{$self->{entity}}, <Code::getCopyOfEntityState::
2771 wakaba 1.11 $entity_type = 'general_entity',
2772     $entity_name = $name>;
2773 wakaba 1.23
2774     if (defined $ent->{notation}) {
2775     my $location;
2776     __CODE{xp|get-location-from-token::
2777     $token => {$token},
2778     $result => {$location},
2779     }__;
2780     my $continue = __c|ERROR{xp|wf-parsed-entity::
2781     xp|error-token => {$token},
2782     c|location => {$location},
2783     xp|name => {$name},
2784     }__;
2785     unless ($continue) {
2786 wakaba 1.27 __CODE{ParseError}__;
2787 wakaba 1.23 }
2788     } # if unparsed entity
2789    
2790     if ($ent->{is_opened}) {
2791     my $location;
2792     __CODE{xp|get-location-from-token::
2793     $token => {$token},
2794     $result => {$location},
2795     }__;
2796     my $continue = __c|ERROR{xp|wf-no-recursion::
2797     xp|error-token => {$token},
2798     c|location => {$location},
2799     xp|name => {$name},
2800     }__;
2801     unless ($continue) {
2802 wakaba 1.27 __CODE{ParseError}__;
2803 wakaba 1.23 }
2804 wakaba 1.27 open my $empty, '<', \'';
2805     $self->{entity}->[-1]->{fh} = $empty;
2806 wakaba 1.23 $er-><AS::x|EntityReference.isExpanded> (false);
2807     } # recursive
2808     $ent->{is_opened} = true;
2809     } # entity declared
2810 wakaba 1.14 $self->{location} = $self->{entity}->[-1];
2811 wakaba 1.11 push @{$self->{entity_token}}, $self->{token};
2812     $self->{token} = [];
2813     push @{$self->{entity_char}}, $self->{char};
2814     $self->{char} = [];
2815     }
2816    
2817     ?lexmode ElementContent;
2818     &content ($doc => $doc, $parent => $er, $ns => $ns);
2819     ~ (#EOF) { }
2820     lang:Perl {
2821 wakaba 1.23 $self->{general_entity}->{$self->{entity}->[-1]->{name}}
2822     ->{is_opened} = false
2823     if $self->{general_entity}->{$self->{entity}->[-1]->{name}};
2824 wakaba 1.11 $self->{token} = pop @{$self->{entity_token}};
2825     $self->{char} = pop @{$self->{entity_char}};
2826 wakaba 1.27 pop (@{$self->{entity}})->{close_file}->();
2827 wakaba 1.14 $self->{location} = $self->{entity}->[-1];
2828 wakaba 1.11 }
2829    
2830     // TODO: Set read-only flag
2831    
2832     ?lexmode EntityReference;
2833     ?requires-next-token;
2834     }
2835    
2836     ~ (REFC) {
2837     ?lexmode ElementContent;
2838     } else {
2839     ?lexmode ElementContent;
2840     }
2841     } // _GeneralEntityReferenceEC
2842    
2843     /*
2844     General entity reference in an attribute value literal
2845     */
2846     rule _GeneralEntityReferenceV_ ($vals) {
2847     ?lexmode EntityReference;
2848    
2849     ~ (Name == 'lt') {
2850     lang:Perl {
2851     push @{$vals->{nodes}}, $self->{doc}-><M::Document.createTextNode>
2852     ('<');
2853     $vals->{value} .= '<';
2854     }
2855     } (Name == 'gt') {
2856     lang:Perl {
2857     push @{$vals->{nodes}}, $self->{doc}-><M::Document.createTextNode>
2858     ('>');
2859     $vals->{value} .= '>';
2860     }
2861     } (Name == 'amp') {
2862     lang:Perl {
2863     push @{$vals->{nodes}}, $self->{doc}-><M::Document.createTextNode>
2864     ('&');
2865     $vals->{value} .= '&';
2866     }
2867     } (Name == 'quot') {
2868     lang:Perl {
2869     push @{$vals->{nodes}}, $self->{doc}-><M::Document.createTextNode>
2870     ('"');
2871     $vals->{value} .= '"';
2872     }
2873     } (Name == 'apos') {
2874     lang:Perl {
2875     push @{$vals->{nodes}}, $self->{doc}-><M::Document.createTextNode>
2876     ("'");
2877     $vals->{value} .= "'";
2878     }
2879     } (Name) {
2880     my $er;
2881 wakaba 1.18 lang:Perl ($name => $token.value) : has-error {
2882 wakaba 1.26 __CODE{checkNCName:: $name => $name}__;
2883 wakaba 1.18
2884 wakaba 1.11 $er = $self->{doc}-><M::Document.createEntityReference> ($name);
2885 wakaba 1.20 $er-><AS::Node.textContent> ('');
2886     ## NOTE: When document entity (and entities referenced directly
2887     ## or indirectly from it) is parsed, no general entity
2888     ## node have its replacement tree. During general
2889     ## entity node collection construction, however,
2890     ## some entity node has replacement tree.
2891 wakaba 1.19 my $ent = $self->{general_entity}->{$name};
2892 wakaba 1.20 if (not $ent) { # no entity declaration
2893     if ($self->{standalone} or not $self->{has_xref}) { # WFC error
2894     my $location;
2895     __CODE{xp|get-location-from-token::
2896     $token => {$token},
2897     $result => {$location},
2898     }__;
2899     my $continue = __DOMCore:ERROR{xp|wf-entity-declared::
2900     xp|error-token => {$token},
2901     c|location => {$location},
2902     xp|name => {$name},
2903     }__;
2904     unless ($continue) {
2905 wakaba 1.27 __CODE{ParseError}__;
2906 wakaba 1.20 }
2907     } # Otherwise VC error
2908 wakaba 1.23 push @{$self->{entity}}, <Code::getEmptyEntityState::
2909     $name = $name>;
2910 wakaba 1.20 $er-><AS::x|EntityReference.isExpanded> (false);
2911    
2912     } else { # there IS entity declaration
2913     if (($self->{standalone} or not $self->{has_xref}) and
2914     $ent->{is_externally_declared} and
2915     not $self->{entity}->[-1]->{is_externally_declared}) {
2916     my $location;
2917     __CODE{xp|get-location-from-token::
2918     $token => {$token},
2919     $result => {$location},
2920     }__;
2921     my $continue = __DOMCore:ERROR{xp|wf-entity-declared::
2922     xp|error-token => {$token},
2923     c|location => {$location},
2924     xp|name => {$name},
2925     }__;
2926     unless ($continue) {
2927 wakaba 1.27 __CODE{ParseError}__;
2928 wakaba 1.20 }
2929     }
2930    
2931     if ($ent->{is_external_entity}) {
2932     my $location;
2933     __CODE{xp|get-location-from-token::
2934     $token => {$token},
2935     $result => {$location},
2936     }__;
2937     my $continue = __c|ERROR{xp|wf-no-external-entity-references::
2938     xp|error-token => {$token},
2939     c|location => {$location},
2940     xp|name => {$name},
2941     }__;
2942     unless ($continue) {
2943 wakaba 1.27 __CODE{ParseError}__;
2944 wakaba 1.20 }
2945 wakaba 1.23 ## NOTE: |xp:wf-parsed-entity| is not checked
2946 wakaba 1.20 } # if external entity
2947    
2948     $er-><AS::x|EntityReference.isExpanded>
2949 wakaba 1.19 ($ent->{has_replacement_text});
2950 wakaba 1.20 push @{$self->{entity}}, <Code::getCopyOfEntityState::
2951 wakaba 1.11 $entity_type = 'general_entity',
2952     $entity_name = $name>;
2953 wakaba 1.23
2954     if ($ent->{is_opened}) {
2955     my $location;
2956     __CODE{xp|get-location-from-token::
2957     $token => {$token},
2958     $result => {$location},
2959     }__;
2960     my $continue = __c|ERROR{xp|wf-no-recursion::
2961     xp|error-token => {$token},
2962     c|location => {$location},
2963     xp|name => {$name},
2964     }__;
2965     unless ($continue) {
2966 wakaba 1.27 __CODE{ParseError}__;
2967 wakaba 1.23 }
2968 wakaba 1.27 open my $empty, '<', \'';
2969     $self->{entity}->[-1]->{fh} = $empty;
2970 wakaba 1.23 $er-><AS::x|EntityReference.isExpanded> (false);
2971     } # recursive
2972     $ent->{is_opened} = true;
2973 wakaba 1.20 }
2974     push @{$vals->{nodes}}, $er;
2975 wakaba 1.14 $self->{location} = $self->{entity}->[-1];
2976 wakaba 1.11 push @{$self->{entity_token}}, $self->{token};
2977     $self->{token} = [];
2978     push @{$self->{entity_char}}, $self->{char};
2979     $self->{char} = [];
2980     }
2981    
2982     ?lexmode AttributeValueLiteralE;
2983     &AttributeValueLiteralE_ ($parent => $er, $vals => $vals);
2984     ~ (#EOF) { }
2985     lang:Perl {
2986 wakaba 1.23 $self->{general_entity}->{$self->{entity}->[-1]->{name}}
2987     ->{is_opened} = false
2988     if $self->{general_entity}->{$self->{entity}->[-1]->{name}};
2989 wakaba 1.11 $self->{token} = pop @{$self->{entity_token}};
2990     $self->{char} = pop @{$self->{entity_char}};
2991 wakaba 1.27 pop (@{$self->{entity}})->{close_file}->();
2992 wakaba 1.14 $self->{location} = $self->{entity}->[-1];
2993 wakaba 1.11 }
2994    
2995     // TODO: Set read-only flag
2996    
2997     ?lexmode EntityReference;
2998     ?requires-next-token;
2999     }
3000    
3001     // ~ (REFC) { }
3002     } // _GeneralEntityReferenceV_
3003 wakaba 1.1
3004 wakaba 1.6 /*
3005 wakaba 1.11 General entity reference in the replacement text
3006     of the entity referenced in an attribute value literal
3007 wakaba 1.6 */
3008 wakaba 1.11 rule _GeneralEntityReferenceAE_ ($parent, $vals)
3009 wakaba 1.6 {
3010 wakaba 1.11 ?lexmode EntityReference;
3011 wakaba 1.1
3012 wakaba 1.11 ~ (Name == 'lt') {
3013     lang:Perl {
3014     $parent-><M::Node.appendChild>
3015     ($self->{doc}-><M::Document.createTextNode> ('<'));
3016     $vals->{value} .= '<';
3017     }
3018     } (Name == 'gt') {
3019     lang:Perl {
3020     $parent-><M::Node.appendChild>
3021     ($self->{doc}-><M::Document.createTextNode> ('>'));
3022     $vals->{value} .= '>';
3023     }
3024     } (Name == 'amp') {
3025     lang:Perl {
3026     $parent-><M::Node.appendChild>
3027     ($self->{doc}-><M::Document.createTextNode> ('&'));
3028     $vals->{value} .= '&';
3029     }
3030     } (Name == 'quot') {
3031     lang:Perl {
3032     $parent-><M::Node.appendChild>
3033     ($self->{doc}-><M::Document.createTextNode> ('"'));
3034     $vals->{value} .= '"';
3035     }
3036     } (Name == 'apos') {
3037     lang:Perl {
3038     $parent-><M::Node.appendChild>
3039     ($self->{doc}-><M::Document.createTextNode> ("'"));
3040     $vals->{value} .= "'";
3041     }
3042     } (Name) {
3043 wakaba 1.6 my $er;
3044 wakaba 1.26 lang:Perl ($name => $token.value) : has-error {
3045     __CODE{checkNCName:: $name => $name}__;
3046 wakaba 1.18
3047 wakaba 1.11 $er = $self->{doc}-><M::Document.createEntityReference> ($name);
3048 wakaba 1.20 $er-><AS::Node.textContent> ('');
3049     ## NOTE: When document entity (and entities referenced directly
3050     ## or indirectly from it) is parsed, no general entity
3051     ## node have its replacement tree. During general
3052     ## entity node collection construction, however,
3053     ## some entity node has replacement tree.
3054 wakaba 1.19 my $ent = $self->{general_entity}->{$name};
3055 wakaba 1.22 if (not $ent) { # no entity declaration
3056     if ($self->{standalone} or not $self->{has_xref}) { # WFC error
3057     my $location;
3058     __CODE{xp|get-location-from-token::
3059     $token => {$token},
3060     $result => {$location},
3061     }__;
3062     my $continue = __DOMCore:ERROR{xp|wf-entity-declared::
3063     xp|error-token => {$token},
3064     c|location => {$location},
3065     xp|name => {$name},
3066     }__;
3067     unless ($continue) {
3068 wakaba 1.27 __CODE{ParseError}__;
3069 wakaba 1.22 }
3070     } # Otherwise VC error
3071 wakaba 1.23 push @{$self->{entity}}, <Code::getEmptyEntityState::
3072     $name = $name>;
3073 wakaba 1.22 $er-><AS::x|EntityReference.isExpanded> (false);
3074    
3075     } else { # there IS entity declaration
3076     if (($self->{standalone} or not $self->{has_xref}) and
3077     $ent->{is_externally_declared} and
3078     not $self->{entity}->[-1]->{is_externally_declared}) {
3079     my $location;
3080     __CODE{xp|get-location-from-token::
3081     $token => {$token},
3082     $result => {$location},
3083     }__;
3084     my $continue = __DOMCore:ERROR{xp|wf-entity-declared::
3085     xp|error-token => {$token},
3086     c|location => {$location},
3087     xp|name => {$name},
3088     }__;
3089     unless ($continue) {
3090 wakaba 1.27 __CODE{ParseError}__;
3091 wakaba 1.22 }
3092     }
3093    
3094     if ($ent->{is_external_entity}) {
3095     my $location;
3096     __CODE{xp|get-location-from-token::
3097     $token => {$token},
3098     $result => {$location},
3099     }__;
3100     my $continue = __c|ERROR{xp|wf-no-external-entity-references::
3101     xp|error-token => {$token},
3102     c|location => {$location},
3103     xp|name => {$name},
3104     }__;
3105     unless ($continue) {
3106 wakaba 1.27 __CODE{ParseError}__;
3107 wakaba 1.22 }
3108 wakaba 1.23 ## NOTE: |xp:wf-parsed-entity| is not checked
3109 wakaba 1.22 } # if external entity
3110    
3111     $er-><AS::x|EntityReference.isExpanded>
3112 wakaba 1.19 ($ent->{has_replacement_text});
3113 wakaba 1.22 push @{$self->{entity}}, <Code::getCopyOfEntityState::
3114 wakaba 1.6 $entity_type = 'general_entity',
3115     $entity_name = $name>;
3116 wakaba 1.23
3117     if ($ent->{is_opened}) {
3118     my $location;
3119     __CODE{xp|get-location-from-token::
3120     $token => {$token},
3121     $result => {$location},
3122     }__;
3123     my $continue = __c|ERROR{xp|wf-no-recursion::
3124     xp|error-token => {$token},
3125     c|location => {$location},
3126     xp|name => {$name},
3127     }__;
3128     unless ($continue) {
3129 wakaba 1.27 __CODE{ParseError}__;
3130 wakaba 1.23 }
3131 wakaba 1.27 open my $empty, '<', \'';
3132     $self->{entity}->[-1]->{fh} = $empty;
3133 wakaba 1.23 $er-><AS::x|EntityReference.isExpanded> (false);
3134     } # recursive
3135     $ent->{is_opened} = true;
3136 wakaba 1.22 }
3137     $parent-><M::Node.appendChild> ($er);
3138 wakaba 1.14 $self->{location} = $self->{entity}->[-1];
3139 wakaba 1.6 push @{$self->{entity_token}}, $self->{token};
3140     $self->{token} = [];
3141     push @{$self->{entity_char}}, $self->{char};
3142     $self->{char} = [];
3143     }
3144    
3145 wakaba 1.11 ?lexmode AttributeValueLiteralE;
3146     &AttributeValueLiteralE_ ($parent => $er, $vals => $vals);
3147 wakaba 1.6 ~ (#EOF) { }
3148     lang:Perl {
3149 wakaba 1.23 $self->{general_entity}->{$self->{entity}->[-1]->{name}}
3150     ->{is_opened} = false
3151     if $self->{general_entity}->{$self->{entity}->[-1]->{name}};
3152 wakaba 1.6 $self->{token} = pop @{$self->{entity_token}};
3153     $self->{char} = pop @{$self->{entity_char}};
3154 wakaba 1.27 pop (@{$self->{entity}})->{close_file}->();
3155 wakaba 1.14 $self->{location} = $self->{entity}->[-1];
3156 wakaba 1.6 }
3157    
3158 wakaba 1.11 // TODO: Set read-only flag
3159    
3160 wakaba 1.6 ?lexmode EntityReference;
3161     ?requires-next-token;
3162 wakaba 1.1 }
3163    
3164     // ~ (REFC) { }
3165 wakaba 1.11 } // _GeneralEntityReferenceAE_
3166 wakaba 1.6
3167     /*
3168 wakaba 1.24 General Entity Reference in Literal Entity Value in Entity Declaration
3169 wakaba 1.6 */
3170 wakaba 1.11 rule _GeneralEntityReferenceEV_ ($vals) {
3171 wakaba 1.6 ?lexmode 'EntityReference';
3172    
3173     ~ (Name) {
3174     lang:Perl ($name => $token.value) {
3175 wakaba 1.26 __CODE{checkNCName:: $name => $name}__;
3176 wakaba 1.6 push @$vals, $name;
3177     }
3178 wakaba 1.24 /*
3179     WFCs such as Entity Declared are not checked
3180     <http://www.w3.org/TR/xml11/#bypass>
3181    
3182     Note that violation to the Parsed Entity WFC is an error
3183     rather than fatal error here.
3184     */
3185 wakaba 1.6 }
3186 wakaba 1.11
3187     // No expansion
3188 wakaba 1.6
3189     // ~ (REFC) { }
3190     } // _GeneralEntityReferenceEV_
3191 wakaba 1.1
3192     /*
3193 wakaba 1.4 Document Type Declaration
3194 wakaba 1.1 */
3195 wakaba 1.4 rule _DocumentTypeDeclaration_ ($doc) {
3196     ?lexmode MarkupDeclaration;
3197    
3198     ~ (Name == 'DOCTYPE') { }
3199    
3200     ~ (S) { }
3201    
3202     // Document type name
3203 wakaba 1.6 my $name;
3204 wakaba 1.4 ~ (Name) {
3205 wakaba 1.6 lang:Perl ($v => $token.value) {
3206 wakaba 1.26 __CODE{checkQName:: $name => $v}__;
3207 wakaba 1.6 $name = $v;
3208     }
3209     }
3210 wakaba 1.17
3211     my $node;
3212     my $decl;
3213 wakaba 1.6 lang:Perl {
3214 wakaba 1.11 $self->{docx} = $self->{doc}
3215     -><M::Node.getFeature> (<Q::fe:XDoctype>, '3.0');
3216     $node = $self->{docx}-><M::DocumentXDoctype.createDocumentTypeDefinition>
3217     ($name);
3218 wakaba 1.17 $decl = $self->{dtdecl} = $node-><M::Node.getFeature>
3219     (<Q::fe:XDoctypeDeclaration>, '3.0');
3220 wakaba 1.4 }
3221    
3222 wakaba 1.25 my $has_extid;
3223 wakaba 1.4 ~? (S) {
3224     ~? (Name == 'PUBLIC') {
3225     ~ (S) { }
3226    
3227 wakaba 1.17 &PubidLiteral ($decl => $decl);
3228 wakaba 1.4
3229     ~ (S) { }
3230    
3231 wakaba 1.17 &SystemLiteral ($decl => $decl);
3232 wakaba 1.4
3233     ~? (S) { }
3234 wakaba 1.19
3235     lang:Perl {
3236     $self->{has_xref} = true;
3237 wakaba 1.25 $has_extid = true;
3238 wakaba 1.19 }
3239 wakaba 1.4 } (Name == 'SYSTEM') {
3240     ~ (S) { }
3241    
3242 wakaba 1.17 &SystemLiteral ($decl => $decl);
3243 wakaba 1.4
3244     ~? (S) { }
3245 wakaba 1.19
3246     lang:Perl {
3247     $self->{has_xref} = true;
3248 wakaba 1.25 $has_extid = true;
3249 wakaba 1.19 }
3250 wakaba 1.4 }
3251     }
3252 wakaba 1.17
3253 wakaba 1.11 lang:Perl {
3254     $self->{dtdef} = $node;
3255 wakaba 1.21 $self->{doc}-><M::Node.appendChild> ($node);
3256     $self->{doc_cfg}-><M::c|DOMConfiguration.setParameter>
3257     ('schema-type' => <Q::xml-dtd:>);
3258     ## ISSUE: Should default schema language information be
3259     ## preserved by some other flag?
3260 wakaba 1.11 }
3261    
3262 wakaba 1.4 ~? (DSO) {
3263 wakaba 1.6 &InternalSubset ($doc => $doc, $doctype => $node);
3264 wakaba 1.4
3265     ~ (DSC) {
3266     ?lexmode MarkupDeclaration;
3267     } else {
3268     ?lexmode MarkupDeclaration;
3269     }
3270    
3271     ~? (S) { }
3272     }
3273    
3274 wakaba 1.25 // TODO: Read and process external subset if any.
3275     lang:Perl {
3276     $self->{dont_process} = true if $has_extid;
3277     }
3278    
3279 wakaba 1.4 // ~ (MDC) { }
3280     } // _DocumentTypeDeclaration_
3281    
3282 wakaba 1.17 /*
3283     Public Identifier Literal
3284     */
3285     rule PubidLiteral ($decl) {
3286     my $pubid;
3287     my $pubid_token;
3288 wakaba 1.4 ~ (LIT) {
3289     ?lexmode SystemLiteral;
3290    
3291     ~? (STRING) {
3292 wakaba 1.17 lang:Perl ($v => $token.value) {
3293     $pubid = $v;
3294     $pubid_token = $token;
3295     }
3296 wakaba 1.4 }
3297    
3298     ~ (LIT) {
3299     ?lexmode MarkupDeclaration;
3300     } else {
3301     ?lexmode MarkupDeclaration;
3302     }
3303     } (LITA) {
3304     ?lexmode SystemLiteralA;
3305    
3306     ~? (STRING) {
3307 wakaba 1.17 lang:Perl ($v => $token.value) {
3308     $pubid = $v;
3309     $pubid_token = $token;
3310     }
3311 wakaba 1.4 }
3312    
3313     ~ (LITA) {
3314     ?lexmode MarkupDeclaration;
3315     } else {
3316     ?lexmode MarkupDeclaration;
3317     }
3318     }
3319 wakaba 1.17
3320     if-true ($pubid_token) {
3321     lang:Perl : has-error {
3322     if ($pubid =~ m{[^\x20\x0D\x0Aa-zA-Z0-9'()+,./:=?;!*#\@\$_%-]}s) {
3323     my $location;
3324     __CODE{xp|get-location-from-token::
3325     $token => {$pubid_token},
3326     $result => {$location},
3327     }__;
3328     ## Should this be other (new) error type?
3329     my $continue = __DOMCore:ERROR{xp|wf-syntax-error::
3330     xp|error-token => {$token},
3331     c|location => {$location},
3332     }__;
3333     unless ($continue) {
3334 wakaba 1.27 __CODE{ParseError}__;
3335 wakaba 1.17 }
3336     }
3337    
3338     ## NOTE: U+0009 is syntactically illegal.
3339 wakaba 1.23 $pubid =~ s/[\x09\x0A\x0D\x20]+/\x20/gs;
3340 wakaba 1.17 $pubid =~ s/\A\x20//s;
3341     $pubid =~ s/\x20\z//s;
3342     ## NOTE: Bare attribute name is written.
3343     $decl->public_id ($pubid);
3344     }
3345     }
3346 wakaba 1.4 } // PubidLiteral
3347    
3348 wakaba 1.17 /*
3349     System Identifier Literal
3350     */
3351     rule SystemLiteral ($decl) {
3352 wakaba 1.4 ~ (LIT) {
3353     ?lexmode SystemLiteral;
3354 wakaba 1.17 &_SystemLiteral ($decl => $decl);
3355 wakaba 1.4 } (LITA) {
3356     ?lexmode SystemLiteralA;
3357 wakaba 1.17 &_SystemLiteral ($decl => $decl);
3358 wakaba 1.4 }
3359     } // SystemLiteral
3360    
3361 wakaba 1.17 /*
3362     System Identifier Literal Content
3363 wakaba 1.29
3364     Used in document type declaration, entity declaration,
3365     and notation declaration.
3366 wakaba 1.17 */
3367     rule _SystemLiteral ($decl) {
3368     // LIT or LITA
3369    
3370 wakaba 1.4 ~? (STRING) {
3371 wakaba 1.17 lang:Perl ($v => $token.value) {
3372 wakaba 1.29 $decl-><AS::x|Entity.systemId> ($v);
3373     $decl-><AS::x|Entity.manakaiDeclarationBaseURI>
3374     ($self->{location}->{base_uri});
3375 wakaba 1.17 }
3376 wakaba 1.4 }
3377    
3378     ~ (LIT) {
3379     ?lexmode MarkupDeclaration;
3380     } (LITA) {
3381     ?lexmode MarkupDeclaration;
3382     } else {
3383     ?lexmode MarkupDeclaration;
3384     }
3385     } // _SystemLiteral
3386    
3387     /*
3388     DTD Internal Subset
3389    
3390     intSubset := *(markupdecl / DeclSep) ;; [28b]
3391     */
3392 wakaba 1.6 rule InternalSubset ($doc, $doctype) {
3393 wakaba 1.4 ?lexmode DTD;
3394    
3395     ~* (MDO) {
3396     ?lexmode MarkupDeclaration;
3397    
3398     ~ (Name == 'ELEMENT') {
3399     &_ElementDeclaration ($doc => $doc);
3400     } (Name == 'ATTLIST') {
3401 wakaba 1.8 &_AttlistDeclaration ($doc => $doc, $doctype => $doctype);
3402 wakaba 1.4 } (Name == 'ENTITY') {
3403     &_EntityDeclaration ($doc => $doc);
3404     } (Name == 'NOTATION') {
3405     &_NotationDeclaration ($doc => $doc);
3406     }
3407     } (S) {
3408     //
3409     } (CDO) {
3410     &_CommentDeclarationDTD ($doc => $doc);
3411     } (PIO) {
3412 wakaba 1.6 &_ProcessingInstructionDTD ($doc => $doc, $doctype => $doctype);
3413 wakaba 1.4 } (PERO) {
3414     ?lexmode EntityReference;
3415    
3416 wakaba 1.19 lang:Perl {
3417     $self->{has_xref} = true;
3418 wakaba 1.25 $self->{dont_process} = true;
3419 wakaba 1.19 }
3420    
3421 wakaba 1.4 ~ (Name) {
3422 wakaba 1.26 // TODO: __CODE{checkNCName:: $name => $name}__;
3423 wakaba 1.4
3424     }
3425    
3426     ~ (REFC) {
3427     ?lexmode DTD;
3428     } else {
3429     ?lexmode DTD;
3430     }
3431     }
3432     } // InternalSubset
3433    
3434     rule _ElementDeclaration ($doc) {
3435     // ~ (MDO) { }
3436     // ?lexmode MarkupDeclaration
3437     // ~ (Name == 'Element') { }
3438    
3439     ~ (S) { }
3440    
3441     ~ (Name) {
3442 wakaba 1.26 // TODO: __CODE{checkQName:: $name => $name}__;
3443 wakaba 1.4
3444     }
3445    
3446     ?lexmode ElementDeclaration;
3447    
3448     ~ (S) { }
3449    
3450     // contentspec
3451     ~ (MGO) {
3452     &_ContentModel ($doc => $doc);
3453     } (Name == 'EMPTY') {
3454    
3455     } (Name == 'ANY') {
3456    
3457     }
3458    
3459     ~? (S) { }
3460    
3461     ~ (MDC) {
3462     ?lexmode DTD;
3463     } else {
3464     ?lexmode DTD;
3465     }
3466     } // _ElementDeclaration
3467    
3468     rule _ContentModel ($doc) {
3469     // ~ (MGO) { }
3470    
3471     ~? (S) { }
3472    
3473     ~ (Name) {
3474     // Element content model
3475     &_ModelGroup ($doc => $doc)
3476     : unshift-current-token;
3477    
3478     ~? (OPT) {
3479    
3480     } (REP) {
3481    
3482     } (PLUS) {
3483    
3484     }
3485    
3486     } (MDO) {
3487     &_ModelGroup ($doc => $doc)
3488     : unshift-current-token;
3489    
3490     ~? (OPT) {
3491    
3492     } (REP) {
3493    
3494     } (PLUS) {
3495    
3496     }
3497    
3498     } (PCDATA) {
3499     // Mixed content declaration
3500     ~? (S) { }
3501    
3502     ~* (OR) {
3503     ~? (S) { }
3504    
3505     ~ (Name) {
3506 wakaba 1.26 // TODO: Name & QName check
3507 wakaba 1.4
3508     }
3509    
3510     ~? (S) { }
3511     }
3512    
3513     ~ (MGC) { }
3514    
3515     ~? (REP) {
3516    
3517     } else {
3518     // TODO: error if |Name|
3519     }
3520    
3521    
3522     }
3523     } // _ContentModel
3524    
3525     rule _ModelGroup ($doc)
3526     : standalone
3527     : recursive
3528     {
3529     // ~ (MGO) { }
3530     // ~? (S) { }
3531    
3532     &ContentParticle ($doc => $doc);
3533    
3534     ~? (S) { }
3535    
3536     ~? (OR) {
3537     ~? (S) { }
3538    
3539     &ContentParticle ($doc => $doc);
3540    
3541     ~? (S) { }
3542    
3543     ~* (OR) {
3544     ~? (S) { }
3545    
3546     &ContentParticle ($doc => $doc);
3547    
3548     ~? (S) { }
3549     }
3550    
3551     } (SEQ) {
3552     ~? (S) { }
3553    
3554     &ContentParticle ($doc => $doc);
3555    
3556     ~? (S) { }
3557    
3558     ~* (SEQ) {
3559     ~? (S) { }
3560    
3561     &ContentParticle ($doc => $doc);
3562    
3563     ~? (S) { }
3564     }
3565    
3566     }
3567    
3568     ~ (MGC) { }
3569     } // _ModelGroup
3570    
3571     rule ContentParticle ($doc) {
3572     ~ (Name) {
3573 wakaba 1.26 // TODO: Name & QName check
3574 wakaba 1.4
3575     } (MGO) {
3576     ~? (S) { }
3577    
3578     &_ModelGroup ($doc => $doc);
3579     }
3580    
3581     ~? (OPT) {
3582    
3583     } (REP) {
3584    
3585     } (PLUS) {
3586    
3587     }
3588     } // ContentParticle
3589    
3590 wakaba 1.8 /*
3591     Attribute list declaration
3592     */
3593     rule _AttlistDeclaration ($doc, $doctype) {
3594 wakaba 1.4 // ~ (MDO) { }
3595     // ~ (Name == 'ATTLIST') { }
3596    
3597     ?lexmode AttlistDeclaration;
3598    
3599     ~ (S) { }
3600    
3601 wakaba 1.8 my $name;
3602 wakaba 1.4 ~ (Name) {
3603 wakaba 1.8 lang:Perl ($v => $token.value) {
3604 wakaba 1.26 __CODE{checkQName:: $name => $v}__;
3605 wakaba 1.8 $name = $v;
3606     }
3607     } else {
3608     lang:Perl { $name = '#ILLEGAL' }
3609     }
3610 wakaba 1.4
3611 wakaba 1.8 my $docxd;
3612     my $et;
3613     lang:Perl {
3614     $et = $doctype-><M::DTDef.getElementTypeDefinitionNode> ($name);
3615     unless ($et) {
3616 wakaba 1.11 $docxd = $doc-><M::Node.getFeature> (<Q::fe:XDoctype>, '3.0');
3617 wakaba 1.8 $et = $docxd-><M::DocumentXDoctype.createElementTypeDefinition>
3618     ($name);
3619     $doctype-><M::DTDef.setElementTypeDefinitionNode> ($et)
3620     unless $name eq '#ILLEGAL';
3621     }
3622 wakaba 1.4 }
3623    
3624     ~? (S) { }
3625    
3626     ~* (Name) {
3627 wakaba 1.8 my $at;
3628 wakaba 1.25 lang:Perl ($v => $token.value) : has-error {
3629 wakaba 1.26 __CODE{checkQName:: $name => $v}__;
3630 wakaba 1.8 $docxd ||= $doc-><M::Node.getFeature>
3631 wakaba 1.11 (<Q::fe:XDoctype>, '3.0');
3632 wakaba 1.8 $at = $docxd-><M::DocumentXDoctype.createAttributeDefinition> ($v);
3633 wakaba 1.25 if (exists $et-><AG::ETDef.attributeDefinitions>->{$v}) {
3634     my $location;
3635     __CODE{xp|get-location-from-token::
3636     $token => {$token},
3637     $result => {$location},
3638     }__;
3639     my $continue = __c|ERROR{xp|warning-attribute-definition-ignored::
3640     xp|error-token => {$token},
3641     c|location => {$location},
3642     xp|name => {$v},
3643     }__;
3644     unless ($continue) {
3645 wakaba 1.27 __CODE{ParseError}__;
3646 wakaba 1.25 }
3647     } elsif ($self->{dont_process} and not $self->{standalone}) {
3648     my $location;
3649     __CODE{xp|get-location-from-token::
3650     $token => {$token},
3651     $result => {$location},
3652     }__;
3653     my $continue = __c|ERROR{
3654     xp|warning-attribute-definition-not-processed::
3655     xp|error-token => {$token},
3656     c|location => {$location},
3657     xp|name => {$v},
3658     }__;
3659     unless ($continue) {
3660 wakaba 1.27 __CODE{ParseError}__;
3661 wakaba 1.25 }
3662     } else {
3663 wakaba 1.9 $et-><M::ETDef.setAttributeDefinitionNode> ($at);
3664     $self->{attr}->{$name}->{$v} = $at;
3665     }
3666 wakaba 1.8 }
3667 wakaba 1.4
3668     ~ (S) { }
3669    
3670     // AttType
3671     ~ (Name == 'NOTATION') {
3672     ~ (S) { }
3673    
3674 wakaba 1.8 my $kwd;
3675     lang:Perl {
3676     $at-><AS::ATDef.declaredType> (<C::ATDef.NOTATION_ATTR>);
3677     $kwd = $at-><AG::ATDef.allowedTokens>;
3678     }
3679    
3680 wakaba 1.4 ~ (EGO) {
3681     ~? (S) { }
3682    
3683 wakaba 1.8 ~+ (Name) {
3684 wakaba 1.26 lang:Perl ($v => $token.value) : has-error {
3685     __CODE{checkNCName:: $name => $v}__;
3686 wakaba 1.8 push @$kwd, $v;
3687     }
3688 wakaba 1.4
3689     ~? (S) { }
3690     } (OR) : separator {
3691     ~? (S) { }
3692     }
3693    
3694     ~ (EGC) { }
3695     }
3696 wakaba 1.8
3697 wakaba 1.4 } (Name) {
3698 wakaba 1.8 my $type;
3699     lang:Perl ($v => $token.value) : has-error {
3700     my $map = {
3701     CDATA => <C::ATDef.CDATA_ATTR>,
3702     ID => <C::ATDef.ID_ATTR>,
3703     IDREF => <C::ATDef.IDREF_ATTR>,
3704     IDREFS => <C::ATDef.IDREFS_ATTR>,
3705     ENTITY => <C::ATDef.ENTITY_ATTR>,
3706     ENTITIES => <C::ATDef.ENTITIES_ATTR>,
3707     NMTOKEN => <C::ATDef.NMTOKEN_ATTR>,
3708     NMTOKENS => <C::ATDef.NMTOKENS_ATTR>,
3709     };
3710     if ($map->{$v}) {
3711     $at-><AS::ATDef.declaredType> ($map->{$v});
3712     } else {
3713     ## TODO: Exception
3714     }
3715     }
3716 wakaba 1.4
3717     } (EGO) {
3718     ?lexmode Enumeration;
3719    
3720     ~? (S) { }
3721    
3722 wakaba 1.8 my $kwd;
3723     lang:Perl {
3724     $at-><AS::ATDef.declaredType> (<C::ATDef.ENUMERATION_ATTR>);
3725     $kwd = $at-><AG::ATDef.allowedTokens>;
3726     }
3727    
3728     ~+ (Nmtoken) {
3729     lang:Perl ($v => $token.value) {
3730     push @$kwd, $v;
3731     }
3732 wakaba 1.4
3733     ~? (S) { }
3734     } (OR) : separator {
3735     ~? (S) { }
3736     }
3737    
3738     ~ (EGC) {
3739     ?lexmode AttlistDeclaration;
3740     } else {
3741     ?lexmode AttlistDeclaration;
3742     }
3743    
3744     }
3745    
3746     ~ (S) { }
3747    
3748     // DefaultDecl
3749     ~ (RNI) {
3750     ~ (Name == 'REQUIRED') {
3751 wakaba 1.8 lang:Perl {
3752     $at-><AS::ATDef.defaultType> (<C::ATDef.REQUIRED_DEFAULT>);
3753     }
3754 wakaba 1.4 } (Name == 'IMPLIED') {
3755 wakaba 1.8 lang:Perl {
3756     $at-><AS::ATDef.defaultType> (<C::ATDef.IMPLIED_DEFAULT>);
3757     }
3758 wakaba 1.4 } (Name == 'FIXED') {
3759     ~ (S) { }
3760 wakaba 1.8
3761     lang:Perl {
3762     $at-><AS::ATDef.defaultType> (<C::ATDef.FIXED_DEFAULT>);
3763     }
3764 wakaba 1.4
3765     ~ (LIT) {
3766     my $vals;
3767     lang:Perl {
3768 wakaba 1.8 $vals = {nodes => [], value => ''};
3769 wakaba 1.4 }
3770    
3771     &_AttributeValueSpecification_ ($doc => $doc, $vals => $vals);
3772    
3773 wakaba 1.8 lang:Perl {
3774     for (@{$vals->{nodes}}) {
3775     $at-><M::Node.appendChild> ($_);
3776     }
3777     }
3778    
3779 wakaba 1.4 ~ (LIT) {
3780     ?lexmode AttlistDeclaration;
3781     } else {
3782     ?lexmode AttlistDeclaration;
3783     }
3784     } (LITA) {
3785     my $vals;
3786     lang:Perl {
3787 wakaba 1.8 $vals = {nodes => [], value => ''};
3788 wakaba 1.4 }
3789    
3790     &_AttributeValueSpecificationA_ ($doc => $doc, $vals => $vals);
3791    
3792 wakaba 1.8 lang:Perl {
3793     for (@{$vals->{nodes}}) {
3794     $at-><M::Node.appendChild> ($_);
3795     }
3796     }
3797    
3798     ~ (LITA) {
3799 wakaba 1.4 ?lexmode AttlistDeclaration;
3800     } else {
3801     ?lexmode AttlistDeclaration;
3802     }
3803     }
3804     }
3805    
3806     } (LIT) {
3807     my $vals;
3808     lang:Perl {
3809 wakaba 1.8 $at-><AS::ATDef.defaultType> (<C::ATDef.EXPLICIT_DEFAULT>);
3810     $vals = {nodes => [], value => ''};
3811 wakaba 1.4 }
3812    
3813     &_AttributeValueSpecification_ ($doc => $doc, $vals => $vals);
3814    
3815 wakaba 1.8 lang:Perl {
3816     for (@{$vals->{nodes}}) {
3817     $at-><M::Node.appendChild> ($_);
3818     }
3819     }
3820    
3821 wakaba 1.4 ~ (LIT) {
3822     ?lexmode AttlistDeclaration;
3823     } else {
3824     ?lexmode AttlistDeclaration;
3825     }
3826     } (LITA) {
3827     my $vals;
3828     lang:Perl {
3829 wakaba 1.8 $at-><AS::ATDef.defaultType> (<C::ATDef.EXPLICIT_DEFAULT>);
3830     $vals = {nodes => [], value => ''};
3831 wakaba 1.4 }
3832    
3833     &_AttributeValueSpecificationA_ ($doc => $doc, $vals => $vals);
3834    
3835 wakaba 1.8 lang:Perl {
3836     for (@{$vals->{nodes}}) {
3837     $at-><M::Node.appendChild> ($_);
3838     }
3839     }
3840    
3841 wakaba 1.4 ~ (LITA) {
3842     ?lexmode AttlistDeclaration;
3843     } else {
3844     ?lexmode AttlistDeclaration;
3845     }
3846     }
3847    
3848     } (S) : separator : terminator? {
3849     //
3850     }
3851    
3852     ~ (MDC) {
3853     ?lexmode DTD;
3854     } else {
3855     ?lexmode DTD;
3856     }
3857     } // _AttlistDeclaration
3858    
3859 wakaba 1.11 /*
3860 wakaba 1.26 Entity Declaration
3861 wakaba 1.11 */
3862 wakaba 1.4 rule _EntityDeclaration ($doc) {
3863     // ~ (MDO) { }
3864     // ~ (Name == ENTITY) { }
3865    
3866     ~ (S) { }
3867    
3868 wakaba 1.23 my $is_param_entity;
3869 wakaba 1.6 my $decl;
3870 wakaba 1.27 lang:Perl {
3871     $decl = {
3872     name => '#ILLEGAL',
3873     reptxt => \'',
3874     is_external_entity => false,
3875     document_uri => $self->{location}->{document_uri},
3876     base_uri => $self->{location}->{base_uri},
3877     };
3878     }
3879 wakaba 1.6
3880 wakaba 1.4 ~? (PERO) {
3881     ~ (S) { }
3882 wakaba 1.6 lang:Perl {
3883 wakaba 1.23 $is_param_entity = $decl->{is_param_entity} = true;
3884 wakaba 1.6 }
3885 wakaba 1.4 }
3886    
3887 wakaba 1.19 /*
3888     TODO: Set |$decl->{is_externally_declared}| flag
3889     and |Entity.isExternallyDeclared| attribute
3890     for entity declarations in external subset or
3891     in parameter entity.
3892     */
3893    
3894 wakaba 1.4 ~ (Name) {
3895 wakaba 1.6 lang:Perl ($v => $token.value) {
3896 wakaba 1.26 __CODE{checkNCName:: $name => $v}__;
3897 wakaba 1.6 $decl->{name} = $v;
3898     }
3899 wakaba 1.4 }
3900    
3901 wakaba 1.18 my $node;
3902 wakaba 1.11 lang:Perl {
3903 wakaba 1.18 $node =
3904 wakaba 1.11 $decl->{node} = $self->{docx}-><M::DocumentXDoctype.createGeneralEntity>
3905     ($decl->{name});
3906     ## TODO: Parameter entity...
3907     }
3908    
3909 wakaba 1.4 ~ (S) { }
3910    
3911     ~ (LIT) {
3912 wakaba 1.6 &_EntityValue ($doc => $doc, $decl => $decl);
3913 wakaba 1.4 } (LITA) {
3914 wakaba 1.6 &_EntityValueA ($doc => $doc, $decl => $decl);
3915 wakaba 1.4 } (Name == 'PUBLIC') {
3916     ~ (S) { }
3917    
3918 wakaba 1.18 &PubidLiteral ($decl => $node);
3919 wakaba 1.4
3920     ~ (S) { }
3921    
3922 wakaba 1.18 &SystemLiteral ($decl => $node);
3923    
3924     lang:Perl {
3925     $decl->{is_external_entity} = true;
3926     }
3927 wakaba 1.4 } (Name == 'SYSTEM') {
3928     ~ (S) { }
3929    
3930 wakaba 1.18 &SystemLiteral ($decl => $node);
3931    
3932     lang:Perl {
3933     $decl->{is_external_entity} = true;
3934     }
3935 wakaba 1.4 }
3936    
3937     ~? (S) {
3938     ~? (Name == 'NDATA') {
3939 wakaba 1.23 if-true ($is_param_entity) {
3940     lang:Perl : has-error {
3941     my $location;
3942     __CODE{xp|get-location-from-token::
3943     $token => {$token},
3944     $result => {$location},
3945     }__;
3946     my $continue = __DOMCore:ERROR{xp|wf-syntax-error::
3947     xp|error-token => {$token},
3948     c|location => {$location},
3949     }__;
3950     unless ($continue) {
3951 wakaba 1.27 __CODE{ParseError}__;
3952 wakaba 1.23 }
3953     }
3954     }
3955 wakaba 1.4
3956     ~ (S) { }
3957    
3958     ~ (Name) {
3959 wakaba 1.26 lang:Perl ($v => $token.value) : has-error {
3960     __CODE{checkNCName:: $name => $v}__;
3961 wakaba 1.6 $decl->{notation} = $v;
3962 wakaba 1.11 $decl->{node}-><AG::x|Entity.notationName> ($v);
3963 wakaba 1.6 }
3964 wakaba 1.4 }
3965    
3966     ~? (S) { }
3967     }
3968     }
3969    
3970 wakaba 1.24 lang:Perl : has-error {
3971 wakaba 1.6 if ($self->{$decl->{is_param_entity} ? 'param_entity' : 'general_entity'}
3972     ->{$decl->{name}}) {
3973 wakaba 1.24 ## Predefined entity
3974     if (not $decl->{is_param_entity} and
3975     {lt => true, gt => true, amp => true,
3976     quot => true, apos => true}->{$decl->{name}}) {
3977     if ($decl->{is_external_entity}) {
3978     my $location;
3979     __CODE{xp|get-location-from-token::
3980     $token => {$token},
3981     $result => {$location},
3982     }__;
3983     my $continue = __c|ERROR{xp|error-internal-predefined-entity::
3984     xp|error-token => {$token},
3985     c|location => {$location},
3986     xp|name => {$decl->{name}},
3987     }__;
3988     unless ($continue) {
3989 wakaba 1.27 __CODE{ParseError}__;
3990 wakaba 1.24 }
3991     } elsif (
3992     not ({gt => true, apos => true, quot => true}->{$decl->{name}} and
3993     ${$decl->{reptxt}} eq {
3994     gt => '>', apos => "'", quot => '"',
3995     }->{$decl->{name}}) and
3996     not (${$decl->{reptxt}} =~ /\A&#0*@{[{
3997     lt => '60', gt => '62', amp => '38',
3998     apos => '39', quot => '34',
3999     }->{$decl->{name}}]};\z/) and
4000     not (${$decl->{reptxt}} =~ /\A&#x0*(?:(?i)@{[{
4001     lt => '3C', gt => '3E', amp => '26',
4002     apos => '27', quot => '22',
4003     }->{$decl->{name}}]});\z/)
4004     ) {
4005     ## NOTE: See "SuikaWiki - Predefined Entities"
4006     ## "http://suika.fam.cx/gate/2005/sw/%E5%AE%9A%E7%BE%A9%E6%B8%88%E5%AE%9F%E4%BD%93".
4007     my $location;
4008     __CODE{xp|get-location-from-token::
4009     $token => {$token},
4010     $result => {$location},
4011     }__;
4012     my $continue = __c|ERROR{xp|error-malformed-predefined-entity::
4013     xp|error-token => {$token},
4014     c|location => {$location},
4015     xp|name => {$decl->{name}},
4016     xp|replacement-text => {${$decl->{reptxt}}},
4017     }__;
4018     unless ($continue) {
4019 wakaba 1.27 __CODE{ParseError}__;
4020 wakaba 1.24 }
4021     }
4022 wakaba 1.25 $self->{dtdecl}->{<H::mn:node>}->{{
4023     lt => <H::d|hasLtDeclaration>,
4024     gt => <H::d|hasGtDeclaration>,
4025     amp => <H::d|hasAmpDeclaration>,
4026     apos => <H::d|hasAposDeclaration>,
4027     quot => <H::d|hasQuotDeclaration>,
4028     }->{$decl->{name}}} = true;
4029 wakaba 1.24 } else { ## Dupulicating declaration
4030     my $location;
4031     __CODE{xp|get-location-from-token::
4032     $token => {$token},
4033     $result => {$location},
4034     }__;
4035     my $continue = __c|ERROR{xp|warning-entity-declaration-ignored::
4036     xp|error-token => {$token},
4037     c|location => {$location},
4038     xp|name => {$decl->{name}},
4039     }__;
4040     unless ($continue) {
4041 wakaba 1.27 __CODE{ParseError}__;
4042 wakaba 1.24 }
4043     }
4044 wakaba 1.25 } elsif ($self->{dont_process} and not $self->{standalone}) {
4045     ## TODO: |standalone| and parameter entities??
4046     my $location;
4047     __CODE{xp|get-location-from-token::
4048     $token => {$token},
4049     $result => {$location},
4050     }__;
4051     my $continue = __c|ERROR{xp|warning-entity-declaration-not-processed::
4052     xp|error-token => {$token},
4053     c|location => {$location},
4054     xp|name => {$decl->{name}},
4055     }__;
4056     unless ($continue) {
4057 wakaba 1.27 __CODE{ParseError}__;
4058 wakaba 1.25 }
4059 wakaba 1.6 } else {
4060     $self->{$decl->{is_param_entity} ? 'param_entity' : 'general_entity'}
4061     ->{$decl->{name}} = $decl;
4062 wakaba 1.11 $self->{dtdef}-><M::DTDef.setGeneralEntityNode> ($decl->{node})
4063     unless $decl->{is_param_entity};
4064 wakaba 1.6 }
4065     }
4066    
4067 wakaba 1.4 ~ (MDC) {
4068     ?lexmode DTD;
4069     } else {
4070     ?lexmode DTD;
4071     }
4072     } // _EntityDeclaration
4073    
4074 wakaba 1.26 /*
4075     Notation Declaration
4076     */
4077     rule _NotationDeclaration {
4078 wakaba 1.4 // ~ (MDO) { }
4079     // ~ (Name == NOTATION) { }
4080    
4081     ~ (S) { }
4082    
4083 wakaba 1.26 my $name;
4084 wakaba 1.4 ~ (Name) {
4085 wakaba 1.26 lang:Perl ($v => $token.value) : has-error {
4086     __CODE{checkNCName:: $name => $v}__;
4087     $name = $v;
4088     }
4089     } else {
4090     lang:Perl {
4091     $name = '#INVALID';
4092     }
4093     }
4094 wakaba 1.4
4095     ~ (S) { }
4096    
4097 wakaba 1.17 lang:Perl {
4098 wakaba 1.26 $decl = $self->{docx}-><M::DocumentXDoctype.createNotation> ($name);
4099 wakaba 1.17 }
4100    
4101 wakaba 1.4 ~ (Name == 'PUBLIC') {
4102     ~ (S) { }
4103    
4104 wakaba 1.17 &PubidLiteral ($decl => $decl);
4105 wakaba 1.4
4106     ~? (S) {
4107     ~? (LIT) {
4108     ?lexmode SystemLiteral;
4109 wakaba 1.17 &_SystemLiteral ($decl => $decl);
4110 wakaba 1.4
4111     ~? (S) { }
4112     } (LITA) {
4113     ?lexmode SystemLiteralA;
4114 wakaba 1.17 &_SystemLiteral ($decl => $decl);
4115 wakaba 1.4
4116     ~? (S) { }
4117     }
4118     }
4119     } (Name == 'SYSTEM') {
4120     ~ (S) { }
4121    
4122 wakaba 1.17 &SystemLiteral ($decl => $decl);
4123 wakaba 1.4
4124     ~? (S) { }
4125     }
4126    
4127 wakaba 1.26 lang:Perl : has-error {
4128     if ($self->{dtdef}-><M::DTDef.getNotationNode> ($name)) {
4129     ## Dupulication
4130     my $location;
4131     __CODE{xp|get-location-from-token::
4132     $token => {$token},
4133     $result => {$location},
4134     }__;
4135     my $continue = __c|ERROR{xp|vc-unique-notation-name::
4136     xp|error-token => {$token},
4137     c|location => {$location},
4138     xp|name => {$name},
4139     }__;
4140     unless ($continue) {
4141 wakaba 1.27 __CODE{ParseError}__;
4142 wakaba 1.26 }
4143     } else {
4144     $self->{dtdef}-><M::DTDef.setNotationNode> ($decl);
4145     }
4146     }
4147    
4148 wakaba 1.4 ~ (MDC) {
4149     ?lexmode DTD;
4150     } else {
4151     ?lexmode DTD;
4152     }
4153     } // _NotationDeclaration
4154    
4155 wakaba 1.11 rule _EntityValue ($decl) {
4156 wakaba 1.4 ?lexmode EntityValue;
4157    
4158     my $vals;
4159 wakaba 1.6 my $reptxt;
4160 wakaba 1.4 lang:Perl {
4161     $vals = [];
4162 wakaba 1.6 $reptxt = '';
4163 wakaba 1.4 }
4164    
4165     ~* (STRING) {
4166 wakaba 1.6 lang:Perl ($v => $token.value) {
4167     $reptxt .= $v;
4168     }
4169 wakaba 1.4 } (PERO) {
4170 wakaba 1.25 ?lexmode EntityReference;
4171 wakaba 1.19
4172     lang:Perl {
4173     $self->{has_xref} = true;
4174 wakaba 1.25 $self->{dont_process} = true;
4175 wakaba 1.19 }
4176 wakaba 1.6
4177     // TODO: Expand or wferror if internal subset
4178 wakaba 1.4
4179     ~ (Name) {
4180    
4181 wakaba 1.25 // Note that external subset and parameter entities are not supported
4182     lang:Perl ($name => $token.value) : has-error {
4183 wakaba 1.26 __CODE{checkNCName:: $name => $name}__;
4184 wakaba 1.25 my $location;
4185     __CODE{xp|get-location-from-token::
4186     $token => {$token},
4187     $result => {$location},
4188     }__;
4189     my $continue = __c|ERROR{xp|wf-pes-in-internal-subset::
4190     xp|error-token => {$token},
4191     c|location => {$location},
4192     xp|name => {$name},
4193     }__;
4194     unless ($continue) {
4195 wakaba 1.27 __CODE{ParseError}__;
4196 wakaba 1.25 }
4197     }
4198 wakaba 1.4 }
4199    
4200     ~ (REFC) {
4201     ?lexmode EntityValue;
4202     } else {
4203     ?lexmode EntityValue;
4204     }
4205     } (HCRO) {
4206 wakaba 1.11 &_HexadecimalCharacterReferenceEV_ ($vals => $vals);
4207 wakaba 1.4
4208 wakaba 1.6 lang:Perl {
4209 wakaba 1.11 $reptxt .= $vals->[-1];
4210 wakaba 1.6 }
4211    
4212 wakaba 1.4 ~ (REFC) {
4213     ?lexmode EntityValue;
4214     } else {
4215     ?lexmode EntityValue;
4216     }
4217     } (CRO) {
4218 wakaba 1.11 &_NumericCharacterReferenceEV_ ($vals => $vals);
4219 wakaba 1.6
4220     lang:Perl {
4221 wakaba 1.11 $reptxt .= $vals->[-1];
4222 wakaba 1.6 }
4223 wakaba 1.4
4224     ~ (REFC) {
4225     ?lexmode EntityValue;
4226     } else {
4227     ?lexmode EntityValue;
4228     }
4229     } (ERO) {
4230 wakaba 1.11 &_GeneralEntityReferenceEV_ ($vals => $vals);
4231 wakaba 1.4
4232 wakaba 1.6 lang:Perl {
4233 wakaba 1.11 $reptxt .= '&' . $vals->[-1] . ';';
4234 wakaba 1.6 }
4235    
4236 wakaba 1.4 ~ (REFC) {
4237     ?lexmode EntityValue;
4238     } else {
4239     ?lexmode EntityValue;
4240     }
4241     }
4242    
4243     ~ (LIT) {
4244     ?lexmode MarkupDeclaration;
4245     } (LITA) {
4246     ?lexmode MarkupDeclaration;
4247     } else {
4248     ?lexmode MarkupDeclaration;
4249     }
4250 wakaba 1.6
4251     lang:Perl {
4252     $decl->{reptxt} = \$reptxt;
4253 wakaba 1.19 $decl->{has_replacement_text} = true;
4254 wakaba 1.6 }
4255 wakaba 1.4 } // _EntityValue
4256    
4257 wakaba 1.11 rule _EntityValueA ($decl) {
4258 wakaba 1.4 ?lexmode EntityValueA;
4259    
4260     my $vals;
4261 wakaba 1.6 my $reptxt;
4262 wakaba 1.4 lang:Perl {
4263     $vals = [];
4264 wakaba 1.6 $reptxt = '';
4265 wakaba 1.4 }
4266    
4267     ~* (STRING) {
4268 wakaba 1.6 lang:Perl ($v => $token.value) {
4269     $reptxt .= $v;
4270     }
4271 wakaba 1.4 } (PERO) {
4272 wakaba 1.25 ?lexmode EntityReference;
4273 wakaba 1.4
4274 wakaba 1.19 lang:Perl {
4275     $self->{has_xref} = true;
4276 wakaba 1.25 $self->{dont_process} = true;
4277 wakaba 1.19 }
4278    
4279 wakaba 1.6 // TODO: implement this
4280 wakaba 1.4 ~ (Name) {
4281    
4282 wakaba 1.25 // Note that external subset and parameter entities are not supported
4283     lang:Perl ($name => $token.value) : has-error {
4284 wakaba 1.26 __CODE{checkNCName:: $name => $name}__;
4285 wakaba 1.25 my $location;
4286     __CODE{xp|get-location-from-token::
4287     $token => {$token},
4288     $result => {$location},
4289     }__;
4290     my $continue = __c|ERROR{xp|wf-pes-in-internal-subset::
4291     xp|error-token => {$token},
4292     c|location => {$location},
4293     xp|name => {$name},
4294     }__;
4295     unless ($continue) {
4296 wakaba 1.27 __CODE{ParseError}__;
4297 wakaba 1.25 }
4298     }
4299 wakaba 1.4 }
4300    
4301     ~ (REFC) {
4302     ?lexmode EntityValueA;
4303     } else {
4304     ?lexmode EntityValueA;
4305     }
4306     } (HCRO) {
4307 wakaba 1.11 &_HexadecimalCharacterReferenceEV_ ($vals => $vals);
4308 wakaba 1.4
4309 wakaba 1.6 lang:Perl {
4310 wakaba 1.11 $reptxt .= $vals->[-1];
4311 wakaba 1.6 }
4312    
4313    
4314 wakaba 1.4 ~ (REFC) {
4315     ?lexmode EntityValueA;
4316     } else {
4317     ?lexmode EntityValueA;
4318     }
4319     } (CRO) {
4320 wakaba 1.11 &_NumericCharacterReferenceEV_ ($vals => $vals);
4321 wakaba 1.4
4322 wakaba 1.6 lang:Perl {
4323 wakaba 1.11 $reptxt .= $vals->[-1];
4324 wakaba 1.6 }
4325    
4326 wakaba 1.4 ~ (REFC) {
4327     ?lexmode EntityValueA;
4328     } else {
4329     ?lexmode EntityValueA;
4330     }
4331     } (ERO) {
4332 wakaba 1.11 &_GeneralEntityReferenceEV_ ($vals => $vals);
4333 wakaba 1.4
4334 wakaba 1.6 lang:Perl {
4335 wakaba 1.11 $reptxt .= '&' . $vals->[-1] . ';';
4336 wakaba 1.6 }
4337    
4338 wakaba 1.4 ~ (REFC) {
4339     ?lexmode EntityValueA;
4340     } else {
4341     ?lexmode EntityValueA;
4342     }
4343     }
4344    
4345     ~ (LITA) {
4346     ?lexmode MarkupDeclaration;
4347     } else {
4348     ?lexmode MarkupDeclaration;
4349     }
4350 wakaba 1.6
4351     lang:Perl {
4352     $decl->{reptxt} = \$reptxt;
4353 wakaba 1.19 $decl->{has_replacement_text} = true;
4354 wakaba 1.6 }
4355 wakaba 1.4 } // _EntityValueA
4356    
4357    
4358     /*
4359     XML Name
4360     */
4361     lexmode NameChar {
4362     $NameStartChar10 := [
4363     '_' ':'
4364     // Letter
4365     // BaseChar
4366     U+0041..U+005A U+0061..U+007A U+00C0..U+00D6
4367     U+00D8..U+00F6 U+00F8..U+00FF U+0100..U+0131
4368     U+0134..U+013E U+0141..U+0148 U+014A..U+017E
4369     U+0180..U+01C3 U+01CD..U+01F0 U+01F4..U+01F5
4370     U+01FA..U+0217 U+0250..U+02A8 U+02BB..U+02C1
4371     U+0386 U+0388..U+038A U+038C U+038E..U+03A1
4372     U+03A3..U+03CE U+03D0..U+03D6 U+03DA U+03DC
4373     U+03DE U+03E0 U+03E2..U+03F3 U+0401..U+040C
4374     U+040E..U+044F U+0451..U+045C U+045E..U+0481
4375     U+0490..U+04C4 U+04C7..U+04C8 U+04CB..U+04CC
4376     U+04D0..U+04EB U+04EE..U+04F5 U+04F8..U+04F9
4377     U+0531..U+0556 U+0559 U+0561..U+0586
4378     U+05D0..U+05EA U+05F0..U+05F2 U+0621..U+063A
4379     U+0641..U+064A U+0671..U+06B7 U+06BA..U+06BE
4380     U+06C0..U+06CE U+06D0..U+06D3 U+06D5
4381     U+06E5..U+06E6 U+0905..U+0939 U+093D
4382     U+0958..U+0961 U+0985..U+098C U+098F..U+0990
4383     U+0993..U+09A8 U+09AA..U+09B0 U+09B2
4384     U+09B6..U+09B9 U+09DC..U+09DD U+09DF..U+09E1
4385     U+09F0..U+09F1 U+0A05..U+0A0A U+0A0F..U+0A10
4386     U+0A13..U+0A28 U+0A2A..U+0A30 U+0A32..U+0A33
4387     U+0A35..U+0A36 U+0A38..U+0A39 U+0A59..U+0A5C
4388     U+0A5E U+0A72..U+0A74 U+0A85..U+0A8B U+0A8D
4389     U+0A8F..U+0A91 U+0A93..U+0AA8 U+0AAA..U+0AB0
4390     U+0AB2..U+0AB3 U+0AB5..U+0AB9 U+0ABD U+0AE0
4391     U+0B05..U+0B0C U+0B0F..U+0B10 U+0B13..U+0B28
4392     U+0B2A..U+0B30 U+0B32..U+0B33 U+0B36..U+0B39
4393     U+0B3D U+0B5C..U+0B5D U+0B5F..U+0B61
4394     U+0B85..U+0B8A U+0B8E..U+0B90 U+0B92..U+0B95
4395     U+0B99..U+0B9A U+0B9C U+0B9E..U+0B9F
4396     U+0BA3..U+0BA4 U+0BA8..U+0BAA U+0BAE..U+0BB5
4397     U+0BB7..U+0BB9 U+0C05..U+0C0C U+0C0E..U+0C10
4398     U+0C12..U+0C28 U+0C2A..U+0C33 U+0C35..U+0C39
4399     U+0C60..U+0C61 U+0C85..U+0C8C U+0C8E..U+0C90
4400     U+0C92..U+0CA8 U+0CAA..U+0CB3 U+0CB5..U+0CB9
4401     U+0CDE U+0CE0..U+0CE1 U+0D05..U+0D0C
4402     U+0D0E..U+0D10 U+0D12..U+0D28 U+0D2A..U+0D39
4403     U+0D60..U+0D61 U+0E01..U+0E2E U+0E30
4404     U+0E32..U+0E33 U+0E40..U+0E45 U+0E81..U+0E82
4405     U+0E84 U+0E87..U+0E88 U+0E8A U+0E8D
4406     U+0E94..U+0E97 U+0E99..U+0E9F U+0EA1..U+0EA3
4407     U+0EA5 U+0EA7 U+0EAA..U+0EAB U+0EAD..U+0EAE
4408     U+0EB0 U+0EB2..U+0EB3 U+0EBD U+0EC0..U+0EC4
4409     U+0F40..U+0F47 U+0F49..U+0F69 U+10A0..U+10C5
4410     U+10D0..U+10F6 U+1100 U+1102..U+1103
4411     U+1105..U+1107 U+1109 U+110B..U+110C
4412     U+110E..U+1112 U+113C U+113E U+1140 U+114C
4413     U+114E U+1150 U+1154..U+1155 U+1159
4414     U+115F..U+1161 U+1163 U+1165 U+1167 U+1169
4415     U+116D..U+116E U+1172..U+1173 U+1175 U+119E
4416     U+11A8 U+11AB U+11AE..U+11AF U+11B7..U+11B8
4417     U+11BA U+11BC..U+11C2 U+11EB U+11F0 U+11F9
4418     U+1E00..U+1E9B U+1EA0..U+1EF9 U+1F00..U+1F15
4419     U+1F18..U+1F1D U+1F20..U+1F45 U+1F48..U+1F4D
4420     U+1F50..U+1F57 U+1F59 U+1F5B U+1F5D
4421     U+1F5F..U+1F7D U+1F80..U+1FB4 U+1FB6..U+1FBC
4422     U+1FBE U+1FC2..U+1FC4 U+1FC6..U+1FCC
4423     U+1FD0..U+1FD3 U+1FD6..U+1FDB U+1FE0..U+1FEC
4424     U+1FF2..U+1FF4 U+1FF6..U+1FFC U+2126
4425     U+212A..U+212B U+212E U+2180..U+2182
4426     U+3041..U+3094 U+30A1..U+30FA U+3105..U+312C
4427     U+AC00..U+D7A3
4428     // Ideographic
4429     U+4E00..U+9FA5 U+3007 U+3021..U+3029
4430     ];
4431     $NameChar10 := [
4432     '.' '-' '_' ':'
4433     // Letter
4434     // BaseChar
4435     U+0041..U+005A U+0061..U+007A U+00C0..U+00D6
4436     U+00D8..U+00F6 U+00F8..U+00FF U+0100..U+0131
4437     U+0134..U+013E U+0141..U+0148 U+014A..U+017E
4438     U+0180..U+01C3 U+01CD..U+01F0 U+01F4..U+01F5
4439     U+01FA..U+0217 U+0250..U+02A8 U+02BB..U+02C1
4440     U+0386 U+0388..U+038A U+038C U+038E..U+03A1
4441     U+03A3..U+03CE U+03D0..U+03D6 U+03DA U+03DC
4442     U+03DE U+03E0 U+03E2..U+03F3 U+0401..U+040C
4443     U+040E..U+044F U+0451..U+045C U+045E..U+0481
4444     U+0490..U+04C4 U+04C7..U+04C8 U+04CB..U+04CC
4445     U+04D0..U+04EB U+04EE..U+04F5 U+04F8..U+04F9
4446     U+0531..U+0556 U+0559 U+0561..U+0586
4447     U+05D0..U+05EA U+05F0..U+05F2 U+0621..U+063A
4448     U+0641..U+064A U+0671..U+06B7 U+06BA..U+06BE
4449     U+06C0..U+06CE U+06D0..U+06D3 U+06D5
4450     U+06E5..U+06E6 U+0905..U+0939 U+093D
4451     U+0958..U+0961 U+0985..U+098C U+098F..U+0990
4452     U+0993..U+09A8 U+09AA..U+09B0 U+09B2
4453     U+09B6..U+09B9 U+09DC..U+09DD U+09DF..U+09E1
4454     U+09F0..U+09F1 U+0A05..U+0A0A U+0A0F..U+0A10
4455     U+0A13..U+0A28 U+0A2A..U+0A30 U+0A32..U+0A33
4456     U+0A35..U+0A36 U+0A38..U+0A39 U+0A59..U+0A5C
4457     U+0A5E U+0A72..U+0A74 U+0A85..U+0A8B U+0A8D
4458     U+0A8F..U+0A91 U+0A93..U+0AA8 U+0AAA..U+0AB0
4459     U+0AB2..U+0AB3 U+0AB5..U+0AB9 U+0ABD U+0AE0
4460     U+0B05..U+0B0C U+0B0F..U+0B10 U+0B13..U+0B28
4461     U+0B2A..U+0B30 U+0B32..U+0B33 U+0B36..U+0B39
4462     U+0B3D U+0B5C..U+0B5D U+0B5F..U+0B61
4463     U+0B85..U+0B8A U+0B8E..U+0B90 U+0B92..U+0B95
4464     U+0B99..U+0B9A U+0B9C U+0B9E..U+0B9F
4465     U+0BA3..U+0BA4 U+0BA8..U+0BAA U+0BAE..U+0BB5
4466     U+0BB7..U+0BB9 U+0C05..U+0C0C U+0C0E..U+0C10
4467     U+0C12..U+0C28 U+0C2A..U+0C33 U+0C35..U+0C39
4468     U+0C60..U+0C61 U+0C85..U+0C8C U+0C8E..U+0C90
4469     U+0C92..U+0CA8 U+0CAA..U+0CB3 U+0CB5..U+0CB9
4470     U+0CDE U+0CE0..U+0CE1 U+0D05..U+0D0C
4471     U+0D0E..U+0D10 U+0D12..U+0D28 U+0D2A..U+0D39
4472     U+0D60..U+0D61 U+0E01..U+0E2E U+0E30
4473     U+0E32..U+0E33 U+0E40..U+0E45 U+0E81..U+0E82
4474     U+0E84 U+0E87..U+0E88 U+0E8A U+0E8D
4475     U+0E94..U+0E97 U+0E99..U+0E9F U+0EA1..U+0EA3
4476     U+0EA5 U+0EA7 U+0EAA..U+0EAB U+0EAD..U+0EAE
4477     U+0EB0 U+0EB2..U+0EB3 U+0EBD U+0EC0..U+0EC4
4478     U+0F40..U+0F47 U+0F49..U+0F69 U+10A0..U+10C5
4479     U+10D0..U+10F6 U+1100 U+1102..U+1103
4480     U+1105..U+1107 U+1109 U+110B..U+110C
4481     U+110E..U+1112 U+113C U+113E U+1140 U+114C
4482     U+114E U+1150 U+1154..U+1155 U+1159
4483     U+115F..U+1161 U+1163 U+1165 U+1167 U+1169
4484     U+116D..U+116E U+1172..U+1173 U+1175 U+119E
4485     U+11A8 U+11AB U+11AE..U+11AF U+11B7..U+11B8
4486     U+11BA U+11BC..U+11C2 U+11EB U+11F0 U+11F9
4487     U+1E00..U+1E9B U+1EA0..U+1EF9 U+1F00..U+1F15
4488     U+1F18..U+1F1D U+1F20..U+1F45 U+1F48..U+1F4D
4489     U+1F50..U+1F57 U+1F59 U+1F5B U+1F5D
4490     U+1F5F..U+1F7D U+1F80..U+1FB4 U+1FB6..U+1FBC
4491     U+1FBE U+1FC2..U+1FC4 U+1FC6..U+1FCC
4492     U+1FD0..U+1FD3 U+1FD6..U+1FDB U+1FE0..U+1FEC
4493     U+1FF2..U+1FF4 U+1FF6..U+1FFC U+2126
4494     U+212A..U+212B U+212E U+2180..U+2182
4495     U+3041..U+3094 U+30A1..U+30FA U+3105..U+312C
4496     U+AC00..U+D7A3
4497     // Ideographic
4498     U+4E00..U+9FA5 U+3007 U+3021..U+3029
4499     // Digit
4500     U+0030..U+0039 U+0660..U+0669 U+06F0..U+06F9
4501     U+0966..U+096F U+09E6..U+09EF U+0A66..U+0A6F
4502     U+0AE6..U+0AEF U+0B66..U+0B6F U+0BE7..U+0BEF
4503     U+0C66..U+0C6F U+0CE6..U+0CEF U+0D66..U+0D6F
4504     U+0E50..U+0E59 U+0ED0..U+0ED9 U+0F20..U+0F29
4505     // CombiningChar
4506     U+0300..U+0345 U+0360..U+0361 U+0483..U+0486
4507     U+0591..U+05A1 U+05A3..U+05B9 U+05BB..U+05BD
4508     U+05BF U+05C1..U+05C2 U+05C4 U+064B..U+0652
4509     U+0670 U+06D6..U+06DC U+06DD..U+06DF
4510     U+06E0..U+06E4 U+06E7..U+06E8 U+06EA..U+06ED
4511     U+0901..U+0903 U+093C U+093E..U+094C U+094D
4512     U+0951..U+0954 U+0962..U+0963 U+0981..U+0983
4513     U+09BC U+09BE U+09BF U+09C0..U+09C4
4514     U+09C7..U+09C8 U+09CB..U+09CD U+09D7
4515     U+09E2..U+09E3 U+0A02 U+0A3C U+0A3E U+0A3F
4516     U+0A40..U+0A42 U+0A47..U+0A48 U+0A4B..U+0A4D
4517     U+0A70..U+0A71 U+0A81..U+0A83 U+0ABC
4518     U+0ABE..U+0AC5 U+0AC7..U+0AC9 U+0ACB..U+0ACD
4519     U+0B01..U+0B03 U+0B3C U+0B3E..U+0B43
4520     U+0B47..U+0B48 U+0B4B..U+0B4D U+0B56..U+0B57
4521     U+0B82..U+0B83 U+0BBE..U+0BC2 U+0BC6..U+0BC8
4522     U+0BCA..U+0BCD U+0BD7 U+0C01..U+0C03
4523     U+0C3E..U+0C44 U+0C46..U+0C48 U+0C4A..U+0C4D
4524     U+0C55..U+0C56 U+0C82..U+0C83 U+0CBE..U+0CC4
4525     U+0CC6..U+0CC8 U+0CCA..U+0CCD U+0CD5..U+0CD6
4526     U+0D02..U+0D03 U+0D3E..U+0D43 U+0D46..U+0D48
4527     U+0D4A..U+0D4D U+0D57 U+0E31 U+0E34..U+0E3A
4528     U+0E47..U+0E4E U+0EB1 U+0EB4..U+0EB9
4529     U+0EBB..U+0EBC U+0EC8..U+0ECD U+0F18..U+0F19
4530     U+0F35 U+0F37 U+0F39 U+0F3E U+0F3F
4531     U+0F71..U+0F84 U+0F86..U+0F8B U+0F90..U+0F95
4532     U+0F97 U+0F99..U+0FAD U+0FB1..U+0FB7 U+0FB9
4533     U+20D0..U+20DC U+20E1 U+302A..U+302F U+3099
4534     U+309A
4535     // Extender
4536     U+00B7 U+02D0 U+02D1 U+0387 U+0640 U+0E46
4537     U+0EC6 U+3005 U+3031..U+3035 U+309D..U+309E
4538     U+30FC..U+30FE
4539     ];
4540 wakaba 1.1
4541     $NameStartChar11 := [
4542     ':' '_'
4543     'A' 'B' 'C' 'D' 'E' 'F' 'G' 'H' 'I' 'J' 'K' 'L' 'M'
4544     'N' 'O' 'P' 'Q' 'R' 'S' 'T' 'U' 'V' 'W' 'X' 'Y' 'Z'
4545     'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm'
4546     'n' 'o' 'p' 'q' 'r' 's' 't' 'u' 'v' 'w' 'x' 'y' 'z'
4547     U+00C0..U+00D6 U+00D8..U+00F6 U+00F8..U+02FF
4548     U+0370..U+037D U+037F..U+1FFF U+200C..U+200D
4549     U+2070..U+218F U+2C00..U+2FEF U+3001..U+D7FF
4550     U+F900..U+FDCF U+FDF0..U+FFFD U+10000..U+EFFFF
4551     ];
4552     $NameChar11 := [
4553     '-' '.' '0' '1' '2' '3' '4' '5' '6' '7' '8' '9'
4554     U+00B7 U+0300..U+036F U+203F..U+2040
4555     // NameStartChar
4556     ':' '_'
4557     'A' 'B' 'C' 'D' 'E' 'F' 'G' 'H' 'I' 'J' 'K' 'L' 'M'
4558     'N' 'O' 'P' 'Q' 'R' 'S' 'T' 'U' 'V' 'W' 'X' 'Y' 'Z'
4559     'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm'
4560     'n' 'o' 'p' 'q' 'r' 's' 't' 'u' 'v' 'w' 'x' 'y' 'z'
4561     U+00C0..U+00D6 U+00D8..U+00F6 U+00F8..U+02FF
4562     U+0370..U+037D U+037F..U+1FFF U+200C..U+200D
4563     U+2070..U+218F U+2C00..U+2FEF U+3001..U+D7FF
4564     U+F900..U+FDCF U+FDF0..U+FFFD U+10000..U+EFFFF
4565     ];
4566 wakaba 1.4 } // NameChar
4567    
4568     lexmode Name
4569     : extends => 'NameChar'
4570     {
4571 wakaba 1.1 Name : value := $NameStartChar11 $NameChar11*;
4572     } // Name
4573 wakaba 1.4
4574     lexmode Nmtoken
4575     : extends => 'NameChar'
4576     {
4577     Nmtoken : value := $NameChar11*;
4578     } // Nmtoken
4579 wakaba 1.1
4580     /*
4581 wakaba 1.14 S
4582 wakaba 1.1 */
4583     lexmode S {
4584 wakaba 1.14 $s := [U+0009 U+000A U+000D U+0020];
4585     S := $s+;
4586 wakaba 1.1 } // S
4587    
4588     /*
4589     Document end scanning mode
4590     */
4591     lexmode DocumentEnd
4592     : standalone
4593     : extends => 'S'
4594     {
4595     /*
4596     Processing instruction
4597     */
4598     PIO := ['<'] ['?'];
4599    
4600     /*
4601     Comment declaration
4602     */
4603     CDO := ['<'] ['!'] ['-'] ['-'];
4604     } // DocumentEnd
4605    
4606     /*
4607     Document misc scanning mode
4608    
4609     This mode scans |Misc| constructions as well
4610     as document element's start tag.
4611     */
4612     lexmode DocumentMisc
4613     : standalone
4614     : extends => 'DocumentEnd'
4615     {
4616     /*
4617     Document element start tag
4618     */
4619     STAGO := ['<'];
4620     } // DocumentMisc
4621    
4622     /*
4623     Document prolog scanning mode
4624     */
4625     lexmode DocumentProlog
4626     : standalone
4627     : extends => 'DocumentMisc'
4628     {
4629     /*
4630     |DOCTYPE| declaration
4631     */
4632     MDO := ['<'] ['!'];
4633     } // DocumentProlog
4634 wakaba 1.16
4635 wakaba 1.1 /*
4636 wakaba 1.16 Document Start Scanning Mode
4637 wakaba 1.1 */
4638     lexmode DocumentStart
4639     : standalone
4640     : extends => 'DocumentProlog'
4641     {
4642     /*
4643     XML declaration
4644     */
4645 wakaba 1.16 XDO := ['<'] ['?'] ['x'] ['m'] ['l'];
4646 wakaba 1.1 } // DocumentStart
4647    
4648     /*
4649     Comment declaration scanning mode
4650     */
4651     lexmode CommentDeclaration
4652     : standalone
4653     {
4654     /*
4655     Comment close
4656     */
4657     COM := ['-'] ['-'];
4658    
4659     /*
4660     Comment data
4661     */
4662 wakaba 1.15 ?default-token STRING : value;
4663 wakaba 1.1 } // CommentDeclaration
4664    
4665     /*
4666     Processing instruction name and |S| scanning mode
4667     */
4668     lexmode PIName
4669     : standalone
4670     : extends => 'Name'
4671     : extends => 'S'
4672     {
4673     /*
4674     Processing instruction close
4675     */
4676     PIC := ['?'] ['>'];
4677     } // PIName
4678    
4679     /*
4680 wakaba 1.16 Processing instruction name and |S| scanning mode
4681     */
4682     lexmode PINmtoken
4683     : standalone
4684     : extends => 'Nmtoken'
4685     : extends => 'S'
4686     {
4687     /*
4688     Processing instruction close
4689     */
4690     PIC := ['?'] ['>'];
4691     } // PINmtoken
4692    
4693     /*
4694 wakaba 1.1 Processing instruction data scanning mode
4695     */
4696     lexmode PIData
4697     : standalone
4698     {
4699     /*
4700     Processing instruction close
4701     */
4702     PIC := ['?'] ['>'];
4703    
4704     /*
4705     Processing instruction target data
4706     */
4707 wakaba 1.2 ?default-token DATA : value;
4708 wakaba 1.1 } // PIData
4709    
4710     /*
4711     Content of element scanning mode
4712     */
4713     lexmode ElementContent
4714     : standalone
4715     {
4716     /*
4717     Start tag open
4718     */
4719     STAGO := ['<'];
4720    
4721     /*
4722     End tag open
4723     */
4724     ETAGO := ['<'] ['/'];
4725    
4726     /*
4727     Hexadecimal character reference open
4728     */
4729     HCRO := ['&'] ['#'] ['x'];
4730    
4731     /*
4732     Numeric character reference open
4733     */
4734     CRO := ['&'] ['#'];
4735    
4736     /*
4737     General entity reference open
4738     */
4739     ERO := ['&'];
4740    
4741     /*
4742     Comment declaration open
4743     */
4744     CDO := ['<'] ['!'] ['-'] ['-'];
4745    
4746     /*
4747     CDATA section open
4748     */
4749     CDSO := ['<'] ['!'] ['[']
4750     ['C'] ['D'] ['A'] ['T'] ['A'] ['['];
4751    
4752     /*
4753     Processing instruction open
4754     */
4755     PIO := ['<'] ['?'];
4756 wakaba 1.2
4757     /*
4758     Markup section end
4759     */
4760     MSE := [']'] [']'] ['>'];
4761    
4762     /*
4763     Character data
4764     */
4765     /*
4766     Character data and/or |MSE|
4767     */
4768     ?default-token CharData : value;
4769 wakaba 1.1 } // ElementContent
4770    
4771     /*
4772     CDATA section content scanning mode
4773     */
4774     lexmode CDATASectionContent
4775     : standalone
4776     {
4777     /*
4778     Markup section end
4779     */
4780     MSE := [']'] [']'] ['>'];
4781    
4782     /*
4783     Character data
4784 wakaba 1.2 */
4785     ?default-token CData : value;
4786 wakaba 1.1 } // CDATASectionContent
4787    
4788     lexmode EntityReference
4789     : standalone
4790     : extends => 'Name'
4791     {
4792     /*
4793     Reference close
4794     */
4795     REFC := [';'];
4796     } // EntityReference
4797    
4798     lexmode NumericCharacterReference
4799     : standalone
4800     {
4801     /*
4802     Decimal number
4803     */
4804     $digit := ['0' '1' '2' '3' '4' '5' '6' '7' '8' '9'];
4805     NUMBER : value := $digit+;
4806    
4807     /*
4808     Reference close
4809     */
4810     REFC := [';'];
4811     } // NumericCharacterReference
4812    
4813     lexmode HexadecimalCharacterReference
4814     : standalone
4815     {
4816     /*
4817     Hexadecimal number
4818     */
4819     $hexdigit := ['0' '1' '2' '3' '4' '5' '6' '7' '8' '9'
4820     'A' 'B' 'C' 'D' 'E' 'F'
4821     'a' 'b' 'c' 'd' 'e' 'f'];
4822     Hex : value := $hexdigit+;
4823    
4824     /*
4825     Reference close
4826     */
4827     REFC := [';'];
4828     } // HexadecimalCharacterReference
4829    
4830 wakaba 1.16 /*
4831     The XML Declaration and Text Declaration Scanning Mode
4832     */
4833 wakaba 1.3 lexmode XMLDeclaration
4834     : standalone
4835     : extends => 'Name'
4836     : extends => 'S'
4837     {
4838    
4839     /*
4840     Value indicator
4841     */
4842     VI := ['='];
4843    
4844     /*
4845     Literal open
4846     */
4847     LIT := ['"'];
4848     LITA := [U+0027];
4849    
4850     /*
4851     Processing instruction close
4852 wakaba 1.16
4853     The |PIC|, i.e. |?>|, is split into two tokens |PIC1| and |PIC2|
4854     in this scanning mode to set |no_xml11_eol| flag in the
4855     |_XMLDeclaration_| |rule|.
4856 wakaba 1.3 */
4857 wakaba 1.16 PIC1 := ['?'];
4858     PIC2 := ['>'];
4859 wakaba 1.3 } // XMLDeclaration
4860 wakaba 1.16
4861     /*
4862     The XML Declaration or Processing Instruction Scanning Mode
4863    
4864     '<?xml' S ...
4865     (DocumentStart) (XMLDeclarationOrPI) (XMLDeclaration)
4866     '<?xml' '1' S ...
4867     (DocumentStart) (XMLDeclarationOrPI) (PINmtoken)(PIName) (PITarget)
4868     '<?xml' '-' 'stylesheet' S ...
4869     (DocumentStart) (XMLDeclarationOrPI) (PINmtoken) (PIName) (PITarget)
4870     */
4871     lexmode XMLDeclarationOrPI
4872     : standalone
4873     : extends => 'NameChar'
4874     : extends => 'S'
4875     {
4876     NameChar : value := $NameChar11;
4877     } // XMLDeclarationOrPI
4878 wakaba 1.3
4879 wakaba 1.1 lexmode StartTag
4880     : standalone
4881     : extends => 'Name'
4882     : extends => 'S'
4883     {
4884    
4885     /*
4886     Value indicator
4887     */
4888     VI := ['='];
4889    
4890     /*
4891     Literal open
4892     */
4893     LIT := ['"'];
4894     LITA := [U+0027];
4895    
4896     /*
4897     Tag close
4898     */
4899     TAGC := ['>'];
4900    
4901     /*
4902 wakaba 1.6 Null end-tag enabled start-tag close
4903 wakaba 1.1 */
4904 wakaba 1.6 NESTC := ['/'];
4905 wakaba 1.1 } // StartTag
4906    
4907     lexmode EndTag
4908     : standalone
4909     : extends => 'Name'
4910     : extends => 'S'
4911     {
4912     /*
4913     Tag close
4914     */
4915     TAGC := ['>'];
4916     } // EndTag
4917    
4918     lexmode AttributeValueLiteral_ {
4919     ERO := ['&'];
4920     CRO := ['&'] ['#'];
4921     HCRO := ['&'] ['#'] ['x'];
4922     } // AttributeValueLiteral_
4923    
4924     lexmode AttributeValueLiteral
4925     : standalone
4926     : extends => 'AttributeValueLiteral_'
4927     {
4928     LIT := ['"'];
4929 wakaba 1.3 STRING : value := [^'"' '&' '<']+;
4930 wakaba 1.1 } // AttributeValueLiteral
4931    
4932     lexmode AttributeValueLiteralA
4933     : standalone
4934     : extends => 'AttributeValueLiteral_'
4935     {
4936 wakaba 1.4 LITA := [U+0027];
4937 wakaba 1.3 STRING : value := [^U+0027 '&' '<']+;
4938 wakaba 1.1 } // AttributeValueLiteralA
4939 wakaba 1.11
4940     lexmode AttributeValueLiteralE
4941     : standalone
4942     : extends => 'AttributeValueLiteral_'
4943     {
4944     STRING : value := [^'&' '<']+;
4945     } // AttributeValueLiteralE
4946 wakaba 1.4
4947     lexmode EntityValue_ {
4948     PERO := ['%'];
4949     ERO := ['&'];
4950     CRO := ['&'] ['#'];
4951     HCRO := ['&'] ['#'] ['x'];
4952     } // EntityValue_
4953    
4954     lexmode EntityValue
4955     : standalone
4956     : extends => 'EntityValue_'
4957     {
4958     LIT := ['"'];
4959     STRING : value := [^'"' '&' '%']+;
4960     } // EntityValue
4961    
4962     lexmode EntityValueA
4963     : standalone
4964     : extends => 'EntityValue_'
4965     {
4966     LITA := [U+0027];
4967     STRING : value := [^U+0027 '&' '%']+;
4968     } // EntityValueA
4969    
4970     lexmode SystemLiteral
4971     : standalone
4972     {
4973     LIT := ['"'];
4974     ?default-token STRING : value;
4975     } // SystemLiteral
4976    
4977     lexmode SystemLiteralA
4978     : standalone
4979     {
4980     LITA := [U+0027];
4981     ?default-token STRING : value;
4982     } // SystemLiteralA
4983    
4984     lexmode DTD
4985     : standalone
4986     : extends => 'S'
4987     {
4988     /*
4989     Markup declaration open
4990     */
4991     MDO := ['<'] ['!'];
4992    
4993     /*
4994     Comment declaration open
4995     */
4996     CDO := ['<'] ['!'] ['-'] ['-'];
4997    
4998     /*
4999     Processing instruction open
5000     */
5001     PIO := ['<'] ['?'];
5002    
5003     /*
5004     Parameter entity reference open
5005     */
5006     PERO := ['%'];
5007    
5008     /*
5009     Declaration subset close
5010     */
5011     DSC := [']'];
5012    
5013     /*
5014     Contition section open
5015     */
5016     CSO := ['<'] ['!'] ['['];
5017     } // DTD
5018    
5019     /*
5020     Markup declaration scanning mode
5021    
5022     This mode is used to recognize |MDC| that terminates
5023     a comment declaration as well as the base |lexmode|
5024     for e.g. document type declaration scanning mode.
5025     */
5026     lexmode MarkupDeclaration
5027     : standalone
5028     : extends => 'Name'
5029     : extends => 'S'
5030     {
5031     /*
5032     Markup declaration close
5033     */
5034     MDC := ['>'];
5035    
5036     /*
5037     Literal open
5038     */
5039     LIT := ['"'];
5040    
5041     /*
5042     Alternative literal open
5043     */
5044     LITA := [U+0027];
5045    
5046     /*
5047     Parameter entity reference open
5048     */
5049     PERO := ['%'];
5050    
5051     /*
5052     Declaration subset open
5053     */
5054     DSO := ['['];
5055     } // MarkupDeclaration
5056    
5057     lexmode ElementDeclaration
5058     : standalone
5059     : extends => 'MarkupDeclaration'
5060     {
5061     /*
5062     Model group open
5063     */
5064     MGO := ['('];
5065    
5066     /*
5067     Model group close
5068     */
5069     MGC := [')'];
5070    
5071     /*
5072     Reserved name indicator
5073     */
5074     RNI := ['#'];
5075    
5076     /*
5077     Occurence indicators
5078     */
5079     OPT := ['?'];
5080     REP := ['*'];
5081     PLUS := ['+'];
5082    
5083     /*
5084     Connectors
5085     */
5086     OR := ['|'];
5087     SEQ := [','];
5088     } // ElementDeclaration
5089    
5090     lexmode AttlistDeclaration
5091     : standalone
5092     : extends => 'MarkupDeclaration'
5093     {
5094     /*
5095     Enumeration group open
5096     */
5097     EGO := ['('];
5098    
5099     /*
5100     Enumeration group close
5101     */
5102     EGC := [')'];
5103    
5104     /*
5105     Enumeration choice delimiter
5106     */
5107     OR := ['|'];
5108    
5109     /*
5110     Reserved name indicator
5111     */
5112     RNI := ['#'];
5113     } // AttlistDeclaration
5114    
5115     lexmode Enumeration
5116     : standalone
5117     : extends => 'Nmtoken'
5118     : extends => 'S'
5119     {
5120     /*
5121     Enumeration group close
5122     */
5123     EGC := [')'];
5124    
5125     /*
5126     Enumeration choice delimiter
5127     */
5128     OR := ['|'];
5129     } // Enumeration
5130    
5131 wakaba 1.1
5132     token-error default : default {
5133     lang:Perl {
5134 wakaba 1.3 my $location;
5135     __CODE{xp|get-location-from-token::
5136     $token => {$token},
5137     $result => {$location},
5138     }__;
5139     my $continue = __DOMCore:ERROR{xp|wf-syntax-error::
5140 wakaba 1.1 xp|error-token => {$token},
5141     DOMCore|location => {$location},
5142     }__;
5143     unless ($continue) {
5144 wakaba 1.27 __CODE{ParseError}__;
5145 wakaba 1.1 }
5146     }
5147     } // default
5148 wakaba 1.5
5149 wakaba 1.26 @ResourceDef:
5150     @@ForCheck: ManakaiDOM|ForClass
5151 wakaba 1.27 @@QName: ParseError
5152     @@rdf:type: DISPerl|BlockCode
5153     @@PerlDef:
5154     __DEEP{
5155     for (@{$self->{entity}}) {
5156     $_->{close_file}->();
5157     }
5158     }__;
5159     __EXCEPTION{DOMLS|PARSE_ERR}__;
5160    
5161     @ResourceDef:
5162     @@ForCheck: ManakaiDOM|ForClass
5163 wakaba 1.26 @@QName: checkNCName
5164     @@rdf:type: DISPerl|BlockCode
5165     @@PerlDef:
5166     if (($self->{xml_version} eq '1.0' and
5167     not <Code::DOMMain|testXML10Name:: $INPUT = $name>) or
5168     ($self->{xml_version} eq '1.1' and
5169     not <Code::DOMMain|testXML11Name:: $INPUT = $name>)) {
5170     my $__location;
5171     __CODE{xp|get-location-from-token::
5172     $token => {$token},
5173     $result => {$__location},
5174     }__;
5175     my $__continue = __c|ERROR{xp|wf-invalid-character-in-node-name::
5176     xp|error-token => {$token},
5177     c|location => {$__location},
5178     xp|name => {$name},
5179     infoset|version => {$self->{xml_version}},
5180     }__;
5181     unless ($__continue) {
5182 wakaba 1.27 __CODE{ParseError}__;
5183 wakaba 1.26 }
5184     } elsif (index ($name, ':') > -1) {
5185     my $__location;
5186     __CODE{xp|get-location-from-token::
5187     $token => {$token},
5188     $result => {$__location},
5189     }__;
5190     my $__continue = __c|ERROR{xp|nswf-legal-ncname::
5191     xp|error-token => {$token},
5192     c|location => {$__location},
5193     xp|name => {$name},
5194     infoset|version => {$self->{xml_version}},
5195     }__;
5196     unless ($__continue) {
5197 wakaba 1.27 __CODE{ParseError}__;
5198 wakaba 1.26 }
5199     }
5200    
5201     @ResourceDef:
5202     @@ForCheck: ManakaiDOM|ForClass
5203     @@QName: checkQName
5204     @@rdf:type: DISPerl|BlockCode
5205     @@PerlDef:
5206     if (($self->{xml_version} eq '1.0' and
5207     not <Code::DOMMain|testXML10Name:: $INPUT = $name>) or
5208     ($self->{xml_version} eq '1.1' and
5209     not <Code::DOMMain|testXML11Name:: $INPUT = $name>)) {
5210     my $__location;
5211     __CODE{xp|get-location-from-token::
5212     $token => {$token},
5213     $result => {$__location},
5214     }__;
5215     my $__continue = __c|ERROR{xp|wf-invalid-character-in-node-name::
5216     xp|error-token => {$token},
5217     c|location => {$__location},
5218     xp|name => {$name},
5219     infoset|version => {$self->{xml_version}},
5220     }__;
5221     unless ($__continue) {
5222 wakaba 1.27 __CODE{ParseError}__;
5223 wakaba 1.26 }
5224     } elsif (($self->{xml_version} eq '1.0' and
5225     not <Code::DOMMain|testXML10QName:: $INPUT = $name>) or
5226     ($self->{xml_version} eq '1.1' and
5227     not <Code::DOMMain|testXML11QName:: $INPUT = $name>)) {
5228     my $__location;
5229     __CODE{xp|get-location-from-token::
5230     $token => {$token},
5231     $result => {$__location},
5232     }__;
5233     my $__continue = __c|ERROR{xp|nswf-legal-qname::
5234     xp|error-token => {$token},
5235     c|location => {$__location},
5236     xp|name => {$name},
5237     infoset|version => {$self->{xml_version}},
5238     }__;
5239     unless ($__continue) {
5240 wakaba 1.27 __CODE{ParseError}__;
5241 wakaba 1.26 }
5242     }
5243    
5244    
5245 wakaba 1.5 @XMLTests:
5246     @@XMLTest:
5247 wakaba 1.15 @@@QName: xp.char.xml10.test
5248     @@@DEnt:
5249     @@@@test:value:
5250     <?xml version="1.0"?>
5251     <p>$u0009$u000A$u000D$u0020$uD7FF$uE000$uFFFD$U00010000$U0010FFFF</p>
5252     @@@test:domTree:
5253     document {
5254     xml-version: '1.0';
5255     element {
5256     text-content: U+0009 U+000A U+000A U+0020 U+D7FF
5257     U+E000 U+FFFD U+10000 U+10FFFF;
5258     }
5259     }
5260     @@XMLTest:
5261     @@@QName: xp.char.xml11.test
5262     @@@DEnt:
5263     @@@@test:value:
5264     <?xml version="1.1"?>
5265     <p>$u0009$u000A$u000D$u0020$uD7FF$uE000$uFFFD$U00010000$U0010FFFF</p>
5266     @@@test:domTree:
5267     document {
5268     xml-version: '1.1';
5269     element {
5270     text-content: U+0009 U+000A U+000A U+0020 U+D7FF
5271     U+E000 U+FFFD U+10000 U+10FFFF;
5272     }
5273     }
5274     @@XMLTest:
5275     @@@QName: xp.char.xml10.c0.test
5276     @@@DEnt:
5277     @@@@test:value:
5278     <?xml version="1.0"?>
5279     <p>$u0000$u0001$u0002$u0003$u0004$u0005$u0006$u0007$u0008$u000B$
5280     $u000C$u000E$u000F$u0010$u0011$u0012$u0013$u0014$u0015$u0016$
5281     $u0017$u0018$u0019$u001A$u001B$u001C$u001D$u001E$u001F</p>
5282     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 4); } /* U+0000 */
5283     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 5); } /* U+0001 */
5284     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 6); } /* U+0002 */
5285     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 7); } /* U+0003 */
5286     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 8); } /* U+0004 */
5287     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 9); } /* U+0005 */
5288     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 10); } /* U+0006 */
5289     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 11); } /* U+0007 */
5290     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 12); } /* U+0008 */
5291     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 13); } /* U+000B */
5292     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 14); } /* U+000C */
5293     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 15); } /* U+000E */
5294     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 16); } /* U+000F */
5295     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 17); } /* U+0010 */
5296     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 18); } /* U+0011 */
5297     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 19); } /* U+0012 */
5298     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 20); } /* U+0013 */
5299     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 21); } /* U+0014 */
5300     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 22); } /* U+0015 */
5301     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 23); } /* U+0016 */
5302     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 24); } /* U+0017 */
5303     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 25); } /* U+0018 */
5304     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 26); } /* U+0019 */
5305     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 27); } /* U+001A */
5306     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 28); } /* U+001B */
5307     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 29); } /* U+001C */
5308     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 30); } /* U+001D */
5309     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 31); } /* U+001E */
5310     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 32); } /* U+001F */
5311     @@XMLTest:
5312     @@@QName: xp.char.xml11.c0.test
5313     @@@DEnt:
5314     @@@@test:value:
5315     <?xml version="1.1"?>
5316     <p>$u0000$u0001$u0002$u0003$u0004$u0005$u0006$u0007$u0008$u000B$
5317     $u000C$u000E$u000F$u0010$u0011$u0012$u0013$u0014$u0015$u0016$
5318     $u0017$u0018$u0019$u001A$u001B$u001C$u001D$u001E$u001F</p>
5319     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 4); } /* U+0000 */
5320     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 5); } /* U+0001 */
5321     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 6); } /* U+0002 */
5322     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 7); } /* U+0003 */
5323     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 8); } /* U+0004 */
5324     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 9); } /* U+0005 */
5325     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 10); } /* U+0006 */
5326     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 11); } /* U+0007 */
5327     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 12); } /* U+0008 */
5328     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 13); } /* U+000B */
5329     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 14); } /* U+000C */
5330     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 15); } /* U+000E */
5331     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 16); } /* U+000F */
5332     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 17); } /* U+0010 */
5333     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 18); } /* U+0011 */
5334     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 19); } /* U+0012 */
5335     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 20); } /* U+0013 */
5336     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 21); } /* U+0014 */
5337     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 22); } /* U+0015 */
5338     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 23); } /* U+0016 */
5339     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 24); } /* U+0017 */
5340     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 25); } /* U+0018 */
5341     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 26); } /* U+0019 */
5342     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 27); } /* U+001A */
5343     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 28); } /* U+001B */
5344     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 29); } /* U+001C */
5345     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 30); } /* U+001D */
5346     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 31); } /* U+001E */
5347     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 32); } /* U+001F */
5348     @@XMLTest:
5349     @@@QName: xp.char.xml10.c1.test
5350     @@@DEnt:
5351     @@@@test:value:
5352     <?xml version="1.0"?>
5353     <p>$u007F$u0080$u0081$u0082$u0083$u0084$u0086$u0087$u0088$
5354     $u0089$u008A$u008B$u008C$
5355     $u008D$u008E$u008F$u0090$u0091$u0092$u0093$u0094$u0095$u0096$
5356     $u0097$u0098$u0099$u009A$u009B$u009C$u009D$u009E$u009F$u0085</p>
5357     @@@test:domTree:
5358     document {
5359     xml-version: '1.0';
5360     element {
5361     text-content: U+007F U+0080 U+0081 U+0082 U+0083 U+0084 U+0086
5362     U+0087 U+0088 U+0089 U+008A U+008B U+008C U+008D
5363     U+008E U+008F U+0090 U+0091 U+0092 U+0093 U+0094
5364     U+0095 U+0096 U+0097 U+0098 U+0099 U+009A U+009B
5365     U+009C U+009D U+009E U+009F U+0085;
5366     }
5367     }
5368     @@XMLTest:
5369     @@@QName: xp.char.xml11.c1.test
5370     @@@DEnt:
5371     @@@@test:value:
5372     <?xml version="1.1"?>
5373     <p>$u007F$u0080$u0081$u0082$u0083$u0084$u0086$u0087$u0088$
5374     $u0089$u008A$u008B$u008C$
5375     $u008D$u008E$u008F$u0090$u0091$u0092$u0093$u0094$u0095$u0096$
5376     $u0097$u0098$u0099$u009A$u009B$u009C$u009D$u009E$u009F$u0085</p>
5377     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 4); } /* U+007F */
5378     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 5); } /* U+0080 */
5379     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 6); } /* U+0081 */
5380     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 7); } /* U+0082 */
5381     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 8); } /* U+0083 */
5382     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 9); } /* U+0084 */
5383     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 10); } /* U+0086 */
5384     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 11); } /* U+0087 */
5385     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 12); } /* U+0088 */
5386     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 13); } /* U+0089 */
5387     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 14); } /* U+008A */
5388     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 15); } /* U+008B */
5389     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 16); } /* U+008C */
5390     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 17); } /* U+008D */
5391     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 18); } /* U+008E */
5392     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 19); } /* U+008F */
5393     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 20); } /* U+0090 */
5394     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 21); } /* U+0091 */
5395     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 22); } /* U+0092 */
5396     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 23); } /* U+0093 */
5397     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 24); } /* U+0094 */
5398     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 25); } /* U+0095 */
5399     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 26); } /* U+0096 */
5400     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 27); } /* U+0097 */
5401     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 28); } /* U+0098 */
5402     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 29); } /* U+0099 */
5403     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 30); } /* U+009A */
5404     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 31); } /* U+009B */
5405     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 32); } /* U+009C */
5406     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 33); } /* U+009D */
5407     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 34); } /* U+009E */
5408     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 35); } /* U+009F */
5409    
5410     @@XMLTest:
5411 wakaba 1.27 @@@QName: xp.c0.internal.entity.xml11.1.test
5412     @@@DEnt:
5413     @@@@test:value:
5414     <?xml version="1.1"?>
5415     <!DOCTYPE a [
5416     <!ENTITY e "&#x01;&#x02;&#x03;&#x04;&#x05;&#x06;&#x07;$
5417     &#x08;&#x09;&#x0A;&#x0B;&#x0C;&#x0D;&#x0E;&#x0F;$
5418     &#x10;&#x11;&#x12;&#x13;&#x14;&#x15;&#x16;&#x17;$
5419     &#x18;&#x19;&#x1A;&#x1B;&#x1C;&#x1D;&#x1E;&#x1F;">
5420     ]><a/>
5421     @@@test:domTree:
5422     document {
5423     document-type {
5424     general-entity {
5425     node-name: 'e';
5426     text-content: U+0001 U+0002 U+0003 U+0004 U+0005
5427     U+0006 U+0007 U+0008 U+0009 U+000A U+000B
5428     U+000C U+000D U+000E U+000F
5429     U+0010 U+0011 U+0012 U+0013 U+0014 U+0015
5430     U+0016 U+0017 U+0018 U+0019 U+001A U+001B
5431     U+001C U+001D U+001E U+001F;
5432     }
5433     }
5434     element { }
5435     }
5436     @@XMLTest:
5437     @@@QName: xp.c1.internal.entity.xml11.1.test
5438     @@@DEnt:
5439     @@@@test:value:
5440     <?xml version="1.1"?>
5441     <!DOCTYPE a [
5442     <!ENTITY e "&#x80;&#x81;&#x82;&#x83;&#x84;&#x85;&#x86;&#x87;$
5443     &#x88;&#x89;&#x8A;&#x8B;&#x8C;&#x8D;&#x8E;&#x8F;$
5444     &#x90;&#x91;&#x92;&#x93;&#x94;&#x95;&#x96;&#x97;$
5445     &#x98;&#x99;&#x9A;&#x9B;&#x9C;&#x9D;&#x9E;&#x9F;&#x7F;">
5446     ]><a/>
5447     @@@test:domTree:
5448     document {
5449     document-type {
5450     general-entity {
5451     node-name: 'e';
5452     text-content: U+0080 U+0081 U+0082 U+0083 U+0084 U+0085
5453     U+0086 U+0087 U+0088 U+0089 U+008A U+008B
5454     U+008C U+008D U+008E U+008F
5455     U+0090 U+0091 U+0092 U+0093 U+0094 U+0095
5456     U+0096 U+0097 U+0098 U+0099 U+009A U+009B
5457     U+009C U+009D U+009E U+009F U+007F;
5458     }
5459     }
5460     element { }
5461     }
5462    
5463     @@XMLTest:
5464 wakaba 1.12 @@@QName: xp.syntax.empty.test
5465     @@@DEnt:
5466     @@@@test:value: \
5467     @@@c:erred:
5468     <[[xp:wf-syntax-error]]> { (1, 1); }
5469     @@XMLTest:
5470     @@@QName: xp.syntax.space.test
5471     @@@DEnt:
5472 wakaba 1.13 @@@@test:value: \
5473 wakaba 1.12 @@@c:erred:
5474     <[[xp:wf-syntax-error]]> { (1, 4); }
5475     @@XMLTest:
5476     @@@QName: xp.syntax.newlines.test
5477     @@@DEnt:
5478     @@@@test:value:
5479     \
5480     \
5481     \
5482     @@@c:erred:
5483     <[[xp:wf-syntax-error]]> { (3, 1); }
5484    
5485     @@XMLTest:
5486 wakaba 1.6 @@@QName: xp.only.docel.test
5487 wakaba 1.5 @@@DEnt:
5488     @@@@test:value:
5489     <p></p>
5490     @@@test:domTree:
5491     document {
5492     xml-version: '1.0';
5493 wakaba 1.6 xml-encoding: null;
5494     xml-standalone: false;
5495     element {
5496     namespace-uri: null;
5497     prefix: null;
5498     local-name: 'p';
5499     text-content: '';
5500     }
5501     }
5502     @@XMLTest:
5503     @@@QName: xp.only.docel.emptyelemtag.test
5504     @@@DEnt:
5505     @@@@test:value:
5506     <p/>
5507     @@@test:domTree:
5508     document {
5509     xml-version: '1.0';
5510     xml-encoding: null;
5511     xml-standalone: false;
5512 wakaba 1.5 element {
5513     namespace-uri: null;
5514     prefix: null;
5515     local-name: 'p';
5516     text-content: '';
5517     }
5518     }
5519 wakaba 1.15 @@XMLTest:
5520     @@@QName: xp.root.s.1.test
5521     @@@DEnt:
5522     @@@@test:value:
5523     <?xml version="1.0"?>$u0020$u000D$u000A$u0009
5524     <p></p>
5525     @@@test:domTree:
5526     document {
5527     element { }
5528     }
5529    
5530     @@XMLTest:
5531     @@@QName: xp.Name.1.test
5532     @@@DEnt:
5533     @@@@test:value: <name/>
5534     @@@test:domTree:
5535     document {
5536     element {
5537     node-name: 'name';
5538     }
5539     }
5540     @@XMLTest:
5541     @@@QName: xp.Name.2.test
5542     @@@DEnt:
5543     @@@@test:value: <name0/>
5544     @@@test:domTree:
5545     document {
5546     element {
5547     node-name: 'name0';
5548     }
5549     }
5550     @@enImplNote:
5551     @@@ddid: xml11name
5552     @@@@:
5553     {TODO:: XML 1.1 Name tests required
5554     }
5555    
5556     @@XMLTest:
5557     @@@QName: xp.content.mse.1.test
5558     @@@DEnt:
5559     @@@@test:value:
5560     <p>]]></p>
5561     @@@c:erred:
5562     <[[xp|wf-syntax-error]]> { (1, 4)..(1, 6); }
5563     @@XMLTest:
5564     @@@QName: xp.content.mse.2.test
5565     @@@DEnt:
5566     @@@@test:value:
5567     <p>aaa]]>bbb</p>
5568     @@@c:erred:
5569     <[[xp|wf-syntax-error]]> { (1, 7)..(1, 9); }
5570    
5571     @@XMLTest:
5572     @@@QName: xp.root.comment.1.test
5573     @@@DEnt:
5574     @@@@test:value:
5575     <!--comment data-->
5576     <p/>
5577     @@@test:domTree:
5578     document {
5579     comment {
5580     data: 'comment data';
5581     }
5582     element { }
5583     }
5584     @@XMLTest:
5585     @@@QName: xp.root.comment.2.test
5586     @@@DEnt:
5587     @@@@test:value:
5588     <!---->
5589     <p/>
5590     @@@test:domTree:
5591     document {
5592     comment {
5593     data: '';
5594     }
5595     element { }
5596     }
5597     @@XMLTest:
5598     @@@QName: xp.root.after.pi.comment.1.test
5599     @@@DEnt:
5600     @@@@test:value:
5601     <?pi?>
5602     <!--comment data-->
5603     <p/>
5604     @@@test:domTree:
5605     document {
5606     pi { }
5607     comment {
5608     data: 'comment data';
5609     }
5610     element { }
5611     }
5612     @@XMLTest:
5613     @@@QName: xp.root.after.pi.comment.2.test
5614     @@@DEnt:
5615     @@@@test:value:
5616     <?pi?>
5617     <!---->
5618     <p/>
5619     @@@test:domTree:
5620     document {
5621     pi { }
5622     comment {
5623     data: '';
5624     }
5625     element { }
5626     }
5627     @@XMLTest:
5628     @@@QName: xp.root.after.element.comment.1.test
5629     @@@DEnt:
5630     @@@@test:value:
5631     <p/>
5632     <!--comment data-->
5633     @@@test:domTree:
5634     document {
5635     element { }
5636     comment {
5637     data: 'comment data';
5638     }
5639     }
5640     @@XMLTest:
5641     @@@QName: xp.root.after.element.comment.2.test
5642     @@@DEnt:
5643     @@@@test:value:
5644     <p/>
5645     <!---->
5646     @@@test:domTree:
5647     document {
5648     element { }
5649     comment {
5650     data: '';
5651     }
5652     }
5653     @@XMLTest:
5654     @@@QName: xp.doctype.intsubset.comment.1.test
5655     @@@DEnt:
5656     @@@@test:value:
5657     <!DOCTYPE a [
5658     <!--comment data-->
5659     ]>
5660     <p/>
5661     @@@test:domTree:
5662     document {
5663     document-type { }
5664     element { }
5665     }
5666     @@XMLTest:
5667     @@@QName: xp.doctype.intsubset.comment.2.test
5668     @@@DEnt:
5669     @@@@test:value:
5670     <!DOCTYPE a [
5671     <!---->
5672     ]>
5673     <p/>
5674     @@@test:domTree:
5675     document {
5676     document-type { }
5677     element { }
5678     }
5679     @@XMLTest:
5680     @@@QName: xp.doctype.intsubset.comment.3.test
5681     @@@DEnt:
5682     @@@@test:value:
5683     <!DOCTYPE a [
5684     <?pi?>
5685     <!---->
5686     ]>
5687     <p/>
5688     @@@test:domTree:
5689     document {
5690     document-type {
5691     pi { }
5692     }
5693     element { }
5694     }
5695     @@XMLTest:
5696     @@@QName: xp.content.comment.1.test
5697     @@@DEnt:
5698     @@@@test:value:
5699     <p><!--comment data--></p>
5700     @@@test:domTree:
5701     document {
5702     element {
5703     comment {
5704     data: 'comment data';
5705     }
5706     }
5707     }
5708     @@XMLTest:
5709     @@@QName: xp.content.comment.2.test
5710     @@@DEnt:
5711     @@@@test:value:
5712     <p><!----></p>
5713     @@@test:domTree:
5714     document {
5715     element {
5716     comment {
5717     data: '';
5718     }
5719     }
5720     }
5721     @@XMLTest:
5722     @@@QName: xp.content.comment.3.test
5723     @@@DEnt:
5724     @@@@test:value:
5725     <p>aaaaa<!---->bbbbb</p>
5726     @@@test:domTree:
5727     document {
5728     element {
5729     text {
5730     data: 'aaaaa';
5731     }
5732     comment {
5733     data: '';
5734     }
5735     text {
5736     data: 'bbbbb';
5737     }
5738     }
5739     }
5740     @@XMLTest:
5741     @@@QName: xp.content.comment.--.1.test
5742     @@@DEnt:
5743     @@@@test:value:
5744     <p><!--data--data--></p>
5745     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 12)..(1, 17); }
5746     @@XMLTest:
5747     @@@QName: xp.content.comment.---gt.test
5748     @@@DEnt:
5749     @@@@test:value:
5750     <p><!--data---></p>
5751     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 12)..(1, 15); }
5752 wakaba 1.13
5753     @@XMLTest:
5754     @@@QName: xp.xmldecl.version.1.0.test
5755     @@@DEnt:
5756     @@@@test:value:
5757     <?xml version="1.0"?>
5758     <p></p>
5759     @@@test:domTree:
5760     document {
5761     xml-version: '1.0';
5762     xml-encoding: null;
5763     xml-standalone: false;
5764     element { }
5765     }
5766     @@XMLTest:
5767     @@@QName: xp.xmldecl.version.1.0.lita.test
5768     @@@DEnt:
5769     @@@@test:value:
5770     <?xml version='1.0'?>
5771     <p></p>
5772     @@@test:domTree:
5773     document {
5774     xml-version: '1.0';
5775     xml-encoding: null;
5776     xml-standalone: false;
5777     element { }
5778     }
5779     @@XMLTest:
5780     @@@QName: xp.xmldecl.version.1.0.s.test
5781     @@@DEnt:
5782     @@@@test:value:
5783     <?xml version = "1.0" ?>
5784     <p></p>
5785     @@@test:domTree:
5786     document {
5787     xml-version: '1.0';
5788     xml-encoding: null;
5789     xml-standalone: false;
5790     element { }
5791     }
5792     @@XMLTest:
5793     @@@QName: xp.xmldecl.version.1.1.test
5794     @@@DEnt:
5795     @@@@test:value:
5796     <?xml version="1.1"?>
5797     <p></p>
5798     @@@test:domTree:
5799     document {
5800     xml-version: '1.1';
5801     xml-encoding: null;
5802     xml-standalone: false;
5803     element { }
5804     }
5805    
5806     @@XMLTest:
5807     @@@QName: xp.xmldecl.version.1.0.encoding.usascii.test
5808     @@@DEnt:
5809     @@@@test:value:
5810     <?xml version="1.0" encoding="US-ascii"?>
5811     <p></p>
5812     @@@test:domTree:
5813     document {
5814     xml-version: '1.0';
5815     xml-encoding: 'US-ascii';
5816     xml-standalone: false;
5817     element { }
5818     }
5819     @@XMLTest:
5820     @@@QName: xp.xmldecl.version.1.0.encoding.usascii.lita.test
5821     @@@DEnt:
5822     @@@@test:value:
5823     <?xml version="1.0" encoding='US-ascii'?>
5824     <p></p>
5825     @@@test:domTree:
5826     document {
5827     xml-version: '1.0';
5828     xml-encoding: 'US-ascii';
5829     xml-standalone: false;
5830     element { }
5831     }
5832     @@XMLTest:
5833     @@@QName: xp.xmldecl.version.1.0.encoding.usascii.s.test
5834     @@@DEnt:
5835     @@@@test:value:
5836     <?xml version="1.0" encoding = "US-ascii" ?>
5837     <p></p>
5838     @@@test:domTree:
5839     document {
5840     xml-version: '1.0';
5841     xml-encoding: 'US-ascii';
5842     xml-standalone: false;
5843     element { }
5844     }
5845    
5846     @@XMLTest:
5847     @@@QName: xp.xmldecl.version.1.0.encoding.usascii.standalone.yes.test
5848     @@@DEnt:
5849     @@@@test:value:
5850     <?xml version="1.0" encoding="us-ascii" standalone="yes"?>
5851     <p></p>
5852     @@@test:domTree:
5853     document {
5854     xml-version: '1.0';
5855     xml-encoding: 'us-ascii';
5856     xml-standalone: true;
5857     element { }
5858     }
5859     @@XMLTest:
5860     @@@QName: xp.xmldecl.version.1.0.encoding.usascii.standalone.no.test
5861     @@@DEnt:
5862     @@@@test:value:
5863     <?xml version="1.0" encoding="us-ascii" standalone="no"?>
5864     <p></p>
5865     @@@test:domTree:
5866     document {
5867     xml-version: '1.0';
5868     xml-encoding: 'us-ascii';
5869     xml-standalone: false;
5870     element { }
5871     }
5872     @@XMLTest:
5873     @@@QName: xp.xmldecl.version.1.0.encoding.usascii.standalone.yes.lita.test
5874     @@@DEnt:
5875     @@@@test:value:
5876     <?xml version="1.0" encoding="us-ascii" standalone='yes'?>
5877     <p></p>
5878     @@@test:domTree:
5879     document {
5880     xml-version: '1.0';
5881     xml-encoding: 'us-ascii';
5882     xml-standalone: true;
5883     element { }
5884     }
5885     @@XMLTest:
5886     @@@QName: xp.xmldecl.version.1.0.encoding.usascii.standalone.yes.s.test
5887     @@@DEnt:
5888     @@@@test:value:
5889     <?xml version="1.0" encoding="us-ascii" standalone = "yes" ?>
5890     <p></p>
5891     @@@test:domTree:
5892     document {
5893     xml-version: '1.0';
5894     xml-encoding: 'us-ascii';
5895     xml-standalone: true;
5896     element { }
5897     }
5898 wakaba 1.14 @@XMLTest:
5899     @@@QName: xp.xmldecl.no.encoding.but.standalone.attr.test
5900     @@@DEnt:
5901     @@@@test:value:
5902     <?xml version="1.0" standalone="yes"?>
5903     <p></p>
5904     @@@test:domTree:
5905     document {
5906     xml-version: '1.0';
5907     xml-encoding: null;
5908     xml-standalone: true;
5909     element { }
5910     }
5911     @@XMLTest:
5912     @@@QName: xp.xmldecl.encoding.encname.test
5913     @@@DEnt:
5914     @@@@test:value:
5915     <?xml version="1.0" encoding="a-._01-"?>
5916     <p></p>
5917     @@@test:domTree:
5918     document {
5919     xml-version: '1.0';
5920     xml-encoding: 'a-._01-';
5921     xml-standalone: false;
5922     element { }
5923     }
5924    
5925     @@XMLTest:
5926     @@@QName: xp.xmldecl.no.s.no.attr.test
5927     @@@DEnt:
5928     @@@@test:value:
5929     <?xml?>
5930     <p></p>
5931     @@@c:erred:
5932 wakaba 1.16 <[[xp:wf-syntax-error]]> { (1, 1)..(1, 7); }
5933 wakaba 1.14 @@XMLTest:
5934     @@@QName: xp.xmldecl.s.no.attr.test
5935     @@@DEnt:
5936     @@@@test:value:
5937     <?xml ?>
5938     <p></p>
5939     @@@c:erred:
5940     <[[xp:wf-syntax-error]]> { (1, 8)..(1, 9); }
5941     @@XMLTest:
5942     @@@QName: xp.xmldecl.unknown.attr.test
5943     @@@DEnt:
5944     @@@@test:value:
5945     <?xml unknown="value"?>
5946     <p></p>
5947     @@@c:erred:
5948     <[[xp:wf-syntax-error]]> { (1, 8)..(1, 22); }
5949     @@XMLTest:
5950     @@@QName: xp.xmldecl.version.unknown.attr.test
5951     @@@DEnt:
5952     @@@@test:value:
5953     <?xml version="1.0" unknown="value"?>
5954     <p></p>
5955     @@@c:erred:
5956     <[[xp:wf-syntax-error]]> { (1, 21)..(1, 35); }
5957     @@XMLTest:
5958     @@@QName: xp.xmldecl.version.encoding.unknown.attr.test
5959     @@@DEnt:
5960     @@@@test:value:
5961     <?xml version="1.0" encoding="us-ascii" unknown="value"?>
5962     <p></p>
5963     @@@c:erred:
5964     <[[xp:wf-syntax-error]]> { (1, 41)..(1, 55); }
5965     @@XMLTest:
5966     @@@QName: xp.xmldecl.version.encoding.standalone.unknown.attr.test
5967     @@@DEnt:
5968     @@@@test:value:
5969     <?xml version="1.0" encoding="us-ascii" standalone="yes"
5970     unknown="value"?>
5971     <p></p>
5972     @@@c:erred:
5973     <[[xp:wf-syntax-error]]> { (2, 1)..(2, 15); }
5974     @@XMLTest:
5975     @@@QName: xp.xmldecl.no.version.but.encoding.attr.test
5976     @@@DEnt:
5977     @@@@test:value:
5978     <?xml encoding="us-ascii"?>
5979     <p></p>
5980     @@@c:erred:
5981     <[[xp:wf-syntax-error]]> { (1, 7)..(1, 25); }
5982     @@XMLTest:
5983     @@@QName: xp.xmldecl.no.version.but.standalone.attr.test
5984     @@@DEnt:
5985     @@@@test:value:
5986     <?xml standalone="yes"?>
5987     <p></p>
5988     @@@c:erred:
5989     <[[xp:wf-syntax-error]]> { (1, 7)..(1, 24); }
5990     @@XMLTest:
5991     @@@QName: xp.xmldecl.version.unsupported.test
5992     @@@DEnt:
5993     @@@@test:value:
5994     <?xml version="1.2"?>
5995     <p></p>
5996     @@@c:erred:
5997     <[[xp:wf-unsupported-xml-version]]> { (1, 7)..(1, 19); }
5998     @@XMLTest:
5999     @@@QName: xp.xmldecl.version.unsupported.2.test
6000     @@@DEnt:
6001     @@@@test:value:
6002     <?xml version=" 1.0 "?>
6003     <p></p>
6004     @@@c:erred:
6005     <[[xp:wf-unsupported-xml-version]]> { (1, 7)..(1, 21); }
6006     @@XMLTest:
6007     @@@QName: xp.xmldecl.version.unsupported.3.test
6008     @@@DEnt:
6009     @@@@test:value:
6010     <?xml version="01.00"?>
6011     <p></p>
6012     @@@c:erred:
6013     <[[xp:wf-unsupported-xml-version]]> { (1, 7)..(1, 21); }
6014     @@XMLTest:
6015     @@@QName: xp.xmldecl.encoding.malformed.1.test
6016     @@@DEnt:
6017     @@@@test:value:
6018     <?xml version="1.0" encoding="0088"?>
6019     <p></p>
6020     @@@c:erred:
6021     <[[xp:wf-malformed-enc-name]]> { (1, 21)..(1, 35); }
6022     @@XMLTest:
6023     @@@QName: xp.xmldecl.encoding.malformed.2.test
6024     @@@DEnt:
6025     @@@@test:value:
6026     <?xml version="1.0" encoding="D.V.D!"?>
6027     <p></p>
6028     @@@c:erred:
6029     <[[xp:wf-malformed-enc-name]]> { (1, 21)..(1, 38); }
6030     @@XMLTest:
6031     @@@QName: xp.xmldecl.standalone.malformed.1.test
6032     @@@DEnt:
6033     @@@@test:value:
6034     <?xml version="1.0" standalone="true"?>
6035     <p></p>
6036     @@@c:erred:
6037     <[[xp:wf-malformed-xml-standalone]]> { (1, 21)..(1, 38); }
6038     @@XMLTest:
6039     @@@QName: xp.xmldecl.standalone.malformed.2.test
6040     @@@DEnt:
6041     @@@@test:value:
6042     <?xml version="1.0" standalone="YES"?>
6043     <p></p>
6044     @@@c:erred:
6045     <[[xp:wf-malformed-xml-standalone]]> { (1, 21)..(1, 37); }
6046     @@XMLTest:
6047     @@@QName: xp.xmldecl.standalone.malformed.3.test
6048     @@@DEnt:
6049     @@@@test:value:
6050     <?xml version="1.0" standalone="no "?>
6051     <p></p>
6052     @@@c:erred:
6053     <[[xp:wf-malformed-xml-standalone]]> { (1, 21)..(1, 38); }
6054 wakaba 1.6
6055     @@XMLTest:
6056 wakaba 1.14 @@@QName: xp.no-xmldecl.xml...-pi.test
6057     @@@DEnt:
6058     @@@@test:value:
6059     <?xmldeclaration?>
6060     <a></a>
6061     @@@test:domTree:
6062     document {
6063     pi {
6064     node-name: 'xmldeclaration';
6065     node-value: '';
6066     }
6067     element { }
6068     }
6069     @@XMLTest:
6070     @@@QName: xp.no-xmldecl.xml...-pi.after.document.element.test
6071     @@@DEnt:
6072     @@@@test:value:
6073     <a></a>
6074     <?xmldeclaration?>
6075     @@@test:domTree:
6076     document {
6077     element { }
6078     pi {
6079     node-name: 'xmldeclaration';
6080     node-value: '';
6081     }
6082     }
6083     @@XMLTest:
6084     @@@QName: xp.no-xmldecl.xml...-pi.in.document.element.test
6085     @@@DEnt:
6086     @@@@test:value:
6087     <a>
6088     <?xmldeclaration?>
6089     </a>
6090     @@@test:domTree:
6091     document {
6092     element {
6093     text { }
6094     pi {
6095     node-name: 'xmldeclaration';
6096     node-value: '';
6097     }
6098     text { }
6099     }
6100     }
6101     @@XMLTest:
6102     @@@QName: xp.no-xmldecl.xml...-pi.in.doctype.test
6103     @@@DEnt:
6104     @@@@test:value:
6105     <!DOCTYPE a [
6106     <?xmldeclaration?>
6107     ]>
6108     <a></a>
6109     @@@test:domTree:
6110     document {
6111     document-type {
6112     pi {
6113     node-name: 'xmldeclaration';
6114     node-value: '';
6115     }
6116     }
6117     element { }
6118     }
6119    
6120     @@XMLTest:
6121     @@@QName: xp.XMLdecl.test
6122     @@@DEnt:
6123     @@@@test:value:
6124     <?XML version="1.0"?>
6125     <p></p>
6126     @@@c:erred:
6127     <[[xp:wf-pi-target-is-xml]]> { (1, 1)..(1, 5); }
6128     @@XMLTest:
6129     @@@QName: xp.Xmldecl.test
6130     @@@DEnt:
6131     @@@@test:value:
6132     <?Xml version="1.0"?>
6133     <p></p>
6134     @@@c:erred:
6135     <[[xp:wf-pi-target-is-xml]]> { (1, 1)..(1, 5); }
6136     @@XMLTest:
6137     @@@QName: xp.xmldecl.after.document.element.empty.test
6138     @@@DEnt:
6139     @@@@test:value:
6140     <p></p>
6141     <?xml?>
6142     @@@c:erred:
6143     <[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); }
6144     @@XMLTest:
6145     @@@QName: xp.xmldecl.after.document.element.test
6146     @@@DEnt:
6147     @@@@test:value:
6148     <p></p>
6149     <?xml version="1.0"?>
6150     @@@c:erred:
6151     <[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); }
6152     @@XMLTest:
6153     @@@QName: xp.xmldecl.in.element.empty.test
6154     @@@DEnt:
6155     @@@@test:value:
6156     <p>
6157     <?xml?>
6158     </p>
6159     @@@c:erred:
6160     <[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); }
6161     @@XMLTest:
6162     @@@QName: xp.xmldecl.in.element.test
6163     @@@DEnt:
6164     @@@@test:value:
6165     <p>
6166     <?xml version="1.0"?>
6167     </p>
6168     @@@c:erred:
6169     <[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); }
6170     @@XMLTest:
6171     @@@QName: xp.xmldecl.after.comment.test
6172     @@@DEnt:
6173     @@@@test:value:
6174     <!---->
6175     <?xml version="1.0"?>
6176     <p></p>
6177     @@@c:erred:
6178     <[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); }
6179     @@XMLTest:
6180     @@@QName: xp.xmldecl.after.comment.empty.test
6181     @@@DEnt:
6182     @@@@test:value:
6183     <!---->
6184     <?xml?>
6185     <p></p>
6186     @@@c:erred:
6187     <[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); }
6188     @@XMLTest:
6189     @@@QName: xp.xmldecl.after.pi.test
6190     @@@DEnt:
6191     @@@@test:value:
6192     <?xml-declaration?>
6193     <?xml version="1.0"?>
6194     <p></p>
6195     @@@c:erred:
6196     <[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); }
6197     @@XMLTest:
6198     @@@QName: xp.xmldecl.after.pi.empty.test
6199     @@@DEnt:
6200     @@@@test:value:
6201     <?xml-declaration?>
6202     <?xml?>
6203     <p></p>
6204     @@@c:erred:
6205     <[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); }
6206     @@XMLTest:
6207 wakaba 1.16 @@@QName: xp.xmldecl.after.pi.2.test
6208     @@@DEnt:
6209     @@@@test:value:
6210     <?declaration?>
6211     <?xml version="1.0"?>
6212     <p></p>
6213     @@@c:erred:
6214     <[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); }
6215     @@XMLTest:
6216     @@@QName: xp.xmldecl.after.pi.empty.2.test
6217     @@@DEnt:
6218     @@@@test:value:
6219     <?declaration?>
6220     <?xml?>
6221     <p></p>
6222     @@@c:erred:
6223     <[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); }
6224     @@XMLTest:
6225 wakaba 1.14 @@@QName: xp.xmldecl.after.doctype.test
6226     @@@DEnt:
6227     @@@@test:value:
6228     <!DOCTYPE a>
6229     <?xml version="1.0"?>
6230     <p></p>
6231     @@@c:erred:
6232     <[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); }
6233     @@XMLTest:
6234     @@@QName: xp.xmldecl.after.doctype.empty.test
6235     @@@DEnt:
6236     @@@@test:value:
6237     <!DOCTYPE a>
6238     <?xml?>
6239     <p></p>
6240     @@@c:erred:
6241     <[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); }
6242     @@XMLTest:
6243     @@@QName: xp.xmldecl.in.doctype.test
6244     @@@DEnt:
6245     @@@@test:value:
6246     <!DOCTYPE a [
6247     <?xml version="1.0"?>
6248     ]>
6249     <p></p>
6250     @@@c:erred:
6251     <[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); }
6252     @@XMLTest:
6253     @@@QName: xp.xmldecl.in.doctype.empty.test
6254     @@@DEnt:
6255     @@@@test:value:
6256     <!DOCTYPE a [
6257     <?xml?>
6258     ]>
6259     <p></p>
6260     @@@c:erred:
6261     <[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); }
6262    
6263     @@XMLTest:
6264     @@@QName: xp.pi.before.element.empty.test
6265     @@@DEnt:
6266     @@@@test:value:
6267     <?target?>
6268     <a></a>
6269     @@@test:domTree:
6270     document {
6271     pi {
6272     node-name: 'target';
6273     node-value: '';
6274     }
6275     element { }
6276     }
6277     @@XMLTest:
6278     @@@QName: xp.pi.before.element.s.test
6279     @@@DEnt:
6280     @@@@test:value:
6281     <?target ?>
6282     <a></a>
6283     @@@test:domTree:
6284     document {
6285     pi {
6286     node-name: 'target';
6287     node-value: '';
6288     }
6289     element { }
6290     }
6291     @@XMLTest:
6292     @@@QName: xp.pi.before.element.string.test
6293     @@@DEnt:
6294     @@@@test:value:
6295     <?target string?>
6296     <a></a>
6297     @@@test:domTree:
6298     document {
6299     pi {
6300     node-name: 'target';
6301     node-value: 'string';
6302     }
6303     element { }
6304     }
6305     @@XMLTest:
6306     @@@QName: xp.pi.before.element.string.s.test
6307     @@@DEnt:
6308     @@@@test:value:
6309     <?target string ?>
6310     <a></a>
6311     @@@test:domTree:
6312     document {
6313     pi {
6314     node-name: 'target';
6315     node-value: 'string ';
6316     }
6317     element { }
6318     }
6319     @@XMLTest:
6320     @@@QName: xp.pi.before.element.gt.test
6321     @@@DEnt:
6322     @@@@test:value:
6323     <?target string>string?>
6324     <a></a>
6325     @@@test:domTree:
6326     document {
6327     pi {
6328     node-name: 'target';
6329     node-value: 'string>string';
6330     }
6331     element { }
6332     }
6333     @@XMLTest:
6334     @@@QName: xp.pi.doctype.empty.test
6335     @@@DEnt:
6336     @@@@test:value:
6337     <!DOCTYPE a [
6338     <?target?>
6339     ]>
6340     <a></a>
6341     @@@test:domTree:
6342     document {
6343     document-type {
6344     pi {
6345     node-name: 'target';
6346     node-value: '';
6347     }
6348     }
6349     element { }
6350     }
6351    
6352     @@XMLTest:
6353     @@@QName: xp.pi.no.target.test
6354     @@@DEnt:
6355     @@@@test:value:
6356     <??>
6357     <p></p>
6358     @@@c:erred:
6359     <[[xp:wf-syntax-error]]> { (1, 3)..(1, 4); }
6360     @@XMLTest:
6361     @@@QName: xp.pi.no.target.2.test
6362     @@@DEnt:
6363     @@@@test:value:
6364     <? ?>
6365     <p></p>
6366     @@@c:erred:
6367     <[[xp:wf-syntax-error]]> { (1, 3)..(1, 4); }
6368     @@XMLTest:
6369     @@@QName: xp.pi.bad.target.1.test
6370     @@@DEnt:
6371     @@@@test:value:
6372     <?target! ?>
6373     <p></p>
6374     @@@c:erred:
6375     <[[xp:wf-syntax-error]]> { (1, 9)..(1, 9); }
6376     @@XMLTest:
6377     @@@QName: xp.pi.bad.target.2.test
6378     @@@DEnt:
6379     @@@@test:value:
6380     <?0target ?>
6381     <p></p>
6382     @@@c:erred:
6383     <[[xp:wf-syntax-error]]> { (1, 3)..(1, 3); }
6384    
6385     @@XMLTest:
6386 wakaba 1.15 @@@QName: xp.cdatasection.empty.1.test
6387     @@@DEnt:
6388     @@@@test:value:
6389     <p><![CDATA[]]></p>
6390     @@@test:domTree:
6391     document {
6392     element {
6393     cdata-section {
6394     data: '';
6395     }
6396     }
6397     }
6398     @@XMLTest:
6399     @@@QName: xp.cdatasection.empty.2.test
6400     @@@DEnt:
6401     @@@@test:value:
6402     <p>aa<![CDATA[]]>bb</p>
6403     @@@test:domTree:
6404     document {
6405     element {
6406     text { data: 'aa'; }
6407     cdata-section {
6408     data: '';
6409     }
6410     text { data: 'bb'; }
6411     }
6412     }
6413     @@XMLTest:
6414     @@@QName: xp.cdatasection.1.test
6415     @@@DEnt:
6416     @@@@test:value:
6417     <p><![CDATA[abcdefg]]></p>
6418     @@@test:domTree:
6419     document {
6420     element {
6421     cdata-section {
6422     data: 'abcdefg';
6423     }
6424     }
6425     }
6426     @@XMLTest:
6427     @@@QName: xp.cdatasection.2.test
6428     @@@DEnt:
6429     @@@@test:value:
6430     <p>aa<![CDATA[abcdefg]]>bb</p>
6431     @@@test:domTree:
6432     document {
6433     element {
6434     text { data: 'aa'; }
6435     cdata-section {
6436     data: 'abcdefg';
6437     }
6438     text { data: 'bb'; }
6439     }
6440     }
6441     @@XMLTest:
6442     @@@QName: xp.cdatasection.ref.1.test
6443     @@@DEnt:
6444     @@@@test:value:
6445     <p><![CDATA[a&amp;&#x32;&#32;%abc;&def;]]&gt;b]]></p>
6446     @@@test:domTree:
6447     document {
6448     element {
6449     cdata-section {
6450     data: 'a&amp;&#x32;&#32;%abc;&def;]]&gt;b';
6451     }
6452     }
6453     }
6454     @@XMLTest:
6455     @@@QName: xp.cdatasection.in.general.entity.test
6456     @@@DEnt:
6457     @@@@test:value:
6458     <!DOCTYPE p [
6459     <!ENTITY cdata "<![CDATA[text]]>">
6460     ]>
6461     <p>&cdata;</p>
6462     @@@test:domTree:
6463     document {
6464     document-type {
6465     general-entity {
6466     node-name: 'cdata';
6467     cdata-section {
6468     data: 'text';
6469     }
6470     }
6471     }
6472     element {
6473     general-entity-reference {
6474 wakaba 1.23 node-name: 'cdata';
6475 wakaba 1.19 is-expanded: true;
6476 wakaba 1.15 cdata-section {
6477     data: 'text';
6478     }
6479     }
6480     }
6481     }
6482     @@XMLTest:
6483     @@@QName: xp.cdatasection.no.mse.test
6484     @@@DEnt:
6485     @@@@test:value:
6486     <p><![CDATA[text</p>
6487     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 21); }
6488     @@XMLTest:
6489     @@@QName: xp.cdatasection.nest.test
6490     @@@DEnt:
6491     @@@@test:value:
6492     <p><![CDATA[text01<![CDATA[txt2]]>text3]]></p>
6493     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 40)..(1, 42); }
6494    
6495     @@XMLTest:
6496 wakaba 1.6 @@@QName: xp.doctype.empty.test
6497     @@@DEnt:
6498     @@@@test:value:
6499     <!DOCTYPE a>
6500     <a></a>
6501     @@@test:domTree:
6502     document {
6503     xml-version: '1.0';
6504     xml-encoding: null;
6505     xml-standalone: false;
6506     document-type {
6507     node-name: 'a';
6508 wakaba 1.17 public-id: null;
6509     system-id: null;
6510 wakaba 1.6 }
6511     element {
6512     namespace-uri: null;
6513     prefix: null;
6514     local-name: 'a';
6515     text-content: '';
6516     }
6517     }
6518 wakaba 1.15 @@XMLTest:
6519     @@@QName: xp.doctype.empty.after.document.element.test
6520     @@@DEnt:
6521     @@@@test:value:
6522     <a></a>
6523     <!DOCTYPE a>
6524     @@@c:erred: <[[xp|wf-syntax-error]]> { (2, 1)..(2, 12); }
6525     @@XMLTest:
6526     @@@QName: xp.doctype.empty.in.element.test
6527     @@@DEnt:
6528     @@@@test:value:
6529     <a>
6530     <!DOCTYPE a>
6531     </a>
6532     @@@c:erred: <[[xp|wf-syntax-error]]> { (2, 1)..(2, 12); }
6533     @@XMLTest:
6534     @@@QName: xp.doctype.empty.dup.test
6535     @@@DEnt:
6536     @@@@test:value:
6537     <!DOCTYPE a>
6538     <!DOCTYPE a>
6539     <a></a>
6540     @@@c:erred: <[[xp|wf-syntax-error]]> { (2, 1)..(2, 12); }
6541     @@XMLTest:
6542     @@@QName: xp.doctype.empty.in.intsubset.test
6543     @@@DEnt:
6544     @@@@test:value:
6545     <!DOCTYPE a [
6546     <!DOCTYPE a>
6547     ]>
6548     <a></a>
6549     @@@c:erred: <[[xp|wf-syntax-error]]> { (2, 1)..(2, 12); }
6550 wakaba 1.16 @@XMLTest:
6551     @@@QName: xp.doctype.no.s.no.name.test
6552     @@@DEnt:
6553     @@@@test:value:
6554     <!DOCTYPE>
6555     <a></a>
6556     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 10); }
6557     @@XMLTest:
6558     @@@QName: xp.doctype.no.name.test
6559     @@@DEnt:
6560     @@@@test:value:
6561     <!DOCTYPE >
6562     <a></a>
6563     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 11); }
6564     @@XMLTest:
6565     @@@QName: xp.doctype.name.s.test
6566     @@@DEnt:
6567     @@@@test:value:
6568     <!DOCTYPE aa >
6569     <aa></aa>
6570     @@@test:domTree:
6571     document {
6572     document-type {
6573     node-name: 'aa';
6574 wakaba 1.17 public-id: null;
6575     system-id: null;
6576 wakaba 1.16 }
6577     element { }
6578     }
6579     @@XMLTest:
6580     @@@QName: xp.doctype.no.mdc.test
6581     @@@DEnt:
6582     @@@@test:value:
6583     <!DOCTYPE aa
6584     <aa></aa>
6585     @@@c:erred: <[[xp|wf-syntax-error]]> { (2, 1); }
6586 wakaba 1.6
6587     @@XMLTest:
6588 wakaba 1.16 @@@QName: xp.doctype.intsubset.empty.1.test
6589 wakaba 1.6 @@@DEnt:
6590     @@@@test:value:
6591 wakaba 1.16 <!DOCTYPE a []>
6592 wakaba 1.6 <a></a>
6593     @@@test:domTree:
6594     document {
6595     xml-version: '1.0';
6596     xml-encoding: null;
6597     xml-standalone: false;
6598     document-type {
6599     node-name: 'a';
6600 wakaba 1.17 public-id: null;
6601     system-id: null;
6602 wakaba 1.6 }
6603     element {
6604     namespace-uri: null;
6605     prefix: null;
6606     local-name: 'a';
6607     text-content: '';
6608     }
6609     }
6610     @@XMLTest:
6611 wakaba 1.16 @@@QName: xp.doctype.intsubset.empty.2.test
6612 wakaba 1.6 @@@DEnt:
6613     @@@@test:value:
6614     <!DOCTYPE a [
6615 wakaba 1.16
6616 wakaba 1.6 ]>
6617     <a></a>
6618     @@@test:domTree:
6619     document {
6620     xml-version: '1.0';
6621     xml-encoding: null;
6622     xml-standalone: false;
6623     document-type {
6624     node-name: 'a';
6625 wakaba 1.17 public-id: null;
6626     system-id: null;
6627 wakaba 1.6 }
6628     element {
6629     namespace-uri: null;
6630     prefix: null;
6631     local-name: 'a';
6632     text-content: '';
6633     }
6634     }
6635     @@XMLTest:
6636 wakaba 1.16 @@@QName: xp.doctype.intsubset.empty.3.test
6637 wakaba 1.6 @@@DEnt:
6638     @@@@test:value:
6639 wakaba 1.16 <!DOCTYPE a[]>
6640 wakaba 1.6 <a></a>
6641     @@@test:domTree:
6642     document {
6643     document-type {
6644     node-name: 'a';
6645 wakaba 1.17 public-id: null;
6646     system-id: null;
6647 wakaba 1.6 }
6648 wakaba 1.16 element { }
6649     }
6650     @@XMLTest:
6651     @@@QName: xp.doctype.intsubset.empty.4.test
6652     @@@DEnt:
6653     @@@@test:value:
6654     <!DOCTYPE a[] >
6655     <a></a>
6656     @@@test:domTree:
6657     document {
6658     document-type {
6659     node-name: 'a';
6660 wakaba 1.17 public-id: null;
6661     system-id: null;
6662 wakaba 1.6 }
6663 wakaba 1.16 element { }
6664 wakaba 1.6 }
6665     @@XMLTest:
6666 wakaba 1.16 @@@QName: xp.doctype.intsubset.no.dsc.1.test
6667     @@@DEnt:
6668     @@@@test:value:
6669     <!DOCTYPE a [>
6670     <a></a>
6671     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 14); }
6672     @@XMLTest:
6673     @@@QName: xp.doctype.intsubset.no.dsc.2.test
6674 wakaba 1.6 @@@DEnt:
6675     @@@@test:value:
6676     <!DOCTYPE a [
6677     <a></a>
6678 wakaba 1.16 @@@c:erred: <[[xp|wf-syntax-error]]> { (2, 1); }
6679     @@XMLTest:
6680     @@@QName: xp.doctype.intsubset.no.dsc.3.test
6681     @@@DEnt:
6682     @@@@test:value:
6683     <!DOCTYPE a [
6684     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 14); }
6685     @@XMLTest:
6686     @@@QName: xp.doctype.intsubset.no.mdc.1.test
6687     @@@DEnt:
6688     @@@@test:value:
6689     <!DOCTYPE a []
6690     <a/>
6691     @@@c:erred: <[[xp|wf-syntax-error]]> { (2, 1); }
6692     @@XMLTest:
6693     @@@QName: xp.doctype.intsubset.no.mdc.2.test
6694     @@@DEnt:
6695     @@@@test:value:
6696     <!DOCTYPE a []]>
6697     <a/>
6698     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 15); }
6699 wakaba 1.17 @@XMLTest:
6700     @@@QName: xp.doctype.pubid.sysid.1.test
6701     @@@DEnt:
6702     @@@@test:value:
6703     <!DOCTYPE a PUBLIC "pubid" "sysid">
6704     <a/>
6705     @@@test:domTree:
6706     document {
6707     document-type {
6708     node-name: 'a';
6709     public-id: 'pubid';
6710     system-id: 'sysid';
6711     }
6712     element { }
6713     }
6714     @@XMLTest:
6715     @@@QName: xp.doctype.pubid.sysid.2.test
6716     @@@DEnt:
6717     @@@@test:value:
6718     <!DOCTYPE a PUBLIC 'pubid' "sysid">
6719     <a/>
6720     @@@test:domTree:
6721     document {
6722     document-type {
6723     node-name: 'a';
6724     public-id: 'pubid';
6725     system-id: 'sysid';
6726     }
6727     element { }
6728     }
6729     @@XMLTest:
6730     @@@QName: xp.doctype.pubid.sysid.3.test
6731     @@@DEnt:
6732     @@@@test:value:
6733     <!DOCTYPE a PUBLIC "pubid" 'sysid'>
6734     <a/>
6735     @@@test:domTree:
6736     document {
6737     document-type {
6738     node-name: 'a';
6739     public-id: 'pubid';
6740     system-id: 'sysid';
6741     }
6742     element { }
6743     }
6744     @@XMLTest:
6745     @@@QName: xp.doctype.pubid.sysid.4.test
6746     @@@DEnt:
6747     @@@@test:value:
6748     <!DOCTYPE a PUBLIC 'pubid' 'sysid'>
6749     <a/>
6750     @@@test:domTree:
6751     document {
6752     document-type {
6753     node-name: 'a';
6754     public-id: 'pubid';
6755     system-id: 'sysid';
6756     }
6757     element { }
6758     }
6759     @@XMLTest:
6760     @@@QName: xp.doctype.pubid.sysid.5.test
6761     @@@DEnt:
6762     @@@@test:value:
6763     <!DOCTYPE a PUBLIC "pubid" "sysid" >
6764     <a/>
6765     @@@test:domTree:
6766     document {
6767     document-type {
6768     node-name: 'a';
6769     public-id: 'pubid';
6770     system-id: 'sysid';
6771     }
6772     element { }
6773     }
6774     @@XMLTest:
6775     @@@QName: xp.doctype.pubid.sysid.6.test
6776     @@@DEnt:
6777     @@@@test:value:
6778     <!DOCTYPE a PUBLIC 'pubid' 'sysid' >
6779     <a/>
6780     @@@test:domTree:
6781     document {
6782     document-type {
6783     node-name: 'a';
6784     public-id: 'pubid';
6785     system-id: 'sysid';
6786     }
6787     element { }
6788     }
6789     @@XMLTest:
6790     @@@QName: xp.doctype.pubid.sysid.intsubset.1.test
6791     @@@DEnt:
6792     @@@@test:value:
6793     <!DOCTYPE a PUBLIC "pubid" "sysid"[]>
6794     <a/>
6795     @@@test:domTree:
6796     document {
6797     document-type {
6798     node-name: 'a';
6799     public-id: 'pubid';
6800     system-id: 'sysid';
6801     }
6802     element { }
6803     }
6804     @@XMLTest:
6805     @@@QName: xp.doctype.pubid.sysid.intsubset.2.test
6806     @@@DEnt:
6807     @@@@test:value:
6808     <!DOCTYPE a PUBLIC "pubid" "sysid" []>
6809     <a/>
6810     @@@test:domTree:
6811     document {
6812     document-type {
6813     node-name: 'a';
6814     public-id: 'pubid';
6815     system-id: 'sysid';
6816     }
6817     element { }
6818     }
6819     @@XMLTest:
6820     @@@QName: xp.doctype.pubid.sysid.intsubset.3.test
6821     @@@DEnt:
6822     @@@@test:value:
6823     <!DOCTYPE a PUBLIC 'pubid' 'sysid'[]>
6824     <a/>
6825     @@@test:domTree:
6826     document {
6827     document-type {
6828     node-name: 'a';
6829     public-id: 'pubid';
6830     system-id: 'sysid';
6831     }
6832     element { }
6833     }
6834     @@XMLTest:
6835     @@@QName: xp.doctype.pubid.sysid.intsubset.4.test
6836     @@@DEnt:
6837     @@@@test:value:
6838     <!DOCTYPE a PUBLIC 'pubid' 'sysid' []>
6839     <a/>
6840     @@@test:domTree:
6841     document {
6842     document-type {
6843     node-name: 'a';
6844     public-id: 'pubid';
6845     system-id: 'sysid';
6846     }
6847     element { }
6848     }
6849     @@XMLTest:
6850     @@@QName: xp.doctype.sysid.1.test
6851     @@@DEnt:
6852     @@@@test:value:
6853     <!DOCTYPE a SYSTEM "sysid">
6854     <a/>
6855     @@@test:domTree:
6856     document {
6857     document-type {
6858     node-name: 'a';
6859     public-id: null;
6860     system-id: 'sysid';
6861     }
6862     element { }
6863     }
6864     @@XMLTest:
6865     @@@QName: xp.doctype.sysid.2.test
6866     @@@DEnt:
6867     @@@@test:value:
6868     <!DOCTYPE a SYSTEM 'sysid'>
6869     <a/>
6870     @@@test:domTree:
6871     document {
6872     document-type {
6873     node-name: 'a';
6874     public-id: null;
6875     system-id: 'sysid';
6876     }
6877     element { }
6878     }
6879     @@XMLTest:
6880     @@@QName: xp.doctype.sysid.3.test
6881     @@@DEnt:
6882     @@@@test:value:
6883     <!DOCTYPE a SYSTEM "sysid" >
6884     <a/>
6885     @@@test:domTree:
6886     document {
6887     document-type {
6888     node-name: 'a';
6889     public-id: null;
6890     system-id: 'sysid';
6891     }
6892     element { }
6893     }
6894     @@XMLTest:
6895     @@@QName: xp.doctype.sysid.4.test
6896     @@@DEnt:
6897     @@@@test:value:
6898     <!DOCTYPE a SYSTEM 'sysid' >
6899     <a/>
6900     @@@test:domTree:
6901     document {
6902     document-type {
6903     node-name: 'a';
6904     public-id: null;
6905     system-id: 'sysid';
6906     }
6907     element { }
6908     }
6909     @@XMLTest:
6910     @@@QName: xp.doctype.sysid.intsubset.1.test
6911     @@@DEnt:
6912     @@@@test:value:
6913     <!DOCTYPE a SYSTEM "sysid"[]>
6914     <a/>
6915     @@@test:domTree:
6916     document {
6917     document-type {
6918     node-name: 'a';
6919     public-id: null;
6920     system-id: 'sysid';
6921     }
6922     element { }
6923     }
6924     @@XMLTest:
6925     @@@QName: xp.doctype.sysid.intsubset.2.test
6926     @@@DEnt:
6927     @@@@test:value:
6928     <!DOCTYPE a SYSTEM "sysid" []>
6929     <a/>
6930     @@@test:domTree:
6931     document {
6932     document-type {
6933     node-name: 'a';
6934     public-id: null;
6935     system-id: 'sysid';
6936     }
6937     element { }
6938     }
6939     @@XMLTest:
6940     @@@QName: xp.doctype.sysid.intsubset.3.test
6941     @@@DEnt:
6942     @@@@test:value:
6943     <!DOCTYPE a SYSTEM 'sysid'[]>
6944     <a/>
6945     @@@test:domTree:
6946     document {
6947     document-type {
6948     node-name: 'a';
6949     public-id: null;
6950     system-id: 'sysid';
6951     }
6952     element { }
6953     }
6954     @@XMLTest:
6955     @@@QName: xp.doctype.sysid.intsubset.4.test
6956     @@@DEnt:
6957     @@@@test:value:
6958     <!DOCTYPE a SYSTEM 'sysid' []>
6959     <a/>
6960     @@@test:domTree:
6961     document {
6962     document-type {
6963     node-name: 'a';
6964     public-id: null;
6965     system-id: 'sysid';
6966     }
6967     element { }
6968     }
6969     @@XMLTest:
6970     @@@QName: xp.doctype.public.stago.test
6971     @@@DEnt:
6972     @@@@test:value:
6973     <!DOCTYPE a PUBLIC<a/>
6974     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 19); }
6975     @@XMLTest:
6976     @@@QName: xp.doctype.public.mdc.test
6977     @@@DEnt:
6978     @@@@test:value:
6979     <!DOCTYPE a PUBLIC>
6980     <a/>
6981     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 19); }
6982     @@XMLTest:
6983     @@@QName: xp.doctype.public.s.stago.test
6984     @@@DEnt:
6985     @@@@test:value:
6986     <!DOCTYPE a PUBLIC <a/>
6987     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 20); }
6988     @@XMLTest:
6989     @@@QName: xp.doctype.public.s.mdc.test
6990     @@@DEnt:
6991     @@@@test:value:
6992     <!DOCTYPE a PUBLIC >
6993     <a/>
6994     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 20); }
6995     @@XMLTest:
6996     @@@QName: xp.doctype.public.lit.test
6997     @@@DEnt:
6998     @@@@test:value:
6999     <!DOCTYPE a PUBLIC"p" "s">
7000     <a/>
7001     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 19); }
7002     @@XMLTest:
7003     @@@QName: xp.doctype.public.lita.test
7004     @@@DEnt:
7005     @@@@test:value:
7006     <!DOCTYPE a PUBLIC'p' "s">
7007     <a/>
7008     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 19); }
7009     @@XMLTest:
7010     @@@QName: xp.doctype.pubid.lit.lita.unmatched.1.test
7011     @@@DEnt:
7012     @@@@test:value:
7013     <!DOCTYPE a PUBLIC "p' "s">
7014     <a/>
7015     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 25); }
7016     @@XMLTest:
7017     @@@QName: xp.doctype.pubid.lit.lita.unmatched.2.test
7018     @@@DEnt:
7019     @@@@test:value:
7020     <!DOCTYPE a PUBLIC "p' 's'><a/>
7021     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 32); }
7022     @@XMLTest:
7023     @@@QName: xp.doctype.pubid.lita.lit.unmatched.1.test
7024     @@@DEnt:
7025     @@@@test:value:
7026     <!DOCTYPE a PUBLIC 'p" "s"><a/>
7027     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 32); }
7028     @@XMLTest:
7029     @@@QName: xp.doctype.pubid.lita.lit.unmatched.2.test
7030     @@@DEnt:
7031     @@@@test:value:
7032     <!DOCTYPE a PUBLIC 'p" 's'>
7033     <a/>
7034     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 21)..(1, 25); }
7035     @@XMLTest:
7036     @@@QName: xp.doctype.public.s.lit.mdc.test
7037     @@@DEnt:
7038     @@@@test:value:
7039     <!DOCTYPE a PUBLIC "><a/>
7040     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 26); }
7041     @@XMLTest:
7042     @@@QName: xp.doctype.public.s.lita.mdc.test
7043     @@@DEnt:
7044     @@@@test:value:
7045     <!DOCTYPE a PUBLIC '><a/>
7046     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 26); }
7047     @@XMLTest:
7048     @@@QName: xp.doctype.public.lit.pubid.lit.mdc.test
7049     @@@DEnt:
7050     @@@@test:value:
7051     <!DOCTYPE a PUBLIC "p">
7052     <a/>
7053     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 23); }
7054     @@XMLTest:
7055     @@@QName: xp.doctype.public.lita.pubid.lita.mdc.test
7056     @@@DEnt:
7057     @@@@test:value:
7058     <!DOCTYPE a PUBLIC 'p'>
7059     <a/>
7060     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 23); }
7061     @@XMLTest:
7062     @@@QName: xp.doctype.public.lit.pubid.lit.s.mdc.test
7063     @@@DEnt:
7064     @@@@test:value:
7065     <!DOCTYPE a PUBLIC "p" >
7066     <a/>
7067     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 24); }
7068     @@XMLTest:
7069     @@@QName: xp.doctype.public.lita.pubid.lita.s.mdc.test
7070     @@@DEnt:
7071     @@@@test:value:
7072     <!DOCTYPE a PUBLIC 'p' >
7073     <a/>
7074     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 24); }
7075     @@XMLTest:
7076     @@@QName: xp.doctype.public.lit.pubid.lit.s.lit.mdc.test
7077     @@@DEnt:
7078     @@@@test:value:
7079     <!DOCTYPE a PUBLIC "p" "><a/>
7080     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 30); }
7081     @@XMLTest:
7082     @@@QName: xp.doctype.public.lit.pubid.lit.s.lita.mdc.test
7083     @@@DEnt:
7084     @@@@test:value:
7085     <!DOCTYPE a PUBLIC "p" '><a/>
7086     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 30); }
7087     @@XMLTest:
7088     @@@QName: xp.doctype.public.lita.pubid.lita.s.lit.mdc.test
7089     @@@DEnt:
7090     @@@@test:value:
7091     <!DOCTYPE a PUBLIC 'p' "><a/>
7092     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 30); }
7093     @@XMLTest:
7094     @@@QName: xp.doctype.public.lita.pubid.lita.s.lita.mdc.test
7095     @@@DEnt:
7096     @@@@test:value:
7097     <!DOCTYPE a PUBLIC 'p' '><a/>
7098     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 30); }
7099     @@XMLTest:
7100     @@@QName: xp.doctype.public.lit.pubid.lit.lit.lita.unmatched.mdc.test
7101     @@@DEnt:
7102     @@@@test:value:
7103     <!DOCTYPE a PUBLIC "p" "s'><a/>
7104     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 32); }
7105     @@XMLTest:
7106     @@@QName: xp.doctype.public.lita.pubid.lita.lita.lit.unmatched.mdc.test
7107     @@@DEnt:
7108     @@@@test:value:
7109     <!DOCTYPE a PUBLIC 'p' 's"><a/>
7110     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 32); }
7111     @@XMLTest:
7112     @@@QName: xp.doctype.pubid.sysid.stago.1.test
7113     @@@DEnt:
7114     @@@@test:value:
7115     <!DOCTYPE a PUBLIC "p" "s"<a/>
7116     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 27); }
7117     @@XMLTest:
7118     @@@QName: xp.doctype.pubid.sysid.stago.2.test
7119     @@@DEnt:
7120     @@@@test:value:
7121     <!DOCTYPE a PUBLIC "p" 's'<a/>
7122     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 27); }
7123     @@XMLTest:
7124     @@@QName: xp.doctype.pubid.sysid.stago.s.1.test
7125     @@@DEnt:
7126     @@@@test:value:
7127     <!DOCTYPE a PUBLIC "p" "s" <a/>
7128     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 28); }
7129     @@XMLTest:
7130     @@@QName: xp.doctype.pubid.sysid.stago.s.2.test
7131     @@@DEnt:
7132     @@@@test:value:
7133     <!DOCTYPE a PUBLIC "p" 's' <a/>
7134     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 28); }
7135 wakaba 1.16
7136     @@XMLTest:
7137     @@@QName: xp.endofline.1.0.crlf.test
7138     @@@DEnt:
7139     @@@@test:value:
7140     <?xml version="1.0"?>
7141     <p>aaa$u000D$u000Abbb</p>
7142 wakaba 1.6 @@@test:domTree:
7143     document {
7144     xml-version: '1.0';
7145 wakaba 1.16 element {
7146     text-content: 'aaa' U+000A 'bbb';
7147 wakaba 1.6 }
7148 wakaba 1.16 }
7149     @@XMLTest:
7150     @@@QName: xp.endofline.1.1.crlf.test
7151     @@@DEnt:
7152     @@@@test:value:
7153     <?xml version="1.1"?>
7154     <p>aaa$u000D$u000Abbb</p>
7155     @@@test:domTree:
7156     document {
7157     xml-version: '1.1';
7158 wakaba 1.6 element {
7159 wakaba 1.16 text-content: 'aaa' U+000A 'bbb';
7160 wakaba 1.6 }
7161     }
7162     @@XMLTest:
7163 wakaba 1.16 @@@QName: xp.endofline.1.0.crnl.test
7164 wakaba 1.6 @@@DEnt:
7165     @@@@test:value:
7166 wakaba 1.16 <?xml version="1.0"?>
7167     <p>aaa$u000D$u0085bbb</p>
7168 wakaba 1.6 @@@test:domTree:
7169     document {
7170     xml-version: '1.0';
7171 wakaba 1.16 element {
7172     text-content: 'aaa' U+000A U+0085 'bbb';
7173 wakaba 1.6 }
7174 wakaba 1.16 }
7175     @@XMLTest:
7176     @@@QName: xp.endofline.1.1.crnl.test
7177     @@@DEnt:
7178     @@@@test:value:
7179     <?xml version="1.1"?>
7180     <p>aaa$u000D$u0085bbb</p>
7181     @@@test:domTree:
7182     document {
7183     xml-version: '1.1';
7184 wakaba 1.6 element {
7185 wakaba 1.16 text-content: 'aaa' U+000A 'bbb';
7186 wakaba 1.6 }
7187     }
7188     @@XMLTest:
7189 wakaba 1.16 @@@QName: xp.endofline.1.0.nl.test
7190 wakaba 1.6 @@@DEnt:
7191     @@@@test:value:
7192 wakaba 1.16 <?xml version="1.0"?>
7193     <p>aaa$u0085bbb</p>
7194 wakaba 1.6 @@@test:domTree:
7195     document {
7196     xml-version: '1.0';
7197     element {
7198 wakaba 1.16 text-content: 'aaa' U+0085 'bbb';
7199 wakaba 1.6 }
7200     }
7201     @@XMLTest:
7202 wakaba 1.16 @@@QName: xp.endofline.1.1.nl.test
7203 wakaba 1.6 @@@DEnt:
7204     @@@@test:value:
7205 wakaba 1.16 <?xml version="1.1"?>
7206     <p>aaa$u0085bbb</p>
7207     @@@test:domTree:
7208     document {
7209     xml-version: '1.1';
7210     element {
7211     text-content: 'aaa' U+000A 'bbb';
7212     }
7213     }
7214     @@XMLTest:
7215     @@@QName: xp.endofline.1.0.ls.test
7216     @@@DEnt:
7217     @@@@test:value:
7218     <?xml version="1.0"?>
7219     <p>aaa$u2028bbb</p>
7220     @@@test:domTree:
7221     document {
7222     xml-version: '1.0';
7223     element {
7224     text-content: 'aaa' U+2028 'bbb';
7225     }
7226     }
7227     @@XMLTest:
7228     @@@QName: xp.endofline.1.1.ls.test
7229     @@@DEnt:
7230     @@@@test:value:
7231     <?xml version="1.1"?>
7232     <p>aaa$u2028bbb</p>
7233     @@@test:domTree:
7234     document {
7235     xml-version: '1.1';
7236     element {
7237     text-content: 'aaa' U+000A 'bbb';
7238     }
7239     }
7240     @@XMLTest:
7241     @@@QName: xp.endofline.1.0.cr.test
7242     @@@DEnt:
7243     @@@@test:value:
7244     <?xml version="1.0"?>
7245     <p>aaa$u000Dbbb</p>
7246     @@@test:domTree:
7247     document {
7248     xml-version: '1.0';
7249     element {
7250     text-content: 'aaa' U+000A 'bbb';
7251     }
7252     }
7253     @@XMLTest:
7254     @@@QName: xp.endofline.1.1.cr.test
7255     @@@DEnt:
7256     @@@@test:value:
7257     <?xml version="1.1"?>
7258     <p>aaa$u000Dbbb</p>
7259     @@@test:domTree:
7260     document {
7261     xml-version: '1.1';
7262     element {
7263     text-content: 'aaa' U+000A 'bbb';
7264     }
7265     }
7266     @@XMLTest:
7267     @@@QName: xp.endofline.1.0.lf.test
7268     @@@DEnt:
7269     @@@@test:value:
7270     <?xml version="1.0"?>
7271     <p>aaa$u000Abbb</p>
7272     @@@test:domTree:
7273     document {
7274     xml-version: '1.0';
7275     element {
7276     text-content: 'aaa' U+000A 'bbb';
7277     }
7278     }
7279     @@XMLTest:
7280     @@@QName: xp.endofline.1.1.lf.test
7281     @@@DEnt:
7282     @@@@test:value:
7283     <?xml version="1.1"?>
7284     <p>aaa$u000Abbb</p>
7285     @@@test:domTree:
7286     document {
7287     xml-version: '1.1';
7288     element {
7289     text-content: 'aaa' U+000A 'bbb';
7290     }
7291     }
7292     @@XMLTest:
7293     @@@QName: xp.xml10.endofline.nl.in.xmldecl.1.test
7294     @@@DEnt:
7295     @@@@test:value:
7296     <?xml$u0085version="1.0"?>
7297     <p/>
7298     @@@c:erred:
7299     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 6)..(2, 0); }
7300     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7301     @@XMLTest:
7302     @@@QName: xp.xml11.endofline.nl.in.xmldecl.1.test
7303     @@@DEnt:
7304     @@@@test:value:
7305     <?xml$u0085version="1.1"?>
7306     (err)<p/>
7307     @@@c:erred:
7308     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 6)..(2, 0); }
7309     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7310     @@XMLTest:
7311     @@@QName: xp.xml10.endofline.crnl.in.xmldecl.1.test
7312     @@@DEnt:
7313     @@@@test:value:
7314     <?xml$u000D$u0085version="1.0"?>
7315     <p/>
7316     @@@c:erred:
7317     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 6)..(2, 0); }
7318     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7319     @@XMLTest:
7320     @@@QName: xp.xml11.endofline.crnl.in.xmldecl.1.test
7321     @@@DEnt:
7322     @@@@test:value:
7323     <?xml$u000D$u0085version="1.1"?>
7324     (err)<p/>
7325     @@@c:erred:
7326     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 6)..(2, 0); }
7327     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7328     @@XMLTest:
7329     @@@QName: xp.xml10.endofline.ls.in.xmldecl.1.test
7330     @@@DEnt:
7331     @@@@test:value:
7332     <?xml$u2028version="1.0"?>
7333     <p/>
7334     @@@c:erred:
7335     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 6)..(2, 0); }
7336     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7337     @@XMLTest:
7338     @@@QName: xp.xml11.endofline.ls.in.xmldecl.1.test
7339     @@@DEnt:
7340     @@@@test:value:
7341     <?xml$u2028version="1.1"?>
7342     (err)<p/>
7343     @@@c:erred:
7344     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 6)..(2, 0); }
7345     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7346     @@XMLTest:
7347     @@@QName: xp.xml10.endofline.nl.in.xmldecl.2.test
7348     @@@DEnt:
7349     @@@@test:value:
7350     <?xml version="1.0"$u0085?>
7351     <p/>
7352     @@@c:erred:
7353     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 20)..(2, 0); }
7354     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7355     @@XMLTest:
7356     @@@QName: xp.xml11.endofline.nl.in.xmldecl.2.test
7357     @@@DEnt:
7358     @@@@test:value:
7359     <?xml version="1.1"$u0085?>
7360     (err)<p/>
7361     @@@c:erred:
7362     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 20)..(2, 0); }
7363     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7364     @@XMLTest:
7365     @@@QName: xp.xml10.endofline.crnl.in.xmldecl.2.test
7366     @@@DEnt:
7367     @@@@test:value:
7368     <?xml version="1.0"$u000D$u0085?>
7369     <p/>
7370     @@@c:erred:
7371     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 20)..(2, 0); }
7372     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7373     @@XMLTest:
7374     @@@QName: xp.xml11.endofline.crnl.in.xmldecl.2.test
7375     @@@DEnt:
7376     @@@@test:value:
7377     <?xml version="1.1"$u000D$u0085?>
7378     (err)<p/>
7379     @@@c:erred:
7380     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 20)..(2, 0); }
7381     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7382     @@XMLTest:
7383     @@@QName: xp.xml10.endofline.ls.in.xmldecl.2.test
7384     @@@DEnt:
7385     @@@@test:value:
7386     <?xml version="1.0"$u2028?>
7387     <p/>
7388     @@@c:erred:
7389     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 20)..(2, 0); }
7390     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7391     @@XMLTest:
7392     @@@QName: xp.xml11.endofline.ls.in.xmldecl.2.test
7393     @@@DEnt:
7394     @@@@test:value:
7395     <?xml version="1.1"$u2028?>
7396     (err)<p/>
7397     @@@c:erred:
7398     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 20)..(2, 0); }
7399     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7400     @@XMLTest:
7401     @@@QName: xp.xml10.endofline.nl.in.xmldecl.3.test
7402     @@@DEnt:
7403     @@@@test:value:
7404     <?xml $u0085version="1.0"?>
7405     <p/>
7406     @@@c:erred:
7407     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 7)..(2, 0); }
7408     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7409     @@XMLTest:
7410     @@@QName: xp.xml11.endofline.nl.in.xmldecl.3.test
7411     @@@DEnt:
7412     @@@@test:value:
7413     <?xml $u0085version="1.1"?>
7414     (err)<p/>
7415     @@@c:erred:
7416     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 7)..(2, 0); }
7417     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7418     @@XMLTest:
7419     @@@QName: xp.xml10.endofline.crnl.in.xmldecl.3.test
7420     @@@DEnt:
7421     @@@@test:value:
7422     <?xml $u000D$u0085version="1.0"?>
7423     <p/>
7424     @@@c:erred:
7425     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 7)..(2, 0); }
7426     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7427     @@XMLTest:
7428     @@@QName: xp.xml11.endofline.crnl.in.xmldecl.3.test
7429     @@@DEnt:
7430     @@@@test:value:
7431     <?xml $u000D$u0085version="1.1"?>
7432     (err)<p/>
7433     @@@c:erred:
7434     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 7)..(2, 0); }
7435     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7436     @@XMLTest:
7437     @@@QName: xp.xml10.endofline.ls.in.xmldecl.3.test
7438     @@@DEnt:
7439     @@@@test:value:
7440     <?xml $u2028version="1.0"?>
7441     <p/>
7442     @@@c:erred:
7443     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 7)..(2, 0); }
7444     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7445     @@XMLTest:
7446     @@@QName: xp.xml11.endofline.ls.in.xmldecl.3.test
7447     @@@DEnt:
7448     @@@@test:value:
7449     <?xml $u2028version="1.1"?>
7450     (err)<p/>
7451     @@@c:erred:
7452     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 7)..(2, 0); }
7453     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7454     @@XMLTest:
7455     @@@QName: xp.xml10implied.endofline.nl.in.pi.1.test
7456     @@@DEnt:
7457     @@@@test:value:
7458     <?xml-$u0085?>
7459     <p/>
7460     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 7)..(2, 0); }
7461     @@XMLTest:
7462     @@@QName: xp.xml10.endofline.nl.in.pi.1.test
7463     @@@DEnt:
7464     @@@@test:value:
7465     <?xml version="1.0"?>
7466     <?xml-$u0085?>
7467     <p/>
7468     @@@c:erred: <[[xp|wf-syntax-error]]> { (2, 7)..(3, 0); }
7469     @@XMLTest:
7470     @@@QName: xp.xml11.endofline.nl.in.pi.1.test
7471     @@@DEnt:
7472     @@@@test:value:
7473     <?xml version="1.1"?>
7474     <?xml-$u0085?>
7475     <p/>
7476     @@@test:domTree:
7477     document {
7478     xml-version: '1.1';
7479     pi {
7480     node-name: 'xml-';
7481     node-value: '';
7482     }
7483     element { }
7484     }
7485     @@XMLTest:
7486     @@@QName: xp.xml10implied.endofline.crnl.in.pi.1.test
7487     @@@DEnt:
7488     @@@@test:value:
7489     <?xml-$u000D$u0085?>
7490     <p/>
7491     @@@test:domTree:
7492     document {
7493     xml-version: '1.0';
7494     pi {
7495     node-name: 'xml-';
7496     node-value: U+0085;
7497     }
7498     element { }
7499     }
7500     @@XMLTest:
7501     @@@QName: xp.xml10.endofline.crnl.in.pi.1.test
7502     @@@DEnt:
7503     @@@@test:value:
7504     <?xml version="1.0"?>
7505     <?xml-$u000D$u0085?>
7506     <p/>
7507     @@@test:domTree:
7508     document {
7509     xml-version: '1.0';
7510     pi {
7511     node-name: 'xml-';
7512     node-value: U+0085;
7513     }
7514     element { }
7515     }
7516     @@XMLTest:
7517     @@@QName: xp.xml11.endofline.crnl.in.pi.1.test
7518     @@@DEnt:
7519     @@@@test:value:
7520     <?xml version="1.1"?>
7521     <?xml-$u000D$u0085?>
7522     <p/>
7523     @@@test:domTree:
7524     document {
7525     xml-version: '1.1';
7526     pi {
7527     node-name: 'xml-';
7528     node-value: '';
7529     }
7530     element { }
7531     }
7532     @@XMLTest:
7533     @@@QName: xp.xml10implied.endofline.ls.in.pi.1.test
7534     @@@DEnt:
7535     @@@@test:value:
7536     <?xml-$u2028?>
7537     <p/>
7538     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 7)..(2, 0); }
7539     @@XMLTest:
7540     @@@QName: xp.xml10.endofline.ls.in.pi.1.test
7541     @@@DEnt:
7542     @@@@test:value:
7543     <?xml version="1.0"?>
7544     <?xml-$u2028?>
7545     <p/>
7546     @@@c:erred: <[[xp|wf-syntax-error]]> { (2, 7)..(3, 0); }
7547     @@XMLTest:
7548     @@@QName: xp.xml11.endofline.ls.in.pi.1.test
7549     @@@DEnt:
7550     @@@@test:value:
7551     <?xml version="1.1"?>
7552     <?xml-$u2028?>
7553     <p/>
7554     @@@test:domTree:
7555     document {
7556     xml-version: '1.1';
7557     pi {
7558     node-name: 'xml-';
7559     node-value: '';
7560     }
7561     element { }
7562     }
7563 wakaba 1.27
7564     @@XMLTest:
7565     @@@QName: xp.xml10.endofline.internal.1.test
7566     @@@DEnt:
7567     @@@@test:value:
7568     <?xml version="1.0"?>
7569     <!DOCTYPE a [
7570     <!ENTITY e "&#x000D; &#x000A; &#x0085; &#x000D;&#x000A; $
7571     &#x000D;&#x0085; &#x2028;">
7572     ]><a>&e;</a>
7573     @@@test:domTree:
7574     document {
7575     xml-version: '1.0';
7576     document-type {
7577     general-entity {
7578     node-name: 'e';
7579     text-content: U+000D ' ' U+000A ' ' U+0085 ' '
7580     U+000D U+000A ' ' U+000D U+0085 ' ' U+2028;
7581     }
7582     }
7583     element {
7584     text-content: U+000D ' ' U+000A ' ' U+0085 ' '
7585     U+000D U+000A ' ' U+000D U+0085 ' ' U+2028;
7586     }
7587     }
7588     @@XMLTest:
7589     @@@QName: xp.xml11.endofline.internal.1.test
7590     @@@DEnt:
7591     @@@@test:value:
7592     <?xml version="1.1"?>
7593     <!DOCTYPE a [
7594     <!ENTITY e "&#x000D; &#x000A; &#x0085; &#x000D;&#x000A; $
7595     &#x000D;&#x0085; &#x2028;">
7596     ]><a>&e;</a>
7597     @@@test:domTree:
7598     document {
7599     xml-version: '1.1';
7600     document-type {
7601     general-entity {
7602     node-name: 'e';
7603     text-content: U+000D ' ' U+000A ' ' U+0085 ' '
7604     U+000D U+000A ' ' U+000D U+0085 ' ' U+2028;
7605     }
7606     }
7607     element {
7608     text-content: U+000D ' ' U+000A ' ' U+0085 ' '
7609     U+000D U+000A ' ' U+000D U+0085 ' ' U+2028;
7610     }
7611     }
7612    
7613 wakaba 1.16 @@XMLTest:
7614     @@@QName: xp.noxmldecl.pi.pi.test
7615     @@@DEnt:
7616     @@@@test:value:
7617     <?noxml 1?><?noxml 2?><p/>
7618     @@@test:domTree:
7619     document {
7620     xml-version: '1.0';
7621     pi {
7622     node-name: 'noxml';
7623     node-value: '1';
7624     }
7625     pi {
7626     node-name: 'noxml';
7627     node-value: '2';
7628     }
7629     element { }
7630     }
7631     @@XMLTest:
7632     @@@QName: xp.noxmldecl.pi.pi.2.test
7633     @@@DEnt:
7634     @@@@test:value:
7635     <?xmlno 1?><?xmlno 2?><p/>
7636     @@@test:domTree:
7637     document {
7638     xml-version: '1.0';
7639     pi {
7640     node-name: 'xmlno';
7641     node-value: '1';
7642     }
7643     pi {
7644     node-name: 'xmlno';
7645     node-value: '2';
7646     }
7647     element { }
7648     }
7649     @@XMLTest:
7650     @@@QName: xp.noxmldecl.pi.pi.3.test
7651     @@@DEnt:
7652     @@@@test:value:
7653     <?xmln 1?><?xmln 2?><p/>
7654     @@@test:domTree:
7655     document {
7656     xml-version: '1.0';
7657     pi {
7658     node-name: 'xmln';
7659     node-value: '1';
7660     }
7661     pi {
7662     node-name: 'xmln';
7663     node-value: '2';
7664     }
7665     element { }
7666     }
7667     @@XMLTest:
7668     @@@QName: xp.noxml.s.nl.test
7669     @@@DEnt:
7670     @@@@test:value:
7671     $u0085<p/>
7672     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 1)..(2, 0); }
7673     @@XMLTest:
7674     @@@QName: xp.noxml.s.crnl.test
7675     @@@DEnt:
7676     @@@@test:value:
7677     $u000D$u0085<p/>
7678     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 1)..(2, 0); }
7679     @@XMLTest:
7680     @@@QName: xp.noxml.s.ls.test
7681     @@@DEnt:
7682     @@@@test:value:
7683     $u2028<p/>
7684     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 1)..(2, 0); }
7685     @@XMLTest:
7686     @@@QName: xp.xml10.decl.s.nl.test
7687     @@@DEnt:
7688     @@@@test:value:
7689     <?xml version="1.0"?>$u0085<p/>
7690     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 22)..(2, 0); }
7691     @@XMLTest:
7692     @@@QName: xp.xml10.decl.s.crnl.test
7693     @@@DEnt:
7694     @@@@test:value:
7695     <?xml version="1.0"?>$u000D$u0085<p/>
7696     @@@c:erred: <[[xp|wf-syntax-error]]> { (2, 0)..(3, 0); }
7697     @@XMLTest:
7698     @@@QName: xp.xml10.decl.s.ls.test
7699     @@@DEnt:
7700     @@@@test:value:
7701     <?xml version="1.0"?>$u2028<p/>
7702     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 22)..(2, 0); }
7703     @@XMLTest:
7704     @@@QName: xp.xml11.decl.s.nl.test
7705     @@@DEnt:
7706     @@@@test:value:
7707     <?xml version="1.1"?>$u0085<p/>
7708     @@@test:domTree:
7709     document {
7710     xml-version: '1.1';
7711     element { }
7712     }
7713     @@XMLTest:
7714     @@@QName: xp.xml11.decl.s.crnl.test
7715     @@@DEnt:
7716     @@@@test:value:
7717     <?xml version="1.1"?>$u000D$u0085<p/>
7718     @@@test:domTree:
7719     document {
7720     xml-version: '1.1';
7721     element { }
7722     }
7723     @@XMLTest:
7724     @@@QName: xp.xml11.decl.s.ls.test
7725     @@@DEnt:
7726     @@@@test:value:
7727     <?xml version="1.1"?>$u2028<p/>
7728     @@@test:domTree:
7729     document {
7730     xml-version: '1.1';
7731     element { }
7732     }
7733    
7734     @@XMLTest:
7735 wakaba 1.18 @@@QName: xp.element.type.match.1.test
7736     @@@DEnt:
7737     @@@@test:value:
7738     <p></pa>(err)
7739     @@@c:erred: <[[xp|wf-element-type-match]]> { (1, 4)..(1, 8); }
7740     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7741     @@XMLTest:
7742     @@@QName: xp.element.type.match.2.test
7743     @@@DEnt:
7744     @@@@test:value:
7745     <p><pa></pa></pa>(err)
7746     @@@c:erred: <[[xp|wf-element-type-match]]> { (1, 13)..(1, 17); }
7747     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7748     @@XMLTest:
7749     @@@QName: xp.element.type.match.3.test
7750     @@@DEnt:
7751     @@@@test:value:
7752     <p><pa></p></p>(err)
7753     @@@c:erred: <[[xp|wf-element-type-match]]> { (1, 8)..(1, 11); }
7754     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7755     @@XMLTest:
7756     @@@QName: xp.element.type.match.4.test
7757     @@@DEnt:
7758     @@@@test:value:
7759     <a:p xmlns:a="about:1"></p>(err)
7760     @@@c:erred: <[[xp|wf-element-type-match]]> { (1, 24)..(1, 27); }
7761     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7762     @@XMLTest:
7763     @@@QName: xp.element.type.match.5.test
7764     @@@DEnt:
7765     @@@@test:value:
7766     <a:p xmlns:a="about:1" xmlns:b="about:1"></b:p>(err)
7767     @@@c:erred: <[[xp|wf-element-type-match]]> { (1, 42)..(1, 47); }
7768     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7769    
7770     @@XMLTest:
7771     @@@QName: xp.stag.stago.name.etago.test
7772     @@@DEnt:
7773     @@@@test:value:
7774     <a</a>
7775     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 3); }
7776     @@XMLTest:
7777     @@@QName: xp.stag.stago.name.s.etago.test
7778     @@@DEnt:
7779     @@@@test:value:
7780     <a </a>
7781     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 4); }
7782     @@XMLTest:
7783     @@@QName: xp.stag.stago.name.s.attr.etago.test
7784     @@@DEnt:
7785     @@@@test:value:
7786     <a a="b"</a>
7787     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 9); }
7788     @@XMLTest:
7789     @@@QName: xp.stag.stago.name.s.attr.s.attr.etago.test
7790     @@@DEnt:
7791     @@@@test:value:
7792     <a a="b" c="d"</a>
7793     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 15); }
7794     @@XMLTest:
7795     @@@QName: xp.stag.stago.name.s.attr.s.etago.test
7796     @@@DEnt:
7797     @@@@test:value:
7798     <a a="b" </a>
7799     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 10); }
7800     @@XMLTest:
7801     @@@QName: xp.stag.etag.1.test
7802 wakaba 1.16 @@@DEnt:
7803     @@@@test:value:
7804 wakaba 1.18 <root><a></a></root>
7805 wakaba 1.16 @@@test:domTree:
7806     document {
7807 wakaba 1.18 element {
7808     element {
7809     node-name: 'a';
7810 wakaba 1.16 }
7811     }
7812 wakaba 1.18 }
7813     @@XMLTest:
7814     @@@QName: xp.stag.etag.2.test
7815     @@@DEnt:
7816     @@@@test:value:
7817     <root><ab></ab></root>
7818     @@@test:domTree:
7819     document {
7820 wakaba 1.16 element {
7821 wakaba 1.18 element {
7822     node-name: 'ab';
7823     }
7824 wakaba 1.16 }
7825 wakaba 1.18 }
7826 wakaba 1.16 @@XMLTest:
7827 wakaba 1.18 @@@QName: xp.stag.etag.s.1.test
7828 wakaba 1.16 @@@DEnt:
7829     @@@@test:value:
7830 wakaba 1.18 <root><a ></a ></root>
7831 wakaba 1.16 @@@test:domTree:
7832     document {
7833 wakaba 1.18 element {
7834     element {
7835     node-name: 'a';
7836 wakaba 1.16 }
7837     }
7838 wakaba 1.18 }
7839     @@XMLTest:
7840     @@@QName: xp.etag.1.test
7841     @@@DEnt:
7842     @@@@test:value:
7843     <root><a/></root>
7844     @@@test:domTree:
7845     document {
7846 wakaba 1.16 element {
7847 wakaba 1.18 element {
7848     node-name: 'a';
7849     }
7850 wakaba 1.16 }
7851 wakaba 1.18 }
7852 wakaba 1.16 @@XMLTest:
7853 wakaba 1.18 @@@QName: xp.etag.2.test
7854 wakaba 1.16 @@@DEnt:
7855     @@@@test:value:
7856 wakaba 1.18 <root><a /></root>
7857 wakaba 1.16 @@@test:domTree:
7858     document {
7859     element {
7860 wakaba 1.18 element {
7861     node-name: 'a';
7862     }
7863 wakaba 1.16 }
7864 wakaba 1.18 }
7865 wakaba 1.16 @@XMLTest:
7866 wakaba 1.18 @@@QName: xp.stag.etag.attr.1.test
7867 wakaba 1.16 @@@DEnt:
7868     @@@@test:value:
7869 wakaba 1.18 <root><a at="v"></a></root>
7870 wakaba 1.16 @@@test:domTree:
7871     document {
7872 wakaba 1.18 element {
7873     element {
7874     node-name: 'a';
7875     attribute {
7876     node-name: 'at';
7877     value: 'v';
7878     }
7879 wakaba 1.16 }
7880     }
7881 wakaba 1.18 }
7882     @@XMLTest:
7883     @@@QName: xp.stag.etag.attr.2.test
7884     @@@DEnt:
7885     @@@@test:value:
7886     <root><a at="v" ></a></root>
7887     @@@test:domTree:
7888     document {
7889 wakaba 1.16 element {
7890 wakaba 1.18 element {
7891     node-name: 'a';
7892     attribute {
7893     node-name: 'at';
7894     value: 'v';
7895 wakaba 1.16 }
7896     }
7897     }
7898 wakaba 1.18 }
7899 wakaba 1.16 @@XMLTest:
7900 wakaba 1.18 @@@QName: xp.stag.etag.attr.3.test
7901 wakaba 1.16 @@@DEnt:
7902     @@@@test:value:
7903 wakaba 1.18 <root><a at ="v"></a></root>
7904 wakaba 1.16 @@@test:domTree:
7905     document {
7906 wakaba 1.18 element {
7907     element {
7908     node-name: 'a';
7909     attribute {
7910     node-name: 'at';
7911     value: 'v';
7912     }
7913 wakaba 1.16 }
7914     }
7915 wakaba 1.18 }
7916     @@XMLTest:
7917     @@@QName: xp.stag.etag.attr.4.test
7918     @@@DEnt:
7919     @@@@test:value:
7920     <root><a at= "v"></a></root>
7921     @@@test:domTree:
7922     document {
7923 wakaba 1.16 element {
7924 wakaba 1.18 element {
7925     node-name: 'a';
7926     attribute {
7927     node-name: 'at';
7928     value: 'v';
7929 wakaba 1.16 }
7930     }
7931 wakaba 1.18 }
7932     }
7933     @@XMLTest:
7934     @@@QName: xp.stag.etag.attr.5.test
7935     @@@DEnt:
7936     @@@@test:value:
7937     <root><a at='v'></a></root>
7938     @@@test:domTree:
7939     document {
7940     element {
7941     element {
7942     node-name: 'a';
7943     attribute {
7944     node-name: 'at';
7945     value: 'v';
7946 wakaba 1.16 }
7947     }
7948     }
7949 wakaba 1.18 }
7950 wakaba 1.16 @@XMLTest:
7951 wakaba 1.18 @@@QName: xp.stag.etag.attr.6.test
7952 wakaba 1.16 @@@DEnt:
7953     @@@@test:value:
7954 wakaba 1.18 <root><a at= 'v' ></a></root>
7955 wakaba 1.6 @@@test:domTree:
7956     document {
7957 wakaba 1.18 element {
7958     element {
7959     node-name: 'a';
7960     attribute {
7961     node-name: 'at';
7962     value: 'v';
7963     }
7964 wakaba 1.11 }
7965 wakaba 1.6 }
7966 wakaba 1.18 }
7967     @@XMLTest:
7968     @@@QName: xp.stag.etag.attr.attr.1.test
7969     @@@DEnt:
7970     @@@@test:value:
7971     <root><a at="v" tr="w"></a></root>
7972     @@@test:domTree:
7973     document {
7974 wakaba 1.6 element {
7975 wakaba 1.18 element {
7976     node-name: 'a';
7977     attribute {
7978     node-name: 'at';
7979     value: 'v';
7980 wakaba 1.6 }
7981 wakaba 1.18 attribute {
7982     node-name: 'tr';
7983     value: 'w';
7984 wakaba 1.6 }
7985     }
7986     }
7987 wakaba 1.18 }
7988 wakaba 1.6 @@XMLTest:
7989 wakaba 1.18 @@@QName: xp.stag.etag.attr.attr.2.test
7990 wakaba 1.6 @@@DEnt:
7991     @@@@test:value:
7992 wakaba 1.18 <root><a tr="w" at="v"></a></root>
7993 wakaba 1.6 @@@test:domTree:
7994     document {
7995 wakaba 1.18 element {
7996     element {
7997     node-name: 'a';
7998     attribute {
7999     node-name: 'at';
8000     value: 'v';
8001     }
8002     attribute {
8003     node-name: 'tr';
8004     value: 'w';
8005 wakaba 1.11 }
8006     }
8007 wakaba 1.6 }
8008 wakaba 1.18 }
8009     @@XMLTest:
8010     @@@QName: xp.stag.etag.attr.no.s.attr.test
8011     @@@DEnt:
8012     @@@@test:value:
8013     <root><a at="v"tr="w"></a></root>
8014     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 16)..(1, 17); }
8015     @@XMLTest:
8016     @@@QName: xp.etag.attr.1.test
8017     @@@DEnt:
8018     @@@@test:value:
8019     <root><a at="v" tr="w"></a b="c"></root>
8020     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 28); }
8021     @@XMLTest:
8022     @@@QName: xp.etag.no.etagc.1.test
8023     @@@DEnt:
8024     @@@@test:value:
8025     <root><a at="v" tr="w"></a</root>
8026     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 27)..(1, 28); }
8027     @@XMLTest:
8028     @@@QName: xp.etag.no.etagc.2.test
8029     @@@DEnt:
8030     @@@@test:value:
8031     <root><a at="v" tr="w"></a </root>
8032     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 29)..(1, 30); }
8033     @@XMLTest:
8034     @@@QName: xp.mtag.attr.1.test
8035     @@@DEnt:
8036     @@@@test:value:
8037     <root><a b="c"/></root>
8038     @@@test:domTree:
8039     document {
8040 wakaba 1.6 element {
8041 wakaba 1.18 element {
8042     node-name: 'a';
8043     attribute {
8044     node-name: 'b';
8045     value: 'c';
8046 wakaba 1.6 }
8047     }
8048 wakaba 1.8 }
8049 wakaba 1.18 }
8050 wakaba 1.11 @@XMLTest:
8051 wakaba 1.18 @@@QName: xp.mtag.attr.2.test
8052 wakaba 1.11 @@@DEnt:
8053     @@@@test:value:
8054 wakaba 1.18 <root><a b="c" /></root>
8055 wakaba 1.11 @@@test:domTree:
8056     document {
8057 wakaba 1.18 element {
8058     element {
8059     node-name: 'a';
8060     attribute {
8061     node-name: 'b';
8062     value: 'c';
8063     }
8064 wakaba 1.11 }
8065     }
8066 wakaba 1.18 }
8067 wakaba 1.11 @@XMLTest:
8068 wakaba 1.18 @@@QName: xp.mtag.attr.3.test
8069 wakaba 1.11 @@@DEnt:
8070     @@@@test:value:
8071 wakaba 1.18 <root><a b='c'/></root>
8072 wakaba 1.11 @@@test:domTree:
8073     document {
8074     element {
8075 wakaba 1.18 element {
8076     node-name: 'a';
8077     attribute {
8078     node-name: 'b';
8079     value: 'c';
8080     }
8081     }
8082 wakaba 1.11 }
8083 wakaba 1.18 }
8084 wakaba 1.11 @@XMLTest:
8085 wakaba 1.18 @@@QName: xp.mtag.attr.4.test
8086 wakaba 1.11 @@@DEnt:
8087     @@@@test:value:
8088 wakaba 1.18 <root><a b="c" d="e"/></root>
8089 wakaba 1.11 @@@test:domTree:
8090     document {
8091     element {
8092 wakaba 1.18 element {
8093     node-name: 'a';
8094     attribute {
8095     node-name: 'b';
8096     value: 'c';
8097     }
8098     attribute {
8099     node-name: 'd';
8100     value: 'e';
8101     }
8102 wakaba 1.11 }
8103     }
8104 wakaba 1.18 }
8105    
8106     @@XMLTest:
8107     @@@QName: xp.attvalue.lt.1.test
8108     @@@DEnt:
8109     @@@@test:value:
8110     <a b="aa<dd"/>
8111     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 9); }
8112     @@XMLTest:
8113     @@@QName: xp.attvalue.lt.2.test
8114     @@@DEnt:
8115     @@@@test:value:
8116     <a b='aa<dd'/>
8117     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 9); }
8118     @@XMLTest:
8119     @@@QName: xp.attvalue.amp.1.test
8120     @@@DEnt:
8121     @@@@test:value:
8122     <a b="aa& dd"/>
8123     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 9)..(1, 12); }
8124     @@XMLTest:
8125     @@@QName: xp.attvalue.amp.2.test
8126     @@@DEnt:
8127     @@@@test:value:
8128     <a b='aa& dd'/>
8129     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 9)..(1, 12); }
8130     @@XMLTest:
8131     @@@QName: xp.attvalue.amp.3.test
8132     @@@DEnt:
8133     @@@@test:value:
8134     <a b="aa&# dd"/>
8135     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 9)..(1, 13); }
8136     @@XMLTest:
8137     @@@QName: xp.attvalue.amp.4.test
8138     @@@DEnt:
8139     @@@@test:value:
8140     <a b="aa&#x dd"/>
8141     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 9)..(1, 14); }
8142    
8143     @@XMLTest:
8144     @@@QName: xp.unique.att.spec.1.test
8145     @@@DEnt:
8146     @@@@test:value:
8147     <a b="c" b="d"/>
8148     @@@c:erred: <[[xp|wf-unique-att-spec]]> { (1, 4)..(1, 14); }
8149     @@XMLTest:
8150     @@@QName: xp.unique.att.spec.2.test
8151     @@@DEnt:
8152     @@@@test:value:
8153     <a d:b="c" d:b="d" xmlns:d="about:2"/>
8154     @@@c:erred: <[[xp|wf-unique-att-spec]]> { (1, 4)..(1, 18); }
8155    
8156     @@XMLTest:
8157     @@@QName: xp.no.external.entity.references.1.test
8158     @@@DEnt:
8159     @@@@test:value:
8160     <!DOCTYPE a [
8161     <!ENTITY ent SYSTEM "something">
8162     ]>
8163     <a b="c&ent;"/>
8164     @@@c:erred: <[[xp|wf-no-external-entity-references]]> { (4, 8)..(4, 12); }
8165     @@XMLTest:
8166     @@@QName: xp.no.external.entity.references.2.test
8167     @@@DEnt:
8168     @@@@test:value:
8169     <!DOCTYPE a [
8170     <!NOTATION n SYSTEM "notation">
8171     <!ENTITY ent SYSTEM "something" NDATA n>
8172     ]>
8173     <a b="c&ent;"/>
8174     @@@c:erred: <[[xp|wf-no-external-entity-references]]> { (5, 8)..(5, 12); }
8175     @@XMLTest:
8176     @@@QName: xp.no.external.entity.references.3.test
8177     @@@DEnt:
8178     @@@@test:value:
8179     <!DOCTYPE a [
8180     <!ENTITY ent SYSTEM "something">
8181     <!ENTITY ent2 "ddd&ent;">
8182     ]>
8183     <a b="c&ent2;"/>
8184     @@@c:erred: <[[xp|wf-no-external-entity-references]]> { (1, 4)..(1, 8); }
8185     @@XMLTest:
8186     @@@QName: xp.no.external.entity.references.4.test
8187     @@@DEnt:
8188     @@@@test:value:
8189     <!DOCTYPE a [
8190     <!NOTATION n SYSTEM "notation">
8191     <!ENTITY ent SYSTEM "something" NDATA n>
8192     <!ENTITY ent2 "ddd&ent;">
8193     ]>
8194     <a b="c&ent2;"/>
8195     @@@c:erred: <[[xp|wf-no-external-entity-references]]> { (1, 4)..(1, 8); }
8196 wakaba 1.23 @@@c:erred: <[[xp|wf-parsed-entity]]> { }
8197 wakaba 1.18 @@XMLTest:
8198     @@@QName: xp.no.lt.in.attr.value.1.test
8199     @@@DEnt:
8200     @@@@test:value:
8201     <!DOCTYPE a [
8202     <!ENTITY ent "aa<bb">
8203     ]>
8204     <a b="c&ent;"/>
8205     @@@c:erred: <[[xp|wf-no-lt-in-attribute-values]]> { (1, 3); }
8206 wakaba 1.20 @@@c:erred:
8207     @@@@@: <[[xp|wf-syntax-error]]> { (1, 3)..(1, 6); }
8208     @@@@enImplNote: When entity node is created.
8209 wakaba 1.18 @@XMLTest:
8210     @@@QName: xp.no.lt.in.attr.value.2.test
8211     @@@DEnt:
8212     @@@@test:value:
8213     <!DOCTYPE a [
8214     <!ENTITY ent "aa<bb">
8215     <!ENTITY ent2 "ccc&ent;">
8216     ]>
8217     <a b="c&ent2;"/>
8218     @@@c:erred: <[[xp|wf-no-lt-in-attribute-values]]> { (1, 3); }
8219 wakaba 1.20 @@@c:erred:
8220     @@@@@: <[[xp|wf-syntax-error]]> { (1, 3)..(1, 6); }
8221     @@@@enImplNote: When entity node is created.
8222 wakaba 1.18 @@XMLTest:
8223     @@@QName: xp.no.lt.in.attr.value.3.test
8224     @@@DEnt:
8225     @@@@test:value:
8226     <!DOCTYPE a [
8227     <!ENTITY ent "aa&#x3C;bb">
8228     ]>
8229     <a b="c&ent;"/>
8230     @@@c:erred: <[[xp|wf-no-lt-in-attribute-values]]> { (1, 3); }
8231 wakaba 1.20 @@@c:erred:
8232     @@@@@: <[[xp|wf-syntax-error]]> { (1, 3)..(1, 6); }
8233     @@@@enImplNote: When entity node is created.
8234 wakaba 1.18 @@XMLTest:
8235     @@@QName: xp.no.lt.in.attr.value.4.test
8236     @@@DEnt:
8237     @@@@test:value:
8238     <!DOCTYPE a [
8239     <!ENTITY ent "aa&#x3C;bb">
8240     <!ENTITY ent2 "ccc&ent;">
8241     ]>
8242     <a b="c&ent2;"/>
8243     @@@c:erred: <[[xp|wf-no-lt-in-attribute-values]]> { (1, 3); }
8244 wakaba 1.20 @@@c:erred:
8245     @@@@@: <[[xp|wf-syntax-error]]> { (1, 3)..(1, 6); }
8246     @@@@enImplNote: When entity node is created.
8247 wakaba 1.11 @@XMLTest:
8248 wakaba 1.18 @@@QName: xp.ger.lt.in.attr.value.1.test
8249 wakaba 1.11 @@@DEnt:
8250     @@@@test:value:
8251     <!DOCTYPE a [
8252 wakaba 1.18 <!ENTITY ent "aa&lt;bb">
8253 wakaba 1.11 ]>
8254 wakaba 1.18 <a b="c&ent;"/>
8255 wakaba 1.11 @@@test:domTree:
8256     document {
8257     document-type {
8258     general-entity {
8259     node-name: 'ent';
8260 wakaba 1.18 text-content: 'aa<bb';
8261 wakaba 1.11 }
8262     }
8263     element {
8264 wakaba 1.18 attribute {
8265     node-name: 'b';
8266     text { data: 'c'; }
8267     general-entity-reference {
8268 wakaba 1.19 is-expanded: true;
8269 wakaba 1.18 node-name: 'ent';
8270     text-content: 'aa<bb';
8271     }
8272     }
8273 wakaba 1.11 }
8274     }
8275     @@XMLTest:
8276 wakaba 1.18 @@@QName: xp.ger.lt.in.attr.value.2.test
8277 wakaba 1.11 @@@DEnt:
8278     @@@@test:value:
8279     <!DOCTYPE a [
8280 wakaba 1.18 <!ENTITY ent "aa&lt;bb">
8281     <!ENTITY ent2 "ccc&ent;">
8282 wakaba 1.11 ]>
8283 wakaba 1.18 <a b="c&ent2;"/>
8284 wakaba 1.11 @@@test:domTree:
8285     document {
8286     document-type {
8287     general-entity {
8288 wakaba 1.18 node-name: 'ent';
8289     text-content: 'aa<bb';
8290     }
8291     general-entity {
8292     node-name: 'ent2';
8293     text { data: 'ccc'; }
8294     general-entity-reference {
8295     node-name: 'ent';
8296     text-content: 'aa<bb';
8297 wakaba 1.19 is-expanded: true;
8298 wakaba 1.18 }
8299 wakaba 1.11 }
8300     }
8301     element {
8302 wakaba 1.18 attribute {
8303     node-name: 'b';
8304     text { data: 'c'; }
8305     general-entity-reference {
8306     node-name: 'ent2';
8307     text { data: 'ccc'; }
8308     general-entity-reference {
8309     node-name: 'ent';
8310     text-content: 'aa<bb';
8311 wakaba 1.19 is-expanded: true;
8312 wakaba 1.18 }
8313 wakaba 1.19 is-expanded: true;
8314 wakaba 1.18 }
8315     }
8316 wakaba 1.11 }
8317     }
8318    
8319 wakaba 1.8 @@XMLTest:
8320 wakaba 1.18 @@@QName: xp.doctype.intsubset.pi.test
8321 wakaba 1.8 @@@DEnt:
8322     @@@@test:value:
8323     <!DOCTYPE a [
8324 wakaba 1.18 <?pi data ?>
8325 wakaba 1.8 ]>
8326     <a></a>
8327     @@@test:domTree:
8328     document {
8329     xml-version: '1.0';
8330     xml-encoding: null;
8331     xml-standalone: false;
8332     document-type {
8333     node-name: 'a';
8334 wakaba 1.18 pi {
8335     target: 'pi';
8336     data: 'data ';
8337 wakaba 1.8 }
8338     }
8339     element {
8340     namespace-uri: null;
8341 wakaba 1.18 prefix: null;
8342 wakaba 1.8 local-name: 'a';
8343 wakaba 1.18 text-content: '';
8344 wakaba 1.8 }
8345     }
8346 wakaba 1.18 @@@enImplNote:
8347     A DOM PI node in doctype node is a manakai extension.
8348    
8349    
8350 wakaba 1.8 @@XMLTest:
8351 wakaba 1.18 @@@QName: xp.doctype.intsubset.entity.general.internal.test
8352 wakaba 1.8 @@@DEnt:
8353     @@@@test:value:
8354     <!DOCTYPE a [
8355 wakaba 1.18 <!ENTITY entity "entity value">
8356 wakaba 1.8 ]>
8357     <a></a>
8358     @@@test:domTree:
8359     document {
8360     xml-version: '1.0';
8361     xml-encoding: null;
8362     xml-standalone: false;
8363     document-type {
8364     node-name: 'a';
8365 wakaba 1.18 general-entity {
8366     node-name: 'entity';
8367     text-content: 'entity value';
8368     has-replacement-tree: true;
8369 wakaba 1.8 }
8370     }
8371     element {
8372     namespace-uri: null;
8373 wakaba 1.18 prefix: null;
8374 wakaba 1.8 local-name: 'a';
8375 wakaba 1.18 text-content: '';
8376 wakaba 1.8 }
8377     }
8378     @@XMLTest:
8379 wakaba 1.18 @@@QName: xp.doctype.intsubset.entity.parameter.internal.test
8380 wakaba 1.8 @@@DEnt:
8381     @@@@test:value:
8382     <!DOCTYPE a [
8383 wakaba 1.18 <!ENTITY % entity "entity value">
8384 wakaba 1.8 ]>
8385     <a></a>
8386     @@@test:domTree:
8387     document {
8388     xml-version: '1.0';
8389     xml-encoding: null;
8390     xml-standalone: false;
8391     document-type {
8392     node-name: 'a';
8393     }
8394     element {
8395     namespace-uri: null;
8396 wakaba 1.18 prefix: null;
8397 wakaba 1.8 local-name: 'a';
8398 wakaba 1.18 text-content: '';
8399 wakaba 1.8 }
8400     }
8401 wakaba 1.18
8402 wakaba 1.8 @@XMLTest:
8403 wakaba 1.18 @@@QName: xp.doctype.internal.entity.root.element.text.only.test
8404 wakaba 1.8 @@@DEnt:
8405     @@@@test:value:
8406     <!DOCTYPE a [
8407 wakaba 1.18 <!ENTITY entity "entity value">
8408 wakaba 1.8 ]>
8409 wakaba 1.18 <a>&entity;</a>
8410 wakaba 1.8 @@@test:domTree:
8411     document {
8412     xml-version: '1.0';
8413     xml-encoding: null;
8414     xml-standalone: false;
8415     document-type {
8416     node-name: 'a';
8417 wakaba 1.18 general-entity {
8418     node-name: 'entity';
8419     text-content: 'entity value';
8420     has-replacement-tree: true;
8421 wakaba 1.8 }
8422     }
8423     element {
8424     namespace-uri: null;
8425 wakaba 1.18 prefix: null;
8426 wakaba 1.8 local-name: 'a';
8427 wakaba 1.18 general-entity-reference {
8428     node-name: 'entity';
8429     text {
8430     data: 'entity value';
8431     }
8432 wakaba 1.19 is-expanded: true;
8433 wakaba 1.10 }
8434 wakaba 1.9 }
8435     }
8436     @@XMLTest:
8437 wakaba 1.18 @@@QName: xp.doctype.internal.entity.root.element.text.mult.test
8438 wakaba 1.9 @@@DEnt:
8439     @@@@test:value:
8440     <!DOCTYPE a [
8441 wakaba 1.18 <!ENTITY entity "entity value">
8442 wakaba 1.9 ]>
8443 wakaba 1.18 <a>&entity; and &entity;</a>
8444 wakaba 1.9 @@@test:domTree:
8445     document {
8446     xml-version: '1.0';
8447     xml-encoding: null;
8448     xml-standalone: false;
8449     document-type {
8450     node-name: 'a';
8451 wakaba 1.18 general-entity {
8452     node-name: 'entity';
8453     text-content: 'entity value';
8454     has-replacement-tree: true;
8455 wakaba 1.9 }
8456     }
8457     element {
8458     namespace-uri: null;
8459 wakaba 1.18 prefix: null;
8460 wakaba 1.9 local-name: 'a';
8461 wakaba 1.18 general-entity-reference {
8462     node-name: 'entity';
8463     text {
8464     data: 'entity value';
8465     }
8466 wakaba 1.19 is-expanded: true;
8467 wakaba 1.18 }
8468     text { data: ' and '; }
8469     general-entity-reference {
8470     node-name: 'entity';
8471     text {
8472     data: 'entity value';
8473     }
8474 wakaba 1.19 is-expanded: true;
8475 wakaba 1.10 }
8476 wakaba 1.9 }
8477     }
8478     @@XMLTest:
8479 wakaba 1.18 @@@QName: xp.doctype.internal.entity.root.element.text.element.test
8480 wakaba 1.9 @@@DEnt:
8481     @@@@test:value:
8482     <!DOCTYPE a [
8483 wakaba 1.18 <!ENTITY entity "entity <p>value</p> with <e>element</e> ">
8484 wakaba 1.9 ]>
8485 wakaba 1.18 <a>&entity;</a>
8486     @@@test:domTree:
8487     document {
8488     xml-version: '1.0';
8489     xml-encoding: null;
8490     xml-standalone: false;
8491     document-type {
8492     node-name: 'a';
8493     general-entity {
8494     node-name: 'entity';
8495     has-replacement-tree: true;
8496     text { data: 'entity '; }
8497     element {
8498     node-name: 'p';
8499     text-content: 'value';
8500     }
8501     text { data: ' with '; }
8502     element {
8503     node-name: 'e';
8504     text-content: 'element';
8505     }
8506 wakaba 1.20 text { data: ' '; }
8507 wakaba 1.18 }
8508     }
8509     element {
8510     namespace-uri: null;
8511     prefix: null;
8512     local-name: 'a';
8513     general-entity-reference {
8514     node-name: 'entity';
8515 wakaba 1.19 is-expanded: true;
8516 wakaba 1.18 text {
8517     data: 'entity ';
8518     }
8519     element {
8520     namespace-uri: null;
8521     prefix: null;
8522     local-name: 'p';
8523     text {
8524     data: 'value';
8525     }
8526     }
8527     text {
8528     data: ' with ';
8529     }
8530     element {
8531     namespace-uri: null;
8532     prefix: null;
8533     local-name: 'e';
8534     text {
8535     data: 'element';
8536     }
8537     }
8538     text {
8539     data: ' ';
8540     }
8541     }
8542     }
8543     }
8544     @@XMLTest:
8545     @@@QName: xp.doctype.internal.entity.root.element.text.in.ent.test
8546     @@@DEnt:
8547     @@@@test:value:
8548     <!DOCTYPE a [
8549     <!ENTITY entity1 "entity value">
8550     <!ENTITY entity2 "e&entity1;n">
8551     ]>
8552     <a>&entity2;</a>
8553     @@@test:domTree:
8554     document {
8555     xml-version: '1.0';
8556     xml-encoding: null;
8557     xml-standalone: false;
8558     document-type {
8559     node-name: 'a';
8560     general-entity {
8561     node-name: 'entity1';
8562     text-content: 'entity value';
8563     }
8564     general-entity {
8565     node-name: 'entity2';
8566     text { data: 'e'; }
8567     general-entity-reference {
8568     node-name: 'entity1';
8569     text-content: 'entity value';
8570     is-expanded: true;
8571     }
8572     text { data: 'n'; }
8573     }
8574     }
8575     element {
8576     namespace-uri: null;
8577     prefix: null;
8578     local-name: 'a';
8579     general-entity-reference {
8580     node-name: 'entity2';
8581     text { data: 'e'; }
8582 wakaba 1.19 is-expanded: true;
8583 wakaba 1.18 general-entity-reference {
8584     node-name: 'entity1';
8585     text {
8586     data: 'entity value';
8587     }
8588 wakaba 1.19 is-expanded: true;
8589 wakaba 1.18 }
8590     text { data: 'n'; }
8591     }
8592     }
8593     }
8594    
8595     @@XMLTest:
8596     @@@QName: xp.doctype.entity.value.charref.test
8597     @@@DEnt:
8598     @@@@test:value:
8599     <!DOCTYPE a [
8600     <!ENTITY entity1 "entity &#x21;value&#35;">
8601     <!ENTITY entity2 '&#x21;value&#35;'>
8602     ]>
8603     <a></a>
8604     @@@test:domTree:
8605     document {
8606     document-type {
8607     general-entity {
8608     node-name: 'entity1';
8609     text-content: 'entity !value#';
8610     has-replacement-tree: true;
8611     }
8612     general-entity {
8613     node-name: 'entity2';
8614     text-content: '!value#';
8615     has-replacement-tree: true;
8616     }
8617     }
8618     element { }
8619     }
8620    
8621     @@XMLTest:
8622     @@@QName: xp.predefined.in.content.test
8623     @@@DEnt:
8624     @@@@test:value:
8625     <a>_&lt;_&gt;_&quot;_&apos;_&amp;_</a>
8626     @@@test:domTree:
8627     document {
8628     element {
8629     text-content: '_<_>_"_' U+0027 '_&_';
8630     }
8631     }
8632     @@XMLTest:
8633     @@@QName: xp.predefined.in.attr.test
8634     @@@DEnt:
8635     @@@@test:value:
8636     <a at="_&lt;_&gt;_&quot;_&apos;_&amp;_"></a>
8637     @@@test:domTree:
8638     document {
8639     element {
8640     attribute {
8641     node-name: 'at';
8642     text-content: '_<_>_"_' U+0027 '_&_';
8643     }
8644     }
8645     }
8646     @@XMLTest:
8647     @@@QName: xp.predefined.in.content.in.entity.test
8648     @@@DEnt:
8649     @@@@test:value:
8650     <!DOCTYPE a [
8651     <!ENTITY ent "_&lt;_&gt;_&quot;_&apos;_&amp;_">
8652     ]>
8653     <a>&ent;</a>
8654     @@@test:domTree:
8655     document {
8656     document-type {
8657     general-entity {
8658     node-name: 'ent';
8659     text-content: '_<_>_"_' U+0027 '_&_';
8660     }
8661     }
8662     element {
8663     text-content: '_<_>_"_' U+0027 '_&_';
8664     }
8665     }
8666     @@XMLTest:
8667     @@@QName: xp.predefined.decl.ignore.test
8668     @@@DEnt:
8669     @@@@test:value:
8670     <!DOCTYPE a [
8671     <!ENTITY lt "&#x26;#x3C;">
8672     <!ENTITY gt "&#x3E;">
8673     <!ENTITY amp "&#x26;#x26;">
8674     <!ENTITY quot "&#x22;">
8675     <!ENTITY apos "&#x27;">
8676     <!ENTITY other "other">
8677     ]>
8678     <a>_&lt;_&gt;_&quot;_&apos;_&amp;_&other;_</a>
8679     @@@test:domTree:
8680     document {
8681     document-type {
8682     general-entity {
8683     node-name: 'other';
8684     text-content: 'other';
8685     }
8686     }
8687     element {
8688     text-content: '_<_>_"_' U+0027 '_&_other_';
8689     }
8690     }
8691    
8692     @@XMLTest:
8693     @@@QName: xp.doctype.internal.attr.empty.test
8694     @@@DEnt:
8695     @@@@test:value:
8696     <!DOCTYPE a [
8697     <!ATTLIST a>
8698     ]>
8699     <a></a>
8700     @@@test:domTree:
8701     document {
8702     xml-version: '1.0';
8703     xml-encoding: null;
8704     xml-standalone: false;
8705     document-type {
8706     node-name: 'a';
8707     element-type-definition {
8708     node-name: 'a';
8709     }
8710     }
8711     element {
8712     namespace-uri: null;
8713     local-name: 'a';
8714     }
8715     }
8716     @@XMLTest:
8717     @@@QName: xp.doctype.internal.attr.cdata.implied.test
8718     @@@DEnt:
8719     @@@@test:value:
8720     <!DOCTYPE a [
8721     <!ATTLIST a
8722     at CDATA #IMPLIED
8723     >
8724     ]>
8725     <a></a>
8726 wakaba 1.9 @@@test:domTree:
8727     document {
8728     xml-version: '1.0';
8729     xml-encoding: null;
8730     xml-standalone: false;
8731     document-type {
8732     node-name: 'a';
8733     element-type-definition {
8734     node-name: 'a';
8735     attribute-definition {
8736     node-name: 'at';
8737 wakaba 1.18 declared-type: const (CDATA_ATTR);
8738 wakaba 1.9 allowed-tokens: DOMStringList ();
8739 wakaba 1.18 default-type: const (IMPLIED_DEFAULT);
8740     text-content: '';
8741 wakaba 1.9 }
8742     }
8743     }
8744     element {
8745     namespace-uri: null;
8746     local-name: 'a';
8747 wakaba 1.18 }
8748     }
8749     @@XMLTest:
8750     @@@QName: xp.doctype.internal.attr.types.implied.test
8751     @@@DEnt:
8752     @@@@test:value:
8753     <!DOCTYPE a [
8754     <!ATTLIST a
8755     at1 ID #IMPLIED
8756     at2 IDREF #IMPLIED
8757     at3 IDREFS #IMPLIED
8758     at4 ENTITY #IMPLIED
8759     at5 ENTITIES #IMPLIED
8760     at6 NMTOKEN #IMPLIED
8761     at7 NMTOKENS #IMPLIED
8762     at8 NOTATION (n1 | n2|n3) #IMPLIED
8763     at9 (e1| e2| e3 ) #IMPLIED
8764     >
8765     ]>
8766     <a></a>
8767     @@@test:domTree:
8768     document {
8769     xml-version: '1.0';
8770     xml-encoding: null;
8771     xml-standalone: false;
8772     document-type {
8773     node-name: 'a';
8774     element-type-definition {
8775     node-name: 'a';
8776     attribute-definition {
8777     node-name: 'at1';
8778     declared-type: const (ID_ATTR);
8779     allowed-tokens: DOMStringList ();
8780     default-type: const (IMPLIED_DEFAULT);
8781     text-content: '';
8782     }
8783     attribute-definition {
8784     node-name: 'at2';
8785     declared-type: const (IDREF_ATTR);
8786     allowed-tokens: DOMStringList ();
8787     default-type: const (IMPLIED_DEFAULT);
8788     text-content: '';
8789     }
8790     attribute-definition {
8791     node-name: 'at3';
8792     declared-type: const (IDREFS_ATTR);
8793     allowed-tokens: DOMStringList ();
8794     default-type: const (IMPLIED_DEFAULT);
8795     text-content: '';
8796     }
8797     attribute-definition {
8798     node-name: 'at4';
8799     declared-type: const (ENTITY_ATTR);
8800     allowed-tokens: DOMStringList ();
8801     default-type: const (IMPLIED_DEFAULT);
8802     text-content: '';
8803     }
8804     attribute-definition {
8805     node-name: 'at5';
8806     declared-type: const (ENTITIES_ATTR);
8807     allowed-tokens: DOMStringList ();
8808     default-type: const (IMPLIED_DEFAULT);
8809     text-content: '';
8810     }
8811     attribute-definition {
8812     node-name: 'at6';
8813     declared-type: const (NMTOKEN_ATTR);
8814     allowed-tokens: DOMStringList ();
8815     default-type: const (IMPLIED_DEFAULT);
8816     text-content: '';
8817     }
8818     attribute-definition {
8819     node-name: 'at7';
8820     declared-type: const (NMTOKENS_ATTR);
8821     allowed-tokens: DOMStringList ();
8822     default-type: const (IMPLIED_DEFAULT);
8823     text-content: '';
8824     }
8825     attribute-definition {
8826     node-name: 'at8';
8827     declared-type: const (NOTATION_ATTR);
8828     allowed-tokens: DOMStringList ('n1', 'n2', 'n3');
8829     default-type: const (IMPLIED_DEFAULT);
8830     text-content: '';
8831     }
8832     attribute-definition {
8833     node-name: 'at9';
8834     declared-type: const (ENUMERATION_ATTR);
8835     allowed-tokens: DOMStringList ('e1', 'e2', 'e3');
8836     default-type: const (IMPLIED_DEFAULT);
8837     text-content: '';
8838     }
8839     }
8840     }
8841     element {
8842     namespace-uri: null;
8843     local-name: 'a';
8844     }
8845     }
8846     @@XMLTest:
8847     @@@QName: xp.doctype.internal.attr.cdata.defaults.test
8848     @@@DEnt:
8849     @@@@test:value:
8850     <!DOCTYPE a [
8851     <!ATTLIST a
8852     at1 CDATA #IMPLIED
8853     at2 CDATA #REQUIRED
8854     at3 CDATA #FIXED "value3"
8855     at4 CDATA "value4"
8856     at5 CDATA #FIXED 'value5'
8857     at6 CDATA 'value6'
8858     >
8859     ]>
8860     <a></a>
8861     @@@test:domTree:
8862     document {
8863     xml-version: '1.0';
8864     xml-encoding: null;
8865     xml-standalone: false;
8866     document-type {
8867     node-name: 'a';
8868     element-type-definition {
8869     node-name: 'a';
8870     attribute-definition {
8871     node-name: 'at1';
8872     declared-type: const (CDATA_ATTR);
8873     allowed-tokens: DOMStringList ();
8874     default-type: const (IMPLIED_DEFAULT);
8875     text-content: '';
8876     }
8877     attribute-definition {
8878     node-name: 'at2';
8879     declared-type: const (CDATA_ATTR);
8880     allowed-tokens: DOMStringList ();
8881     default-type: const (REQUIRED_DEFAULT);
8882     text-content: '';
8883     }
8884     attribute-definition {
8885     node-name: 'at3';
8886     declared-type: const (CDATA_ATTR);
8887     allowed-tokens: DOMStringList ();
8888     default-type: const (FIXED_DEFAULT);
8889     text-content: 'value3';
8890     }
8891     attribute-definition {
8892     node-name: 'at4';
8893     declared-type: const (CDATA_ATTR);
8894     allowed-tokens: DOMStringList ();
8895     default-type: const (EXPLICIT_DEFAULT);
8896     text-content: 'value4';
8897     }
8898     attribute-definition {
8899     node-name: 'at5';
8900     declared-type: const (CDATA_ATTR);
8901     allowed-tokens: DOMStringList ();
8902     default-type: const (FIXED_DEFAULT);
8903     text-content: 'value5';
8904     }
8905     attribute-definition {
8906     node-name: 'at6';
8907     declared-type: const (CDATA_ATTR);
8908     allowed-tokens: DOMStringList ();
8909     default-type: const (EXPLICIT_DEFAULT);
8910     text-content: 'value6';
8911     }
8912     }
8913     }
8914     element {
8915     namespace-uri: null;
8916     local-name: 'a';
8917     attribute {
8918     node-name: 'at3';
8919     text-content: 'value3';
8920     specified: false;
8921     }
8922     attribute {
8923     node-name: 'at4';
8924     text-content: 'value4';
8925     specified: false;
8926     }
8927     attribute {
8928     node-name: 'at5';
8929     text-content: 'value5';
8930     specified: false;
8931     }
8932     attribute {
8933     node-name: 'at6';
8934     text-content: 'value6';
8935     specified: false;
8936     }
8937     }
8938     }
8939    
8940     @@XMLTest:
8941     @@@QName: xp.doctype.internal.attr.cdata.default.normalize.test
8942     @@@DEnt:
8943     @@@@test:value:
8944     <!DOCTYPE a [
8945     <!ATTLIST a
8946     at CDATA " default &#x0A;value "
8947     >
8948     ]>
8949     <a></a>
8950     @@@test:domTree:
8951     document {
8952     xml-version: '1.0';
8953     xml-encoding: null;
8954     xml-standalone: false;
8955     document-type {
8956     node-name: 'a';
8957     element-type-definition {
8958     node-name: 'a';
8959     attribute-definition {
8960     node-name: 'at';
8961     declared-type: const (CDATA_ATTR);
8962     allowed-tokens: DOMStringList ();
8963     default-type: const (EXPLICIT_DEFAULT);
8964     text-content: ' default ' U+000A 'value ';
8965     }
8966     }
8967     }
8968     element {
8969     namespace-uri: null;
8970     local-name: 'a';
8971     attribute {
8972     node-name: 'at';
8973     text-content: ' default ' U+000A 'value ';
8974     specified: false;
8975     }
8976     }
8977     }
8978     @@XMLTest:
8979     @@@QName: xp.doctype.internal.attr.nmtoken.default.normalize.test
8980     @@@DEnt:
8981     @@@@test:value:
8982     <!DOCTYPE a [
8983     <!ATTLIST a
8984     at NMTOKEN " default &#x0A;value "
8985     >
8986     ]>
8987     <a></a>
8988     @@@test:domTree:
8989     document {
8990     xml-version: '1.0';
8991     xml-encoding: null;
8992     xml-standalone: false;
8993     document-type {
8994     node-name: 'a';
8995     element-type-definition {
8996     node-name: 'a';
8997     attribute-definition {
8998     node-name: 'at';
8999     declared-type: const (NMTOKEN_ATTR);
9000     allowed-tokens: DOMStringList ();
9001     default-type: const (EXPLICIT_DEFAULT);
9002     text-content: ' default ' U+000A 'value ';
9003     }
9004     }
9005     }
9006     element {
9007     namespace-uri: null;
9008     local-name: 'a';
9009     attribute {
9010     node-name: 'at';
9011     text-content: ' default ' U+000A 'value ';
9012     specified: false;
9013     }
9014     }
9015     }
9016    
9017     @@XMLTest:
9018     @@@QName: xp.doctype.attrtype.no-value.test
9019     @@@DEnt:
9020     @@@@test:value:
9021     <!DOCTYPE a>
9022     <a at=" at value "></a>
9023     @@@test:domTree:
9024     document {
9025     xml-version: '1.0';
9026     xml-encoding: null;
9027     xml-standalone: false;
9028     document-type { }
9029     element {
9030     namespace-uri: null;
9031     local-name: 'a';
9032     attribute {
9033     namespace-uri: null;
9034     local-name: 'at';
9035     value: ' at value ';
9036     text {
9037     data: ' at value ';
9038     }
9039     schema-type-info: TypeInfo (null, null);
9040     specified: true;
9041     }
9042     }
9043     }
9044     @@XMLTest:
9045     @@@QName: xp.doctype.attrtype.cdata.test
9046     @@@DEnt:
9047     @@@@test:value:
9048     <!DOCTYPE a [
9049     <!ATTLIST a
9050     at CDATA #IMPLIED
9051     >
9052     ]>
9053     <a at=" at value "></a>
9054     @@@test:domTree:
9055     document {
9056     xml-version: '1.0';
9057     xml-encoding: null;
9058     xml-standalone: false;
9059     document-type { }
9060     element {
9061     namespace-uri: null;
9062     local-name: 'a';
9063     attribute {
9064     namespace-uri: null;
9065     local-name: 'at';
9066     value: ' at value ';
9067     text {
9068     data: ' at value ';
9069     }
9070     schema-type-info:
9071     TypeInfo ('http://www.w3.org/TR/REC-xml', 'CDATA');
9072     specified: true;
9073     }
9074     }
9075     }
9076     @@XMLTest:
9077     @@@QName: xp.doctype.attrtype.nmtoken.test
9078     @@@DEnt:
9079     @@@@test:value:
9080     <!DOCTYPE a [
9081     <!ATTLIST a
9082     at NMTOKEN #IMPLIED
9083     >
9084     ]>
9085     <a at=" at value "></a>
9086     @@@test:domTree:
9087     document {
9088     xml-version: '1.0';
9089     xml-encoding: null;
9090     xml-standalone: false;
9091     document-type { }
9092     element {
9093     namespace-uri: null;
9094     local-name: 'a';
9095     attribute {
9096     namespace-uri: null;
9097     local-name: 'at';
9098     value: 'at value';
9099     text {
9100     data: ' at value ';
9101     }
9102     schema-type-info:
9103     TypeInfo ('http://www.w3.org/TR/REC-xml', 'NMTOKEN');
9104     specified: true;
9105     }
9106     }
9107     }
9108    
9109     @@XMLTest:
9110     @@@QName: xp.doctype.attr.normalization.1.test
9111     @@@DEnt:
9112     @@@@test:value:
9113     <a at=" at &#xA;value "></a>
9114     @@@test:domTree:
9115     document {
9116     element {
9117     attribute {
9118     node-name: 'at';
9119     value: ' at ' U+000A 'value ';
9120     schema-type-info: TypeInfo (null, null);
9121     specified: true;
9122     }
9123     }
9124     }
9125     @@XMLTest:
9126     @@@QName: xp.doctype.attr.normalization.2.test
9127     @@@DEnt:
9128     @@@@test:value:
9129     <a at=" at &#xD;value "></a>
9130     @@@test:domTree:
9131     document {
9132     element {
9133     attribute {
9134     value: ' at ' U+000D 'value ';
9135     schema-type-info: TypeInfo (null, null);
9136     specified: true;
9137     }
9138     }
9139     }
9140     @@XMLTest:
9141     @@@QName: xp.doctype.attr.normalization.3.test
9142     @@@DEnt:
9143     @@@@test:value:
9144     <a at=" at &#x9;value "></a>
9145     @@@test:domTree:
9146     document {
9147     element {
9148     attribute {
9149     node-name: 'at';
9150     value: ' at ' U+0009 'value ';
9151     schema-type-info: TypeInfo (null, null);
9152     specified: true;
9153     }
9154     }
9155     }
9156    
9157     @@XMLTest:
9158     @@@QName: xp.doctype.attr.specified.1.test
9159     @@@DEnt:
9160     @@@@test:value:
9161     <!DOCTYPE a [
9162     <!ATTLIST a
9163     at CDATA "default"
9164     >
9165     ]>
9166     <a></a>
9167     @@@test:domTree:
9168     document {
9169     document-type { }
9170     element {
9171     attribute {
9172     node-name: 'at';
9173     value: 'default';
9174     specified: false;
9175     }
9176     }
9177     }
9178     @@XMLTest:
9179     @@@QName: xp.doctype.attr.specified.2.test
9180     @@@DEnt:
9181     @@@@test:value:
9182     <!DOCTYPE a [
9183     <!ATTLIST a
9184     at CDATA "default"
9185     >
9186     ]>
9187     <a at2="specified"></a>
9188     @@@test:domTree:
9189     document {
9190     document-type { }
9191     element {
9192     attribute {
9193     node-name: 'at';
9194     value: 'default';
9195     specified: false;
9196     }
9197     attribute {
9198     node-name: 'at2';
9199     value: 'specified';
9200     specified: true;
9201     }
9202     }
9203     }
9204     @@XMLTest:
9205     @@@QName: xp.doctype.attr.specified.3.test
9206     @@@DEnt:
9207     @@@@test:value:
9208     <!DOCTYPE a [
9209     <!ATTLIST a
9210     at CDATA "default"
9211     >
9212     ]>
9213     <a at="specified"></a>
9214     @@@test:domTree:
9215     document {
9216     document-type { }
9217     element {
9218     attribute {
9219     node-name: 'at';
9220     value: 'specified';
9221     specified: true;
9222     }
9223     }
9224     }
9225    
9226     @@XMLTest:
9227     @@@QName: xp.attr.literal.charref.test
9228     @@@DEnt:
9229     @@@@test:value:
9230     <a at1 = "value&#33;_&#x25;value"
9231     at2 = 'value&#x25;_&#33;value'></a>
9232     @@@test:domTree:
9233     document {
9234     element {
9235     attribute {
9236     node-name: 'at1';
9237     text-content: 'value!_%value';
9238     }
9239     attribute {
9240     node-name: 'at2';
9241     text-content: 'value%_!value';
9242     }
9243     }
9244     }
9245     @@XMLTest:
9246     @@@QName: xp.attr.literal.entref.test
9247     @@@DEnt:
9248     @@@@test:value:
9249     <!DOCTYPE a [
9250     <!ENTITY ent "entity&#x26;#33;_&#x26;#x29;value">
9251     ]>
9252     <a at1 = "value&ent;value"
9253     at2 = 'value&ent;value'></a>
9254     @@@test:domTree:
9255     document {
9256     document-type {
9257     general-entity {
9258     node-name: 'ent';
9259     text-content: 'entity!_)value';
9260     }
9261     }
9262     element {
9263     attribute {
9264     node-name: 'at1';
9265     text-content: 'valueentity!_)valuevalue';
9266     }
9267     attribute {
9268     node-name: 'at2';
9269     text-content: 'valueentity!_)valuevalue';
9270     }
9271     }
9272     }
9273     @@XMLTest:
9274     @@@QName: xp.attr.literal.entref.nest.test
9275     @@@DEnt:
9276     @@@@test:value:
9277     <!DOCTYPE a [
9278     <!ENTITY ent1 "entity&#x26;#33;_&#x26;#x29;value">
9279     <!ENTITY ent2 "@&ent1;@">
9280     ]>
9281     <a at1 = "value&ent2;value"
9282     at2 = 'value&ent2;value'></a>
9283     @@@test:domTree:
9284     document {
9285     document-type {
9286     general-entity {
9287     node-name: 'ent1';
9288     text-content: 'entity!_)value';
9289     }
9290     general-entity {
9291     node-name: 'ent2';
9292     text-content: '@entity!_)value@';
9293     }
9294     }
9295     element {
9296     attribute {
9297     node-name: 'at1';
9298     text-content: 'value@entity!_)value@value';
9299     }
9300     attribute {
9301     node-name: 'at2';
9302     text-content: 'value@entity!_)value@value';
9303     }
9304     }
9305     }
9306    
9307     @@XMLTest:
9308     @@@QName: xp.element.content.ncr.1.test
9309     @@@DEnt:
9310     @@@@test:value:
9311     <e>&#33;</e>
9312     @@@test:domTree:
9313     document {
9314     element {
9315     text-content: '!';
9316     }
9317     }
9318     @@XMLTest:
9319     @@@QName: xp.element.content.ncr.2.test
9320     @@@DEnt:
9321     @@@@test:value:
9322     <e>aaaa&#33;bbbb</e>
9323     @@@test:domTree:
9324     document {
9325     element {
9326     text-content: 'aaaa!bbbb';
9327     }
9328     }
9329     @@XMLTest:
9330     @@@QName: xp.attrval.ncr.1.test
9331     @@@DEnt:
9332     @@@@test:value:
9333     <e a="&#33;"/>
9334     @@@test:domTree:
9335     document {
9336     element {
9337     attribute {
9338     node-name: 'a';
9339     text-content: '!';
9340     }
9341     }
9342     }
9343     @@XMLTest:
9344     @@@QName: xp.attrval.ncr.2.test
9345     @@@DEnt:
9346     @@@@test:value:
9347     <e a="aaaaa&#33;bbbbb"/>
9348     @@@test:domTree:
9349     document {
9350     element {
9351     attribute {
9352     node-name: 'a';
9353     text-content: 'aaaaa!bbbbb';
9354     }
9355     }
9356     }
9357     @@XMLTest:
9358     @@@QName: xp.attrval.ncr.3.test
9359     @@@DEnt:
9360     @@@@test:value:
9361     <e a='&#33;'/>
9362     @@@test:domTree:
9363     document {
9364     element {
9365     attribute {
9366     node-name: 'a';
9367     text-content: '!';
9368     }
9369     }
9370     }
9371     @@XMLTest:
9372     @@@QName: xp.attrval.ncr.4.test
9373     @@@DEnt:
9374     @@@@test:value:
9375     <e a='aaaaa&#33;bbbbb'/>
9376     @@@test:domTree:
9377     document {
9378     element {
9379     attribute {
9380     node-name: 'a';
9381     text-content: 'aaaaa!bbbbb';
9382     }
9383     }
9384     }
9385     @@XMLTest:
9386     @@@QName: xp.entval.ncr.1.test
9387     @@@DEnt:
9388     @@@@test:value:
9389     <!DOCTYPE e [
9390     <!ENTITY ent "&#33;">
9391     ]>
9392     <e/>
9393     @@@test:domTree:
9394     document {
9395     document-type {
9396     general-entity {
9397     node-name: 'ent';
9398     text-content: '!';
9399     }
9400     }
9401     element { }
9402     }
9403     @@XMLTest:
9404     @@@QName: xp.entval.ncr.2.test
9405     @@@DEnt:
9406     @@@@test:value:
9407     <!DOCTYPE e [
9408     <!ENTITY ent "aaaaa&#33;bbbbb">
9409     ]>
9410     <e/>
9411     @@@test:domTree:
9412     document {
9413     document-type {
9414     general-entity {
9415     node-name: 'ent';
9416     text-content: 'aaaaa!bbbbb';
9417     }
9418     }
9419     element { }
9420     }
9421     @@XMLTest:
9422     @@@QName: xp.element.content.reptxt.ncr.1.test
9423     @@@DEnt:
9424     @@@@test:value:
9425     <!DOCTYPE e [
9426     <!ENTITY ent "&#38;#33;">
9427     ]>
9428     <e>&ent;</e>
9429     @@@test:domTree:
9430     document {
9431     document-type { }
9432     element {
9433     general-entity-reference {
9434     node-name: 'ent';
9435     text-content: '!';
9436 wakaba 1.19 is-expanded: true;
9437 wakaba 1.18 }
9438     }
9439     }
9440     @@XMLTest:
9441     @@@QName: xp.element.content.reptxt.ncr.2.test
9442     @@@DEnt:
9443     @@@@test:value:
9444     <!DOCTYPE e [
9445     <!ENTITY ent "aaaaa&#38;#33;bbbbb">
9446     ]>
9447     <e>&ent;</e>
9448     @@@test:domTree:
9449     document {
9450     document-type { }
9451     element {
9452     general-entity-reference {
9453     node-name: 'ent';
9454     text-content: 'aaaaa!bbbbb';
9455 wakaba 1.19 is-expanded: true;
9456 wakaba 1.18 }
9457     }
9458     }
9459     @@XMLTest:
9460     @@@QName: xp.element.content.reptxt.reptxt.ncr.1.test
9461     @@@DEnt:
9462     @@@@test:value:
9463     <!DOCTYPE e [
9464     <!ENTITY ent "&#38;#33;">
9465     <!ENTITY ent2 "&ent;">
9466     ]>
9467     <e>&ent2;</e>
9468     @@@test:domTree:
9469     document {
9470     document-type { }
9471     element {
9472     general-entity-reference {
9473     node-name: 'ent2';
9474     general-entity-reference {
9475     node-name: 'ent';
9476     text-content: '!';
9477 wakaba 1.19 is-expanded: true;
9478 wakaba 1.18 }
9479 wakaba 1.19 is-expanded: true;
9480 wakaba 1.18 }
9481     }
9482     }
9483     @@XMLTest:
9484     @@@QName: xp.element.content.reptxt.reptxt.ncr.2.test
9485     @@@DEnt:
9486     @@@@test:value:
9487     <!DOCTYPE e [
9488     <!ENTITY ent "aa&#38;#33;bb">
9489     <!ENTITY ent2 "&ent;">
9490     ]>
9491     <e>&ent2;</e>
9492     @@@test:domTree:
9493     document {
9494     document-type { }
9495     element {
9496     general-entity-reference {
9497     node-name: 'ent2';
9498     general-entity-reference {
9499     node-name: 'ent';
9500     text-content: 'aa!bb';
9501 wakaba 1.19 is-expanded: true;
9502 wakaba 1.18 }
9503 wakaba 1.19 is-expanded: true;
9504 wakaba 1.18 }
9505     }
9506     }
9507     @@XMLTest:
9508     @@@QName: xp.attval.reptxt.ncr.1.test
9509     @@@DEnt:
9510     @@@@test:value:
9511     <!DOCTYPE e [
9512     <!ENTITY ent "&#38;#33;">
9513     ]>
9514     <e a="&ent;"/>
9515     @@@test:domTree:
9516     document {
9517     document-type { }
9518     element {
9519     attribute {
9520     node-name: 'a';
9521     general-entity-reference {
9522     node-name: 'ent';
9523     text-content: '!';
9524 wakaba 1.19 is-expanded: true;
9525 wakaba 1.18 }
9526     }
9527     }
9528     }
9529     @@XMLTest:
9530     @@@QName: xp.attval.reptxt.ncr.2.test
9531     @@@DEnt:
9532     @@@@test:value:
9533     <!DOCTYPE e [
9534     <!ENTITY ent "aaaaa&#38;#33;bbbbb">
9535     ]>
9536     <e a="&ent;"/>
9537     @@@test:domTree:
9538     document {
9539     document-type { }
9540     element {
9541     attribute {
9542     node-name: 'a';
9543     general-entity-reference {
9544     node-name: 'ent';
9545     text-content: 'aaaaa!bbbbb';
9546 wakaba 1.19 is-expanded: true;
9547 wakaba 1.18 }
9548     }
9549     }
9550     }
9551     @@XMLTest:
9552     @@@QName: xp.attval.reptxt.reptxt.ncr.1.test
9553     @@@DEnt:
9554     @@@@test:value:
9555     <!DOCTYPE e [
9556     <!ENTITY ent "&#38;#33;">
9557     <!ENTITY ent2 "&ent;">
9558     ]>
9559     <e a="&ent2;"/>
9560     @@@test:domTree:
9561     document {
9562     document-type { }
9563     element {
9564     attribute {
9565     node-name: 'a';
9566     general-entity-reference {
9567     node-name: 'ent2';
9568 wakaba 1.19 is-expanded: true;
9569 wakaba 1.18 general-entity-reference {
9570     node-name: 'ent';
9571     text-content: '!';
9572 wakaba 1.19 is-expanded: true;
9573 wakaba 1.18 }
9574     }
9575     }
9576     }
9577     }
9578     @@XMLTest:
9579     @@@QName: xp.attval.reptxt.reptxt.ncr.2.test
9580     @@@DEnt:
9581     @@@@test:value:
9582     <!DOCTYPE e [
9583     <!ENTITY ent "aa&#38;#33;bb">
9584     <!ENTITY ent2 "&ent;">
9585     ]>
9586     <e a="&ent2;"/>
9587     @@@test:domTree:
9588     document {
9589     document-type { }
9590     element {
9591     attribute {
9592     node-name: 'a';
9593     general-entity-reference {
9594     node-name: 'ent2';
9595 wakaba 1.19 is-expanded: true;
9596 wakaba 1.18 general-entity-reference {
9597     node-name: 'ent';
9598     text-content: 'aa!bb';
9599 wakaba 1.19 is-expanded: true;
9600 wakaba 1.18 }
9601     }
9602     }
9603     }
9604     }
9605    
9606     @@XMLTest:
9607     @@@QName: xp.element.content.hcr.1.test
9608     @@@DEnt:
9609     @@@@test:value:
9610     <e>&#x21;</e>
9611     @@@test:domTree:
9612     document {
9613     element {
9614     text-content: '!';
9615     }
9616     }
9617     @@XMLTest:
9618     @@@QName: xp.element.content.hcr.2.test
9619     @@@DEnt:
9620     @@@@test:value:
9621     <e>aaaa&#x21;bbbb</e>
9622     @@@test:domTree:
9623     document {
9624     element {
9625     text-content: 'aaaa!bbbb';
9626     }
9627     }
9628     @@XMLTest:
9629     @@@QName: xp.attrval.hcr.1.test
9630     @@@DEnt:
9631     @@@@test:value:
9632     <e a="&#x21;"/>
9633     @@@test:domTree:
9634     document {
9635     element {
9636     attribute {
9637     node-name: 'a';
9638     text-content: '!';
9639     }
9640     }
9641     }
9642     @@XMLTest:
9643     @@@QName: xp.attrval.hcr.2.test
9644     @@@DEnt:
9645     @@@@test:value:
9646     <e a="aaaaa&#x21;bbbbb"/>
9647     @@@test:domTree:
9648     document {
9649     element {
9650     attribute {
9651     node-name: 'a';
9652     text-content: 'aaaaa!bbbbb';
9653     }
9654     }
9655     }
9656     @@XMLTest:
9657     @@@QName: xp.attrval.hcr.3.test
9658     @@@DEnt:
9659     @@@@test:value:
9660     <e a='&#x21;'/>
9661     @@@test:domTree:
9662     document {
9663     element {
9664     attribute {
9665     node-name: 'a';
9666     text-content: '!';
9667     }
9668     }
9669     }
9670     @@XMLTest:
9671     @@@QName: xp.attrval.hcr.4.test
9672     @@@DEnt:
9673     @@@@test:value:
9674     <e a='aaaaa&#x21;bbbbb'/>
9675     @@@test:domTree:
9676     document {
9677     element {
9678     attribute {
9679     node-name: 'a';
9680     text-content: 'aaaaa!bbbbb';
9681     }
9682     }
9683     }
9684     @@XMLTest:
9685     @@@QName: xp.entval.hcr.1.test
9686     @@@DEnt:
9687     @@@@test:value:
9688     <!DOCTYPE e [
9689     <!ENTITY ent "&#x21;">
9690     ]>
9691     <e/>
9692     @@@test:domTree:
9693     document {
9694     document-type {
9695     general-entity {
9696     node-name: 'ent';
9697     text-content: '!';
9698 wakaba 1.10 }
9699 wakaba 1.9 }
9700 wakaba 1.18 element { }
9701 wakaba 1.9 }
9702     @@XMLTest:
9703 wakaba 1.18 @@@QName: xp.entval.hcr.2.test
9704 wakaba 1.9 @@@DEnt:
9705     @@@@test:value:
9706 wakaba 1.18 <!DOCTYPE e [
9707     <!ENTITY ent "aaaaa&#x21;bbbbb">
9708     ]>
9709     <e/>
9710 wakaba 1.9 @@@test:domTree:
9711     document {
9712 wakaba 1.18 document-type {
9713     general-entity {
9714     node-name: 'ent';
9715     text-content: 'aaaaa!bbbbb';
9716 wakaba 1.9 }
9717     }
9718 wakaba 1.18 element { }
9719 wakaba 1.9 }
9720     @@XMLTest:
9721 wakaba 1.18 @@@QName: xp.element.content.reptxt.hcr.1.test
9722 wakaba 1.9 @@@DEnt:
9723     @@@@test:value:
9724 wakaba 1.18 <!DOCTYPE e [
9725     <!ENTITY ent "&#38;#x21;">
9726 wakaba 1.9 ]>
9727 wakaba 1.18 <e>&ent;</e>
9728 wakaba 1.9 @@@test:domTree:
9729     document {
9730     document-type { }
9731     element {
9732 wakaba 1.18 general-entity-reference {
9733     node-name: 'ent';
9734     text-content: '!';
9735 wakaba 1.19 is-expanded: true;
9736 wakaba 1.9 }
9737     }
9738     }
9739     @@XMLTest:
9740 wakaba 1.18 @@@QName: xp.element.content.reptxt.hcr.2.test
9741 wakaba 1.9 @@@DEnt:
9742     @@@@test:value:
9743 wakaba 1.18 <!DOCTYPE e [
9744     <!ENTITY ent "aaaaa&#38;#x21;bbbbb">
9745 wakaba 1.9 ]>
9746 wakaba 1.18 <e>&ent;</e>
9747 wakaba 1.9 @@@test:domTree:
9748     document {
9749     document-type { }
9750     element {
9751 wakaba 1.18 general-entity-reference {
9752     node-name: 'ent';
9753     text-content: 'aaaaa!bbbbb';
9754 wakaba 1.19 is-expanded: true;
9755 wakaba 1.9 }
9756     }
9757     }
9758     @@XMLTest:
9759 wakaba 1.18 @@@QName: xp.element.content.reptxt.reptxt.hcr.1.test
9760 wakaba 1.9 @@@DEnt:
9761     @@@@test:value:
9762 wakaba 1.18 <!DOCTYPE e [
9763     <!ENTITY ent "&#38;#x21;">
9764     <!ENTITY ent2 "&ent;">
9765     ]>
9766     <e>&ent2;</e>
9767 wakaba 1.9 @@@test:domTree:
9768     document {
9769 wakaba 1.18 document-type { }
9770 wakaba 1.9 element {
9771 wakaba 1.18 general-entity-reference {
9772     node-name: 'ent2';
9773 wakaba 1.19 is-expanded: true;
9774 wakaba 1.18 general-entity-reference {
9775     node-name: 'ent';
9776     text-content: '!';
9777 wakaba 1.19 is-expanded: true;
9778 wakaba 1.18 }
9779 wakaba 1.9 }
9780     }
9781     }
9782     @@XMLTest:
9783 wakaba 1.18 @@@QName: xp.element.content.reptxt.reptxt.hcr.2.test
9784 wakaba 1.9 @@@DEnt:
9785     @@@@test:value:
9786 wakaba 1.18 <!DOCTYPE e [
9787     <!ENTITY ent "aa&#38;#x21;bb">
9788     <!ENTITY ent2 "&ent;">
9789     ]>
9790     <e>&ent2;</e>
9791 wakaba 1.9 @@@test:domTree:
9792     document {
9793 wakaba 1.18 document-type { }
9794 wakaba 1.9 element {
9795 wakaba 1.18 general-entity-reference {
9796     node-name: 'ent2';
9797 wakaba 1.19 is-expanded: true;
9798 wakaba 1.18 general-entity-reference {
9799     node-name: 'ent';
9800 wakaba 1.19 is-expanded: true;
9801 wakaba 1.18 text-content: 'aa!bb';
9802     }
9803 wakaba 1.9 }
9804     }
9805     }
9806     @@XMLTest:
9807 wakaba 1.18 @@@QName: xp.attval.reptxt.hcr.1.test
9808 wakaba 1.9 @@@DEnt:
9809     @@@@test:value:
9810 wakaba 1.18 <!DOCTYPE e [
9811     <!ENTITY ent "&#38;#x21;">
9812     ]>
9813     <e a="&ent;"/>
9814 wakaba 1.9 @@@test:domTree:
9815     document {
9816 wakaba 1.18 document-type { }
9817 wakaba 1.9 element {
9818     attribute {
9819 wakaba 1.18 node-name: 'a';
9820     general-entity-reference {
9821     node-name: 'ent';
9822 wakaba 1.19 is-expanded: true;
9823 wakaba 1.18 text-content: '!';
9824     }
9825 wakaba 1.10 }
9826     }
9827     }
9828     @@XMLTest:
9829 wakaba 1.18 @@@QName: xp.attval.reptxt.hcr.2.test
9830 wakaba 1.10 @@@DEnt:
9831     @@@@test:value:
9832 wakaba 1.18 <!DOCTYPE e [
9833     <!ENTITY ent "aaaaa&#38;#x21;bbbbb">
9834 wakaba 1.10 ]>
9835 wakaba 1.18 <e a="&ent;"/>
9836 wakaba 1.10 @@@test:domTree:
9837     document {
9838     document-type { }
9839     element {
9840     attribute {
9841 wakaba 1.18 node-name: 'a';
9842     general-entity-reference {
9843     node-name: 'ent';
9844 wakaba 1.19 is-expanded: true;
9845 wakaba 1.18 text-content: 'aaaaa!bbbbb';
9846     }
9847 wakaba 1.10 }
9848     }
9849     }
9850     @@XMLTest:
9851 wakaba 1.18 @@@QName: xp.attval.reptxt.reptxt.hcr.1.test
9852 wakaba 1.10 @@@DEnt:
9853     @@@@test:value:
9854 wakaba 1.18 <!DOCTYPE e [
9855     <!ENTITY ent "&#38;#x21;">
9856     <!ENTITY ent2 "&ent;">
9857 wakaba 1.10 ]>
9858 wakaba 1.18 <e a="&ent2;"/>
9859 wakaba 1.10 @@@test:domTree:
9860     document {
9861     document-type { }
9862     element {
9863     attribute {
9864 wakaba 1.18 node-name: 'a';
9865     general-entity-reference {
9866     node-name: 'ent2';
9867 wakaba 1.19 is-expanded: true;
9868 wakaba 1.18 general-entity-reference {
9869     node-name: 'ent';
9870 wakaba 1.19 is-expanded: true;
9871 wakaba 1.18 text-content: '!';
9872     }
9873     }
9874 wakaba 1.10 }
9875     }
9876     }
9877     @@XMLTest:
9878 wakaba 1.18 @@@QName: xp.attval.reptxt.reptxt.hcr.2.test
9879 wakaba 1.10 @@@DEnt:
9880     @@@@test:value:
9881 wakaba 1.18 <!DOCTYPE e [
9882     <!ENTITY ent "aa&#38;#x21;bb">
9883     <!ENTITY ent2 "&ent;">
9884 wakaba 1.10 ]>
9885 wakaba 1.18 <e a="&ent2;"/>
9886 wakaba 1.10 @@@test:domTree:
9887     document {
9888     document-type { }
9889     element {
9890     attribute {
9891 wakaba 1.18 node-name: 'a';
9892     general-entity-reference {
9893     node-name: 'ent2';
9894 wakaba 1.19 is-expanded: true;
9895 wakaba 1.18 general-entity-reference {
9896     node-name: 'ent';
9897 wakaba 1.19 is-expanded: true;
9898 wakaba 1.18 text-content: 'aa!bb';
9899     }
9900     }
9901 wakaba 1.11 }
9902     }
9903     }
9904    
9905     @@XMLTest:
9906 wakaba 1.18 @@@QName: xp.element.content.ncr.legal.char.1.0.1.test
9907     @@@DEnt:
9908     @@@@test:value:
9909     <?xml version="1.0"?>
9910     <e>&#0;</e>
9911     @@@c:erred: <[[xp|wf-legal-character]]> { (2, 4)..(2, 7); }
9912     @@XMLTest:
9913     @@@QName: xp.element.content.ncr.legal.char.1.1.1.test
9914     @@@DEnt:
9915     @@@@test:value:
9916     <?xml version="1.1"?>
9917     <e>&#0;</e>
9918     @@@c:erred: <[[xp|wf-legal-character]]> { (2, 4)..(2, 7); }
9919     @@XMLTest:
9920     @@@QName: xp.element.content.ncr.legal.char.1.0.2.test
9921     @@@DEnt:
9922     @@@@test:value:
9923     <?xml version="1.0"?>
9924     <e>&#1;</e>
9925     @@@c:erred: <[[xp|wf-legal-character]]> { (2, 4)..(2, 7); }
9926     @@XMLTest:
9927     @@@QName: xp.element.content.ncr.legal.char.1.1.2.test
9928 wakaba 1.11 @@@DEnt:
9929     @@@@test:value:
9930 wakaba 1.18 <?xml version="1.1"?>
9931     <e>&#1;</e>
9932 wakaba 1.11 @@@test:domTree:
9933     document {
9934 wakaba 1.18 xml-version: '1.1';
9935 wakaba 1.11 element {
9936 wakaba 1.18 text-content: U+0001;
9937 wakaba 1.11 }
9938     }
9939     @@XMLTest:
9940 wakaba 1.18 @@@QName: xp.element.content.hcr.legal.char.1.0.1.test
9941     @@@DEnt:
9942     @@@@test:value:
9943     <?xml version="1.0"?>
9944     <e>&#x0;</e>
9945     @@@c:erred: <[[xp|wf-legal-character]]> { (2, 4)..(2, 8); }
9946     @@XMLTest:
9947     @@@QName: xp.element.content.hcr.legal.char.1.1.1.test
9948     @@@DEnt:
9949     @@@@test:value:
9950     <?xml version="1.1"?>
9951     <e>&#x0;</e>
9952     @@@c:erred: <[[xp|wf-legal-character]]> { (2, 4)..(2, 8); }
9953     @@XMLTest:
9954     @@@QName: xp.element.content.hcr.legal.char.1.0.2.test
9955 wakaba 1.11 @@@DEnt:
9956     @@@@test:value:
9957 wakaba 1.18 <?xml version="1.0"?>
9958     <e>&#x1;</e>
9959     @@@c:erred: <[[xp|wf-legal-character]]> { (2, 4)..(2, 8); }
9960 wakaba 1.11 @@XMLTest:
9961 wakaba 1.18 @@@QName: xp.element.content.hcr.legal.char.1.1.2.test
9962 wakaba 1.11 @@@DEnt:
9963     @@@@test:value:
9964 wakaba 1.18 <?xml version="1.1"?>
9965     <e>&#x1;</e>
9966 wakaba 1.11 @@@test:domTree:
9967     document {
9968 wakaba 1.18 xml-version: '1.1';
9969 wakaba 1.11 element {
9970 wakaba 1.18 text-content: U+0001;
9971 wakaba 1.6 }
9972     }
9973    
9974 wakaba 1.19 @@XMLTest:
9975     @@@QName: xp.element.content.ger.entity.declared.nodtd.1.test
9976     @@@DEnt:
9977     @@@@test:value:
9978     <p>&entity;</p>
9979     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 4)..(1, 11); }
9980     @@XMLTest:
9981     @@@QName: xp.element.content.ger.entity.declared.nodtd.2.test
9982     @@@DEnt:
9983     @@@@test:value:
9984     <?xml version="1.0" standalone="yes"?>
9985     <p>&entity;</p>
9986     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 4)..(2, 11); }
9987     @@XMLTest:
9988     @@@QName: xp.element.content.ger.entity.declared.nodtd.3.test
9989     @@@DEnt:
9990     @@@@test:value:
9991     <?xml version="1.0" standalone="no"?>
9992     <p>&entity;</p>
9993     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 4)..(2, 11); }
9994     @@XMLTest:
9995     @@@QName: xp.element.content.ger.entity.declared.nodtd.-1.test
9996     @@@DEnt:
9997     @@@@test:value:
9998     <p>&lt;&gt;&amp;&quot;&apos;</p>
9999     @@@test:domTree:
10000     document {
10001     element {
10002     text-content: '<>&"' U+0027;
10003     }
10004     }
10005     @@XMLTest:
10006     @@@QName: xp.element.content.ger.entity.declared.nopref.1.test
10007     @@@DEnt:
10008     @@@@test:value:
10009     <!DOCTYPE p []>
10010     <p>&entity;</p>
10011     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 4)..(2, 11); }
10012     @@XMLTest:
10013     @@@QName: xp.element.content.ger.entity.declared.nopref.2.test
10014     @@@DEnt:
10015     @@@@test:value:
10016     <!DOCTYPE p [
10017     <!ENTITY other "aa">
10018     <!ENTITY % another "aa">
10019     ]>
10020     <p>&entity;</p>
10021     @@@c:erred: <[[xp|wf-entity-declared]]> { (5, 4)..(5, 11); }
10022     @@XMLTest:
10023     @@@QName: xp.element.content.ger.entity.declared.nopref.3.test
10024     @@@DEnt:
10025     @@@@test:value:
10026     <?xml version="1.0" standalone="yes"?>
10027     <!DOCTYPE p []>
10028     <p>&entity;</p>
10029     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 4)..(3, 11); }
10030     @@XMLTest:
10031     @@@QName: xp.element.content.ger.entity.declared.nopref.4.test
10032     @@@DEnt:
10033     @@@@test:value:
10034     <?xml version="1.0" standalone="no"?>
10035     <!DOCTYPE p []>
10036     <p>&entity;</p>
10037     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 4)..(3, 11); }
10038     @@XMLTest:
10039     @@@QName: xp.element.content.ger.entity.declared.nopref.5.test
10040     @@@DEnt:
10041     @@@@test:value:
10042     <?xml version="1.0" standalone="yes"?>
10043     <!DOCTYPE p [
10044     <!ENTITY other "aa">
10045     <!ENTITY % another "aa">
10046     ]>
10047     <p>&entity;</p>
10048     @@@c:erred: <[[xp|wf-entity-declared]]> { (6, 4)..(6, 11); }
10049     @@XMLTest:
10050     @@@QName: xp.element.content.ger.entity.declared.nopref.6.test
10051     @@@DEnt:
10052     @@@@test:value:
10053     <?xml version="1.0" standalone="no"?>
10054     <!DOCTYPE p [
10055     <!ENTITY other "aa">
10056     <!ENTITY % another "aa">
10057     ]>
10058     <p>&entity;</p>
10059     @@@c:erred: <[[xp|wf-entity-declared]]> { (6, 4)..(6, 11); }
10060     @@XMLTest:
10061     @@@QName: xp.element.content.ger.entity.declared.nopref.-1.test
10062     @@@DEnt:
10063     @@@@test:value:
10064     <!DOCTYPE p [
10065     <!ENTITY entity "value">
10066     ]>
10067     <p>&entity;</p>
10068     @@@test:domTree:
10069     document {
10070     document-type {
10071     general-entity {
10072     node-name: 'entity';
10073     text-content: 'value';
10074     }
10075     }
10076     element {
10077 wakaba 1.20 general-entity-reference {
10078 wakaba 1.19 node-name: 'entity';
10079 wakaba 1.20 is-expanded: true;
10080 wakaba 1.19 text-content: 'value';
10081     }
10082     }
10083     }
10084     @@XMLTest:
10085     @@@QName: xp.element.content.ger.entity.declared.nopref.-2.test
10086     @@@DEnt:
10087     @@@@test:value:
10088     <!DOCTYPE p [
10089     <!ENTITY entity "value">
10090     <!ENTITY another SYSTEM "another">
10091     ]>
10092     <p>&entity;</p>
10093     @@@test:domTree:
10094     document {
10095     document-type {
10096     general-entity {
10097     node-name: 'entity';
10098     text-content: 'value';
10099     }
10100 wakaba 1.20 general-entity {
10101     node-name: 'another';
10102     public-id: null;
10103     system-id: 'another';
10104     }
10105 wakaba 1.19 }
10106     element {
10107 wakaba 1.20 general-entity-reference {
10108 wakaba 1.19 node-name: 'entity';
10109 wakaba 1.20 is-expanded: true;
10110 wakaba 1.19 text-content: 'value';
10111     }
10112     }
10113     }
10114     @@XMLTest:
10115     @@@QName: xp.element.content.ger.entity.declared.standalone.1.test
10116     @@@DEnt:
10117     @@@@test:value:
10118     <?xml version="1.0" standalone="yes"?>
10119     <p>&entity;</p>
10120     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 4)..(2, 11); }
10121     @@XMLTest:
10122     @@@QName: xp.element.content.ger.entity.declared.standalone.2.test
10123     @@@DEnt:
10124     @@@@test:value:
10125     <?xml version="1.0" standalone="yes"?>
10126     <!DOCTYPE p []>
10127     <p>&entity;</p>
10128     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 4)..(3, 11); }
10129     @@XMLTest:
10130     @@@QName: xp.element.content.ger.entity.declared.standalone.3.test
10131     @@@DEnt:
10132     @@@@test:value:
10133     <?xml version="1.0" standalone="yes"?>
10134     <!DOCTYPE p [
10135     <!ENTITY % para "<!-- -->">
10136     %para;
10137     ]>
10138     <p>&entity;</p>
10139     @@@c:erred: <[[xp|wf-entity-declared]]> { (6, 4)..(6, 11); }
10140     @@XMLTest:
10141     @@@QName: xp.element.content.ger.entity.declared.standalone.-1.test
10142     @@@DEnt:
10143     @@@@test:value:
10144     <?xml version="1.0" standalone="no"?>
10145     <!DOCTYPE p [
10146     <!ENTITY % para "<!-- -->">
10147     %para;
10148     ]>
10149     <p>&entity;</p>
10150     @@@test:domTree:
10151     document {
10152     document-type { }
10153     element {
10154     general-entity-reference {
10155     is-expanded: false;
10156     }
10157     }
10158     }
10159     @@XMLTest:
10160     @@@QName: xp.element.content.ger.entity.declared.standalone.-2.test
10161     @@@DEnt:
10162     @@@@test:value:
10163     <!DOCTYPE p [
10164     <!ENTITY % para "<!-- -->">
10165     %para;
10166     ]>
10167     <p>&entity;</p>
10168     @@@test:domTree:
10169     document {
10170     document-type { }
10171     element {
10172     general-entity-reference {
10173     is-expanded: false;
10174     }
10175     }
10176     }
10177     @@XMLTest:
10178     @@@QName: xp.element.content.ger.entity.declared.standalone.4.test
10179     @@@DEnt:
10180     @@@@test:value:
10181     <?xml version="1.0" standalone="yes"?>
10182     <!DOCTYPE p [
10183     <!ENTITY % para SYSTEM "para">
10184     %para;
10185     ]>
10186     <p>&entity;</p>
10187     @@@c:erred: <[[xp|wf-entity-declared]]> { (6, 4)..(6, 11); }
10188     @@XMLTest:
10189     @@@QName: xp.element.content.ger.entity.declared.standalone.-3.test
10190     @@@DEnt:
10191     @@@@test:value:
10192     <?xml version="1.0" standalone="no"?>
10193     <!DOCTYPE p [
10194     <!ENTITY % para SYSTEM "para">
10195     %para;
10196     ]>
10197     <p>&entity;</p>
10198     @@@test:domTree:
10199     document {
10200     document-type { }
10201     element {
10202     general-entity-reference {
10203     is-expanded: false;
10204     }
10205     }
10206     }
10207     @@XMLTest:
10208     @@@QName: xp.element.content.ger.entity.declared.standalone.-4.test
10209     @@@DEnt:
10210     @@@@test:value:
10211     <!DOCTYPE p [
10212     <!ENTITY % para SYSTEM "para">
10213     %para;
10214     ]>
10215     <p>&entity;</p>
10216     @@@test:domTree:
10217     document {
10218     document-type { }
10219     element {
10220     general-entity-reference {
10221     is-expanded: false;
10222     }
10223     }
10224     }
10225     @@XMLTest:
10226     @@@QName: xp.element.content.ger.entity.declared.standalone.5.test
10227     @@@DEnt:
10228     @@@@test:value:
10229     <?xml version="1.0" standalone="yes"?>
10230     <!DOCTYPE p SYSTEM "dtd">
10231     <p>&entity;</p>
10232     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 4)..(3, 11); }
10233     @@XMLTest:
10234     @@@QName: xp.element.content.ger.entity.declared.standalone.-5.test
10235     @@@DEnt:
10236     @@@@test:value:
10237     <?xml version="1.0" standalone="no"?>
10238     <!DOCTYPE p SYSTEM "dtd">
10239     <p>&entity;</p>
10240     @@@test:domTree:
10241     document {
10242     document-type { }
10243     element {
10244     general-entity-reference {
10245     is-expanded: false;
10246     }
10247     }
10248     }
10249     @@XMLTest:
10250     @@@QName: xp.element.content.ger.entity.declared.standalone.-6.test
10251     @@@DEnt:
10252     @@@@test:value:
10253     <!DOCTYPE p SYSTEM "dtd">
10254     <p>&entity;</p>
10255     @@@test:domTree:
10256     document {
10257     document-type { }
10258     element {
10259     general-entity-reference {
10260     is-expanded: false;
10261     }
10262     }
10263     }
10264    
10265 wakaba 1.20 @@XMLTest:
10266     @@@QName: xp.reptxt.element.content.ger.entity.declared.nopref.1.test
10267     @@@DEnt:
10268     @@@@test:value:
10269     <!DOCTYPE p [
10270     <!ENTITY c "&entity;">
10271     ]>
10272     <p>&c;</p>
10273     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
10274     @@XMLTest:
10275     @@@QName: xp.reptxt.element.content.ger.entity.declared.nopref.2.test
10276     @@@DEnt:
10277     @@@@test:value:
10278     <!DOCTYPE p [
10279     <!ENTITY other "aa">
10280     <!ENTITY % another "aa">
10281     <!ENTITY c "&entity;">
10282     ]>
10283     <p>&c;</p>
10284     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
10285     @@XMLTest:
10286     @@@QName: xp.reptxt.element.content.ger.entity.declared.nopref.3.test
10287     @@@DEnt:
10288     @@@@test:value:
10289     <?xml version="1.0" standalone="yes"?>
10290     <!DOCTYPE p [
10291     <!ENTITY c "&entity;">
10292     ]>
10293     <p>&c;</p>
10294     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
10295     @@XMLTest:
10296     @@@QName: xp.reptxt.element.content.ger.entity.declared.nopref.4.test
10297     @@@DEnt:
10298     @@@@test:value:
10299     <?xml version="1.0" standalone="no"?>
10300     <!DOCTYPE p [
10301     <!ENTITY c "&entity;">
10302     ]>
10303     <p>&c;</p>
10304     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
10305     @@XMLTest:
10306     @@@QName: xp.reptxt.element.content.ger.entity.declared.nopref.5.test
10307     @@@DEnt:
10308     @@@@test:value:
10309     <?xml version="1.0" standalone="yes"?>
10310     <!DOCTYPE p [
10311     <!ENTITY other "aa">
10312     <!ENTITY % another "aa">
10313     <!ENTITY c "&entity;">
10314     ]>
10315     <p>&c;</p>
10316     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
10317     @@XMLTest:
10318     @@@QName: xp.reptxt.element.content.ger.entity.declared.nopref.6.test
10319     @@@DEnt:
10320     @@@@test:value:
10321     <?xml version="1.0" standalone="no"?>
10322     <!DOCTYPE p [
10323     <!ENTITY other "aa">
10324     <!ENTITY % another "aa">
10325     <!ENTITY c "&entity;">
10326     ]>
10327     <p>&c;</p>
10328     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
10329     @@XMLTest:
10330     @@@QName: xp.reptxt.element.content.ger.entity.declared.nopref.-1.test
10331     @@@DEnt:
10332     @@@@test:value:
10333     <!DOCTYPE p [
10334     <!ENTITY entity "value">
10335     <!ENTITY c "&entity;">
10336     ]>
10337     <p>&c;</p>
10338     @@@test:domTree:
10339     document {
10340     document-type {
10341     general-entity {
10342     node-name: 'entity';
10343     text-content: 'value';
10344     }
10345     general-entity {
10346     node-name: 'c';
10347     general-entity-reference {
10348     node-name: 'entity';
10349     text-content: 'value';
10350     }
10351     }
10352     }
10353     element {
10354     general-entity-reference {
10355     node-name: 'c';
10356     general-entity-reference {
10357     node-name: 'entity';
10358     text-content: 'value';
10359     }
10360     }
10361     }
10362     }
10363     @@XMLTest:
10364     @@@QName: xp.reptxt.element.content.ger.entity.declared.nopref.-2.test
10365     @@@DEnt:
10366     @@@@test:value:
10367     <!DOCTYPE p [
10368     <!ENTITY entity "value">
10369     <!ENTITY another SYSTEM "another">
10370     <!ENTITY c "&entity;">
10371     ]>
10372     <p>&c;</p>
10373     @@@test:domTree:
10374     document {
10375     document-type {
10376     general-entity {
10377     node-name: 'entity';
10378     text-content: 'value';
10379     }
10380     general-entity {
10381     node-name: 'c';
10382     general-entity-reference {
10383     node-name: 'entity';
10384 wakaba 1.23 is-expanded: true;
10385 wakaba 1.20 text-content: 'value';
10386     }
10387     }
10388     general-entity {
10389     node-name: 'another';
10390     public-id: null;
10391     system-id: 'another';
10392     has-replacement-tree: false;
10393     }
10394     }
10395     element {
10396     general-entity-reference {
10397     node-name: 'c';
10398 wakaba 1.23 is-expanded: true;
10399 wakaba 1.20 general-entity-reference {
10400     node-name: 'entity';
10401 wakaba 1.23 is-expanded: true;
10402 wakaba 1.20 text-content: 'value';
10403     }
10404     }
10405     }
10406     }
10407     @@XMLTest:
10408     @@@QName: xp.reptxt.element.content.ger.entity.declared.standalone.2.test
10409     @@@DEnt:
10410     @@@@test:value:
10411     <?xml version="1.0" standalone="yes"?>
10412     <!DOCTYPE p [
10413     <!ENTITY c "&entity;">
10414     ]>
10415     <p>&c;</p>
10416     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
10417     @@XMLTest:
10418     @@@QName: xp.reptxt.element.content.ger.entity.declared.standalone.3.test
10419     @@@DEnt:
10420     @@@@test:value:
10421     <?xml version="1.0" standalone="yes"?>
10422     <!DOCTYPE p [
10423     <!ENTITY % para "<!-- -->">
10424     %para;
10425     <!ENTITY c "&entity;">
10426     ]>
10427     <p>&c;</p>
10428     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
10429     @@XMLTest:
10430     @@@QName: xp.reptxt.element.content.ger.entity.declared.standalone.-1.test
10431     @@@DEnt:
10432     @@@@test:value:
10433     <?xml version="1.0" standalone="no"?>
10434     <!DOCTYPE p [
10435     <!ENTITY c "&entity;">
10436     <!ENTITY % para "<!-- -->">
10437     %para;
10438     ]>
10439     <p>&c;</p>
10440     @@@test:domTree:
10441     document {
10442     document-type {
10443     general-entity {
10444     node-name: 'c';
10445     general-entity-reference {
10446     node-name: 'entity';
10447     is-expanded: false;
10448     }
10449     }
10450     }
10451     element {
10452     general-entity-reference {
10453     node-name: 'c';
10454     general-entity-reference {
10455     node-name: 'entity';
10456     is-expanded: false;
10457     }
10458     }
10459     }
10460     }
10461     @@XMLTest:
10462     @@@QName:
10463     xp.reptxt.element.content.ger.entity.declared.standalone.-1.2.test
10464     @@@DEnt:
10465     @@@@test:value:
10466     <?xml version="1.0" standalone="no"?>
10467     <!DOCTYPE p [
10468     <!ENTITY % para "<!-- -->">
10469     %para;
10470     <!ENTITY c "&entity;">
10471     ]>
10472     <p>&c;</p>
10473     @@@test:domTree:
10474     document {
10475     document-type { }
10476     element {
10477     general-entity-reference {
10478     node-name: 'c';
10479     is-expanded: false;
10480     }
10481     }
10482     }
10483     @@XMLTest:
10484     @@@QName: xp.reptxt.element.content.ger.entity.declared.standalone.-2.test
10485     @@@DEnt:
10486     @@@@test:value:
10487     <!DOCTYPE p [
10488     <!ENTITY c "&entity;">
10489     <!ENTITY % para "<!-- -->">
10490     %para;
10491     ]>
10492     <p>&c;</p>
10493     @@@test:domTree:
10494     document {
10495     document-type { }
10496     element {
10497     general-entity-reference {
10498     node-name: 'c';
10499     is-expanded: true;
10500     general-entity-reference {
10501     node-name: 'entity';
10502     is-expanded: false;
10503     }
10504     }
10505     }
10506     }
10507     @@XMLTest:
10508     @@@QName:
10509     xp.reptxt.element.content.ger.entity.declared.standalone.-2.2.test
10510     @@@DEnt:
10511     @@@@test:value:
10512     <!DOCTYPE p [
10513     <!ENTITY % para "<!-- -->">
10514     %para;
10515     <!ENTITY c "&entity;">
10516     ]>
10517     <p>&c;</p>
10518     @@@test:domTree:
10519     document {
10520     document-type { }
10521     element {
10522     general-entity-reference {
10523     node-name: 'c';
10524     is-expanded: false;
10525     }
10526     }
10527     }
10528     @@XMLTest:
10529     @@@QName: xp.reptxt.element.content.ger.entity.declared.standalone.4.test
10530     @@@DEnt:
10531     @@@@test:value:
10532     <?xml version="1.0" standalone="yes"?>
10533     <!DOCTYPE p [
10534     <!ENTITY % para SYSTEM "para">
10535     %para;
10536     <!ENTITY c "&entity;">
10537     ]>
10538     <p>&c;</p>
10539     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
10540     @@XMLTest:
10541     @@@QName: xp.reptxt.element.content.ger.entity.declared.standalone.-3.test
10542     @@@DEnt:
10543     @@@@test:value:
10544     <?xml version="1.0" standalone="no"?>
10545     <!DOCTYPE p [
10546     <!ENTITY c "&entity;">
10547     <!ENTITY % para SYSTEM "para">
10548     %para;
10549     ]>
10550     <p>&c;</p>
10551     @@@test:domTree:
10552     document {
10553     document-type { }
10554     element {
10555     general-entity-reference {
10556     node-name: 'c';
10557     is-expanded: true;
10558     general-entity-reference {
10559     node-name: 'entity';
10560     is-expanded: false;
10561     }
10562     }
10563     }
10564     }
10565     @@XMLTest:
10566     @@@QName:
10567     xp.reptxt.element.content.ger.entity.declared.standalone.-3.2.test
10568     @@@DEnt:
10569     @@@@test:value:
10570     <?xml version="1.0" standalone="no"?>
10571     <!DOCTYPE p [
10572     <!ENTITY % para SYSTEM "para">
10573     %para;
10574     <!ENTITY c "&entity;">
10575     ]>
10576     <p>&c;</p>
10577     @@@test:domTree:
10578     document {
10579     document-type { }
10580     element {
10581     general-entity-reference {
10582     node-name: 'c';
10583     is-expanded: false;
10584     }
10585     }
10586     }
10587     @@XMLTest:
10588     @@@QName: xp.reptxt.element.content.ger.entity.declared.standalone.-4.test
10589     @@@DEnt:
10590     @@@@test:value:
10591     <!DOCTYPE p [
10592     <!ENTITY c "&entity;">
10593     <!ENTITY % para SYSTEM "para">
10594     %para;
10595     ]>
10596     <p>&c;</p>
10597     @@@test:domTree:
10598     document {
10599     document-type { }
10600     element {
10601     general-entity-reference {
10602     node-name: 'c';
10603     is-expanded: true;
10604     general-entity-reference {
10605     node-name: 'entity';
10606     is-expanded: false;
10607     }
10608     }
10609     }
10610     }
10611     @@XMLTest:
10612     @@@QName:
10613     xp.reptxt.element.content.ger.entity.declared.standalone.-4.2.test
10614     @@@DEnt:
10615     @@@@test:value:
10616     <!DOCTYPE p [
10617     <!ENTITY % para SYSTEM "para">
10618     %para;
10619     <!ENTITY c "&entity;">
10620     ]>
10621     <p>&c;</p>
10622     @@@test:domTree:
10623     document {
10624     document-type { }
10625     element {
10626     general-entity-reference {
10627     node-name: 'c';
10628     is-expanded: false;
10629     }
10630     }
10631     }
10632     @@XMLTest:
10633     @@@QName: xp.reptxt.element.content.ger.entity.declared.standalone.5.test
10634     @@@DEnt:
10635     @@@@test:value:
10636     <?xml version="1.0" standalone="yes"?>
10637     <!DOCTYPE p SYSTEM "dtd" [
10638     <!ENTITY c "&entity;">
10639     ]>
10640     <p>&c;</p>
10641     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
10642     @@XMLTest:
10643     @@@QName: xp.reptxt.element.content.ger.entity.declared.standalone.-5.test
10644     @@@DEnt:
10645     @@@@test:value:
10646     <?xml version="1.0" standalone="no"?>
10647     <!DOCTYPE p SYSTEM "dtd" [
10648     <!ENTITY c "&entity;">
10649     ]>
10650     <p>&c;</p>
10651     @@@test:domTree:
10652     document {
10653     document-type { }
10654     element {
10655     general-entity-reference {
10656     node-name: 'c';
10657     is-expanded: true;
10658     general-entity-reference {
10659     node-name: 'entity';
10660     is-expanded: false;
10661     }
10662     }
10663     }
10664     }
10665     @@XMLTest:
10666     @@@QName: xp.reptxt.element.content.ger.entity.declared.standalone.-6.test
10667     @@@DEnt:
10668     @@@@test:value:
10669     <!DOCTYPE p SYSTEM "dtd" [<!ENTITY c "&entity;">]>
10670     <p>&c;</p>
10671     @@@test:domTree:
10672     document {
10673     document-type { }
10674     element {
10675     general-entity-reference {
10676     node-name: 'c';
10677     is-expanded: true;
10678     general-entity-reference {
10679     node-name: 'entity';
10680     is-expanded: false;
10681     }
10682     }
10683     }
10684     }
10685    
10686     @@XMLTest:
10687     @@@QName: xp.attval.ger.entity.declared.nodtd.1.test
10688     @@@DEnt:
10689     @@@@test:value:
10690     <p a="&entity;"/>
10691     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 7)..(1, 14); }
10692     @@XMLTest:
10693     @@@QName: xp.attval.ger.entity.declared.nodtd.2.test
10694     @@@DEnt:
10695     @@@@test:value:
10696     <?xml version="1.0" standalone="yes"?>
10697     <p a="&entity;"/>
10698     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 7)..(2, 14); }
10699     @@XMLTest:
10700     @@@QName: xp.attval.ger.entity.declared.nodtd.3.test
10701     @@@DEnt:
10702     @@@@test:value:
10703     <?xml version="1.0" standalone="no"?>
10704     <p a="&entity;"/>
10705     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 7)..(2, 14); }
10706     @@XMLTest:
10707     @@@QName: xp.attval.ger.entity.declared.nodtd.-1.test
10708     @@@DEnt:
10709     @@@@test:value:
10710     <p a="&lt;&gt;&amp;&quot;&apos;"/>
10711     @@@test:domTree:
10712     document {
10713     element {
10714     attribute {
10715     node-name: 'a';
10716     text-content: '<>&"' U+0027;
10717     }
10718     }
10719     }
10720     @@XMLTest:
10721     @@@QName: xp.attval.ger.entity.declared.nopref.1.test
10722     @@@DEnt:
10723     @@@@test:value:
10724     <!DOCTYPE p []>
10725     <p a="&entity;"/>
10726     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 7)..(2, 14); }
10727     @@XMLTest:
10728     @@@QName: xp.attval.ger.entity.declared.nopref.2.test
10729     @@@DEnt:
10730     @@@@test:value:
10731     <!DOCTYPE p [
10732     <!ENTITY other "aa">
10733     <!ENTITY % another "aa">
10734     ]>
10735     <p a="&entity;"/>
10736     @@@c:erred: <[[xp|wf-entity-declared]]> { (5, 7)..(5, 14); }
10737     @@XMLTest:
10738     @@@QName: xp.attval.ger.entity.declared.nopref.3.test
10739     @@@DEnt:
10740     @@@@test:value:
10741     <?xml version="1.0" standalone="yes"?>
10742     <!DOCTYPE p []>
10743     <p a="&entity;"/>
10744     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 7)..(3, 14); }
10745     @@XMLTest:
10746     @@@QName: xp.attval.ger.entity.declared.nopref.4.test
10747     @@@DEnt:
10748     @@@@test:value:
10749     <?xml version="1.0" standalone="no"?>
10750     <!DOCTYPE p []>
10751     <p a="&entity;"/>
10752     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 7)..(3, 14); }
10753     @@XMLTest:
10754     @@@QName: xp.attval.ger.entity.declared.nopref.5.test
10755     @@@DEnt:
10756     @@@@test:value:
10757     <?xml version="1.0" standalone="yes"?>
10758     <!DOCTYPE p [
10759     <!ENTITY other "aa">
10760     <!ENTITY % another "aa">
10761     ]>
10762     <p a="&entity;"/>
10763     @@@c:erred: <[[xp|wf-entity-declared]]> { (6, 7)..(6, 14); }
10764     @@XMLTest:
10765     @@@QName: xp.attval.ger.entity.declared.nopref.6.test
10766     @@@DEnt:
10767     @@@@test:value:
10768     <?xml version="1.0" standalone="no"?>
10769     <!DOCTYPE p [
10770     <!ENTITY other "aa">
10771     <!ENTITY % another "aa">
10772     ]>
10773     <p a="&entity;"/>
10774     @@@c:erred: <[[xp|wf-entity-declared]]> { (6, 7)..(6, 14); }
10775     @@XMLTest:
10776     @@@QName: xp.attval.ger.entity.declared.nopref.-1.test
10777     @@@DEnt:
10778     @@@@test:value:
10779     <!DOCTYPE p [
10780     <!ENTITY entity "value">
10781     ]>
10782     <p a="&entity;"/>
10783     @@@test:domTree:
10784     document {
10785     document-type {
10786     general-entity {
10787     node-name: 'entity';
10788     text-content: 'value';
10789     }
10790     }
10791     element {
10792     attribute {
10793     node-name: 'a';
10794     general-entity-reference {
10795     node-name: 'entity';
10796     is-expanded: true;
10797     text-content: 'value';
10798     }
10799     }
10800     }
10801     }
10802     @@XMLTest:
10803     @@@QName: xp.attval.ger.entity.declared.nopref.-2.test
10804     @@@DEnt:
10805     @@@@test:value:
10806     <!DOCTYPE p [
10807     <!ENTITY entity "value">
10808     <!ENTITY another SYSTEM "another">
10809     ]>
10810     <p a="&entity;"/>
10811     @@@test:domTree:
10812     document {
10813     document-type {
10814     general-entity {
10815     node-name: 'entity';
10816     text-content: 'value';
10817     has-replacement-tree: true;
10818     }
10819     general-entity {
10820     node-name: 'another';
10821     public-id: null;
10822     system-id: 'another';
10823     has-replacement-tree: false;
10824     }
10825     }
10826     element {
10827     attribute {
10828     node-name: 'a';
10829     general-entity-reference {
10830     node-name: 'entity';
10831     is-expanded: true;
10832     text-content: 'value';
10833     }
10834     }
10835     }
10836     }
10837     @@XMLTest:
10838     @@@QName: xp.attval.ger.entity.declared.standalone.1.test
10839     @@@DEnt:
10840     @@@@test:value:
10841     <?xml version="1.0" standalone="yes"?>
10842     <p a="&entity;"/>
10843     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 7)..(2, 14); }
10844     @@XMLTest:
10845     @@@QName: xp.attval.ger.entity.declared.standalone.2.test
10846     @@@DEnt:
10847     @@@@test:value:
10848     <?xml version="1.0" standalone="yes"?>
10849     <!DOCTYPE p []>
10850     <p a="&entity;"/>
10851     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 7)..(3, 14); }
10852     @@XMLTest:
10853     @@@QName: xp.attval.ger.entity.declared.standalone.3.test
10854     @@@DEnt:
10855     @@@@test:value:
10856     <?xml version="1.0" standalone="yes"?>
10857     <!DOCTYPE p [
10858     <!ENTITY % para "<!-- -->">
10859     %para;
10860     ]>
10861     <p a="&entity;"/>
10862     @@@c:erred: <[[xp|wf-entity-declared]]> { (6, 7)..(6, 14); }
10863     @@XMLTest:
10864     @@@QName: xp.attval.ger.entity.declared.standalone.-1.test
10865     @@@DEnt:
10866     @@@@test:value:
10867     <?xml version="1.0" standalone="no"?>
10868     <!DOCTYPE p [
10869     <!ENTITY % para "<!-- -->">
10870     %para;
10871     ]>
10872     <p a="&entity;"/>
10873     @@@test:domTree:
10874     document {
10875     document-type { }
10876     element {
10877     attribute {
10878     node-name: 'a';
10879     general-entity-reference {
10880     is-expanded: false;
10881     }
10882     }
10883     }
10884     }
10885     @@XMLTest:
10886     @@@QName: xp.attval.ger.entity.declared.standalone.-2.test
10887     @@@DEnt:
10888     @@@@test:value:
10889     <!DOCTYPE p [
10890     <!ENTITY % para "<!-- -->">
10891     %para;
10892     ]>
10893     <p a="&entity;"/>
10894     @@@test:domTree:
10895     document {
10896     document-type { }
10897     element {
10898     attribute {
10899     node-name: 'a';
10900     general-entity-reference {
10901     is-expanded: false;
10902     }
10903     }
10904     }
10905     }
10906     @@XMLTest:
10907     @@@QName: xp.attval.ger.entity.declared.standalone.4.test
10908     @@@DEnt:
10909     @@@@test:value:
10910     <?xml version="1.0" standalone="yes"?>
10911     <!DOCTYPE p [
10912     <!ENTITY % para SYSTEM "para">
10913     %para;
10914     ]>
10915     <p a="&entity;"/>
10916     @@@c:erred: <[[xp|wf-entity-declared]]> { (6, 7)..(6, 14); }
10917     @@XMLTest:
10918     @@@QName: xp.attval.ger.entity.declared.standalone.-3.test
10919     @@@DEnt:
10920     @@@@test:value:
10921     <?xml version="1.0" standalone="no"?>
10922     <!DOCTYPE p [
10923     <!ENTITY % para SYSTEM "para">
10924     %para;
10925     ]>
10926     <p a="&entity;"/>
10927     @@@test:domTree:
10928     document {
10929     document-type { }
10930     element {
10931     attribute {
10932     node-name: 'a';
10933     general-entity-reference {
10934     is-expanded: false;
10935     }
10936     }
10937     }
10938     }
10939     @@XMLTest:
10940     @@@QName: xp.attval.ger.entity.declared.standalone.-4.test
10941     @@@DEnt:
10942     @@@@test:value:
10943     <!DOCTYPE p [
10944     <!ENTITY % para SYSTEM "para">
10945     %para;
10946     ]>
10947     <p a="&entity;"/>
10948     @@@test:domTree:
10949     document {
10950     document-type { }
10951     element {
10952     attribute {
10953     node-name: 'a';
10954     general-entity-reference {
10955     is-expanded: false;
10956     }
10957     }
10958     }
10959     }
10960     @@XMLTest:
10961     @@@QName: xp.attval.ger.entity.declared.standalone.5.test
10962     @@@DEnt:
10963     @@@@test:value:
10964     <?xml version="1.0" standalone="yes"?>
10965     <!DOCTYPE p SYSTEM "dtd">
10966     <p a="&entity;"/>
10967     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 7)..(3, 14); }
10968     @@XMLTest:
10969     @@@QName: xp.attval.ger.entity.declared.standalone.-5.test
10970     @@@DEnt:
10971     @@@@test:value:
10972     <?xml version="1.0" standalone="no"?>
10973     <!DOCTYPE p SYSTEM "dtd">
10974     <p a="&entity;"/>
10975     @@@test:domTree:
10976     document {
10977     document-type { }
10978     element {
10979     attribute {
10980     node-name: 'a';
10981     general-entity-reference {
10982     is-expanded: false;
10983     }
10984     }
10985     }
10986     }
10987     @@XMLTest:
10988     @@@QName: xp.attval.ger.entity.declared.standalone.-6.test
10989     @@@DEnt:
10990     @@@@test:value:
10991     <!DOCTYPE p SYSTEM "dtd">
10992     <p a="&entity;"/>
10993     @@@test:domTree:
10994     document {
10995     document-type { }
10996     element {
10997     attribute {
10998     node-name: 'a';
10999     general-entity-reference {
11000     is-expanded: false;
11001     }
11002     }
11003     }
11004     }
11005    
11006 wakaba 1.21 @@XMLTest:
11007 wakaba 1.22 @@@QName: xp.reptxt.attval.ger.entity.declared.nopref.1.test
11008 wakaba 1.21 @@@DEnt:
11009     @@@@test:value:
11010     <!DOCTYPE p [
11011 wakaba 1.22 <!ENTITY c "&entity;">
11012 wakaba 1.21 ]>
11013 wakaba 1.22 <p a="&c;"/>
11014     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11015 wakaba 1.21 @@XMLTest:
11016 wakaba 1.22 @@@QName: xp.reptxt.attval.ger.entity.declared.nopref.2.test
11017 wakaba 1.21 @@@DEnt:
11018     @@@@test:value:
11019     <!DOCTYPE p [
11020     <!ENTITY other "aa">
11021     <!ENTITY % another "aa">
11022 wakaba 1.22 <!ENTITY c "&entity;">
11023 wakaba 1.21 ]>
11024 wakaba 1.22 <p a="&c;"/>
11025     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11026 wakaba 1.21 @@XMLTest:
11027 wakaba 1.22 @@@QName: xp.reptxt.attval.ger.entity.declared.nopref.3.test
11028 wakaba 1.21 @@@DEnt:
11029     @@@@test:value:
11030     <?xml version="1.0" standalone="yes"?>
11031     <!DOCTYPE p [
11032 wakaba 1.22 <!ENTITY c "&entity;">
11033 wakaba 1.21 ]>
11034 wakaba 1.22 <p a="&c;"/>
11035     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11036 wakaba 1.21 @@XMLTest:
11037 wakaba 1.22 @@@QName: xp.reptxt.attval.ger.entity.declared.nopref.4.test
11038 wakaba 1.21 @@@DEnt:
11039     @@@@test:value:
11040     <?xml version="1.0" standalone="no"?>
11041     <!DOCTYPE p [
11042 wakaba 1.22 <!ENTITY c "&entity;">
11043 wakaba 1.21 ]>
11044 wakaba 1.22 <p a="&c;"/>
11045     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11046 wakaba 1.21 @@XMLTest:
11047 wakaba 1.22 @@@QName: xp.reptxt.attval.ger.entity.declared.nopref.5.test
11048 wakaba 1.21 @@@DEnt:
11049     @@@@test:value:
11050     <?xml version="1.0" standalone="yes"?>
11051     <!DOCTYPE p [
11052     <!ENTITY other "aa">
11053     <!ENTITY % another "aa">
11054 wakaba 1.22 <!ENTITY c "&entity;">
11055 wakaba 1.21 ]>
11056 wakaba 1.22 <p a="&c;"/>
11057     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11058 wakaba 1.21 @@XMLTest:
11059 wakaba 1.22 @@@QName: xp.reptxt.attval.ger.entity.declared.nopref.6.test
11060 wakaba 1.21 @@@DEnt:
11061     @@@@test:value:
11062     <?xml version="1.0" standalone="no"?>
11063     <!DOCTYPE p [
11064     <!ENTITY other "aa">
11065     <!ENTITY % another "aa">
11066 wakaba 1.22 <!ENTITY c "&entity;">
11067 wakaba 1.21 ]>
11068 wakaba 1.22 <p a="&c;"/>
11069     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11070 wakaba 1.21 @@XMLTest:
11071 wakaba 1.22 @@@QName: xp.reptxt.attval.ger.entity.declared.nopref.-1.test
11072 wakaba 1.21 @@@DEnt:
11073     @@@@test:value:
11074     <!DOCTYPE p [
11075     <!ENTITY entity "value">
11076 wakaba 1.22 <!ENTITY c "&entity;">
11077 wakaba 1.21 ]>
11078 wakaba 1.22 <p a="&c;"/>
11079 wakaba 1.21 @@@test:domTree:
11080     document {
11081     document-type {
11082     general-entity {
11083     node-name: 'entity';
11084     text-content: 'value';
11085     }
11086 wakaba 1.22 general-entity {
11087     node-name: 'c';
11088     general-entity-reference {
11089     node-name: 'entity';
11090     text-content: 'value';
11091 wakaba 1.21 }
11092     }
11093     }
11094     element {
11095     attribute {
11096     node-name: 'a';
11097     general-entity-reference {
11098 wakaba 1.22 node-name: 'c';
11099     general-entity-reference {
11100     node-name: 'entity';
11101     text-content: 'value';
11102     }
11103 wakaba 1.21 }
11104     }
11105     }
11106     }
11107     @@XMLTest:
11108 wakaba 1.22 @@@QName: xp.reptxt.attval.ger.entity.declared.nopref.-2.test
11109 wakaba 1.21 @@@DEnt:
11110     @@@@test:value:
11111     <!DOCTYPE p [
11112     <!ENTITY entity "value">
11113     <!ENTITY another SYSTEM "another">
11114 wakaba 1.22 <!ENTITY c "&entity;">
11115 wakaba 1.21 ]>
11116 wakaba 1.22 <p a="&c;"/>
11117 wakaba 1.21 @@@test:domTree:
11118     document {
11119     document-type {
11120     general-entity {
11121     node-name: 'entity';
11122     text-content: 'value';
11123 wakaba 1.22 }
11124     general-entity {
11125     node-name: 'c';
11126     general-entity-reference {
11127     node-name: 'entity';
11128     text-content: 'value';
11129     }
11130 wakaba 1.21 }
11131     general-entity {
11132     node-name: 'another';
11133     public-id: null;
11134     system-id: 'another';
11135     has-replacement-tree: false;
11136     }
11137     }
11138     element {
11139     attribute {
11140     node-name: 'a';
11141     general-entity-reference {
11142 wakaba 1.22 node-name: 'c';
11143     general-entity-reference {
11144     node-name: 'entity';
11145     text-content: 'value';
11146     }
11147 wakaba 1.21 }
11148     }
11149     }
11150     }
11151     @@XMLTest:
11152 wakaba 1.22 @@@QName: xp.reptxt.attval.ger.entity.declared.standalone.2.test
11153 wakaba 1.21 @@@DEnt:
11154     @@@@test:value:
11155     <?xml version="1.0" standalone="yes"?>
11156     <!DOCTYPE p [
11157 wakaba 1.22 <!ENTITY c "&entity;">
11158 wakaba 1.21 ]>
11159 wakaba 1.22 <p a="&c;"/>
11160     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11161 wakaba 1.21 @@XMLTest:
11162 wakaba 1.22 @@@QName: xp.reptxt.attval.ger.entity.declared.standalone.3.test
11163 wakaba 1.21 @@@DEnt:
11164     @@@@test:value:
11165     <?xml version="1.0" standalone="yes"?>
11166     <!DOCTYPE p [
11167     <!ENTITY % para "<!-- -->">
11168     %para;
11169 wakaba 1.22 <!ENTITY c "&entity;">
11170 wakaba 1.21 ]>
11171 wakaba 1.22 <p a="&c;"/>
11172     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11173 wakaba 1.21 @@XMLTest:
11174 wakaba 1.22 @@@QName: xp.reptxt.attval.ger.entity.declared.standalone.-1.test
11175 wakaba 1.21 @@@DEnt:
11176     @@@@test:value:
11177 wakaba 1.22 <?xml version="1.0" standalone="no"?>
11178 wakaba 1.21 <!DOCTYPE p [
11179 wakaba 1.22 <!ENTITY c "&entity;">
11180 wakaba 1.21 <!ENTITY % para "<!-- -->">
11181     %para;
11182     ]>
11183 wakaba 1.22 <p a="&c;"/>
11184     @@@test:domTree:
11185     document {
11186     document-type {
11187     general-entity {
11188     node-name: 'c';
11189     general-entity-reference {
11190     node-name: 'entity';
11191     is-expanded: false;
11192     }
11193     }
11194     }
11195     element {
11196     attribute {
11197     node-name: 'a';
11198     general-entity-reference {
11199     node-name: 'c';
11200     general-entity-reference {
11201     node-name: 'entity';
11202     is-expanded: false;
11203     }
11204     }
11205     }
11206     }
11207     }
11208 wakaba 1.21 @@XMLTest:
11209 wakaba 1.22 @@@QName:
11210     xp.reptxt.attval.ger.entity.declared.standalone.-1.2.test
11211 wakaba 1.21 @@@DEnt:
11212     @@@@test:value:
11213     <?xml version="1.0" standalone="no"?>
11214     <!DOCTYPE p [
11215     <!ENTITY % para "<!-- -->">
11216     %para;
11217 wakaba 1.22 <!ENTITY c "&entity;">
11218 wakaba 1.21 ]>
11219 wakaba 1.22 <p a="&c;"/>
11220     @@@test:domTree:
11221     document {
11222     document-type { }
11223     element {
11224     attribute {
11225     node-name: 'a';
11226     general-entity-reference {
11227     node-name: 'c';
11228     is-expanded: false;
11229     }
11230     }
11231     }
11232     }
11233 wakaba 1.21 @@XMLTest:
11234 wakaba 1.22 @@@QName: xp.reptxt.attval.ger.entity.declared.standalone.-2.test
11235 wakaba 1.21 @@@DEnt:
11236     @@@@test:value:
11237     <!DOCTYPE p [
11238 wakaba 1.22 <!ENTITY c "&entity;">
11239     <!ENTITY % para "<!-- -->">
11240     %para;
11241     ]>
11242     <p a="&c;"/>
11243     @@@test:domTree:
11244     document {
11245     document-type { }
11246     element {
11247     attribute {
11248     node-name: 'a';
11249     general-entity-reference {
11250     node-name: 'c';
11251     is-expanded: true;
11252     general-entity-reference {
11253     node-name: 'entity';
11254     is-expanded: false;
11255     }
11256     }
11257     }
11258     }
11259     }
11260     @@XMLTest:
11261     @@@QName:
11262     xp.reptxt.attval.ger.entity.declared.standalone.-2.2.test
11263     @@@DEnt:
11264     @@@@test:value:
11265     <!DOCTYPE p [
11266     <!ENTITY % para "<!-- -->">
11267     %para;
11268     <!ENTITY c "&entity;">
11269     ]>
11270     <p a="&c;"/>
11271     @@@test:domTree:
11272     document {
11273     document-type { }
11274     element {
11275     attribute {
11276     node-name: 'a';
11277     general-entity-reference {
11278     node-name: 'c';
11279     is-expanded: false;
11280     }
11281     }
11282     }
11283     }
11284     @@XMLTest:
11285     @@@QName: xp.reptxt.attval.ger.entity.declared.standalone.4.test
11286     @@@DEnt:
11287     @@@@test:value:
11288     <?xml version="1.0" standalone="yes"?>
11289     <!DOCTYPE p [
11290     <!ENTITY % para SYSTEM "para">
11291     %para;
11292     <!ENTITY c "&entity;">
11293     ]>
11294     <p a="&c;"/>
11295     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11296     @@XMLTest:
11297     @@@QName: xp.reptxt.attval.ger.entity.declared.standalone.-3.test
11298     @@@DEnt:
11299     @@@@test:value:
11300     <?xml version="1.0" standalone="no"?>
11301     <!DOCTYPE p [
11302     <!ENTITY c "&entity;">
11303     <!ENTITY % para SYSTEM "para">
11304     %para;
11305     ]>
11306     <p a="&c;"/>
11307     @@@test:domTree:
11308     document {
11309     document-type { }
11310     element {
11311     attribute {
11312     node-name: 'a';
11313     general-entity-reference {
11314     node-name: 'c';
11315     is-expanded: true;
11316     general-entity-reference {
11317     node-name: 'entity';
11318     is-expanded: false;
11319     }
11320     }
11321     }
11322     }
11323     }
11324     @@XMLTest:
11325     @@@QName:
11326     xp.reptxt.attval.ger.entity.declared.standalone.-3.2.test
11327     @@@DEnt:
11328     @@@@test:value:
11329     <?xml version="1.0" standalone="no"?>
11330     <!DOCTYPE p [
11331     <!ENTITY % para SYSTEM "para">
11332     %para;
11333     <!ENTITY c "&entity;">
11334     ]>
11335     <p a="&c;"/>
11336     @@@test:domTree:
11337     document {
11338     document-type { }
11339     element {
11340     attribute {
11341     node-name: 'a';
11342     general-entity-reference {
11343     node-name: 'c';
11344     is-expanded: false;
11345     }
11346     }
11347     }
11348     }
11349     @@XMLTest:
11350     @@@QName: xp.reptxt.attval.ger.entity.declared.standalone.-4.test
11351     @@@DEnt:
11352     @@@@test:value:
11353     <!DOCTYPE p [
11354     <!ENTITY c "&entity;">
11355     <!ENTITY % para SYSTEM "para">
11356     %para;
11357     ]>
11358     <p a="&c;"/>
11359     @@@test:domTree:
11360     document {
11361     document-type { }
11362     element {
11363     attribute {
11364     node-name: 'a';
11365     general-entity-reference {
11366     node-name: 'c';
11367     is-expanded: true;
11368     general-entity-reference {
11369     node-name: 'entity';
11370     is-expanded: false;
11371     }
11372     }
11373     }
11374     }
11375     }
11376     @@XMLTest:
11377     @@@QName:
11378     xp.reptxt.attval.ger.entity.declared.standalone.-4.2.test
11379     @@@DEnt:
11380     @@@@test:value:
11381     <!DOCTYPE p [
11382     <!ENTITY % para SYSTEM "para">
11383     %para;
11384     <!ENTITY c "&entity;">
11385     ]>
11386     <p a="&c;"/>
11387     @@@test:domTree:
11388     document {
11389     document-type { }
11390     element {
11391     attribute {
11392     node-name: 'a';
11393     general-entity-reference {
11394     node-name: 'c';
11395     is-expanded: false;
11396     }
11397     }
11398     }
11399     }
11400     @@XMLTest:
11401     @@@QName: xp.reptxt.attval.ger.entity.declared.standalone.5.test
11402     @@@DEnt:
11403     @@@@test:value:
11404     <?xml version="1.0" standalone="yes"?>
11405     <!DOCTYPE p SYSTEM "dtd" [
11406     <!ENTITY c "&entity;">
11407     ]>
11408     <p a="&c;"/>
11409     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11410     @@XMLTest:
11411     @@@QName: xp.reptxt.attval.ger.entity.declared.standalone.-5.test
11412     @@@DEnt:
11413     @@@@test:value:
11414     <?xml version="1.0" standalone="no"?>
11415     <!DOCTYPE p SYSTEM "dtd" [
11416     <!ENTITY c "&entity;">
11417     ]>
11418     <p a="&c;"/>
11419     @@@test:domTree:
11420     document {
11421     document-type { }
11422     element {
11423     attribute {
11424     node-name: 'a';
11425     general-entity-reference {
11426     node-name: 'c';
11427     is-expanded: true;
11428     general-entity-reference {
11429     node-name: 'entity';
11430     is-expanded: false;
11431     }
11432     }
11433     }
11434     }
11435     }
11436     @@XMLTest:
11437     @@@QName: xp.reptxt.attval.ger.entity.declared.standalone.-6.test
11438     @@@DEnt:
11439     @@@@test:value:
11440     <!DOCTYPE p SYSTEM "dtd" [<!ENTITY c "&entity;">]>
11441     <p a="&c;"/>
11442     @@@test:domTree:
11443     document {
11444     document-type { }
11445     element {
11446     attribute {
11447     node-name: 'a';
11448     general-entity-reference {
11449     node-name: 'c';
11450     is-expanded: true;
11451     general-entity-reference {
11452     node-name: 'entity';
11453     is-expanded: false;
11454     }
11455     }
11456     }
11457     }
11458     }
11459    
11460     @@XMLTest:
11461     @@@QName: xp.attlist.dup.entity.declared.1.test
11462     @@@DEnt:
11463     @@@@test:value:
11464     <!DOCTYPE p [
11465     <!ATTLIST p a CDATA "no-entity">
11466     <!ATTLIST p a CDATA "&entity;">
11467     ]>
11468     <p/>
11469     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 21)..(3, 29); }
11470     @@XMLTest:
11471     @@@QName: xp.attlist.dup.entity.declared.2.test
11472     @@@DEnt:
11473     @@@@test:value:
11474     <!DOCTYPE p [
11475     <!ATTLIST p a CDATA "no-entity"
11476     a CDATA "&entity;">
11477     ]>
11478     <p/>
11479     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 21)..(3, 29); }
11480     @@XMLTest:
11481     @@@QName: xp.attlist.unused.entity.declared.1.test
11482     @@@DEnt:
11483     @@@@test:value:
11484     <!DOCTYPE p [
11485     <!ATTLIST q a CDATA "&entity;">
11486     ]>
11487     <p/>
11488     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 21)..(2, 29); }
11489     @@XMLTest:
11490     @@@QName: xp.attlist.unused.entity.declared.2.test
11491     @@@DEnt:
11492     @@@@test:value:
11493     <!DOCTYPE p [
11494     <!ATTLIST p a CDATA "&entity;">
11495     ]>
11496     <p a="bb"/>
11497     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 21)..(2, 29); }
11498    
11499     @@XMLTest:
11500     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.nopref.1.test
11501     @@@DEnt:
11502     @@@@test:value:
11503     <!DOCTYPE p [
11504     <!ENTITY c "&entity;">
11505     <!ATTLIST p a CDATA "&c;">
11506     ]>
11507     <p/>
11508     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11509     @@XMLTest:
11510     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.nopref.2.test
11511     @@@DEnt:
11512     @@@@test:value:
11513     <!DOCTYPE p [
11514     <!ENTITY other "aa">
11515     <!ENTITY % another "aa">
11516     <!ENTITY c "&entity;">
11517     <!ATTLIST p a CDATA "&c;">
11518     ]>
11519     <p/>
11520     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11521     @@XMLTest:
11522     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.nopref.3.test
11523     @@@DEnt:
11524     @@@@test:value:
11525     <?xml version="1.0" standalone="yes"?>
11526     <!DOCTYPE p [
11527     <!ENTITY c "&entity;">
11528     <!ATTLIST p a CDATA "&c;">
11529     ]>
11530     <p/>
11531     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11532     @@XMLTest:
11533     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.nopref.4.test
11534     @@@DEnt:
11535     @@@@test:value:
11536     <?xml version="1.0" standalone="no"?>
11537     <!DOCTYPE p [
11538     <!ENTITY c "&entity;">
11539     <!ATTLIST p a CDATA "&c;">
11540     ]>
11541     <p/>
11542     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11543     @@XMLTest:
11544     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.nopref.5.test
11545     @@@DEnt:
11546     @@@@test:value:
11547     <?xml version="1.0" standalone="yes"?>
11548     <!DOCTYPE p [
11549     <!ENTITY other "aa">
11550     <!ENTITY % another "aa">
11551     <!ENTITY c "&entity;">
11552     <!ATTLIST p a CDATA "&c;">
11553     ]>
11554     <p/>
11555     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11556     @@XMLTest:
11557     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.nopref.6.test
11558     @@@DEnt:
11559     @@@@test:value:
11560     <?xml version="1.0" standalone="no"?>
11561     <!DOCTYPE p [
11562     <!ENTITY other "aa">
11563     <!ENTITY % another "aa">
11564     <!ENTITY c "&entity;">
11565     <!ATTLIST p a CDATA "&c;">
11566     ]>
11567     <p/>
11568     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11569     @@XMLTest:
11570     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.nopref.-1.test
11571     @@@DEnt:
11572     @@@@test:value:
11573     <!DOCTYPE p [
11574     <!ENTITY entity "value">
11575     <!ENTITY c "&entity;">
11576     <!ATTLIST p a CDATA "&c;">
11577     ]>
11578     <p/>
11579     @@@test:domTree:
11580     document {
11581     document-type {
11582     general-entity {
11583     node-name: 'entity';
11584     text-content: 'value';
11585     }
11586     general-entity {
11587     node-name: 'c';
11588     general-entity-reference {
11589     node-name: 'entity';
11590     is-expanded: true;
11591     text-content: 'value';
11592     }
11593     }
11594     element-type-definition {
11595     node-name: 'p';
11596     attribute-definition {
11597     node-name: 'a';
11598     general-entity-reference {
11599     node-name: 'c';
11600     is-expanded: true;
11601     general-entity-reference {
11602     node-name: 'entity';
11603     is-expanded: true;
11604     text-content: 'value';
11605     }
11606     }
11607     }
11608     }
11609     }
11610     element {
11611     attribute {
11612     node-name: 'a';
11613     specified: false;
11614     general-entity-reference {
11615     node-name: 'c';
11616     general-entity-reference {
11617     node-name: 'entity';
11618     text-content: 'value';
11619     }
11620     }
11621     }
11622     }
11623     }
11624     @@XMLTest:
11625     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.nopref.-2.test
11626     @@@DEnt:
11627     @@@@test:value:
11628     <!DOCTYPE p [
11629     <!ENTITY entity "value">
11630     <!ENTITY another SYSTEM "another">
11631     <!ENTITY c "&entity;">
11632     <!ATTLIST p a CDATA "&c;">
11633     ]>
11634     <p/>
11635     @@@test:domTree:
11636     document {
11637     document-type {
11638     general-entity {
11639     node-name: 'entity';
11640     text-content: 'value';
11641     }
11642     general-entity {
11643     node-name: 'c';
11644     general-entity-reference {
11645     node-name: 'entity';
11646     text-content: 'value';
11647     }
11648     }
11649     general-entity {
11650     node-name: 'another';
11651     public-id: null;
11652     system-id: 'another';
11653     has-replacement-tree: false;
11654     }
11655     element-type-definition {
11656     node-name: 'p';
11657     attribute-definition {
11658     node-name: 'a';
11659     general-entity-reference {
11660     node-name: 'c';
11661     is-expanded: true;
11662     general-entity-reference {
11663     node-name: 'entity';
11664     is-expanded: true;
11665     text-content: 'value';
11666     }
11667     }
11668     }
11669     }
11670     }
11671     element {
11672     attribute {
11673     node-name: 'a';
11674     specified: false;
11675     general-entity-reference {
11676     node-name: 'c';
11677     general-entity-reference {
11678     node-name: 'entity';
11679     text-content: 'value';
11680     }
11681     }
11682     }
11683     }
11684     }
11685     @@XMLTest:
11686     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.standalone.2.test
11687     @@@DEnt:
11688     @@@@test:value:
11689     <?xml version="1.0" standalone="yes"?>
11690     <!DOCTYPE p [
11691     <!ENTITY c "&entity;">
11692     <!ATTLIST p a CDATA "&c;">
11693     ]>
11694     <p/>
11695     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11696     @@XMLTest:
11697     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.standalone.3.test
11698     @@@DEnt:
11699     @@@@test:value:
11700     <?xml version="1.0" standalone="yes"?>
11701     <!DOCTYPE p [
11702     <!ENTITY % para "<!-- -->">
11703     %para;
11704     <!ENTITY c "&entity;">
11705     <!ATTLIST p a CDATA "&c;">
11706     ]>
11707     <p/>
11708     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11709     @@XMLTest:
11710     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.standalone.-1.test
11711     @@@DEnt:
11712     @@@@test:value:
11713     <?xml version="1.0" standalone="no"?>
11714     <!DOCTYPE p [
11715     <!ENTITY c "&entity;">
11716     <!ATTLIST p a CDATA "&c;">
11717     <!ENTITY % para "<!-- -->">
11718     %para;
11719     ]>
11720     <p/>
11721     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11722     @@XMLTest:
11723     @@@QName:
11724     xp.reptxt.attlist.attval.ger.entity.declared.standalone.-1.2.test
11725     @@@DEnt:
11726     @@@@test:value:
11727     <?xml version="1.0" standalone="no"?>
11728     <!DOCTYPE p [
11729     <!ENTITY % para "<!-- -->">
11730     %para;
11731     <!ENTITY c "&entity;">
11732     <!ATTLIST p a CDATA "&c;">
11733     ]>
11734     <p g="h"/>
11735     @@@test:domTree:
11736     document {
11737     document-type { }
11738     element {
11739     attribute {
11740     node-name: 'g';
11741     text-content: 'h';
11742     }
11743     }
11744     }
11745     @@XMLTest:
11746     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.standalone.-2.test
11747     @@@DEnt:
11748     @@@@test:value:
11749     <!DOCTYPE p [
11750     <!ENTITY c "&entity;">
11751     <!ATTLIST p a CDATA "&c;">
11752     <!ENTITY % para "<!-- -->">
11753     %para;
11754     ]>
11755     <p/>
11756     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11757     @@XMLTest:
11758     @@@QName:
11759     xp.reptxt.attlist.attval.ger.entity.declared.standalone.-2.2.test
11760     @@@DEnt:
11761     @@@@test:value:
11762     <!DOCTYPE p [
11763     <!ENTITY % para "<!-- -->">
11764     %para;
11765     <!ENTITY c "&entity;">
11766     <!ATTLIST p a CDATA "&c;">
11767     ]>
11768     <p g="h"/>
11769     @@@test:domTree:
11770     document {
11771     document-type { }
11772     element {
11773     attribute {
11774     node-name: 'g';
11775     text-content: 'h';
11776     }
11777     }
11778     }
11779     @@XMLTest:
11780     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.standalone.4.test
11781     @@@DEnt:
11782     @@@@test:value:
11783     <?xml version="1.0" standalone="yes"?>
11784     <!DOCTYPE p [
11785     <!ENTITY % para SYSTEM "para">
11786     %para;
11787     <!ENTITY c "&entity;">
11788     <!ATTLIST p a CDATA "&c;">
11789     ]>
11790     <p/>
11791     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11792     @@XMLTest:
11793     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.standalone.-3.test
11794     @@@DEnt:
11795     @@@@test:value:
11796     <?xml version="1.0" standalone="no"?>
11797     <!DOCTYPE p [
11798     <!ENTITY c "&entity;">
11799     <!ATTLIST p a CDATA "&c;">
11800     <!ENTITY % para SYSTEM "para">
11801     %para;
11802     ]>
11803     <p/>
11804     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11805     @@XMLTest:
11806     @@@QName:
11807     xp.reptxt.attlist.attval.ger.entity.declared.standalone.-3.2.test
11808     @@@DEnt:
11809     @@@@test:value:
11810     <?xml version="1.0" standalone="no"?>
11811     <!DOCTYPE p [
11812     <!ENTITY % para SYSTEM "para">
11813     %para;
11814     <!ENTITY c "&entity;">
11815     <!ATTLIST p a CDATA "&c;">
11816     ]>
11817     <p g="h"/>
11818     @@@test:domTree:
11819     document {
11820     document-type { }
11821     element {
11822     attribute {
11823     node-name: 'g';
11824     text-content: 'h';
11825     }
11826     }
11827     }
11828     @@XMLTest:
11829     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.standalone.-4.test
11830     @@@DEnt:
11831     @@@@test:value:
11832     <!DOCTYPE p [
11833     <!ENTITY c "&entity;">
11834     <!ATTLIST p a CDATA "&c;">
11835     <!ENTITY % para SYSTEM "para">
11836     %para;
11837     ]>
11838     <p/>
11839     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11840     @@XMLTest:
11841     @@@QName:
11842     xp.reptxt.attlist.attval.ger.entity.declared.standalone.-4.2.test
11843     @@@DEnt:
11844     @@@@test:value:
11845     <!DOCTYPE p [
11846     <!ENTITY % para SYSTEM "para">
11847     %para;
11848     <!ENTITY c "&entity;">
11849     <!ATTLIST p a CDATA "&c;">
11850     ]>
11851     <p g="h"/>
11852     @@@test:domTree:
11853     document {
11854     document-type { }
11855     element {
11856     attribute {
11857     node-name: 'g';
11858     text-content: 'h';
11859     }
11860     }
11861     }
11862     @@XMLTest:
11863     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.standalone.5.test
11864     @@@DEnt:
11865     @@@@test:value:
11866     <?xml version="1.0" standalone="yes"?>
11867     <!DOCTYPE p SYSTEM "dtd" [
11868     <!ENTITY c "&entity;">
11869     <!ATTLIST p a CDATA "&c;">
11870     ]>
11871     <p/>
11872     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11873     @@XMLTest:
11874     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.standalone.-5.test
11875     @@@DEnt:
11876     @@@@test:value:
11877     <?xml version="1.0" standalone="no"?>
11878     <!DOCTYPE p SYSTEM "dtd" [
11879     <!ENTITY c "&entity;">
11880     <!ATTLIST p a CDATA "&c;">
11881     ]>
11882     <p/>
11883     @@@test:domTree:
11884     document {
11885     document-type { }
11886     element {
11887     attribute {
11888     node-name: 'a';
11889     specified: false;
11890     general-entity-reference {
11891     node-name: 'c';
11892     is-expanded: true;
11893     general-entity-reference {
11894     node-name: 'entity';
11895     is-expanded: false;
11896     }
11897     }
11898     }
11899     }
11900     }
11901     @@XMLTest:
11902     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.standalone.-6.test
11903     @@@DEnt:
11904     @@@@test:value:
11905     <!DOCTYPE p SYSTEM "dtd" [<!ENTITY c "&entity;">
11906     <!ATTLIST p a CDATA "&c;">
11907     ]>
11908     <p/>
11909     @@@test:domTree:
11910     document {
11911     document-type { }
11912     element {
11913     attribute {
11914     node-name: 'a';
11915     specified: false;
11916     general-entity-reference {
11917     node-name: 'c';
11918     is-expanded: true;
11919     general-entity-reference {
11920     node-name: 'entity';
11921     is-expanded: false;
11922     }
11923     }
11924     }
11925     }
11926     }
11927    
11928     @@XMLTest:
11929     @@@QName: xp.attlist.attval.ger.entity.declared.nopref.1.test
11930     @@@DEnt:
11931     @@@@test:value:
11932     <!DOCTYPE p [
11933     <!ATTLIST p a CDATA "&entity;">
11934     ]>
11935     <p/>
11936     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 22)..(2, 29); }
11937     @@XMLTest:
11938     @@@QName: xp.attlist.attval.ger.entity.declared.nopref.2.test
11939     @@@DEnt:
11940     @@@@test:value:
11941     <!DOCTYPE p [
11942     <!ENTITY other "aa">
11943     <!ENTITY % another "aa">
11944     <!ATTLIST p a CDATA "&entity;">
11945     ]>
11946     <p/>
11947     @@@c:erred: <[[xp|wf-entity-declared]]> { (4, 22)..(4, 29); }
11948     @@XMLTest:
11949     @@@QName: xp.attlist.attval.ger.entity.declared.nopref.3.test
11950     @@@DEnt:
11951     @@@@test:value:
11952     <?xml version="1.0" standalone="yes"?>
11953     <!DOCTYPE p [
11954     <!ATTLIST p a CDATA "&entity;">
11955     ]>
11956     <p/>
11957     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 22)..(3, 29); }
11958     @@XMLTest:
11959     @@@QName: xp.attlist.attval.ger.entity.declared.nopref.4.test
11960     @@@DEnt:
11961     @@@@test:value:
11962     <?xml version="1.0" standalone="no"?>
11963     <!DOCTYPE p [
11964     <!ATTLIST p a CDATA "&entity;">
11965     ]>
11966     <p/>
11967     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 22)..(3, 29); }
11968     @@XMLTest:
11969     @@@QName: xp.attlist.attval.ger.entity.declared.nopref.5.test
11970     @@@DEnt:
11971     @@@@test:value:
11972     <?xml version="1.0" standalone="yes"?>
11973     <!DOCTYPE p [
11974     <!ENTITY other "aa">
11975     <!ENTITY % another "aa">
11976     <!ATTLIST p a CDATA "&entity;">
11977     ]>
11978     <p/>
11979     @@@c:erred: <[[xp|wf-entity-declared]]> { (5, 22)..(5, 29); }
11980     @@XMLTest:
11981     @@@QName: xp.attlist.attval.ger.entity.declared.nopref.6.test
11982     @@@DEnt:
11983     @@@@test:value:
11984     <?xml version="1.0" standalone="no"?>
11985     <!DOCTYPE p [
11986     <!ENTITY other "aa">
11987     <!ENTITY % another "aa">
11988     <!ATTLIST p a CDATA "&entity;">
11989     ]>
11990     <p/>
11991     @@@c:erred: <[[xp|wf-entity-declared]]> { (5, 22)..(5, 29); }
11992     @@XMLTest:
11993     @@@QName: xp.attlist.attval.ger.entity.declared.nopref.-1.test
11994     @@@DEnt:
11995     @@@@test:value:
11996     <!DOCTYPE p [
11997     <!ENTITY entity "value">
11998     <!ATTLIST p a CDATA "&entity;">
11999     ]>
12000     <p/>
12001     @@@test:domTree:
12002     document {
12003     document-type {
12004     general-entity {
12005     node-name: 'entity';
12006     text-content: 'value';
12007     }
12008     element-type-definition {
12009     node-name: 'p';
12010     attribute-definition {
12011     node-name: 'a';
12012     general-entity-reference {
12013     node-name: 'entity';
12014     is-expanded: true;
12015     text-content: 'value';
12016     }
12017     }
12018     }
12019     }
12020     element {
12021     attribute {
12022     node-name: 'a';
12023     specified: false;
12024     general-entity-reference {
12025     node-name: 'entity';
12026     is-expanded: true;
12027     text-content: 'value';
12028     }
12029     }
12030     }
12031     }
12032     @@XMLTest:
12033     @@@QName: xp.attlist.attval.ger.entity.declared.nopref.-1.2.test
12034     @@@DEnt:
12035     @@@@test:value:
12036     <!DOCTYPE p [
12037     <!ATTLIST p a CDATA "&entity;">
12038     <!ENTITY entity "value">
12039     ]>
12040     <p/>
12041     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 22)..(2, 29); }
12042     @@XMLTest:
12043     @@@QName: xp.attlist.attval.ger.entity.declared.nopref.-2.test
12044     @@@DEnt:
12045     @@@@test:value:
12046     <!DOCTYPE p [
12047     <!ENTITY entity "value">
12048     <!ENTITY another SYSTEM "another">
12049     <!ATTLIST p a CDATA "&entity;">
12050     ]>
12051     <p/>
12052     @@@test:domTree:
12053     document {
12054     document-type {
12055     element-type-definition {
12056     node-name: 'p';
12057     attribute-definition {
12058     node-name: 'a';
12059     general-entity-reference {
12060     node-name: 'entity';
12061     is-expanded: true;
12062     text-content: 'value';
12063     }
12064     }
12065     }
12066     general-entity {
12067     node-name: 'entity';
12068     text-content: 'value';
12069     has-replacement-tree: true;
12070     }
12071     general-entity {
12072     node-name: 'another';
12073     public-id: null;
12074     system-id: 'another';
12075     has-replacement-tree: false;
12076     }
12077     }
12078     element {
12079     attribute {
12080     node-name: 'a';
12081     specified: false;
12082     general-entity-reference {
12083     node-name: 'entity';
12084     is-expanded: true;
12085     text-content: 'value';
12086     }
12087     }
12088     }
12089     }
12090     @@XMLTest:
12091     @@@QName: xp.attlist.attval.ger.entity.declared.nopref.-2.2.test
12092     @@@DEnt:
12093     @@@@test:value:
12094     <!DOCTYPE p [
12095     <!ATTLIST p a CDATA "&entity;">
12096     <!ENTITY entity "value">
12097     <!ENTITY another SYSTEM "another">
12098     ]>
12099     <p/>
12100     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 22)..(2, 29); }
12101     @@XMLTest:
12102     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.2.test
12103     @@@DEnt:
12104     @@@@test:value:
12105     <?xml version="1.0" standalone="yes"?>
12106     <!DOCTYPE p [
12107     <!ATTLIST p a CDATA "&entity;">
12108     ]>
12109     <p/>
12110     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 22)..(3, 29); }
12111     @@XMLTest:
12112     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.3.test
12113     @@@DEnt:
12114     @@@@test:value:
12115     <?xml version="1.0" standalone="yes"?>
12116     <!DOCTYPE p [
12117     <!ATTLIST p a CDATA "&entity;">
12118     <!ENTITY % para "<!-- -->">
12119     %para;
12120     ]>
12121     <p/>
12122     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 22)..(3, 29); }
12123     @@XMLTest:
12124     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.3.2.test
12125     @@@DEnt:
12126     @@@@test:value:
12127     <?xml version="1.0" standalone="yes"?>
12128     <!DOCTYPE p [
12129     <!ENTITY % para "<!-- -->">
12130     %para;
12131     <!ATTLIST p a CDATA "&entity;">
12132     ]>
12133     <p/>
12134     @@@c:erred: <[[xp|wf-entity-declared]]> { (5, 22)..(5, 29); }
12135     @@@enImplNote:
12136     The <XML::ATTLIST> declaration is processed since
12137     it is a <XA::standalone> document.
12138     @@XMLTest:
12139     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.-1.test
12140     @@@DEnt:
12141     @@@@test:value:
12142     <?xml version="1.0" standalone="no"?>
12143     <!DOCTYPE p [
12144     <!ATTLIST p a CDATA "&entity;">
12145     <!ENTITY % para "<!-- -->">
12146     %para;
12147     ]>
12148     <p/>
12149     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 22)..(3, 29); }
12150     @@XMLTest:
12151     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.-1.2.test
12152     @@@DEnt:
12153     @@@@test:value:
12154     <?xml version="1.0" standalone="no"?>
12155     <!DOCTYPE p [
12156 wakaba 1.25 <!ATTLIST p b CDATA #IMPLIED>
12157 wakaba 1.21 <!ENTITY % para "<!-- -->">
12158     %para;
12159     <!ATTLIST p a CDATA "&entity;">
12160     ]>
12161     <p c="d"/>
12162 wakaba 1.25 @@@c:erred:
12163     <[[xp|warning-attribute-definition-not-processed]]> { (6, 13)..(6, 30); }
12164 wakaba 1.21 @@@test:domTree:
12165     document {
12166     document-type {
12167     element-type-definition {
12168 wakaba 1.25 node-name: 'p';
12169 wakaba 1.21 attribute-definition {
12170     node-name: 'b';
12171     }
12172     }
12173     }
12174     element {
12175     attribute {
12176     node-name: 'c';
12177     text-content: 'd';
12178     }
12179     }
12180     }
12181     @@@enImplNote:
12182     The second <XML::ATTLIST> declaration is read but not processed
12183     and its <XML::&entity;> general entity reference violates
12184     entity declared validty constraint rather than well-formedness
12185     constraint.
12186     @@XMLTest:
12187     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.-2.test
12188     @@@DEnt:
12189     @@@@test:value:
12190     <!DOCTYPE p [
12191     <!ATTLIST p a CDATA "&entity;">
12192     <!ENTITY % para "<!-- -->">
12193     %para;
12194     ]>
12195     <p/>
12196     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 22)..(2, 29); }
12197     @@XMLTest:
12198     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.-2.2.test
12199     @@@DEnt:
12200     @@@@test:value:
12201     <!DOCTYPE p [
12202 wakaba 1.25 <!ATTLIST p b CDATA #IMPLIED>
12203 wakaba 1.21 <!ENTITY % para "<!-- -->">
12204     %para;
12205     <!ATTLIST p a CDATA "&entity;">
12206     ]>
12207     <p c="d"/>
12208 wakaba 1.25 @@@c:erred:
12209     <[[xp|warning-attribute-definition-not-processed]]> { (5, 13)..(5, 30); }
12210 wakaba 1.21 @@@test:domTree:
12211     document {
12212     document-type {
12213     element-type-definition {
12214 wakaba 1.25 node-name: 'p';
12215 wakaba 1.21 attribute-definition {
12216     node-name: 'b';
12217     }
12218     }
12219     }
12220     element {
12221     attribute {
12222     node-name: 'c';
12223     text-content: 'd';
12224     }
12225     }
12226     }
12227     @@XMLTest:
12228     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.4.test
12229     @@@DEnt:
12230     @@@@test:value:
12231     <?xml version="1.0" standalone="yes"?>
12232     <!DOCTYPE p [
12233     <!ATTLIST p a CDATA "&entity;">
12234     <!ENTITY % para SYSTEM "p">
12235     %para;
12236     ]>
12237     <p/>
12238     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 22)..(3, 29); }
12239     @@XMLTest:
12240     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.4.2.test
12241     @@@DEnt:
12242     @@@@test:value:
12243     <?xml version="1.0" standalone="yes"?>
12244     <!DOCTYPE p [
12245     <!ENTITY % para SYSTEM "p">
12246     %para;
12247     <!ATTLIST p a CDATA "&entity;">
12248     ]>
12249     <p/>
12250     @@@c:erred: <[[xp|wf-entity-declared]]> { (5, 22)..(5, 29); }
12251     @@@enImplNote:
12252     The <XML::ATTLIST> declaration is processed since
12253     it is a <XA::standalone> document.
12254     @@XMLTest:
12255     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.-3.test
12256     @@@DEnt:
12257     @@@@test:value:
12258     <?xml version="1.0" standalone="no"?>
12259     <!DOCTYPE p [
12260     <!ATTLIST p a CDATA "&entity;">
12261     <!ENTITY % para SYSTEM "p">
12262     %para;
12263     ]>
12264     <p/>
12265     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 22)..(3, 29); }
12266     @@@enImplNote:
12267     Is this well-formed? It has a parameter entity reference,
12268     therefore, it does not violates Entity Declared WFC, isn't it?
12269    
12270     Note that Firefox 1.5 and Opera 9 TP1 reports that this document has a
12271     fatal error (also note that they does not support unexpanded).
12272    
12273     See also:
12274     <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>
12275     @@XMLTest:
12276     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.-3.2.test
12277     @@@DEnt:
12278     @@@@test:value:
12279     <?xml version="1.0" standalone="no"?>
12280     <!DOCTYPE p [
12281 wakaba 1.25 <!ATTLIST p b CDATA #IMPLIED>
12282 wakaba 1.21 <!ENTITY % para SYSTEM "p">
12283     %para;
12284     <!ATTLIST p a CDATA "&entity;">
12285     ]>
12286     <p c="d"/>
12287 wakaba 1.25 @@@c:erred:
12288     <[[xp|warning-attribute-definition-not-processed]]> { (6, 13)..(6, 30); }
12289 wakaba 1.21 @@@test:domTree:
12290     document {
12291     document-type {
12292     element-type-definition {
12293 wakaba 1.25 node-name: 'p';
12294 wakaba 1.21 attribute-definition {
12295     node-name: 'b';
12296     }
12297     }
12298     }
12299     element {
12300     attribute {
12301     node-name: 'c';
12302     text-content: 'd';
12303     }
12304     }
12305     }
12306     @@@enImplNote:
12307     The second <XML::ATTLIST> declaration is read but not processed
12308     and its <XML::&entity;> general entity reference violates
12309     entity declared validty constraint rather than well-formedness
12310     constraint.
12311     @@XMLTest:
12312     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.-4.test
12313     @@@DEnt:
12314     @@@@test:value:
12315     <!DOCTYPE p [
12316     <!ATTLIST p a CDATA "&entity;">
12317     <!ENTITY % para SYSTEM "p">
12318     %para;
12319     ]>
12320     <p/>
12321     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 22)..(2, 29); }
12322     @@XMLTest:
12323     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.-4.2.test
12324     @@@DEnt:
12325     @@@@test:value:
12326     <!DOCTYPE p [
12327 wakaba 1.25 <!ATTLIST p b CDATA #IMPLIED>
12328 wakaba 1.21 <!ENTITY % para SYSTEM "p">
12329     %para;
12330     <!ATTLIST p a CDATA "&entity;">
12331     ]>
12332     <p c="d"/>
12333 wakaba 1.25 @@@c:erred:
12334     <[[xp|warning-attribute-definition-not-processed]]> { (5, 13)..(5, 30); }
12335 wakaba 1.21 @@@test:domTree:
12336     document {
12337     document-type {
12338     element-type-definition {
12339 wakaba 1.25 node-name: 'p';
12340 wakaba 1.21 attribute-definition {
12341     node-name: 'b';
12342     }
12343     }
12344     }
12345     element {
12346     attribute {
12347     node-name: 'c';
12348     text-content: 'd';
12349     }
12350     }
12351     }
12352     @@XMLTest:
12353     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.5.test
12354     @@@DEnt:
12355     @@@@test:value:
12356     <?xml version="1.0" standalone="yes"?>
12357     <!DOCTYPE p SYSTEM "dtd" [
12358     <!ATTLIST p a CDATA "&entity;">
12359     ]>
12360     <p/>
12361     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 22)..(3, 29); }
12362     @@@enImplNote:
12363     This document has an error - result is implementation dependent.
12364     @@XMLTest:
12365     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.-5.test
12366     @@@DEnt:
12367     @@@@test:value:
12368     <?xml version="1.0" standalone="no"?>
12369     <!DOCTYPE p SYSTEM "dtd" [
12370     <!ATTLIST p a CDATA "&entity;">
12371     ]>
12372     <p/>
12373     @@@test:domTree:
12374     document {
12375     document-type {
12376     element-type-definition {
12377     node-name: 'p';
12378     attribute-definition {
12379     node-name: 'a';
12380     general-entity-reference {
12381     node-name: 'entity';
12382     is-expanded: false;
12383     }
12384     }
12385     }
12386     }
12387     element {
12388     attribute {
12389     node-name: 'a';
12390     specified: false;
12391     general-entity-reference {
12392     node-name: 'entity';
12393     is-expanded: false;
12394     }
12395     }
12396     }
12397     }
12398     @@@enImplNote:
12399     This document has an error - result is implementation dependent.
12400     @@XMLTest:
12401     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.-6.test
12402     @@@DEnt:
12403     @@@@test:value:
12404     <!DOCTYPE p SYSTEM "dtd" [
12405     <!ATTLIST p a CDATA "&entity;">
12406     ]>
12407     <p/>
12408     @@@test:domTree:
12409     document {
12410     document-type {
12411     element-type-definition {
12412     node-name: 'p';
12413     attribute-definition {
12414     node-name: 'a';
12415     general-entity-reference {
12416     node-name: 'entity';
12417     is-expanded: false;
12418     }
12419     }
12420     }
12421     }
12422     element {
12423     attribute {
12424     node-name: 'a';
12425     specified: false;
12426     general-entity-reference {
12427     node-name: 'entity';
12428     is-expanded: false;
12429     }
12430     }
12431     }
12432     }
12433     @@@enImplNote:
12434     This document has an error - result is implementation dependent.
12435    
12436 wakaba 1.19 @@enImplNote:
12437     {TODO:: Entity declared WFC for
12438 wakaba 1.20
12439     - General entity references in entity value??
12440 wakaba 1.19
12441     }
12442    
12443 wakaba 1.23 @@XMLTest:
12444     @@@QName: xp.element.content.parsed.entity.reference.test
12445     @@@DEnt:
12446     @@@@test:value:
12447     <!DOCTYPE p [
12448     <!NOTATION n SYSTEM "notation">
12449     <!ENTITY ext SYSTEM "system" NDATA n>
12450     ]>
12451     <p>&ext;</p>
12452     @@@c:erred: <[[xp|wf-parsed-entity]]> { (5, 4)..(5, 8); }
12453     @@XMLTest:
12454     @@@QName: xp.attval.parsed.entity.reference.test
12455     @@@DEnt:
12456     @@@@test:value:
12457     <!DOCTYPE p [
12458     <!NOTATION n SYSTEM "notation">
12459     <!ENTITY ext SYSTEM "system" NDATA n>
12460     ]>
12461     <p a="&ext;"/>
12462     # @@@c:erred: <[[xp|wf-parsed-entity]]> { (5, 7)..(5, 11); }
12463     @@@c:erred: <[[xp|wf-no-external-entity-references]]> { (5, 7)..(5, 11); }
12464     @@XMLTest:
12465     @@@QName: xp.element.content.reptxt.parsed.entity.reference.test
12466     @@@DEnt:
12467     @@@@test:value:
12468     <!DOCTYPE p [
12469     <!NOTATION n SYSTEM "notation">
12470     <!ENTITY ext SYSTEM "system" NDATA n>
12471     <!ENTITY c "&#x26;ext;">
12472     ]>
12473     <p>&c;</p>
12474     @@@c:erred: <[[xp|wf-parsed-entity]]> { (1, 1)..(1, 5); }
12475     @@XMLTest:
12476     @@@QName: xp.attval.reptxt.parsed.entity.reference.test
12477     @@@DEnt:
12478     @@@@test:value:
12479     <!DOCTYPE p [
12480     <!NOTATION n SYSTEM "notation">
12481     <!ENTITY ext SYSTEM "system" NDATA n>
12482     <!ENTITY c "&#x26;ext;">
12483     ]>
12484     <p a="&c;"/>
12485     @@@c:erred: <[[xp|wf-no-external-entity-references]]> { (1, 1)..(1, 5); }
12486     @@@c:erred:
12487     @@@@@: <[[xp|wf-parsed-entity]]> { }
12488     @@@@enImplNote: During entity node construction.
12489     @@XMLTest:
12490     @@@QName: xp.element.content.entval.parsed.entity.reference.test
12491     @@@DEnt:
12492     @@@@test:value:
12493     <!DOCTYPE p [
12494     <!NOTATION n SYSTEM "notation">
12495     <!ENTITY ext SYSTEM "system" NDATA n>
12496     <!ENTITY c "&ext;">
12497     ]>
12498     <p>&c;</p>
12499     @@@c:erred: <[[xp|wf-parsed-entity]]> { }
12500     @@XMLTest:
12501     @@@QName: xp.attval.entval.parsed.entity.reference.test
12502     @@@DEnt:
12503     @@@@test:value:
12504     <!DOCTYPE p [
12505     <!NOTATION n SYSTEM "notation">
12506     <!ENTITY ext SYSTEM "system" NDATA n>
12507     <!ENTITY c "&ext;">
12508     ]>
12509     <p a="&c;"/>
12510     @@@c:erred: <[[xp|wf-no-external-entity-references]]> { }
12511     @@@c:erred: <[[xp|wf-parsed-entity]]> { }
12512    
12513     @@XMLTest:
12514     @@@QName: xp.element.content.no.recursion.direct.test
12515     @@@DEnt:
12516     @@@@test:value:
12517     <!DOCTYPE p [
12518     <!ENTITY c "&c;">
12519     ]>
12520     <p>&c;</p>
12521     @@@c:erred: <[[xp|wf-no-recursion]]> { (1, 1)..(1, 3); }
12522     @@XMLTest:
12523     @@@QName: xp.element.content.no.recursion.indirect.test
12524     @@@DEnt:
12525     @@@@test:value:
12526     <!DOCTYPE p [
12527     <!ENTITY d "&c;">
12528     <!ENTITY c "&d;">
12529     ]>
12530     <p>&c;</p>
12531     @@@c:erred: <[[xp|wf-no-recursion]]> { /* |d| */ (1, 1)..(1, 3); }
12532     @@XMLTest:
12533     @@@QName: xp.attval.no.recursion.direct.test
12534     @@@DEnt:
12535     @@@@test:value:
12536     <!DOCTYPE p [
12537     <!ENTITY c "&c;">
12538     ]>
12539     <p a="&c;"/>
12540     @@@c:erred: <[[xp|wf-no-recursion]]> { (1, 1)..(1, 3); }
12541     @@XMLTest:
12542     @@@QName: xp.attval.no.recursion.indirect.test
12543     @@@DEnt:
12544     @@@@test:value:
12545     <!DOCTYPE p [
12546     <!ENTITY d "&c;">
12547     <!ENTITY c "&d;">
12548     ]>
12549     <p a="&c;"/>
12550     @@@c:erred: <[[xp|wf-no-recursion]]> { /* |d| */ (1, 1)..(1, 3); }
12551     @@XMLTest:
12552     @@@QName: xp.reptxt.element.content.no.recursion.direct.test
12553     @@@DEnt:
12554     @@@@test:value:
12555     <!DOCTYPE p [
12556     <!ENTITY c "&c;">
12557     <!ENTITY e "&#x26;c;">
12558     ]>
12559     <p>&e;</p>
12560     @@@c:erred: <[[xp|wf-no-recursion]]> { /* |e| */ (1, 1)..(1, 3); }
12561     @@XMLTest:
12562     @@@QName: xp.reptxt.element.content.no.recursion.indirect.test
12563     @@@DEnt:
12564     @@@@test:value:
12565     <!DOCTYPE p [
12566     <!ENTITY d "&c;">
12567     <!ENTITY c "&d;">
12568     <!ENTITY e "&#x26;c;">
12569     ]>
12570     <p>&e;</p>
12571     @@@c:erred: <[[xp|wf-no-recursion]]> { /* |d| */ (1, 1)..(1, 3); }
12572     @@XMLTest:
12573     @@@QName: xp.reptxt.attval.no.recursion.direct.test
12574     @@@DEnt:
12575     @@@@test:value:
12576     <!DOCTYPE p [
12577     <!ENTITY c "&c;">
12578     <!ENTITY e "&#x26;c;">
12579     ]>
12580     <p a="&e;"/>
12581     @@@c:erred: <[[xp|wf-no-recursion]]> { /* |e| */ (1, 1)..(1, 3); }
12582     @@XMLTest:
12583     @@@QName: xp.reptxt.attval.no.recursion.indirect.test
12584     @@@DEnt:
12585     @@@@test:value:
12586     <!DOCTYPE p [
12587     <!ENTITY d "&c;">
12588     <!ENTITY c "&d;">
12589     <!ENTITY e "&#x26;c;">
12590     ]>
12591     <p a="&e;"/>
12592     @@@c:erred: <[[xp|wf-no-recursion]]> { /* |d| */ (1, 1)..(1, 3); }
12593    
12594     @@XMLTest:
12595     @@@QName: xp.ENTITY.system.ndata.name.test
12596     @@@DEnt:
12597     @@@@test:value:
12598     <!DOCTYPE a [
12599     <!NOTATION n SYSTEM "n">
12600     <!ENTITY % e SYSTEM "sys" NDATA n>
12601     ]><a/>
12602     @@@c:erred: <[[xp|wf-syntax-error]]> { (3, 26)..(3, 30); }
12603     @@XMLTest:
12604     @@@QName: xp.ENTITY.public.ndata.name.test
12605     @@@DEnt:
12606     @@@@test:value:
12607     <!DOCTYPE a [
12608     <!NOTATION n SYSTEM "n">
12609     <!ENTITY % e PUBLIC "pub" "sys" NDATA n>
12610     ]><a/>
12611     @@@c:erred: <[[xp|wf-syntax-error]]> { (3, 33)..(3, 37); }
12612     @@XMLTest:
12613     @@@QName: xp.ENTITY.public.ndata.name.-1.test
12614     @@@DEnt:
12615     @@@@test:value:
12616     <!DOCTYPE a [
12617     <!NOTATION n SYSTEM "n">
12618     <!ENTITY % e PUBLIC "pub" "sys" >
12619     ]><a/>
12620     @@@test:domTree:
12621     document { }
12622    
12623     @@XMLTest:
12624     @@@QName: xp.ENTITY.pubid.1.test
12625     @@@DEnt:
12626     @@@@test:value:
12627     <!DOCTYPE a [
12628     <!ENTITY e PUBLIC "p" "s">
12629     ]><a/>
12630     @@@test:domTree:
12631     document {
12632     document-type {
12633     general-entity {
12634     node-name: 'e';
12635     public-id: 'p';
12636     system-id: 's';
12637     }
12638     }
12639     element { }
12640     }
12641     @@XMLTest:
12642     @@@QName: xp.ENTITY.pubid.2.test
12643     @@@DEnt:
12644     @@@@test:value:
12645     <!DOCTYPE a [
12646     <!ENTITY e PUBLIC " p " "s">
12647     ]><a/>
12648     @@@test:domTree:
12649     document {
12650     document-type {
12651     general-entity {
12652     node-name: 'e';
12653     public-id: 'p';
12654     system-id: 's';
12655     }
12656     }
12657     element { }
12658     }
12659     @@XMLTest:
12660     @@@QName: xp.ENTITY.pubid.3.test
12661     @@@DEnt:
12662     @@@@test:value:
12663     <!DOCTYPE a [
12664     <!ENTITY e PUBLIC " p $u000Aq$u000A " "s">
12665     ]><a/>
12666     @@@test:domTree:
12667     document {
12668     document-type {
12669     general-entity {
12670     node-name: 'e';
12671     public-id: 'p q';
12672     system-id: 's';
12673     }
12674     }
12675     element { }
12676     }
12677     @@XMLTest:
12678     @@@QName: xp.ENTITY.pubid.4.test
12679     @@@DEnt:
12680     @@@@test:value:
12681     <!DOCTYPE a [
12682     <!ENTITY e PUBLIC " p $u000D$u000Aq" "s">
12683     ]><a/>
12684     @@@test:domTree:
12685     document {
12686     document-type {
12687     general-entity {
12688     node-name: 'e';
12689     public-id: 'p q';
12690     system-id: 's';
12691     }
12692     }
12693     element { }
12694     }
12695     @@XMLTest:
12696     @@@QName: xp.ENTITY.pubid.5.test
12697     @@@DEnt:
12698     @@@@test:value:
12699     <?xml version="1.1"?>
12700     <!DOCTYPE a [
12701 wakaba 1.27 <!ENTITY e PUBLIC " p $u000D$u0085q" "s">
12702 wakaba 1.23 ]><a/>
12703     @@@test:domTree:
12704     document {
12705     document-type {
12706     general-entity {
12707     node-name: 'e';
12708     public-id: 'p q';
12709     system-id: 's';
12710     }
12711     }
12712     element { }
12713     }
12714    
12715 wakaba 1.24 @@XMLTest:
12716     @@@QName: xp.ENTITY.ignored.test
12717     @@@DEnt:
12718     @@@@test:value:
12719     <!DOCTYPE a [
12720     <!ENTITY e "a">
12721     <!ENTITY e "b">
12722     ]><a/>
12723     @@@test:domTree:
12724     document {
12725     document-type {
12726     general-entity {
12727     node-name: 'e';
12728     text-content: 'a';
12729     }
12730     }
12731     element { }
12732     }
12733     @@@c:erred:
12734     <[[xp|warning-entity-declaration-ignored]]> { (3, 1)..(3, 15); }
12735     @@XMLTest:
12736     @@@QName: xp.ENTITY.ignored.2.test
12737     @@@DEnt:
12738     @@@@test:value:
12739     <!DOCTYPE a [
12740     <!ENTITY % e "a">
12741     <!ENTITY % e "b">
12742     ]><a/>
12743     @@@test:domTree:
12744     document { }
12745     @@@c:erred:
12746     <[[xp|warning-entity-declaration-ignored]]> { (3, 1)..(3, 17); }
12747    
12748     @@XMLTest:
12749     @@@QName: xp.ENTITY.predefined.1.test
12750     @@@DEnt:
12751     @@@@test:value:
12752     <!DOCTYPE a [
12753     <!ENTITY lt "&#38;#60;">
12754     <!ENTITY gt "&#62;">
12755     <!ENTITY amp "&#38;#38;">
12756     <!ENTITY apos "&#39;">
12757     <!ENTITY quot "&#34;">
12758     <!ENTITY e "f">
12759     ]><a>&lt;&gt;&amp;&apos;&quot;</a>
12760     @@@test:domTree:
12761     document {
12762     document-type {
12763     general-entity {
12764     node-name: 'e';
12765     text-content: 'f';
12766     }
12767     }
12768     element {
12769     text-content: '<>&' U+0027 '"';
12770     }
12771     }
12772     @@XMLTest:
12773     @@@QName: xp.ENTITY.predefined.2.test
12774     @@@DEnt:
12775     @@@@test:value:
12776     <!DOCTYPE a [
12777     <!ENTITY lt "&#38;#60;">
12778     <!ENTITY gt "&#x26;#62;">
12779     <!ENTITY amp "&#38;#38;">
12780     <!ENTITY apos "&#x26;#39;">
12781     <!ENTITY quot "&#x26;#34;">
12782     <!ENTITY e "f">
12783     ]><a>&lt;&gt;&amp;&apos;&quot;</a>
12784     @@@test:domTree:
12785     document {
12786     document-type {
12787     general-entity {
12788     node-name: 'e';
12789     text-content: 'f';
12790     }
12791     }
12792     element {
12793     text-content: '<>&' U+0027 '"';
12794     }
12795     }
12796     @@XMLTest:
12797     @@@QName: xp.ENTITY.predefined.3.test
12798     @@@DEnt:
12799     @@@@test:value:
12800     <!DOCTYPE a [
12801     <!ENTITY lt "&#60;">
12802     <!ENTITY gt "&#62;">
12803     <!ENTITY amp "&#38;">
12804     <!ENTITY apos "&#39;">
12805     <!ENTITY quot "&#34;">
12806     <!ENTITY e "f">
12807     ]><a>&lt;&gt;&amp;&apos;&quot;</a>
12808     @@@c:erred: <[[xp|error-malformed-predefined-entity]]> { (2, 1)..(2, 24); }
12809     @@@c:erred: <[[xp|error-malformed-predefined-entity]]> { (4, 1)..(4, 24); }
12810     @@@test:domTree:
12811     document {
12812     document-type {
12813     general-entity {
12814     node-name: 'e';
12815     text-content: 'f';
12816     }
12817     }
12818     element {
12819     text-content: '<>&' U+0027 '"';
12820     }
12821     }
12822     @@XMLTest:
12823     @@@QName: xp.ENTITY.predefined.4.test
12824     @@@DEnt:
12825     @@@@test:value:
12826     <!DOCTYPE a [
12827     <!ENTITY lt "1">
12828     <!ENTITY gt "2">
12829     <!ENTITY amp "3">
12830     <!ENTITY apos "4">
12831     <!ENTITY quot "5">
12832     <!ENTITY e "f">
12833     ]><a>&lt;&gt;&amp;&apos;&quot;</a>
12834     @@@c:erred: <[[xp|error-malformed-predefined-entity]]> { (2, 1)..(2, 24); }
12835     @@@c:erred: <[[xp|error-malformed-predefined-entity]]> { (3, 1)..(3, 24); }
12836     @@@c:erred: <[[xp|error-malformed-predefined-entity]]> { (4, 1)..(4, 24); }
12837     @@@c:erred: <[[xp|error-malformed-predefined-entity]]> { (5, 1)..(5, 24); }
12838     @@@c:erred: <[[xp|error-malformed-predefined-entity]]> { (6, 1)..(6, 24); }
12839     @@@test:domTree:
12840     document {
12841     document-type {
12842     general-entity {
12843     node-name: 'e';
12844     text-content: 'f';
12845     }
12846     }
12847     element {
12848     text-content: '<>&' U+0027 '"';
12849     }
12850     }
12851     @@XMLTest:
12852     @@@QName: xp.ENTITY.predefined.5.test
12853     @@@DEnt:
12854     @@@@test:value:
12855     <!DOCTYPE a [
12856     <!ENTITY lt SYSTEM "1">
12857     <!ENTITY gt SYSTEM "2">
12858     <!ENTITY amp SYSTEM "3">
12859     <!ENTITY apos SYSTEM "4">
12860     <!ENTITY quot SYSTEM "5">
12861     <!ENTITY e "f">
12862     ]><a>&lt;&gt;&amp;&apos;&quot;</a>
12863     @@@c:erred: <[[xp|error-internal-predefined-entity]]> { (2, 1)..(2, 27); }
12864     @@@c:erred: <[[xp|error-internal-predefined-entity]]> { (3, 1)..(3, 27); }
12865     @@@c:erred: <[[xp|error-internal-predefined-entity]]> { (4, 1)..(4, 27); }
12866     @@@c:erred: <[[xp|error-internal-predefined-entity]]> { (5, 1)..(5, 27); }
12867     @@@c:erred: <[[xp|error-internal-predefined-entity]]> { (6, 1)..(6, 27); }
12868     @@@test:domTree:
12869     document {
12870     document-type {
12871     general-entity {
12872     node-name: 'e';
12873     text-content: 'f';
12874     }
12875     }
12876     element {
12877     text-content: '<>&' U+0027 '"';
12878     }
12879     }
12880     @@XMLTest:
12881     @@@QName: xp.ENTITY.predefined.6.test
12882     @@@DEnt:
12883     @@@@test:value:
12884     <!DOCTYPE a [
12885     <!ENTITY % lt SYSTEM "1">
12886     <!ENTITY % gt SYSTEM "2">
12887     <!ENTITY % amp SYSTEM "3">
12888     <!ENTITY % apos SYSTEM "4">
12889     <!ENTITY % quot SYSTEM "5">
12890     <!ENTITY e "f">
12891     ]><a>&lt;&gt;&amp;&apos;&quot;</a>
12892     @@@test:domTree:
12893     document {
12894     document-type {
12895     general-entity {
12896     node-name: 'e';
12897     text-content: 'f';
12898     }
12899     }
12900     element {
12901     text-content: '<>&' U+0027 '"';
12902     }
12903     }
12904     @@XMLTest:
12905     @@@QName: xp.ENTITY.predefined.7.test
12906     @@@DEnt:
12907     @@@@test:value:
12908     <!DOCTYPE a [
12909     <!ENTITY lt "&#38;#x3C;">
12910     <!ENTITY gt "&#x3E;">
12911     <!ENTITY amp "&#38;#x26;">
12912     <!ENTITY apos "&#x27;">
12913     <!ENTITY quot "&#x22;">
12914     <!ENTITY e "f">
12915     ]><a>&lt;&gt;&amp;&apos;&quot;</a>
12916     @@@test:domTree:
12917     document {
12918     document-type {
12919     general-entity {
12920     node-name: 'e';
12921     text-content: 'f';
12922     }
12923     }
12924     element {
12925     text-content: '<>&' U+0027 '"';
12926     }
12927     }
12928     @@XMLTest:
12929     @@@QName: xp.ENTITY.predefined.8.test
12930     @@@DEnt:
12931     @@@@test:value:
12932     <!DOCTYPE a [
12933     <!ENTITY lt "&#38;#x3c;">
12934     <!ENTITY gt "&#x3e;">
12935     <!ENTITY amp "&#38;#x26;">
12936     <!ENTITY apos "&#x27;">
12937     <!ENTITY quot "&#x22;">
12938     <!ENTITY e "f">
12939     ]><a>&lt;&gt;&amp;&apos;&quot;</a>
12940     @@@test:domTree:
12941     document {
12942     document-type {
12943     general-entity {
12944     node-name: 'e';
12945     text-content: 'f';
12946     }
12947     }
12948     element {
12949     text-content: '<>&' U+0027 '"';
12950     }
12951     }
12952     @@XMLTest:
12953     @@@QName: xp.ENTITY.predefined.9.test
12954     @@@DEnt:
12955     @@@@test:value:
12956     <!DOCTYPE a [
12957     <!ENTITY lt "&#38;#x00003C;">
12958     <!ENTITY gt "&#x0003E;">
12959     <!ENTITY amp "&#38;#x026;">
12960     <!ENTITY apos "&#x000027;">
12961     <!ENTITY quot "&#x0022;">
12962     <!ENTITY e "f">
12963     ]><a>&lt;&gt;&amp;&apos;&quot;</a>
12964     @@@test:domTree:
12965     document {
12966     document-type {
12967     general-entity {
12968     node-name: 'e';
12969     text-content: 'f';
12970     }
12971     }
12972     element {
12973     text-content: '<>&' U+0027 '"';
12974     }
12975     }
12976     @@XMLTest:
12977     @@@QName: xp.ENTITY.predefined.10.test
12978     @@@DEnt:
12979     @@@@test:value:
12980     <!DOCTYPE a [
12981     <!ENTITY lt "&#38;#00060;">
12982     <!ENTITY gt "&#062;">
12983     <!ENTITY amp "&#38;#000038;">
12984     <!ENTITY apos "&#0000039;">
12985     <!ENTITY quot "&#0034;">
12986     <!ENTITY e "f">
12987     ]><a>&lt;&gt;&amp;&apos;&quot;</a>
12988     @@@test:domTree:
12989     document {
12990     document-type {
12991     general-entity {
12992     node-name: 'e';
12993     text-content: 'f';
12994     }
12995     }
12996     element {
12997     text-content: '<>&' U+0027 '"';
12998     }
12999     }
13000    
13001 wakaba 1.25 @@XMLTest:
13002     @@@QName: xp.processed.1.test
13003     @@@DEnt:
13004     @@@@test:value:
13005     <a/>
13006     @@@test:domTree:
13007     document {
13008     all-declarations-processed: true;
13009     element { }
13010     }
13011     @@XMLTest:
13012     @@@QName: xp.processed.2.test
13013     @@@DEnt:
13014     @@@@test:value:
13015     <!DOCTYPE a [
13016     <!ENTITY e "f">
13017     <!ATTLIST a b NMTOKEN " c ">
13018     ]><a>&e;</a>
13019     @@@test:domTree:
13020     document {
13021     document-type {
13022     general-entity {
13023     node-name: 'e';
13024     }
13025     element-type-definition {
13026     node-name: 'a';
13027     attribute-definition {
13028     node-name: 'b';
13029     }
13030     }
13031     }
13032     all-declarations-processed: true;
13033     element {
13034     attribute {
13035     node-name: 'b';
13036     node-value: 'c';
13037     }
13038     text-content: 'f';
13039     }
13040     }
13041     @@XMLTest:
13042     @@@QName: xp.processed.3.test
13043     @@@DEnt:
13044     @@@@test:value:
13045     <!DOCTYPE a [
13046     <!ENTITY % p SYSTEM "p">
13047     %p;
13048     <!ENTITY e "f">
13049     <!ATTLIST a b NMTOKEN " c ">
13050     ]><a d="e">&e;</a>
13051     @@@test:domTree:
13052     document {
13053     document-type { }
13054     all-declarations-processed: false;
13055     element {
13056     attribute {
13057     node-name: 'd';
13058     node-value: 'e';
13059     }
13060     general-entity-reference {
13061     node-name: 'e';
13062     is-expanded: false;
13063     }
13064     }
13065     }
13066     @@@c:erred:
13067     <[[xp|warning-entity-declaration-not-processed]]> { (4, 1)..(4, 20); }
13068     @@@c:erred:
13069     <[[xp|warning-attribute-definition-not-processed]]> { (5, 13)..(5, 31); }
13070     @@XMLTest:
13071     @@@QName: xp.processed.4.test
13072     @@@DEnt:
13073     @@@@test:value:
13074     <?xml version="1.1" standalone="yes"?>
13075     <!DOCTYPE a [
13076     <!ENTITY % p SYSTEM "p">
13077     %p;
13078     <!ENTITY e "f">
13079     <!ATTLIST a b NMTOKEN " c ">
13080     ]><a>&e;</a>
13081     @@@test:domTree:
13082     document {
13083     document-type {
13084     general-entity {
13085     node-name: 'e';
13086     }
13087     element-type-definition {
13088     node-name: 'a';
13089     attribute-definition {
13090     node-name: 'b';
13091     }
13092     }
13093     }
13094     all-declarations-processed: false;
13095     element {
13096     attribute {
13097     node-name: 'b';
13098     node-value: 'c';
13099     }
13100     text-content: 'f';
13101     }
13102     }
13103     @@XMLTest:
13104     @@@QName: xp.processed.5.test
13105     @@@DEnt:
13106     @@@@test:value:
13107     <!DOCTYPE a SYSTEM "p" [
13108     <!ENTITY e "f">
13109     <!ATTLIST a b NMTOKEN " c ">
13110     ]><a>&e;</a>
13111     @@@test:domTree:
13112     document {
13113     document-type {
13114     general-entity {
13115     node-name: 'e';
13116     }
13117     element-type-definition {
13118     node-name: 'a';
13119     attribute-definition {
13120     node-name: 'b';
13121     }
13122     }
13123     }
13124     all-declarations-processed: false;
13125     element {
13126     attribute {
13127     node-name: 'b';
13128     node-value: 'c';
13129     }
13130     text-content: 'f';
13131     }
13132     }
13133    
13134     @@XMLTest:
13135     @@@QName: xp.PEs.in.internal.subset.1.test
13136     @@@DEnt:
13137     @@@@test:value:
13138     <!DOCTYPE a [
13139     <!ENTITY % p " ">
13140 wakaba 1.26 <!ENTITY % q "%p;">
13141 wakaba 1.25 ]><a/>
13142     @@@c:erred: <[[xp|wf-pes-in-internal-subset]]> { (3, 15)..(3, 17); }
13143     @@XMLTest:
13144     @@@QName: xp.PEs.in.internal.subset.2.test
13145     @@@DEnt:
13146     @@@@test:value:
13147     <!DOCTYPE a [
13148     <!ENTITY % p " ">
13149 wakaba 1.26 <!ENTITY % q '%p;'>
13150 wakaba 1.25 ]><a/>
13151     @@@c:erred: <[[xp|wf-pes-in-internal-subset]]> { (3, 15)..(3, 17); }
13152    
13153 wakaba 1.26 @@XMLTest:
13154     @@@QName: xp.name.pitarget.content.1.0.2.test
13155     @@@DEnt:
13156     @@@@test:value:
13157     <?xml version="1.0"?>
13158     <p>
13159     <?$u3001$u3002?>
13160     </p>
13161     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]> { (3, 3)..(3, 4); }
13162     @@XMLTest:
13163     @@@QName: xp.name.pitarget.content.1.1.2.test
13164     @@@DEnt:
13165     @@@@test:value:
13166     <?xml version="1.1"?>
13167     <p>$
13168     <?$u3001$u3002?>$
13169     </p>
13170     @@@test:domTree:
13171     document {
13172     xml-version: '1.1';
13173     element {
13174     pi {
13175     node-name: U+3001 U+3002;
13176 wakaba 1.14 }
13177 wakaba 1.12 }
13178 wakaba 1.26 }
13179     @@XMLTest:
13180     @@@QName: xp.name.pitarget.content.1.0.3.test
13181     @@@DEnt:
13182     @@@@test:value:
13183     <?xml version="1.0"?>
13184     <p>
13185     <?$u3005b?>
13186     </p>
13187     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]> { (3, 3)..(3, 4); }
13188     @@XMLTest:
13189     @@@QName: xp.name.pitarget.content.1.1.3.test
13190     @@@DEnt:
13191     @@@@test:value:
13192     <?xml version="1.1"?>
13193     <p>$
13194     <?$u3005b?>$
13195     </p>
13196     @@@test:domTree:
13197     document {
13198     xml-version: '1.1';
13199     element {
13200     pi {
13201     node-name: U+3005 'b';
13202 wakaba 1.12 }
13203     }
13204 wakaba 1.26 }
13205     @@XMLTest:
13206     @@@QName: xp.name.pitarget.content.names.1.0.1.test
13207     @@@DEnt:
13208     @@@@test:value:
13209     <?xml version="1.0"?>
13210     <p>
13211     <?a:b?>
13212     </p>
13213     @@@c:erred: <[[xp|nswf-legal-ncname]]> { (3, 3)..(3, 5); }
13214     @@XMLTest:
13215     @@@QName: xp.name.pitarget.content.names.1.1.1.test
13216     @@@DEnt:
13217     @@@@test:value:
13218     <?xml version="1.1"?>
13219     <p>
13220     <?a:b?>
13221     </p>
13222     @@@c:erred: <[[xp|nswf-legal-ncname]]> { (3, 3)..(3, 5); }
13223     @@XMLTest:
13224     @@@QName: xp.name.pitarget.intsubset.1.0.2.test
13225     @@@DEnt:
13226     @@@@test:value:
13227     <?xml version="1.0"?>
13228     <!DOCTYPE p [
13229     <?$u3001$u3002?>
13230     ]><p/>
13231     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]> { (3, 3)..(3, 4); }
13232     @@XMLTest:
13233     @@@QName: xp.name.pitarget.intsubset.1.1.2.test
13234     @@@DEnt:
13235     @@@@test:value:
13236     <?xml version="1.1"?>
13237     <!DOCTYPE p [
13238     <?$u3001$u3002?>
13239     ]><p/>
13240     @@@test:domTree:
13241     document {
13242     xml-version: '1.1';
13243     document-type {
13244     pi {
13245     node-name: U+3001 U+3002;
13246     }
13247     }
13248     element { }
13249     }
13250     @@XMLTest:
13251     @@@QName: xp.name.pitarget.intsubset.1.0.3.test
13252     @@@DEnt:
13253     @@@@test:value:
13254     <?xml version="1.0"?>
13255     <!DOCTYPE p [
13256     <?$u3005b?>
13257     ]><p/>
13258     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]> { (3, 3)..(3, 4); }
13259     @@XMLTest:
13260     @@@QName: xp.name.pitarget.intsubset.1.1.3.test
13261     @@@DEnt:
13262     @@@@test:value:
13263     <?xml version="1.1"?>
13264     <!DOCTYPE p [
13265     <?$u3005b?>
13266     ]><p/>
13267     @@@test:domTree:
13268     document {
13269     xml-version: '1.1';
13270     document-type {
13271     pi {
13272     node-name: U+3005 'b';
13273     }
13274     }
13275     element { }
13276     }
13277     @@XMLTest:
13278     @@@QName: xp.name.pitarget.intsubset.names.1.0.1.test
13279     @@@DEnt:
13280     @@@@test:value:
13281     <?xml version="1.0"?>
13282     <!DOCTYPE p [
13283     <?a:b?>
13284     ]><p/>
13285     @@@c:erred: <[[xp|nswf-legal-ncname]]> { (3, 3)..(3, 5); }
13286     @@XMLTest:
13287     @@@QName: xp.name.pitarget.intsubset.names.1.1.1.test
13288     @@@DEnt:
13289     @@@@test:value:
13290     <?xml version="1.1"?>
13291     <!DOCTYPE p [
13292     <?a:b?>
13293     ]><p/>
13294     @@@c:erred: <[[xp|nswf-legal-ncname]]> { (3, 3)..(3, 5); }
13295     @@XMLTest:
13296     @@@QName: xp.name.doctypedecl.stag.etag.1.0.2.test
13297     @@@DEnt:
13298     @@@@test:value:
13299     <?xml version="1.0"?>
13300     <!DOCTYPE $u3001$u3002>
13301     <$u3001$u3002>
13302     </$u3001$u3002>
13303     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (2, 11)..(2, 12); }
13304     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (3, 2)..(3, 3); }
13305     # @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (4, 3)..(4, 4); }
13306     @@XMLTest:
13307     @@@QName: xp.name.doctypedecl.stag.etag.1.1.2.test
13308     @@@DEnt:
13309     @@@@test:value:
13310     <?xml version="1.1"?>
13311     <!DOCTYPE $u3001$u3002>
13312     <$u3001$u3002>
13313     </$u3001$u3002>
13314     @@@test:domTree:
13315     document {
13316     xml-version: '1.1';
13317     document-type {
13318     node-name: U+3001 U+3002;
13319     }
13320     element {
13321     node-name: U+3001 U+3002;
13322     }
13323     }
13324     @@XMLTest:
13325     @@@QName: xp.name.doctypedecl.stag.etag.1.0.3.test
13326     @@@DEnt:
13327     @@@@test:value:
13328     <?xml version="1.0"?>
13329     <!DOCTYPE $u3005b>
13330     <$u3005b>
13331     </$u3005b>
13332     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (2, 11)..(2, 12); }
13333     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (3, 2)..(3, 3); }
13334     # @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (4, 3)..(4, 4); }
13335     @@XMLTest:
13336     @@@QName: xp.name.doctype.decl.stag.etag.1.1.3.test
13337     @@@DEnt:
13338     @@@@test:value:
13339     <?xml version="1.1"?>
13340     <!DOCTYPE $u3005b>
13341     <$u3005b>
13342     </$u3005b>
13343     @@@test:domTree:
13344     document {
13345     xml-version: '1.1';
13346     document-type {
13347     node-name: U+3005 'b';
13348     }
13349     element {
13350     node-name: U+3005 'b';
13351     }
13352     }
13353     @@XMLTest:
13354     @@@QName: xp.name.doctypedecl.stag.etag.names.1.0.1.test
13355     @@@DEnt:
13356     @@@@test:value:
13357     <?xml version="1.0"?>
13358     <!DOCTYPE a:b>
13359     <a:b xmlns:a="http://a.example/">
13360     </a:b>
13361     @@@test:domTree:
13362     document {
13363     xml-version: '1.0';
13364     document-type {
13365     node-name: 'a:b';
13366     }
13367     element {
13368     prefix: 'a';
13369     local-name: 'b';
13370     namespace-uri: 'http://a.example/';
13371     attribute {
13372     namespace-uri: 'http://www.w3.org/2000/xmlns/';
13373     prefix: 'xmlns';
13374     local-name: 'a';
13375     value: 'http://a.example/';
13376     specified: true;
13377     }
13378     }
13379     }
13380     @@XMLTest:
13381     @@@QName: xp.name.doctypedecl.stag.etag.names.1.1.1.test
13382     @@@DEnt:
13383     @@@@test:value:
13384     <?xml version="1.1"?>
13385     <!DOCTYPE a:b>
13386     <a:b xmlns:a="http://a.example/">
13387     </a:b>
13388     @@@test:domTree:
13389     document {
13390     xml-version: '1.1';
13391     document-type {
13392     node-name: 'a:b';
13393     }
13394     element {
13395     prefix: 'a';
13396     local-name: 'b';
13397     namespace-uri: 'http://a.example/';
13398     attribute {
13399     namespace-uri: 'http://www.w3.org/2000/xmlns/';
13400     prefix: 'xmlns';
13401     local-name: 'a';
13402     specified: true;
13403     }
13404     }
13405     }
13406     @@XMLTest:
13407     @@@QName: xp.name.doctypedecl.stag.etag.names.1.0.2.test
13408     @@@DEnt:
13409     @@@@test:value:
13410     <?xml version="1.0"?>
13411     <!DOCTYPE :ab>
13412     <:ab>
13413     </:ab>
13414     @@@c:erred: <[[xp|nswf-legal-qname]]> { (2, 11)..(2, 13); }
13415     @@@c:erred: <[[xp|nswf-legal-qname]]> { (3, 2)..(3, 4); }
13416     @@@c:erred: <[[xp|nsc-prefix-declared]]> { /* prefix || */ }
13417     @@XMLTest:
13418     @@@QName: xp.name.doctypedecl.stag.etag.names.1.1.2.test
13419     @@@DEnt:
13420     @@@@test:value:
13421     <?xml version="1.1"?>
13422     <!DOCTYPE :ab>
13423     <:ab>
13424     </:ab>
13425     @@@c:erred: <[[xp|nswf-legal-qname]]> { (2, 11)..(2, 13); }
13426     @@@c:erred: <[[xp|nswf-legal-qname]]> { (3, 2)..(3, 4); }
13427     @@@c:erred: <[[xp|nsc-prefix-declared]]> { /* prefix || */ }
13428     @@XMLTest:
13429     @@@QName: xp.name.doctypedecl.stag.etag.names.1.0.3.test
13430     @@@DEnt:
13431     @@@@test:value:
13432     <?xml version="1.0"?>
13433     <!DOCTYPE a:$u3005>
13434     <a:$u3005 xmlns:a="http://a.example/">
13435     </a:$u3005>
13436     @@@c:erred: <[[xp|nswf-legal-qname]]> { (2, 11)..(2, 13); }
13437     @@@c:erred: <[[xp|nswf-legal-qname]]> { (3, 2)..(3, 4); }
13438     @@XMLTest:
13439     @@@QName: xp.name.doctypedecl.stag.etag.names.1.1.3.test
13440     @@@DEnt:
13441     @@@@test:value:
13442     <?xml version="1.1"?>
13443     <!DOCTYPE a:$u3005>
13444     <a:$u3005 xmlns:a="http://a.example/">
13445     </a:$u3005>
13446     @@@test:domTree:
13447     document {
13448     xml-version: '1.1';
13449     document-type {
13450     node-name: 'a:' U+3005;
13451     }
13452     element {
13453     prefix: 'a';
13454     local-name: U+3005;
13455     namespace-uri: 'http://a.example/';
13456     attribute {
13457     namespace-uri: 'http://www.w3.org/2000/xmlns/';
13458     prefix: 'xmlns';
13459     local-name: 'a';
13460     value: 'http://a.example/';
13461     specified: true;
13462     }
13463     }
13464     }
13465     @@XMLTest:
13466     @@@QName: xp.name.doctypedecl.stag.etag.names.1.0.4.test
13467     @@@DEnt:
13468     @@@@test:value:
13469     <?xml version="1.0"?>
13470     <!DOCTYPE a:b>
13471     <a:b>
13472     </a:b>
13473     @@@c:erred: <[[xp|nsc-prefix-declared]]> { (3, 1)..(3, 5); }
13474     @@XMLTest:
13475     @@@QName: xp.name.doctypedecl.stag.etag.names.1.1.4.test
13476     @@@DEnt:
13477     @@@@test:value:
13478     <?xml version="1.1"?>
13479     <!DOCTYPE a:b>
13480     <a:b>
13481     </a:b>
13482     @@@c:erred: <[[xp|nsc-prefix-declared]]> { (3, 1)..(3, 5); }
13483     @@XMLTest:
13484     @@@QName: xp.name.emptyelemtag.1.0.2.test
13485     @@@DEnt:
13486     @@@@test:value:
13487     <?xml version="1.0"?>
13488     <$u3001$u3002/>
13489     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (2, 2)..(2, 3); }
13490     @@XMLTest:
13491     @@@QName: xp.name.emptyelemtag.1.1.2.test
13492     @@@DEnt:
13493     @@@@test:value:
13494     <?xml version="1.1"?>
13495     <$u3001$u3002/>
13496     @@@test:domTree:
13497     document {
13498     xml-version: '1.1';
13499     element {
13500     node-name: U+3001 U+3002;
13501     }
13502     }
13503     @@XMLTest:
13504     @@@QName: xp.name.emptyelemtag.1.0.3.test
13505     @@@DEnt:
13506     @@@@test:value:
13507     <?xml version="1.0"?>
13508     <$u3005b/>
13509     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (2, 2)..(2, 3); }
13510     @@XMLTest:
13511     @@@QName: xp.name.emptyelemtag.1.1.3.test
13512     @@@DEnt:
13513     @@@@test:value:
13514     <?xml version="1.1"?>
13515     <$u3005b/>
13516     @@@test:domTree:
13517     document {
13518     xml-version: '1.1';
13519     element {
13520     node-name: U+3005 'b';
13521     }
13522     }
13523     @@XMLTest:
13524     @@@QName: xp.name.emptyelemtag.names.1.0.1.test
13525     @@@DEnt:
13526     @@@@test:value:
13527     <?xml version="1.0"?>
13528     <a:b/>
13529     @@@c:erred: <[[xp|nsc-prefix-declared]]>{ (2, 1)..(2, 6); }
13530     @@XMLTest:
13531     @@@QName: xp.name.emptyelemtag.names.1.1.1.test
13532     @@@DEnt:
13533     @@@@test:value:
13534     <?xml version="1.1"?>
13535     <a:b/>
13536     @@@c:erred: <[[xp|nsc-prefix-declared]]>{ (2, 1)..(2, 6); }
13537     @@XMLTest:
13538     @@@QName: xp.name.attr.1.0.2.test
13539     @@@DEnt:
13540     @@@@test:value:
13541     <?xml version="1.0"?>
13542     <a $u3001$u3002=""/>
13543     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (2, 4)..(2, 5); }
13544     @@XMLTest:
13545     @@@QName: xp.name.attr.1.1.2.test
13546     @@@DEnt:
13547     @@@@test:value:
13548     <?xml version="1.1"?>
13549     <a $u3001$u3002=""/>
13550     @@@test:domTree:
13551     document {
13552     xml-version: '1.1';
13553     element {
13554     attribute {
13555     node-name: U+3001 U+3002;
13556     }
13557     }
13558     }
13559     @@XMLTest:
13560     @@@QName: xp.name.attr.1.0.3.test
13561     @@@DEnt:
13562     @@@@test:value:
13563     <?xml version="1.0"?>
13564     <a $u3005b=""/>
13565     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (2, 4)..(2, 5); }
13566     @@XMLTest:
13567     @@@QName: xp.name.attr.1.1.3.test
13568     @@@DEnt:
13569     @@@@test:value:
13570     <?xml version="1.1"?>
13571     <a $u3005b=""/>
13572     @@@test:domTree:
13573     document {
13574     xml-version: '1.1';
13575     element {
13576     attribute {
13577     node-name: U+3005 'b';
13578     }
13579     }
13580     }
13581     @@XMLTest:
13582     @@@QName: xp.name.attr.names.1.0.1.test
13583     @@@DEnt:
13584     @@@@test:value:
13585     <?xml version="1.0"?>
13586     <a a:b=""/>
13587     @@@c:erred: <[[xp|nsc-prefix-declared]]>{ (2, 1)..(2, 11); }
13588     @@XMLTest:
13589     @@@QName: xp.name.attr.names.1.1.1.test
13590     @@@DEnt:
13591     @@@@test:value:
13592     <?xml version="1.1"?>
13593     <a a:b=""/>
13594     @@@c:erred: <[[xp|nsc-prefix-declared]]>{ (2, 1)..(2, 11); }
13595     @@XMLTest:
13596     @@@QName: xp.name.attr.names.1.0.2.test
13597     @@@DEnt:
13598     @@@@test:value:
13599     <?xml version="1.0"?>
13600     <a :ab=""/>
13601     @@@c:erred: <[[xp|nswf-legal-qname]]>{ (2, 4)..(2, 6); }
13602     @@@c:erred: <[[xp|nsc-prefix-declared]]> { }
13603     @@XMLTest:
13604     @@@QName: xp.name.attr.names.1.1.2.test
13605     @@@DEnt:
13606     @@@@test:value:
13607     <?xml version="1.1"?>
13608     <a :ab=""/>
13609     @@@c:erred: <[[xp|nswf-legal-qname]]>{ (2, 4)..(2, 6); }
13610     @@@c:erred: <[[xp|nsc-prefix-declared]]> { }
13611     @@XMLTest:
13612     @@@QName: xp.name.attlist.1.0.2.test
13613     @@@DEnt:
13614     @@@@test:value:
13615     <?xml version="1.0"?>
13616     <!DOCTYPE p [
13617     <!NOTATION $u3001$u3002 SYSTEM "n">
13618     <!ATTLIST $u3001$u3002
13619     $u3001$u3002
13620     NOTATION
13621     ($u3001$u3002)
13622     #IMPLIED>
13623     ]><p/>
13624     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (3, 12)..(3, 13); }
13625     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (4, 11)..(4, 12); }
13626     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (5, 1)..(5, 2); }
13627     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (7, 2)..(7, 3); }
13628     @@XMLTest:
13629     @@@QName: xp.name.attlist.1.1.2.test
13630     @@@DEnt:
13631     @@@@test:value:
13632     <?xml version="1.1"?>
13633     <!DOCTYPE p [
13634     <!NOTATION $u3001$u3002 SYSTEM "n">
13635     <!ATTLIST $u3001$u3002
13636     $u3001$u3002
13637     NOTATION
13638     ($u3001$u3002)
13639     #IMPLIED>
13640     ]><p/>
13641     @@@test:domTree:
13642     document {
13643     xml-version: '1.1';
13644     document-type {
13645     notation {
13646     node-name: U+3001 U+3002;
13647     }
13648     element-type-definition {
13649     node-name: U+3001 U+3002;
13650     attribute-definition {
13651     node-name: U+3001 U+3002;
13652     allowed-tokens: DOMStringList (U+3001 U+3002);
13653     }
13654     }
13655     }
13656     element { }
13657     }
13658     @@XMLTest:
13659     @@@QName: xp.name.attlist.1.0.3.test
13660     @@@DEnt:
13661     @@@@test:value:
13662     <?xml version="1.0"?>
13663     <!DOCTYPE p [
13664     <!NOTATION $u3005b SYSTEM "n">
13665     <!ATTLIST $u3005b
13666     $u3005b
13667     NOTATION
13668     ($u3005b)
13669     #IMPLIED>
13670     ]><p/>
13671     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (3, 12)..(3, 13); }
13672     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (4, 11)..(4, 12); }
13673     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (5, 1)..(5, 2); }
13674     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (7, 2)..(7, 3); }
13675     @@XMLTest:
13676     @@@QName: xp.name.attlist.1.1.3.test
13677     @@@DEnt:
13678     @@@@test:value:
13679     <?xml version="1.1"?>
13680     <!DOCTYPE p [
13681     <!NOTATION $u3005b SYSTEM "n">
13682     <!ATTLIST $u3005b
13683     $u3005b
13684     NOTATION
13685     ($u3005b)
13686     #IMPLIED>
13687     ]><p/>
13688     @@@test:domTree:
13689     document {
13690     xml-version: '1.1';
13691     document-type {
13692     notation {
13693     node-name: U+3005 'b';
13694     }
13695     element-type-definition {
13696     node-name: U+3005 'b';
13697     attribute-definition {
13698     node-name: U+3005 'b';
13699     allowed-tokens: DOMStringList (U+3005 'b');
13700     }
13701     }
13702     }
13703     element { }
13704     }
13705     @@XMLTest:
13706     @@@QName: xp.name.attlist.names.1.0.1.test
13707     @@@DEnt:
13708     @@@@test:value:
13709     <?xml version="1.0"?>
13710     <!DOCTYPE p [
13711     <!NOTATION a:b SYSTEM "n">
13712     <!ATTLIST a:b
13713     a:b
13714     NOTATION
13715     (a:b)
13716     #IMPLIED>
13717     ]><p/>
13718     @@@c:erred: <[[xp|nswf-legal-ncname]]>{ (3, 12)..(3, 14); }
13719     @@@c:erred: <[[xp|nswf-legal-ncname]]>{ (7, 2)..(7, 4); }
13720     @@XMLTest:
13721     @@@QName: xp.name.attlist.names.1.1.1.test
13722     @@@DEnt:
13723     @@@@test:value:
13724     <?xml version="1.1"?>
13725     <!DOCTYPE p [
13726     <!NOTATION a:b SYSTEM "n">
13727     <!ATTLIST a:b
13728     a:b
13729     NOTATION
13730     (a:b)
13731     #IMPLIED>
13732     ]><p/>
13733     @@@c:erred: <[[xp|nswf-legal-ncname]]>{ (3, 12)..(3, 14); }
13734     @@@c:erred: <[[xp|nswf-legal-ncname]]>{ (7, 2)..(7, 4); }
13735     @@XMLTest:
13736     @@@QName: xp.name.attlist.names.1.0.2.test
13737     @@@DEnt:
13738     @@@@test:value:
13739     <?xml version="1.0"?>
13740     <!DOCTYPE p [
13741     <!NOTATION :ab SYSTEM "n">
13742     <!ATTLIST :ab
13743     :ab
13744     NOTATION
13745     (:ab)
13746     #IMPLIED>
13747     ]><p/>
13748     @@@c:erred: <[[xp|nswf-legal-ncname]]>{ (3, 12)..(3, 14); }
13749     @@@c:erred: <[[xp|nswf-legal-qname]]>{ (4, 11)..(4, 13); }
13750     @@@c:erred: <[[xp|nswf-legal-qname]]>{ (5, 1)..(5, 3); }
13751     @@@c:erred: <[[xp|nswf-legal-ncname]]>{ (7, 2)..(7, 4); }
13752     @@XMLTest:
13753     @@@QName: xp.name.attlist.names.1.1.2.test
13754     @@@DEnt:
13755     @@@@test:value:
13756     <?xml version="1.1"?>
13757     <!DOCTYPE p [
13758     <!NOTATION :ab SYSTEM "n">
13759     <!ATTLIST :ab
13760     :ab
13761     NOTATION
13762     (:ab)
13763     #IMPLIED>
13764     ]><p/>
13765     @@@c:erred: <[[xp|nswf-legal-ncname]]>{ (3, 12)..(3, 14); }
13766     @@@c:erred: <[[xp|nswf-legal-qname]]>{ (4, 11)..(4, 13); }
13767     @@@c:erred: <[[xp|nswf-legal-qname]]>{ (5, 1)..(5, 3); }
13768     @@@c:erred: <[[xp|nswf-legal-ncname]]>{ (7, 2)..(7, 4); }
13769     @@XMLTest:
13770     @@@QName: xp.name.gent.1.0.2.test
13771     @@@DEnt:
13772     @@@@test:value:
13773     <?xml version="1.0"?>
13774     <!DOCTYPE p [
13775     <!ENTITY $u3001$u3002 "n">
13776     ]>
13777     <p a="&$u3001$u3002;">
13778     &$u3001$u3002;
13779     </p>
13780     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (3, 10)..(3, 11); }
13781     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (5, 8)..(5, 9); }
13782     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (6, 2)..(6, 3); }
13783     @@XMLTest:
13784     @@@QName: xp.name.ger.1.1.2.test
13785     @@@DEnt:
13786     @@@@test:value:
13787     <?xml version="1.1"?>
13788     <!DOCTYPE p [
13789     <!ENTITY $u3001$u3002 "n">
13790     ]>
13791     <p a="&$u3001$u3002;">$
13792     &$u3001$u3002;$
13793     </p>
13794     @@@test:domTree:
13795     document {
13796     xml-version: '1.1';
13797     document-type {
13798     general-entity {
13799     node-name: U+3001 U+3002;
13800     }
13801     }
13802     element {
13803     attribute {
13804     node-name: 'a';
13805     general-entity-reference {
13806     node-name: U+3001 U+3002;
13807     }
13808     }
13809     general-entity-reference {
13810     node-name: U+3001 U+3002;
13811     }
13812     }
13813     }
13814     @@XMLTest:
13815     @@@QName: xp.name.ger.1.0.3.test
13816     @@@DEnt:
13817     @@@@test:value:
13818     <?xml version="1.0"?>
13819     <!DOCTYPE p [
13820     <!ENTITY $u3005b "n">
13821     ]>
13822     <p a="&$u3005b;">
13823     &$u3005b;
13824     </p>
13825     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (3, 10)..(3, 11); }
13826     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (5, 8)..(5, 9); }
13827     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (6, 2)..(6, 3); }
13828     @@XMLTest:
13829     @@@QName: xp.name.ger.1.1.3.test
13830     @@@DEnt:
13831     @@@@test:value:
13832     <?xml version="1.1"?>
13833     <!DOCTYPE p [
13834     <!ENTITY $u3005b "n">
13835     ]>
13836     <p a="&$u3005b;">$
13837     &$u3005b;$
13838     </p>
13839     @@@test:domTree:
13840     document {
13841     xml-version: '1.1';
13842     document-type {
13843     general-entity {
13844     node-name: U+3005 'b';
13845     }
13846     }
13847     element {
13848     attribute {
13849     node-name: 'a';
13850     general-entity-reference {
13851     node-name: U+3005 'b';
13852     }
13853     }
13854     general-entity-reference {
13855     node-name: U+3005 'b';
13856     }
13857     }
13858     }
13859     @@XMLTest:
13860     @@@QName: xp.name.ger.names.1.0.1.test
13861     @@@DEnt:
13862     @@@@test:value:
13863     <?xml version="1.0"?>
13864     <!DOCTYPE p [
13865     <!ENTITY a:b "n">
13866     ]>
13867     <p a="&a:b;">
13868     &a:b;
13869     </p>
13870     @@@c:erred: <[[xp|nswf-legal-ncname]]>{ (3, 10)..(3, 12); }
13871     @@@c:erred: <[[xp|nswf-legal-ncname]]>{ (5, 8)..(5, 10); }
13872     @@@c:erred: <[[xp|nswf-legal-ncname]]>{ (6, 2)..(6, 4); }
13873     @@XMLTest:
13874     @@@QName: xp.name.ger.names.1.1.1.test
13875     @@@DEnt:
13876     @@@@test:value:
13877     <?xml version="1.1"?>
13878     <!DOCTYPE p [
13879     <!ENTITY a:b "n">
13880     ]>
13881     <p a="&a:b;">
13882     &a:b;
13883     </p>
13884     @@@c:erred: <[[xp|nswf-legal-ncname]]>{ (3, 10)..(3, 12); }
13885     @@@c:erred: <[[xp|nswf-legal-ncname]]>{ (5, 8)..(5, 10); }
13886     @@@c:erred: <[[xp|nswf-legal-ncname]]>{ (6, 2)..(6, 4); }
13887     @@XMLTest:
13888     @@@QName: xp.name.ndata.1.0.2.test
13889     @@@DEnt:
13890     @@@@test:value:
13891     <?xml version="1.0"?>
13892     <!DOCTYPE p [
13893     <!NOTATION $u3001$u3002 SYSTEM "n">
13894     <!ENTITY e SYSTEM "s" NDATA $u3001$u3002>
13895     ]><p/>
13896     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (3, 12)..(3, 13); }
13897     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (4, 29)..(4, 30); }
13898     @@XMLTest:
13899     @@@QName: xp.name.ndata.1.1.2.test
13900     @@@DEnt:
13901     @@@@test:value:
13902     <?xml version="1.1"?>
13903     <!DOCTYPE p [
13904     <!NOTATION $u3001$u3002 SYSTEM "n">
13905     <!ENTITY e SYSTEM "s" NDATA $u3001$u3002>
13906     ]><p/>
13907     @@@test:domTree:
13908     document {
13909     xml-version: '1.1';
13910     document-type {
13911     notation {
13912     node-name: U+3001 U+3002;
13913     }
13914     general-entity {
13915     node-name: 'e';
13916     notation-name: U+3001 U+3002;
13917     }
13918     }
13919     element { }
13920     }
13921     @@XMLTest:
13922     @@@QName: xp.name.ndata.1.0.3.test
13923     @@@DEnt:
13924     @@@@test:value:
13925     <?xml version="1.0"?>
13926     <!DOCTYPE p [
13927     <!NOTATION $u3005b SYSTEM "n">
13928     <!ENTITY e SYSTEM "s" NDATA $u3005b>
13929     ]><p/>
13930     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (3, 12)..(3, 13); }
13931     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (4, 29)..(4, 30); }
13932     @@XMLTest:
13933     @@@QName: xp.name.ndata.1.1.3.test
13934     @@@DEnt:
13935     @@@@test:value:
13936     <?xml version="1.1"?>
13937     <!DOCTYPE p [
13938     <!NOTATION $u3005b SYSTEM "n">
13939     <!ENTITY e SYSTEM "s" NDATA $u3005b>
13940     ]><p/>
13941     @@@test:domTree:
13942     document {
13943     xml-version: '1.1';
13944     document-type {
13945     notation {
13946     node-name: U+3005 'b';
13947     }
13948     general-entity {
13949     node-name: 'e';
13950     notation-name: U+3005 'b';
13951     }
13952     }
13953     element { }
13954     }
13955     @@XMLTest:
13956     @@@QName: xp.name.ndata.names.1.0.1.test
13957     @@@DEnt:
13958     @@@@test:value:
13959     <?xml version="1.0"?>
13960     <!DOCTYPE p [
13961     <!NOTATION a:b SYSTEM "n">
13962     <!ENTITY e SYSTEM "s" NDATA a:b>
13963     ]><p/>
13964     @@@c:erred: <[[xp|nswf-legal-ncname]]>{ (3, 12)..(3, 14); }
13965     @@@c:erred: <[[xp|nswf-legal-ncname]]>{ (4, 29)..(4, 31); }
13966     @@XMLTest:
13967     @@@QName: xp.name.ndata.names.1.1.1.test
13968     @@@DEnt:
13969     @@@@test:value:
13970     <?xml version="1.1"?>
13971     <!DOCTYPE p [
13972     <!NOTATION a:b SYSTEM "n">
13973     <!ENTITY e SYSTEM "s" NDATA a:b>
13974     ]><p/>
13975     @@@c:erred: <[[xp|nswf-legal-ncname]]>{ (3, 12)..(3, 14); }
13976     @@@c:erred: <[[xp|nswf-legal-ncname]]>{ (4, 29)..(4, 31); }
13977    
13978     @@enImplNote:
13979     @@@ddid: wf-invalid-character-in-node-name
13980     @@@@:
13981     {ISSUE::
13982     {P:: Tests required for:
13983    
13984     - <CODE::Name> in element type declaration
13985    
13986     - <CODE::Name> in model group
13987    
13988     - <CODE::Name> in parameter entity declaration
13989    
13990     - <CODE::Name> in parameter entity reference
13991    
13992     }
13993     }
13994    
13995     @@XMLTest:
13996     @@@QName: xp.NOTATION.1.test
13997     @@@DEnt:
13998     @@@@test:value:
13999     <!DOCTYPE p [
14000     <!NOTATION n SYSTEM "m">
14001     ]><p/>
14002     @@@test:domTree:
14003     document {
14004     document-type {
14005     notation {
14006     node-name: 'n';
14007     public-id: null;
14008     system-id: 'm';
14009     }
14010     }
14011     element { }
14012     }
14013     @@XMLTest:
14014     @@@QName: xp.NOTATION.2.test
14015     @@@DEnt:
14016     @@@@test:value:
14017     <!DOCTYPE p [
14018     <!NOTATION n PUBLIC "m">
14019     ]><p/>
14020     @@@test:domTree:
14021     document {
14022     document-type {
14023     notation {
14024     node-name: 'n';
14025     system-id: null;
14026     public-id: 'm';
14027     }
14028     }
14029     element { }
14030     }
14031     @@XMLTest:
14032     @@@QName: xp.NOTATION.3.test
14033     @@@DEnt:
14034     @@@@test:value:
14035     <!DOCTYPE p [
14036     <!NOTATION n PUBLIC "m" "l">
14037     ]><p/>
14038     @@@test:domTree:
14039     document {
14040     document-type {
14041     notation {
14042     node-name: 'n';
14043     public-id: 'm';
14044     system-id: 'l';
14045     }
14046     }
14047     element { }
14048     }
14049     @@XMLTest:
14050     @@@QName: xp.NOTATION.4.test
14051     @@@DEnt:
14052     @@@@test:value:
14053     <!DOCTYPE p [
14054     <!NOTATION n SYSTEM "m">
14055     <!NOTATION n SYSTEM "l">
14056     ]><p/>
14057     @@@c:erred: <[[xp|vc-unique-notation-name]]> { (3, 1)..(3, 24); }
14058     @@@test:domTree:
14059     document {
14060     document-type {
14061     notation {
14062     node-name: 'n';
14063     system-id: 'm';
14064     }
14065     }
14066     element { }
14067     }
14068    
14069     @@XMLTest:
14070     @@@QName: xp.names.1.test
14071     @@@DEnt:
14072     @@@@test:value:
14073     <p xmlns="http://1.example/" a="b"/>
14074     @@@test:domTree:
14075     document {
14076     element {
14077     prefix: null;
14078     local-name: 'p';
14079     namespace-uri: 'http://1.example/';
14080     attribute {
14081     prefix: null;
14082     local-name: 'xmlns';
14083     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14084     specified: true;
14085     }
14086     attribute {
14087     prefix: null;
14088     local-name: 'a';
14089     specified: true;
14090     }
14091     }
14092     }
14093     @@XMLTest:
14094     @@@QName: xp.names.2.test
14095     @@@DEnt:
14096     @@@@test:value:
14097     <p xmlns:a="http://1.example/" a="b" a:a="c"/>
14098     @@@test:domTree:
14099     document {
14100     element {
14101     prefix: null;
14102     local-name: 'p';
14103     namespace-uri: null;
14104     attribute {
14105     prefix: 'xmlns';
14106     local-name: 'a';
14107     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14108     specified: true;
14109     }
14110     attribute {
14111     prefix: null;
14112     local-name: 'a';
14113     specified: true;
14114     }
14115     attribute {
14116     prefix: 'a';
14117     local-name: 'a';
14118     namespace-uri: 'http://1.example/';
14119     specified: true;
14120     }
14121     }
14122     }
14123     @@XMLTest:
14124     @@@QName: xp.names.3.test
14125     @@@DEnt:
14126     @@@@test:value:
14127     <a:p xmlns:a="http://1.example/" a="b" a:a="c"/>
14128     @@@test:domTree:
14129     document {
14130     element {
14131     prefix: 'a';
14132     local-name: 'p';
14133     namespace-uri: 'http://1.example/';
14134     attribute {
14135     prefix: 'xmlns';
14136     local-name: 'a';
14137     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14138     specified: true;
14139     }
14140     attribute {
14141     prefix: null;
14142     local-name: 'a';
14143     specified: true;
14144     }
14145     attribute {
14146     prefix: 'a';
14147     local-name: 'a';
14148     namespace-uri: 'http://1.example/';
14149     specified: true;
14150     }
14151     }
14152     }
14153     @@XMLTest:
14154     @@@QName: xp.names.5.test
14155     @@@DEnt:
14156     @@@@test:value:
14157     <p xmlns:a="http://1.example/">$
14158     <a:q/>$
14159     </p>
14160     @@@test:domTree:
14161     document {
14162     element {
14163     prefix: null;
14164     local-name: 'p';
14165     namespace-uri: null;
14166     attribute {
14167     prefix: 'xmlns';
14168     local-name: 'a';
14169     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14170     specified: true;
14171     }
14172     element {
14173     prefix: 'a';
14174     local-name: 'q';
14175     namespace-uri: 'http://1.example/';
14176     }
14177     }
14178     }
14179     @@XMLTest:
14180     @@@QName: xp.names.6.test
14181     @@@DEnt:
14182     @@@@test:value:
14183     <p xmlns:a="http://1.example/">$
14184     <q a:b="c"/>$
14185     </p>
14186     @@@test:domTree:
14187     document {
14188     element {
14189     prefix: null;
14190     local-name: 'p';
14191     namespace-uri: null;
14192     attribute {
14193     prefix: 'xmlns';
14194     local-name: 'a';
14195     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14196     specified: true;
14197     }
14198     element {
14199     prefix: null;
14200     local-name: 'q';
14201     namespace-uri: null;
14202     attribute {
14203     prefix: 'a';
14204     local-name: 'b';
14205     namespace-uri: 'http://1.example/';
14206     specified: true;
14207     }
14208     }
14209     }
14210     }
14211     @@XMLTest:
14212     @@@QName: xp.names.7.test
14213     @@@DEnt:
14214     @@@@test:value:
14215     <p xmlns:a="http://1.example/">$
14216     <q a:b="c" xmlns:a="http://2.example/"/>$
14217     </p>
14218     @@@test:domTree:
14219     document {
14220     element {
14221     prefix: null;
14222     local-name: 'p';
14223     namespace-uri: null;
14224     attribute {
14225     prefix: 'xmlns';
14226     local-name: 'a';
14227     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14228     specified: true;
14229     }
14230     element {
14231     prefix: null;
14232     local-name: 'q';
14233     namespace-uri: null;
14234     attribute {
14235     prefix: 'a';
14236     local-name: 'b';
14237     namespace-uri: 'http://2.example/';
14238     specified: true;
14239     }
14240     attribute {
14241     prefix: 'xmlns';
14242     local-name: 'a';
14243     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14244     specified: true;
14245     }
14246     }
14247     }
14248     }
14249    
14250     @@XMLTest:
14251     @@@QName: xp.names.undeclare.1.test
14252     @@@DEnt:
14253     @@@@test:value:
14254     <p xmlns="http://1.example/">$
14255     <q xmlns="">$
14256     <r xmlns="http://2.example/"/>$
14257     </q>$
14258     </p>
14259     @@@test:domTree:
14260     document {
14261     element {
14262     prefix: null;
14263     local-name: 'p';
14264     namespace-uri: 'http://1.example/';
14265     attribute {
14266     prefix: null;
14267     local-name: 'xmlns';
14268     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14269     specified: true;
14270     }
14271     element {
14272     prefix: null;
14273     local-name: 'q';
14274     namespace-uri: null;
14275     attribute {
14276     prefix: null;
14277     local-name: 'xmlns';
14278     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14279     specified: true;
14280     }
14281     element {
14282     prefix: null;
14283     local-name: 'r';
14284     namespace-uri: 'http://2.example/';
14285     attribute {
14286     prefix: null;
14287     local-name: 'xmlns';
14288     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14289     specified: true;
14290     }
14291     }
14292     }
14293     }
14294     }
14295    
14296     @@XMLTest:
14297     @@@QName: xp.names.undeclare.1.0.1.test
14298     @@@DEnt:
14299     @@@@test:value:
14300     <?xml version="1.0"?>
14301     <a:p xmlns:a="http://1.example/">$
14302     <q xmlns:a="">$
14303     <a:r xmlns:a="http://2.example/"/>$
14304     </q>$
14305     </a:p>
14306     @@@c:erred: <[[xp|nswf-empty-namespace-name]]> { (2, 34)..(2, 47); }
14307     @@XMLTest:
14308     @@@QName: xp.names.undeclare.1.1.1.test
14309     @@@DEnt:
14310     @@@@test:value:
14311     <?xml version="1.1"?>
14312     <a:p xmlns:a="http://1.example/">$
14313     <q xmlns:a="">$
14314     <a:r xmlns:a="http://2.example/"/>$
14315     </q>$
14316     </a:p>
14317     @@@test:domTree:
14318     document {
14319     element {
14320     prefix: 'a';
14321     local-name: 'p';
14322     namespace-uri: 'http://1.example/';
14323     attribute {
14324     prefix: 'xmlns';
14325     local-name: 'a';
14326     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14327     specified: true;
14328     }
14329     element {
14330     prefix: null;
14331     local-name: 'q';
14332     namespace-uri: null;
14333     attribute {
14334     prefix: 'xmlns';
14335     local-name: 'a';
14336     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14337     specified: true;
14338     }
14339     element {
14340     prefix: 'a';
14341     local-name: 'r';
14342     namespace-uri: 'http://2.example/';
14343     attribute {
14344     prefix: 'xmlns';
14345     local-name: 'a';
14346     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14347     specified: true;
14348     }
14349     }
14350     }
14351     }
14352     }
14353     @@XMLTest:
14354     @@@QName: xp.names.undeclare.1.1.2.test
14355     @@@DEnt:
14356     @@@@test:value:
14357     <?xml version="1.1"?>
14358     <a:p xmlns:a="http://1.example/">$
14359     <q xmlns:a="">$
14360     <a:r/>$
14361     </q>$
14362     </a:p>
14363     @@@c:erred: <[[xp|nsc-prefix-declared]]> { (2, 48)..(2, 53); }
14364    
14365     @@XMLTest:
14366     @@@QName: xp.names.xml.prefix.1.test
14367     @@@DEnt:
14368     @@@@test:value:
14369     <a xmlns:xml="http://www.w3.org/XML/1998/namespace"/>
14370     @@@test:domTree:
14371     document {
14372     element {
14373     attribute {
14374     prefix: 'xmlns';
14375     local-name: 'xml';
14376     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14377     }
14378     }
14379     }
14380     @@XMLTest:
14381     @@@QName: xp.names.xml.prefix.2.test
14382     @@@DEnt:
14383     @@@@test:value:
14384     <a xmlns:xml="a"/>
14385     @@@c:erred: <[[xp|nsc-reserved-prefix-xml]]> { (1, 1)..(1, 18); }
14386     @@XMLTest:
14387     @@@QName: xp.names.xml.prefix.3.test
14388     @@@DEnt:
14389     @@@@test:value:
14390     <a xmlns:a="http://www.w3.org/XML/1998/namespace"
14391     />
14392     @@@c:erred: <[[xp|nsc-reserved-namespace-name-xml]]> { (1, 1)..(2, 2); }
14393     @@XMLTest:
14394     @@@QName: xp.names.xml.prefix.4.test
14395     @@@DEnt:
14396     @@@@test:value:
14397     <a xml:lang="ja"/>
14398     @@@test:domTree:
14399     document {
14400     element {
14401     attribute {
14402     prefix: 'xml';
14403     local-name: 'lang';
14404     namespace-uri: 'http://www.w3.org/XML/1998/namespace';
14405     }
14406     }
14407     }
14408    
14409     @@XMLTest:
14410     @@@QName: xp.names.prefix.declared.1.test
14411     @@@DEnt:
14412     @@@@test:value:
14413     <!DOCTYPE a [
14414     <!ATTLIST a
14415     b:c CDATA "d"
14416     >
14417     ]>
14418     <a/>
14419     @@@c:erred: <[[xp|nsc-prefix-declared]]> { (6, 1)..(6, 4); }
14420    
14421     @@XMLTest:
14422     @@@QName: xp.names.xmlns.reserved.1.test
14423     @@@DEnt:
14424     @@@@test:value:
14425     <a xmlns:xmlns="http://www.w3.org/2000/xmlns/"
14426     />
14427     @@@c:erred: <[[xp|nsc-reserved-prefix-xmlns]]> { (1, 1)..(2, 2); }
14428     @@@c:erred: <[[xp|nsc-reserved-namespace-name-xmlns]]> { (1, 1)..(2, 2); }
14429     @@XMLTest:
14430     @@@QName: xp.names.xmlns.reserved.2.test
14431     @@@DEnt:
14432     @@@@test:value:
14433     <a xmlns:xmlns="a"
14434     />
14435     @@@c:erred: <[[xp|nsc-reserved-prefix-xmlns]]> { (1, 1)..(2, 2); }
14436     @@XMLTest:
14437     @@@QName: xp.names.xmlns.reserved.3.test
14438     @@@DEnt:
14439     @@@@test:value:
14440     <a xmlns:a="http://www.w3.org/2000/xmlns/"
14441     />
14442     @@@c:erred: <[[xp|nsc-reserved-namespace-name-xmlns]]> { (1, 1)..(2, 2); }
14443    
14444     @@XMLTest:
14445     @@@QName: xp.names.default.1.test
14446     @@@DEnt:
14447     @@@@test:value:
14448     <!DOCTYPE a [
14449     <!ATTLIST a
14450     xmlns CDATA "http://1.example/">
14451     ]>
14452     <a/>
14453     @@@test:domTree:
14454     document {
14455     document-type {
14456     element-type-definition {
14457     node-name: 'a';
14458     attribute-definition {
14459     node-name: 'xmlns';
14460     node-value: 'http://1.example/';
14461     }
14462     }
14463     }
14464     element {
14465     prefix: null;
14466     local-name: 'a';
14467     namespace-uri: 'http://1.example/';
14468     attribute {
14469     prefix: null;
14470     local-name: 'xmlns';
14471     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14472     value: 'http://1.example/';
14473     specified: false;
14474     }
14475     }
14476     }
14477     @@XMLTest:
14478     @@@QName: xp.names.default.2.test
14479     @@@DEnt:
14480     @@@@test:value:
14481     <!DOCTYPE a [
14482     <!ATTLIST a
14483     xmlns CDATA "http://1.example/">
14484     ]>
14485     <a xmlns="http://2.example/"/>
14486     @@@test:domTree:
14487     document {
14488     document-type {
14489     element-type-definition {
14490     node-name: 'a';
14491     attribute-definition {
14492     node-name: 'xmlns';
14493     node-value: 'http://1.example/';
14494     }
14495     }
14496     }
14497     element {
14498     prefix: null;
14499     local-name: 'a';
14500     namespace-uri: 'http://2.example/';
14501     attribute {
14502     prefix: null;
14503     local-name: 'xmlns';
14504     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14505     value: 'http://2.example/';
14506     specified: true;
14507     }
14508     }
14509     }
14510     @@XMLTest:
14511     @@@QName: xp.names.default.3.test
14512     @@@DEnt:
14513     @@@@test:value:
14514     <!DOCTYPE b:a [
14515     <!ATTLIST b:a
14516     xmlns:b CDATA "http://1.example/">
14517     ]>
14518     <b:a/>
14519     @@@test:domTree:
14520     document {
14521     document-type {
14522     element-type-definition {
14523     node-name: 'b:a';
14524     attribute-definition {
14525     node-name: 'xmlns:b';
14526     node-value: 'http://1.example/';
14527     }
14528     }
14529     }
14530     element {
14531     prefix: 'b';
14532     local-name: 'a';
14533     namespace-uri: 'http://1.example/';
14534     attribute {
14535     prefix: 'xmlns';
14536     local-name: 'b';
14537     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14538     value: 'http://1.example/';
14539     specified: false;
14540     }
14541     }
14542     }
14543     @@XMLTest:
14544     @@@QName: xp.names.default.4.test
14545     @@@DEnt:
14546     @@@@test:value:
14547     <!DOCTYPE b:a [
14548     <!ATTLIST b:a
14549     xmlns:b CDATA "http://1.example/">
14550     ]>
14551     <b:a xmlns:b="http://2.example/"/>
14552     @@@test:domTree:
14553     document {
14554     document-type {
14555     element-type-definition {
14556     node-name: 'b:a';
14557     attribute-definition {
14558     node-name: 'xmlns:b';
14559     node-value: 'http://1.example/';
14560     }
14561     }
14562     }
14563     element {
14564     prefix: 'b';
14565     local-name: 'a';
14566     namespace-uri: 'http://2.example/';
14567     attribute {
14568     prefix: 'xmlns';
14569     local-name: 'b';
14570     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14571     value: 'http://2.example/';
14572     specified: true;
14573     }
14574     }
14575     }
14576     @@XMLTest:
14577     @@@QName: xp.names.default.5.test
14578     @@@DEnt:
14579     @@@@test:value:
14580     <!DOCTYPE a [
14581     <!ATTLIST a
14582     xmlns:b CDATA "http://1.example/"
14583     b:c CDATA "http://1.example/">
14584     ]>
14585     <a xmlns:b="http://2.example/"/>
14586     @@@test:domTree:
14587     document {
14588     document-type {
14589     element-type-definition {
14590     node-name: 'a';
14591     attribute-definition {
14592     node-name: 'xmlns:b';
14593     text-content: 'http://1.example/';
14594     }
14595     attribute-definition {
14596     node-name: 'b:c';
14597     text-content: 'http://1.example/';
14598     }
14599     }
14600     }
14601     element {
14602     prefix: null;
14603     local-name: 'a';
14604     namespace-uri: null;
14605     attribute {
14606     prefix: 'xmlns';
14607     local-name: 'b';
14608     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14609     value: 'http://2.example/';
14610     specified: true;
14611     }
14612     attribute {
14613     prefix: 'b';
14614     local-name: 'c';
14615     namespace-uri: 'http://2.example/';
14616     specified: false;
14617     }
14618     }
14619     }
14620    
14621     @@XMLTest:
14622     @@@QName: xp.names.unique.1.test
14623     @@@DEnt:
14624     @@@@test:value:
14625     <a
14626     xmlns:b="http://2.example/"
14627     xmlns:c="http://2.example/"
14628     b:d=""
14629     c:d=""
14630     />
14631     @@@c:erred: <[[xp|nswf-unique-att-spec-expanded-name]]> { (1, 1)..(6, 2); }
14632     @@XMLTest:
14633     @@@QName: xp.names.unique.2.test
14634     @@@DEnt:
14635     @@@@test:value:
14636     <!DOCTYPE a [
14637     <!ATTLIST a
14638     c:d CDATA ""
14639     >
14640     ]>
14641     <a
14642     xmlns:b="http://2.example/"
14643     xmlns:c="http://2.example/"
14644     b:d=""
14645     />
14646     @@@c:erred: <[[xp|nswf-unique-att-spec-expanded-name]]> { (6, 1)..(10, 2);}
14647     @@XMLTest:
14648     @@@QName: xp.names.unique.3.test
14649     @@@DEnt:
14650     @@@@test:value:
14651     <!DOCTYPE a [
14652     <!ATTLIST a
14653     c:d CDATA "value1"
14654     >
14655     ]>
14656     <a
14657     xmlns:c="http://2.example/"
14658     c:d="value2"
14659     />
14660     @@@test:domTree:
14661     document {
14662     document-type { }
14663     element {
14664     attribute {
14665     prefix: 'xmlns';
14666     local-name: 'c';
14667     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14668     specified: true;
14669     }
14670     attribute {
14671     prefix: 'c';
14672     local-name: 'd';
14673     namespace-uri: 'http://2.example/';
14674     value: 'value2';
14675     specified: true;
14676     }
14677     }
14678     }
14679    
14680     @@XMLTest:
14681     @@@QName: xp.names.normalize.1.test
14682     @@@DEnt:
14683     @@@@test:value:
14684     <!DOCTYPE a [
14685     <!ATTLIST a
14686     xmlns NMTOKEN #IMPLIED
14687     >
14688     ]>
14689     <a xmlns=" "/>
14690     @@@test:domTree:
14691     document {
14692     document-type { }
14693     element {
14694     namespace-uri: null;
14695     prefix: null;
14696     local-name: 'a';
14697     }
14698     }
14699     @@XMLTest:
14700     @@@QName: xp.names.normalize.2.test
14701     @@@DEnt:
14702     @@@@test:value:
14703     <!DOCTYPE a [
14704     <!ATTLIST a
14705     xmlns NMTOKEN #IMPLIED
14706     >
14707     ]>
14708     <a xmlns=" about:blank "/>
14709     @@@test:domTree:
14710     document {
14711     document-type { }
14712     element {
14713     namespace-uri: 'about:blank';
14714     prefix: null;
14715     local-name: 'a';
14716     }
14717     }
14718     @@XMLTest:
14719     @@@QName: xp.names.normalize.3.test
14720     @@@DEnt:
14721     @@@@test:value:
14722     <!DOCTYPE a:a [
14723     <!ATTLIST a:a
14724     xmlns:a NMTOKEN #IMPLIED
14725     >
14726     ]>
14727     <a:a xmlns:a=" about:blank "/>
14728     @@@test:domTree:
14729     document {
14730     document-type { }
14731     element {
14732     namespace-uri: 'about:blank';
14733     prefix: 'a';
14734     local-name: 'a';
14735     }
14736     }
14737    
14738 wakaba 1.29 @@XMLTest:
14739     @@@QName: xp.no.baseuri.test
14740     @@@DEnt:
14741     @@@@test:value:
14742     <p/>
14743     @@@test:domTree:
14744     document {
14745     document-uri: null;
14746     base-uri: null;
14747     element {
14748     node-name: 'p';
14749     base-uri: null;
14750     }
14751     }
14752     @@XMLTest:
14753     @@@QName: xp.docuri.no.baseuri.test
14754     @@@DEnt:
14755     @@@@test:uri:
14756     http://www.example.com/
14757     @@@@test:value:
14758     <p/>
14759     @@@test:domTree:
14760     document {
14761     document-uri: 'http://www.example.com/';
14762     base-uri: 'http://www.example.com/';
14763     element {
14764     node-name: 'p';
14765     base-uri: 'http://www.example.com/';
14766     }
14767     }
14768     @@XMLTest:
14769     @@@QName: xp.docuri.baseuri.test
14770     @@@DEnt:
14771     @@@@test:uri:
14772     http://www.example.com/
14773     @@@@test:baseURI:
14774     ftp://ftp.example.com/
14775     @@@@test:value:
14776     <p/>
14777     @@@test:domTree:
14778     document {
14779     document-uri: 'http://www.example.com/';
14780     base-uri: 'ftp://ftp.example.com/';
14781     element {
14782     node-name: 'p';
14783     base-uri: 'ftp://ftp.example.com/';
14784     }
14785     }
14786     @@XMLTest:
14787     @@@QName: xp.doctype.baseuri.test
14788     @@@DEnt:
14789     @@@@test:uri:
14790     http://www.example.com/
14791     @@@@test:baseURI:
14792     ftp://ftp.example.com/
14793     @@@@test:value:
14794     <!DOCTYPE p SYSTEM "sys">
14795     <p/>
14796     @@@test:domTree:
14797     document {
14798     document-uri: 'http://www.example.com/';
14799     base-uri: 'ftp://ftp.example.com/';
14800     document-type {
14801     system-id: 'sys';
14802     manakai-declaration-base-uri: 'ftp://ftp.example.com/';
14803     }
14804     element {
14805     node-name: 'p';
14806     base-uri: 'ftp://ftp.example.com/';
14807     }
14808     }
14809     @@XMLTest:
14810     @@@QName: xp.entdecl.baseuri.test
14811     @@@DEnt:
14812     @@@@test:uri:
14813     http://www.example.com/
14814     @@@@test:baseURI:
14815     ftp://ftp.example.com/
14816     @@@@test:value:
14817     <!DOCTYPE p [
14818     <!ENTITY ent SYSTEM "ent">
14819     ]>
14820     <p/>
14821     @@@test:domTree:
14822     document {
14823     document-uri: 'http://www.example.com/';
14824     base-uri: 'ftp://ftp.example.com/';
14825     document-type {
14826     general-entity {
14827     node-name: 'ent';
14828     manakai-declaration-base-uri: 'ftp://ftp.example.com/';
14829     }
14830     }
14831     element {
14832     node-name: 'p';
14833     base-uri: 'ftp://ftp.example.com/';
14834     }
14835     }
14836     @@XMLTest:
14837     @@@QName: xp.notdecl.baseuri.test
14838     @@@DEnt:
14839     @@@@test:uri:
14840     http://www.example.com/
14841     @@@@test:baseURI:
14842     ftp://ftp.example.com/
14843     @@@@test:value:
14844     <!DOCTYPE p [
14845     <!NOTATION not SYSTEM "not">
14846     ]>
14847     <p/>
14848     @@@test:domTree:
14849     document {
14850     document-uri: 'http://www.example.com/';
14851     base-uri: 'ftp://ftp.example.com/';
14852     document-type {
14853     notation {
14854     node-name: 'not';
14855     manakai-declaration-base-uri: 'ftp://ftp.example.com/';
14856     }
14857     }
14858     element {
14859     node-name: 'p';
14860     base-uri: 'ftp://ftp.example.com/';
14861     }
14862     }
14863     @@XMLTest:
14864     @@@QName: xp.doctype.intsubset.pi.baseuri.test
14865     @@@DEnt:
14866     @@@@test:uri:
14867     http://www.example.com/
14868     @@@@test:baseURI:
14869     ftp://ftp.example.com/
14870     @@@@test:value:
14871     <!DOCTYPE p [
14872     <?pi?>
14873     ]>
14874     <p/>
14875     @@@test:domTree:
14876     document {
14877     document-uri: 'http://www.example.com/';
14878     base-uri: 'ftp://ftp.example.com/';
14879     document-type {
14880     pi {
14881     node-name: 'pi';
14882     base-uri: 'ftp://ftp.example.com/';
14883     }
14884     }
14885     element {
14886     node-name: 'p';
14887     base-uri: 'ftp://ftp.example.com/';
14888     }
14889     }
14890    
14891 wakaba 1.26 @@PerlDef:
14892     my $impl = $Message::DOM::ImplementationRegistry->get_implementation ({
14893     'Core' => '3.0',
14894     'XML' => '3.0',
14895     'XMLVersion' => ['1.0', '1.1'],
14896     });
14897     my $parser = <Class::ManakaiXMLParser>->new ($impl);
14898    
14899     for my $test_data (@$TestData) {
14900     $test->start_new_test ($test_data->{uri});
14901     my $doc_ent = $test_data->{entity}->{$test_data->{root_uri}};
14902     my $not_ok;
14903    
14904     $parser->dom_config->set_parameter ('error-handler' => sub ($$) {
14905     my (undef, $err) = @_;
14906     my $err_type = $err->type;
14907     if ($test_data->{dom_error}->{$err_type}) {
14908     $test->assert_error_equals
14909     (actual_value => $err,
14910     expected_hash => shift @{$test_data->{dom_error}
14911     ->{$err_type}});
14912     } else { # Uncatched error
14913     warn $err;
14914     unless ($err->severity == <C::c|DOMError.SEVERITY_WARNING>) {
14915     $test->failure_comment ('Unexpected error |'.$err->type.'|');
14916     $not_ok = true;
14917     }
14918     }
14919     return true; # continue as far as possible
14920     });
14921    
14922 wakaba 1.27 my $input = {string_data => \$doc_ent->{<Q::test:value>},
14923     system_id => $doc_ent->{<Q::test:uri>},
14924     base_uri => $doc_ent->{<Q::test:baseURI>}};
14925 wakaba 1.26 if ($test_data->{dom_tree}) { # Successful test
14926     try {
14927 wakaba 1.27 my $doc = $parser->parse ($input);
14928 wakaba 1.26 $test->assert_dom_tree_equals
14929     (actual_value => $doc,
14930     expected_hash => $test_data->{dom_tree});
14931     for (values %{$test_data->{dom_error}||{}}) {
14932     if (@$_) {
14933     $test->failure_comment
14934     (@$_.' |DOMError|s of type |'.
14935     $_->[0]->{type}->{value}.'| are not reported');
14936     $not_ok = true;
14937     }
14938     }
14939     $not_ok ? $test->not_ok : $test->ok;
14940     } catch Message::Util::IF::DTException with {
14941     #
14942     } catch Message::DOM::IF::LSException with {
14943     # not_ok
14944     } otherwise {
14945     my $err = shift;
14946     warn $err;
14947     $test->not_ok;
14948     };
14949     } else {
14950     try {
14951 wakaba 1.27 my $doc = $parser->parse ($input);
14952 wakaba 1.26 } catch Message::Util::IF::DTException with {
14953     #
14954     } catch Message::DOM::IF::LSException with {
14955     #
14956     } otherwise {
14957     my $err = shift;
14958     warn $err;
14959     $test->not_ok;
14960     };
14961     for (values %{$test_data->{dom_error}||{}}) {
14962     if (@$_) {
14963     $test->failure_comment
14964     (@$_.' |DOMError|s of type |'.
14965     $_->[0]->{type}->{value}.'| are not reported');
14966     $not_ok = true;
14967     }
14968     }
14969     $not_ok ? $test->not_ok : $test->ok;
14970 wakaba 1.12 }
14971 wakaba 1.5 }
14972 wakaba 1.6
14973     @ResourceDef:
14974 wakaba 1.19 @@QName: getEmptyEntityState
14975     @@rdf:type: DISPerl|InlineCode
14976     @@ForCheck: ManakaiDOM|ForClass
14977     @@PerlDef:
14978     {reptxt => \'', line => 1, column => 1, pos => 0,
14979 wakaba 1.27 is_externally_declared => true, name => $name,
14980     fh => do {
14981     open my $empty, '<', \'';
14982     $empty;
14983     },
14984     close_file => sub { }}
14985 wakaba 1.19
14986     @ResourceDef:
14987 wakaba 1.6 @@QName: getCopyOfEntityState
14988     @@rdf:type: DISPerl|InlineCode
14989     @@ForCheck: ManakaiDOM|ForClass
14990     @@PerlDef:
14991     {%{$self->{$entity_type}->{$entity_name}},
14992 wakaba 1.27 line => 1, column => 1, pos => 0,
14993     fh => do {
14994     require IO::String;
14995     IO::String->new
14996     (${$self->{$entity_type}->{$entity_name}->{reptxt}});
14997     ## TODO: External entities.
14998     },
14999     close_file => sub { }}
15000 wakaba 1.1 ##ManakaiXMLParser
15001 wakaba 1.5
15002     ElementTypeBinding:
15003 wakaba 1.27 @Name: Test
15004     @ElementType:
15005     dis:ResourceDef
15006     @ShadowContent:
15007     @@ForCheck: ManakaiDOM|ForClass
15008     @@rdf:type: test|StandaloneTest
15009    
15010     ElementTypeBinding:
15011 wakaba 1.5 @Name: XMLTests
15012     @ElementType:
15013     dis:ResourceDef
15014     @ShadowContent:
15015     @@ForCheck: ManakaiDOM|ForClass
15016     @@rdf:type: test|ParserTestSet
15017    
15018     ElementTypeBinding:
15019     @Name: XMLTest
15020     @ElementType:
15021     dis:ResourceDef
15022     @ShadowContent:
15023     @@ForCheck: ManakaiDOM|ForClass
15024     @@rdf:type: test|ParserTest
15025    
15026     ElementTypeBinding:
15027     @Name: DEnt
15028     @ElementType:
15029     dis:ResourceDef
15030     @ShadowContent:
15031     @@rdf:type: test|RootEntity
15032    
15033     ElementTypeBinding:
15034     @Name: Ent
15035     @ElementType:
15036     dis:ResourceDef
15037     @ShadowContent:
15038     @@rdf:type: test|Entity
15039 wakaba 1.1
15040 wakaba 1.3 ResourceDef:
15041     @QName: xp|get-location-from-token
15042     @rdf:type: DISPerl|BlockCode
15043     @enDesc:
15044     Creates a <IF::DOMCore:DOMLocator> object from a token.
15045     @PerlDef:
15046 wakaba 1.14 my $__d = $token->{type} ne '#EOF'
15047     ? $token->{location}->{char_d}
15048     : 0;
15049 wakaba 1.15 $__d -= $token->{location_d} if $token->{location_d};
15050 wakaba 1.3 $result = {
15051 wakaba 1.14 utf32_offset => $token->{location}->{pos} - $__d,
15052     line_number => $token->{location}->{line},
15053     column_number => $token->{location}->{column} - $__d,
15054 wakaba 1.3 };
15055 wakaba 1.14 $result->{utf32_offset} = 0 if $result->{utf32_offset} < 0;
15056     $result->{column_number} = 0 if $result->{column_number} < 0;
15057     ## 0 or 1, which should be?
15058 wakaba 1.3 @For: ManakaiDOM|ManakaiDOM3
15059 wakaba 1.1
15060     ElementTypeBinding:
15061     @Name: RuleDef
15062     @ElementType:
15063     dis:ResourceDef
15064     @ShadowContent:
15065     @@ForCheck: ManakaiDOM|ForClass
15066     @@rdf:type: Muf2003|RuleDefClass
15067    
15068     ElementTypeBinding:
15069     @Name: RuleParam
15070     @ElementType:
15071     dis:ResourceDef
15072     @ShadowContent:
15073     @@rdf:type: Muf2003|RuleParameter
15074    
15075     ElementTypeBinding:
15076     @Name: enImplNote
15077     @ElementType:
15078     dis:ImplNote
15079     @ShadowContent:
15080     @@lang:en
15081    
15082     ElementTypeBinding:
15083 wakaba 1.24 @Name: WFErrDef
15084 wakaba 1.1 @ElementType:
15085     dis:ResourceDef
15086     @ShadowContent:
15087     @@rdf:type: DOMCore|DOMErrorType
15088     @@For: ManakaiDOM|DOM3
15089     @@ecore:textFormatter: ManakaiXMLParserExceptionFormatter
15090 wakaba 1.24 @@c:severity: c|SEVERITY_FATAL_ERROR
15091 wakaba 1.1
15092 wakaba 1.3 ElementTypeBinding:
15093 wakaba 1.24 @Name: FatalErrDef
15094 wakaba 1.3 @ElementType:
15095     dis:ResourceDef
15096     @ShadowContent:
15097     @@rdf:type: DOMCore|DOMErrorType
15098     @@For: ManakaiDOM|DOM3
15099     @@ecore:textFormatter: ManakaiXMLParserExceptionFormatter
15100 wakaba 1.24 @@c:severity: c|SEVERITY_FATAL_ERROR
15101    
15102     ElementTypeBinding:
15103 wakaba 1.26 @Name: NSFatalErrDef
15104     @ElementType:
15105     dis:ResourceDef
15106     @ShadowContent:
15107     @@rdf:type: c|DOMErrorType
15108     @@For: ManakaiDOM|DOM3
15109     @@ecore:textFormatter: ManakaiXMLParserExceptionFormatter
15110     @@c:severity: c|SEVERITY_FATAL_ERROR
15111    
15112     ElementTypeBinding:
15113     @Name: NSCErrDef
15114     @ElementType:
15115     dis:ResourceDef
15116     @ShadowContent:
15117     @@rdf:type: c|DOMErrorType
15118     @@For: ManakaiDOM|DOM3
15119     @@ecore:textFormatter: ManakaiXMLParserExceptionFormatter
15120     @@c:severity: c|SEVERITY_FATAL_ERROR
15121    
15122     ElementTypeBinding:
15123 wakaba 1.24 @Name: VCErrDef
15124     @ElementType:
15125     dis:ResourceDef
15126     @ShadowContent:
15127     @@rdf:type: c|DOMErrorType
15128     @@For: ManakaiDOM|DOM3
15129     @@ecore:textFormatter: ManakaiXMLParserExceptionFormatter
15130     @@c:severity: c|SEVERITY_ERROR
15131    
15132     ElementTypeBinding:
15133     @Name: ErrDef
15134     @ElementType:
15135     dis:ResourceDef
15136     @ShadowContent:
15137     @@rdf:type: c|DOMErrorType
15138     @@For: ManakaiDOM|DOM3
15139     @@ecore:textFormatter: ManakaiXMLParserExceptionFormatter
15140     @@c:severity: c|SEVERITY_ERROR
15141 wakaba 1.3
15142 wakaba 1.16 ElementTypeBinding:
15143 wakaba 1.24 @Name: WarnDef
15144 wakaba 1.16 @ElementType:
15145     dis:ResourceDef
15146     @ShadowContent:
15147 wakaba 1.24 @@rdf:type: c|DOMErrorType
15148 wakaba 1.16 @@For: ManakaiDOM|DOM3
15149     @@ecore:textFormatter: ManakaiXMLParserExceptionFormatter
15150 wakaba 1.24 @@c:severity: c|SEVERITY_WARNING
15151 wakaba 1.16
15152 wakaba 1.3 WFErrDef:
15153     @QName: xp|wf-syntax-error
15154     @enDesc:
15155     The entity does not match to the production rule; it is not
15156     well-formed.
15157     @enMufDef:
15158     |%xp-error-token-type;|%xp-error-token-value
15159     (prefix => { (|}, suffix => {|)}); is not
15160     allowed%xp-error-lines (prefix => { (|}, suffix => {|)});
15161     @ecore:hasParameter:
15162     @@@: xp|error-token
15163     @@enDesc:
15164     The token that is not allowed.
15165    
15166     WFErrDef:
15167     @QName: xp|wf-pi-target-is-xml
15168     @enDesc:
15169     A processing instruction has its <CODE::PITarget> of
15170     <XML::xml> (in any case) which is not allowed.
15171     @enMufDef:
15172     Processing instruction target name cannot be |%p
15173     (name => {<Q::xp|name>});|
15174     @ecore:hasParameter:
15175     @@@: xp|error-token
15176     @@enDesc:
15177     The token that contains the name.
15178     @ecore:hasParameter:
15179     @@@: xp|name
15180     @@enDesc:
15181     A string that is specified as target name of the
15182     processing instruction.
15183     @ecore:hasParameter: xp|parent
15184    
15185     WFErrDef:
15186     @QName: xp|wf-no-end-tag
15187     @enDesc:
15188     An end-tag is not found.
15189     @enMufDef:
15190     End-tag |</%p (name => {<Q::xp|expected-element-type>});>| is required
15191     @ecore:hasParameter: xp|error-token
15192     @ecore:hasParameter:
15193     @@@: xp|node
15194     @@enDesc:
15195     The element node that is not closed.
15196     @ecore:hasParameter:
15197     @@@: xp|expected-element-type
15198     @@enDesc:
15199     The element type name of the element that is not closed.
15200    
15201     WFErrDef:
15202     @QName: xp|wf-unsupported-xml-version
15203     @enDesc:
15204     The XML version specified in the version declaration is not supported.
15205     @enMufDef:
15206     XML version |%p (name => {<Q::infoset|version>});| is not supported
15207     @ecore:hasParameter: xp|bad-token
15208     @ecore:hasParameter:
15209     @@@: xp|parent
15210     @@enDesc:
15211     The document node.
15212     @ecore:hasParameter:
15213     @@@: infoset|version
15214     @@enDesc:
15215     The specified XML version.
15216    
15217     WFErrDef:
15218     @QName: xp|wf-malformed-enc-name
15219     @enDesc:
15220     An <XA::encoding> pseudo-attribute value does not match
15221     to the procduction rule <CODE::EncName>.
15222     @enMufDef:
15223     Encoding name |%p (name => {<Q::xp|name>});| is not allowed
15224     @ecore:hasParameter: xp|error-token
15225     @ecore:hasParameter:
15226     @@@: xp|parent
15227     @@enDesc: The document node.
15228     @ecore:hasParameter:
15229     @@@: xp|name
15230     @@enDesc:
15231     The <XA::encoding> value.
15232    
15233     WFErrDef:
15234     @QName: xp|wf-malformed-xml-standalone
15235     @enDesc:
15236     An <XA::standalone> pseudo-attribute value is neither <XML::yes>
15237     or <XML::no>.
15238     @enMufDef:
15239     |standalone| pseudo-attribute value |%p (name => {<Q::xp|name>});|
15240     is not allowed
15241     @ecore:hasParameter: xp|error-token
15242     @ecore:hasParameter:
15243     @@@: xp|parent
15244     @@enDesc: The document node.
15245     @ecore:hasParameter:
15246     @@@: xp|name
15247     @@enDesc:
15248     The <XA::standalone> value.
15249    
15250     WFErrDef:
15251     @QName: xp|wf-legal-literal-character
15252     @enDesc:
15253     Each character in XML entity must match to the production
15254     rule <CODE::Char - RestrictedChar>.
15255     @enMufDef:
15256     Character %character-code-point
15257     (v => {<Q::xp|character-number>}); is not allowed
15258     @ecore:hasParameter:
15259     @@@: xp|character-number
15260     @@enDesc:
15261     The code position of the character being referred.
15262    
15263     WFErrDef:
15264 wakaba 1.26 @QName: xp|wf-invalid-character-in-node-name
15265     @c:errorType:
15266     @@@: wf-invalid-character-in-node-name
15267     @@ContentType: DISCore|String
15268     @enDesc:
15269     If a name contains a character that is not a name character
15270     in the XML version in use, or if the first character of a name
15271     is not a name start character in the XML version in use.
15272    
15273     {NOTE::
15274     When an invalid character is encountered in an entity
15275     where a <CODE::Name> is expected, what type of error
15276     is issued is implementation dependent: <Q::xp|wf-syntax-error>,
15277     <Q::xp|wf-pi-target-is-xml> or other error might be reported.
15278     }
15279    
15280     {NOTE::
15281     This error type is defined in DOM Level 3 Core and Load and Save
15282     modules and redefined herein for the purpose of XML parser.
15283     }
15284     @enMufDef:
15285     Character %character-code-point
15286     (v => {<Q::xp|character-number>}); is not allowed in name
15287     @ecore:hasParameter: xp|error-token
15288     @ecore:hasParameter:
15289     @@@: xp|character-number
15290     @@enDesc:
15291     The code position of the character being referred.
15292     @ecore:hasParameter:
15293     @@@: infoset|version
15294     @@enDesc:
15295     The version of XML in use.
15296    
15297     WFErrDef:
15298 wakaba 1.25 @QName: xp|wf-pes-in-internal-subset
15299     @enDesc:
15300     In the internal subset of the DTD, parameter entity references
15301     <kwd:MUST-NOT> occur within markup declarations.
15302     @enMufDef:
15303     Parameter entity reference |%percent;%param (name => {<Q::xp|name>});;|
15304     cannot occur within a markup declaration
15305     @ecore:hasParameter: xp|error-token
15306     @ecore:hasParameter:
15307     @@@: xp|name
15308     @@enDesc:
15309     The name of the parameter entity.
15310    
15311     WFErrDef:
15312 wakaba 1.3 @QName: xp|wf-element-type-match
15313 wakaba 1.1 @enDesc:
15314 wakaba 1.3 The <CODE::Name> in an element's end-tag must match the element type
15315     in the start-tag.
15316     @enMufDef:
15317     End-tag |</%p (name => {<Q::xp|actual-element-type>});>| does
15318     not match to start-tag |<%p (name => {<Q::xp|expected-element-type>});>|
15319     @ecore:hasParameter: xp|error-token
15320     @ecore:hasParameter:
15321     @@@: xp|node
15322     @@enDesc:
15323     The current opening element node.
15324     @ecore:hasParameter:
15325     @@@: xp|expected-element-type
15326     @@enDesc:
15327     The element type name of the current element.
15328     @ecore:hasParameter:
15329     @@@: xp|actual-element-type
15330     @@enDesc:
15331     The <CODE::Name> occurs in the end-tag.
15332    
15333     WFErrDef:
15334     @QName: xp|wf-unique-att-spec
15335     @enDesc:
15336     An attribute name <kwd:MUST-NOT> appear more than once in
15337     the same start-tag or empty-element tag.
15338 wakaba 1.1 @enMufDef:
15339 wakaba 1.3 Attribute |%p (name => {<Q::xp|name>});| is specified more
15340     than once in the same tag
15341     @ecore:hasParameter: xp|error-token
15342     @ecore:hasParameter:
15343     @@@: xp|name
15344     @@enDesc:
15345     The name of the attribute.
15346 wakaba 1.18
15347     WFErrDef:
15348     @QName: xp|wf-no-external-entity-references
15349     @enDesc:
15350     Attribute values <kwd:MUST-NOT> contain direct or indirect
15351     entity references to external entities.
15352     @enMufDef:
15353     External entity |%p (name => {<Q::xp|name>});| is referenced
15354     in an attribute value literal
15355     @ecore:hasParameter: xp|error-token
15356     @ecore:hasParameter:
15357     @@@: xp|name
15358     @@enDesc:
15359     The name of the entity.
15360    
15361     WFErrDef:
15362     @QName: xp|wf-no-lt-in-attribute-values
15363     @enDesc:
15364     The replacement text of any entity referred to directly or indirectly
15365     in an attribute value literal <kwd:MUST-NOT> contain a
15366     <CHAR::LESS-THAN SIGN>.
15367     @enMufDef:
15368     Entity replacement text cannot contain a
15369     |LESS-THAN SIGN| since it is referenced from an attribute
15370     value literal
15371     @ecore:hasParameter: xp|error-token
15372 wakaba 1.3
15373 wakaba 1.25 WarnDef:
15374     @QName: xp|warning-attribute-definition-ignored
15375     @enDesc:
15376     An attribute definition is ignored because the same attribute
15377     is declared before.
15378     @enMufDef:
15379     Attribute definition for |%p (name => {<Q::xp|name>});| is ignored
15380     @ecore:hasParameter: xp|error-token
15381     @ecore:hasParameter:
15382     @@@: xp|name
15383     @@enDesc:
15384     The name of the attribute.
15385    
15386 wakaba 1.3 WFErrDef:
15387     @QName: xp|wf-legal-character
15388     @enDesc:
15389     Characters referred to using character references <kwd:MUST>
15390     match the production for <CODE::Char>.
15391     @enMufDef:
15392     Reference to character %character-code-point
15393     (v => {<Q::xp|character-number>}); is not allowed
15394     @ecore:hasParameter: xp|error-token
15395     @ecore:hasParameter:
15396     @@@: xp|character-number
15397     @@enDesc:
15398     The code position of the character being referred.
15399     @ecore:hasParameter:
15400     @@@: xp|parent
15401     @@enDesc:
15402     The parent node in which the character reference has
15403     occurred, if available.
15404 wakaba 1.19
15405     WFErrDef:
15406     @QName: xp|wf-entity-declared
15407     @enDesc:
15408     {P:: In a document
15409    
15410     - without any DTD,
15411    
15412     - with only an internal DTD subset that contains no parameter
15413     entity references, or
15414    
15415     - with <XML::standalone="yes">,
15416    
15417     for an entity reference that does not occur within the external
15418     subset or a parameter entity, the <CODE::Name> given in the
15419     entity reference <kwd:MUST> match the <CODE::Name> does not
15420     occur within the external subset or a parameter entity,
15421     except that five predefined character entities need not
15422     be declared. The declaration of a general entity <kwd:MUST>
15423     precede any reference to it which appears in a default value
15424     in an attribute list declaration.
15425     @enMufDef:
15426     Entity |%p (name => {<Q::xp|name>});| must be declared
15427     in the internal subset
15428 wakaba 1.23 @ecore:hasParameter: xp|error-token
15429     @ecore:hasParameter:
15430     @@@: xp|name
15431     @@enDesc:
15432     The name of the entity.
15433    
15434     WFErrDef:
15435     @QName: xp|wf-parsed-entity
15436     @enDesc:
15437     An entity reference <kwd:MUST-NOT> contain the name of an
15438     unparsed entity.
15439     @enMufDef:
15440     Entity |%p (name => {<Q::xp|name>});| is an unparsed entity
15441     @ecore:hasParameter: xp|error-token
15442     @ecore:hasParameter:
15443     @@@: xp|name
15444     @@enDesc:
15445     The name of the entity.
15446    
15447     WFErrDef:
15448     @QName: xp|wf-no-recursion
15449     @enDesc:
15450     A parsed entity <kwd:MUST-NOT> contain a recursive reference
15451     to itself, either directly or indirectly.
15452     @enMufDef:
15453     Entity |%p (name => {<Q::xp|name>});| is recursively referenced
15454 wakaba 1.19 @ecore:hasParameter: xp|error-token
15455     @ecore:hasParameter:
15456     @@@: xp|name
15457     @@enDesc:
15458     The name of the entity.
15459 wakaba 1.16
15460     FatalErrDef:
15461     @QName: xp|fatal-xml11-end-of-line-in-xml-declaration
15462     @enDesc:
15463     An end-of-line character <CODE::U+0085> or <CODE::U+2028> is appeared
15464     within an XML declaration or text declaration.
15465     @enMufDef:
15466     End-of-line character %character-code-point
15467     (v => {<Q::xp|character-number>}); cannot be used within the
15468     XML or text declaration
15469     @ecore:hasParameter:
15470     @@@: xp|character-number
15471     @@enDesc:
15472     The code position of the end-of-line character.
15473 wakaba 1.24
15474     ErrDef:
15475     @QName: xp|error-internal-predefined-entity
15476     @enDesc:
15477     A general entity declaration whose <CODE::Name> equals to one
15478     of predefined entities <kwd:MUST> declare it as an internal entity.
15479     @enMufDef:
15480     Entity |%p (name => {<Q::xp|name>});| must be declared as an
15481     internal entity
15482     @ecore:hasParameter: xp|error-token
15483     @ecore:hasParameter:
15484     @@@: xp|name
15485     @@enDesc:
15486     The name of the entity.
15487    
15488     ErrDef:
15489     @QName: xp|error-malformed-predefined-entity
15490     @enDesc:
15491     A general entity declaration whose <CODE::Name> equals to one
15492     of predefined entities <kwd:MUST> declare it as a data
15493     character for the entity.
15494     @enMufDef:
15495     Entity declaration for |%p (name => {<Q::xp|name>});|
15496     (replacement text |%p (name => {<Q::xp|replacement-text>});|) is malformed
15497     @ecore:hasParameter: xp|error-token
15498     @ecore:hasParameter:
15499     @@@: xp|name
15500     @@enDesc:
15501     The name of the entity.
15502     @ecore:hasParameter:
15503     @@@: xp|replacement-text
15504     @@enDesc:
15505     The replacement text of the entity declaration.
15506    
15507     WarnDef:
15508     @QName: xp|warning-entity-declaration-ignored
15509     @enDesc:
15510     An entity declaration is ignored because the same entity
15511     is declared before.
15512     @enMufDef:
15513     Entity declaration for |%p (name => {<Q::xp|name>});| is ignored
15514     @ecore:hasParameter: xp|error-token
15515     @ecore:hasParameter:
15516     @@@: xp|name
15517     @@enDesc:
15518     The name of the entity.
15519    
15520     VCErrDef:
15521     @QName: xp|vc-unique-notation-name
15522     @enDesc:
15523     A <CODE::Name> <kwd:MUST-NOT> be declared in more than
15524     one notation declaration.
15525     @enMufDef:
15526     Notation |%p (name => {<Q::xp|name>});| is already declared
15527     @ecore:hasParameter: xp|error-token
15528     @ecore:hasParameter:
15529     @@@: xp|name
15530     @@enDesc:
15531     The name of the notation.
15532 wakaba 1.25
15533     WarnDef:
15534     @QName: xp|warning-entity-declaration-not-processed
15535     @enDesc:
15536     An entity declaration is not processed because there
15537     is a reference to parameter entity before the declaration
15538     and the entity is not read.
15539     @enMufDef:
15540     Entity declaration for |%p (name => {<Q::xp|name>});| is not processed
15541     @ecore:hasParameter: xp|error-token
15542     @ecore:hasParameter:
15543     @@@: xp|name
15544     @@enDesc:
15545     The name of the entity.
15546    
15547     WarnDef:
15548     @QName: xp|warning-attribute-definition-not-processed
15549     @enDesc:
15550     An attribute definition is not processed because there
15551     is a reference to parameter entity before the declaration
15552     and the entity is not read.
15553     @enMufDef:
15554     Attribute definition for |%p (name => {<Q::xp|name>});| is not processed
15555     @ecore:hasParameter: xp|error-token
15556     @ecore:hasParameter:
15557     @@@: xp|name
15558     @@enDesc:
15559     The name of the attribute.
15560 wakaba 1.26
15561     NSFatalErrDef:
15562     @QName: xp|nswf-legal-ncname
15563     @enDesc:
15564     <CODE::Name>s other than element type names and attribute names
15565     <kwd:MUST> be <CODE::NCName>s.
15566     @enMufDef:
15567     <CODE::Name> |%p (name => {<Q::xp|name>});| is not an <CODE::NCName>
15568     @ecore:hasParameter: xp|error-token
15569     @ecore:hasParameter:
15570     @@@: xp|name
15571     @@enDesc:
15572     The name.
15573     @ecore:hasParameter:
15574     @@@: infoset|version
15575     @@enDesc:
15576     The version of XML in use.
15577    
15578     NSFatalErrDef:
15579     @QName: xp|nswf-legal-qname
15580     @enDesc:
15581     An element type name or an attribute name <kwd:MUST> be a
15582     <CODE::QName>.
15583     @enMufDef:
15584     <CODE::Name> |%p (name => {<Q::xp|name>});| is not a <CODE::QName>
15585     @ecore:hasParameter: xp|error-token
15586     @ecore:hasParameter:
15587     @@@: xp|name
15588     @@enDesc:
15589     The name.
15590     @ecore:hasParameter:
15591     @@@: infoset|version
15592     @@enDesc:
15593     The version of XML in use.
15594    
15595     NSCErrDef:
15596     @QName: xp|nsc-reserved-prefix-xml
15597     @enDesc:
15598     The prefix <XML::xml> <kwd:MUST-NOT> be undeclared or bound
15599     to any namespace name other than <URI::http://www.w3.org/XML/1998/namespace>.
15600     @enMufDef:
15601     Namespace prefix |xml| cannot be bound to namespace
15602     name |%p (name => {<Q::infoset|namespaceName>});|
15603     @ecore:hasParameter: xp|error-token
15604     @ecore:hasParameter:
15605     @@@: infoset|prefix
15606     @@enDesc:
15607     The namespace prefix.
15608     @ecore:hasParameter:
15609     @@@: infoset|namespaceName
15610     @@enDesc:
15611     The namespace name bound to or an empty string for undeclaring.
15612    
15613     NSCErrDef:
15614     @QName: xp|nsc-reserved-namespace-name-xml
15615     @enDesc:
15616     Namespace prefixes other than <XML::xml> <kwd:MUST-NOT> be bound
15617     to the namespace name <URI::http://www.w3.org/XML/1998/namespace>.
15618     @enMufDef:
15619     Namespace prefix |%p (name => {<Q::infoset|prefix>});| cannot be
15620     bound to namespace name |http://www.w3.org/XML/1998/namespace|
15621     @enImplNote:
15622     The XMLNames spec does not prohibit the URI bound to
15623     the default namespace (!)
15624     @ecore:hasParameter: xp|error-token
15625     @ecore:hasParameter:
15626     @@@: infoset|prefix
15627     @@enDesc:
15628     The namespace prefix or <DOM::null> for default namespace.
15629     @ecore:hasParameter:
15630     @@@: infoset|namespaceName
15631     @@enDesc:
15632     The namespace name bound to.
15633    
15634     NSCErrDef:
15635     @QName: xp|nsc-reserved-prefix-xmlns
15636     @enDesc:
15637     The prefix <XML::xmlns> <kwd:MUST-NOT> be declared or undeclared.
15638     @enMufDef:
15639     Namespace prefix |xmlns| cannot be declared or undeclared
15640     @ecore:hasParameter: xp|error-token
15641     @ecore:hasParameter:
15642     @@@: infoset|prefix
15643     @@enDesc:
15644     The namespace prefix.
15645     @ecore:hasParameter:
15646     @@@: infoset|namespaceName
15647     @@enDesc:
15648     The namespace name bound to or an empty string for undeclaring.
15649    
15650     NSCErrDef:
15651     @QName: xp|nsc-reserved-namespace-name-xmlns
15652     @enDesc:
15653     Namespace prefixes <kwd:MUST-NOT> be bound
15654     to the namespace name <URI::http://www.w3.org/2000/xmlns/>.
15655     @enMufDef:
15656     Namespace prefix |%p (name => {<Q::infoset|prefix>});| cannot be
15657     bound to namespace name |http://www.w3.org/2000/xmlns/|
15658     @enImplNote:
15659     The XMLNames spec does not prohibit the URI bound to
15660     the default namespace (!)
15661     @ecore:hasParameter: xp|error-token
15662     @ecore:hasParameter:
15663     @@@: infoset|prefix
15664     @@enDesc:
15665     The namespace prefix or <DOM::null> for default namespace.
15666     @ecore:hasParameter:
15667     @@@: infoset|namespaceName
15668     @@enDesc:
15669     The namespace name bound to.
15670    
15671     NSCErrDef:
15672     @QName: xp|nsc-prefix-declared
15673     @enDesc:
15674     A namespace prefix other than <XML::xml> or <XML::xmlns>
15675     <kwd:MUST> have been declared in a namespace declaration
15676     attribute in either the start or empty element tag of the
15677     element where the prefix is used or in an ancestor
15678     element. Furthermore, the attribute value in the innermost
15679     such declaration <kwd:MUST-NOT> be an empty string.
15680     @enMufDef:
15681     Namespace prefix |%p (name => {<Q::infoset|prefix>});| in
15682     qualified name |%p (name => {<Q::xp|name>});| is not declared
15683     @ecore:hasParameter: xp|error-token
15684     @ecore:hasParameter:
15685     @@@: infoset|prefix
15686     @@enDesc:
15687     The namespace prefix.
15688     @ecore:hasParameter:
15689     @@@: xp|name
15690     @@enDesc:
15691     The qualified name.
15692    
15693     NSFatalErrDef:
15694     @QName: xp|nswf-empty-namespace-name
15695     @enDesc:
15696     If the XML version of the document is 1.0 and the
15697     normalized value of the prefixed namespace declaration attribute is empty.
15698     @enMufDef:
15699     Namespace |%p (name => {<Q::infoset|prefix>});| cannot be
15700     undeclared in XML 1.0
15701     @ecore:hasParameter: xp|error-token
15702     @ecore:hasParameter:
15703     @@@: infoset|prefix
15704     @@enDesc:
15705     The namespace prefix.
15706     @ecore:hasParameter:
15707     @@@: infoset|namespaceName
15708     @@enDesc:
15709     An empty string.
15710    
15711     NSFatalErrDef:
15712     @QName: xp|nswf-unique-att-spec-expanded-name
15713     @enDesc:
15714     No element may have two attributes that have qualified name
15715     with the same local part and with namespace prefixes
15716     that have been bound to namespace names that are identical.
15717     @enMufDef:
15718     Attribute |%p (name => {<Q::infoset|localName>});| in
15719     namespace |%p (name => {<Q::infoset|namespaceName>});| is
15720     attached to the same element more than once (as
15721     |%p (name => {<Q::xp|name>});| and
15722     |%p (name => {<Q::xp|another-attribute-name>});|)
15723     @enImplNote:
15724     The XMLNames spec doesn't mention default attributes
15725     for this constraint...
15726     @ecore:hasParameter: xp|error-token
15727     @ecore:hasParameter:
15728     @@@: infoset|localName
15729     @@enDesc:
15730     The local part of the attribute.
15731     @ecore:hasParameter:
15732     @@@: infoset|namespaceName
15733     @@enDesc:
15734     The namespace URI of the attribute.
15735     @ecore:hasParameter:
15736     @@@: xp|name
15737     @@enDesc:
15738     The name, i.e. a qualified name consist of <Q::infoset:localName>
15739     and <Q::infoset:namespaceName> parameter values.
15740     @ecore:hasParameter:
15741     @@@: xp|another-attribute-name
15742     @@enDesc:
15743     Another attribute qualified name expanded to the same expanded name
15744     as <Q::xp|name>.
15745    
15746     XWParam:
15747     @QName: xp|another-attribute-name
15748 wakaba 1.24
15749     XWParam:
15750     @QName: xp|replacement-text
15751     @enDesc:
15752     The replacement text.
15753 wakaba 1.1
15754 wakaba 1.3 XWParam:
15755 wakaba 1.1 @QName: xp|error-token
15756     @enDesc:
15757     The token where the parser found an error.
15758    
15759 wakaba 1.3 XWParam:
15760     @QName: xp|name
15761     @enDesc:
15762     A name.
15763    
15764     XWParam:
15765     @QName: xp|parent
15766     @enDesc:
15767     The parent node in which the error occurs.
15768    
15769     XWParam:
15770     @QName: xp|node
15771     @enDesc:
15772     The current node.
15773    
15774     XWParam:
15775     @QName: xp|actual-element-type
15776     @enDesc:
15777     The actual element type name occured in the source.
15778    
15779     XWParam:
15780     @QName: xp|expected-element-type
15781 wakaba 1.1 @enDesc:
15782 wakaba 1.3 The element type name expected.
15783    
15784     XWParam:
15785     @QName: xp|character-number
15786     @enDesc:
15787     The character code position.
15788    
15789     ElementTypeBinding:
15790     @Name: XWParam
15791     @ElementType:
15792     dis:ResourceDef
15793     @ShadowContent:
15794     @@For: =ManakaiDOM|all
15795     @@rdf:type: ecore|Parameter
15796 wakaba 1.1
15797     ElementTypeBinding:
15798     @Name:enMufDef
15799     @ElementType:
15800     ecore:defaultMessage
15801     @ShadowContent:
15802     @@lang:en
15803     @@ContentType:
15804     lang:muf
15805    
15806     ResourceDef:
15807     @QName: DOMImpl
15808     @AliasFor: DOMCore|DOMImplementation
15809     @For: ManakaiDOM|DOM
15810    
15811 wakaba 1.27 ResourceDef:
15812     @QName: LSInput
15813     @AliasFor: DOMLS|LSInput
15814     @For: ManakaiDOM|DOM
15815    
15816     ResourceDef:
15817     @QName: LSParser
15818     @AliasFor: DOMLS|LSParser
15819     @For: ManakaiDOM|DOM
15820    
15821 wakaba 1.1 ElementTypeBinding:
15822     @Name: Attr
15823     @ElementType:
15824     dis:ResourceDef
15825     @ShadowContent:
15826     @@rdf:type: DISLang|Attribute
15827     @@ForCheck: !=ManakaiDOM|ManakaiDOM
15828    
15829     ElementTypeBinding:
15830     @Name: Get
15831     @ElementType:
15832     dis:ResourceDef
15833     @ShadowContent:
15834     @@rdf:type: DISLang|AttributeGet
15835    
15836     ElementTypeBinding:
15837     @Name: Set
15838     @ElementType:
15839     dis:ResourceDef
15840     @ShadowContent:
15841     @@rdf:type: DISLang|AttributeSet
15842    
15843     ElementTypeBinding:
15844     @Name: enDesc
15845     @ElementType:
15846     dis:Description
15847     @ShadowContent:
15848     @@lang:en
15849    
15850     ElementTypeBinding:
15851     @Name: Method
15852     @ElementType:
15853     dis:ResourceDef
15854     @ShadowContent:
15855     @@rdf:type: DISLang|Method
15856     @@For: !=ManakaiDOM|ManakaiDOM
15857    
15858     ElementTypeBinding:
15859     @Name: Return
15860     @ElementType:
15861     dis:ResourceDef
15862     @ShadowContent:
15863     @@rdf:type: DISLang|MethodReturn
15864    
15865     ElementTypeBinding:
15866     @Name: Param
15867     @ElementType:
15868     dis:ResourceDef
15869     @ShadowContent:
15870     @@rdf:type: DISLang|MethodParameter
15871    
15872     ElementTypeBinding:
15873     @Name: PerlDef
15874     @ElementType:
15875     dis:Def
15876     @ShadowContent:
15877     @@ContentType: lang|Perl
15878    
15879     ElementTypeBinding:
15880 wakaba 1.27 @Name: PerlDefC
15881     @ElementType:
15882     dis:Def
15883     @ShadowContent:
15884     @@ContentType: lang|Perl
15885    
15886     ElementTypeBinding:
15887 wakaba 1.1 @Name: PropDef
15888     @ElementType:
15889     dis:ResourceDef
15890     @ShadowContent:
15891     @@rdf:type: rdf|Property
15892    
15893     ClsDef:
15894     @ClsQName: ManakaiXMLParserExceptionFormatter
15895    
15896     @ClsISA: ecore|MUErrorFormatter||ManakaiDOM|Perl
15897    
15898     @RuleDef:
15899     @@Name: xp-error-token-type
15900     @@enDesc:
15901     The type of the token the parser is encountered.
15902    
15903     @@Method:
15904     @@@Name: after
15905     @@@Param:
15906     @@@@Name: name
15907     @@@@Type: DOMString
15908     @@@@enDesc: The name of the method.
15909     @@@Param:
15910     @@@@Name: p
15911     @@@@Type: DISPerl|HASH
15912     @@@@enDesc: The set of the parameters to the method.
15913     @@@Param:
15914     @@@@Name: o
15915     @@@@Type: DISPerl|HASH
15916     @@@@enDesc: The option value.
15917     @@@Return:
15918     @@@@PerlDef:
15919     $p->{-result} = $o->{<H::xp|error-token>}->{type}
15920     if defined $o->{<H::xp|error-token>}->{type};
15921    
15922     @RuleDef:
15923     @@Name: xp-error-token-value
15924     @@enDesc:
15925     The value of the token the parser is encountered, if any.
15926    
15927     @@Method:
15928     @@@Name: after
15929     @@@Param:
15930     @@@@Name: name
15931     @@@@Type: DOMString
15932     @@@@enDesc: The name of the method.
15933     @@@Param:
15934     @@@@Name: p
15935     @@@@Type: DISPerl|HASH
15936     @@@@enDesc: The set of the parameters to the method.
15937     @@@Param:
15938     @@@@Name: o
15939     @@@@Type: DISPerl|HASH
15940     @@@@enDesc: The option value.
15941     @@@Return:
15942     @@@@PerlDef:
15943     $p->{-result} = $o->{<H::xp|error-token>}->{value}
15944     if defined $o->{<H::xp|error-token>}->{value};
15945    
15946     @RuleDef:
15947     @@Name: xp-error-lines
15948     @@enDesc:
15949     A copy of fragment of the source text that contains the line
15950     where the error occurred, if available.
15951    
15952     @@Method:
15953     @@@Name: after
15954     @@@Param:
15955     @@@@Name: name
15956     @@@@Type: DOMString
15957     @@@@enDesc: The name of the method.
15958     @@@Param:
15959     @@@@Name: p
15960     @@@@Type: DISPerl|HASH
15961     @@@@enDesc: The set of the parameters to the method.
15962     @@@Param:
15963     @@@@Name: o
15964     @@@@Type: DISPerl|HASH
15965     @@@@enDesc: The option value.
15966     @@@Return:
15967     @@@@PerlDef:
15968     my $pos = $o-><AG::DOMCore|DOMError.location>
15969     -><AG::DOMCore|DOMLocator.utf32Offset>;
15970 wakaba 1.27 my $src = $o->{<H::ecore|object>}->{entity}->[-1]->{reptxt};
15971     if (defined $src and $pos > -1) {
15972 wakaba 1.1 my $start = $pos;
15973     $start = rindex ($$src, "\x0A", $start - 1) for 0..2;
15974     $start++;
15975     my $end = $pos;
15976     $end = index ($$src, "\x0A", $end + 1) for 0..2;
15977     $end = length $$src if $end < 0;
15978     $p->{-result} = substr $$src, $start, $end - $start;
15979     }
15980 wakaba 1.3
15981     @RuleDef:
15982     @@Name: character-code-point
15983     @@enDesc:
15984     The character code position, in <CODE::U+<VAR::HHHH>> notation.
15985    
15986     @@Method:
15987     @@@Name: after
15988     @@@Param:
15989     @@@@Name: name
15990     @@@@Type: DOMString
15991     @@@@enDesc: The name of the method.
15992     @@@Param:
15993     @@@@Name: p
15994     @@@@Type: DISPerl|HASH
15995     @@@@enDesc: The set of the parameters to the method.
15996     @@@Param:
15997     @@@@Name: o
15998     @@@@Type: DISPerl|HASH
15999     @@@@enDesc: The option value.
16000     @@@RuleParam:
16001     @@@@Name: v
16002     @@@@Type: DISPerl|Number
16003     @@@@enDesc:
16004     The name of the error parameter that contains the character code.
16005     @@@Return:
16006     @@@@PerlDef:
16007     $p->{-result} = sprintf 'U+%04X', $o->{$p->{v}};
16008 wakaba 1.1 ##XMLParserExceptionFormatter
16009 wakaba 1.27
16010     ElementTypeBinding:
16011     @Name: CParam
16012     @ElementType:
16013     dis:ResourceDef
16014     @ShadowContent:
16015     @@rdf:type:
16016     @@@@: c|DOMConfigurationParameter
16017     @@@For: ManakaiDOM|DOM
16018     @@rdf:type:
16019     @@@@: DISCore|Property
16020     @@@For: =ManakaiDOM|all
16021     @@For: ManakaiDOM|DOM3
16022     @@For: =ManakaiDOM|all
16023    
16024     ElementTypeBinding:
16025     @Name: CParamApp
16026     @ElementType:
16027     dis:ResourceDef
16028     @ShadowContent:
16029     @@rdf:type:
16030     @@@@: c|DOMConfigurationParameterApplication
16031     @@@For: ManakaiDOM|DOM
16032     @@For: ManakaiDOM|DOM3
16033    
16034     CParamApp:
16035     @QName: error-handler
16036     @c:domConfigurationParameter: c|error-handler
16037     @c:targetType: xp|ManakaiXMLParser
16038    
16039     CParam:
16040     @QName: xp|ls-input-to-input-file
16041     @DOMLS:lsKey:
16042     @@@: i2i
16043     @@For: =ManakaiDOM|all
16044     @Type: ManakaiDOMLSInputToInputFile
16045     @c:targetType: xp|ManakaiXMLParser
16046     @IsSupportRequired: 1
16047     @c:isSupported: 1
16048     @enDesc:
16049     An <IF::LSInput> to Perl filehandle converter.
16050    
16051     @Method:
16052     @@rdf:type: c|DOMConfigurationParameterDefaultGetter
16053     @@Param:
16054     @@@Name: name
16055     @@@Type: DOMString
16056     @@@dis:actualType: c|DOMConfigurationParameterName
16057     @@@enDesc: The parameter name.
16058     @@Return:
16059     @@@Type: ManakaiDOMLSInputToInputFile
16060     @@@enDesc:
16061     The default resolver.
16062     @@@PerlDefC:
16063     $r = sub {
16064     my ($self, $input, $errorHandler) = @_;
16065     ## As defined in DOM Level 3 LS |LSInput| interface
16066    
16067     my $r = {};
16068    
16069     __DEEP{
16070    
16071     FH: {
16072     ## 1. |characterStream|
16073     my $v = $input-><AG::LSInput.characterStream>;
16074     if (defined $v) {
16075     $r->{filehandle} = $v;
16076     last FH;
16077     }
16078    
16079     ## 2. |byteStream|
16080     $v = $input-><AG::LSInput.byteStream>;
16081     if (defined $v) {
16082     ## TODO: Support byte filehandle
16083     ## |encoding|
16084     ## TODO: How to guess?
16085     return null;
16086     }
16087    
16088     ## 3. |stringData|
16089     $v = $input-><AG::LSInput.stringData>;
16090     if (defined $v) {
16091     require IO::String;
16092     $r->{filehandle} = IO::String->new ($v);
16093     last FH;
16094     }
16095    
16096     ## 4. |systemId|
16097     ## TODO:
16098     ## resolve relative URI
16099     ## open
16100     ## set document_uri
16101    
16102     ## 5. |publicId|
16103     ## The default resolver does not support only-|publicId| input.
16104    
16105     return null;
16106     } # FH
16107    
16108     DURI: {
16109     last DURI if defined $r->{document_uri};
16110    
16111     my $v = $input-><AG::LSInput.systemId>;
16112     if (defined $v) {
16113 wakaba 1.29 $r->{base_uri} = $input-><AG::LSInput.baseURI>
16114     unless defined $r->{base_uri};
16115     if (defined $r->{base_uri}) {
16116     $r->{document_uri}
16117     = <ClassM::urigen|ManakaiURIReference.new> (\$v)
16118     -><M::urigen|URIReference.getAbsoluteReference>
16119     ($r->{base_uri})
16120     -><AG::urigen|URIReference.uriReference>;
16121     } else {
16122     $r->{document_uri} = $v;
16123     }
16124 wakaba 1.27 last DURI;
16125     }
16126    
16127     ## TODO: pubid -> pubid URN -> document_uri
16128     } # DURI
16129    
16130     BURI: {
16131     last BURI if defined $r->{base_uri};
16132    
16133     my $v = $input-><AG::LSInput.baseURI>;
16134     if (defined $v) {
16135     $r->{base_uri} = $v;
16136     last BURI;
16137     }
16138    
16139     if (defined $r->{document_uri}) {
16140     $r->{base_uri} = $r->{document_uri};
16141     }
16142     } # BURI
16143    
16144     }__;
16145    
16146     ## ISSUE: Is |certifiedText| required by parsers?
16147    
16148     return $r;
16149     };
16150     @Method:
16151     @@rdf:type: c|DOMConfigurationParameterSetter
16152     @@Param:
16153     @@@Name: name
16154     @@@Type: DOMString
16155     @@@dis:actualType: c|DOMConfigurationParameterName
16156     @@@enDesc: The parameter name.
16157     @@Param:
16158     @@@Name: value
16159     @@@Type: DOMMain|DOMUserData
16160     @@@dis:actualType: ManakaiDOMLSInputToInputFile
16161     @@@enDesc: The new value.
16162     @@Return:
16163     @@@Type: idl|void||ManakaiDOM|all
16164     @@@PerlDefC:
16165     $self->[1]->{<H::xp|ls-input-to-input-file>} = $value;
16166     @@enImplNote:
16167     Implied input processor converts non-blessed code references
16168     into a <Class::ManakaiDOMLSInputToInputFile> object.
16169     @Method:
16170     @@rdf:type: c|DOMConfigurationParameterChecker
16171     @@Param:
16172     @@@Name: name
16173     @@@Type: DOMString
16174     @@@dis:actualType: c|DOMConfigurationParameterName
16175     @@@enDesc: The parameter name.
16176     @@Param:
16177     @@@Name: value
16178     @@@Type: DOMMain|DOMUserData
16179     #@@@dis:actualType: ManakaiDOMLSInputToInputFile
16180     @@@enDesc: The new value.
16181     @@Return:
16182     @@@Type: idl|boolean||ManakaiDOM|all
16183     @@@PerlDefC:
16184     $r = UNIVERSAL::isa ($value, 'CODE') or
16185     UNIVERSAL::isa ($value, <ClassName::ManakaiDOMLSInputToInputFile>);
16186    
16187     @@Test:
16188     @@@QName: cp.ls-input-to-input-file.test
16189     @@@PerlDefC:
16190     my $xp;
16191     __CODE{createParserForTest:: $xp => $xp}__;
16192     my $cfg = $xp-><AG::LSInput.domConfig>;
16193    
16194     my $cp = <Q::xp|ls-input-to-input-file>;
16195    
16196     $test->id ('default');
16197     my $default = $cfg-><M::c|DOMConfiguration.getParameter> ($cp);
16198     $test->assert_isa ($default,
16199     <ClassName::ManakaiDOMLSInputToInputFile>);
16200    
16201     $test->id ('set');
16202     my $sub1 = sub { };
16203     $cfg-><M::c|DOMConfiguration.setParameter> ($cp => $sub1);
16204     my $sub2 = $cfg-><M::c|DOMConfiguration.getParameter> ($cp);
16205     $test->assert_isa ($sub2, <ClassName::ManakaiDOMLSInputToInputFile>);
16206     $test->assert_equals ($sub2, $sub1);
16207    
16208     $test->id ('reset');
16209     $cfg-><M::c|DOMConfiguration.setParameter> ($cp => null);
16210     my $sub3 = $cfg-><M::c|DOMConfiguration.getParameter> ($cp);
16211     $test->assert_isa ($sub3, <ClassName::ManakaiDOMLSInputToInputFile>);
16212     $test->assert_equals ($sub3, $default);
16213 wakaba 1.29
16214     @@Test:
16215     @@@QName: cp.ls-input-to-input-file.default.test
16216     @@@PerlDefC:
16217     my $xp;
16218     __CODE{createParserForTest:: $xp => $xp}__;
16219     my $cfg = $xp-><AG::LSInput.domConfig>;
16220     my $cp = <Q::xp|ls-input-to-input-file>;
16221     my $default = $cfg-><M::c|DOMConfiguration.getParameter> ($cp);
16222    
16223     my $err = sub {}; # dummy error handler
16224    
16225     my $cs = \*STDOUT; # dummy input
16226    
16227     $test->id ('cs.sysid');
16228     my $r1 = $default->resolve_ls_input ({
16229     character_stream => $cs,
16230     system_id => q<http://example.com/sysid>,
16231     }, $err);
16232     $test->assert_equals
16233     ($r1->document_uri, q<http://example.com/sysid>);
16234     $test->assert_equals
16235     ($r1->base_uri, q<http://example.com/sysid>);
16236    
16237     $test->id ('cs.baseuri.sysid');
16238     my $r1 = $default->resolve_ls_input ({
16239     character_stream => $cs,
16240     system_id => q<sysid>,
16241     base_uri => q<http://example.com/>,
16242     }, $err);
16243     $test->assert_equals
16244     ($r1->document_uri, q<http://example.com/sysid>);
16245     $test->assert_equals
16246     ($r1->base_uri, q<http://example.com/>);
16247 wakaba 1.27 ##ls-input-to-input-file
16248    
16249     ClsDef:
16250     @ClsQName: ManakaiDOMLSInputToInputFile
16251     @enDesc:
16252     An <Class::ManakaiDOMLSInputToInputFile> object is used to covert
16253     a <IF::LSInput> object into a Perl filehandle.
16254    
16255     {ISSUE::
16256     In which module this class should be placed?
16257    
16258     Better interface name?
16259     }
16260    
16261     @enDesc:
16262     @@ddid: perl
16263     @@ForCheck: ManakaiDOM|ManakaiDOM
16264     @@@:
16265     For Perl binding, any parameter that accepts
16266     a <Class::ManakaiDOMLSInputToInputFile> would also accept a Perl code
16267     reference (subroutine reference). The code reference
16268     will be blessed as a <Class::ManakaiDOMLSInputToInputFile> whose
16269     <M::ManakaiDOMLSInputToInputFile.resolveLSInput> method invokes the code.
16270    
16271     @ResourceDef:
16272     @@rdf:type: DISLang|InputProcessor
16273     @@rdf:type: DISLang|OutputProcessor
16274     @@PerlDef:
16275     $INPUT = bless $INPUT, <ClassName::ManakaiDOMLSInputToInputFile>
16276     if ref $INPUT eq 'CODE';
16277    
16278     @Method:
16279     @@Name: resolveLSInput
16280     @@enDesc:
16281     Converts a <IF::LSInput> into a Perl filehandle.
16282     @@Param:
16283     @@@Name: input
16284     @@@Type: LSInput
16285     @@@enDesc:
16286     The input.
16287     @@Param:
16288     @@@Name: errorHandler
16289     @@@Type: c|DOMErrorHandler
16290     @@@enDesc:
16291     An error handler. If the method encounters an error
16292     or warning, it <kwd:MAY> notify it to application
16293     via this handler.
16294     @@Return:
16295     @@@Type: ManakaiDOMInputFile
16296     @@@enDesc:
16297     A <Class::ManakaiDOMInputFile> object created from <P::input>.
16298     @@@nullCase:
16299     @@@@enDesc:
16300     If the method was unable to resolve the <P::input>.
16301    
16302     {ISSUE::
16303     Should we allow the method to throw exceptions?
16304     }
16305     @@@PerlDef:
16306     __DEEP{
16307     $r = $self->($self, $input, $errorHandler);
16308     }__;
16309     @@@enImplNote:
16310     Notet that the input / output processor for <CODE::$input>
16311     and return value might or might not be inserted in
16312     the <Perl::$self> code.
16313     ##LSInputToInputFile
16314    
16315     ClsDef:
16316     @ClsQName: ManakaiDOMInputFile
16317     @enDesc:
16318     A set of information on the input, including filehandle.
16319    
16320     @enDesc:
16321     @@ddid: perl
16322     @@ForCheck: ManakaiDOM|ManakaiDOM
16323     @@@:
16324     For Perl binding, any parameter that accepts
16325     a <Class::ManakaiDOMInputFile> would also accept a Perl hash reference.
16326     If a hash reference is given to parameter that expects
16327     a <Class::ManakaiDOMInputFile> object, then it
16328     bless the hash with the class.
16329    
16330     Each attributes defined
16331     in the class is associated to the hash value with the
16332     key equals to the attribut name. Each method defined in
16333     the class will invoke the code reference retrieved
16334     from the hash by the key equals to the method name.
16335    
16336     If there is no value in the hash for an attribute,
16337     then its value is <DOM::null>.
16338    
16339     @ResourceDef:
16340     @@rdf:type: DISLang|InputProcessor
16341     @@rdf:type: DISLang|OutputProcessor
16342     @@PerlDef:
16343     $INPUT = bless $INPUT, <ClassName::ManakaiDOMInputFile>
16344     if ref $INPUT eq 'HASH';
16345    
16346     @Attr:
16347     @@Name: filehandle
16348     @@Type: DISPerl|filehandle||ManakaiDOM|all
16349     @@enDesc:
16350     The input filehandle.
16351    
16352     It <kwd:MUST> be an <Perl::open>ed (and not <Perl::close>d)
16353     filehandle. Note that
16354     it does not have to be associated with an actual file
16355     in the local file system.
16356    
16357     It <kwd:MUST> return a character (rather than byte)
16358     by <Perl::getc>.
16359     @@Get:
16360     @@@PerlDef: $r = $self->{filehandle};
16361     @@Set:
16362     @@@PerlDef: $self->{filehandle} = $given;
16363    
16364     @Attr:
16365     @@Name: baseURI
16366     @@enDesc:
16367     The base URI of the input.
16368    
16369     It <kwd:MUST> be an absolute DOM URI or <DOM::null>.
16370     Otherwise, the result is undefined.
16371     @@Type: DOMString
16372     @@nullCase:
16373     @@@enDesc:
16374     If the base URI is not available.
16375     @@Get:
16376     @@@PerlDef: $r = $self->{base_uri};
16377     @@Set:
16378     @@@PerlDef: $self->{base_uri} = $given;
16379    
16380     @Attr:
16381     @@Name: documentURI
16382     @@enDesc:
16383     The URI of the document.
16384    
16385     It <kwd:MUST> be an absolute DOM URI or <DOM::null>.
16386     Otherwise, the result is undefined.
16387     @@Type: DOMString
16388     @@nullCase:
16389     @@@enDesc:
16390     If the document URI is not available.
16391     @@Get:
16392     @@@PerlDef: $r = $self->{document_uri};
16393     @@Set:
16394     @@@PerlDef: $self->{document_uri} = $given;
16395    
16396     @Method:
16397     @@Name: close
16398     @@enDesc:
16399     Closes the file.
16400    
16401     Since when the Perl's destructor is invoked is unreliable,
16402     this method is explicitly called when the file is no longer
16403     in use.
16404    
16405     If the <Class::ManakaiDOMInputFile> is given as a hash
16406     reference and whose value for <CODE::close> is not defined,
16407     then the statement <Perl::close $filehandle> is done
16408     (where <Perl::$filehandle> is the <A::ManakaiDOMInputFile.filehandle>
16409     value).
16410     @@Return:
16411     @@@PerlDef:
16412     __DEEP{
16413     if ($self->{close}) {
16414     $self->{close}->($self);
16415     } else {
16416     close $self->{filehandle};
16417     }
16418     }__;
16419     ##ManakaiDOMInputFile
16420    
16421    
16422    

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24