/[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.30 - (hide annotations) (download)
Mon Mar 6 07:32:52 2006 UTC (18 years, 8 months ago) by wakaba
Branch: MAIN
Changes since 1.29: +100 -1 lines
++ manakai/bin/ChangeLog	6 Mar 2006 07:30:27 -0000
2006-03-06  Wakaba  <wakaba@suika.fam.cx>

	* daf.pl (get_referring_module_uri_list): Don't
	invoke |daf_convert_dis_document_to_dnl_document| to prevent
	prefix-not-defined error because the referred module is not
	yet loaded.

++ manakai/lib/Message/DOM/ChangeLog	6 Mar 2006 07:32:43 -0000
2006-03-06  Wakaba  <wakaba@suika.fam.cx>

	* DOMXML.dis (ManakaiDOMXMLIdAttr): New class.

	* Tree.dis (createAttribute, createAttributeNS,
	setAttribute, setAttributeNS): They now supports
	the |cfg:xml-id| configuration parameter.
	(cfg:xml-id): New configuration parameter.

	* XDoctype.dis (createAttributeDefinition): It now
	supports the |cfg:xml-id| configuration parameter.

	* XMLParser.dis (parse): It now supports
	the |cfg:xml-id| configuration parameter.

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.30 $Date: 2006/03/05 12:42:48 $
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 wakaba 1.30 (<Q::cfg|xml-id> => $self->{parser_cfg}
638     -><M::c|DOMConfiguration.getParameter>
639     (<Q::cfg|xml-id>));
640     $self->{doc_cfg}-><M::c|DOMConfiguration.setParameter>
641 wakaba 1.26 ('error-handler' => sub {
642     my (undef, $err) = @_;
643     return ($err-><AG::c|DOMError.severity> !=
644     <C::c|DOMError.SEVERITY_FATAL_ERROR>);
645     })
646     unless $Message::DOM::XMLParser::DEBUG;
647 wakaba 1.29 ## NOTE: The default error handler in manakai |warn|s error
648 wakaba 1.26 ## description.
649 wakaba 1.11
650 wakaba 1.29 ## Document entity's URI and base URI
651     $r-><AS::Document.documentURI> ($self->{entity}->[0]->{doc_uri});
652     $r-><AS::Document.manakaiEntityBaseURI>
653     ($self->{entity}->[0]->{base_uri});
654    
655 wakaba 1.11 ## Document entity -> |Document| node
656     $self->_parse_DocumentEntity;
657    
658 wakaba 1.27 for (@{$self->{entity}}) {
659     $_->{close_file}->();
660     ## NOTE: There should be only the document entity.
661     }
662    
663 wakaba 1.11 ## Replacement tree for general |Entity| nodes
664 wakaba 1.20 my @ent = values %{$self->{general_entity}};
665     for my $ent (@ent) {
666     if (exists $ent->{has_replacement_text}) {
667 wakaba 1.11 my $ent_name = $ent->{name};
668     $self->{entity} = [<Code::getCopyOfEntityState::
669     $entity_type = 'general_entity',
670     $entity_name = $ent_name>];
671 wakaba 1.14 $self->{location} = $self->{entity}->[-1];
672 wakaba 1.11 $self->{token} = [];
673     $self->{char} = [];
674 wakaba 1.23 local $ent->{is_opened} = true;
675 wakaba 1.11 ## TODO: External entity support
676     $self->_parse_InternalGeneralParsedEntity ($ent->{node});
677     $ent->{node}-><AS::x|Entity.hasReplacementTree> (true);
678 wakaba 1.27 $self->{entity}->[-1]->{close_file}->();
679 wakaba 1.21 ## ISSUE: Should errors detected by this phase result
680     ## in |DOMLS:PARSE_ERR| exception thrown?
681 wakaba 1.20 }
682 wakaba 1.11 ## TODO: Read-only if configuration (for all entities)
683     }
684    
685 wakaba 1.21 ## Turns flags to their default value
686     $self->{doc_cfg}-><M::c|DOMConfiguration.setParameter>
687     (<Q::cfg|entity-reference-read-only> => null);
688     $self->{doc_cfg}-><M::c|DOMConfiguration.setParameter>
689     (<Q::cfg|clone-entity-reference-subtree> => null);
690 wakaba 1.26 $self->{doc_cfg}-><M::c|DOMConfiguration.setParameter>
691     (<Q::cfg|dtd-default-attributes> => null);
692     $self->{doc_cfg}-><M::c|DOMConfiguration.setParameter>
693 wakaba 1.30 (<Q::cfg|xml-id> => null);
694     $self->{doc_cfg}-><M::c|DOMConfiguration.setParameter>
695 wakaba 1.26 ('error-handler' => null);
696 wakaba 1.11 $r-><AS::Document.strictErrorChecking> (true);
697 wakaba 1.1 }__;
698    
699     @Method:
700     @@Name: shiftChar
701     @@ManakaiDOM:isForInternal:1
702     @@ForCheck: ManakaiDOM|ForClass
703     @@enDesc:
704     Returns the next character.
705     @@Return:
706     @@@Type: idl|long||ManakaiDOM|all
707     @@@enDesc:
708     The code position number of the next character, if any,
709 wakaba 1.6 or <CODE::-1>.
710 wakaba 1.1 @@@PerlDef:
711     if (@{$self->{char}}) {
712     $r = shift @{$self->{char}};
713     } else {
714 wakaba 1.6 GETCHAR: {
715 wakaba 1.27 no warnings 'closed'; # getc() on closed filehandle warning
716     my $ent = $self->{entity}->[-1];
717     my $char = getc $ent->{fh};
718 wakaba 1.6
719 wakaba 1.7 if (defined $char and length $char) {
720 wakaba 1.27 $ent->{pos}++;
721 wakaba 1.6 $r = ord $char;
722     if ($r == 0x000A) {
723 wakaba 1.27 $ent->{line}++;
724     $ent->{column} = 1;
725 wakaba 1.6 } elsif ($r == 0x000D) {
726 wakaba 1.27 my $next_char = getc $ent->{fh};
727 wakaba 1.6 if ($next_char eq "\x0A") {
728 wakaba 1.27 if ($ent->{is_external_entity}) {
729     $ent->{pos}++;
730     $ent->{line}++;
731     $ent->{column} = 1;
732     $r = 0x000A; # ^ U+000D U+000A -> U+000A ^
733     } else { # Internal entity
734     $ent->{column}++;
735     ## Line number will be increased by next |shiftChar|.
736     $ent->{fh}->ungetc (0x000A);
737     #$r = 0x000D; # ^ U+000D U+000A -> U+000D ^ U+000A
738     # no change
739     }
740 wakaba 1.6 } elsif ($next_char eq "\x85") {
741     if ($self->{xml_version} eq '1.1') {
742 wakaba 1.27 if ($ent->{is_external_entity}) {
743     if ($ent->{no_xml11_eol}) {
744     my $location = {
745     utf32_offset => $ent->{pos} - 1,
746     line_number => $ent->{line},
747     column_number => $ent->{column},
748     };
749     my $continue = __c|ERROR{
750     xp|fatal-xml11-end-of-line-in-xml-declaration::
751     c|location => {$location},
752     xp|character-number => {$r},
753     }__;
754     unless ($continue) {
755     __CODE{ParseError}__;
756     }
757     } # no_xml11_eol
758     $ent->{pos}++;
759     $ent->{line}++;
760     $ent->{column} = 1;
761     $r = 0x000A; # ^ U+000D U+0085 -> U+000A ^
762     } else { # internal entity
763     $ent->{column}++;
764     ## Line number will be increased by next |shiftChar|.
765     $ent->{fh}->ungetc (0x0085);
766     #$r = 0x000D; # ^ U+000D U+0085 -> U+000D ^ U+0085
767     # no change
768     }
769     } else { # XML 1.0
770 wakaba 1.16 ## |no_xml11_eol| will be tested later.
771 wakaba 1.27 $ent->{column}++;
772     ## Line number will be increased by next |shiftChar|.
773     $ent->{fh}->ungetc (0x0085);
774     $r = 0x000A if $ent->{is_external_entity};
775     # external: ^ U+000D U+0085 -> U+000A ^ U+0085
776     # internal: ^ U+000D U+0085 -> U+000D ^ U+0085 (as is)
777 wakaba 1.6 }
778 wakaba 1.27 } else { # neither U+000A nor U+0085
779     $ent->{line}++;
780     $ent->{column} = 1;
781     $ent->{fh}->ungetc (ord $next_char);
782     $r = 0x000A if $ent->{is_external_entity};
783     # external: ^ U+000D _ -> U+000A ^ _
784     # internal: ^ U+000D _ -> U+000D ^ _ (as is)
785 wakaba 1.6 }
786 wakaba 1.27 } elsif ($r == 0x0085 or $r == 0x2028) {
787     if ($ent->{no_xml11_eol}) {
788     my $location = {
789     utf32_offset => $ent->{pos} - 1,
790     line_number => $ent->{line},
791     column_number => $ent->{column},
792     };
793     my $continue = __c|ERROR{
794     xp|fatal-xml11-end-of-line-in-xml-declaration::
795     c|location => {$location},
796     xp|character-number => {$r},
797     }__;
798     unless ($continue) {
799     __CODE{ParseError}__;
800     }
801     } # no_xml11_eol
802     $r = 0x000A if $self->{xml_version} eq '1.1' and
803     $ent->{is_external_entity};
804     ## Even in XML 1.0 it increases the line number.
805     $ent->{line}++;
806     $ent->{column} = 1;
807 wakaba 1.6 } elsif (
808     not ((0x0020 <= $r and $r <= 0x007E) or
809     (0x00A0 <= $r and $r <= 0xD7FF) or
810     (0xE000 <= $r and $r <= 0xFFFD) or
811     (0x10000 <= $r and $r <= 0x10FFFF)) and
812 wakaba 1.27 $r != 0x0009 and
813     not (($self->{xml_version} eq '1.0' or
814     not $ent->{is_external_entity}) and
815     (0x007F <= $r and $r <= 0x009F)) and
816     not ($self->{xml_version} eq '1.1' and
817     not $ent->{is_external_entity} and
818     0x0001 <= $r and $r <= 0x001F)
819 wakaba 1.6 ) {
820     my $location = {
821 wakaba 1.27 utf32_offset => $ent->{pos} - 1,
822     line_number => $ent->{line},
823     column_number => $ent->{column},
824 wakaba 1.6 };
825 wakaba 1.27 my $continue = __c|ERROR{xp|wf-legal-literal-character::
826     c|location => {$location},
827 wakaba 1.6 xp|character-number => {$r},
828     }__;
829     unless ($continue) {
830 wakaba 1.27 __CODE{ParseError}__;
831 wakaba 1.3 }
832 wakaba 1.27 $ent->{column}++;
833     } else { # XML |Char|
834     $ent->{column}++;
835 wakaba 1.3 }
836     } else {
837 wakaba 1.6 $r = -1;
838 wakaba 1.3 }
839 wakaba 1.6 } # GETCHAR
840 wakaba 1.1 }
841    
842     @Method:
843     @@ManakaiDOM:isForInternal: 1
844     @@Operator: ManakaiDOM|MUErrorHandler
845     @@enDesc:
846     When a <IF::ecore|ErrorInterface||ManakaiDOM|Perl> is <Perl::report>ed,
847     then this method is invoked.
848    
849     The method calls the <cfg::DOMCore|error-handler> if the error is of
850     <IF::DOMCore|DOMError>. Otherwise, the error is re-thrown so that
851     corresponding <Perl::catch> clause, if any, can catch the error.
852     @@Param:
853     @@@Name: err
854     @@@Type: ecore|ErrorInterface||ManakaiDOM|Perl
855     @@@enDesc:
856     The reported error object.
857     @@Return:
858     @@@Type: DISPerl|Any
859     @@@enDesc:
860     If the <P::err> is a <IF::DOMCore|DOMError>, then the return value
861     of the error handler.
862    
863     {NOTE:: If the error is thrown, the method never returns.
864     }
865     @@@nullCase:
866     @@@@enDesc:
867     No error handler.
868     @@@PerlDef:
869     if ($err->isa (<IFName::DOMCore|DOMError||ManakaiDOM|ManakaiDOM>)) {
870     __DEEP{
871     A: {
872     my $cfg = $self-><AG::LSParser.domConfig>;
873     my $h = $cfg-><M::DOMCore|DOMConfiguration.getParameter>
874     ('error-handler');
875     $r = $h-><M::DOMCore|DOMErrorHandler.handleError> ($err);
876     } # A
877     }__;
878     } else {
879     $err-><M::ecore|ErrorInterface||ManakaiDOM|Perl.throw>;
880     }
881    
882     @DISPerl:dpgDef:
883    
884     /*
885     XML Document Entity
886    
887     document := prolog element *Misc
888     - *Char RestrictedChar *Char ;; [1]
889     */
890 wakaba 1.11 rule DocumentEntity : standalone {
891 wakaba 1.1 /*
892     prolog := XMLDecl? *Misc [doctypedecl *Misc] ;; [22]
893     */
894 wakaba 1.16 ?lexmode DocumentStart;
895 wakaba 1.11
896     my $doc;
897     lang:Perl {
898     $doc = $self->{doc};
899     }
900 wakaba 1.1
901 wakaba 1.3 ~? (XDO) {
902 wakaba 1.16 ?lexmode XMLDeclarationOrPI;
903     lang:Perl {
904     $self->{entity}->[-1]->{no_xml11_eol} = true;
905     }
906     ~ (S) { // XML declaration
907     &_XMLDeclaration_ ($doc => $doc);
908     ~ (PIC2) {
909     ?lexmode DocumentProlog;
910     } else {
911     ?lexmode DocumentProlog;
912     }
913     } (NameChar) { // Processing instruction whose target begins with |xml|
914     my $target_token;
915     lang:Perl ($v => $token.value) {
916     $target_token = $token;
917     $target_token->{value} = 'xml'.$target_token->{value};
918     $self->{entity}->[-1]->{no_xml11_eol} = false;
919     }
920     ?lexmode PINmtoken;
921     ~? (Nmtoken) {
922     lang:Perl ($v => $token.value) {
923     $target_token->{value} .= $v;
924     }
925     ?lexmode PIName;
926     }
927     lang:Perl {
928     $target_token->{type} = 'Name';
929     $target_token->{location_d} += 3; # 'xml'
930     unshift @{$self->{token}}, $token;
931     $token = $target_token;
932     }
933     &_ProcessingInstruction_ ($doc => $doc, $parent => $doc);
934     ~ (PIC) {
935     ?lexmode DocumentProlog;
936     } else {
937     ?lexmode DocumentProlog;
938     }
939 wakaba 1.3 } else {
940 wakaba 1.16 lang:Perl {
941     $self->{entity}->[-1]->{no_xml11_eol} = false;
942     }
943 wakaba 1.3 }
944     } else {
945     ?lexmode 'DocumentProlog';
946     }
947 wakaba 1.1
948     // *Misc
949 wakaba 1.2 ~* (CDO) {
950 wakaba 1.1 &_CommentDeclaration_ ($doc => $doc, $parent => $doc);
951    
952     ~ (MDC) {
953     ?lexmode DocumentProlog;
954     } else {
955     ?lexmode DocumentProlog;
956     }
957     } (PIO) {
958     &_ProcessingInstruction_ ($doc => $doc, $parent => $doc);
959    
960     ~ (PIC) {
961     ?lexmode 'DocumentProlog';
962     } else {
963     ?lexmode DocumentProlog;
964     }
965     } (S) {
966     //
967     }
968    
969     // doctypedecl
970     ~? (MDO) {
971     &_DocumentTypeDeclaration_ ($doc => $doc);
972    
973 wakaba 1.3 ~ (MDC) {
974     ?lexmode DocumentMisc;
975     } else {
976     ?lexmode DocumentMisc;
977     }
978     } else {
979     ?lexmode DocumentMisc;
980 wakaba 1.1 }
981 wakaba 1.25
982     lang:Perl {
983     $self->{doc}-><AS::Document.allDeclarationsProcessed> (true)
984     unless $self->{dont_process};
985     }
986 wakaba 1.1
987     // *Misc
988 wakaba 1.2 ~* (CDO) {
989 wakaba 1.1 &_CommentDeclaration_ ($doc => $doc, $parent => $doc);
990    
991     ~ (MDC) {
992     ?lexmode DocumentMisc;
993     } else {
994     ?lexmode DocumentMisc;
995     }
996     } (PIO) {
997     &_ProcessingInstruction_ ($doc => $doc, $parent => $doc);
998    
999     ~ (PIC) {
1000     ?lexmode 'DocumentMisc';
1001     } else {
1002     ?lexmode DocumentMisc;
1003     }
1004     } (S) {
1005     //
1006     }
1007    
1008     // Document element
1009     ~ (STAGO) {
1010     &Element_ ($doc => $doc, $parent => $doc)
1011     : unshift-current-token;
1012     ~ (TAGC) {
1013     ?lexmode DocumentEnd;
1014     } else {
1015     ?lexmode DocumentEnd;
1016     }
1017     } else {
1018     ?lexmode 'DocumentEnd';
1019     }
1020    
1021     // *Misc
1022 wakaba 1.2 ~* (CDO) {
1023 wakaba 1.1 &_CommentDeclaration_ ($doc => $doc, $parent => $doc);
1024    
1025     ~ (MDC) {
1026     ?lexmode DocumentEnd;
1027     } else {
1028     ?lexmode DocumentEnd;
1029     }
1030     } (PIO) {
1031     &_ProcessingInstruction_ ($doc => $doc, $parent => $doc);
1032     ~ (PIC) {
1033     ?lexmode 'DocumentEnd';
1034     } else {
1035     ?lexmode DocumentEnd;
1036     }
1037     } (S) {
1038     //
1039     }
1040    
1041     ~ (#EOF) { }
1042     } // DocumentEntity
1043 wakaba 1.11
1044     /*
1045     Internal General Parsed Entity
1046    
1047     An internal general parsed entity is well-formed if its
1048     replacement text matches the production labeled |content|.
1049     */
1050     rule InternalGeneralParsedEntity ($ent) : standalone {
1051     ?lexmode ElementContent;
1052    
1053     my $ns;
1054     lang:Perl {
1055     $ns = {
1056     xml => <Q::xml:>,
1057     xmlns => <Q::xmlns:>,
1058     };
1059     }
1060    
1061     &content ($parent => $ent, $ns => $ns);
1062    
1063     ~ (#EOF) { }
1064     } // InternalGeneralParsedEntity
1065    
1066 wakaba 1.1 /*
1067     XML Declaration
1068    
1069     XMLDecl := '<?xml' VersionInfo
1070     [EncodingDecl]
1071     [SDDecl]
1072     [S] '?>' ;; [23]
1073    
1074     NOTE: XML declaration is optional in XML 1.0
1075     while it is required in XML 1.1.
1076     */
1077 wakaba 1.16 rule _XMLDeclaration_ {
1078     // ~ (XDO) { }
1079 wakaba 1.3 ?lexmode XMLDeclaration;
1080 wakaba 1.16 //lang:Perl {
1081     // $self->{entity}->[-1]->{no_xml11_eol} = true;
1082     //}
1083     //~ (S) { }
1084 wakaba 1.3
1085     ~ (Name == 'version') {
1086     ~? (S) { }
1087     ~ (VI) { }
1088     ~? (S) { }
1089 wakaba 1.1
1090 wakaba 1.3 my $ver;
1091     my $bad_token;
1092    
1093     ~ (LIT) {
1094     ?lexmode AttributeValueLiteral;
1095    
1096     ~ (STRING) {
1097     lang:Perl ($version => $token.value) {
1098     $ver = $version;
1099     $bad_token = $token;
1100     }
1101     }
1102    
1103     ~ (LIT) {
1104     ?lexmode XMLDeclaration;
1105     }
1106     } (LITA) {
1107     ?lexmode AttributeValueLiteralA;
1108    
1109     ~ (STRING) {
1110     lang:Perl ($version => $token.value) {
1111     $ver = $version;
1112     $bad_token = $token;
1113     }
1114     }
1115    
1116     ~ (LITA) {
1117     ?lexmode XMLDeclaration;
1118     }
1119     }
1120    
1121     lang:Perl : has-error {
1122     unless ($ver eq '1.0' or $ver eq '1.1') {
1123     my $location;
1124     __CODE{xp|get-location-from-token::
1125     $token => {$bad_token},
1126     $result => {$location},
1127     }__;
1128     my $continue = __DOMCore:ERROR{xp|wf-unsupported-xml-version::
1129     DOMCore|location => {$location},
1130 wakaba 1.16 xp|parent => {$self->{doc}},
1131 wakaba 1.3 infoset|version => {$ver},
1132     xp|error-token => {$bad_token},
1133     }__;
1134     unless ($continue) {
1135 wakaba 1.27 __CODE{ParseError}__;
1136 wakaba 1.3 }
1137     }
1138 wakaba 1.16 $self->{doc}-><AS::Document.xmlVersion> ($ver);
1139 wakaba 1.3 $self->{xml_version} = $ver;
1140     }
1141    
1142     ~? (S) { }
1143 wakaba 1.1 }
1144    
1145 wakaba 1.3 ~? (Name == 'encoding') {
1146     ~? (S) { }
1147     ~ (VI) { }
1148     ~? (S) { }
1149    
1150     my $ver;
1151     my $bad_token;
1152    
1153     ~ (LIT) {
1154     ?lexmode AttributeValueLiteral;
1155    
1156     ~ (STRING) {
1157     lang:Perl ($version => $token.value) {
1158     $ver = $version;
1159     $bad_token = $token;
1160     }
1161     }
1162    
1163     ~ (LIT) {
1164     ?lexmode XMLDeclaration;
1165     }
1166     } (LITA) {
1167     ?lexmode AttributeValueLiteralA;
1168    
1169     ~ (STRING) {
1170     lang:Perl ($version => $token.value) {
1171     $ver = $version;
1172     $bad_token = $token;
1173     }
1174     }
1175    
1176     ~ (LITA) {
1177     ?lexmode XMLDeclaration;
1178     }
1179     }
1180    
1181     lang:Perl : has-error {
1182     unless ($ver =~ /\A[A-Za-z][A-Za-z0-9._-]*\z/) {
1183     my $location;
1184     __CODE{xp|get-location-from-token::
1185     $token => {$bad_token},
1186     $result => {$location},
1187     }__;
1188     my $continue = __DOMCore:ERROR{xp|wf-malformed-enc-name::
1189     DOMCore|location => {$location},
1190 wakaba 1.16 xp|parent => {$self->{doc}},
1191 wakaba 1.3 xp|name => {$ver},
1192     xp|error-token => {$bad_token},
1193     }__;
1194     unless ($continue) {
1195 wakaba 1.27 __CODE{ParseError}__;
1196 wakaba 1.3 }
1197     }
1198 wakaba 1.16 $self->{doc}-><AS::Document.xmlEncoding> ($ver);
1199 wakaba 1.3 }
1200    
1201     ~? (S) { }
1202 wakaba 1.1 }
1203 wakaba 1.3
1204     ~? (Name == 'standalone') {
1205     ~? (S) { }
1206     ~ (VI) { }
1207     ~? (S) { }
1208    
1209     my $ver;
1210     my $bad_token;
1211    
1212     ~ (LIT) {
1213     ?lexmode AttributeValueLiteral;
1214    
1215     ~ (STRING) {
1216     lang:Perl ($version => $token.value) {
1217     $ver = $version;
1218     $bad_token = $token;
1219     }
1220     }
1221    
1222     ~ (LIT) {
1223     ?lexmode XMLDeclaration;
1224     }
1225     } (LITA) {
1226     ?lexmode AttributeValueLiteralA;
1227    
1228     ~ (STRING) {
1229     lang:Perl ($version => $token.value) {
1230     $ver = $version;
1231     $bad_token = $token;
1232     }
1233     }
1234 wakaba 1.1
1235 wakaba 1.3 ~ (LITA) {
1236     ?lexmode XMLDeclaration;
1237     }
1238     }
1239    
1240     lang:Perl : has-error {
1241     unless ($ver eq 'yes' or $ver eq 'no') {
1242     my $location;
1243     __CODE{xp|get-location-from-token::
1244     $token => {$bad_token},
1245     $result => {$location},
1246     }__;
1247     my $continue = __DOMCore:ERROR{xp|wf-malformed-xml-standalone::
1248     DOMCore|location => {$location},
1249 wakaba 1.16 xp|parent => {$self->{doc}},
1250 wakaba 1.3 xp|name => {$ver},
1251     xp|error-token => {$bad_token},
1252     }__;
1253     unless ($continue) {
1254 wakaba 1.27 __CODE{ParseError}__;
1255 wakaba 1.3 }
1256     }
1257 wakaba 1.13 if ($ver eq 'yes') {
1258 wakaba 1.16 $self->{doc}-><AS::Document.xmlStandalone> (true);
1259 wakaba 1.13 $self->{standalone} = true;
1260     }
1261 wakaba 1.3 }
1262    
1263     ~? (S) { }
1264     }
1265    
1266 wakaba 1.16 ~ (PIC1) {
1267     lang:Perl {
1268     $self->{entity}->[-1]->{no_xml11_eol} = false;
1269     }
1270     } else {
1271     lang:Perl {
1272     $self->{entity}->[-1]->{no_xml11_eol} = false;
1273     }
1274     }
1275    
1276     // ~ (PIC2) { }
1277 wakaba 1.3 } // _XMLDeclaration_
1278 wakaba 1.1
1279     /*
1280     Comment Declaration
1281    
1282     Comment := '<!--' *(Char - '-' / '-' (Char - '-'))
1283     '-->' ;; [15]
1284 wakaba 1.4 */
1285 wakaba 1.1 rule _CommentDeclaration_ ($doc, $parent) {
1286     ?lexmode 'CommentDeclaration';
1287    
1288     ~? (STRING) {
1289     lang:Perl ($data => $token.value) {
1290     my $com = $doc-><M::Document.createComment> ($data);
1291     $parent-><M::Node.appendChild> ($com);
1292     }
1293     } else {
1294     lang:Perl {
1295     my $com = $doc-><M::Document.createComment> ('');
1296     $parent-><M::Node.appendChild> ($com);
1297     }
1298     }
1299    
1300     ~ (COM) {
1301     ?lexmode MarkupDeclaration;
1302     } else {
1303     ?lexmode MarkupDeclaration;
1304     }
1305    
1306     // ~ (MDC) { }
1307 wakaba 1.4 } // _CommentDeclaration
1308 wakaba 1.15
1309     rule _CommentDeclarationDTD {
1310     ?lexmode CommentDeclaration;
1311 wakaba 1.4
1312     ~? (STRING) {
1313     //
1314     }
1315    
1316     ~ (COM) {
1317     ?lexmode MarkupDeclaration;
1318     } else {
1319     ?lexmode MarkupDeclaration;
1320     }
1321    
1322     ~ (MDC) {
1323     ?lexmode DTD;
1324     } else {
1325     ?lexmode DTD;
1326     }
1327     } // _CommentDeclarationDTD
1328    
1329 wakaba 1.1 /*
1330     Processing Instruction
1331    
1332     PI := '<?' PITarget [S *Char - *Char '?>' *Char]
1333     '?>' ;; [16]
1334     */
1335     rule _ProcessingInstruction_ ($doc, $parent) {
1336     ?lexmode 'PIName';
1337    
1338     my $pi;
1339    
1340     ~ (Name) {
1341 wakaba 1.3 lang:Perl ($name => $token.value) : has-error {
1342 wakaba 1.1 if (lc $name eq 'xml') {
1343 wakaba 1.3 my $location;
1344     __CODE{xp|get-location-from-token::
1345     $token => {$token},
1346     $result => {$location},
1347     }__;
1348     my $continue = __DOMCore:ERROR{xp|wf-pi-target-is-xml::
1349     xp|name => {$name},
1350     DOMCore|location => {$location},
1351     xp|parent => {$parent},
1352     }__;
1353     unless ($continue) {
1354 wakaba 1.27 __CODE{ParseError}__;
1355 wakaba 1.3 }
1356 wakaba 1.1 }
1357 wakaba 1.26 __CODE{checkNCName:: $name => $name}__;
1358    
1359 wakaba 1.1 $pi = $doc-><M::Document.createProcessingInstruction>
1360     ($name);
1361     }
1362 wakaba 1.14 } else {
1363     lang:Perl {
1364     $pi = $doc-><M::Document.createProcessingInstruction> ('#INVALID');
1365     }
1366 wakaba 1.1 }
1367    
1368 wakaba 1.14 ~? (S) {
1369 wakaba 1.1 ?lexmode 'PIData';
1370    
1371     my $tdata;
1372    
1373     ~? (DATA) {
1374     lang:Perl ($data => $token.value) {
1375     $tdata = $data;
1376     }
1377     } else {
1378     lang:Perl {
1379     $tdata = '';
1380     }
1381     }
1382    
1383     lang:Perl {
1384     $pi-><AS::Node.nodeValue> ($tdata);
1385     }
1386     }
1387    
1388     lang:Perl {
1389     $parent-><M::Node.appendChild> ($pi);
1390     }
1391    
1392     // ~ (PIC) { }
1393     } // _ProcessingInstruction_
1394 wakaba 1.4
1395 wakaba 1.6 /*
1396     Processing instruction in DTD
1397     */
1398     rule _ProcessingInstructionDTD ($doc, $doctype) {
1399 wakaba 1.4 ?lexmode 'PIName';
1400 wakaba 1.6
1401     my $pi;
1402 wakaba 1.4
1403     ~ (Name) {
1404 wakaba 1.6 lang:Perl ($name => $token.value) : has-error {
1405     if (lc $name eq 'xml') {
1406     my $location;
1407     __CODE{xp|get-location-from-token::
1408     $token => {$token},
1409     $result => {$location},
1410     }__;
1411     my $continue = __DOMCore:ERROR{xp|wf-pi-target-is-xml::
1412     xp|name => {$name},
1413     DOMCore|location => {$location},
1414     xp|parent => {$doctype},
1415     }__;
1416     unless ($continue) {
1417 wakaba 1.27 __CODE{ParseError}__;
1418 wakaba 1.6 }
1419     }
1420 wakaba 1.26 __CODE{checkNCName:: $name => $name}__;
1421    
1422 wakaba 1.6 $pi = $doc-><M::Document.createProcessingInstruction>
1423     ($name);
1424 wakaba 1.29 $pi-><AS::x|ProcessingInstruction.manakaiBaseURI>
1425     ($self->{location}->{base_uri});
1426 wakaba 1.6 }
1427 wakaba 1.14 } else {
1428     lang:Perl {
1429     $pi = $doc-><M::Document.createProcessingInstruction> ('#INVALID');
1430     }
1431 wakaba 1.4 }
1432    
1433 wakaba 1.14 ~? (S) {
1434 wakaba 1.4 ?lexmode 'PIData';
1435    
1436 wakaba 1.6 my $tdata;
1437    
1438 wakaba 1.4 ~? (DATA) {
1439 wakaba 1.6 lang:Perl ($data => $token.value) {
1440     $tdata = $data;
1441     }
1442     } else {
1443     lang:Perl {
1444     $tdata = '';
1445     }
1446     }
1447    
1448     lang:Perl {
1449     $pi-><AS::Node.nodeValue> ($tdata);
1450 wakaba 1.4 }
1451     }
1452    
1453 wakaba 1.6 lang:Perl {
1454     $doctype-><M::Node.appendChild> ($pi);
1455     }
1456    
1457 wakaba 1.4 ~ (PIC) {
1458     ?lexmode DTD;
1459     } else {
1460     ?lexmode DTD;
1461     }
1462     } // _ProcessingInstructionDTD
1463 wakaba 1.1
1464     /*
1465     Element content parsing mode
1466    
1467     element := EmptyElemTag /
1468     STag content ETag ;; [39]
1469     content := (CharData / element / Reference / CDSect /
1470     PI / Comment) ;; [43]
1471     */
1472 wakaba 1.6 rule Element_ ($doc, $parent, $ns) : standalone {
1473 wakaba 1.1 ?lexmode 'ElementContent';
1474    
1475     my $node; // Current "parent" node
1476     my $nodes; // Node stack (w/o $current_node)
1477     my $type; // Current "parent" element type QName
1478     my $types; // Element type stack (w/o $current_type)
1479 wakaba 1.6 //my $ns; // Current in-scope namespace bindings
1480 wakaba 1.1 my $nses; // Namespace binding stack (w/o $current_ns)
1481    
1482     lang:Perl {
1483     $node = $parent;
1484     $nodes = [];
1485     $type = '';
1486     $types = [];
1487 wakaba 1.6 $ns ||= {
1488 wakaba 1.1 xml => <Q::xml:>,
1489     xmlns => <Q::xmlns:>,
1490     };
1491     $nses = [];
1492     }
1493    
1494     ~* : name => CONTENT
1495     (CharData) {
1496     // Character data
1497     lang:Perl ($data => $token.value) {
1498     $node-><M::Node.appendChild>
1499     ($doc-><M::Document.createTextNode> ($data));
1500     }
1501     } (STAGO) {
1502     // Start tag or empty element tag
1503    
1504     ?lexmode 'StartTag';
1505    
1506     ~ (Name) {
1507     my $attrs;
1508 wakaba 1.26 lang:Perl ($name => $token.value) : has-error {
1509     __CODE{checkQName:: $name => $name}__;
1510 wakaba 1.1 push @{$types}, $type;
1511     $type = $name;
1512     $attrs = {};
1513     }
1514    
1515     ~? (S) {
1516     &AttributeSpecificationList
1517     ($doc => $doc, $attrs => $attrs);
1518     }
1519    
1520     my $el;
1521 wakaba 1.9
1522     /*
1523     Note that this implementation does not perform
1524     attribute value tokenization (but does white space
1525     normalization common to attribute types) and
1526     construct the tree as is. DOM Level 3 Core spec
1527     is unclear on this point. With tokenization,
1528     entity references cannot be preserved.
1529    
1530     The manakai Node.nodeValue and Attr.value attributes
1531     do tokenization according to attribute types.
1532     */
1533    
1534     /*
1535     ISSUE: Should |xml:id| attribute be typed?
1536     */
1537 wakaba 1.1
1538     lang:Perl {
1539     push @{$nses}, $ns;
1540     $ns = {%$ns};
1541 wakaba 1.26
1542     ## Default attributes
1543     DA: for my $atqname (%{$self->{attr}->{$type}}) {
1544     next DA unless $self->{attr}->{$type}->{$atqname};
1545     next DA if exists $attrs->{$atqname}; # specified
1546     my $dtype = $self->{attr}->{$type}->{$atqname}
1547     -><AG::ATDef.defaultType>;
1548     next DA unless $dtype == <C::ATDef.EXPLICIT_DEFAULT> or
1549     $dtype == <C::ATDef.FIXED_DEFAULT>;
1550     $attrs->{$atqname} = {is_default => true, nodes => []};
1551     for (@{$self->{attr}->{$type}->{$atqname}
1552     -><AG::Node.childNodes>}) {
1553     push @{$attrs->{$atqname}->{nodes}},
1554     $_-><M::Node.cloneNode> (true);
1555     }
1556     }
1557 wakaba 1.1
1558     my %gattr;
1559     my %lattr;
1560     for my $atqname (keys %$attrs) {
1561     my ($pfx, $lname) = split /:/, $atqname;
1562 wakaba 1.9 $attrs->{$atqname}->{def} = $self->{attr}->{$type}->{$atqname};
1563 wakaba 1.1 if (defined $lname) { ## Global attribute
1564     if ($pfx eq 'xmlns') {
1565 wakaba 1.26 my $nsuri = $attrs->{$atqname}->{is_default}
1566     ? $attrs->{$atqname}->{def}-><AG::Node.nodeValue>
1567     : $attrs->{$atqname}->{value};
1568     if (not $attrs->{$atqname}->{is_default} and
1569     $attrs->{$atqname}->{def}) {
1570 wakaba 1.9 my $dt = $attrs->{$atqname}->{def}-><AG::ATDef.declaredType>;
1571     if ({
1572     <C::ATDef.ID_ATTR> => true,
1573     <C::ATDef.IDREF_ATTR> => true,
1574     <C::ATDef.IDREFS_ATTR> => true,
1575     <C::ATDef.ENTITY_ATTR> => true,
1576     <C::ATDef.ENTITIES_ATTR> => true,
1577     <C::ATDef.NMTOKEN_ATTR> => true,
1578     <C::ATDef.NMTOKENS_ATTR> => true,
1579     <C::ATDef.NOTATION_ATTR> => true,
1580     <C::ATDef.ENUMERATION_ATTR> => true,
1581     }->{$dt}) {
1582     ## Tokenization (XML 1 3.3.3)
1583 wakaba 1.26 for ($nsuri) {
1584 wakaba 1.9 s/^\x20+//;
1585     s/\x20+\z//;
1586     s/\x20+/ /g;
1587     }
1588     }
1589     }
1590 wakaba 1.26 if ($lname eq 'xml' and
1591     $nsuri ne <Q::xml:>) {
1592     my $location;
1593     __CODE{xp|get-location-from-token::
1594     $token => $token,
1595     $result => $location,
1596     }__;
1597     my $continue = __c|ERROR{xp|nsc-reserved-prefix-xml::
1598     c|location => {$location},
1599     xp|token => {$token},
1600     infoset|prefix => {$lname},
1601     infoset|namespaceName => {$nsuri},
1602     }__;
1603     unless ($continue) {
1604 wakaba 1.27 __CODE{ParseError}__;
1605 wakaba 1.26 }
1606     } elsif ($lname eq 'xmlns') {
1607     my $location;
1608     __CODE{xp|get-location-from-token::
1609     $token => $token,
1610     $result => $location,
1611     }__;
1612     my $continue = __c|ERROR{xp|nsc-reserved-prefix-xmlns::
1613     c|location => {$location},
1614     xp|token => {$token},
1615     infoset|prefix => {$lname},
1616     infoset|namespaceName => {$nsuri},
1617     }__;
1618     unless ($continue) {
1619 wakaba 1.27 __CODE{ParseError}__;
1620 wakaba 1.26 }
1621     }
1622     if ($nsuri eq '') {
1623     if ($self->{xml_version} eq '1.0') {
1624     my $location;
1625     __CODE{xp|get-location-from-token::
1626     $token => $token,
1627     $result => $location,
1628     }__;
1629     my $continue = __c|ERROR{xp|nswf-empty-namespace-name::
1630     c|location => {$location},
1631     xp|token => {$token},
1632     infoset|namespaceName => {$nsuri},
1633     infoset|prefix => {$lname},
1634     }__;
1635     unless ($continue) {
1636 wakaba 1.27 __CODE{ParseError}__;
1637 wakaba 1.26 }
1638     }
1639     } elsif ($nsuri eq <Q::xml:> and
1640     $lname ne 'xml') {
1641     my $location;
1642     __CODE{xp|get-location-from-token::
1643     $token => $token,
1644     $result => $location,
1645     }__;
1646     my $continue = __c|ERROR{
1647     xp|nsc-reserved-namespace-name-xml::
1648     c|location => {$location},
1649     xp|token => {$token},
1650     infoset|prefix => {$lname},
1651     infoset|namespaceName => {$nsuri},
1652     }__;
1653     unless ($continue) {
1654 wakaba 1.27 __CODE{ParseError}__;
1655 wakaba 1.26 }
1656     } elsif ($nsuri eq <Q::xmlns:>) {
1657     my $location;
1658     __CODE{xp|get-location-from-token::
1659     $token => $token,
1660     $result => $location,
1661     }__;
1662     my $continue = __c|ERROR{
1663     xp|nsc-reserved-namespace-name-xmlns::
1664     c|location => {$location},
1665     xp|token => {$token},
1666     infoset|prefix => {$lname},
1667     infoset|namespaceName => {$nsuri},
1668     }__;
1669     unless ($continue) {
1670 wakaba 1.27 __CODE{ParseError}__;
1671 wakaba 1.26 }
1672     }
1673     $ns->{$lname} = $nsuri;
1674 wakaba 1.1 delete $ns->{$lname} unless length $ns->{$lname};
1675     }
1676     $gattr{$pfx}->{$lname} = $attrs->{$atqname};
1677     } else { ## Local attribute
1678     if ($pfx eq 'xmlns') {
1679 wakaba 1.26 $ns->{''} = $attrs->{xmlns}->{is_default}
1680     ? $attrs->{xmlns}->{def}-><AG::Node.nodeValue>
1681     : $attrs->{xmlns}->{value};
1682     if (not $attrs->{$atqname}->{is_default} and
1683     $attrs->{$atqname}->{def}) {
1684 wakaba 1.9 my $dt = $attrs->{$atqname}->{def}-><AG::ATDef.declaredType>;
1685     if ({
1686     <C::ATDef.ID_ATTR> => true,
1687     <C::ATDef.IDREF_ATTR> => true,
1688     <C::ATDef.IDREFS_ATTR> => true,
1689     <C::ATDef.ENTITY_ATTR> => true,
1690     <C::ATDef.ENTITIES_ATTR> => true,
1691     <C::ATDef.NMTOKEN_ATTR> => true,
1692     <C::ATDef.NMTOKENS_ATTR> => true,
1693     <C::ATDef.NOTATION_ATTR> => true,
1694     <C::ATDef.ENUMERATION_ATTR> => true,
1695     }->{$dt}) {
1696     ## Tokenization (XML 1 3.3.3)
1697     for ($ns->{''}) {
1698     s/^\x20+//;
1699     s/\x20+\z//;
1700     s/\x20+/ /g;
1701     }
1702     }
1703     }
1704 wakaba 1.26 unless ($ns->{''}) {
1705     delete $ns->{''};
1706     } elsif ($ns->{''} eq <Q::xml:>) {
1707     my $location;
1708     __CODE{xp|get-location-from-token::
1709     $token => $token,
1710     $result => $location,
1711     }__;
1712     my $continue = __c|ERROR{
1713     xp|nsc-reserved-namespace-name-xml::
1714     c|location => {$location},
1715     xp|token => {$token},
1716     infoset|prefix => {null},
1717     infoset|namespaceName => {<Q::xml:>},
1718     }__;
1719     unless ($continue) {
1720 wakaba 1.27 __CODE{ParseError}__;
1721 wakaba 1.26 }
1722     } elsif ($ns->{''} eq <Q::xmlns:>) {
1723     my $location;
1724     __CODE{xp|get-location-from-token::
1725     $token => $token,
1726     $result => $location,
1727     }__;
1728     my $continue = __c|ERROR{
1729     xp|nsc-reserved-namespace-name-xmlns::
1730     c|location => {$location},
1731     xp|token => {$token},
1732     infoset|prefix => {null},
1733     infoset|namespaceName => {<Q::xmlns:>},
1734     }__;
1735     unless ($continue) {
1736 wakaba 1.27 __CODE{ParseError}__;
1737 wakaba 1.26 }
1738     }
1739 wakaba 1.1 } else {
1740     $lattr{$pfx} = $attrs->{$atqname};
1741     }
1742     }
1743     }
1744    
1745     my ($pfx, $lname) = split /:/, $type;
1746     my $nsuri;
1747     if (defined $lname) { ## Prefixed namespace
1748     if (defined $ns->{$pfx}) {
1749     $nsuri = $ns->{$pfx};
1750     } else {
1751 wakaba 1.26 my $location;
1752     __CODE{xp|get-location-from-token::
1753     $token => $token,
1754     $result => $location,
1755     }__;
1756     my $continue = __c|ERROR{xp|nsc-prefix-declared::
1757     c|location => {$location},
1758     xp|token => {$token},
1759     infoset|prefix => {$pfx},
1760     xp|name => {$type},
1761     }__;
1762     unless ($continue) {
1763 wakaba 1.27 __CODE{ParseError}__;
1764 wakaba 1.26 }
1765 wakaba 1.1 }
1766     } else { ## Default namespace
1767     $nsuri = $ns->{''};
1768     }
1769    
1770     $el = $doc-><M::Document.createElementNS>
1771     ($nsuri, $type);
1772    
1773     if ($attrs->{xmlns}) {
1774     my $attr = $doc-><M::Document.createAttributeNS>
1775     (<Q::xmlns:>, 'xmlns');
1776     for (@{$attrs->{xmlns}->{nodes}}) {
1777     $attr-><M::Node.appendChild> ($_);
1778     }
1779 wakaba 1.9 if ($attrs->{xmlns}->{def}) {
1780     __CODE{t|setAttrType::
1781     $attr => $attr,
1782     $type => {$attrs->{xmlns}->{def}-><AG::ATDef.declaredType>},
1783     }__;
1784     }
1785 wakaba 1.1 $el-><M::Element.setAttributeNodeNS> ($attr);
1786 wakaba 1.26 $attr-><AS::t|Attr.specified> (false)
1787     if $attrs->{xmlns}->{is_default};
1788 wakaba 1.1 }
1789    
1790     for my $lname (keys %lattr) {
1791     my $attr = $doc-><M::Document.createAttributeNS>
1792     (null, $lname);
1793     for (@{$lattr{$lname}->{nodes}}) {
1794     $attr-><M::Node.appendChild> ($_);
1795     }
1796 wakaba 1.9 if ($attrs->{$lname}->{def}) {
1797     __CODE{t|setAttrType::
1798     $attr => $attr,
1799     $type => {$attrs->{$lname}->{def}-><AG::ATDef.declaredType>},
1800     }__;
1801     }
1802 wakaba 1.1 $el-><M::Element.setAttributeNodeNS> ($attr);
1803 wakaba 1.26 $attr-><AS::t|Attr.specified> (false)
1804     if $attrs->{$lname}->{is_default};
1805 wakaba 1.1 }
1806    
1807     for my $pfx (keys %gattr) {
1808 wakaba 1.26 LN: for my $lname (keys %{$gattr{$pfx}}) {
1809     my $name = $pfx.':'.$lname;
1810     unless (defined $ns->{$pfx}) {
1811     my $location;
1812     __CODE{xp|get-location-from-token::
1813     $token => $token,
1814     $result => $location,
1815     }__;
1816     my $continue = __c|ERROR{xp|nsc-prefix-declared::
1817     c|location => {$location},
1818     xp|token => {$token},
1819     xp|name => {$name},
1820     infoset|prefix => {$pfx},
1821     }__;
1822     unless ($continue) {
1823 wakaba 1.27 __CODE{ParseError}__;
1824 wakaba 1.26 }
1825     }
1826     my $attr = $el-><M::Element.getAttributeNodeNS>
1827     ($ns->{$pfx}, $lname);
1828     if ($attr) {
1829     my $another_name = $attr-><AG::Node.nodeName>;
1830     if ($name ne $another_name) {
1831     my $location;
1832     __CODE{xp|get-location-from-token::
1833     $token => $token,
1834     $result => $location,
1835     }__;
1836     my $continue = __c|ERROR{
1837     xp|nswf-unique-att-spec-expanded-name::
1838     c|location => {$location},
1839     xp|token => {$token},
1840     xp|another-attribute-name => {$another_name},
1841     xp|name => {$name},
1842     infoset|namespaceName => {$ns->{$pfx}},
1843     infoset|localName => {$lname},
1844     }__;
1845     unless ($continue) {
1846 wakaba 1.27 __CODE{ParseError}__;
1847 wakaba 1.26 }
1848     unless ($attr-><AG::t|Attr.specified>) {
1849     ## It is a default attribute
1850     $attr = $doc-><M::Document.createAttributeNS>
1851     ($ns->{$pfx}, $name);
1852     } else {
1853     ## It is a specified attribute
1854     next LN;
1855     }
1856     } else { ## There is default attribute
1857     $attr = $doc-><M::Document.createAttributeNS>
1858     ($ns->{$pfx}, $name);
1859     }
1860     } else {
1861     $attr = $doc-><M::Document.createAttributeNS>
1862     ($ns->{$pfx}, $name);
1863     }
1864 wakaba 1.1 for (@{$gattr{$pfx}->{$lname}->{nodes}}) {
1865     $attr-><M::Node.appendChild> ($_);
1866     }
1867 wakaba 1.26 if ($gattr{$pfx}->{$lname}->{def}) {
1868 wakaba 1.9 __CODE{t|setAttrType::
1869     $attr => $attr,
1870 wakaba 1.26 $type => {$gattr{$pfx}->{$lname}
1871 wakaba 1.9 ->{def}-><AG::ATDef.declaredType>},
1872     }__;
1873     }
1874 wakaba 1.1 $el-><M::Element.setAttributeNodeNS> ($attr);
1875 wakaba 1.26 $attr-><AS::t|Attr.specified> (false)
1876     if $gattr{$pfx}->{$lname}->{is_default};
1877     } # PFX
1878 wakaba 1.1 }
1879    
1880     $node-><M::Node.appendChild> ($el);
1881     }
1882    
1883     ~ (TAGC) {
1884     lang:Perl {
1885     push @{$nodes}, $node;
1886     $node = $el;
1887     }
1888     ?lexmode ElementContent;
1889 wakaba 1.6 } (NESTC) {
1890     my $is_docel;
1891 wakaba 1.1 lang:Perl {
1892     $ns = pop @{$nses};
1893     $type = pop @{$types};
1894 wakaba 1.6 $is_docel = (@{$types} == 0);
1895     }
1896    
1897     if-true ($is_docel) {
1898     return;
1899     }
1900    
1901     ~ (TAGC) {
1902     ?lexmode ElementContent;
1903     } else {
1904     ?lexmode ElementContent;
1905 wakaba 1.1 }
1906     } else {
1907     ?lexmode ElementContent;
1908     }
1909     } else {
1910     ?lexmode ElementContent;
1911     }
1912    
1913     } (ETAGO) {
1914     // End tag
1915    
1916     ?lexmode 'EndTag';
1917    
1918     my $is_docel;
1919    
1920     ~ (Name) {
1921 wakaba 1.26 // No NCName & QName check (it must match to start-tag)
1922 wakaba 1.3 lang:Perl ($name => $token.value) : has-error {
1923 wakaba 1.1 if ($name eq $type) {
1924     $type = pop @{$types};
1925     if ($type eq '') {
1926     $is_docel = true;
1927     }
1928     $node = pop @{$nodes};
1929     $ns = pop @{$nses};
1930     } else {
1931 wakaba 1.3 my $location;
1932     __CODE{xp|get-location-from-token::
1933     $token => $token,
1934     $result => $location,
1935     }__;
1936     my $continue = __DOMCore:ERROR{xp|wf-element-type-match::
1937     DOMCore:location => {$location},
1938     xp|token => {$token},
1939     xp|expected-element-type => {$type},
1940     xp|actual-element-type => {$name},
1941     xp|node => {$node},
1942     }__;
1943     unless ($continue) {
1944 wakaba 1.27 __CODE{ParseError}__;
1945 wakaba 1.3 }
1946 wakaba 1.1 }
1947     }
1948     }
1949    
1950     ~? (S) { }
1951    
1952     if-true ($is_docel) {
1953 wakaba 1.3 lang:Perl : has-error {
1954 wakaba 1.1 if (@{$types}) {
1955 wakaba 1.3 my $location;
1956     __CODE{xp|get-location-from-token::
1957     $token => $token,
1958     $result => $location,
1959     }__;
1960     for my $type (reverse @{$types}) {
1961     my $continue = __DOMCore:ERROR{xp|wf-no-end-tag::
1962     DOMCore:location => {$location},
1963     xp|token => {$token},
1964     xp|expected-element-type => {$type},
1965     xp|node => {$node},
1966     }__;
1967     unless ($continue) {
1968 wakaba 1.27 __CODE{ParseError}__;
1969 wakaba 1.3 }
1970     $node = shift @{$nodes};
1971     }
1972 wakaba 1.1 }
1973     }
1974     return;
1975     }
1976    
1977     ~ (TAGC) {
1978     ?lexmode ElementContent;
1979     } else {
1980     ?lexmode 'ElementContent';
1981     }
1982    
1983     } (HCRO) {
1984     &_HexadecimalCharacterReference_
1985     ($doc => $doc, $parent => $node);
1986    
1987     ~ (REFC) {
1988     ?lexmode 'ElementContent';
1989     } else {
1990     ?lexmode ElementContent;
1991     }
1992     } (CRO) {
1993     &_NumericCharacterReference_
1994     ($doc => $doc, $parent => $node);
1995    
1996     ~ (REFC) {
1997     ?lexmode 'ElementContent';
1998     } else {
1999     ?lexmode ElementContent;
2000     }
2001     } (ERO) {
2002 wakaba 1.6 &_GeneralEntityReferenceEC
2003     ($doc => $doc, $parent => $node, $ns => $ns);
2004 wakaba 1.1 } (CDO) {
2005     &_CommentDeclaration_ ($doc => $doc, $parent => $node);
2006    
2007     ~ (MDC) {
2008     ?lexmode ElementContent;
2009     } else {
2010     ?lexmode ElementContent;
2011     }
2012     } (CDSO) {
2013     &_CDATASection_ ($doc => $doc, $parent => $node);
2014    
2015     ~ (MSE) {
2016     ?lexmode 'ElementContent';
2017     } else {
2018     ?lexmode ElementContent;
2019     }
2020     } (PIO) {
2021     &_ProcessingInstruction_ ($doc => $doc, $parent => $node);
2022    
2023     ~ (PIC) {
2024     ?lexmode 'ElementContent';
2025     } else {
2026     ?lexmode ElementContent;
2027     }
2028     }
2029 wakaba 1.3
2030     ~ (#NONE) { }
2031 wakaba 1.1 } // Element_
2032 wakaba 1.11
2033     /*
2034     content := [CharData]
2035     *((element / Reference / CDSect / PI / Comment) [CharData])
2036     */
2037     rule content ($parent, $ns) {
2038     // ?lexmode ElementContent;
2039    
2040     my $doc;
2041     lang:Perl {
2042     $doc = $self->{doc};
2043     }
2044    
2045     ~* (CharData) {
2046     lang:Perl ($data => $token.value) {
2047     $parent-><M::Node.appendChild>
2048     ($self->{doc}-><M::Document.createTextNode> ($data));
2049     }
2050     } (STAGO) {
2051     &Element_ ($doc => $doc, $parent => $parent, $ns => $ns)
2052     : unshift-current-token;
2053     ~ (TAGC) {
2054     ?lexmode ElementContent;
2055     } else {
2056     ?lexmode ElementContent;
2057     }
2058     } (HCRO) {
2059     &_HexadecimalCharacterReference_
2060     ($doc => $doc, $parent => $parent);
2061    
2062     ~ (REFC) {
2063     ?lexmode 'ElementContent';
2064     } else {
2065     ?lexmode ElementContent;
2066     }
2067     } (CRO) {
2068     &_NumericCharacterReference_
2069     ($doc => $doc, $parent => $parent);
2070    
2071     ~ (REFC) {
2072     ?lexmode 'ElementContent';
2073     } else {
2074     ?lexmode ElementContent;
2075     }
2076     } (ERO) {
2077     &_GeneralEntityReferenceEC
2078     ($doc => $doc, $parent => $parent, $ns => $ns);
2079     } (CDO) {
2080     &_CommentDeclaration_ ($doc => $doc, $parent => $parent);
2081    
2082     ~ (MDC) {
2083     ?lexmode ElementContent;
2084     } else {
2085     ?lexmode ElementContent;
2086     }
2087     } (CDSO) {
2088     &_CDATASection_ ($doc => $doc, $parent => $parent);
2089    
2090     ~ (MSE) {
2091     ?lexmode 'ElementContent';
2092     } else {
2093     ?lexmode ElementContent;
2094     }
2095     } (PIO) {
2096     &_ProcessingInstruction_ ($doc => $doc, $parent => $parent);
2097    
2098     ~ (PIC) {
2099     ?lexmode 'ElementContent';
2100     } else {
2101     ?lexmode ElementContent;
2102     }
2103     }
2104     } // content
2105 wakaba 1.1
2106     rule AttributeSpecificationList ($doc, $attrs)
2107     : standalone
2108     {
2109     ?lexmode 'StartTag';
2110    
2111     my $i;
2112     lang:Perl {
2113     $i = 0;
2114     }
2115    
2116     ~* (Name) {
2117     my $atqname;
2118 wakaba 1.26 lang:Perl ($name => $token.value) : has-error {
2119     __CODE{checkQName:: $name => $name}__;
2120 wakaba 1.1 $atqname = $name;
2121     }
2122    
2123     my $vals;
2124 wakaba 1.18 lang:Perl : has-error {
2125 wakaba 1.1 if ($attrs->{$atqname}) {
2126 wakaba 1.3 my $location;
2127     __CODE{xp|get-location-from-token::
2128     $token => $token,
2129     $result => $location,
2130     }__;
2131     my $continue = __DOMCore:ERROR{xp|wf-unique-att-spec::
2132     DOMCore:location => {$location},
2133     xp|token => {$token},
2134     xp|name => {$atqname},
2135     }__;
2136     unless ($continue) {
2137 wakaba 1.27 __CODE{ParseError}__;
2138 wakaba 1.3 }
2139 wakaba 1.1 }
2140    
2141     $vals = $attrs->{$atqname} = {
2142     nodes => [],
2143     value => '',
2144     index => $i++,
2145     };
2146     }
2147 wakaba 1.3
2148     ~? (S) { }
2149     ~ (VI) { }
2150     ~? (S) { }
2151 wakaba 1.1
2152     ~ (LIT) {
2153     &_AttributeValueSpecification_
2154     ($doc => $doc, $vals => $vals);
2155    
2156     ~ (LIT) {
2157     ?lexmode StartTag;
2158     } else {
2159     ?lexmode StartTag;
2160     }
2161     } (LITA) {
2162     &_AttributeValueSpecificationA_
2163     ($doc => $doc, $vals => $vals);
2164    
2165     ~ (LITA) {
2166     ?lexmode StartTag;
2167     } else {
2168     ?lexmode StartTag;
2169     }
2170     }
2171     } (S) : separator : terminator? { }
2172     } // AttributeSpecificationList
2173    
2174     rule _AttributeValueSpecification_ ($doc, $vals) {
2175     // ~ (LIT) { }
2176     ?lexmode 'AttributeValueLiteral';
2177    
2178     ~* (STRING) {
2179     lang:Perl ($value => $token.value) {
2180     $value =~ s/[\x09\x0A\x0D]/ /g;
2181     my $text = $doc-><M::Document.createTextNode> ($value);
2182     push @{$vals->{nodes}}, $text;
2183     $vals->{value} .= $value;
2184     }
2185     } (HCRO) {
2186     &_HexadecimalCharacterReferenceV_
2187     ($doc => $doc, $vals => $vals);
2188    
2189     ~ (REFC) {
2190     ?lexmode AttributeValueLiteral;
2191     } else {
2192     ?lexmode AttributeValueLiteral;
2193     }
2194     } (CRO) {
2195     &_NumericCharacterReferenceV_
2196     ($doc => $doc, $vals => $vals);
2197    
2198     ~ (REFC) {
2199     ?lexmode AttributeValueLiteral;
2200     } else {
2201     ?lexmode AttributeValueLiteral;
2202     }
2203     } (ERO) {
2204     // TODO: Attribute value normalization
2205     &_GeneralEntityReferenceV_
2206     ($doc => $doc, $vals => $vals);
2207    
2208     ~ (REFC) {
2209     ?lexmode AttributeValueLiteral;
2210     } else {
2211     ?lexmode AttributeValueLiteral;
2212     }
2213     }
2214    
2215     // ~ (LIT) { } (LITA) { }
2216     } // _AttributeValueSpecification_
2217    
2218     rule _AttributeValueSpecificationA_ ($doc, $vals) {
2219     // ~ (LITA) { }
2220     ?lexmode 'AttributeValueLiteralA';
2221    
2222     ~* (STRING) {
2223     lang:Perl ($value => $token.value) {
2224     $value =~ s/[\x09\x0A\x0D]/ /g;
2225     my $text = $doc-><M::Document.createTextNode> ($value);
2226     push @{$vals->{nodes}}, $text;
2227     $vals->{value} .= $value;
2228     }
2229     } (HCRO) {
2230     &_HexadecimalCharacterReferenceV_
2231     ($doc => $doc, $vals => $vals);
2232    
2233     ~ (REFC) {
2234     ?lexmode AttributeValueLiteralA;
2235     } else {
2236     ?lexmode AttributeValueLiteralA;
2237     }
2238     } (CRO) {
2239     &_NumericCharacterReferenceV_
2240     ($doc => $doc, $vals => $vals);
2241    
2242     ~ (REFC) {
2243     ?lexmode AttributeValueLiteralA;
2244     } else {
2245     ?lexmode AttributeValueLiteralA;
2246     }
2247     } (ERO) {
2248     // TODO: Attribute value normalization
2249     &_GeneralEntityReferenceV_
2250     ($doc => $doc, $vals => $vals);
2251    
2252     ~ (REFC) {
2253     ?lexmode AttributeValueLiteralA;
2254     } else {
2255     ?lexmode AttributeValueLiteralA;
2256     }
2257     }
2258    
2259     // ~ (LITA) { }
2260     } // _AttributeValueSpecificationA_
2261    
2262     /*
2263 wakaba 1.11 Parsing replacement text of an entity referenced in
2264     an attribute value specification.
2265     */
2266     rule AttributeValueLiteralE_ ($parent, $vals)
2267     : recursive
2268     {
2269     // ?lexmode AttributeValueLiteralE;
2270    
2271     ~* (STRING) {
2272     lang:Perl ($value => $token.value) {
2273     $value =~ s/[\x09\x0A\x0D]/ /g;
2274     my $text = $self->{doc}-><M::Document.createTextNode> ($value);
2275     $parent-><M::Node.appendChild> ($text);
2276     $vals->{value} .= $value;
2277     }
2278     } (HCRO) {
2279     &_HexadecimalCharacterReferenceAE_
2280     ($parent => $parent, $vals => $vals);
2281    
2282     ~ (REFC) {
2283     ?lexmode AttributeValueLiteralE;
2284     } else {
2285     ?lexmode AttributeValueLiteralE;
2286     }
2287     } (CRO) {
2288     &_NumericCharacterReferenceAE_
2289     ($parent => $parent, $vals => $vals);
2290    
2291     ~ (REFC) {
2292     ?lexmode AttributeValueLiteralE;
2293     } else {
2294     ?lexmode AttributeValueLiteralE;
2295     }
2296     } (ERO) {
2297     &_GeneralEntityReferenceAE_ ($parent => $parent, $vals => $vals);
2298    
2299     ~ (REFC) {
2300     ?lexmode AttributeValueLiteralE;
2301     } else {
2302     ?lexmode AttributeValueLiteralE;
2303     }
2304 wakaba 1.18 } (#INVALID == '<') {
2305     lang:Perl : has-error {
2306     my $location;
2307     __CODE{xp|get-location-from-token::
2308     $token => $token,
2309     $result => $location,
2310     }__;
2311     my $continue = __DOMCore:ERROR{xp|wf-no-lt-in-attribute-values::
2312     c|location => {$location},
2313     xp|token => {$token},
2314     }__;
2315     unless ($continue) {
2316 wakaba 1.27 __CODE{ParseError}__;
2317 wakaba 1.18 }
2318    
2319     my $text = $self->{doc}-><M::Document.createTextNode> ('<');
2320     $parent-><M::Node.appendChild> ($text);
2321     $vals->{value} .= '<';
2322     }
2323 wakaba 1.11 }
2324    
2325     // ~ (#EOF) { }
2326     } // AttributeValueLiteralE_
2327    
2328     /*
2329 wakaba 1.1 CDATA Section Content Parsing Mode
2330     */
2331     rule _CDATASection_ ($doc, $parent) {
2332     ?lexmode 'CDATASectionContent';
2333    
2334     my $cdata;
2335    
2336 wakaba 1.2 ~? (CData) {
2337 wakaba 1.1 lang:Perl ($data => $token.value) {
2338     $cdata = $data;
2339     }
2340     } else {
2341     lang:Perl {
2342     $cdata = '';
2343     }
2344     }
2345    
2346     lang:Perl {
2347     my $cdsect = $doc-><M::Document.createCDATASection>
2348     ($cdata);
2349     $parent-><M::Node.appendChild> ($cdsect);
2350     }
2351    
2352     // ~ (MSE) { }
2353     } // _CDATASection_
2354    
2355     rule _NumericCharacterReference_ ($doc, $parent) {
2356     ?lexmode 'NumericCharacterReference';
2357    
2358     ~ (NUMBER) {
2359 wakaba 1.3 lang:Perl ($num => $token.value) : has-error {
2360     $num += 0;
2361     unless (
2362     ($self->{xml_version} eq '1.0' and
2363     ((0x0020 <= $num and $num <= 0xD7FF) or
2364     (0xE000 <= $num and $num <= 0xFFFD) or
2365     (0x10000 <= $num and $num <= 0x10FFFF) or
2366     $num == 0x9 or $num == 0xA or $num == 0xD)) or
2367     ($self->{xml_version} eq '1.1' and
2368     ((0x0001 <= $num and $num <= 0xD7FF) or
2369     (0xE000 <= $num and $num <= 0xFFFD) or
2370     (0x10000 <= $num and $num <= 0x10FFFF)))
2371     ) {
2372     my $location;
2373     __CODE{xp|get-location-from-token::
2374     $token => $token,
2375     $result => $location,
2376     }__;
2377     my $continue = __DOMCore:ERROR{xp|wf-legal-character::
2378     DOMCore:location => {$location},
2379     xp|token => {$token},
2380     xp|character-number => {$num},
2381     xp|parent => {$parent},
2382     }__;
2383     unless ($continue) {
2384 wakaba 1.27 __CODE{ParseError}__;
2385 wakaba 1.3 }
2386     }
2387     my $ncr = $doc-><M::Document.createTextNode> (chr $num);
2388 wakaba 1.1 $parent-><M::Node.appendChild> ($ncr);
2389     }
2390     }
2391    
2392     // ~ (REFC) { }
2393     } // _NumericCharacterReference_
2394    
2395     rule _NumericCharacterReferenceV_ ($doc, $vals) {
2396     ?lexmode 'NumericCharacterReference';
2397    
2398     ~ (NUMBER) {
2399 wakaba 1.3 lang:Perl ($num => $token.value) : has-error {
2400     $num += 0;
2401     unless (
2402     ($self->{xml_version} eq '1.0' and
2403     ((0x0020 <= $num and $num <= 0xD7FF) or
2404     (0xE000 <= $num and $num <= 0xFFFD) or
2405     (0x10000 <= $num and $num <= 0x10FFFF) or
2406     $num == 0x9 or $num == 0xA or $num == 0xD)) or
2407     ($self->{xml_version} eq '1.1' and
2408     ((0x0001 <= $num and $num <= 0xD7FF) or
2409     (0xE000 <= $num and $num <= 0xFFFD) or
2410     (0x10000 <= $num and $num <= 0x10FFFF)))
2411     ) {
2412     my $location;
2413     __CODE{xp|get-location-from-token::
2414     $token => $token,
2415     $result => $location,
2416     }__;
2417     my $continue = __DOMCore:ERROR{xp|wf-legal-character::
2418     DOMCore:location => {$location},
2419     xp|token => {$token},
2420     xp|character-number => {$num},
2421     }__;
2422     unless ($continue) {
2423 wakaba 1.27 __CODE{ParseError}__;
2424 wakaba 1.3 }
2425     }
2426 wakaba 1.1 my $ncr = $doc-><M::Document.createTextNode>
2427 wakaba 1.9 (my $char = chr $num);
2428 wakaba 1.1 push @{$vals->{nodes}}, $ncr;
2429     $vals->{value} .= $char;
2430     }
2431     }
2432    
2433     // ~ (REFC) { }
2434     } // _NumericCharacterReferenceV_
2435    
2436 wakaba 1.11 /*
2437     Numeric character reference in the replacement text
2438     of the entity referenced in an attribute value specification
2439     */
2440     rule _NumericCharacterReferenceAE_ ($parent, $vals)
2441     {
2442     ?lexmode NumericCharacterReference;
2443    
2444     ~ (NUMBER) {
2445     lang:Perl ($num => $token.value) : has-error {
2446     $num += 0;
2447     unless (
2448     ($self->{xml_version} eq '1.0' and
2449     ((0x0020 <= $num and $num <= 0xD7FF) or
2450     (0xE000 <= $num and $num <= 0xFFFD) or
2451     (0x10000 <= $num and $num <= 0x10FFFF) or
2452     $num == 0x9 or $num == 0xA or $num == 0xD)) or
2453     ($self->{xml_version} eq '1.1' and
2454     ((0x0001 <= $num and $num <= 0xD7FF) or
2455     (0xE000 <= $num and $num <= 0xFFFD) or
2456     (0x10000 <= $num and $num <= 0x10FFFF)))
2457     ) {
2458     my $location;
2459     __CODE{xp|get-location-from-token::
2460     $token => $token,
2461     $result => $location,
2462     }__;
2463     my $continue = __DOMCore:ERROR{xp|wf-legal-character::
2464     DOMCore:location => {$location},
2465     xp|token => {$token},
2466     xp|character-number => {$num},
2467     }__;
2468     unless ($continue) {
2469 wakaba 1.27 __CODE{ParseError}__;
2470 wakaba 1.11 }
2471     }
2472     my $ncr = $self->{doc}-><M::Document.createTextNode>
2473     (my $char = chr $num);
2474     $parent-><M::Node.appendChild> ($ncr);
2475     $vals->{value} .= $char;
2476     }
2477     }
2478    
2479     // ~ (REFC) { }
2480     } // _NumericCharacterReferenceAE_
2481    
2482     rule _NumericCharacterReferenceEV_ ($vals)
2483     {
2484     ?lexmode 'NumericCharacterReference';
2485    
2486     ~ (NUMBER) {
2487     lang:Perl ($num => $token.value) : has-error {
2488     $num += 0;
2489     unless (
2490     ($self->{xml_version} eq '1.0' and
2491     ((0x0020 <= $num and $num <= 0xD7FF) or
2492     (0xE000 <= $num and $num <= 0xFFFD) or
2493     (0x10000 <= $num and $num <= 0x10FFFF) or
2494     $num == 0x9 or $num == 0xA or $num == 0xD)) or
2495     ($self->{xml_version} eq '1.1' and
2496     ((0x0001 <= $num and $num <= 0xD7FF) or
2497     (0xE000 <= $num and $num <= 0xFFFD) or
2498     (0x10000 <= $num and $num <= 0x10FFFF)))
2499     ) {
2500     my $location;
2501     __CODE{xp|get-location-from-token::
2502     $token => $token,
2503     $result => $location,
2504     }__;
2505     my $continue = __DOMCore:ERROR{xp|wf-legal-character::
2506     DOMCore:location => {$location},
2507     xp|token => {$token},
2508     xp|character-number => {$num},
2509     }__;
2510     unless ($continue) {
2511 wakaba 1.27 __CODE{ParseError}__;
2512 wakaba 1.11 }
2513     }
2514     push @{$vals}, chr $num;
2515     }
2516     }
2517    
2518     // ~ (REFC) { }
2519     } // _NumericCharacterReferenceEV_
2520    
2521 wakaba 1.1 rule _HexadecimalCharacterReference_ ($doc, $parent) {
2522     ?lexmode 'HexadecimalCharacterReference';
2523    
2524     ~ (Hex) {
2525 wakaba 1.9 lang:Perl ($v => $token.value) : has-error {
2526     my $num = hex $v;
2527 wakaba 1.3 unless (
2528     ($self->{xml_version} eq '1.0' and
2529     ((0x0020 <= $num and $num <= 0xD7FF) or
2530     (0xE000 <= $num and $num <= 0xFFFD) or
2531     (0x10000 <= $num and $num <= 0x10FFFF) or
2532     $num == 0x9 or $num == 0xA or $num == 0xD)) or
2533     ($self->{xml_version} eq '1.1' and
2534     ((0x0001 <= $num and $num <= 0xD7FF) or
2535     (0xE000 <= $num and $num <= 0xFFFD) or
2536     (0x10000 <= $num and $num <= 0x10FFFF)))
2537     ) {
2538     my $location;
2539     __CODE{xp|get-location-from-token::
2540     $token => $token,
2541     $result => $location,
2542     }__;
2543     my $continue = __DOMCore:ERROR{xp|wf-legal-character::
2544     DOMCore:location => {$location},
2545     xp|token => {$token},
2546     xp|character-number => {$num},
2547     xp|parent => {$parent},
2548     }__;
2549     unless ($continue) {
2550 wakaba 1.27 __CODE{ParseError}__;
2551 wakaba 1.3 }
2552     }
2553 wakaba 1.1 my $ncr = $doc-><M::Document.createTextNode>
2554 wakaba 1.9 (chr $num);
2555 wakaba 1.1 $parent-><M::Node.appendChild> ($ncr);
2556     }
2557     }
2558    
2559     // ~ (REFC) { }
2560     } // _HexadecimalCharacterReference_
2561    
2562 wakaba 1.3 rule _HexadecimalCharacterReferenceV_ ($doc, $vals) {
2563 wakaba 1.1 ?lexmode 'HexadecimalCharacterReference';
2564    
2565     ~ (Hex) {
2566 wakaba 1.9 lang:Perl ($v => $token.value) : has-error {
2567     my $num = hex $v;
2568 wakaba 1.3 unless (
2569     ($self->{xml_version} eq '1.0' and
2570     ((0x0020 <= $num and $num <= 0xD7FF) or
2571     (0xE000 <= $num and $num <= 0xFFFD) or
2572     (0x10000 <= $num and $num <= 0x10FFFF) or
2573     $num == 0x9 or $num == 0xA or $num == 0xD)) or
2574     ($self->{xml_version} eq '1.1' and
2575     ((0x0001 <= $num and $num <= 0xD7FF) or
2576     (0xE000 <= $num and $num <= 0xFFFD) or
2577     (0x10000 <= $num and $num <= 0x10FFFF)))
2578     ) {
2579     my $location;
2580     __CODE{xp|get-location-from-token::
2581     $token => $token,
2582     $result => $location,
2583     }__;
2584     my $continue = __DOMCore:ERROR{xp|wf-legal-character::
2585     DOMCore:location => {$location},
2586     xp|token => {$token},
2587     xp|character-number => {$num},
2588     }__;
2589     unless ($continue) {
2590 wakaba 1.27 __CODE{ParseError}__;
2591 wakaba 1.3 }
2592     }
2593 wakaba 1.1 my $ncr = $doc-><M::Document.createTextNode>
2594 wakaba 1.9 (my $char = chr $num);
2595 wakaba 1.1 push @{$vals->{nodes}}, $ncr;
2596     $vals->{value} .= $char;
2597     }
2598     }
2599    
2600     // ~ (REFC) { }
2601 wakaba 1.11 } // _HexadecimalCharacterReferenceV_
2602    
2603     /*
2604     Hexadecimal character reference in the replacement text
2605     of the entity referenced in an attribute value literal
2606     */
2607     rule _HexadecimalCharacterReferenceAE_ ($parent, $vals)
2608     {
2609     ?lexmode HexadecimalCharacterReference;
2610    
2611     ~ (Hex) {
2612     lang:Perl ($v => $token.value) : has-error {
2613     my $num = hex $v;
2614     unless (
2615     ($self->{xml_version} eq '1.0' and
2616     ((0x0020 <= $num and $num <= 0xD7FF) or
2617     (0xE000 <= $num and $num <= 0xFFFD) or
2618     (0x10000 <= $num and $num <= 0x10FFFF) or
2619     $num == 0x9 or $num == 0xA or $num == 0xD)) or
2620     ($self->{xml_version} eq '1.1' and
2621     ((0x0001 <= $num and $num <= 0xD7FF) or
2622     (0xE000 <= $num and $num <= 0xFFFD) or
2623     (0x10000 <= $num and $num <= 0x10FFFF)))
2624     ) {
2625     my $location;
2626     __CODE{xp|get-location-from-token::
2627     $token => $token,
2628     $result => $location,
2629     }__;
2630     my $continue = __DOMCore:ERROR{xp|wf-legal-character::
2631     DOMCore:location => {$location},
2632     xp|token => {$token},
2633     xp|character-number => {$num},
2634     }__;
2635     unless ($continue) {
2636 wakaba 1.27 __CODE{ParseError}__;
2637 wakaba 1.11 }
2638     }
2639     my $ncr = $self->{doc}-><M::Document.createTextNode>
2640     (my $char = chr $num);
2641     $parent-><M::Node.appendChild> ($ncr);
2642     $vals->{value} .= $char;
2643     }
2644     }
2645    
2646     // ~ (REFC) { }
2647     } // _HexadecimalCharacterReferenceAE_
2648    
2649     rule _HexadecimalCharacterReferenceEV_ ($vals) {
2650     ?lexmode HexadecimalCharacterReference;
2651    
2652     ~ (Hex) {
2653     lang:Perl ($v => $token.value) : has-error {
2654     my $num = hex $v;
2655     unless (
2656     ($self->{xml_version} eq '1.0' and
2657     ((0x0020 <= $num and $num <= 0xD7FF) or
2658     (0xE000 <= $num and $num <= 0xFFFD) or
2659     (0x10000 <= $num and $num <= 0x10FFFF) or
2660     $num == 0x9 or $num == 0xA or $num == 0xD)) or
2661     ($self->{xml_version} eq '1.1' and
2662     ((0x0001 <= $num and $num <= 0xD7FF) or
2663     (0xE000 <= $num and $num <= 0xFFFD) or
2664     (0x10000 <= $num and $num <= 0x10FFFF)))
2665     ) {
2666     my $location;
2667     __CODE{xp|get-location-from-token::
2668     $token => $token,
2669     $result => $location,
2670     }__;
2671     my $continue = __DOMCore:ERROR{xp|wf-legal-character::
2672     DOMCore:location => {$location},
2673     xp|token => {$token},
2674     xp|character-number => {$num},
2675     }__;
2676     unless ($continue) {
2677 wakaba 1.27 __CODE{ParseError}__;
2678 wakaba 1.11 }
2679     }
2680     push @{$vals}, chr $num;
2681     }
2682     }
2683    
2684     // ~ (REFC) { }
2685     } // _HexadecimalCharacterReferenceEV_
2686    
2687     /*
2688     General entity reference in element's content
2689     */
2690     rule _GeneralEntityReferenceEC ($doc, $parent, $ns)
2691     : recursive
2692     {
2693     ?lexmode 'EntityReference';
2694    
2695     ~ (Name == 'lt') {
2696     lang:Perl {
2697     $parent-><M::Node.appendChild>
2698     ($self->{doc}-><M::Document.createTextNode> ('<'));
2699     }
2700     } (Name == 'gt') {
2701     lang:Perl {
2702     $parent-><M::Node.appendChild>
2703     ($self->{doc}-><M::Document.createTextNode> ('>'));
2704     }
2705     } (Name == 'amp') {
2706     lang:Perl {
2707     $parent-><M::Node.appendChild>
2708     ($self->{doc}-><M::Document.createTextNode> ('&'));
2709     }
2710     } (Name == 'quot') {
2711     lang:Perl {
2712     $parent-><M::Node.appendChild>
2713     ($self->{doc}-><M::Document.createTextNode> ('"'));
2714     }
2715     } (Name == 'apos') {
2716     lang:Perl {
2717     $parent-><M::Node.appendChild>
2718     ($self->{doc}-><M::Document.createTextNode> ("'"));
2719     }
2720     } (Name) {
2721     my $er;
2722 wakaba 1.19 lang:Perl ($name => $token.value) : has-error {
2723 wakaba 1.26 __CODE{checkNCName:: $name => $name}__;
2724    
2725 wakaba 1.11 $er = $doc-><M::Document.createEntityReference>
2726     ($name);
2727 wakaba 1.20 $er-><AS::Node.textContent> ('');
2728     ## NOTE: When document entity (and entities referenced directly
2729     ## or indirectly from it) is parsed, no general entity
2730     ## node have its replacement tree. During general
2731     ## entity node collection construction, however,
2732     ## some entity node has replacement tree.
2733 wakaba 1.11 $parent-><M::Node.appendChild> ($er);
2734 wakaba 1.19
2735     my $ent = $self->{general_entity}->{$name};
2736     if (not $ent) { # no entity declaration
2737     if ($self->{standalone} or not $self->{has_xref}) { # WFC error
2738     my $location;
2739     __CODE{xp|get-location-from-token::
2740     $token => {$token},
2741     $result => {$location},
2742     }__;
2743     my $continue = __DOMCore:ERROR{xp|wf-entity-declared::
2744     xp|error-token => {$token},
2745     c|location => {$location},
2746     xp|name => {$name},
2747     }__;
2748     unless ($continue) {
2749 wakaba 1.27 __CODE{ParseError}__;
2750 wakaba 1.19 }
2751     } # Otherwise VC error
2752 wakaba 1.23 push @{$self->{entity}}, <Code::getEmptyEntityState::
2753     $name = $name>;
2754 wakaba 1.20 $er-><AS::x|EntityReference.isExpanded> (false);
2755 wakaba 1.19
2756     } else { # there IS entity declaration
2757     if (($self->{standalone} or not $self->{has_xref}) and
2758     $ent->{is_externally_declared} and
2759     not $self->{entity}->[-1]->{is_externally_declared}) {
2760     my $location;
2761     __CODE{xp|get-location-from-token::
2762     $token => {$token},
2763     $result => {$location},
2764     }__;
2765     my $continue = __DOMCore:ERROR{xp|wf-entity-declared::
2766     xp|error-token => {$token},
2767     c|location => {$location},
2768     xp|name => {$name},
2769     }__;
2770     unless ($continue) {
2771 wakaba 1.27 __CODE{ParseError}__;
2772 wakaba 1.19 }
2773     }
2774     $er-><AS::x|EntityReference.isExpanded>
2775     ($ent->{has_replacement_text});
2776     push @{$self->{entity}}, <Code::getCopyOfEntityState::
2777 wakaba 1.11 $entity_type = 'general_entity',
2778     $entity_name = $name>;
2779 wakaba 1.23
2780     if (defined $ent->{notation}) {
2781     my $location;
2782     __CODE{xp|get-location-from-token::
2783     $token => {$token},
2784     $result => {$location},
2785     }__;
2786     my $continue = __c|ERROR{xp|wf-parsed-entity::
2787     xp|error-token => {$token},
2788     c|location => {$location},
2789     xp|name => {$name},
2790     }__;
2791     unless ($continue) {
2792 wakaba 1.27 __CODE{ParseError}__;
2793 wakaba 1.23 }
2794     } # if unparsed entity
2795    
2796     if ($ent->{is_opened}) {
2797     my $location;
2798     __CODE{xp|get-location-from-token::
2799     $token => {$token},
2800     $result => {$location},
2801     }__;
2802     my $continue = __c|ERROR{xp|wf-no-recursion::
2803     xp|error-token => {$token},
2804     c|location => {$location},
2805     xp|name => {$name},
2806     }__;
2807     unless ($continue) {
2808 wakaba 1.27 __CODE{ParseError}__;
2809 wakaba 1.23 }
2810 wakaba 1.27 open my $empty, '<', \'';
2811     $self->{entity}->[-1]->{fh} = $empty;
2812 wakaba 1.23 $er-><AS::x|EntityReference.isExpanded> (false);
2813     } # recursive
2814     $ent->{is_opened} = true;
2815     } # entity declared
2816 wakaba 1.14 $self->{location} = $self->{entity}->[-1];
2817 wakaba 1.11 push @{$self->{entity_token}}, $self->{token};
2818     $self->{token} = [];
2819     push @{$self->{entity_char}}, $self->{char};
2820     $self->{char} = [];
2821     }
2822    
2823     ?lexmode ElementContent;
2824     &content ($doc => $doc, $parent => $er, $ns => $ns);
2825     ~ (#EOF) { }
2826     lang:Perl {
2827 wakaba 1.23 $self->{general_entity}->{$self->{entity}->[-1]->{name}}
2828     ->{is_opened} = false
2829     if $self->{general_entity}->{$self->{entity}->[-1]->{name}};
2830 wakaba 1.11 $self->{token} = pop @{$self->{entity_token}};
2831     $self->{char} = pop @{$self->{entity_char}};
2832 wakaba 1.27 pop (@{$self->{entity}})->{close_file}->();
2833 wakaba 1.14 $self->{location} = $self->{entity}->[-1];
2834 wakaba 1.11 }
2835    
2836     // TODO: Set read-only flag
2837    
2838     ?lexmode EntityReference;
2839     ?requires-next-token;
2840     }
2841    
2842     ~ (REFC) {
2843     ?lexmode ElementContent;
2844     } else {
2845     ?lexmode ElementContent;
2846     }
2847     } // _GeneralEntityReferenceEC
2848    
2849     /*
2850     General entity reference in an attribute value literal
2851     */
2852     rule _GeneralEntityReferenceV_ ($vals) {
2853     ?lexmode EntityReference;
2854    
2855     ~ (Name == 'lt') {
2856     lang:Perl {
2857     push @{$vals->{nodes}}, $self->{doc}-><M::Document.createTextNode>
2858     ('<');
2859     $vals->{value} .= '<';
2860     }
2861     } (Name == 'gt') {
2862     lang:Perl {
2863     push @{$vals->{nodes}}, $self->{doc}-><M::Document.createTextNode>
2864     ('>');
2865     $vals->{value} .= '>';
2866     }
2867     } (Name == 'amp') {
2868     lang:Perl {
2869     push @{$vals->{nodes}}, $self->{doc}-><M::Document.createTextNode>
2870     ('&');
2871     $vals->{value} .= '&';
2872     }
2873     } (Name == 'quot') {
2874     lang:Perl {
2875     push @{$vals->{nodes}}, $self->{doc}-><M::Document.createTextNode>
2876     ('"');
2877     $vals->{value} .= '"';
2878     }
2879     } (Name == 'apos') {
2880     lang:Perl {
2881     push @{$vals->{nodes}}, $self->{doc}-><M::Document.createTextNode>
2882     ("'");
2883     $vals->{value} .= "'";
2884     }
2885     } (Name) {
2886     my $er;
2887 wakaba 1.18 lang:Perl ($name => $token.value) : has-error {
2888 wakaba 1.26 __CODE{checkNCName:: $name => $name}__;
2889 wakaba 1.18
2890 wakaba 1.11 $er = $self->{doc}-><M::Document.createEntityReference> ($name);
2891 wakaba 1.20 $er-><AS::Node.textContent> ('');
2892     ## NOTE: When document entity (and entities referenced directly
2893     ## or indirectly from it) is parsed, no general entity
2894     ## node have its replacement tree. During general
2895     ## entity node collection construction, however,
2896     ## some entity node has replacement tree.
2897 wakaba 1.19 my $ent = $self->{general_entity}->{$name};
2898 wakaba 1.20 if (not $ent) { # no entity declaration
2899     if ($self->{standalone} or not $self->{has_xref}) { # WFC error
2900     my $location;
2901     __CODE{xp|get-location-from-token::
2902     $token => {$token},
2903     $result => {$location},
2904     }__;
2905     my $continue = __DOMCore:ERROR{xp|wf-entity-declared::
2906     xp|error-token => {$token},
2907     c|location => {$location},
2908     xp|name => {$name},
2909     }__;
2910     unless ($continue) {
2911 wakaba 1.27 __CODE{ParseError}__;
2912 wakaba 1.20 }
2913     } # Otherwise VC error
2914 wakaba 1.23 push @{$self->{entity}}, <Code::getEmptyEntityState::
2915     $name = $name>;
2916 wakaba 1.20 $er-><AS::x|EntityReference.isExpanded> (false);
2917    
2918     } else { # there IS entity declaration
2919     if (($self->{standalone} or not $self->{has_xref}) and
2920     $ent->{is_externally_declared} and
2921     not $self->{entity}->[-1]->{is_externally_declared}) {
2922     my $location;
2923     __CODE{xp|get-location-from-token::
2924     $token => {$token},
2925     $result => {$location},
2926     }__;
2927     my $continue = __DOMCore:ERROR{xp|wf-entity-declared::
2928     xp|error-token => {$token},
2929     c|location => {$location},
2930     xp|name => {$name},
2931     }__;
2932     unless ($continue) {
2933 wakaba 1.27 __CODE{ParseError}__;
2934 wakaba 1.20 }
2935     }
2936    
2937     if ($ent->{is_external_entity}) {
2938     my $location;
2939     __CODE{xp|get-location-from-token::
2940     $token => {$token},
2941     $result => {$location},
2942     }__;
2943     my $continue = __c|ERROR{xp|wf-no-external-entity-references::
2944     xp|error-token => {$token},
2945     c|location => {$location},
2946     xp|name => {$name},
2947     }__;
2948     unless ($continue) {
2949 wakaba 1.27 __CODE{ParseError}__;
2950 wakaba 1.20 }
2951 wakaba 1.23 ## NOTE: |xp:wf-parsed-entity| is not checked
2952 wakaba 1.20 } # if external entity
2953    
2954     $er-><AS::x|EntityReference.isExpanded>
2955 wakaba 1.19 ($ent->{has_replacement_text});
2956 wakaba 1.20 push @{$self->{entity}}, <Code::getCopyOfEntityState::
2957 wakaba 1.11 $entity_type = 'general_entity',
2958     $entity_name = $name>;
2959 wakaba 1.23
2960     if ($ent->{is_opened}) {
2961     my $location;
2962     __CODE{xp|get-location-from-token::
2963     $token => {$token},
2964     $result => {$location},
2965     }__;
2966     my $continue = __c|ERROR{xp|wf-no-recursion::
2967     xp|error-token => {$token},
2968     c|location => {$location},
2969     xp|name => {$name},
2970     }__;
2971     unless ($continue) {
2972 wakaba 1.27 __CODE{ParseError}__;
2973 wakaba 1.23 }
2974 wakaba 1.27 open my $empty, '<', \'';
2975     $self->{entity}->[-1]->{fh} = $empty;
2976 wakaba 1.23 $er-><AS::x|EntityReference.isExpanded> (false);
2977     } # recursive
2978     $ent->{is_opened} = true;
2979 wakaba 1.20 }
2980     push @{$vals->{nodes}}, $er;
2981 wakaba 1.14 $self->{location} = $self->{entity}->[-1];
2982 wakaba 1.11 push @{$self->{entity_token}}, $self->{token};
2983     $self->{token} = [];
2984     push @{$self->{entity_char}}, $self->{char};
2985     $self->{char} = [];
2986     }
2987    
2988     ?lexmode AttributeValueLiteralE;
2989     &AttributeValueLiteralE_ ($parent => $er, $vals => $vals);
2990     ~ (#EOF) { }
2991     lang:Perl {
2992 wakaba 1.23 $self->{general_entity}->{$self->{entity}->[-1]->{name}}
2993     ->{is_opened} = false
2994     if $self->{general_entity}->{$self->{entity}->[-1]->{name}};
2995 wakaba 1.11 $self->{token} = pop @{$self->{entity_token}};
2996     $self->{char} = pop @{$self->{entity_char}};
2997 wakaba 1.27 pop (@{$self->{entity}})->{close_file}->();
2998 wakaba 1.14 $self->{location} = $self->{entity}->[-1];
2999 wakaba 1.11 }
3000    
3001     // TODO: Set read-only flag
3002    
3003     ?lexmode EntityReference;
3004     ?requires-next-token;
3005     }
3006    
3007     // ~ (REFC) { }
3008     } // _GeneralEntityReferenceV_
3009 wakaba 1.1
3010 wakaba 1.6 /*
3011 wakaba 1.11 General entity reference in the replacement text
3012     of the entity referenced in an attribute value literal
3013 wakaba 1.6 */
3014 wakaba 1.11 rule _GeneralEntityReferenceAE_ ($parent, $vals)
3015 wakaba 1.6 {
3016 wakaba 1.11 ?lexmode EntityReference;
3017 wakaba 1.1
3018 wakaba 1.11 ~ (Name == 'lt') {
3019     lang:Perl {
3020     $parent-><M::Node.appendChild>
3021     ($self->{doc}-><M::Document.createTextNode> ('<'));
3022     $vals->{value} .= '<';
3023     }
3024     } (Name == 'gt') {
3025     lang:Perl {
3026     $parent-><M::Node.appendChild>
3027     ($self->{doc}-><M::Document.createTextNode> ('>'));
3028     $vals->{value} .= '>';
3029     }
3030     } (Name == 'amp') {
3031     lang:Perl {
3032     $parent-><M::Node.appendChild>
3033     ($self->{doc}-><M::Document.createTextNode> ('&'));
3034     $vals->{value} .= '&';
3035     }
3036     } (Name == 'quot') {
3037     lang:Perl {
3038     $parent-><M::Node.appendChild>
3039     ($self->{doc}-><M::Document.createTextNode> ('"'));
3040     $vals->{value} .= '"';
3041     }
3042     } (Name == 'apos') {
3043     lang:Perl {
3044     $parent-><M::Node.appendChild>
3045     ($self->{doc}-><M::Document.createTextNode> ("'"));
3046     $vals->{value} .= "'";
3047     }
3048     } (Name) {
3049 wakaba 1.6 my $er;
3050 wakaba 1.26 lang:Perl ($name => $token.value) : has-error {
3051     __CODE{checkNCName:: $name => $name}__;
3052 wakaba 1.18
3053 wakaba 1.11 $er = $self->{doc}-><M::Document.createEntityReference> ($name);
3054 wakaba 1.20 $er-><AS::Node.textContent> ('');
3055     ## NOTE: When document entity (and entities referenced directly
3056     ## or indirectly from it) is parsed, no general entity
3057     ## node have its replacement tree. During general
3058     ## entity node collection construction, however,
3059     ## some entity node has replacement tree.
3060 wakaba 1.19 my $ent = $self->{general_entity}->{$name};
3061 wakaba 1.22 if (not $ent) { # no entity declaration
3062     if ($self->{standalone} or not $self->{has_xref}) { # WFC error
3063     my $location;
3064     __CODE{xp|get-location-from-token::
3065     $token => {$token},
3066     $result => {$location},
3067     }__;
3068     my $continue = __DOMCore:ERROR{xp|wf-entity-declared::
3069     xp|error-token => {$token},
3070     c|location => {$location},
3071     xp|name => {$name},
3072     }__;
3073     unless ($continue) {
3074 wakaba 1.27 __CODE{ParseError}__;
3075 wakaba 1.22 }
3076     } # Otherwise VC error
3077 wakaba 1.23 push @{$self->{entity}}, <Code::getEmptyEntityState::
3078     $name = $name>;
3079 wakaba 1.22 $er-><AS::x|EntityReference.isExpanded> (false);
3080    
3081     } else { # there IS entity declaration
3082     if (($self->{standalone} or not $self->{has_xref}) and
3083     $ent->{is_externally_declared} and
3084     not $self->{entity}->[-1]->{is_externally_declared}) {
3085     my $location;
3086     __CODE{xp|get-location-from-token::
3087     $token => {$token},
3088     $result => {$location},
3089     }__;
3090     my $continue = __DOMCore:ERROR{xp|wf-entity-declared::
3091     xp|error-token => {$token},
3092     c|location => {$location},
3093     xp|name => {$name},
3094     }__;
3095     unless ($continue) {
3096 wakaba 1.27 __CODE{ParseError}__;
3097 wakaba 1.22 }
3098     }
3099    
3100     if ($ent->{is_external_entity}) {
3101     my $location;
3102     __CODE{xp|get-location-from-token::
3103     $token => {$token},
3104     $result => {$location},
3105     }__;
3106     my $continue = __c|ERROR{xp|wf-no-external-entity-references::
3107     xp|error-token => {$token},
3108     c|location => {$location},
3109     xp|name => {$name},
3110     }__;
3111     unless ($continue) {
3112 wakaba 1.27 __CODE{ParseError}__;
3113 wakaba 1.22 }
3114 wakaba 1.23 ## NOTE: |xp:wf-parsed-entity| is not checked
3115 wakaba 1.22 } # if external entity
3116    
3117     $er-><AS::x|EntityReference.isExpanded>
3118 wakaba 1.19 ($ent->{has_replacement_text});
3119 wakaba 1.22 push @{$self->{entity}}, <Code::getCopyOfEntityState::
3120 wakaba 1.6 $entity_type = 'general_entity',
3121     $entity_name = $name>;
3122 wakaba 1.23
3123     if ($ent->{is_opened}) {
3124     my $location;
3125     __CODE{xp|get-location-from-token::
3126     $token => {$token},
3127     $result => {$location},
3128     }__;
3129     my $continue = __c|ERROR{xp|wf-no-recursion::
3130     xp|error-token => {$token},
3131     c|location => {$location},
3132     xp|name => {$name},
3133     }__;
3134     unless ($continue) {
3135 wakaba 1.27 __CODE{ParseError}__;
3136 wakaba 1.23 }
3137 wakaba 1.27 open my $empty, '<', \'';
3138     $self->{entity}->[-1]->{fh} = $empty;
3139 wakaba 1.23 $er-><AS::x|EntityReference.isExpanded> (false);
3140     } # recursive
3141     $ent->{is_opened} = true;
3142 wakaba 1.22 }
3143     $parent-><M::Node.appendChild> ($er);
3144 wakaba 1.14 $self->{location} = $self->{entity}->[-1];
3145 wakaba 1.6 push @{$self->{entity_token}}, $self->{token};
3146     $self->{token} = [];
3147     push @{$self->{entity_char}}, $self->{char};
3148     $self->{char} = [];
3149     }
3150    
3151 wakaba 1.11 ?lexmode AttributeValueLiteralE;
3152     &AttributeValueLiteralE_ ($parent => $er, $vals => $vals);
3153 wakaba 1.6 ~ (#EOF) { }
3154     lang:Perl {
3155 wakaba 1.23 $self->{general_entity}->{$self->{entity}->[-1]->{name}}
3156     ->{is_opened} = false
3157     if $self->{general_entity}->{$self->{entity}->[-1]->{name}};
3158 wakaba 1.6 $self->{token} = pop @{$self->{entity_token}};
3159     $self->{char} = pop @{$self->{entity_char}};
3160 wakaba 1.27 pop (@{$self->{entity}})->{close_file}->();
3161 wakaba 1.14 $self->{location} = $self->{entity}->[-1];
3162 wakaba 1.6 }
3163    
3164 wakaba 1.11 // TODO: Set read-only flag
3165    
3166 wakaba 1.6 ?lexmode EntityReference;
3167     ?requires-next-token;
3168 wakaba 1.1 }
3169    
3170     // ~ (REFC) { }
3171 wakaba 1.11 } // _GeneralEntityReferenceAE_
3172 wakaba 1.6
3173     /*
3174 wakaba 1.24 General Entity Reference in Literal Entity Value in Entity Declaration
3175 wakaba 1.6 */
3176 wakaba 1.11 rule _GeneralEntityReferenceEV_ ($vals) {
3177 wakaba 1.6 ?lexmode 'EntityReference';
3178    
3179     ~ (Name) {
3180     lang:Perl ($name => $token.value) {
3181 wakaba 1.26 __CODE{checkNCName:: $name => $name}__;
3182 wakaba 1.6 push @$vals, $name;
3183     }
3184 wakaba 1.24 /*
3185     WFCs such as Entity Declared are not checked
3186     <http://www.w3.org/TR/xml11/#bypass>
3187    
3188     Note that violation to the Parsed Entity WFC is an error
3189     rather than fatal error here.
3190     */
3191 wakaba 1.6 }
3192 wakaba 1.11
3193     // No expansion
3194 wakaba 1.6
3195     // ~ (REFC) { }
3196     } // _GeneralEntityReferenceEV_
3197 wakaba 1.1
3198     /*
3199 wakaba 1.4 Document Type Declaration
3200 wakaba 1.1 */
3201 wakaba 1.4 rule _DocumentTypeDeclaration_ ($doc) {
3202     ?lexmode MarkupDeclaration;
3203    
3204     ~ (Name == 'DOCTYPE') { }
3205    
3206     ~ (S) { }
3207    
3208     // Document type name
3209 wakaba 1.6 my $name;
3210 wakaba 1.4 ~ (Name) {
3211 wakaba 1.6 lang:Perl ($v => $token.value) {
3212 wakaba 1.26 __CODE{checkQName:: $name => $v}__;
3213 wakaba 1.6 $name = $v;
3214     }
3215     }
3216 wakaba 1.17
3217     my $node;
3218     my $decl;
3219 wakaba 1.6 lang:Perl {
3220 wakaba 1.11 $self->{docx} = $self->{doc}
3221     -><M::Node.getFeature> (<Q::fe:XDoctype>, '3.0');
3222     $node = $self->{docx}-><M::DocumentXDoctype.createDocumentTypeDefinition>
3223     ($name);
3224 wakaba 1.17 $decl = $self->{dtdecl} = $node-><M::Node.getFeature>
3225     (<Q::fe:XDoctypeDeclaration>, '3.0');
3226 wakaba 1.4 }
3227    
3228 wakaba 1.25 my $has_extid;
3229 wakaba 1.4 ~? (S) {
3230     ~? (Name == 'PUBLIC') {
3231     ~ (S) { }
3232    
3233 wakaba 1.17 &PubidLiteral ($decl => $decl);
3234 wakaba 1.4
3235     ~ (S) { }
3236    
3237 wakaba 1.17 &SystemLiteral ($decl => $decl);
3238 wakaba 1.4
3239     ~? (S) { }
3240 wakaba 1.19
3241     lang:Perl {
3242     $self->{has_xref} = true;
3243 wakaba 1.25 $has_extid = true;
3244 wakaba 1.19 }
3245 wakaba 1.4 } (Name == 'SYSTEM') {
3246     ~ (S) { }
3247    
3248 wakaba 1.17 &SystemLiteral ($decl => $decl);
3249 wakaba 1.4
3250     ~? (S) { }
3251 wakaba 1.19
3252     lang:Perl {
3253     $self->{has_xref} = true;
3254 wakaba 1.25 $has_extid = true;
3255 wakaba 1.19 }
3256 wakaba 1.4 }
3257     }
3258 wakaba 1.17
3259 wakaba 1.11 lang:Perl {
3260     $self->{dtdef} = $node;
3261 wakaba 1.21 $self->{doc}-><M::Node.appendChild> ($node);
3262     $self->{doc_cfg}-><M::c|DOMConfiguration.setParameter>
3263     ('schema-type' => <Q::xml-dtd:>);
3264     ## ISSUE: Should default schema language information be
3265     ## preserved by some other flag?
3266 wakaba 1.11 }
3267    
3268 wakaba 1.4 ~? (DSO) {
3269 wakaba 1.6 &InternalSubset ($doc => $doc, $doctype => $node);
3270 wakaba 1.4
3271     ~ (DSC) {
3272     ?lexmode MarkupDeclaration;
3273     } else {
3274     ?lexmode MarkupDeclaration;
3275     }
3276    
3277     ~? (S) { }
3278     }
3279    
3280 wakaba 1.25 // TODO: Read and process external subset if any.
3281     lang:Perl {
3282     $self->{dont_process} = true if $has_extid;
3283     }
3284    
3285 wakaba 1.4 // ~ (MDC) { }
3286     } // _DocumentTypeDeclaration_
3287    
3288 wakaba 1.17 /*
3289     Public Identifier Literal
3290     */
3291     rule PubidLiteral ($decl) {
3292     my $pubid;
3293     my $pubid_token;
3294 wakaba 1.4 ~ (LIT) {
3295     ?lexmode SystemLiteral;
3296    
3297     ~? (STRING) {
3298 wakaba 1.17 lang:Perl ($v => $token.value) {
3299     $pubid = $v;
3300     $pubid_token = $token;
3301     }
3302 wakaba 1.4 }
3303    
3304     ~ (LIT) {
3305     ?lexmode MarkupDeclaration;
3306     } else {
3307     ?lexmode MarkupDeclaration;
3308     }
3309     } (LITA) {
3310     ?lexmode SystemLiteralA;
3311    
3312     ~? (STRING) {
3313 wakaba 1.17 lang:Perl ($v => $token.value) {
3314     $pubid = $v;
3315     $pubid_token = $token;
3316     }
3317 wakaba 1.4 }
3318    
3319     ~ (LITA) {
3320     ?lexmode MarkupDeclaration;
3321     } else {
3322     ?lexmode MarkupDeclaration;
3323     }
3324     }
3325 wakaba 1.17
3326     if-true ($pubid_token) {
3327     lang:Perl : has-error {
3328     if ($pubid =~ m{[^\x20\x0D\x0Aa-zA-Z0-9'()+,./:=?;!*#\@\$_%-]}s) {
3329     my $location;
3330     __CODE{xp|get-location-from-token::
3331     $token => {$pubid_token},
3332     $result => {$location},
3333     }__;
3334     ## Should this be other (new) error type?
3335     my $continue = __DOMCore:ERROR{xp|wf-syntax-error::
3336     xp|error-token => {$token},
3337     c|location => {$location},
3338     }__;
3339     unless ($continue) {
3340 wakaba 1.27 __CODE{ParseError}__;
3341 wakaba 1.17 }
3342     }
3343    
3344     ## NOTE: U+0009 is syntactically illegal.
3345 wakaba 1.23 $pubid =~ s/[\x09\x0A\x0D\x20]+/\x20/gs;
3346 wakaba 1.17 $pubid =~ s/\A\x20//s;
3347     $pubid =~ s/\x20\z//s;
3348     ## NOTE: Bare attribute name is written.
3349     $decl->public_id ($pubid);
3350     }
3351     }
3352 wakaba 1.4 } // PubidLiteral
3353    
3354 wakaba 1.17 /*
3355     System Identifier Literal
3356     */
3357     rule SystemLiteral ($decl) {
3358 wakaba 1.4 ~ (LIT) {
3359     ?lexmode SystemLiteral;
3360 wakaba 1.17 &_SystemLiteral ($decl => $decl);
3361 wakaba 1.4 } (LITA) {
3362     ?lexmode SystemLiteralA;
3363 wakaba 1.17 &_SystemLiteral ($decl => $decl);
3364 wakaba 1.4 }
3365     } // SystemLiteral
3366    
3367 wakaba 1.17 /*
3368     System Identifier Literal Content
3369 wakaba 1.29
3370     Used in document type declaration, entity declaration,
3371     and notation declaration.
3372 wakaba 1.17 */
3373     rule _SystemLiteral ($decl) {
3374     // LIT or LITA
3375    
3376 wakaba 1.4 ~? (STRING) {
3377 wakaba 1.17 lang:Perl ($v => $token.value) {
3378 wakaba 1.29 $decl-><AS::x|Entity.systemId> ($v);
3379     $decl-><AS::x|Entity.manakaiDeclarationBaseURI>
3380     ($self->{location}->{base_uri});
3381 wakaba 1.17 }
3382 wakaba 1.4 }
3383    
3384     ~ (LIT) {
3385     ?lexmode MarkupDeclaration;
3386     } (LITA) {
3387     ?lexmode MarkupDeclaration;
3388     } else {
3389     ?lexmode MarkupDeclaration;
3390     }
3391     } // _SystemLiteral
3392    
3393     /*
3394     DTD Internal Subset
3395    
3396     intSubset := *(markupdecl / DeclSep) ;; [28b]
3397     */
3398 wakaba 1.6 rule InternalSubset ($doc, $doctype) {
3399 wakaba 1.4 ?lexmode DTD;
3400    
3401     ~* (MDO) {
3402     ?lexmode MarkupDeclaration;
3403    
3404     ~ (Name == 'ELEMENT') {
3405     &_ElementDeclaration ($doc => $doc);
3406     } (Name == 'ATTLIST') {
3407 wakaba 1.8 &_AttlistDeclaration ($doc => $doc, $doctype => $doctype);
3408 wakaba 1.4 } (Name == 'ENTITY') {
3409     &_EntityDeclaration ($doc => $doc);
3410     } (Name == 'NOTATION') {
3411     &_NotationDeclaration ($doc => $doc);
3412     }
3413     } (S) {
3414     //
3415     } (CDO) {
3416     &_CommentDeclarationDTD ($doc => $doc);
3417     } (PIO) {
3418 wakaba 1.6 &_ProcessingInstructionDTD ($doc => $doc, $doctype => $doctype);
3419 wakaba 1.4 } (PERO) {
3420     ?lexmode EntityReference;
3421    
3422 wakaba 1.19 lang:Perl {
3423     $self->{has_xref} = true;
3424 wakaba 1.25 $self->{dont_process} = true;
3425 wakaba 1.19 }
3426    
3427 wakaba 1.4 ~ (Name) {
3428 wakaba 1.26 // TODO: __CODE{checkNCName:: $name => $name}__;
3429 wakaba 1.4
3430     }
3431    
3432     ~ (REFC) {
3433     ?lexmode DTD;
3434     } else {
3435     ?lexmode DTD;
3436     }
3437     }
3438     } // InternalSubset
3439    
3440     rule _ElementDeclaration ($doc) {
3441     // ~ (MDO) { }
3442     // ?lexmode MarkupDeclaration
3443     // ~ (Name == 'Element') { }
3444    
3445     ~ (S) { }
3446    
3447     ~ (Name) {
3448 wakaba 1.26 // TODO: __CODE{checkQName:: $name => $name}__;
3449 wakaba 1.4
3450     }
3451    
3452     ?lexmode ElementDeclaration;
3453    
3454     ~ (S) { }
3455    
3456     // contentspec
3457     ~ (MGO) {
3458     &_ContentModel ($doc => $doc);
3459     } (Name == 'EMPTY') {
3460    
3461     } (Name == 'ANY') {
3462    
3463     }
3464    
3465     ~? (S) { }
3466    
3467     ~ (MDC) {
3468     ?lexmode DTD;
3469     } else {
3470     ?lexmode DTD;
3471     }
3472     } // _ElementDeclaration
3473    
3474     rule _ContentModel ($doc) {
3475     // ~ (MGO) { }
3476    
3477     ~? (S) { }
3478    
3479     ~ (Name) {
3480     // Element content model
3481     &_ModelGroup ($doc => $doc)
3482     : unshift-current-token;
3483    
3484     ~? (OPT) {
3485    
3486     } (REP) {
3487    
3488     } (PLUS) {
3489    
3490     }
3491    
3492     } (MDO) {
3493     &_ModelGroup ($doc => $doc)
3494     : unshift-current-token;
3495    
3496     ~? (OPT) {
3497    
3498     } (REP) {
3499    
3500     } (PLUS) {
3501    
3502     }
3503    
3504     } (PCDATA) {
3505     // Mixed content declaration
3506     ~? (S) { }
3507    
3508     ~* (OR) {
3509     ~? (S) { }
3510    
3511     ~ (Name) {
3512 wakaba 1.26 // TODO: Name & QName check
3513 wakaba 1.4
3514     }
3515    
3516     ~? (S) { }
3517     }
3518    
3519     ~ (MGC) { }
3520    
3521     ~? (REP) {
3522    
3523     } else {
3524     // TODO: error if |Name|
3525     }
3526    
3527    
3528     }
3529     } // _ContentModel
3530    
3531     rule _ModelGroup ($doc)
3532     : standalone
3533     : recursive
3534     {
3535     // ~ (MGO) { }
3536     // ~? (S) { }
3537    
3538     &ContentParticle ($doc => $doc);
3539    
3540     ~? (S) { }
3541    
3542     ~? (OR) {
3543     ~? (S) { }
3544    
3545     &ContentParticle ($doc => $doc);
3546    
3547     ~? (S) { }
3548    
3549     ~* (OR) {
3550     ~? (S) { }
3551    
3552     &ContentParticle ($doc => $doc);
3553    
3554     ~? (S) { }
3555     }
3556    
3557     } (SEQ) {
3558     ~? (S) { }
3559    
3560     &ContentParticle ($doc => $doc);
3561    
3562     ~? (S) { }
3563    
3564     ~* (SEQ) {
3565     ~? (S) { }
3566    
3567     &ContentParticle ($doc => $doc);
3568    
3569     ~? (S) { }
3570     }
3571    
3572     }
3573    
3574     ~ (MGC) { }
3575     } // _ModelGroup
3576    
3577     rule ContentParticle ($doc) {
3578     ~ (Name) {
3579 wakaba 1.26 // TODO: Name & QName check
3580 wakaba 1.4
3581     } (MGO) {
3582     ~? (S) { }
3583    
3584     &_ModelGroup ($doc => $doc);
3585     }
3586    
3587     ~? (OPT) {
3588    
3589     } (REP) {
3590    
3591     } (PLUS) {
3592    
3593     }
3594     } // ContentParticle
3595    
3596 wakaba 1.8 /*
3597     Attribute list declaration
3598     */
3599     rule _AttlistDeclaration ($doc, $doctype) {
3600 wakaba 1.4 // ~ (MDO) { }
3601     // ~ (Name == 'ATTLIST') { }
3602    
3603     ?lexmode AttlistDeclaration;
3604    
3605     ~ (S) { }
3606    
3607 wakaba 1.8 my $name;
3608 wakaba 1.4 ~ (Name) {
3609 wakaba 1.8 lang:Perl ($v => $token.value) {
3610 wakaba 1.26 __CODE{checkQName:: $name => $v}__;
3611 wakaba 1.8 $name = $v;
3612     }
3613     } else {
3614     lang:Perl { $name = '#ILLEGAL' }
3615     }
3616 wakaba 1.4
3617 wakaba 1.8 my $docxd;
3618     my $et;
3619     lang:Perl {
3620     $et = $doctype-><M::DTDef.getElementTypeDefinitionNode> ($name);
3621     unless ($et) {
3622 wakaba 1.11 $docxd = $doc-><M::Node.getFeature> (<Q::fe:XDoctype>, '3.0');
3623 wakaba 1.8 $et = $docxd-><M::DocumentXDoctype.createElementTypeDefinition>
3624     ($name);
3625     $doctype-><M::DTDef.setElementTypeDefinitionNode> ($et)
3626     unless $name eq '#ILLEGAL';
3627     }
3628 wakaba 1.4 }
3629    
3630     ~? (S) { }
3631    
3632     ~* (Name) {
3633 wakaba 1.8 my $at;
3634 wakaba 1.25 lang:Perl ($v => $token.value) : has-error {
3635 wakaba 1.26 __CODE{checkQName:: $name => $v}__;
3636 wakaba 1.8 $docxd ||= $doc-><M::Node.getFeature>
3637 wakaba 1.11 (<Q::fe:XDoctype>, '3.0');
3638 wakaba 1.8 $at = $docxd-><M::DocumentXDoctype.createAttributeDefinition> ($v);
3639 wakaba 1.25 if (exists $et-><AG::ETDef.attributeDefinitions>->{$v}) {
3640     my $location;
3641     __CODE{xp|get-location-from-token::
3642     $token => {$token},
3643     $result => {$location},
3644     }__;
3645     my $continue = __c|ERROR{xp|warning-attribute-definition-ignored::
3646     xp|error-token => {$token},
3647     c|location => {$location},
3648     xp|name => {$v},
3649     }__;
3650     unless ($continue) {
3651 wakaba 1.27 __CODE{ParseError}__;
3652 wakaba 1.25 }
3653     } elsif ($self->{dont_process} and not $self->{standalone}) {
3654     my $location;
3655     __CODE{xp|get-location-from-token::
3656     $token => {$token},
3657     $result => {$location},
3658     }__;
3659     my $continue = __c|ERROR{
3660     xp|warning-attribute-definition-not-processed::
3661     xp|error-token => {$token},
3662     c|location => {$location},
3663     xp|name => {$v},
3664     }__;
3665     unless ($continue) {
3666 wakaba 1.27 __CODE{ParseError}__;
3667 wakaba 1.25 }
3668     } else {
3669 wakaba 1.9 $et-><M::ETDef.setAttributeDefinitionNode> ($at);
3670     $self->{attr}->{$name}->{$v} = $at;
3671     }
3672 wakaba 1.8 }
3673 wakaba 1.4
3674     ~ (S) { }
3675    
3676     // AttType
3677     ~ (Name == 'NOTATION') {
3678     ~ (S) { }
3679    
3680 wakaba 1.8 my $kwd;
3681     lang:Perl {
3682     $at-><AS::ATDef.declaredType> (<C::ATDef.NOTATION_ATTR>);
3683     $kwd = $at-><AG::ATDef.allowedTokens>;
3684     }
3685    
3686 wakaba 1.4 ~ (EGO) {
3687     ~? (S) { }
3688    
3689 wakaba 1.8 ~+ (Name) {
3690 wakaba 1.26 lang:Perl ($v => $token.value) : has-error {
3691     __CODE{checkNCName:: $name => $v}__;
3692 wakaba 1.8 push @$kwd, $v;
3693     }
3694 wakaba 1.4
3695     ~? (S) { }
3696     } (OR) : separator {
3697     ~? (S) { }
3698     }
3699    
3700     ~ (EGC) { }
3701     }
3702 wakaba 1.8
3703 wakaba 1.4 } (Name) {
3704 wakaba 1.8 my $type;
3705     lang:Perl ($v => $token.value) : has-error {
3706     my $map = {
3707     CDATA => <C::ATDef.CDATA_ATTR>,
3708     ID => <C::ATDef.ID_ATTR>,
3709     IDREF => <C::ATDef.IDREF_ATTR>,
3710     IDREFS => <C::ATDef.IDREFS_ATTR>,
3711     ENTITY => <C::ATDef.ENTITY_ATTR>,
3712     ENTITIES => <C::ATDef.ENTITIES_ATTR>,
3713     NMTOKEN => <C::ATDef.NMTOKEN_ATTR>,
3714     NMTOKENS => <C::ATDef.NMTOKENS_ATTR>,
3715     };
3716     if ($map->{$v}) {
3717     $at-><AS::ATDef.declaredType> ($map->{$v});
3718     } else {
3719     ## TODO: Exception
3720     }
3721     }
3722 wakaba 1.4
3723     } (EGO) {
3724     ?lexmode Enumeration;
3725    
3726     ~? (S) { }
3727    
3728 wakaba 1.8 my $kwd;
3729     lang:Perl {
3730     $at-><AS::ATDef.declaredType> (<C::ATDef.ENUMERATION_ATTR>);
3731     $kwd = $at-><AG::ATDef.allowedTokens>;
3732     }
3733    
3734     ~+ (Nmtoken) {
3735     lang:Perl ($v => $token.value) {
3736     push @$kwd, $v;
3737     }
3738 wakaba 1.4
3739     ~? (S) { }
3740     } (OR) : separator {
3741     ~? (S) { }
3742     }
3743    
3744     ~ (EGC) {
3745     ?lexmode AttlistDeclaration;
3746     } else {
3747     ?lexmode AttlistDeclaration;
3748     }
3749    
3750     }
3751    
3752     ~ (S) { }
3753    
3754     // DefaultDecl
3755     ~ (RNI) {
3756     ~ (Name == 'REQUIRED') {
3757 wakaba 1.8 lang:Perl {
3758     $at-><AS::ATDef.defaultType> (<C::ATDef.REQUIRED_DEFAULT>);
3759     }
3760 wakaba 1.4 } (Name == 'IMPLIED') {
3761 wakaba 1.8 lang:Perl {
3762     $at-><AS::ATDef.defaultType> (<C::ATDef.IMPLIED_DEFAULT>);
3763     }
3764 wakaba 1.4 } (Name == 'FIXED') {
3765     ~ (S) { }
3766 wakaba 1.8
3767     lang:Perl {
3768     $at-><AS::ATDef.defaultType> (<C::ATDef.FIXED_DEFAULT>);
3769     }
3770 wakaba 1.4
3771     ~ (LIT) {
3772     my $vals;
3773     lang:Perl {
3774 wakaba 1.8 $vals = {nodes => [], value => ''};
3775 wakaba 1.4 }
3776    
3777     &_AttributeValueSpecification_ ($doc => $doc, $vals => $vals);
3778    
3779 wakaba 1.8 lang:Perl {
3780     for (@{$vals->{nodes}}) {
3781     $at-><M::Node.appendChild> ($_);
3782     }
3783     }
3784    
3785 wakaba 1.4 ~ (LIT) {
3786     ?lexmode AttlistDeclaration;
3787     } else {
3788     ?lexmode AttlistDeclaration;
3789     }
3790     } (LITA) {
3791     my $vals;
3792     lang:Perl {
3793 wakaba 1.8 $vals = {nodes => [], value => ''};
3794 wakaba 1.4 }
3795    
3796     &_AttributeValueSpecificationA_ ($doc => $doc, $vals => $vals);
3797    
3798 wakaba 1.8 lang:Perl {
3799     for (@{$vals->{nodes}}) {
3800     $at-><M::Node.appendChild> ($_);
3801     }
3802     }
3803    
3804     ~ (LITA) {
3805 wakaba 1.4 ?lexmode AttlistDeclaration;
3806     } else {
3807     ?lexmode AttlistDeclaration;
3808     }
3809     }
3810     }
3811    
3812     } (LIT) {
3813     my $vals;
3814     lang:Perl {
3815 wakaba 1.8 $at-><AS::ATDef.defaultType> (<C::ATDef.EXPLICIT_DEFAULT>);
3816     $vals = {nodes => [], value => ''};
3817 wakaba 1.4 }
3818    
3819     &_AttributeValueSpecification_ ($doc => $doc, $vals => $vals);
3820    
3821 wakaba 1.8 lang:Perl {
3822     for (@{$vals->{nodes}}) {
3823     $at-><M::Node.appendChild> ($_);
3824     }
3825     }
3826    
3827 wakaba 1.4 ~ (LIT) {
3828     ?lexmode AttlistDeclaration;
3829     } else {
3830     ?lexmode AttlistDeclaration;
3831     }
3832     } (LITA) {
3833     my $vals;
3834     lang:Perl {
3835 wakaba 1.8 $at-><AS::ATDef.defaultType> (<C::ATDef.EXPLICIT_DEFAULT>);
3836     $vals = {nodes => [], value => ''};
3837 wakaba 1.4 }
3838    
3839     &_AttributeValueSpecificationA_ ($doc => $doc, $vals => $vals);
3840    
3841 wakaba 1.8 lang:Perl {
3842     for (@{$vals->{nodes}}) {
3843     $at-><M::Node.appendChild> ($_);
3844     }
3845     }
3846    
3847 wakaba 1.4 ~ (LITA) {
3848     ?lexmode AttlistDeclaration;
3849     } else {
3850     ?lexmode AttlistDeclaration;
3851     }
3852     }
3853    
3854     } (S) : separator : terminator? {
3855     //
3856     }
3857    
3858     ~ (MDC) {
3859     ?lexmode DTD;
3860     } else {
3861     ?lexmode DTD;
3862     }
3863     } // _AttlistDeclaration
3864    
3865 wakaba 1.11 /*
3866 wakaba 1.26 Entity Declaration
3867 wakaba 1.11 */
3868 wakaba 1.4 rule _EntityDeclaration ($doc) {
3869     // ~ (MDO) { }
3870     // ~ (Name == ENTITY) { }
3871    
3872     ~ (S) { }
3873    
3874 wakaba 1.23 my $is_param_entity;
3875 wakaba 1.6 my $decl;
3876 wakaba 1.27 lang:Perl {
3877     $decl = {
3878     name => '#ILLEGAL',
3879     reptxt => \'',
3880     is_external_entity => false,
3881     document_uri => $self->{location}->{document_uri},
3882     base_uri => $self->{location}->{base_uri},
3883     };
3884     }
3885 wakaba 1.6
3886 wakaba 1.4 ~? (PERO) {
3887     ~ (S) { }
3888 wakaba 1.6 lang:Perl {
3889 wakaba 1.23 $is_param_entity = $decl->{is_param_entity} = true;
3890 wakaba 1.6 }
3891 wakaba 1.4 }
3892    
3893 wakaba 1.19 /*
3894     TODO: Set |$decl->{is_externally_declared}| flag
3895     and |Entity.isExternallyDeclared| attribute
3896     for entity declarations in external subset or
3897     in parameter entity.
3898     */
3899    
3900 wakaba 1.4 ~ (Name) {
3901 wakaba 1.6 lang:Perl ($v => $token.value) {
3902 wakaba 1.26 __CODE{checkNCName:: $name => $v}__;
3903 wakaba 1.6 $decl->{name} = $v;
3904     }
3905 wakaba 1.4 }
3906    
3907 wakaba 1.18 my $node;
3908 wakaba 1.11 lang:Perl {
3909 wakaba 1.18 $node =
3910 wakaba 1.11 $decl->{node} = $self->{docx}-><M::DocumentXDoctype.createGeneralEntity>
3911     ($decl->{name});
3912     ## TODO: Parameter entity...
3913     }
3914    
3915 wakaba 1.4 ~ (S) { }
3916    
3917     ~ (LIT) {
3918 wakaba 1.6 &_EntityValue ($doc => $doc, $decl => $decl);
3919 wakaba 1.4 } (LITA) {
3920 wakaba 1.6 &_EntityValueA ($doc => $doc, $decl => $decl);
3921 wakaba 1.4 } (Name == 'PUBLIC') {
3922     ~ (S) { }
3923    
3924 wakaba 1.18 &PubidLiteral ($decl => $node);
3925 wakaba 1.4
3926     ~ (S) { }
3927    
3928 wakaba 1.18 &SystemLiteral ($decl => $node);
3929    
3930     lang:Perl {
3931     $decl->{is_external_entity} = true;
3932     }
3933 wakaba 1.4 } (Name == 'SYSTEM') {
3934     ~ (S) { }
3935    
3936 wakaba 1.18 &SystemLiteral ($decl => $node);
3937    
3938     lang:Perl {
3939     $decl->{is_external_entity} = true;
3940     }
3941 wakaba 1.4 }
3942    
3943     ~? (S) {
3944     ~? (Name == 'NDATA') {
3945 wakaba 1.23 if-true ($is_param_entity) {
3946     lang:Perl : has-error {
3947     my $location;
3948     __CODE{xp|get-location-from-token::
3949     $token => {$token},
3950     $result => {$location},
3951     }__;
3952     my $continue = __DOMCore:ERROR{xp|wf-syntax-error::
3953     xp|error-token => {$token},
3954     c|location => {$location},
3955     }__;
3956     unless ($continue) {
3957 wakaba 1.27 __CODE{ParseError}__;
3958 wakaba 1.23 }
3959     }
3960     }
3961 wakaba 1.4
3962     ~ (S) { }
3963    
3964     ~ (Name) {
3965 wakaba 1.26 lang:Perl ($v => $token.value) : has-error {
3966     __CODE{checkNCName:: $name => $v}__;
3967 wakaba 1.6 $decl->{notation} = $v;
3968 wakaba 1.11 $decl->{node}-><AG::x|Entity.notationName> ($v);
3969 wakaba 1.6 }
3970 wakaba 1.4 }
3971    
3972     ~? (S) { }
3973     }
3974     }
3975    
3976 wakaba 1.24 lang:Perl : has-error {
3977 wakaba 1.6 if ($self->{$decl->{is_param_entity} ? 'param_entity' : 'general_entity'}
3978     ->{$decl->{name}}) {
3979 wakaba 1.24 ## Predefined entity
3980     if (not $decl->{is_param_entity} and
3981     {lt => true, gt => true, amp => true,
3982     quot => true, apos => true}->{$decl->{name}}) {
3983     if ($decl->{is_external_entity}) {
3984     my $location;
3985     __CODE{xp|get-location-from-token::
3986     $token => {$token},
3987     $result => {$location},
3988     }__;
3989     my $continue = __c|ERROR{xp|error-internal-predefined-entity::
3990     xp|error-token => {$token},
3991     c|location => {$location},
3992     xp|name => {$decl->{name}},
3993     }__;
3994     unless ($continue) {
3995 wakaba 1.27 __CODE{ParseError}__;
3996 wakaba 1.24 }
3997     } elsif (
3998     not ({gt => true, apos => true, quot => true}->{$decl->{name}} and
3999     ${$decl->{reptxt}} eq {
4000     gt => '>', apos => "'", quot => '"',
4001     }->{$decl->{name}}) and
4002     not (${$decl->{reptxt}} =~ /\A&#0*@{[{
4003     lt => '60', gt => '62', amp => '38',
4004     apos => '39', quot => '34',
4005     }->{$decl->{name}}]};\z/) and
4006     not (${$decl->{reptxt}} =~ /\A&#x0*(?:(?i)@{[{
4007     lt => '3C', gt => '3E', amp => '26',
4008     apos => '27', quot => '22',
4009     }->{$decl->{name}}]});\z/)
4010     ) {
4011     ## NOTE: See "SuikaWiki - Predefined Entities"
4012     ## "http://suika.fam.cx/gate/2005/sw/%E5%AE%9A%E7%BE%A9%E6%B8%88%E5%AE%9F%E4%BD%93".
4013     my $location;
4014     __CODE{xp|get-location-from-token::
4015     $token => {$token},
4016     $result => {$location},
4017     }__;
4018     my $continue = __c|ERROR{xp|error-malformed-predefined-entity::
4019     xp|error-token => {$token},
4020     c|location => {$location},
4021     xp|name => {$decl->{name}},
4022     xp|replacement-text => {${$decl->{reptxt}}},
4023     }__;
4024     unless ($continue) {
4025 wakaba 1.27 __CODE{ParseError}__;
4026 wakaba 1.24 }
4027     }
4028 wakaba 1.25 $self->{dtdecl}->{<H::mn:node>}->{{
4029     lt => <H::d|hasLtDeclaration>,
4030     gt => <H::d|hasGtDeclaration>,
4031     amp => <H::d|hasAmpDeclaration>,
4032     apos => <H::d|hasAposDeclaration>,
4033     quot => <H::d|hasQuotDeclaration>,
4034     }->{$decl->{name}}} = true;
4035 wakaba 1.24 } else { ## Dupulicating declaration
4036     my $location;
4037     __CODE{xp|get-location-from-token::
4038     $token => {$token},
4039     $result => {$location},
4040     }__;
4041     my $continue = __c|ERROR{xp|warning-entity-declaration-ignored::
4042     xp|error-token => {$token},
4043     c|location => {$location},
4044     xp|name => {$decl->{name}},
4045     }__;
4046     unless ($continue) {
4047 wakaba 1.27 __CODE{ParseError}__;
4048 wakaba 1.24 }
4049     }
4050 wakaba 1.25 } elsif ($self->{dont_process} and not $self->{standalone}) {
4051     ## TODO: |standalone| and parameter entities??
4052     my $location;
4053     __CODE{xp|get-location-from-token::
4054     $token => {$token},
4055     $result => {$location},
4056     }__;
4057     my $continue = __c|ERROR{xp|warning-entity-declaration-not-processed::
4058     xp|error-token => {$token},
4059     c|location => {$location},
4060     xp|name => {$decl->{name}},
4061     }__;
4062     unless ($continue) {
4063 wakaba 1.27 __CODE{ParseError}__;
4064 wakaba 1.25 }
4065 wakaba 1.6 } else {
4066     $self->{$decl->{is_param_entity} ? 'param_entity' : 'general_entity'}
4067     ->{$decl->{name}} = $decl;
4068 wakaba 1.11 $self->{dtdef}-><M::DTDef.setGeneralEntityNode> ($decl->{node})
4069     unless $decl->{is_param_entity};
4070 wakaba 1.6 }
4071     }
4072    
4073 wakaba 1.4 ~ (MDC) {
4074     ?lexmode DTD;
4075     } else {
4076     ?lexmode DTD;
4077     }
4078     } // _EntityDeclaration
4079    
4080 wakaba 1.26 /*
4081     Notation Declaration
4082     */
4083     rule _NotationDeclaration {
4084 wakaba 1.4 // ~ (MDO) { }
4085     // ~ (Name == NOTATION) { }
4086    
4087     ~ (S) { }
4088    
4089 wakaba 1.26 my $name;
4090 wakaba 1.4 ~ (Name) {
4091 wakaba 1.26 lang:Perl ($v => $token.value) : has-error {
4092     __CODE{checkNCName:: $name => $v}__;
4093     $name = $v;
4094     }
4095     } else {
4096     lang:Perl {
4097     $name = '#INVALID';
4098     }
4099     }
4100 wakaba 1.4
4101     ~ (S) { }
4102    
4103 wakaba 1.17 lang:Perl {
4104 wakaba 1.26 $decl = $self->{docx}-><M::DocumentXDoctype.createNotation> ($name);
4105 wakaba 1.17 }
4106    
4107 wakaba 1.4 ~ (Name == 'PUBLIC') {
4108     ~ (S) { }
4109    
4110 wakaba 1.17 &PubidLiteral ($decl => $decl);
4111 wakaba 1.4
4112     ~? (S) {
4113     ~? (LIT) {
4114     ?lexmode SystemLiteral;
4115 wakaba 1.17 &_SystemLiteral ($decl => $decl);
4116 wakaba 1.4
4117     ~? (S) { }
4118     } (LITA) {
4119     ?lexmode SystemLiteralA;
4120 wakaba 1.17 &_SystemLiteral ($decl => $decl);
4121 wakaba 1.4
4122     ~? (S) { }
4123     }
4124     }
4125     } (Name == 'SYSTEM') {
4126     ~ (S) { }
4127    
4128 wakaba 1.17 &SystemLiteral ($decl => $decl);
4129 wakaba 1.4
4130     ~? (S) { }
4131     }
4132    
4133 wakaba 1.26 lang:Perl : has-error {
4134     if ($self->{dtdef}-><M::DTDef.getNotationNode> ($name)) {
4135     ## Dupulication
4136     my $location;
4137     __CODE{xp|get-location-from-token::
4138     $token => {$token},
4139     $result => {$location},
4140     }__;
4141     my $continue = __c|ERROR{xp|vc-unique-notation-name::
4142     xp|error-token => {$token},
4143     c|location => {$location},
4144     xp|name => {$name},
4145     }__;
4146     unless ($continue) {
4147 wakaba 1.27 __CODE{ParseError}__;
4148 wakaba 1.26 }
4149     } else {
4150     $self->{dtdef}-><M::DTDef.setNotationNode> ($decl);
4151     }
4152     }
4153    
4154 wakaba 1.4 ~ (MDC) {
4155     ?lexmode DTD;
4156     } else {
4157     ?lexmode DTD;
4158     }
4159     } // _NotationDeclaration
4160    
4161 wakaba 1.11 rule _EntityValue ($decl) {
4162 wakaba 1.4 ?lexmode EntityValue;
4163    
4164     my $vals;
4165 wakaba 1.6 my $reptxt;
4166 wakaba 1.4 lang:Perl {
4167     $vals = [];
4168 wakaba 1.6 $reptxt = '';
4169 wakaba 1.4 }
4170    
4171     ~* (STRING) {
4172 wakaba 1.6 lang:Perl ($v => $token.value) {
4173     $reptxt .= $v;
4174     }
4175 wakaba 1.4 } (PERO) {
4176 wakaba 1.25 ?lexmode EntityReference;
4177 wakaba 1.19
4178     lang:Perl {
4179     $self->{has_xref} = true;
4180 wakaba 1.25 $self->{dont_process} = true;
4181 wakaba 1.19 }
4182 wakaba 1.6
4183     // TODO: Expand or wferror if internal subset
4184 wakaba 1.4
4185     ~ (Name) {
4186    
4187 wakaba 1.25 // Note that external subset and parameter entities are not supported
4188     lang:Perl ($name => $token.value) : has-error {
4189 wakaba 1.26 __CODE{checkNCName:: $name => $name}__;
4190 wakaba 1.25 my $location;
4191     __CODE{xp|get-location-from-token::
4192     $token => {$token},
4193     $result => {$location},
4194     }__;
4195     my $continue = __c|ERROR{xp|wf-pes-in-internal-subset::
4196     xp|error-token => {$token},
4197     c|location => {$location},
4198     xp|name => {$name},
4199     }__;
4200     unless ($continue) {
4201 wakaba 1.27 __CODE{ParseError}__;
4202 wakaba 1.25 }
4203     }
4204 wakaba 1.4 }
4205    
4206     ~ (REFC) {
4207     ?lexmode EntityValue;
4208     } else {
4209     ?lexmode EntityValue;
4210     }
4211     } (HCRO) {
4212 wakaba 1.11 &_HexadecimalCharacterReferenceEV_ ($vals => $vals);
4213 wakaba 1.4
4214 wakaba 1.6 lang:Perl {
4215 wakaba 1.11 $reptxt .= $vals->[-1];
4216 wakaba 1.6 }
4217    
4218 wakaba 1.4 ~ (REFC) {
4219     ?lexmode EntityValue;
4220     } else {
4221     ?lexmode EntityValue;
4222     }
4223     } (CRO) {
4224 wakaba 1.11 &_NumericCharacterReferenceEV_ ($vals => $vals);
4225 wakaba 1.6
4226     lang:Perl {
4227 wakaba 1.11 $reptxt .= $vals->[-1];
4228 wakaba 1.6 }
4229 wakaba 1.4
4230     ~ (REFC) {
4231     ?lexmode EntityValue;
4232     } else {
4233     ?lexmode EntityValue;
4234     }
4235     } (ERO) {
4236 wakaba 1.11 &_GeneralEntityReferenceEV_ ($vals => $vals);
4237 wakaba 1.4
4238 wakaba 1.6 lang:Perl {
4239 wakaba 1.11 $reptxt .= '&' . $vals->[-1] . ';';
4240 wakaba 1.6 }
4241    
4242 wakaba 1.4 ~ (REFC) {
4243     ?lexmode EntityValue;
4244     } else {
4245     ?lexmode EntityValue;
4246     }
4247     }
4248    
4249     ~ (LIT) {
4250     ?lexmode MarkupDeclaration;
4251     } (LITA) {
4252     ?lexmode MarkupDeclaration;
4253     } else {
4254     ?lexmode MarkupDeclaration;
4255     }
4256 wakaba 1.6
4257     lang:Perl {
4258     $decl->{reptxt} = \$reptxt;
4259 wakaba 1.19 $decl->{has_replacement_text} = true;
4260 wakaba 1.6 }
4261 wakaba 1.4 } // _EntityValue
4262    
4263 wakaba 1.11 rule _EntityValueA ($decl) {
4264 wakaba 1.4 ?lexmode EntityValueA;
4265    
4266     my $vals;
4267 wakaba 1.6 my $reptxt;
4268 wakaba 1.4 lang:Perl {
4269     $vals = [];
4270 wakaba 1.6 $reptxt = '';
4271 wakaba 1.4 }
4272    
4273     ~* (STRING) {
4274 wakaba 1.6 lang:Perl ($v => $token.value) {
4275     $reptxt .= $v;
4276     }
4277 wakaba 1.4 } (PERO) {
4278 wakaba 1.25 ?lexmode EntityReference;
4279 wakaba 1.4
4280 wakaba 1.19 lang:Perl {
4281     $self->{has_xref} = true;
4282 wakaba 1.25 $self->{dont_process} = true;
4283 wakaba 1.19 }
4284    
4285 wakaba 1.6 // TODO: implement this
4286 wakaba 1.4 ~ (Name) {
4287    
4288 wakaba 1.25 // Note that external subset and parameter entities are not supported
4289     lang:Perl ($name => $token.value) : has-error {
4290 wakaba 1.26 __CODE{checkNCName:: $name => $name}__;
4291 wakaba 1.25 my $location;
4292     __CODE{xp|get-location-from-token::
4293     $token => {$token},
4294     $result => {$location},
4295     }__;
4296     my $continue = __c|ERROR{xp|wf-pes-in-internal-subset::
4297     xp|error-token => {$token},
4298     c|location => {$location},
4299     xp|name => {$name},
4300     }__;
4301     unless ($continue) {
4302 wakaba 1.27 __CODE{ParseError}__;
4303 wakaba 1.25 }
4304     }
4305 wakaba 1.4 }
4306    
4307     ~ (REFC) {
4308     ?lexmode EntityValueA;
4309     } else {
4310     ?lexmode EntityValueA;
4311     }
4312     } (HCRO) {
4313 wakaba 1.11 &_HexadecimalCharacterReferenceEV_ ($vals => $vals);
4314 wakaba 1.4
4315 wakaba 1.6 lang:Perl {
4316 wakaba 1.11 $reptxt .= $vals->[-1];
4317 wakaba 1.6 }
4318    
4319    
4320 wakaba 1.4 ~ (REFC) {
4321     ?lexmode EntityValueA;
4322     } else {
4323     ?lexmode EntityValueA;
4324     }
4325     } (CRO) {
4326 wakaba 1.11 &_NumericCharacterReferenceEV_ ($vals => $vals);
4327 wakaba 1.4
4328 wakaba 1.6 lang:Perl {
4329 wakaba 1.11 $reptxt .= $vals->[-1];
4330 wakaba 1.6 }
4331    
4332 wakaba 1.4 ~ (REFC) {
4333     ?lexmode EntityValueA;
4334     } else {
4335     ?lexmode EntityValueA;
4336     }
4337     } (ERO) {
4338 wakaba 1.11 &_GeneralEntityReferenceEV_ ($vals => $vals);
4339 wakaba 1.4
4340 wakaba 1.6 lang:Perl {
4341 wakaba 1.11 $reptxt .= '&' . $vals->[-1] . ';';
4342 wakaba 1.6 }
4343    
4344 wakaba 1.4 ~ (REFC) {
4345     ?lexmode EntityValueA;
4346     } else {
4347     ?lexmode EntityValueA;
4348     }
4349     }
4350    
4351     ~ (LITA) {
4352     ?lexmode MarkupDeclaration;
4353     } else {
4354     ?lexmode MarkupDeclaration;
4355     }
4356 wakaba 1.6
4357     lang:Perl {
4358     $decl->{reptxt} = \$reptxt;
4359 wakaba 1.19 $decl->{has_replacement_text} = true;
4360 wakaba 1.6 }
4361 wakaba 1.4 } // _EntityValueA
4362    
4363    
4364     /*
4365     XML Name
4366     */
4367     lexmode NameChar {
4368     $NameStartChar10 := [
4369     '_' ':'
4370     // Letter
4371     // BaseChar
4372     U+0041..U+005A U+0061..U+007A U+00C0..U+00D6
4373     U+00D8..U+00F6 U+00F8..U+00FF U+0100..U+0131
4374     U+0134..U+013E U+0141..U+0148 U+014A..U+017E
4375     U+0180..U+01C3 U+01CD..U+01F0 U+01F4..U+01F5
4376     U+01FA..U+0217 U+0250..U+02A8 U+02BB..U+02C1
4377     U+0386 U+0388..U+038A U+038C U+038E..U+03A1
4378     U+03A3..U+03CE U+03D0..U+03D6 U+03DA U+03DC
4379     U+03DE U+03E0 U+03E2..U+03F3 U+0401..U+040C
4380     U+040E..U+044F U+0451..U+045C U+045E..U+0481
4381     U+0490..U+04C4 U+04C7..U+04C8 U+04CB..U+04CC
4382     U+04D0..U+04EB U+04EE..U+04F5 U+04F8..U+04F9
4383     U+0531..U+0556 U+0559 U+0561..U+0586
4384     U+05D0..U+05EA U+05F0..U+05F2 U+0621..U+063A
4385     U+0641..U+064A U+0671..U+06B7 U+06BA..U+06BE
4386     U+06C0..U+06CE U+06D0..U+06D3 U+06D5
4387     U+06E5..U+06E6 U+0905..U+0939 U+093D
4388     U+0958..U+0961 U+0985..U+098C U+098F..U+0990
4389     U+0993..U+09A8 U+09AA..U+09B0 U+09B2
4390     U+09B6..U+09B9 U+09DC..U+09DD U+09DF..U+09E1
4391     U+09F0..U+09F1 U+0A05..U+0A0A U+0A0F..U+0A10
4392     U+0A13..U+0A28 U+0A2A..U+0A30 U+0A32..U+0A33
4393     U+0A35..U+0A36 U+0A38..U+0A39 U+0A59..U+0A5C
4394     U+0A5E U+0A72..U+0A74 U+0A85..U+0A8B U+0A8D
4395     U+0A8F..U+0A91 U+0A93..U+0AA8 U+0AAA..U+0AB0
4396     U+0AB2..U+0AB3 U+0AB5..U+0AB9 U+0ABD U+0AE0
4397     U+0B05..U+0B0C U+0B0F..U+0B10 U+0B13..U+0B28
4398     U+0B2A..U+0B30 U+0B32..U+0B33 U+0B36..U+0B39
4399     U+0B3D U+0B5C..U+0B5D U+0B5F..U+0B61
4400     U+0B85..U+0B8A U+0B8E..U+0B90 U+0B92..U+0B95
4401     U+0B99..U+0B9A U+0B9C U+0B9E..U+0B9F
4402     U+0BA3..U+0BA4 U+0BA8..U+0BAA U+0BAE..U+0BB5
4403     U+0BB7..U+0BB9 U+0C05..U+0C0C U+0C0E..U+0C10
4404     U+0C12..U+0C28 U+0C2A..U+0C33 U+0C35..U+0C39
4405     U+0C60..U+0C61 U+0C85..U+0C8C U+0C8E..U+0C90
4406     U+0C92..U+0CA8 U+0CAA..U+0CB3 U+0CB5..U+0CB9
4407     U+0CDE U+0CE0..U+0CE1 U+0D05..U+0D0C
4408     U+0D0E..U+0D10 U+0D12..U+0D28 U+0D2A..U+0D39
4409     U+0D60..U+0D61 U+0E01..U+0E2E U+0E30
4410     U+0E32..U+0E33 U+0E40..U+0E45 U+0E81..U+0E82
4411     U+0E84 U+0E87..U+0E88 U+0E8A U+0E8D
4412     U+0E94..U+0E97 U+0E99..U+0E9F U+0EA1..U+0EA3
4413     U+0EA5 U+0EA7 U+0EAA..U+0EAB U+0EAD..U+0EAE
4414     U+0EB0 U+0EB2..U+0EB3 U+0EBD U+0EC0..U+0EC4
4415     U+0F40..U+0F47 U+0F49..U+0F69 U+10A0..U+10C5
4416     U+10D0..U+10F6 U+1100 U+1102..U+1103
4417     U+1105..U+1107 U+1109 U+110B..U+110C
4418     U+110E..U+1112 U+113C U+113E U+1140 U+114C
4419     U+114E U+1150 U+1154..U+1155 U+1159
4420     U+115F..U+1161 U+1163 U+1165 U+1167 U+1169
4421     U+116D..U+116E U+1172..U+1173 U+1175 U+119E
4422     U+11A8 U+11AB U+11AE..U+11AF U+11B7..U+11B8
4423     U+11BA U+11BC..U+11C2 U+11EB U+11F0 U+11F9
4424     U+1E00..U+1E9B U+1EA0..U+1EF9 U+1F00..U+1F15
4425     U+1F18..U+1F1D U+1F20..U+1F45 U+1F48..U+1F4D
4426     U+1F50..U+1F57 U+1F59 U+1F5B U+1F5D
4427     U+1F5F..U+1F7D U+1F80..U+1FB4 U+1FB6..U+1FBC
4428     U+1FBE U+1FC2..U+1FC4 U+1FC6..U+1FCC
4429     U+1FD0..U+1FD3 U+1FD6..U+1FDB U+1FE0..U+1FEC
4430     U+1FF2..U+1FF4 U+1FF6..U+1FFC U+2126
4431     U+212A..U+212B U+212E U+2180..U+2182
4432     U+3041..U+3094 U+30A1..U+30FA U+3105..U+312C
4433     U+AC00..U+D7A3
4434     // Ideographic
4435     U+4E00..U+9FA5 U+3007 U+3021..U+3029
4436     ];
4437     $NameChar10 := [
4438     '.' '-' '_' ':'
4439     // Letter
4440     // BaseChar
4441     U+0041..U+005A U+0061..U+007A U+00C0..U+00D6
4442     U+00D8..U+00F6 U+00F8..U+00FF U+0100..U+0131
4443     U+0134..U+013E U+0141..U+0148 U+014A..U+017E
4444     U+0180..U+01C3 U+01CD..U+01F0 U+01F4..U+01F5
4445     U+01FA..U+0217 U+0250..U+02A8 U+02BB..U+02C1
4446     U+0386 U+0388..U+038A U+038C U+038E..U+03A1
4447     U+03A3..U+03CE U+03D0..U+03D6 U+03DA U+03DC
4448     U+03DE U+03E0 U+03E2..U+03F3 U+0401..U+040C
4449     U+040E..U+044F U+0451..U+045C U+045E..U+0481
4450     U+0490..U+04C4 U+04C7..U+04C8 U+04CB..U+04CC
4451     U+04D0..U+04EB U+04EE..U+04F5 U+04F8..U+04F9
4452     U+0531..U+0556 U+0559 U+0561..U+0586
4453     U+05D0..U+05EA U+05F0..U+05F2 U+0621..U+063A
4454     U+0641..U+064A U+0671..U+06B7 U+06BA..U+06BE
4455     U+06C0..U+06CE U+06D0..U+06D3 U+06D5
4456     U+06E5..U+06E6 U+0905..U+0939 U+093D
4457     U+0958..U+0961 U+0985..U+098C U+098F..U+0990
4458     U+0993..U+09A8 U+09AA..U+09B0 U+09B2
4459     U+09B6..U+09B9 U+09DC..U+09DD U+09DF..U+09E1
4460     U+09F0..U+09F1 U+0A05..U+0A0A U+0A0F..U+0A10
4461     U+0A13..U+0A28 U+0A2A..U+0A30 U+0A32..U+0A33
4462     U+0A35..U+0A36 U+0A38..U+0A39 U+0A59..U+0A5C
4463     U+0A5E U+0A72..U+0A74 U+0A85..U+0A8B U+0A8D
4464     U+0A8F..U+0A91 U+0A93..U+0AA8 U+0AAA..U+0AB0
4465     U+0AB2..U+0AB3 U+0AB5..U+0AB9 U+0ABD U+0AE0
4466     U+0B05..U+0B0C U+0B0F..U+0B10 U+0B13..U+0B28
4467     U+0B2A..U+0B30 U+0B32..U+0B33 U+0B36..U+0B39
4468     U+0B3D U+0B5C..U+0B5D U+0B5F..U+0B61
4469     U+0B85..U+0B8A U+0B8E..U+0B90 U+0B92..U+0B95
4470     U+0B99..U+0B9A U+0B9C U+0B9E..U+0B9F
4471     U+0BA3..U+0BA4 U+0BA8..U+0BAA U+0BAE..U+0BB5
4472     U+0BB7..U+0BB9 U+0C05..U+0C0C U+0C0E..U+0C10
4473     U+0C12..U+0C28 U+0C2A..U+0C33 U+0C35..U+0C39
4474     U+0C60..U+0C61 U+0C85..U+0C8C U+0C8E..U+0C90
4475     U+0C92..U+0CA8 U+0CAA..U+0CB3 U+0CB5..U+0CB9
4476     U+0CDE U+0CE0..U+0CE1 U+0D05..U+0D0C
4477     U+0D0E..U+0D10 U+0D12..U+0D28 U+0D2A..U+0D39
4478     U+0D60..U+0D61 U+0E01..U+0E2E U+0E30
4479     U+0E32..U+0E33 U+0E40..U+0E45 U+0E81..U+0E82
4480     U+0E84 U+0E87..U+0E88 U+0E8A U+0E8D
4481     U+0E94..U+0E97 U+0E99..U+0E9F U+0EA1..U+0EA3
4482     U+0EA5 U+0EA7 U+0EAA..U+0EAB U+0EAD..U+0EAE
4483     U+0EB0 U+0EB2..U+0EB3 U+0EBD U+0EC0..U+0EC4
4484     U+0F40..U+0F47 U+0F49..U+0F69 U+10A0..U+10C5
4485     U+10D0..U+10F6 U+1100 U+1102..U+1103
4486     U+1105..U+1107 U+1109 U+110B..U+110C
4487     U+110E..U+1112 U+113C U+113E U+1140 U+114C
4488     U+114E U+1150 U+1154..U+1155 U+1159
4489     U+115F..U+1161 U+1163 U+1165 U+1167 U+1169
4490     U+116D..U+116E U+1172..U+1173 U+1175 U+119E
4491     U+11A8 U+11AB U+11AE..U+11AF U+11B7..U+11B8
4492     U+11BA U+11BC..U+11C2 U+11EB U+11F0 U+11F9
4493     U+1E00..U+1E9B U+1EA0..U+1EF9 U+1F00..U+1F15
4494     U+1F18..U+1F1D U+1F20..U+1F45 U+1F48..U+1F4D
4495     U+1F50..U+1F57 U+1F59 U+1F5B U+1F5D
4496     U+1F5F..U+1F7D U+1F80..U+1FB4 U+1FB6..U+1FBC
4497     U+1FBE U+1FC2..U+1FC4 U+1FC6..U+1FCC
4498     U+1FD0..U+1FD3 U+1FD6..U+1FDB U+1FE0..U+1FEC
4499     U+1FF2..U+1FF4 U+1FF6..U+1FFC U+2126
4500     U+212A..U+212B U+212E U+2180..U+2182
4501     U+3041..U+3094 U+30A1..U+30FA U+3105..U+312C
4502     U+AC00..U+D7A3
4503     // Ideographic
4504     U+4E00..U+9FA5 U+3007 U+3021..U+3029
4505     // Digit
4506     U+0030..U+0039 U+0660..U+0669 U+06F0..U+06F9
4507     U+0966..U+096F U+09E6..U+09EF U+0A66..U+0A6F
4508     U+0AE6..U+0AEF U+0B66..U+0B6F U+0BE7..U+0BEF
4509     U+0C66..U+0C6F U+0CE6..U+0CEF U+0D66..U+0D6F
4510     U+0E50..U+0E59 U+0ED0..U+0ED9 U+0F20..U+0F29
4511     // CombiningChar
4512     U+0300..U+0345 U+0360..U+0361 U+0483..U+0486
4513     U+0591..U+05A1 U+05A3..U+05B9 U+05BB..U+05BD
4514     U+05BF U+05C1..U+05C2 U+05C4 U+064B..U+0652
4515     U+0670 U+06D6..U+06DC U+06DD..U+06DF
4516     U+06E0..U+06E4 U+06E7..U+06E8 U+06EA..U+06ED
4517     U+0901..U+0903 U+093C U+093E..U+094C U+094D
4518     U+0951..U+0954 U+0962..U+0963 U+0981..U+0983
4519     U+09BC U+09BE U+09BF U+09C0..U+09C4
4520     U+09C7..U+09C8 U+09CB..U+09CD U+09D7
4521     U+09E2..U+09E3 U+0A02 U+0A3C U+0A3E U+0A3F
4522     U+0A40..U+0A42 U+0A47..U+0A48 U+0A4B..U+0A4D
4523     U+0A70..U+0A71 U+0A81..U+0A83 U+0ABC
4524     U+0ABE..U+0AC5 U+0AC7..U+0AC9 U+0ACB..U+0ACD
4525     U+0B01..U+0B03 U+0B3C U+0B3E..U+0B43
4526     U+0B47..U+0B48 U+0B4B..U+0B4D U+0B56..U+0B57
4527     U+0B82..U+0B83 U+0BBE..U+0BC2 U+0BC6..U+0BC8
4528     U+0BCA..U+0BCD U+0BD7 U+0C01..U+0C03
4529     U+0C3E..U+0C44 U+0C46..U+0C48 U+0C4A..U+0C4D
4530     U+0C55..U+0C56 U+0C82..U+0C83 U+0CBE..U+0CC4
4531     U+0CC6..U+0CC8 U+0CCA..U+0CCD U+0CD5..U+0CD6
4532     U+0D02..U+0D03 U+0D3E..U+0D43 U+0D46..U+0D48
4533     U+0D4A..U+0D4D U+0D57 U+0E31 U+0E34..U+0E3A
4534     U+0E47..U+0E4E U+0EB1 U+0EB4..U+0EB9
4535     U+0EBB..U+0EBC U+0EC8..U+0ECD U+0F18..U+0F19
4536     U+0F35 U+0F37 U+0F39 U+0F3E U+0F3F
4537     U+0F71..U+0F84 U+0F86..U+0F8B U+0F90..U+0F95
4538     U+0F97 U+0F99..U+0FAD U+0FB1..U+0FB7 U+0FB9
4539     U+20D0..U+20DC U+20E1 U+302A..U+302F U+3099
4540     U+309A
4541     // Extender
4542     U+00B7 U+02D0 U+02D1 U+0387 U+0640 U+0E46
4543     U+0EC6 U+3005 U+3031..U+3035 U+309D..U+309E
4544     U+30FC..U+30FE
4545     ];
4546 wakaba 1.1
4547     $NameStartChar11 := [
4548     ':' '_'
4549     'A' 'B' 'C' 'D' 'E' 'F' 'G' 'H' 'I' 'J' 'K' 'L' 'M'
4550     'N' 'O' 'P' 'Q' 'R' 'S' 'T' 'U' 'V' 'W' 'X' 'Y' 'Z'
4551     'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm'
4552     'n' 'o' 'p' 'q' 'r' 's' 't' 'u' 'v' 'w' 'x' 'y' 'z'
4553     U+00C0..U+00D6 U+00D8..U+00F6 U+00F8..U+02FF
4554     U+0370..U+037D U+037F..U+1FFF U+200C..U+200D
4555     U+2070..U+218F U+2C00..U+2FEF U+3001..U+D7FF
4556     U+F900..U+FDCF U+FDF0..U+FFFD U+10000..U+EFFFF
4557     ];
4558     $NameChar11 := [
4559     '-' '.' '0' '1' '2' '3' '4' '5' '6' '7' '8' '9'
4560     U+00B7 U+0300..U+036F U+203F..U+2040
4561     // NameStartChar
4562     ':' '_'
4563     'A' 'B' 'C' 'D' 'E' 'F' 'G' 'H' 'I' 'J' 'K' 'L' 'M'
4564     'N' 'O' 'P' 'Q' 'R' 'S' 'T' 'U' 'V' 'W' 'X' 'Y' 'Z'
4565     'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm'
4566     'n' 'o' 'p' 'q' 'r' 's' 't' 'u' 'v' 'w' 'x' 'y' 'z'
4567     U+00C0..U+00D6 U+00D8..U+00F6 U+00F8..U+02FF
4568     U+0370..U+037D U+037F..U+1FFF U+200C..U+200D
4569     U+2070..U+218F U+2C00..U+2FEF U+3001..U+D7FF
4570     U+F900..U+FDCF U+FDF0..U+FFFD U+10000..U+EFFFF
4571     ];
4572 wakaba 1.4 } // NameChar
4573    
4574     lexmode Name
4575     : extends => 'NameChar'
4576     {
4577 wakaba 1.1 Name : value := $NameStartChar11 $NameChar11*;
4578     } // Name
4579 wakaba 1.4
4580     lexmode Nmtoken
4581     : extends => 'NameChar'
4582     {
4583     Nmtoken : value := $NameChar11*;
4584     } // Nmtoken
4585 wakaba 1.1
4586     /*
4587 wakaba 1.14 S
4588 wakaba 1.1 */
4589     lexmode S {
4590 wakaba 1.14 $s := [U+0009 U+000A U+000D U+0020];
4591     S := $s+;
4592 wakaba 1.1 } // S
4593    
4594     /*
4595     Document end scanning mode
4596     */
4597     lexmode DocumentEnd
4598     : standalone
4599     : extends => 'S'
4600     {
4601     /*
4602     Processing instruction
4603     */
4604     PIO := ['<'] ['?'];
4605    
4606     /*
4607     Comment declaration
4608     */
4609     CDO := ['<'] ['!'] ['-'] ['-'];
4610     } // DocumentEnd
4611    
4612     /*
4613     Document misc scanning mode
4614    
4615     This mode scans |Misc| constructions as well
4616     as document element's start tag.
4617     */
4618     lexmode DocumentMisc
4619     : standalone
4620     : extends => 'DocumentEnd'
4621     {
4622     /*
4623     Document element start tag
4624     */
4625     STAGO := ['<'];
4626     } // DocumentMisc
4627    
4628     /*
4629     Document prolog scanning mode
4630     */
4631     lexmode DocumentProlog
4632     : standalone
4633     : extends => 'DocumentMisc'
4634     {
4635     /*
4636     |DOCTYPE| declaration
4637     */
4638     MDO := ['<'] ['!'];
4639     } // DocumentProlog
4640 wakaba 1.16
4641 wakaba 1.1 /*
4642 wakaba 1.16 Document Start Scanning Mode
4643 wakaba 1.1 */
4644     lexmode DocumentStart
4645     : standalone
4646     : extends => 'DocumentProlog'
4647     {
4648     /*
4649     XML declaration
4650     */
4651 wakaba 1.16 XDO := ['<'] ['?'] ['x'] ['m'] ['l'];
4652 wakaba 1.1 } // DocumentStart
4653    
4654     /*
4655     Comment declaration scanning mode
4656     */
4657     lexmode CommentDeclaration
4658     : standalone
4659     {
4660     /*
4661     Comment close
4662     */
4663     COM := ['-'] ['-'];
4664    
4665     /*
4666     Comment data
4667     */
4668 wakaba 1.15 ?default-token STRING : value;
4669 wakaba 1.1 } // CommentDeclaration
4670    
4671     /*
4672     Processing instruction name and |S| scanning mode
4673     */
4674     lexmode PIName
4675     : standalone
4676     : extends => 'Name'
4677     : extends => 'S'
4678     {
4679     /*
4680     Processing instruction close
4681     */
4682     PIC := ['?'] ['>'];
4683     } // PIName
4684    
4685     /*
4686 wakaba 1.16 Processing instruction name and |S| scanning mode
4687     */
4688     lexmode PINmtoken
4689     : standalone
4690     : extends => 'Nmtoken'
4691     : extends => 'S'
4692     {
4693     /*
4694     Processing instruction close
4695     */
4696     PIC := ['?'] ['>'];
4697     } // PINmtoken
4698    
4699     /*
4700 wakaba 1.1 Processing instruction data scanning mode
4701     */
4702     lexmode PIData
4703     : standalone
4704     {
4705     /*
4706     Processing instruction close
4707     */
4708     PIC := ['?'] ['>'];
4709    
4710     /*
4711     Processing instruction target data
4712     */
4713 wakaba 1.2 ?default-token DATA : value;
4714 wakaba 1.1 } // PIData
4715    
4716     /*
4717     Content of element scanning mode
4718     */
4719     lexmode ElementContent
4720     : standalone
4721     {
4722     /*
4723     Start tag open
4724     */
4725     STAGO := ['<'];
4726    
4727     /*
4728     End tag open
4729     */
4730     ETAGO := ['<'] ['/'];
4731    
4732     /*
4733     Hexadecimal character reference open
4734     */
4735     HCRO := ['&'] ['#'] ['x'];
4736    
4737     /*
4738     Numeric character reference open
4739     */
4740     CRO := ['&'] ['#'];
4741    
4742     /*
4743     General entity reference open
4744     */
4745     ERO := ['&'];
4746    
4747     /*
4748     Comment declaration open
4749     */
4750     CDO := ['<'] ['!'] ['-'] ['-'];
4751    
4752     /*
4753     CDATA section open
4754     */
4755     CDSO := ['<'] ['!'] ['[']
4756     ['C'] ['D'] ['A'] ['T'] ['A'] ['['];
4757    
4758     /*
4759     Processing instruction open
4760     */
4761     PIO := ['<'] ['?'];
4762 wakaba 1.2
4763     /*
4764     Markup section end
4765     */
4766     MSE := [']'] [']'] ['>'];
4767    
4768     /*
4769     Character data
4770     */
4771     /*
4772     Character data and/or |MSE|
4773     */
4774     ?default-token CharData : value;
4775 wakaba 1.1 } // ElementContent
4776    
4777     /*
4778     CDATA section content scanning mode
4779     */
4780     lexmode CDATASectionContent
4781     : standalone
4782     {
4783     /*
4784     Markup section end
4785     */
4786     MSE := [']'] [']'] ['>'];
4787    
4788     /*
4789     Character data
4790 wakaba 1.2 */
4791     ?default-token CData : value;
4792 wakaba 1.1 } // CDATASectionContent
4793    
4794     lexmode EntityReference
4795     : standalone
4796     : extends => 'Name'
4797     {
4798     /*
4799     Reference close
4800     */
4801     REFC := [';'];
4802     } // EntityReference
4803    
4804     lexmode NumericCharacterReference
4805     : standalone
4806     {
4807     /*
4808     Decimal number
4809     */
4810     $digit := ['0' '1' '2' '3' '4' '5' '6' '7' '8' '9'];
4811     NUMBER : value := $digit+;
4812    
4813     /*
4814     Reference close
4815     */
4816     REFC := [';'];
4817     } // NumericCharacterReference
4818    
4819     lexmode HexadecimalCharacterReference
4820     : standalone
4821     {
4822     /*
4823     Hexadecimal number
4824     */
4825     $hexdigit := ['0' '1' '2' '3' '4' '5' '6' '7' '8' '9'
4826     'A' 'B' 'C' 'D' 'E' 'F'
4827     'a' 'b' 'c' 'd' 'e' 'f'];
4828     Hex : value := $hexdigit+;
4829    
4830     /*
4831     Reference close
4832     */
4833     REFC := [';'];
4834     } // HexadecimalCharacterReference
4835    
4836 wakaba 1.16 /*
4837     The XML Declaration and Text Declaration Scanning Mode
4838     */
4839 wakaba 1.3 lexmode XMLDeclaration
4840     : standalone
4841     : extends => 'Name'
4842     : extends => 'S'
4843     {
4844    
4845     /*
4846     Value indicator
4847     */
4848     VI := ['='];
4849    
4850     /*
4851     Literal open
4852     */
4853     LIT := ['"'];
4854     LITA := [U+0027];
4855    
4856     /*
4857     Processing instruction close
4858 wakaba 1.16
4859     The |PIC|, i.e. |?>|, is split into two tokens |PIC1| and |PIC2|
4860     in this scanning mode to set |no_xml11_eol| flag in the
4861     |_XMLDeclaration_| |rule|.
4862 wakaba 1.3 */
4863 wakaba 1.16 PIC1 := ['?'];
4864     PIC2 := ['>'];
4865 wakaba 1.3 } // XMLDeclaration
4866 wakaba 1.16
4867     /*
4868     The XML Declaration or Processing Instruction Scanning Mode
4869    
4870     '<?xml' S ...
4871     (DocumentStart) (XMLDeclarationOrPI) (XMLDeclaration)
4872     '<?xml' '1' S ...
4873     (DocumentStart) (XMLDeclarationOrPI) (PINmtoken)(PIName) (PITarget)
4874     '<?xml' '-' 'stylesheet' S ...
4875     (DocumentStart) (XMLDeclarationOrPI) (PINmtoken) (PIName) (PITarget)
4876     */
4877     lexmode XMLDeclarationOrPI
4878     : standalone
4879     : extends => 'NameChar'
4880     : extends => 'S'
4881     {
4882     NameChar : value := $NameChar11;
4883     } // XMLDeclarationOrPI
4884 wakaba 1.3
4885 wakaba 1.1 lexmode StartTag
4886     : standalone
4887     : extends => 'Name'
4888     : extends => 'S'
4889     {
4890    
4891     /*
4892     Value indicator
4893     */
4894     VI := ['='];
4895    
4896     /*
4897     Literal open
4898     */
4899     LIT := ['"'];
4900     LITA := [U+0027];
4901    
4902     /*
4903     Tag close
4904     */
4905     TAGC := ['>'];
4906    
4907     /*
4908 wakaba 1.6 Null end-tag enabled start-tag close
4909 wakaba 1.1 */
4910 wakaba 1.6 NESTC := ['/'];
4911 wakaba 1.1 } // StartTag
4912    
4913     lexmode EndTag
4914     : standalone
4915     : extends => 'Name'
4916     : extends => 'S'
4917     {
4918     /*
4919     Tag close
4920     */
4921     TAGC := ['>'];
4922     } // EndTag
4923    
4924     lexmode AttributeValueLiteral_ {
4925     ERO := ['&'];
4926     CRO := ['&'] ['#'];
4927     HCRO := ['&'] ['#'] ['x'];
4928     } // AttributeValueLiteral_
4929    
4930     lexmode AttributeValueLiteral
4931     : standalone
4932     : extends => 'AttributeValueLiteral_'
4933     {
4934     LIT := ['"'];
4935 wakaba 1.3 STRING : value := [^'"' '&' '<']+;
4936 wakaba 1.1 } // AttributeValueLiteral
4937    
4938     lexmode AttributeValueLiteralA
4939     : standalone
4940     : extends => 'AttributeValueLiteral_'
4941     {
4942 wakaba 1.4 LITA := [U+0027];
4943 wakaba 1.3 STRING : value := [^U+0027 '&' '<']+;
4944 wakaba 1.1 } // AttributeValueLiteralA
4945 wakaba 1.11
4946     lexmode AttributeValueLiteralE
4947     : standalone
4948     : extends => 'AttributeValueLiteral_'
4949     {
4950     STRING : value := [^'&' '<']+;
4951     } // AttributeValueLiteralE
4952 wakaba 1.4
4953     lexmode EntityValue_ {
4954     PERO := ['%'];
4955     ERO := ['&'];
4956     CRO := ['&'] ['#'];
4957     HCRO := ['&'] ['#'] ['x'];
4958     } // EntityValue_
4959    
4960     lexmode EntityValue
4961     : standalone
4962     : extends => 'EntityValue_'
4963     {
4964     LIT := ['"'];
4965     STRING : value := [^'"' '&' '%']+;
4966     } // EntityValue
4967    
4968     lexmode EntityValueA
4969     : standalone
4970     : extends => 'EntityValue_'
4971     {
4972     LITA := [U+0027];
4973     STRING : value := [^U+0027 '&' '%']+;
4974     } // EntityValueA
4975    
4976     lexmode SystemLiteral
4977     : standalone
4978     {
4979     LIT := ['"'];
4980     ?default-token STRING : value;
4981     } // SystemLiteral
4982    
4983     lexmode SystemLiteralA
4984     : standalone
4985     {
4986     LITA := [U+0027];
4987     ?default-token STRING : value;
4988     } // SystemLiteralA
4989    
4990     lexmode DTD
4991     : standalone
4992     : extends => 'S'
4993     {
4994     /*
4995     Markup declaration open
4996     */
4997     MDO := ['<'] ['!'];
4998    
4999     /*
5000     Comment declaration open
5001     */
5002     CDO := ['<'] ['!'] ['-'] ['-'];
5003    
5004     /*
5005     Processing instruction open
5006     */
5007     PIO := ['<'] ['?'];
5008    
5009     /*
5010     Parameter entity reference open
5011     */
5012     PERO := ['%'];
5013    
5014     /*
5015     Declaration subset close
5016     */
5017     DSC := [']'];
5018    
5019     /*
5020     Contition section open
5021     */
5022     CSO := ['<'] ['!'] ['['];
5023     } // DTD
5024    
5025     /*
5026     Markup declaration scanning mode
5027    
5028     This mode is used to recognize |MDC| that terminates
5029     a comment declaration as well as the base |lexmode|
5030     for e.g. document type declaration scanning mode.
5031     */
5032     lexmode MarkupDeclaration
5033     : standalone
5034     : extends => 'Name'
5035     : extends => 'S'
5036     {
5037     /*
5038     Markup declaration close
5039     */
5040     MDC := ['>'];
5041    
5042     /*
5043     Literal open
5044     */
5045     LIT := ['"'];
5046    
5047     /*
5048     Alternative literal open
5049     */
5050     LITA := [U+0027];
5051    
5052     /*
5053     Parameter entity reference open
5054     */
5055     PERO := ['%'];
5056    
5057     /*
5058     Declaration subset open
5059     */
5060     DSO := ['['];
5061     } // MarkupDeclaration
5062    
5063     lexmode ElementDeclaration
5064     : standalone
5065     : extends => 'MarkupDeclaration'
5066     {
5067     /*
5068     Model group open
5069     */
5070     MGO := ['('];
5071    
5072     /*
5073     Model group close
5074     */
5075     MGC := [')'];
5076    
5077     /*
5078     Reserved name indicator
5079     */
5080     RNI := ['#'];
5081    
5082     /*
5083     Occurence indicators
5084     */
5085     OPT := ['?'];
5086     REP := ['*'];
5087     PLUS := ['+'];
5088    
5089     /*
5090     Connectors
5091     */
5092     OR := ['|'];
5093     SEQ := [','];
5094     } // ElementDeclaration
5095    
5096     lexmode AttlistDeclaration
5097     : standalone
5098     : extends => 'MarkupDeclaration'
5099     {
5100     /*
5101     Enumeration group open
5102     */
5103     EGO := ['('];
5104    
5105     /*
5106     Enumeration group close
5107     */
5108     EGC := [')'];
5109    
5110     /*
5111     Enumeration choice delimiter
5112     */
5113     OR := ['|'];
5114    
5115     /*
5116     Reserved name indicator
5117     */
5118     RNI := ['#'];
5119     } // AttlistDeclaration
5120    
5121     lexmode Enumeration
5122     : standalone
5123     : extends => 'Nmtoken'
5124     : extends => 'S'
5125     {
5126     /*
5127     Enumeration group close
5128     */
5129     EGC := [')'];
5130    
5131     /*
5132     Enumeration choice delimiter
5133     */
5134     OR := ['|'];
5135     } // Enumeration
5136    
5137 wakaba 1.1
5138     token-error default : default {
5139     lang:Perl {
5140 wakaba 1.3 my $location;
5141     __CODE{xp|get-location-from-token::
5142     $token => {$token},
5143     $result => {$location},
5144     }__;
5145     my $continue = __DOMCore:ERROR{xp|wf-syntax-error::
5146 wakaba 1.1 xp|error-token => {$token},
5147     DOMCore|location => {$location},
5148     }__;
5149     unless ($continue) {
5150 wakaba 1.27 __CODE{ParseError}__;
5151 wakaba 1.1 }
5152     }
5153     } // default
5154 wakaba 1.5
5155 wakaba 1.26 @ResourceDef:
5156     @@ForCheck: ManakaiDOM|ForClass
5157 wakaba 1.27 @@QName: ParseError
5158     @@rdf:type: DISPerl|BlockCode
5159     @@PerlDef:
5160     __DEEP{
5161     for (@{$self->{entity}}) {
5162     $_->{close_file}->();
5163     }
5164     }__;
5165     __EXCEPTION{DOMLS|PARSE_ERR}__;
5166    
5167     @ResourceDef:
5168     @@ForCheck: ManakaiDOM|ForClass
5169 wakaba 1.26 @@QName: checkNCName
5170     @@rdf:type: DISPerl|BlockCode
5171     @@PerlDef:
5172     if (($self->{xml_version} eq '1.0' and
5173     not <Code::DOMMain|testXML10Name:: $INPUT = $name>) or
5174     ($self->{xml_version} eq '1.1' and
5175     not <Code::DOMMain|testXML11Name:: $INPUT = $name>)) {
5176     my $__location;
5177     __CODE{xp|get-location-from-token::
5178     $token => {$token},
5179     $result => {$__location},
5180     }__;
5181     my $__continue = __c|ERROR{xp|wf-invalid-character-in-node-name::
5182     xp|error-token => {$token},
5183     c|location => {$__location},
5184     xp|name => {$name},
5185     infoset|version => {$self->{xml_version}},
5186     }__;
5187     unless ($__continue) {
5188 wakaba 1.27 __CODE{ParseError}__;
5189 wakaba 1.26 }
5190     } elsif (index ($name, ':') > -1) {
5191     my $__location;
5192     __CODE{xp|get-location-from-token::
5193     $token => {$token},
5194     $result => {$__location},
5195     }__;
5196     my $__continue = __c|ERROR{xp|nswf-legal-ncname::
5197     xp|error-token => {$token},
5198     c|location => {$__location},
5199     xp|name => {$name},
5200     infoset|version => {$self->{xml_version}},
5201     }__;
5202     unless ($__continue) {
5203 wakaba 1.27 __CODE{ParseError}__;
5204 wakaba 1.26 }
5205     }
5206    
5207     @ResourceDef:
5208     @@ForCheck: ManakaiDOM|ForClass
5209     @@QName: checkQName
5210     @@rdf:type: DISPerl|BlockCode
5211     @@PerlDef:
5212     if (($self->{xml_version} eq '1.0' and
5213     not <Code::DOMMain|testXML10Name:: $INPUT = $name>) or
5214     ($self->{xml_version} eq '1.1' and
5215     not <Code::DOMMain|testXML11Name:: $INPUT = $name>)) {
5216     my $__location;
5217     __CODE{xp|get-location-from-token::
5218     $token => {$token},
5219     $result => {$__location},
5220     }__;
5221     my $__continue = __c|ERROR{xp|wf-invalid-character-in-node-name::
5222     xp|error-token => {$token},
5223     c|location => {$__location},
5224     xp|name => {$name},
5225     infoset|version => {$self->{xml_version}},
5226     }__;
5227     unless ($__continue) {
5228 wakaba 1.27 __CODE{ParseError}__;
5229 wakaba 1.26 }
5230     } elsif (($self->{xml_version} eq '1.0' and
5231     not <Code::DOMMain|testXML10QName:: $INPUT = $name>) or
5232     ($self->{xml_version} eq '1.1' and
5233     not <Code::DOMMain|testXML11QName:: $INPUT = $name>)) {
5234     my $__location;
5235     __CODE{xp|get-location-from-token::
5236     $token => {$token},
5237     $result => {$__location},
5238     }__;
5239     my $__continue = __c|ERROR{xp|nswf-legal-qname::
5240     xp|error-token => {$token},
5241     c|location => {$__location},
5242     xp|name => {$name},
5243     infoset|version => {$self->{xml_version}},
5244     }__;
5245     unless ($__continue) {
5246 wakaba 1.27 __CODE{ParseError}__;
5247 wakaba 1.26 }
5248     }
5249    
5250    
5251 wakaba 1.5 @XMLTests:
5252     @@XMLTest:
5253 wakaba 1.15 @@@QName: xp.char.xml10.test
5254     @@@DEnt:
5255     @@@@test:value:
5256     <?xml version="1.0"?>
5257     <p>$u0009$u000A$u000D$u0020$uD7FF$uE000$uFFFD$U00010000$U0010FFFF</p>
5258     @@@test:domTree:
5259     document {
5260     xml-version: '1.0';
5261     element {
5262     text-content: U+0009 U+000A U+000A U+0020 U+D7FF
5263     U+E000 U+FFFD U+10000 U+10FFFF;
5264     }
5265     }
5266     @@XMLTest:
5267     @@@QName: xp.char.xml11.test
5268     @@@DEnt:
5269     @@@@test:value:
5270     <?xml version="1.1"?>
5271     <p>$u0009$u000A$u000D$u0020$uD7FF$uE000$uFFFD$U00010000$U0010FFFF</p>
5272     @@@test:domTree:
5273     document {
5274     xml-version: '1.1';
5275     element {
5276     text-content: U+0009 U+000A U+000A U+0020 U+D7FF
5277     U+E000 U+FFFD U+10000 U+10FFFF;
5278     }
5279     }
5280     @@XMLTest:
5281     @@@QName: xp.char.xml10.c0.test
5282     @@@DEnt:
5283     @@@@test:value:
5284     <?xml version="1.0"?>
5285     <p>$u0000$u0001$u0002$u0003$u0004$u0005$u0006$u0007$u0008$u000B$
5286     $u000C$u000E$u000F$u0010$u0011$u0012$u0013$u0014$u0015$u0016$
5287     $u0017$u0018$u0019$u001A$u001B$u001C$u001D$u001E$u001F</p>
5288     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 4); } /* U+0000 */
5289     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 5); } /* U+0001 */
5290     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 6); } /* U+0002 */
5291     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 7); } /* U+0003 */
5292     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 8); } /* U+0004 */
5293     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 9); } /* U+0005 */
5294     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 10); } /* U+0006 */
5295     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 11); } /* U+0007 */
5296     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 12); } /* U+0008 */
5297     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 13); } /* U+000B */
5298     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 14); } /* U+000C */
5299     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 15); } /* U+000E */
5300     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 16); } /* U+000F */
5301     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 17); } /* U+0010 */
5302     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 18); } /* U+0011 */
5303     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 19); } /* U+0012 */
5304     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 20); } /* U+0013 */
5305     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 21); } /* U+0014 */
5306     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 22); } /* U+0015 */
5307     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 23); } /* U+0016 */
5308     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 24); } /* U+0017 */
5309     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 25); } /* U+0018 */
5310     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 26); } /* U+0019 */
5311     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 27); } /* U+001A */
5312     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 28); } /* U+001B */
5313     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 29); } /* U+001C */
5314     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 30); } /* U+001D */
5315     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 31); } /* U+001E */
5316     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 32); } /* U+001F */
5317     @@XMLTest:
5318     @@@QName: xp.char.xml11.c0.test
5319     @@@DEnt:
5320     @@@@test:value:
5321     <?xml version="1.1"?>
5322     <p>$u0000$u0001$u0002$u0003$u0004$u0005$u0006$u0007$u0008$u000B$
5323     $u000C$u000E$u000F$u0010$u0011$u0012$u0013$u0014$u0015$u0016$
5324     $u0017$u0018$u0019$u001A$u001B$u001C$u001D$u001E$u001F</p>
5325     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 4); } /* U+0000 */
5326     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 5); } /* U+0001 */
5327     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 6); } /* U+0002 */
5328     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 7); } /* U+0003 */
5329     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 8); } /* U+0004 */
5330     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 9); } /* U+0005 */
5331     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 10); } /* U+0006 */
5332     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 11); } /* U+0007 */
5333     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 12); } /* U+0008 */
5334     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 13); } /* U+000B */
5335     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 14); } /* U+000C */
5336     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 15); } /* U+000E */
5337     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 16); } /* U+000F */
5338     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 17); } /* U+0010 */
5339     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 18); } /* U+0011 */
5340     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 19); } /* U+0012 */
5341     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 20); } /* U+0013 */
5342     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 21); } /* U+0014 */
5343     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 22); } /* U+0015 */
5344     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 23); } /* U+0016 */
5345     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 24); } /* U+0017 */
5346     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 25); } /* U+0018 */
5347     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 26); } /* U+0019 */
5348     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 27); } /* U+001A */
5349     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 28); } /* U+001B */
5350     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 29); } /* U+001C */
5351     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 30); } /* U+001D */
5352     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 31); } /* U+001E */
5353     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 32); } /* U+001F */
5354     @@XMLTest:
5355     @@@QName: xp.char.xml10.c1.test
5356     @@@DEnt:
5357     @@@@test:value:
5358     <?xml version="1.0"?>
5359     <p>$u007F$u0080$u0081$u0082$u0083$u0084$u0086$u0087$u0088$
5360     $u0089$u008A$u008B$u008C$
5361     $u008D$u008E$u008F$u0090$u0091$u0092$u0093$u0094$u0095$u0096$
5362     $u0097$u0098$u0099$u009A$u009B$u009C$u009D$u009E$u009F$u0085</p>
5363     @@@test:domTree:
5364     document {
5365     xml-version: '1.0';
5366     element {
5367     text-content: U+007F U+0080 U+0081 U+0082 U+0083 U+0084 U+0086
5368     U+0087 U+0088 U+0089 U+008A U+008B U+008C U+008D
5369     U+008E U+008F U+0090 U+0091 U+0092 U+0093 U+0094
5370     U+0095 U+0096 U+0097 U+0098 U+0099 U+009A U+009B
5371     U+009C U+009D U+009E U+009F U+0085;
5372     }
5373     }
5374     @@XMLTest:
5375     @@@QName: xp.char.xml11.c1.test
5376     @@@DEnt:
5377     @@@@test:value:
5378     <?xml version="1.1"?>
5379     <p>$u007F$u0080$u0081$u0082$u0083$u0084$u0086$u0087$u0088$
5380     $u0089$u008A$u008B$u008C$
5381     $u008D$u008E$u008F$u0090$u0091$u0092$u0093$u0094$u0095$u0096$
5382     $u0097$u0098$u0099$u009A$u009B$u009C$u009D$u009E$u009F$u0085</p>
5383     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 4); } /* U+007F */
5384     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 5); } /* U+0080 */
5385     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 6); } /* U+0081 */
5386     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 7); } /* U+0082 */
5387     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 8); } /* U+0083 */
5388     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 9); } /* U+0084 */
5389     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 10); } /* U+0086 */
5390     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 11); } /* U+0087 */
5391     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 12); } /* U+0088 */
5392     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 13); } /* U+0089 */
5393     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 14); } /* U+008A */
5394     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 15); } /* U+008B */
5395     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 16); } /* U+008C */
5396     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 17); } /* U+008D */
5397     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 18); } /* U+008E */
5398     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 19); } /* U+008F */
5399     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 20); } /* U+0090 */
5400     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 21); } /* U+0091 */
5401     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 22); } /* U+0092 */
5402     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 23); } /* U+0093 */
5403     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 24); } /* U+0094 */
5404     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 25); } /* U+0095 */
5405     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 26); } /* U+0096 */
5406     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 27); } /* U+0097 */
5407     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 28); } /* U+0098 */
5408     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 29); } /* U+0099 */
5409     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 30); } /* U+009A */
5410     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 31); } /* U+009B */
5411     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 32); } /* U+009C */
5412     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 33); } /* U+009D */
5413     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 34); } /* U+009E */
5414     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 35); } /* U+009F */
5415    
5416     @@XMLTest:
5417 wakaba 1.27 @@@QName: xp.c0.internal.entity.xml11.1.test
5418     @@@DEnt:
5419     @@@@test:value:
5420     <?xml version="1.1"?>
5421     <!DOCTYPE a [
5422     <!ENTITY e "&#x01;&#x02;&#x03;&#x04;&#x05;&#x06;&#x07;$
5423     &#x08;&#x09;&#x0A;&#x0B;&#x0C;&#x0D;&#x0E;&#x0F;$
5424     &#x10;&#x11;&#x12;&#x13;&#x14;&#x15;&#x16;&#x17;$
5425     &#x18;&#x19;&#x1A;&#x1B;&#x1C;&#x1D;&#x1E;&#x1F;">
5426     ]><a/>
5427     @@@test:domTree:
5428     document {
5429     document-type {
5430     general-entity {
5431     node-name: 'e';
5432     text-content: U+0001 U+0002 U+0003 U+0004 U+0005
5433     U+0006 U+0007 U+0008 U+0009 U+000A U+000B
5434     U+000C U+000D U+000E U+000F
5435     U+0010 U+0011 U+0012 U+0013 U+0014 U+0015
5436     U+0016 U+0017 U+0018 U+0019 U+001A U+001B
5437     U+001C U+001D U+001E U+001F;
5438     }
5439     }
5440     element { }
5441     }
5442     @@XMLTest:
5443     @@@QName: xp.c1.internal.entity.xml11.1.test
5444     @@@DEnt:
5445     @@@@test:value:
5446     <?xml version="1.1"?>
5447     <!DOCTYPE a [
5448     <!ENTITY e "&#x80;&#x81;&#x82;&#x83;&#x84;&#x85;&#x86;&#x87;$
5449     &#x88;&#x89;&#x8A;&#x8B;&#x8C;&#x8D;&#x8E;&#x8F;$
5450     &#x90;&#x91;&#x92;&#x93;&#x94;&#x95;&#x96;&#x97;$
5451     &#x98;&#x99;&#x9A;&#x9B;&#x9C;&#x9D;&#x9E;&#x9F;&#x7F;">
5452     ]><a/>
5453     @@@test:domTree:
5454     document {
5455     document-type {
5456     general-entity {
5457     node-name: 'e';
5458     text-content: U+0080 U+0081 U+0082 U+0083 U+0084 U+0085
5459     U+0086 U+0087 U+0088 U+0089 U+008A U+008B
5460     U+008C U+008D U+008E U+008F
5461     U+0090 U+0091 U+0092 U+0093 U+0094 U+0095
5462     U+0096 U+0097 U+0098 U+0099 U+009A U+009B
5463     U+009C U+009D U+009E U+009F U+007F;
5464     }
5465     }
5466     element { }
5467     }
5468    
5469     @@XMLTest:
5470 wakaba 1.12 @@@QName: xp.syntax.empty.test
5471     @@@DEnt:
5472     @@@@test:value: \
5473     @@@c:erred:
5474     <[[xp:wf-syntax-error]]> { (1, 1); }
5475     @@XMLTest:
5476     @@@QName: xp.syntax.space.test
5477     @@@DEnt:
5478 wakaba 1.13 @@@@test:value: \
5479 wakaba 1.12 @@@c:erred:
5480     <[[xp:wf-syntax-error]]> { (1, 4); }
5481     @@XMLTest:
5482     @@@QName: xp.syntax.newlines.test
5483     @@@DEnt:
5484     @@@@test:value:
5485     \
5486     \
5487     \
5488     @@@c:erred:
5489     <[[xp:wf-syntax-error]]> { (3, 1); }
5490    
5491     @@XMLTest:
5492 wakaba 1.6 @@@QName: xp.only.docel.test
5493 wakaba 1.5 @@@DEnt:
5494     @@@@test:value:
5495     <p></p>
5496     @@@test:domTree:
5497     document {
5498     xml-version: '1.0';
5499 wakaba 1.6 xml-encoding: null;
5500     xml-standalone: false;
5501     element {
5502     namespace-uri: null;
5503     prefix: null;
5504     local-name: 'p';
5505     text-content: '';
5506     }
5507     }
5508     @@XMLTest:
5509     @@@QName: xp.only.docel.emptyelemtag.test
5510     @@@DEnt:
5511     @@@@test:value:
5512     <p/>
5513     @@@test:domTree:
5514     document {
5515     xml-version: '1.0';
5516     xml-encoding: null;
5517     xml-standalone: false;
5518 wakaba 1.5 element {
5519     namespace-uri: null;
5520     prefix: null;
5521     local-name: 'p';
5522     text-content: '';
5523     }
5524     }
5525 wakaba 1.15 @@XMLTest:
5526     @@@QName: xp.root.s.1.test
5527     @@@DEnt:
5528     @@@@test:value:
5529     <?xml version="1.0"?>$u0020$u000D$u000A$u0009
5530     <p></p>
5531     @@@test:domTree:
5532     document {
5533     element { }
5534     }
5535    
5536     @@XMLTest:
5537     @@@QName: xp.Name.1.test
5538     @@@DEnt:
5539     @@@@test:value: <name/>
5540     @@@test:domTree:
5541     document {
5542     element {
5543     node-name: 'name';
5544     }
5545     }
5546     @@XMLTest:
5547     @@@QName: xp.Name.2.test
5548     @@@DEnt:
5549     @@@@test:value: <name0/>
5550     @@@test:domTree:
5551     document {
5552     element {
5553     node-name: 'name0';
5554     }
5555     }
5556     @@enImplNote:
5557     @@@ddid: xml11name
5558     @@@@:
5559     {TODO:: XML 1.1 Name tests required
5560     }
5561    
5562     @@XMLTest:
5563     @@@QName: xp.content.mse.1.test
5564     @@@DEnt:
5565     @@@@test:value:
5566     <p>]]></p>
5567     @@@c:erred:
5568     <[[xp|wf-syntax-error]]> { (1, 4)..(1, 6); }
5569     @@XMLTest:
5570     @@@QName: xp.content.mse.2.test
5571     @@@DEnt:
5572     @@@@test:value:
5573     <p>aaa]]>bbb</p>
5574     @@@c:erred:
5575     <[[xp|wf-syntax-error]]> { (1, 7)..(1, 9); }
5576    
5577     @@XMLTest:
5578     @@@QName: xp.root.comment.1.test
5579     @@@DEnt:
5580     @@@@test:value:
5581     <!--comment data-->
5582     <p/>
5583     @@@test:domTree:
5584     document {
5585     comment {
5586     data: 'comment data';
5587     }
5588     element { }
5589     }
5590     @@XMLTest:
5591     @@@QName: xp.root.comment.2.test
5592     @@@DEnt:
5593     @@@@test:value:
5594     <!---->
5595     <p/>
5596     @@@test:domTree:
5597     document {
5598     comment {
5599     data: '';
5600     }
5601     element { }
5602     }
5603     @@XMLTest:
5604     @@@QName: xp.root.after.pi.comment.1.test
5605     @@@DEnt:
5606     @@@@test:value:
5607     <?pi?>
5608     <!--comment data-->
5609     <p/>
5610     @@@test:domTree:
5611     document {
5612     pi { }
5613     comment {
5614     data: 'comment data';
5615     }
5616     element { }
5617     }
5618     @@XMLTest:
5619     @@@QName: xp.root.after.pi.comment.2.test
5620     @@@DEnt:
5621     @@@@test:value:
5622     <?pi?>
5623     <!---->
5624     <p/>
5625     @@@test:domTree:
5626     document {
5627     pi { }
5628     comment {
5629     data: '';
5630     }
5631     element { }
5632     }
5633     @@XMLTest:
5634     @@@QName: xp.root.after.element.comment.1.test
5635     @@@DEnt:
5636     @@@@test:value:
5637     <p/>
5638     <!--comment data-->
5639     @@@test:domTree:
5640     document {
5641     element { }
5642     comment {
5643     data: 'comment data';
5644     }
5645     }
5646     @@XMLTest:
5647     @@@QName: xp.root.after.element.comment.2.test
5648     @@@DEnt:
5649     @@@@test:value:
5650     <p/>
5651     <!---->
5652     @@@test:domTree:
5653     document {
5654     element { }
5655     comment {
5656     data: '';
5657     }
5658     }
5659     @@XMLTest:
5660     @@@QName: xp.doctype.intsubset.comment.1.test
5661     @@@DEnt:
5662     @@@@test:value:
5663     <!DOCTYPE a [
5664     <!--comment data-->
5665     ]>
5666     <p/>
5667     @@@test:domTree:
5668     document {
5669     document-type { }
5670     element { }
5671     }
5672     @@XMLTest:
5673     @@@QName: xp.doctype.intsubset.comment.2.test
5674     @@@DEnt:
5675     @@@@test:value:
5676     <!DOCTYPE a [
5677     <!---->
5678     ]>
5679     <p/>
5680     @@@test:domTree:
5681     document {
5682     document-type { }
5683     element { }
5684     }
5685     @@XMLTest:
5686     @@@QName: xp.doctype.intsubset.comment.3.test
5687     @@@DEnt:
5688     @@@@test:value:
5689     <!DOCTYPE a [
5690     <?pi?>
5691     <!---->
5692     ]>
5693     <p/>
5694     @@@test:domTree:
5695     document {
5696     document-type {
5697     pi { }
5698     }
5699     element { }
5700     }
5701     @@XMLTest:
5702     @@@QName: xp.content.comment.1.test
5703     @@@DEnt:
5704     @@@@test:value:
5705     <p><!--comment data--></p>
5706     @@@test:domTree:
5707     document {
5708     element {
5709     comment {
5710     data: 'comment data';
5711     }
5712     }
5713     }
5714     @@XMLTest:
5715     @@@QName: xp.content.comment.2.test
5716     @@@DEnt:
5717     @@@@test:value:
5718     <p><!----></p>
5719     @@@test:domTree:
5720     document {
5721     element {
5722     comment {
5723     data: '';
5724     }
5725     }
5726     }
5727     @@XMLTest:
5728     @@@QName: xp.content.comment.3.test
5729     @@@DEnt:
5730     @@@@test:value:
5731     <p>aaaaa<!---->bbbbb</p>
5732     @@@test:domTree:
5733     document {
5734     element {
5735     text {
5736     data: 'aaaaa';
5737     }
5738     comment {
5739     data: '';
5740     }
5741     text {
5742     data: 'bbbbb';
5743     }
5744     }
5745     }
5746     @@XMLTest:
5747     @@@QName: xp.content.comment.--.1.test
5748     @@@DEnt:
5749     @@@@test:value:
5750     <p><!--data--data--></p>
5751     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 12)..(1, 17); }
5752     @@XMLTest:
5753     @@@QName: xp.content.comment.---gt.test
5754     @@@DEnt:
5755     @@@@test:value:
5756     <p><!--data---></p>
5757     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 12)..(1, 15); }
5758 wakaba 1.13
5759     @@XMLTest:
5760     @@@QName: xp.xmldecl.version.1.0.test
5761     @@@DEnt:
5762     @@@@test:value:
5763     <?xml version="1.0"?>
5764     <p></p>
5765     @@@test:domTree:
5766     document {
5767     xml-version: '1.0';
5768     xml-encoding: null;
5769     xml-standalone: false;
5770     element { }
5771     }
5772     @@XMLTest:
5773     @@@QName: xp.xmldecl.version.1.0.lita.test
5774     @@@DEnt:
5775     @@@@test:value:
5776     <?xml version='1.0'?>
5777     <p></p>
5778     @@@test:domTree:
5779     document {
5780     xml-version: '1.0';
5781     xml-encoding: null;
5782     xml-standalone: false;
5783     element { }
5784     }
5785     @@XMLTest:
5786     @@@QName: xp.xmldecl.version.1.0.s.test
5787     @@@DEnt:
5788     @@@@test:value:
5789     <?xml version = "1.0" ?>
5790     <p></p>
5791     @@@test:domTree:
5792     document {
5793     xml-version: '1.0';
5794     xml-encoding: null;
5795     xml-standalone: false;
5796     element { }
5797     }
5798     @@XMLTest:
5799     @@@QName: xp.xmldecl.version.1.1.test
5800     @@@DEnt:
5801     @@@@test:value:
5802     <?xml version="1.1"?>
5803     <p></p>
5804     @@@test:domTree:
5805     document {
5806     xml-version: '1.1';
5807     xml-encoding: null;
5808     xml-standalone: false;
5809     element { }
5810     }
5811    
5812     @@XMLTest:
5813     @@@QName: xp.xmldecl.version.1.0.encoding.usascii.test
5814     @@@DEnt:
5815     @@@@test:value:
5816     <?xml version="1.0" encoding="US-ascii"?>
5817     <p></p>
5818     @@@test:domTree:
5819     document {
5820     xml-version: '1.0';
5821     xml-encoding: 'US-ascii';
5822     xml-standalone: false;
5823     element { }
5824     }
5825     @@XMLTest:
5826     @@@QName: xp.xmldecl.version.1.0.encoding.usascii.lita.test
5827     @@@DEnt:
5828     @@@@test:value:
5829     <?xml version="1.0" encoding='US-ascii'?>
5830     <p></p>
5831     @@@test:domTree:
5832     document {
5833     xml-version: '1.0';
5834     xml-encoding: 'US-ascii';
5835     xml-standalone: false;
5836     element { }
5837     }
5838     @@XMLTest:
5839     @@@QName: xp.xmldecl.version.1.0.encoding.usascii.s.test
5840     @@@DEnt:
5841     @@@@test:value:
5842     <?xml version="1.0" encoding = "US-ascii" ?>
5843     <p></p>
5844     @@@test:domTree:
5845     document {
5846     xml-version: '1.0';
5847     xml-encoding: 'US-ascii';
5848     xml-standalone: false;
5849     element { }
5850     }
5851    
5852     @@XMLTest:
5853     @@@QName: xp.xmldecl.version.1.0.encoding.usascii.standalone.yes.test
5854     @@@DEnt:
5855     @@@@test:value:
5856     <?xml version="1.0" encoding="us-ascii" standalone="yes"?>
5857     <p></p>
5858     @@@test:domTree:
5859     document {
5860     xml-version: '1.0';
5861     xml-encoding: 'us-ascii';
5862     xml-standalone: true;
5863     element { }
5864     }
5865     @@XMLTest:
5866     @@@QName: xp.xmldecl.version.1.0.encoding.usascii.standalone.no.test
5867     @@@DEnt:
5868     @@@@test:value:
5869     <?xml version="1.0" encoding="us-ascii" standalone="no"?>
5870     <p></p>
5871     @@@test:domTree:
5872     document {
5873     xml-version: '1.0';
5874     xml-encoding: 'us-ascii';
5875     xml-standalone: false;
5876     element { }
5877     }
5878     @@XMLTest:
5879     @@@QName: xp.xmldecl.version.1.0.encoding.usascii.standalone.yes.lita.test
5880     @@@DEnt:
5881     @@@@test:value:
5882     <?xml version="1.0" encoding="us-ascii" standalone='yes'?>
5883     <p></p>
5884     @@@test:domTree:
5885     document {
5886     xml-version: '1.0';
5887     xml-encoding: 'us-ascii';
5888     xml-standalone: true;
5889     element { }
5890     }
5891     @@XMLTest:
5892     @@@QName: xp.xmldecl.version.1.0.encoding.usascii.standalone.yes.s.test
5893     @@@DEnt:
5894     @@@@test:value:
5895     <?xml version="1.0" encoding="us-ascii" standalone = "yes" ?>
5896     <p></p>
5897     @@@test:domTree:
5898     document {
5899     xml-version: '1.0';
5900     xml-encoding: 'us-ascii';
5901     xml-standalone: true;
5902     element { }
5903     }
5904 wakaba 1.14 @@XMLTest:
5905     @@@QName: xp.xmldecl.no.encoding.but.standalone.attr.test
5906     @@@DEnt:
5907     @@@@test:value:
5908     <?xml version="1.0" standalone="yes"?>
5909     <p></p>
5910     @@@test:domTree:
5911     document {
5912     xml-version: '1.0';
5913     xml-encoding: null;
5914     xml-standalone: true;
5915     element { }
5916     }
5917     @@XMLTest:
5918     @@@QName: xp.xmldecl.encoding.encname.test
5919     @@@DEnt:
5920     @@@@test:value:
5921     <?xml version="1.0" encoding="a-._01-"?>
5922     <p></p>
5923     @@@test:domTree:
5924     document {
5925     xml-version: '1.0';
5926     xml-encoding: 'a-._01-';
5927     xml-standalone: false;
5928     element { }
5929     }
5930    
5931     @@XMLTest:
5932     @@@QName: xp.xmldecl.no.s.no.attr.test
5933     @@@DEnt:
5934     @@@@test:value:
5935     <?xml?>
5936     <p></p>
5937     @@@c:erred:
5938 wakaba 1.16 <[[xp:wf-syntax-error]]> { (1, 1)..(1, 7); }
5939 wakaba 1.14 @@XMLTest:
5940     @@@QName: xp.xmldecl.s.no.attr.test
5941     @@@DEnt:
5942     @@@@test:value:
5943     <?xml ?>
5944     <p></p>
5945     @@@c:erred:
5946     <[[xp:wf-syntax-error]]> { (1, 8)..(1, 9); }
5947     @@XMLTest:
5948     @@@QName: xp.xmldecl.unknown.attr.test
5949     @@@DEnt:
5950     @@@@test:value:
5951     <?xml unknown="value"?>
5952     <p></p>
5953     @@@c:erred:
5954     <[[xp:wf-syntax-error]]> { (1, 8)..(1, 22); }
5955     @@XMLTest:
5956     @@@QName: xp.xmldecl.version.unknown.attr.test
5957     @@@DEnt:
5958     @@@@test:value:
5959     <?xml version="1.0" unknown="value"?>
5960     <p></p>
5961     @@@c:erred:
5962     <[[xp:wf-syntax-error]]> { (1, 21)..(1, 35); }
5963     @@XMLTest:
5964     @@@QName: xp.xmldecl.version.encoding.unknown.attr.test
5965     @@@DEnt:
5966     @@@@test:value:
5967     <?xml version="1.0" encoding="us-ascii" unknown="value"?>
5968     <p></p>
5969     @@@c:erred:
5970     <[[xp:wf-syntax-error]]> { (1, 41)..(1, 55); }
5971     @@XMLTest:
5972     @@@QName: xp.xmldecl.version.encoding.standalone.unknown.attr.test
5973     @@@DEnt:
5974     @@@@test:value:
5975     <?xml version="1.0" encoding="us-ascii" standalone="yes"
5976     unknown="value"?>
5977     <p></p>
5978     @@@c:erred:
5979     <[[xp:wf-syntax-error]]> { (2, 1)..(2, 15); }
5980     @@XMLTest:
5981     @@@QName: xp.xmldecl.no.version.but.encoding.attr.test
5982     @@@DEnt:
5983     @@@@test:value:
5984     <?xml encoding="us-ascii"?>
5985     <p></p>
5986     @@@c:erred:
5987     <[[xp:wf-syntax-error]]> { (1, 7)..(1, 25); }
5988     @@XMLTest:
5989     @@@QName: xp.xmldecl.no.version.but.standalone.attr.test
5990     @@@DEnt:
5991     @@@@test:value:
5992     <?xml standalone="yes"?>
5993     <p></p>
5994     @@@c:erred:
5995     <[[xp:wf-syntax-error]]> { (1, 7)..(1, 24); }
5996     @@XMLTest:
5997     @@@QName: xp.xmldecl.version.unsupported.test
5998     @@@DEnt:
5999     @@@@test:value:
6000     <?xml version="1.2"?>
6001     <p></p>
6002     @@@c:erred:
6003     <[[xp:wf-unsupported-xml-version]]> { (1, 7)..(1, 19); }
6004     @@XMLTest:
6005     @@@QName: xp.xmldecl.version.unsupported.2.test
6006     @@@DEnt:
6007     @@@@test:value:
6008     <?xml version=" 1.0 "?>
6009     <p></p>
6010     @@@c:erred:
6011     <[[xp:wf-unsupported-xml-version]]> { (1, 7)..(1, 21); }
6012     @@XMLTest:
6013     @@@QName: xp.xmldecl.version.unsupported.3.test
6014     @@@DEnt:
6015     @@@@test:value:
6016     <?xml version="01.00"?>
6017     <p></p>
6018     @@@c:erred:
6019     <[[xp:wf-unsupported-xml-version]]> { (1, 7)..(1, 21); }
6020     @@XMLTest:
6021     @@@QName: xp.xmldecl.encoding.malformed.1.test
6022     @@@DEnt:
6023     @@@@test:value:
6024     <?xml version="1.0" encoding="0088"?>
6025     <p></p>
6026     @@@c:erred:
6027     <[[xp:wf-malformed-enc-name]]> { (1, 21)..(1, 35); }
6028     @@XMLTest:
6029     @@@QName: xp.xmldecl.encoding.malformed.2.test
6030     @@@DEnt:
6031     @@@@test:value:
6032     <?xml version="1.0" encoding="D.V.D!"?>
6033     <p></p>
6034     @@@c:erred:
6035     <[[xp:wf-malformed-enc-name]]> { (1, 21)..(1, 38); }
6036     @@XMLTest:
6037     @@@QName: xp.xmldecl.standalone.malformed.1.test
6038     @@@DEnt:
6039     @@@@test:value:
6040     <?xml version="1.0" standalone="true"?>
6041     <p></p>
6042     @@@c:erred:
6043     <[[xp:wf-malformed-xml-standalone]]> { (1, 21)..(1, 38); }
6044     @@XMLTest:
6045     @@@QName: xp.xmldecl.standalone.malformed.2.test
6046     @@@DEnt:
6047     @@@@test:value:
6048     <?xml version="1.0" standalone="YES"?>
6049     <p></p>
6050     @@@c:erred:
6051     <[[xp:wf-malformed-xml-standalone]]> { (1, 21)..(1, 37); }
6052     @@XMLTest:
6053     @@@QName: xp.xmldecl.standalone.malformed.3.test
6054     @@@DEnt:
6055     @@@@test:value:
6056     <?xml version="1.0" standalone="no "?>
6057     <p></p>
6058     @@@c:erred:
6059     <[[xp:wf-malformed-xml-standalone]]> { (1, 21)..(1, 38); }
6060 wakaba 1.6
6061     @@XMLTest:
6062 wakaba 1.14 @@@QName: xp.no-xmldecl.xml...-pi.test
6063     @@@DEnt:
6064     @@@@test:value:
6065     <?xmldeclaration?>
6066     <a></a>
6067     @@@test:domTree:
6068     document {
6069     pi {
6070     node-name: 'xmldeclaration';
6071     node-value: '';
6072     }
6073     element { }
6074     }
6075     @@XMLTest:
6076     @@@QName: xp.no-xmldecl.xml...-pi.after.document.element.test
6077     @@@DEnt:
6078     @@@@test:value:
6079     <a></a>
6080     <?xmldeclaration?>
6081     @@@test:domTree:
6082     document {
6083     element { }
6084     pi {
6085     node-name: 'xmldeclaration';
6086     node-value: '';
6087     }
6088     }
6089     @@XMLTest:
6090     @@@QName: xp.no-xmldecl.xml...-pi.in.document.element.test
6091     @@@DEnt:
6092     @@@@test:value:
6093     <a>
6094     <?xmldeclaration?>
6095     </a>
6096     @@@test:domTree:
6097     document {
6098     element {
6099     text { }
6100     pi {
6101     node-name: 'xmldeclaration';
6102     node-value: '';
6103     }
6104     text { }
6105     }
6106     }
6107     @@XMLTest:
6108     @@@QName: xp.no-xmldecl.xml...-pi.in.doctype.test
6109     @@@DEnt:
6110     @@@@test:value:
6111     <!DOCTYPE a [
6112     <?xmldeclaration?>
6113     ]>
6114     <a></a>
6115     @@@test:domTree:
6116     document {
6117     document-type {
6118     pi {
6119     node-name: 'xmldeclaration';
6120     node-value: '';
6121     }
6122     }
6123     element { }
6124     }
6125    
6126     @@XMLTest:
6127     @@@QName: xp.XMLdecl.test
6128     @@@DEnt:
6129     @@@@test:value:
6130     <?XML version="1.0"?>
6131     <p></p>
6132     @@@c:erred:
6133     <[[xp:wf-pi-target-is-xml]]> { (1, 1)..(1, 5); }
6134     @@XMLTest:
6135     @@@QName: xp.Xmldecl.test
6136     @@@DEnt:
6137     @@@@test:value:
6138     <?Xml version="1.0"?>
6139     <p></p>
6140     @@@c:erred:
6141     <[[xp:wf-pi-target-is-xml]]> { (1, 1)..(1, 5); }
6142     @@XMLTest:
6143     @@@QName: xp.xmldecl.after.document.element.empty.test
6144     @@@DEnt:
6145     @@@@test:value:
6146     <p></p>
6147     <?xml?>
6148     @@@c:erred:
6149     <[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); }
6150     @@XMLTest:
6151     @@@QName: xp.xmldecl.after.document.element.test
6152     @@@DEnt:
6153     @@@@test:value:
6154     <p></p>
6155     <?xml version="1.0"?>
6156     @@@c:erred:
6157     <[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); }
6158     @@XMLTest:
6159     @@@QName: xp.xmldecl.in.element.empty.test
6160     @@@DEnt:
6161     @@@@test:value:
6162     <p>
6163     <?xml?>
6164     </p>
6165     @@@c:erred:
6166     <[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); }
6167     @@XMLTest:
6168     @@@QName: xp.xmldecl.in.element.test
6169     @@@DEnt:
6170     @@@@test:value:
6171     <p>
6172     <?xml version="1.0"?>
6173     </p>
6174     @@@c:erred:
6175     <[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); }
6176     @@XMLTest:
6177     @@@QName: xp.xmldecl.after.comment.test
6178     @@@DEnt:
6179     @@@@test:value:
6180     <!---->
6181     <?xml version="1.0"?>
6182     <p></p>
6183     @@@c:erred:
6184     <[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); }
6185     @@XMLTest:
6186     @@@QName: xp.xmldecl.after.comment.empty.test
6187     @@@DEnt:
6188     @@@@test:value:
6189     <!---->
6190     <?xml?>
6191     <p></p>
6192     @@@c:erred:
6193     <[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); }
6194     @@XMLTest:
6195     @@@QName: xp.xmldecl.after.pi.test
6196     @@@DEnt:
6197     @@@@test:value:
6198     <?xml-declaration?>
6199     <?xml version="1.0"?>
6200     <p></p>
6201     @@@c:erred:
6202     <[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); }
6203     @@XMLTest:
6204     @@@QName: xp.xmldecl.after.pi.empty.test
6205     @@@DEnt:
6206     @@@@test:value:
6207     <?xml-declaration?>
6208     <?xml?>
6209     <p></p>
6210     @@@c:erred:
6211     <[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); }
6212     @@XMLTest:
6213 wakaba 1.16 @@@QName: xp.xmldecl.after.pi.2.test
6214     @@@DEnt:
6215     @@@@test:value:
6216     <?declaration?>
6217     <?xml version="1.0"?>
6218     <p></p>
6219     @@@c:erred:
6220     <[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); }
6221     @@XMLTest:
6222     @@@QName: xp.xmldecl.after.pi.empty.2.test
6223     @@@DEnt:
6224     @@@@test:value:
6225     <?declaration?>
6226     <?xml?>
6227     <p></p>
6228     @@@c:erred:
6229     <[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); }
6230     @@XMLTest:
6231 wakaba 1.14 @@@QName: xp.xmldecl.after.doctype.test
6232     @@@DEnt:
6233     @@@@test:value:
6234     <!DOCTYPE a>
6235     <?xml version="1.0"?>
6236     <p></p>
6237     @@@c:erred:
6238     <[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); }
6239     @@XMLTest:
6240     @@@QName: xp.xmldecl.after.doctype.empty.test
6241     @@@DEnt:
6242     @@@@test:value:
6243     <!DOCTYPE a>
6244     <?xml?>
6245     <p></p>
6246     @@@c:erred:
6247     <[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); }
6248     @@XMLTest:
6249     @@@QName: xp.xmldecl.in.doctype.test
6250     @@@DEnt:
6251     @@@@test:value:
6252     <!DOCTYPE a [
6253     <?xml version="1.0"?>
6254     ]>
6255     <p></p>
6256     @@@c:erred:
6257     <[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); }
6258     @@XMLTest:
6259     @@@QName: xp.xmldecl.in.doctype.empty.test
6260     @@@DEnt:
6261     @@@@test:value:
6262     <!DOCTYPE a [
6263     <?xml?>
6264     ]>
6265     <p></p>
6266     @@@c:erred:
6267     <[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); }
6268    
6269     @@XMLTest:
6270     @@@QName: xp.pi.before.element.empty.test
6271     @@@DEnt:
6272     @@@@test:value:
6273     <?target?>
6274     <a></a>
6275     @@@test:domTree:
6276     document {
6277     pi {
6278     node-name: 'target';
6279     node-value: '';
6280     }
6281     element { }
6282     }
6283     @@XMLTest:
6284     @@@QName: xp.pi.before.element.s.test
6285     @@@DEnt:
6286     @@@@test:value:
6287     <?target ?>
6288     <a></a>
6289     @@@test:domTree:
6290     document {
6291     pi {
6292     node-name: 'target';
6293     node-value: '';
6294     }
6295     element { }
6296     }
6297     @@XMLTest:
6298     @@@QName: xp.pi.before.element.string.test
6299     @@@DEnt:
6300     @@@@test:value:
6301     <?target string?>
6302     <a></a>
6303     @@@test:domTree:
6304     document {
6305     pi {
6306     node-name: 'target';
6307     node-value: 'string';
6308     }
6309     element { }
6310     }
6311     @@XMLTest:
6312     @@@QName: xp.pi.before.element.string.s.test
6313     @@@DEnt:
6314     @@@@test:value:
6315     <?target string ?>
6316     <a></a>
6317     @@@test:domTree:
6318     document {
6319     pi {
6320     node-name: 'target';
6321     node-value: 'string ';
6322     }
6323     element { }
6324     }
6325     @@XMLTest:
6326     @@@QName: xp.pi.before.element.gt.test
6327     @@@DEnt:
6328     @@@@test:value:
6329     <?target string>string?>
6330     <a></a>
6331     @@@test:domTree:
6332     document {
6333     pi {
6334     node-name: 'target';
6335     node-value: 'string>string';
6336     }
6337     element { }
6338     }
6339     @@XMLTest:
6340     @@@QName: xp.pi.doctype.empty.test
6341     @@@DEnt:
6342     @@@@test:value:
6343     <!DOCTYPE a [
6344     <?target?>
6345     ]>
6346     <a></a>
6347     @@@test:domTree:
6348     document {
6349     document-type {
6350     pi {
6351     node-name: 'target';
6352     node-value: '';
6353     }
6354     }
6355     element { }
6356     }
6357    
6358     @@XMLTest:
6359     @@@QName: xp.pi.no.target.test
6360     @@@DEnt:
6361     @@@@test:value:
6362     <??>
6363     <p></p>
6364     @@@c:erred:
6365     <[[xp:wf-syntax-error]]> { (1, 3)..(1, 4); }
6366     @@XMLTest:
6367     @@@QName: xp.pi.no.target.2.test
6368     @@@DEnt:
6369     @@@@test:value:
6370     <? ?>
6371     <p></p>
6372     @@@c:erred:
6373     <[[xp:wf-syntax-error]]> { (1, 3)..(1, 4); }
6374     @@XMLTest:
6375     @@@QName: xp.pi.bad.target.1.test
6376     @@@DEnt:
6377     @@@@test:value:
6378     <?target! ?>
6379     <p></p>
6380     @@@c:erred:
6381     <[[xp:wf-syntax-error]]> { (1, 9)..(1, 9); }
6382     @@XMLTest:
6383     @@@QName: xp.pi.bad.target.2.test
6384     @@@DEnt:
6385     @@@@test:value:
6386     <?0target ?>
6387     <p></p>
6388     @@@c:erred:
6389     <[[xp:wf-syntax-error]]> { (1, 3)..(1, 3); }
6390    
6391     @@XMLTest:
6392 wakaba 1.15 @@@QName: xp.cdatasection.empty.1.test
6393     @@@DEnt:
6394     @@@@test:value:
6395     <p><![CDATA[]]></p>
6396     @@@test:domTree:
6397     document {
6398     element {
6399     cdata-section {
6400     data: '';
6401     }
6402     }
6403     }
6404     @@XMLTest:
6405     @@@QName: xp.cdatasection.empty.2.test
6406     @@@DEnt:
6407     @@@@test:value:
6408     <p>aa<![CDATA[]]>bb</p>
6409     @@@test:domTree:
6410     document {
6411     element {
6412     text { data: 'aa'; }
6413     cdata-section {
6414     data: '';
6415     }
6416     text { data: 'bb'; }
6417     }
6418     }
6419     @@XMLTest:
6420     @@@QName: xp.cdatasection.1.test
6421     @@@DEnt:
6422     @@@@test:value:
6423     <p><![CDATA[abcdefg]]></p>
6424     @@@test:domTree:
6425     document {
6426     element {
6427     cdata-section {
6428     data: 'abcdefg';
6429     }
6430     }
6431     }
6432     @@XMLTest:
6433     @@@QName: xp.cdatasection.2.test
6434     @@@DEnt:
6435     @@@@test:value:
6436     <p>aa<![CDATA[abcdefg]]>bb</p>
6437     @@@test:domTree:
6438     document {
6439     element {
6440     text { data: 'aa'; }
6441     cdata-section {
6442     data: 'abcdefg';
6443     }
6444     text { data: 'bb'; }
6445     }
6446     }
6447     @@XMLTest:
6448     @@@QName: xp.cdatasection.ref.1.test
6449     @@@DEnt:
6450     @@@@test:value:
6451     <p><![CDATA[a&amp;&#x32;&#32;%abc;&def;]]&gt;b]]></p>
6452     @@@test:domTree:
6453     document {
6454     element {
6455     cdata-section {
6456     data: 'a&amp;&#x32;&#32;%abc;&def;]]&gt;b';
6457     }
6458     }
6459     }
6460     @@XMLTest:
6461     @@@QName: xp.cdatasection.in.general.entity.test
6462     @@@DEnt:
6463     @@@@test:value:
6464     <!DOCTYPE p [
6465     <!ENTITY cdata "<![CDATA[text]]>">
6466     ]>
6467     <p>&cdata;</p>
6468     @@@test:domTree:
6469     document {
6470     document-type {
6471     general-entity {
6472     node-name: 'cdata';
6473     cdata-section {
6474     data: 'text';
6475     }
6476     }
6477     }
6478     element {
6479     general-entity-reference {
6480 wakaba 1.23 node-name: 'cdata';
6481 wakaba 1.19 is-expanded: true;
6482 wakaba 1.15 cdata-section {
6483     data: 'text';
6484     }
6485     }
6486     }
6487     }
6488     @@XMLTest:
6489     @@@QName: xp.cdatasection.no.mse.test
6490     @@@DEnt:
6491     @@@@test:value:
6492     <p><![CDATA[text</p>
6493     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 21); }
6494     @@XMLTest:
6495     @@@QName: xp.cdatasection.nest.test
6496     @@@DEnt:
6497     @@@@test:value:
6498     <p><![CDATA[text01<![CDATA[txt2]]>text3]]></p>
6499     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 40)..(1, 42); }
6500    
6501     @@XMLTest:
6502 wakaba 1.6 @@@QName: xp.doctype.empty.test
6503     @@@DEnt:
6504     @@@@test:value:
6505     <!DOCTYPE a>
6506     <a></a>
6507     @@@test:domTree:
6508     document {
6509     xml-version: '1.0';
6510     xml-encoding: null;
6511     xml-standalone: false;
6512     document-type {
6513     node-name: 'a';
6514 wakaba 1.17 public-id: null;
6515     system-id: null;
6516 wakaba 1.6 }
6517     element {
6518     namespace-uri: null;
6519     prefix: null;
6520     local-name: 'a';
6521     text-content: '';
6522     }
6523     }
6524 wakaba 1.15 @@XMLTest:
6525     @@@QName: xp.doctype.empty.after.document.element.test
6526     @@@DEnt:
6527     @@@@test:value:
6528     <a></a>
6529     <!DOCTYPE a>
6530     @@@c:erred: <[[xp|wf-syntax-error]]> { (2, 1)..(2, 12); }
6531     @@XMLTest:
6532     @@@QName: xp.doctype.empty.in.element.test
6533     @@@DEnt:
6534     @@@@test:value:
6535     <a>
6536     <!DOCTYPE a>
6537     </a>
6538     @@@c:erred: <[[xp|wf-syntax-error]]> { (2, 1)..(2, 12); }
6539     @@XMLTest:
6540     @@@QName: xp.doctype.empty.dup.test
6541     @@@DEnt:
6542     @@@@test:value:
6543     <!DOCTYPE a>
6544     <!DOCTYPE a>
6545     <a></a>
6546     @@@c:erred: <[[xp|wf-syntax-error]]> { (2, 1)..(2, 12); }
6547     @@XMLTest:
6548     @@@QName: xp.doctype.empty.in.intsubset.test
6549     @@@DEnt:
6550     @@@@test:value:
6551     <!DOCTYPE a [
6552     <!DOCTYPE a>
6553     ]>
6554     <a></a>
6555     @@@c:erred: <[[xp|wf-syntax-error]]> { (2, 1)..(2, 12); }
6556 wakaba 1.16 @@XMLTest:
6557     @@@QName: xp.doctype.no.s.no.name.test
6558     @@@DEnt:
6559     @@@@test:value:
6560     <!DOCTYPE>
6561     <a></a>
6562     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 10); }
6563     @@XMLTest:
6564     @@@QName: xp.doctype.no.name.test
6565     @@@DEnt:
6566     @@@@test:value:
6567     <!DOCTYPE >
6568     <a></a>
6569     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 11); }
6570     @@XMLTest:
6571     @@@QName: xp.doctype.name.s.test
6572     @@@DEnt:
6573     @@@@test:value:
6574     <!DOCTYPE aa >
6575     <aa></aa>
6576     @@@test:domTree:
6577     document {
6578     document-type {
6579     node-name: 'aa';
6580 wakaba 1.17 public-id: null;
6581     system-id: null;
6582 wakaba 1.16 }
6583     element { }
6584     }
6585     @@XMLTest:
6586     @@@QName: xp.doctype.no.mdc.test
6587     @@@DEnt:
6588     @@@@test:value:
6589     <!DOCTYPE aa
6590     <aa></aa>
6591     @@@c:erred: <[[xp|wf-syntax-error]]> { (2, 1); }
6592 wakaba 1.6
6593     @@XMLTest:
6594 wakaba 1.16 @@@QName: xp.doctype.intsubset.empty.1.test
6595 wakaba 1.6 @@@DEnt:
6596     @@@@test:value:
6597 wakaba 1.16 <!DOCTYPE a []>
6598 wakaba 1.6 <a></a>
6599     @@@test:domTree:
6600     document {
6601     xml-version: '1.0';
6602     xml-encoding: null;
6603     xml-standalone: false;
6604     document-type {
6605     node-name: 'a';
6606 wakaba 1.17 public-id: null;
6607     system-id: null;
6608 wakaba 1.6 }
6609     element {
6610     namespace-uri: null;
6611     prefix: null;
6612     local-name: 'a';
6613     text-content: '';
6614     }
6615     }
6616     @@XMLTest:
6617 wakaba 1.16 @@@QName: xp.doctype.intsubset.empty.2.test
6618 wakaba 1.6 @@@DEnt:
6619     @@@@test:value:
6620     <!DOCTYPE a [
6621 wakaba 1.16
6622 wakaba 1.6 ]>
6623     <a></a>
6624     @@@test:domTree:
6625     document {
6626     xml-version: '1.0';
6627     xml-encoding: null;
6628     xml-standalone: false;
6629     document-type {
6630     node-name: 'a';
6631 wakaba 1.17 public-id: null;
6632     system-id: null;
6633 wakaba 1.6 }
6634     element {
6635     namespace-uri: null;
6636     prefix: null;
6637     local-name: 'a';
6638     text-content: '';
6639     }
6640     }
6641     @@XMLTest:
6642 wakaba 1.16 @@@QName: xp.doctype.intsubset.empty.3.test
6643 wakaba 1.6 @@@DEnt:
6644     @@@@test:value:
6645 wakaba 1.16 <!DOCTYPE a[]>
6646 wakaba 1.6 <a></a>
6647     @@@test:domTree:
6648     document {
6649     document-type {
6650     node-name: 'a';
6651 wakaba 1.17 public-id: null;
6652     system-id: null;
6653 wakaba 1.6 }
6654 wakaba 1.16 element { }
6655     }
6656     @@XMLTest:
6657     @@@QName: xp.doctype.intsubset.empty.4.test
6658     @@@DEnt:
6659     @@@@test:value:
6660     <!DOCTYPE a[] >
6661     <a></a>
6662     @@@test:domTree:
6663     document {
6664     document-type {
6665     node-name: 'a';
6666 wakaba 1.17 public-id: null;
6667     system-id: null;
6668 wakaba 1.6 }
6669 wakaba 1.16 element { }
6670 wakaba 1.6 }
6671     @@XMLTest:
6672 wakaba 1.16 @@@QName: xp.doctype.intsubset.no.dsc.1.test
6673     @@@DEnt:
6674     @@@@test:value:
6675     <!DOCTYPE a [>
6676     <a></a>
6677     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 14); }
6678     @@XMLTest:
6679     @@@QName: xp.doctype.intsubset.no.dsc.2.test
6680 wakaba 1.6 @@@DEnt:
6681     @@@@test:value:
6682     <!DOCTYPE a [
6683     <a></a>
6684 wakaba 1.16 @@@c:erred: <[[xp|wf-syntax-error]]> { (2, 1); }
6685     @@XMLTest:
6686     @@@QName: xp.doctype.intsubset.no.dsc.3.test
6687     @@@DEnt:
6688     @@@@test:value:
6689     <!DOCTYPE a [
6690     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 14); }
6691     @@XMLTest:
6692     @@@QName: xp.doctype.intsubset.no.mdc.1.test
6693     @@@DEnt:
6694     @@@@test:value:
6695     <!DOCTYPE a []
6696     <a/>
6697     @@@c:erred: <[[xp|wf-syntax-error]]> { (2, 1); }
6698     @@XMLTest:
6699     @@@QName: xp.doctype.intsubset.no.mdc.2.test
6700     @@@DEnt:
6701     @@@@test:value:
6702     <!DOCTYPE a []]>
6703     <a/>
6704     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 15); }
6705 wakaba 1.17 @@XMLTest:
6706     @@@QName: xp.doctype.pubid.sysid.1.test
6707     @@@DEnt:
6708     @@@@test:value:
6709     <!DOCTYPE a PUBLIC "pubid" "sysid">
6710     <a/>
6711     @@@test:domTree:
6712     document {
6713     document-type {
6714     node-name: 'a';
6715     public-id: 'pubid';
6716     system-id: 'sysid';
6717     }
6718     element { }
6719     }
6720     @@XMLTest:
6721     @@@QName: xp.doctype.pubid.sysid.2.test
6722     @@@DEnt:
6723     @@@@test:value:
6724     <!DOCTYPE a PUBLIC 'pubid' "sysid">
6725     <a/>
6726     @@@test:domTree:
6727     document {
6728     document-type {
6729     node-name: 'a';
6730     public-id: 'pubid';
6731     system-id: 'sysid';
6732     }
6733     element { }
6734     }
6735     @@XMLTest:
6736     @@@QName: xp.doctype.pubid.sysid.3.test
6737     @@@DEnt:
6738     @@@@test:value:
6739     <!DOCTYPE a PUBLIC "pubid" 'sysid'>
6740     <a/>
6741     @@@test:domTree:
6742     document {
6743     document-type {
6744     node-name: 'a';
6745     public-id: 'pubid';
6746     system-id: 'sysid';
6747     }
6748     element { }
6749     }
6750     @@XMLTest:
6751     @@@QName: xp.doctype.pubid.sysid.4.test
6752     @@@DEnt:
6753     @@@@test:value:
6754     <!DOCTYPE a PUBLIC 'pubid' 'sysid'>
6755     <a/>
6756     @@@test:domTree:
6757     document {
6758     document-type {
6759     node-name: 'a';
6760     public-id: 'pubid';
6761     system-id: 'sysid';
6762     }
6763     element { }
6764     }
6765     @@XMLTest:
6766     @@@QName: xp.doctype.pubid.sysid.5.test
6767     @@@DEnt:
6768     @@@@test:value:
6769     <!DOCTYPE a PUBLIC "pubid" "sysid" >
6770     <a/>
6771     @@@test:domTree:
6772     document {
6773     document-type {
6774     node-name: 'a';
6775     public-id: 'pubid';
6776     system-id: 'sysid';
6777     }
6778     element { }
6779     }
6780     @@XMLTest:
6781     @@@QName: xp.doctype.pubid.sysid.6.test
6782     @@@DEnt:
6783     @@@@test:value:
6784     <!DOCTYPE a PUBLIC 'pubid' 'sysid' >
6785     <a/>
6786     @@@test:domTree:
6787     document {
6788     document-type {
6789     node-name: 'a';
6790     public-id: 'pubid';
6791     system-id: 'sysid';
6792     }
6793     element { }
6794     }
6795     @@XMLTest:
6796     @@@QName: xp.doctype.pubid.sysid.intsubset.1.test
6797     @@@DEnt:
6798     @@@@test:value:
6799     <!DOCTYPE a PUBLIC "pubid" "sysid"[]>
6800     <a/>
6801     @@@test:domTree:
6802     document {
6803     document-type {
6804     node-name: 'a';
6805     public-id: 'pubid';
6806     system-id: 'sysid';
6807     }
6808     element { }
6809     }
6810     @@XMLTest:
6811     @@@QName: xp.doctype.pubid.sysid.intsubset.2.test
6812     @@@DEnt:
6813     @@@@test:value:
6814     <!DOCTYPE a PUBLIC "pubid" "sysid" []>
6815     <a/>
6816     @@@test:domTree:
6817     document {
6818     document-type {
6819     node-name: 'a';
6820     public-id: 'pubid';
6821     system-id: 'sysid';
6822     }
6823     element { }
6824     }
6825     @@XMLTest:
6826     @@@QName: xp.doctype.pubid.sysid.intsubset.3.test
6827     @@@DEnt:
6828     @@@@test:value:
6829     <!DOCTYPE a PUBLIC 'pubid' 'sysid'[]>
6830     <a/>
6831     @@@test:domTree:
6832     document {
6833     document-type {
6834     node-name: 'a';
6835     public-id: 'pubid';
6836     system-id: 'sysid';
6837     }
6838     element { }
6839     }
6840     @@XMLTest:
6841     @@@QName: xp.doctype.pubid.sysid.intsubset.4.test
6842     @@@DEnt:
6843     @@@@test:value:
6844     <!DOCTYPE a PUBLIC 'pubid' 'sysid' []>
6845     <a/>
6846     @@@test:domTree:
6847     document {
6848     document-type {
6849     node-name: 'a';
6850     public-id: 'pubid';
6851     system-id: 'sysid';
6852     }
6853     element { }
6854     }
6855     @@XMLTest:
6856     @@@QName: xp.doctype.sysid.1.test
6857     @@@DEnt:
6858     @@@@test:value:
6859     <!DOCTYPE a SYSTEM "sysid">
6860     <a/>
6861     @@@test:domTree:
6862     document {
6863     document-type {
6864     node-name: 'a';
6865     public-id: null;
6866     system-id: 'sysid';
6867     }
6868     element { }
6869     }
6870     @@XMLTest:
6871     @@@QName: xp.doctype.sysid.2.test
6872     @@@DEnt:
6873     @@@@test:value:
6874     <!DOCTYPE a SYSTEM 'sysid'>
6875     <a/>
6876     @@@test:domTree:
6877     document {
6878     document-type {
6879     node-name: 'a';
6880     public-id: null;
6881     system-id: 'sysid';
6882     }
6883     element { }
6884     }
6885     @@XMLTest:
6886     @@@QName: xp.doctype.sysid.3.test
6887     @@@DEnt:
6888     @@@@test:value:
6889     <!DOCTYPE a SYSTEM "sysid" >
6890     <a/>
6891     @@@test:domTree:
6892     document {
6893     document-type {
6894     node-name: 'a';
6895     public-id: null;
6896     system-id: 'sysid';
6897     }
6898     element { }
6899     }
6900     @@XMLTest:
6901     @@@QName: xp.doctype.sysid.4.test
6902     @@@DEnt:
6903     @@@@test:value:
6904     <!DOCTYPE a SYSTEM 'sysid' >
6905     <a/>
6906     @@@test:domTree:
6907     document {
6908     document-type {
6909     node-name: 'a';
6910     public-id: null;
6911     system-id: 'sysid';
6912     }
6913     element { }
6914     }
6915     @@XMLTest:
6916     @@@QName: xp.doctype.sysid.intsubset.1.test
6917     @@@DEnt:
6918     @@@@test:value:
6919     <!DOCTYPE a SYSTEM "sysid"[]>
6920     <a/>
6921     @@@test:domTree:
6922     document {
6923     document-type {
6924     node-name: 'a';
6925     public-id: null;
6926     system-id: 'sysid';
6927     }
6928     element { }
6929     }
6930     @@XMLTest:
6931     @@@QName: xp.doctype.sysid.intsubset.2.test
6932     @@@DEnt:
6933     @@@@test:value:
6934     <!DOCTYPE a SYSTEM "sysid" []>
6935     <a/>
6936     @@@test:domTree:
6937     document {
6938     document-type {
6939     node-name: 'a';
6940     public-id: null;
6941     system-id: 'sysid';
6942     }
6943     element { }
6944     }
6945     @@XMLTest:
6946     @@@QName: xp.doctype.sysid.intsubset.3.test
6947     @@@DEnt:
6948     @@@@test:value:
6949     <!DOCTYPE a SYSTEM 'sysid'[]>
6950     <a/>
6951     @@@test:domTree:
6952     document {
6953     document-type {
6954     node-name: 'a';
6955     public-id: null;
6956     system-id: 'sysid';
6957     }
6958     element { }
6959     }
6960     @@XMLTest:
6961     @@@QName: xp.doctype.sysid.intsubset.4.test
6962     @@@DEnt:
6963     @@@@test:value:
6964     <!DOCTYPE a SYSTEM 'sysid' []>
6965     <a/>
6966     @@@test:domTree:
6967     document {
6968     document-type {
6969     node-name: 'a';
6970     public-id: null;
6971     system-id: 'sysid';
6972     }
6973     element { }
6974     }
6975     @@XMLTest:
6976     @@@QName: xp.doctype.public.stago.test
6977     @@@DEnt:
6978     @@@@test:value:
6979     <!DOCTYPE a PUBLIC<a/>
6980     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 19); }
6981     @@XMLTest:
6982     @@@QName: xp.doctype.public.mdc.test
6983     @@@DEnt:
6984     @@@@test:value:
6985     <!DOCTYPE a PUBLIC>
6986     <a/>
6987     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 19); }
6988     @@XMLTest:
6989     @@@QName: xp.doctype.public.s.stago.test
6990     @@@DEnt:
6991     @@@@test:value:
6992     <!DOCTYPE a PUBLIC <a/>
6993     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 20); }
6994     @@XMLTest:
6995     @@@QName: xp.doctype.public.s.mdc.test
6996     @@@DEnt:
6997     @@@@test:value:
6998     <!DOCTYPE a PUBLIC >
6999     <a/>
7000     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 20); }
7001     @@XMLTest:
7002     @@@QName: xp.doctype.public.lit.test
7003     @@@DEnt:
7004     @@@@test:value:
7005     <!DOCTYPE a PUBLIC"p" "s">
7006     <a/>
7007     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 19); }
7008     @@XMLTest:
7009     @@@QName: xp.doctype.public.lita.test
7010     @@@DEnt:
7011     @@@@test:value:
7012     <!DOCTYPE a PUBLIC'p' "s">
7013     <a/>
7014     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 19); }
7015     @@XMLTest:
7016     @@@QName: xp.doctype.pubid.lit.lita.unmatched.1.test
7017     @@@DEnt:
7018     @@@@test:value:
7019     <!DOCTYPE a PUBLIC "p' "s">
7020     <a/>
7021     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 25); }
7022     @@XMLTest:
7023     @@@QName: xp.doctype.pubid.lit.lita.unmatched.2.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.1.test
7030     @@@DEnt:
7031     @@@@test:value:
7032     <!DOCTYPE a PUBLIC 'p" "s"><a/>
7033     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 32); }
7034     @@XMLTest:
7035     @@@QName: xp.doctype.pubid.lita.lit.unmatched.2.test
7036     @@@DEnt:
7037     @@@@test:value:
7038     <!DOCTYPE a PUBLIC 'p" 's'>
7039     <a/>
7040     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 21)..(1, 25); }
7041     @@XMLTest:
7042     @@@QName: xp.doctype.public.s.lit.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.s.lita.mdc.test
7049     @@@DEnt:
7050     @@@@test:value:
7051     <!DOCTYPE a PUBLIC '><a/>
7052     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 26); }
7053     @@XMLTest:
7054     @@@QName: xp.doctype.public.lit.pubid.lit.mdc.test
7055     @@@DEnt:
7056     @@@@test:value:
7057     <!DOCTYPE a PUBLIC "p">
7058     <a/>
7059     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 23); }
7060     @@XMLTest:
7061     @@@QName: xp.doctype.public.lita.pubid.lita.mdc.test
7062     @@@DEnt:
7063     @@@@test:value:
7064     <!DOCTYPE a PUBLIC 'p'>
7065     <a/>
7066     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 23); }
7067     @@XMLTest:
7068     @@@QName: xp.doctype.public.lit.pubid.lit.s.mdc.test
7069     @@@DEnt:
7070     @@@@test:value:
7071     <!DOCTYPE a PUBLIC "p" >
7072     <a/>
7073     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 24); }
7074     @@XMLTest:
7075     @@@QName: xp.doctype.public.lita.pubid.lita.s.mdc.test
7076     @@@DEnt:
7077     @@@@test:value:
7078     <!DOCTYPE a PUBLIC 'p' >
7079     <a/>
7080     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 24); }
7081     @@XMLTest:
7082     @@@QName: xp.doctype.public.lit.pubid.lit.s.lit.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.lit.pubid.lit.s.lita.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.lit.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.lita.pubid.lita.s.lita.mdc.test
7101     @@@DEnt:
7102     @@@@test:value:
7103     <!DOCTYPE a PUBLIC 'p' '><a/>
7104     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 30); }
7105     @@XMLTest:
7106     @@@QName: xp.doctype.public.lit.pubid.lit.lit.lita.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.public.lita.pubid.lita.lita.lit.unmatched.mdc.test
7113     @@@DEnt:
7114     @@@@test:value:
7115     <!DOCTYPE a PUBLIC 'p' 's"><a/>
7116     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 32); }
7117     @@XMLTest:
7118     @@@QName: xp.doctype.pubid.sysid.stago.1.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.2.test
7125     @@@DEnt:
7126     @@@@test:value:
7127     <!DOCTYPE a PUBLIC "p" 's'<a/>
7128     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 27); }
7129     @@XMLTest:
7130     @@@QName: xp.doctype.pubid.sysid.stago.s.1.test
7131     @@@DEnt:
7132     @@@@test:value:
7133     <!DOCTYPE a PUBLIC "p" "s" <a/>
7134     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 28); }
7135     @@XMLTest:
7136     @@@QName: xp.doctype.pubid.sysid.stago.s.2.test
7137     @@@DEnt:
7138     @@@@test:value:
7139     <!DOCTYPE a PUBLIC "p" 's' <a/>
7140     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 28); }
7141 wakaba 1.16
7142     @@XMLTest:
7143     @@@QName: xp.endofline.1.0.crlf.test
7144     @@@DEnt:
7145     @@@@test:value:
7146     <?xml version="1.0"?>
7147     <p>aaa$u000D$u000Abbb</p>
7148 wakaba 1.6 @@@test:domTree:
7149     document {
7150     xml-version: '1.0';
7151 wakaba 1.16 element {
7152     text-content: 'aaa' U+000A 'bbb';
7153 wakaba 1.6 }
7154 wakaba 1.16 }
7155     @@XMLTest:
7156     @@@QName: xp.endofline.1.1.crlf.test
7157     @@@DEnt:
7158     @@@@test:value:
7159     <?xml version="1.1"?>
7160     <p>aaa$u000D$u000Abbb</p>
7161     @@@test:domTree:
7162     document {
7163     xml-version: '1.1';
7164 wakaba 1.6 element {
7165 wakaba 1.16 text-content: 'aaa' U+000A 'bbb';
7166 wakaba 1.6 }
7167     }
7168     @@XMLTest:
7169 wakaba 1.16 @@@QName: xp.endofline.1.0.crnl.test
7170 wakaba 1.6 @@@DEnt:
7171     @@@@test:value:
7172 wakaba 1.16 <?xml version="1.0"?>
7173     <p>aaa$u000D$u0085bbb</p>
7174 wakaba 1.6 @@@test:domTree:
7175     document {
7176     xml-version: '1.0';
7177 wakaba 1.16 element {
7178     text-content: 'aaa' U+000A U+0085 'bbb';
7179 wakaba 1.6 }
7180 wakaba 1.16 }
7181     @@XMLTest:
7182     @@@QName: xp.endofline.1.1.crnl.test
7183     @@@DEnt:
7184     @@@@test:value:
7185     <?xml version="1.1"?>
7186     <p>aaa$u000D$u0085bbb</p>
7187     @@@test:domTree:
7188     document {
7189     xml-version: '1.1';
7190 wakaba 1.6 element {
7191 wakaba 1.16 text-content: 'aaa' U+000A 'bbb';
7192 wakaba 1.6 }
7193     }
7194     @@XMLTest:
7195 wakaba 1.16 @@@QName: xp.endofline.1.0.nl.test
7196 wakaba 1.6 @@@DEnt:
7197     @@@@test:value:
7198 wakaba 1.16 <?xml version="1.0"?>
7199     <p>aaa$u0085bbb</p>
7200 wakaba 1.6 @@@test:domTree:
7201     document {
7202     xml-version: '1.0';
7203     element {
7204 wakaba 1.16 text-content: 'aaa' U+0085 'bbb';
7205 wakaba 1.6 }
7206     }
7207     @@XMLTest:
7208 wakaba 1.16 @@@QName: xp.endofline.1.1.nl.test
7209 wakaba 1.6 @@@DEnt:
7210     @@@@test:value:
7211 wakaba 1.16 <?xml version="1.1"?>
7212     <p>aaa$u0085bbb</p>
7213     @@@test:domTree:
7214     document {
7215     xml-version: '1.1';
7216     element {
7217     text-content: 'aaa' U+000A 'bbb';
7218     }
7219     }
7220     @@XMLTest:
7221     @@@QName: xp.endofline.1.0.ls.test
7222     @@@DEnt:
7223     @@@@test:value:
7224     <?xml version="1.0"?>
7225     <p>aaa$u2028bbb</p>
7226     @@@test:domTree:
7227     document {
7228     xml-version: '1.0';
7229     element {
7230     text-content: 'aaa' U+2028 'bbb';
7231     }
7232     }
7233     @@XMLTest:
7234     @@@QName: xp.endofline.1.1.ls.test
7235     @@@DEnt:
7236     @@@@test:value:
7237     <?xml version="1.1"?>
7238     <p>aaa$u2028bbb</p>
7239     @@@test:domTree:
7240     document {
7241     xml-version: '1.1';
7242     element {
7243     text-content: 'aaa' U+000A 'bbb';
7244     }
7245     }
7246     @@XMLTest:
7247     @@@QName: xp.endofline.1.0.cr.test
7248     @@@DEnt:
7249     @@@@test:value:
7250     <?xml version="1.0"?>
7251     <p>aaa$u000Dbbb</p>
7252     @@@test:domTree:
7253     document {
7254     xml-version: '1.0';
7255     element {
7256     text-content: 'aaa' U+000A 'bbb';
7257     }
7258     }
7259     @@XMLTest:
7260     @@@QName: xp.endofline.1.1.cr.test
7261     @@@DEnt:
7262     @@@@test:value:
7263     <?xml version="1.1"?>
7264     <p>aaa$u000Dbbb</p>
7265     @@@test:domTree:
7266     document {
7267     xml-version: '1.1';
7268     element {
7269     text-content: 'aaa' U+000A 'bbb';
7270     }
7271     }
7272     @@XMLTest:
7273     @@@QName: xp.endofline.1.0.lf.test
7274     @@@DEnt:
7275     @@@@test:value:
7276     <?xml version="1.0"?>
7277     <p>aaa$u000Abbb</p>
7278     @@@test:domTree:
7279     document {
7280     xml-version: '1.0';
7281     element {
7282     text-content: 'aaa' U+000A 'bbb';
7283     }
7284     }
7285     @@XMLTest:
7286     @@@QName: xp.endofline.1.1.lf.test
7287     @@@DEnt:
7288     @@@@test:value:
7289     <?xml version="1.1"?>
7290     <p>aaa$u000Abbb</p>
7291     @@@test:domTree:
7292     document {
7293     xml-version: '1.1';
7294     element {
7295     text-content: 'aaa' U+000A 'bbb';
7296     }
7297     }
7298     @@XMLTest:
7299     @@@QName: xp.xml10.endofline.nl.in.xmldecl.1.test
7300     @@@DEnt:
7301     @@@@test:value:
7302     <?xml$u0085version="1.0"?>
7303     <p/>
7304     @@@c:erred:
7305     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 6)..(2, 0); }
7306     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7307     @@XMLTest:
7308     @@@QName: xp.xml11.endofline.nl.in.xmldecl.1.test
7309     @@@DEnt:
7310     @@@@test:value:
7311     <?xml$u0085version="1.1"?>
7312     (err)<p/>
7313     @@@c:erred:
7314     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 6)..(2, 0); }
7315     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7316     @@XMLTest:
7317     @@@QName: xp.xml10.endofline.crnl.in.xmldecl.1.test
7318     @@@DEnt:
7319     @@@@test:value:
7320     <?xml$u000D$u0085version="1.0"?>
7321     <p/>
7322     @@@c:erred:
7323     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 6)..(2, 0); }
7324     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7325     @@XMLTest:
7326     @@@QName: xp.xml11.endofline.crnl.in.xmldecl.1.test
7327     @@@DEnt:
7328     @@@@test:value:
7329     <?xml$u000D$u0085version="1.1"?>
7330     (err)<p/>
7331     @@@c:erred:
7332     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 6)..(2, 0); }
7333     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7334     @@XMLTest:
7335     @@@QName: xp.xml10.endofline.ls.in.xmldecl.1.test
7336     @@@DEnt:
7337     @@@@test:value:
7338     <?xml$u2028version="1.0"?>
7339     <p/>
7340     @@@c:erred:
7341     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 6)..(2, 0); }
7342     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7343     @@XMLTest:
7344     @@@QName: xp.xml11.endofline.ls.in.xmldecl.1.test
7345     @@@DEnt:
7346     @@@@test:value:
7347     <?xml$u2028version="1.1"?>
7348     (err)<p/>
7349     @@@c:erred:
7350     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 6)..(2, 0); }
7351     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7352     @@XMLTest:
7353     @@@QName: xp.xml10.endofline.nl.in.xmldecl.2.test
7354     @@@DEnt:
7355     @@@@test:value:
7356     <?xml version="1.0"$u0085?>
7357     <p/>
7358     @@@c:erred:
7359     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 20)..(2, 0); }
7360     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7361     @@XMLTest:
7362     @@@QName: xp.xml11.endofline.nl.in.xmldecl.2.test
7363     @@@DEnt:
7364     @@@@test:value:
7365     <?xml version="1.1"$u0085?>
7366     (err)<p/>
7367     @@@c:erred:
7368     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 20)..(2, 0); }
7369     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7370     @@XMLTest:
7371     @@@QName: xp.xml10.endofline.crnl.in.xmldecl.2.test
7372     @@@DEnt:
7373     @@@@test:value:
7374     <?xml version="1.0"$u000D$u0085?>
7375     <p/>
7376     @@@c:erred:
7377     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 20)..(2, 0); }
7378     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7379     @@XMLTest:
7380     @@@QName: xp.xml11.endofline.crnl.in.xmldecl.2.test
7381     @@@DEnt:
7382     @@@@test:value:
7383     <?xml version="1.1"$u000D$u0085?>
7384     (err)<p/>
7385     @@@c:erred:
7386     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 20)..(2, 0); }
7387     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7388     @@XMLTest:
7389     @@@QName: xp.xml10.endofline.ls.in.xmldecl.2.test
7390     @@@DEnt:
7391     @@@@test:value:
7392     <?xml version="1.0"$u2028?>
7393     <p/>
7394     @@@c:erred:
7395     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 20)..(2, 0); }
7396     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7397     @@XMLTest:
7398     @@@QName: xp.xml11.endofline.ls.in.xmldecl.2.test
7399     @@@DEnt:
7400     @@@@test:value:
7401     <?xml version="1.1"$u2028?>
7402     (err)<p/>
7403     @@@c:erred:
7404     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 20)..(2, 0); }
7405     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7406     @@XMLTest:
7407     @@@QName: xp.xml10.endofline.nl.in.xmldecl.3.test
7408     @@@DEnt:
7409     @@@@test:value:
7410     <?xml $u0085version="1.0"?>
7411     <p/>
7412     @@@c:erred:
7413     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 7)..(2, 0); }
7414     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7415     @@XMLTest:
7416     @@@QName: xp.xml11.endofline.nl.in.xmldecl.3.test
7417     @@@DEnt:
7418     @@@@test:value:
7419     <?xml $u0085version="1.1"?>
7420     (err)<p/>
7421     @@@c:erred:
7422     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 7)..(2, 0); }
7423     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7424     @@XMLTest:
7425     @@@QName: xp.xml10.endofline.crnl.in.xmldecl.3.test
7426     @@@DEnt:
7427     @@@@test:value:
7428     <?xml $u000D$u0085version="1.0"?>
7429     <p/>
7430     @@@c:erred:
7431     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 7)..(2, 0); }
7432     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7433     @@XMLTest:
7434     @@@QName: xp.xml11.endofline.crnl.in.xmldecl.3.test
7435     @@@DEnt:
7436     @@@@test:value:
7437     <?xml $u000D$u0085version="1.1"?>
7438     (err)<p/>
7439     @@@c:erred:
7440     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 7)..(2, 0); }
7441     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7442     @@XMLTest:
7443     @@@QName: xp.xml10.endofline.ls.in.xmldecl.3.test
7444     @@@DEnt:
7445     @@@@test:value:
7446     <?xml $u2028version="1.0"?>
7447     <p/>
7448     @@@c:erred:
7449     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 7)..(2, 0); }
7450     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7451     @@XMLTest:
7452     @@@QName: xp.xml11.endofline.ls.in.xmldecl.3.test
7453     @@@DEnt:
7454     @@@@test:value:
7455     <?xml $u2028version="1.1"?>
7456     (err)<p/>
7457     @@@c:erred:
7458     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 7)..(2, 0); }
7459     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7460     @@XMLTest:
7461     @@@QName: xp.xml10implied.endofline.nl.in.pi.1.test
7462     @@@DEnt:
7463     @@@@test:value:
7464     <?xml-$u0085?>
7465     <p/>
7466     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 7)..(2, 0); }
7467     @@XMLTest:
7468     @@@QName: xp.xml10.endofline.nl.in.pi.1.test
7469     @@@DEnt:
7470     @@@@test:value:
7471     <?xml version="1.0"?>
7472     <?xml-$u0085?>
7473     <p/>
7474     @@@c:erred: <[[xp|wf-syntax-error]]> { (2, 7)..(3, 0); }
7475     @@XMLTest:
7476     @@@QName: xp.xml11.endofline.nl.in.pi.1.test
7477     @@@DEnt:
7478     @@@@test:value:
7479     <?xml version="1.1"?>
7480     <?xml-$u0085?>
7481     <p/>
7482     @@@test:domTree:
7483     document {
7484     xml-version: '1.1';
7485     pi {
7486     node-name: 'xml-';
7487     node-value: '';
7488     }
7489     element { }
7490     }
7491     @@XMLTest:
7492     @@@QName: xp.xml10implied.endofline.crnl.in.pi.1.test
7493     @@@DEnt:
7494     @@@@test:value:
7495     <?xml-$u000D$u0085?>
7496     <p/>
7497     @@@test:domTree:
7498     document {
7499     xml-version: '1.0';
7500     pi {
7501     node-name: 'xml-';
7502     node-value: U+0085;
7503     }
7504     element { }
7505     }
7506     @@XMLTest:
7507     @@@QName: xp.xml10.endofline.crnl.in.pi.1.test
7508     @@@DEnt:
7509     @@@@test:value:
7510     <?xml version="1.0"?>
7511     <?xml-$u000D$u0085?>
7512     <p/>
7513     @@@test:domTree:
7514     document {
7515     xml-version: '1.0';
7516     pi {
7517     node-name: 'xml-';
7518     node-value: U+0085;
7519     }
7520     element { }
7521     }
7522     @@XMLTest:
7523     @@@QName: xp.xml11.endofline.crnl.in.pi.1.test
7524     @@@DEnt:
7525     @@@@test:value:
7526     <?xml version="1.1"?>
7527     <?xml-$u000D$u0085?>
7528     <p/>
7529     @@@test:domTree:
7530     document {
7531     xml-version: '1.1';
7532     pi {
7533     node-name: 'xml-';
7534     node-value: '';
7535     }
7536     element { }
7537     }
7538     @@XMLTest:
7539     @@@QName: xp.xml10implied.endofline.ls.in.pi.1.test
7540     @@@DEnt:
7541     @@@@test:value:
7542     <?xml-$u2028?>
7543     <p/>
7544     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 7)..(2, 0); }
7545     @@XMLTest:
7546     @@@QName: xp.xml10.endofline.ls.in.pi.1.test
7547     @@@DEnt:
7548     @@@@test:value:
7549     <?xml version="1.0"?>
7550     <?xml-$u2028?>
7551     <p/>
7552     @@@c:erred: <[[xp|wf-syntax-error]]> { (2, 7)..(3, 0); }
7553     @@XMLTest:
7554     @@@QName: xp.xml11.endofline.ls.in.pi.1.test
7555     @@@DEnt:
7556     @@@@test:value:
7557     <?xml version="1.1"?>
7558     <?xml-$u2028?>
7559     <p/>
7560     @@@test:domTree:
7561     document {
7562     xml-version: '1.1';
7563     pi {
7564     node-name: 'xml-';
7565     node-value: '';
7566     }
7567     element { }
7568     }
7569 wakaba 1.27
7570     @@XMLTest:
7571     @@@QName: xp.xml10.endofline.internal.1.test
7572     @@@DEnt:
7573     @@@@test:value:
7574     <?xml version="1.0"?>
7575     <!DOCTYPE a [
7576     <!ENTITY e "&#x000D; &#x000A; &#x0085; &#x000D;&#x000A; $
7577     &#x000D;&#x0085; &#x2028;">
7578     ]><a>&e;</a>
7579     @@@test:domTree:
7580     document {
7581     xml-version: '1.0';
7582     document-type {
7583     general-entity {
7584     node-name: 'e';
7585     text-content: U+000D ' ' U+000A ' ' U+0085 ' '
7586     U+000D U+000A ' ' U+000D U+0085 ' ' U+2028;
7587     }
7588     }
7589     element {
7590     text-content: U+000D ' ' U+000A ' ' U+0085 ' '
7591     U+000D U+000A ' ' U+000D U+0085 ' ' U+2028;
7592     }
7593     }
7594     @@XMLTest:
7595     @@@QName: xp.xml11.endofline.internal.1.test
7596     @@@DEnt:
7597     @@@@test:value:
7598     <?xml version="1.1"?>
7599     <!DOCTYPE a [
7600     <!ENTITY e "&#x000D; &#x000A; &#x0085; &#x000D;&#x000A; $
7601     &#x000D;&#x0085; &#x2028;">
7602     ]><a>&e;</a>
7603     @@@test:domTree:
7604     document {
7605     xml-version: '1.1';
7606     document-type {
7607     general-entity {
7608     node-name: 'e';
7609     text-content: U+000D ' ' U+000A ' ' U+0085 ' '
7610     U+000D U+000A ' ' U+000D U+0085 ' ' U+2028;
7611     }
7612     }
7613     element {
7614     text-content: U+000D ' ' U+000A ' ' U+0085 ' '
7615     U+000D U+000A ' ' U+000D U+0085 ' ' U+2028;
7616     }
7617     }
7618    
7619 wakaba 1.16 @@XMLTest:
7620     @@@QName: xp.noxmldecl.pi.pi.test
7621     @@@DEnt:
7622     @@@@test:value:
7623     <?noxml 1?><?noxml 2?><p/>
7624     @@@test:domTree:
7625     document {
7626     xml-version: '1.0';
7627     pi {
7628     node-name: 'noxml';
7629     node-value: '1';
7630     }
7631     pi {
7632     node-name: 'noxml';
7633     node-value: '2';
7634     }
7635     element { }
7636     }
7637     @@XMLTest:
7638     @@@QName: xp.noxmldecl.pi.pi.2.test
7639     @@@DEnt:
7640     @@@@test:value:
7641     <?xmlno 1?><?xmlno 2?><p/>
7642     @@@test:domTree:
7643     document {
7644     xml-version: '1.0';
7645     pi {
7646     node-name: 'xmlno';
7647     node-value: '1';
7648     }
7649     pi {
7650     node-name: 'xmlno';
7651     node-value: '2';
7652     }
7653     element { }
7654     }
7655     @@XMLTest:
7656     @@@QName: xp.noxmldecl.pi.pi.3.test
7657     @@@DEnt:
7658     @@@@test:value:
7659     <?xmln 1?><?xmln 2?><p/>
7660     @@@test:domTree:
7661     document {
7662     xml-version: '1.0';
7663     pi {
7664     node-name: 'xmln';
7665     node-value: '1';
7666     }
7667     pi {
7668     node-name: 'xmln';
7669     node-value: '2';
7670     }
7671     element { }
7672     }
7673     @@XMLTest:
7674     @@@QName: xp.noxml.s.nl.test
7675     @@@DEnt:
7676     @@@@test:value:
7677     $u0085<p/>
7678     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 1)..(2, 0); }
7679     @@XMLTest:
7680     @@@QName: xp.noxml.s.crnl.test
7681     @@@DEnt:
7682     @@@@test:value:
7683     $u000D$u0085<p/>
7684     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 1)..(2, 0); }
7685     @@XMLTest:
7686     @@@QName: xp.noxml.s.ls.test
7687     @@@DEnt:
7688     @@@@test:value:
7689     $u2028<p/>
7690     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 1)..(2, 0); }
7691     @@XMLTest:
7692     @@@QName: xp.xml10.decl.s.nl.test
7693     @@@DEnt:
7694     @@@@test:value:
7695     <?xml version="1.0"?>$u0085<p/>
7696     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 22)..(2, 0); }
7697     @@XMLTest:
7698     @@@QName: xp.xml10.decl.s.crnl.test
7699     @@@DEnt:
7700     @@@@test:value:
7701     <?xml version="1.0"?>$u000D$u0085<p/>
7702     @@@c:erred: <[[xp|wf-syntax-error]]> { (2, 0)..(3, 0); }
7703     @@XMLTest:
7704     @@@QName: xp.xml10.decl.s.ls.test
7705     @@@DEnt:
7706     @@@@test:value:
7707     <?xml version="1.0"?>$u2028<p/>
7708     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 22)..(2, 0); }
7709     @@XMLTest:
7710     @@@QName: xp.xml11.decl.s.nl.test
7711     @@@DEnt:
7712     @@@@test:value:
7713     <?xml version="1.1"?>$u0085<p/>
7714     @@@test:domTree:
7715     document {
7716     xml-version: '1.1';
7717     element { }
7718     }
7719     @@XMLTest:
7720     @@@QName: xp.xml11.decl.s.crnl.test
7721     @@@DEnt:
7722     @@@@test:value:
7723     <?xml version="1.1"?>$u000D$u0085<p/>
7724     @@@test:domTree:
7725     document {
7726     xml-version: '1.1';
7727     element { }
7728     }
7729     @@XMLTest:
7730     @@@QName: xp.xml11.decl.s.ls.test
7731     @@@DEnt:
7732     @@@@test:value:
7733     <?xml version="1.1"?>$u2028<p/>
7734     @@@test:domTree:
7735     document {
7736     xml-version: '1.1';
7737     element { }
7738     }
7739    
7740     @@XMLTest:
7741 wakaba 1.18 @@@QName: xp.element.type.match.1.test
7742     @@@DEnt:
7743     @@@@test:value:
7744     <p></pa>(err)
7745     @@@c:erred: <[[xp|wf-element-type-match]]> { (1, 4)..(1, 8); }
7746     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7747     @@XMLTest:
7748     @@@QName: xp.element.type.match.2.test
7749     @@@DEnt:
7750     @@@@test:value:
7751     <p><pa></pa></pa>(err)
7752     @@@c:erred: <[[xp|wf-element-type-match]]> { (1, 13)..(1, 17); }
7753     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7754     @@XMLTest:
7755     @@@QName: xp.element.type.match.3.test
7756     @@@DEnt:
7757     @@@@test:value:
7758     <p><pa></p></p>(err)
7759     @@@c:erred: <[[xp|wf-element-type-match]]> { (1, 8)..(1, 11); }
7760     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7761     @@XMLTest:
7762     @@@QName: xp.element.type.match.4.test
7763     @@@DEnt:
7764     @@@@test:value:
7765     <a:p xmlns:a="about:1"></p>(err)
7766     @@@c:erred: <[[xp|wf-element-type-match]]> { (1, 24)..(1, 27); }
7767     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7768     @@XMLTest:
7769     @@@QName: xp.element.type.match.5.test
7770     @@@DEnt:
7771     @@@@test:value:
7772     <a:p xmlns:a="about:1" xmlns:b="about:1"></b:p>(err)
7773     @@@c:erred: <[[xp|wf-element-type-match]]> { (1, 42)..(1, 47); }
7774     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7775    
7776     @@XMLTest:
7777     @@@QName: xp.stag.stago.name.etago.test
7778     @@@DEnt:
7779     @@@@test:value:
7780     <a</a>
7781     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 3); }
7782     @@XMLTest:
7783     @@@QName: xp.stag.stago.name.s.etago.test
7784     @@@DEnt:
7785     @@@@test:value:
7786     <a </a>
7787     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 4); }
7788     @@XMLTest:
7789     @@@QName: xp.stag.stago.name.s.attr.etago.test
7790     @@@DEnt:
7791     @@@@test:value:
7792     <a a="b"</a>
7793     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 9); }
7794     @@XMLTest:
7795     @@@QName: xp.stag.stago.name.s.attr.s.attr.etago.test
7796     @@@DEnt:
7797     @@@@test:value:
7798     <a a="b" c="d"</a>
7799     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 15); }
7800     @@XMLTest:
7801     @@@QName: xp.stag.stago.name.s.attr.s.etago.test
7802     @@@DEnt:
7803     @@@@test:value:
7804     <a a="b" </a>
7805     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 10); }
7806     @@XMLTest:
7807     @@@QName: xp.stag.etag.1.test
7808 wakaba 1.16 @@@DEnt:
7809     @@@@test:value:
7810 wakaba 1.18 <root><a></a></root>
7811 wakaba 1.16 @@@test:domTree:
7812     document {
7813 wakaba 1.18 element {
7814     element {
7815     node-name: 'a';
7816 wakaba 1.16 }
7817     }
7818 wakaba 1.18 }
7819     @@XMLTest:
7820     @@@QName: xp.stag.etag.2.test
7821     @@@DEnt:
7822     @@@@test:value:
7823     <root><ab></ab></root>
7824     @@@test:domTree:
7825     document {
7826 wakaba 1.16 element {
7827 wakaba 1.18 element {
7828     node-name: 'ab';
7829     }
7830 wakaba 1.16 }
7831 wakaba 1.18 }
7832 wakaba 1.16 @@XMLTest:
7833 wakaba 1.18 @@@QName: xp.stag.etag.s.1.test
7834 wakaba 1.16 @@@DEnt:
7835     @@@@test:value:
7836 wakaba 1.18 <root><a ></a ></root>
7837 wakaba 1.16 @@@test:domTree:
7838     document {
7839 wakaba 1.18 element {
7840     element {
7841     node-name: 'a';
7842 wakaba 1.16 }
7843     }
7844 wakaba 1.18 }
7845     @@XMLTest:
7846     @@@QName: xp.etag.1.test
7847     @@@DEnt:
7848     @@@@test:value:
7849     <root><a/></root>
7850     @@@test:domTree:
7851     document {
7852 wakaba 1.16 element {
7853 wakaba 1.18 element {
7854     node-name: 'a';
7855     }
7856 wakaba 1.16 }
7857 wakaba 1.18 }
7858 wakaba 1.16 @@XMLTest:
7859 wakaba 1.18 @@@QName: xp.etag.2.test
7860 wakaba 1.16 @@@DEnt:
7861     @@@@test:value:
7862 wakaba 1.18 <root><a /></root>
7863 wakaba 1.16 @@@test:domTree:
7864     document {
7865     element {
7866 wakaba 1.18 element {
7867     node-name: 'a';
7868     }
7869 wakaba 1.16 }
7870 wakaba 1.18 }
7871 wakaba 1.16 @@XMLTest:
7872 wakaba 1.18 @@@QName: xp.stag.etag.attr.1.test
7873 wakaba 1.16 @@@DEnt:
7874     @@@@test:value:
7875 wakaba 1.18 <root><a at="v"></a></root>
7876 wakaba 1.16 @@@test:domTree:
7877     document {
7878 wakaba 1.18 element {
7879     element {
7880     node-name: 'a';
7881     attribute {
7882     node-name: 'at';
7883     value: 'v';
7884     }
7885 wakaba 1.16 }
7886     }
7887 wakaba 1.18 }
7888     @@XMLTest:
7889     @@@QName: xp.stag.etag.attr.2.test
7890     @@@DEnt:
7891     @@@@test:value:
7892     <root><a at="v" ></a></root>
7893     @@@test:domTree:
7894     document {
7895 wakaba 1.16 element {
7896 wakaba 1.18 element {
7897     node-name: 'a';
7898     attribute {
7899     node-name: 'at';
7900     value: 'v';
7901 wakaba 1.16 }
7902     }
7903     }
7904 wakaba 1.18 }
7905 wakaba 1.16 @@XMLTest:
7906 wakaba 1.18 @@@QName: xp.stag.etag.attr.3.test
7907 wakaba 1.16 @@@DEnt:
7908     @@@@test:value:
7909 wakaba 1.18 <root><a at ="v"></a></root>
7910 wakaba 1.16 @@@test:domTree:
7911     document {
7912 wakaba 1.18 element {
7913     element {
7914     node-name: 'a';
7915     attribute {
7916     node-name: 'at';
7917     value: 'v';
7918     }
7919 wakaba 1.16 }
7920     }
7921 wakaba 1.18 }
7922     @@XMLTest:
7923     @@@QName: xp.stag.etag.attr.4.test
7924     @@@DEnt:
7925     @@@@test:value:
7926     <root><a at= "v"></a></root>
7927     @@@test:domTree:
7928     document {
7929 wakaba 1.16 element {
7930 wakaba 1.18 element {
7931     node-name: 'a';
7932     attribute {
7933     node-name: 'at';
7934     value: 'v';
7935 wakaba 1.16 }
7936     }
7937 wakaba 1.18 }
7938     }
7939     @@XMLTest:
7940     @@@QName: xp.stag.etag.attr.5.test
7941     @@@DEnt:
7942     @@@@test:value:
7943     <root><a at='v'></a></root>
7944     @@@test:domTree:
7945     document {
7946     element {
7947     element {
7948     node-name: 'a';
7949     attribute {
7950     node-name: 'at';
7951     value: 'v';
7952 wakaba 1.16 }
7953     }
7954     }
7955 wakaba 1.18 }
7956 wakaba 1.16 @@XMLTest:
7957 wakaba 1.18 @@@QName: xp.stag.etag.attr.6.test
7958 wakaba 1.16 @@@DEnt:
7959     @@@@test:value:
7960 wakaba 1.18 <root><a at= 'v' ></a></root>
7961 wakaba 1.6 @@@test:domTree:
7962     document {
7963 wakaba 1.18 element {
7964     element {
7965     node-name: 'a';
7966     attribute {
7967     node-name: 'at';
7968     value: 'v';
7969     }
7970 wakaba 1.11 }
7971 wakaba 1.6 }
7972 wakaba 1.18 }
7973     @@XMLTest:
7974     @@@QName: xp.stag.etag.attr.attr.1.test
7975     @@@DEnt:
7976     @@@@test:value:
7977     <root><a at="v" tr="w"></a></root>
7978     @@@test:domTree:
7979     document {
7980 wakaba 1.6 element {
7981 wakaba 1.18 element {
7982     node-name: 'a';
7983     attribute {
7984     node-name: 'at';
7985     value: 'v';
7986 wakaba 1.6 }
7987 wakaba 1.18 attribute {
7988     node-name: 'tr';
7989     value: 'w';
7990 wakaba 1.6 }
7991     }
7992     }
7993 wakaba 1.18 }
7994 wakaba 1.6 @@XMLTest:
7995 wakaba 1.18 @@@QName: xp.stag.etag.attr.attr.2.test
7996 wakaba 1.6 @@@DEnt:
7997     @@@@test:value:
7998 wakaba 1.18 <root><a tr="w" at="v"></a></root>
7999 wakaba 1.6 @@@test:domTree:
8000     document {
8001 wakaba 1.18 element {
8002     element {
8003     node-name: 'a';
8004     attribute {
8005     node-name: 'at';
8006     value: 'v';
8007     }
8008     attribute {
8009     node-name: 'tr';
8010     value: 'w';
8011 wakaba 1.11 }
8012     }
8013 wakaba 1.6 }
8014 wakaba 1.18 }
8015     @@XMLTest:
8016     @@@QName: xp.stag.etag.attr.no.s.attr.test
8017     @@@DEnt:
8018     @@@@test:value:
8019     <root><a at="v"tr="w"></a></root>
8020     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 16)..(1, 17); }
8021     @@XMLTest:
8022     @@@QName: xp.etag.attr.1.test
8023     @@@DEnt:
8024     @@@@test:value:
8025     <root><a at="v" tr="w"></a b="c"></root>
8026     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 28); }
8027     @@XMLTest:
8028     @@@QName: xp.etag.no.etagc.1.test
8029     @@@DEnt:
8030     @@@@test:value:
8031     <root><a at="v" tr="w"></a</root>
8032     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 27)..(1, 28); }
8033     @@XMLTest:
8034     @@@QName: xp.etag.no.etagc.2.test
8035     @@@DEnt:
8036     @@@@test:value:
8037     <root><a at="v" tr="w"></a </root>
8038     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 29)..(1, 30); }
8039     @@XMLTest:
8040     @@@QName: xp.mtag.attr.1.test
8041     @@@DEnt:
8042     @@@@test:value:
8043     <root><a b="c"/></root>
8044     @@@test:domTree:
8045     document {
8046 wakaba 1.6 element {
8047 wakaba 1.18 element {
8048     node-name: 'a';
8049     attribute {
8050     node-name: 'b';
8051     value: 'c';
8052 wakaba 1.6 }
8053     }
8054 wakaba 1.8 }
8055 wakaba 1.18 }
8056 wakaba 1.11 @@XMLTest:
8057 wakaba 1.18 @@@QName: xp.mtag.attr.2.test
8058 wakaba 1.11 @@@DEnt:
8059     @@@@test:value:
8060 wakaba 1.18 <root><a b="c" /></root>
8061 wakaba 1.11 @@@test:domTree:
8062     document {
8063 wakaba 1.18 element {
8064     element {
8065     node-name: 'a';
8066     attribute {
8067     node-name: 'b';
8068     value: 'c';
8069     }
8070 wakaba 1.11 }
8071     }
8072 wakaba 1.18 }
8073 wakaba 1.11 @@XMLTest:
8074 wakaba 1.18 @@@QName: xp.mtag.attr.3.test
8075 wakaba 1.11 @@@DEnt:
8076     @@@@test:value:
8077 wakaba 1.18 <root><a b='c'/></root>
8078 wakaba 1.11 @@@test:domTree:
8079     document {
8080     element {
8081 wakaba 1.18 element {
8082     node-name: 'a';
8083     attribute {
8084     node-name: 'b';
8085     value: 'c';
8086     }
8087     }
8088 wakaba 1.11 }
8089 wakaba 1.18 }
8090 wakaba 1.11 @@XMLTest:
8091 wakaba 1.18 @@@QName: xp.mtag.attr.4.test
8092 wakaba 1.11 @@@DEnt:
8093     @@@@test:value:
8094 wakaba 1.18 <root><a b="c" d="e"/></root>
8095 wakaba 1.11 @@@test:domTree:
8096     document {
8097     element {
8098 wakaba 1.18 element {
8099     node-name: 'a';
8100     attribute {
8101     node-name: 'b';
8102     value: 'c';
8103     }
8104     attribute {
8105     node-name: 'd';
8106     value: 'e';
8107     }
8108 wakaba 1.11 }
8109     }
8110 wakaba 1.18 }
8111    
8112     @@XMLTest:
8113     @@@QName: xp.attvalue.lt.1.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.lt.2.test
8120     @@@DEnt:
8121     @@@@test:value:
8122     <a b='aa<dd'/>
8123     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 9); }
8124     @@XMLTest:
8125     @@@QName: xp.attvalue.amp.1.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.2.test
8132     @@@DEnt:
8133     @@@@test:value:
8134     <a b='aa& dd'/>
8135     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 9)..(1, 12); }
8136     @@XMLTest:
8137     @@@QName: xp.attvalue.amp.3.test
8138     @@@DEnt:
8139     @@@@test:value:
8140     <a b="aa&# dd"/>
8141     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 9)..(1, 13); }
8142     @@XMLTest:
8143     @@@QName: xp.attvalue.amp.4.test
8144     @@@DEnt:
8145     @@@@test:value:
8146     <a b="aa&#x dd"/>
8147     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 9)..(1, 14); }
8148    
8149     @@XMLTest:
8150     @@@QName: xp.unique.att.spec.1.test
8151     @@@DEnt:
8152     @@@@test:value:
8153     <a b="c" b="d"/>
8154     @@@c:erred: <[[xp|wf-unique-att-spec]]> { (1, 4)..(1, 14); }
8155     @@XMLTest:
8156     @@@QName: xp.unique.att.spec.2.test
8157     @@@DEnt:
8158     @@@@test:value:
8159     <a d:b="c" d:b="d" xmlns:d="about:2"/>
8160     @@@c:erred: <[[xp|wf-unique-att-spec]]> { (1, 4)..(1, 18); }
8161    
8162     @@XMLTest:
8163     @@@QName: xp.no.external.entity.references.1.test
8164     @@@DEnt:
8165     @@@@test:value:
8166     <!DOCTYPE a [
8167     <!ENTITY ent SYSTEM "something">
8168     ]>
8169     <a b="c&ent;"/>
8170     @@@c:erred: <[[xp|wf-no-external-entity-references]]> { (4, 8)..(4, 12); }
8171     @@XMLTest:
8172     @@@QName: xp.no.external.entity.references.2.test
8173     @@@DEnt:
8174     @@@@test:value:
8175     <!DOCTYPE a [
8176     <!NOTATION n SYSTEM "notation">
8177     <!ENTITY ent SYSTEM "something" NDATA n>
8178     ]>
8179     <a b="c&ent;"/>
8180     @@@c:erred: <[[xp|wf-no-external-entity-references]]> { (5, 8)..(5, 12); }
8181     @@XMLTest:
8182     @@@QName: xp.no.external.entity.references.3.test
8183     @@@DEnt:
8184     @@@@test:value:
8185     <!DOCTYPE a [
8186     <!ENTITY ent SYSTEM "something">
8187     <!ENTITY ent2 "ddd&ent;">
8188     ]>
8189     <a b="c&ent2;"/>
8190     @@@c:erred: <[[xp|wf-no-external-entity-references]]> { (1, 4)..(1, 8); }
8191     @@XMLTest:
8192     @@@QName: xp.no.external.entity.references.4.test
8193     @@@DEnt:
8194     @@@@test:value:
8195     <!DOCTYPE a [
8196     <!NOTATION n SYSTEM "notation">
8197     <!ENTITY ent SYSTEM "something" NDATA n>
8198     <!ENTITY ent2 "ddd&ent;">
8199     ]>
8200     <a b="c&ent2;"/>
8201     @@@c:erred: <[[xp|wf-no-external-entity-references]]> { (1, 4)..(1, 8); }
8202 wakaba 1.23 @@@c:erred: <[[xp|wf-parsed-entity]]> { }
8203 wakaba 1.18 @@XMLTest:
8204     @@@QName: xp.no.lt.in.attr.value.1.test
8205     @@@DEnt:
8206     @@@@test:value:
8207     <!DOCTYPE a [
8208     <!ENTITY ent "aa<bb">
8209     ]>
8210     <a b="c&ent;"/>
8211     @@@c:erred: <[[xp|wf-no-lt-in-attribute-values]]> { (1, 3); }
8212 wakaba 1.20 @@@c:erred:
8213     @@@@@: <[[xp|wf-syntax-error]]> { (1, 3)..(1, 6); }
8214     @@@@enImplNote: When entity node is created.
8215 wakaba 1.18 @@XMLTest:
8216     @@@QName: xp.no.lt.in.attr.value.2.test
8217     @@@DEnt:
8218     @@@@test:value:
8219     <!DOCTYPE a [
8220     <!ENTITY ent "aa<bb">
8221     <!ENTITY ent2 "ccc&ent;">
8222     ]>
8223     <a b="c&ent2;"/>
8224     @@@c:erred: <[[xp|wf-no-lt-in-attribute-values]]> { (1, 3); }
8225 wakaba 1.20 @@@c:erred:
8226     @@@@@: <[[xp|wf-syntax-error]]> { (1, 3)..(1, 6); }
8227     @@@@enImplNote: When entity node is created.
8228 wakaba 1.18 @@XMLTest:
8229     @@@QName: xp.no.lt.in.attr.value.3.test
8230     @@@DEnt:
8231     @@@@test:value:
8232     <!DOCTYPE a [
8233     <!ENTITY ent "aa&#x3C;bb">
8234     ]>
8235     <a b="c&ent;"/>
8236     @@@c:erred: <[[xp|wf-no-lt-in-attribute-values]]> { (1, 3); }
8237 wakaba 1.20 @@@c:erred:
8238     @@@@@: <[[xp|wf-syntax-error]]> { (1, 3)..(1, 6); }
8239     @@@@enImplNote: When entity node is created.
8240 wakaba 1.18 @@XMLTest:
8241     @@@QName: xp.no.lt.in.attr.value.4.test
8242     @@@DEnt:
8243     @@@@test:value:
8244     <!DOCTYPE a [
8245     <!ENTITY ent "aa&#x3C;bb">
8246     <!ENTITY ent2 "ccc&ent;">
8247     ]>
8248     <a b="c&ent2;"/>
8249     @@@c:erred: <[[xp|wf-no-lt-in-attribute-values]]> { (1, 3); }
8250 wakaba 1.20 @@@c:erred:
8251     @@@@@: <[[xp|wf-syntax-error]]> { (1, 3)..(1, 6); }
8252     @@@@enImplNote: When entity node is created.
8253 wakaba 1.11 @@XMLTest:
8254 wakaba 1.18 @@@QName: xp.ger.lt.in.attr.value.1.test
8255 wakaba 1.11 @@@DEnt:
8256     @@@@test:value:
8257     <!DOCTYPE a [
8258 wakaba 1.18 <!ENTITY ent "aa&lt;bb">
8259 wakaba 1.11 ]>
8260 wakaba 1.18 <a b="c&ent;"/>
8261 wakaba 1.11 @@@test:domTree:
8262     document {
8263     document-type {
8264     general-entity {
8265     node-name: 'ent';
8266 wakaba 1.18 text-content: 'aa<bb';
8267 wakaba 1.11 }
8268     }
8269     element {
8270 wakaba 1.18 attribute {
8271     node-name: 'b';
8272     text { data: 'c'; }
8273     general-entity-reference {
8274 wakaba 1.19 is-expanded: true;
8275 wakaba 1.18 node-name: 'ent';
8276     text-content: 'aa<bb';
8277     }
8278     }
8279 wakaba 1.11 }
8280     }
8281     @@XMLTest:
8282 wakaba 1.18 @@@QName: xp.ger.lt.in.attr.value.2.test
8283 wakaba 1.11 @@@DEnt:
8284     @@@@test:value:
8285     <!DOCTYPE a [
8286 wakaba 1.18 <!ENTITY ent "aa&lt;bb">
8287     <!ENTITY ent2 "ccc&ent;">
8288 wakaba 1.11 ]>
8289 wakaba 1.18 <a b="c&ent2;"/>
8290 wakaba 1.11 @@@test:domTree:
8291     document {
8292     document-type {
8293     general-entity {
8294 wakaba 1.18 node-name: 'ent';
8295     text-content: 'aa<bb';
8296     }
8297     general-entity {
8298     node-name: 'ent2';
8299     text { data: 'ccc'; }
8300     general-entity-reference {
8301     node-name: 'ent';
8302     text-content: 'aa<bb';
8303 wakaba 1.19 is-expanded: true;
8304 wakaba 1.18 }
8305 wakaba 1.11 }
8306     }
8307     element {
8308 wakaba 1.18 attribute {
8309     node-name: 'b';
8310     text { data: 'c'; }
8311     general-entity-reference {
8312     node-name: 'ent2';
8313     text { data: 'ccc'; }
8314     general-entity-reference {
8315     node-name: 'ent';
8316     text-content: 'aa<bb';
8317 wakaba 1.19 is-expanded: true;
8318 wakaba 1.18 }
8319 wakaba 1.19 is-expanded: true;
8320 wakaba 1.18 }
8321     }
8322 wakaba 1.11 }
8323     }
8324    
8325 wakaba 1.8 @@XMLTest:
8326 wakaba 1.18 @@@QName: xp.doctype.intsubset.pi.test
8327 wakaba 1.8 @@@DEnt:
8328     @@@@test:value:
8329     <!DOCTYPE a [
8330 wakaba 1.18 <?pi data ?>
8331 wakaba 1.8 ]>
8332     <a></a>
8333     @@@test:domTree:
8334     document {
8335     xml-version: '1.0';
8336     xml-encoding: null;
8337     xml-standalone: false;
8338     document-type {
8339     node-name: 'a';
8340 wakaba 1.18 pi {
8341     target: 'pi';
8342     data: 'data ';
8343 wakaba 1.8 }
8344     }
8345     element {
8346     namespace-uri: null;
8347 wakaba 1.18 prefix: null;
8348 wakaba 1.8 local-name: 'a';
8349 wakaba 1.18 text-content: '';
8350 wakaba 1.8 }
8351     }
8352 wakaba 1.18 @@@enImplNote:
8353     A DOM PI node in doctype node is a manakai extension.
8354    
8355    
8356 wakaba 1.8 @@XMLTest:
8357 wakaba 1.18 @@@QName: xp.doctype.intsubset.entity.general.internal.test
8358 wakaba 1.8 @@@DEnt:
8359     @@@@test:value:
8360     <!DOCTYPE a [
8361 wakaba 1.18 <!ENTITY entity "entity value">
8362 wakaba 1.8 ]>
8363     <a></a>
8364     @@@test:domTree:
8365     document {
8366     xml-version: '1.0';
8367     xml-encoding: null;
8368     xml-standalone: false;
8369     document-type {
8370     node-name: 'a';
8371 wakaba 1.18 general-entity {
8372     node-name: 'entity';
8373     text-content: 'entity value';
8374     has-replacement-tree: true;
8375 wakaba 1.8 }
8376     }
8377     element {
8378     namespace-uri: null;
8379 wakaba 1.18 prefix: null;
8380 wakaba 1.8 local-name: 'a';
8381 wakaba 1.18 text-content: '';
8382 wakaba 1.8 }
8383     }
8384     @@XMLTest:
8385 wakaba 1.18 @@@QName: xp.doctype.intsubset.entity.parameter.internal.test
8386 wakaba 1.8 @@@DEnt:
8387     @@@@test:value:
8388     <!DOCTYPE a [
8389 wakaba 1.18 <!ENTITY % entity "entity value">
8390 wakaba 1.8 ]>
8391     <a></a>
8392     @@@test:domTree:
8393     document {
8394     xml-version: '1.0';
8395     xml-encoding: null;
8396     xml-standalone: false;
8397     document-type {
8398     node-name: 'a';
8399     }
8400     element {
8401     namespace-uri: null;
8402 wakaba 1.18 prefix: null;
8403 wakaba 1.8 local-name: 'a';
8404 wakaba 1.18 text-content: '';
8405 wakaba 1.8 }
8406     }
8407 wakaba 1.18
8408 wakaba 1.8 @@XMLTest:
8409 wakaba 1.18 @@@QName: xp.doctype.internal.entity.root.element.text.only.test
8410 wakaba 1.8 @@@DEnt:
8411     @@@@test:value:
8412     <!DOCTYPE a [
8413 wakaba 1.18 <!ENTITY entity "entity value">
8414 wakaba 1.8 ]>
8415 wakaba 1.18 <a>&entity;</a>
8416 wakaba 1.8 @@@test:domTree:
8417     document {
8418     xml-version: '1.0';
8419     xml-encoding: null;
8420     xml-standalone: false;
8421     document-type {
8422     node-name: 'a';
8423 wakaba 1.18 general-entity {
8424     node-name: 'entity';
8425     text-content: 'entity value';
8426     has-replacement-tree: true;
8427 wakaba 1.8 }
8428     }
8429     element {
8430     namespace-uri: null;
8431 wakaba 1.18 prefix: null;
8432 wakaba 1.8 local-name: 'a';
8433 wakaba 1.18 general-entity-reference {
8434     node-name: 'entity';
8435     text {
8436     data: 'entity value';
8437     }
8438 wakaba 1.19 is-expanded: true;
8439 wakaba 1.10 }
8440 wakaba 1.9 }
8441     }
8442     @@XMLTest:
8443 wakaba 1.18 @@@QName: xp.doctype.internal.entity.root.element.text.mult.test
8444 wakaba 1.9 @@@DEnt:
8445     @@@@test:value:
8446     <!DOCTYPE a [
8447 wakaba 1.18 <!ENTITY entity "entity value">
8448 wakaba 1.9 ]>
8449 wakaba 1.18 <a>&entity; and &entity;</a>
8450 wakaba 1.9 @@@test:domTree:
8451     document {
8452     xml-version: '1.0';
8453     xml-encoding: null;
8454     xml-standalone: false;
8455     document-type {
8456     node-name: 'a';
8457 wakaba 1.18 general-entity {
8458     node-name: 'entity';
8459     text-content: 'entity value';
8460     has-replacement-tree: true;
8461 wakaba 1.9 }
8462     }
8463     element {
8464     namespace-uri: null;
8465 wakaba 1.18 prefix: null;
8466 wakaba 1.9 local-name: 'a';
8467 wakaba 1.18 general-entity-reference {
8468     node-name: 'entity';
8469     text {
8470     data: 'entity value';
8471     }
8472 wakaba 1.19 is-expanded: true;
8473 wakaba 1.18 }
8474     text { data: ' and '; }
8475     general-entity-reference {
8476     node-name: 'entity';
8477     text {
8478     data: 'entity value';
8479     }
8480 wakaba 1.19 is-expanded: true;
8481 wakaba 1.10 }
8482 wakaba 1.9 }
8483     }
8484     @@XMLTest:
8485 wakaba 1.18 @@@QName: xp.doctype.internal.entity.root.element.text.element.test
8486 wakaba 1.9 @@@DEnt:
8487     @@@@test:value:
8488     <!DOCTYPE a [
8489 wakaba 1.18 <!ENTITY entity "entity <p>value</p> with <e>element</e> ">
8490 wakaba 1.9 ]>
8491 wakaba 1.18 <a>&entity;</a>
8492     @@@test:domTree:
8493     document {
8494     xml-version: '1.0';
8495     xml-encoding: null;
8496     xml-standalone: false;
8497     document-type {
8498     node-name: 'a';
8499     general-entity {
8500     node-name: 'entity';
8501     has-replacement-tree: true;
8502     text { data: 'entity '; }
8503     element {
8504     node-name: 'p';
8505     text-content: 'value';
8506     }
8507     text { data: ' with '; }
8508     element {
8509     node-name: 'e';
8510     text-content: 'element';
8511     }
8512 wakaba 1.20 text { data: ' '; }
8513 wakaba 1.18 }
8514     }
8515     element {
8516     namespace-uri: null;
8517     prefix: null;
8518     local-name: 'a';
8519     general-entity-reference {
8520     node-name: 'entity';
8521 wakaba 1.19 is-expanded: true;
8522 wakaba 1.18 text {
8523     data: 'entity ';
8524     }
8525     element {
8526     namespace-uri: null;
8527     prefix: null;
8528     local-name: 'p';
8529     text {
8530     data: 'value';
8531     }
8532     }
8533     text {
8534     data: ' with ';
8535     }
8536     element {
8537     namespace-uri: null;
8538     prefix: null;
8539     local-name: 'e';
8540     text {
8541     data: 'element';
8542     }
8543     }
8544     text {
8545     data: ' ';
8546     }
8547     }
8548     }
8549     }
8550     @@XMLTest:
8551     @@@QName: xp.doctype.internal.entity.root.element.text.in.ent.test
8552     @@@DEnt:
8553     @@@@test:value:
8554     <!DOCTYPE a [
8555     <!ENTITY entity1 "entity value">
8556     <!ENTITY entity2 "e&entity1;n">
8557     ]>
8558     <a>&entity2;</a>
8559     @@@test:domTree:
8560     document {
8561     xml-version: '1.0';
8562     xml-encoding: null;
8563     xml-standalone: false;
8564     document-type {
8565     node-name: 'a';
8566     general-entity {
8567     node-name: 'entity1';
8568     text-content: 'entity value';
8569     }
8570     general-entity {
8571     node-name: 'entity2';
8572     text { data: 'e'; }
8573     general-entity-reference {
8574     node-name: 'entity1';
8575     text-content: 'entity value';
8576     is-expanded: true;
8577     }
8578     text { data: 'n'; }
8579     }
8580     }
8581     element {
8582     namespace-uri: null;
8583     prefix: null;
8584     local-name: 'a';
8585     general-entity-reference {
8586     node-name: 'entity2';
8587     text { data: 'e'; }
8588 wakaba 1.19 is-expanded: true;
8589 wakaba 1.18 general-entity-reference {
8590     node-name: 'entity1';
8591     text {
8592     data: 'entity value';
8593     }
8594 wakaba 1.19 is-expanded: true;
8595 wakaba 1.18 }
8596     text { data: 'n'; }
8597     }
8598     }
8599     }
8600    
8601     @@XMLTest:
8602     @@@QName: xp.doctype.entity.value.charref.test
8603     @@@DEnt:
8604     @@@@test:value:
8605     <!DOCTYPE a [
8606     <!ENTITY entity1 "entity &#x21;value&#35;">
8607     <!ENTITY entity2 '&#x21;value&#35;'>
8608     ]>
8609     <a></a>
8610     @@@test:domTree:
8611     document {
8612     document-type {
8613     general-entity {
8614     node-name: 'entity1';
8615     text-content: 'entity !value#';
8616     has-replacement-tree: true;
8617     }
8618     general-entity {
8619     node-name: 'entity2';
8620     text-content: '!value#';
8621     has-replacement-tree: true;
8622     }
8623     }
8624     element { }
8625     }
8626    
8627     @@XMLTest:
8628     @@@QName: xp.predefined.in.content.test
8629     @@@DEnt:
8630     @@@@test:value:
8631     <a>_&lt;_&gt;_&quot;_&apos;_&amp;_</a>
8632     @@@test:domTree:
8633     document {
8634     element {
8635     text-content: '_<_>_"_' U+0027 '_&_';
8636     }
8637     }
8638     @@XMLTest:
8639     @@@QName: xp.predefined.in.attr.test
8640     @@@DEnt:
8641     @@@@test:value:
8642     <a at="_&lt;_&gt;_&quot;_&apos;_&amp;_"></a>
8643     @@@test:domTree:
8644     document {
8645     element {
8646     attribute {
8647     node-name: 'at';
8648     text-content: '_<_>_"_' U+0027 '_&_';
8649     }
8650     }
8651     }
8652     @@XMLTest:
8653     @@@QName: xp.predefined.in.content.in.entity.test
8654     @@@DEnt:
8655     @@@@test:value:
8656     <!DOCTYPE a [
8657     <!ENTITY ent "_&lt;_&gt;_&quot;_&apos;_&amp;_">
8658     ]>
8659     <a>&ent;</a>
8660     @@@test:domTree:
8661     document {
8662     document-type {
8663     general-entity {
8664     node-name: 'ent';
8665     text-content: '_<_>_"_' U+0027 '_&_';
8666     }
8667     }
8668     element {
8669     text-content: '_<_>_"_' U+0027 '_&_';
8670     }
8671     }
8672     @@XMLTest:
8673     @@@QName: xp.predefined.decl.ignore.test
8674     @@@DEnt:
8675     @@@@test:value:
8676     <!DOCTYPE a [
8677     <!ENTITY lt "&#x26;#x3C;">
8678     <!ENTITY gt "&#x3E;">
8679     <!ENTITY amp "&#x26;#x26;">
8680     <!ENTITY quot "&#x22;">
8681     <!ENTITY apos "&#x27;">
8682     <!ENTITY other "other">
8683     ]>
8684     <a>_&lt;_&gt;_&quot;_&apos;_&amp;_&other;_</a>
8685     @@@test:domTree:
8686     document {
8687     document-type {
8688     general-entity {
8689     node-name: 'other';
8690     text-content: 'other';
8691     }
8692     }
8693     element {
8694     text-content: '_<_>_"_' U+0027 '_&_other_';
8695     }
8696     }
8697    
8698     @@XMLTest:
8699     @@@QName: xp.doctype.internal.attr.empty.test
8700     @@@DEnt:
8701     @@@@test:value:
8702     <!DOCTYPE a [
8703     <!ATTLIST a>
8704     ]>
8705     <a></a>
8706     @@@test:domTree:
8707     document {
8708     xml-version: '1.0';
8709     xml-encoding: null;
8710     xml-standalone: false;
8711     document-type {
8712     node-name: 'a';
8713     element-type-definition {
8714     node-name: 'a';
8715     }
8716     }
8717     element {
8718     namespace-uri: null;
8719     local-name: 'a';
8720     }
8721     }
8722     @@XMLTest:
8723     @@@QName: xp.doctype.internal.attr.cdata.implied.test
8724     @@@DEnt:
8725     @@@@test:value:
8726     <!DOCTYPE a [
8727     <!ATTLIST a
8728     at CDATA #IMPLIED
8729     >
8730     ]>
8731     <a></a>
8732 wakaba 1.9 @@@test:domTree:
8733     document {
8734     xml-version: '1.0';
8735     xml-encoding: null;
8736     xml-standalone: false;
8737     document-type {
8738     node-name: 'a';
8739     element-type-definition {
8740     node-name: 'a';
8741     attribute-definition {
8742     node-name: 'at';
8743 wakaba 1.18 declared-type: const (CDATA_ATTR);
8744 wakaba 1.9 allowed-tokens: DOMStringList ();
8745 wakaba 1.18 default-type: const (IMPLIED_DEFAULT);
8746     text-content: '';
8747 wakaba 1.9 }
8748     }
8749     }
8750     element {
8751     namespace-uri: null;
8752     local-name: 'a';
8753 wakaba 1.18 }
8754     }
8755     @@XMLTest:
8756     @@@QName: xp.doctype.internal.attr.types.implied.test
8757     @@@DEnt:
8758     @@@@test:value:
8759     <!DOCTYPE a [
8760     <!ATTLIST a
8761     at1 ID #IMPLIED
8762     at2 IDREF #IMPLIED
8763     at3 IDREFS #IMPLIED
8764     at4 ENTITY #IMPLIED
8765     at5 ENTITIES #IMPLIED
8766     at6 NMTOKEN #IMPLIED
8767     at7 NMTOKENS #IMPLIED
8768     at8 NOTATION (n1 | n2|n3) #IMPLIED
8769     at9 (e1| e2| e3 ) #IMPLIED
8770     >
8771     ]>
8772     <a></a>
8773     @@@test:domTree:
8774     document {
8775     xml-version: '1.0';
8776     xml-encoding: null;
8777     xml-standalone: false;
8778     document-type {
8779     node-name: 'a';
8780     element-type-definition {
8781     node-name: 'a';
8782     attribute-definition {
8783     node-name: 'at1';
8784     declared-type: const (ID_ATTR);
8785     allowed-tokens: DOMStringList ();
8786     default-type: const (IMPLIED_DEFAULT);
8787     text-content: '';
8788     }
8789     attribute-definition {
8790     node-name: 'at2';
8791     declared-type: const (IDREF_ATTR);
8792     allowed-tokens: DOMStringList ();
8793     default-type: const (IMPLIED_DEFAULT);
8794     text-content: '';
8795     }
8796     attribute-definition {
8797     node-name: 'at3';
8798     declared-type: const (IDREFS_ATTR);
8799     allowed-tokens: DOMStringList ();
8800     default-type: const (IMPLIED_DEFAULT);
8801     text-content: '';
8802     }
8803     attribute-definition {
8804     node-name: 'at4';
8805     declared-type: const (ENTITY_ATTR);
8806     allowed-tokens: DOMStringList ();
8807     default-type: const (IMPLIED_DEFAULT);
8808     text-content: '';
8809     }
8810     attribute-definition {
8811     node-name: 'at5';
8812     declared-type: const (ENTITIES_ATTR);
8813     allowed-tokens: DOMStringList ();
8814     default-type: const (IMPLIED_DEFAULT);
8815     text-content: '';
8816     }
8817     attribute-definition {
8818     node-name: 'at6';
8819     declared-type: const (NMTOKEN_ATTR);
8820     allowed-tokens: DOMStringList ();
8821     default-type: const (IMPLIED_DEFAULT);
8822     text-content: '';
8823     }
8824     attribute-definition {
8825     node-name: 'at7';
8826     declared-type: const (NMTOKENS_ATTR);
8827     allowed-tokens: DOMStringList ();
8828     default-type: const (IMPLIED_DEFAULT);
8829     text-content: '';
8830     }
8831     attribute-definition {
8832     node-name: 'at8';
8833     declared-type: const (NOTATION_ATTR);
8834     allowed-tokens: DOMStringList ('n1', 'n2', 'n3');
8835     default-type: const (IMPLIED_DEFAULT);
8836     text-content: '';
8837     }
8838     attribute-definition {
8839     node-name: 'at9';
8840     declared-type: const (ENUMERATION_ATTR);
8841     allowed-tokens: DOMStringList ('e1', 'e2', 'e3');
8842     default-type: const (IMPLIED_DEFAULT);
8843     text-content: '';
8844     }
8845     }
8846     }
8847     element {
8848     namespace-uri: null;
8849     local-name: 'a';
8850     }
8851     }
8852     @@XMLTest:
8853     @@@QName: xp.doctype.internal.attr.cdata.defaults.test
8854     @@@DEnt:
8855     @@@@test:value:
8856     <!DOCTYPE a [
8857     <!ATTLIST a
8858     at1 CDATA #IMPLIED
8859     at2 CDATA #REQUIRED
8860     at3 CDATA #FIXED "value3"
8861     at4 CDATA "value4"
8862     at5 CDATA #FIXED 'value5'
8863     at6 CDATA 'value6'
8864     >
8865     ]>
8866     <a></a>
8867     @@@test:domTree:
8868     document {
8869     xml-version: '1.0';
8870     xml-encoding: null;
8871     xml-standalone: false;
8872     document-type {
8873     node-name: 'a';
8874     element-type-definition {
8875     node-name: 'a';
8876     attribute-definition {
8877     node-name: 'at1';
8878     declared-type: const (CDATA_ATTR);
8879     allowed-tokens: DOMStringList ();
8880     default-type: const (IMPLIED_DEFAULT);
8881     text-content: '';
8882     }
8883     attribute-definition {
8884     node-name: 'at2';
8885     declared-type: const (CDATA_ATTR);
8886     allowed-tokens: DOMStringList ();
8887     default-type: const (REQUIRED_DEFAULT);
8888     text-content: '';
8889     }
8890     attribute-definition {
8891     node-name: 'at3';
8892     declared-type: const (CDATA_ATTR);
8893     allowed-tokens: DOMStringList ();
8894     default-type: const (FIXED_DEFAULT);
8895     text-content: 'value3';
8896     }
8897     attribute-definition {
8898     node-name: 'at4';
8899     declared-type: const (CDATA_ATTR);
8900     allowed-tokens: DOMStringList ();
8901     default-type: const (EXPLICIT_DEFAULT);
8902     text-content: 'value4';
8903     }
8904     attribute-definition {
8905     node-name: 'at5';
8906     declared-type: const (CDATA_ATTR);
8907     allowed-tokens: DOMStringList ();
8908     default-type: const (FIXED_DEFAULT);
8909     text-content: 'value5';
8910     }
8911     attribute-definition {
8912     node-name: 'at6';
8913     declared-type: const (CDATA_ATTR);
8914     allowed-tokens: DOMStringList ();
8915     default-type: const (EXPLICIT_DEFAULT);
8916     text-content: 'value6';
8917     }
8918     }
8919     }
8920     element {
8921     namespace-uri: null;
8922     local-name: 'a';
8923     attribute {
8924     node-name: 'at3';
8925     text-content: 'value3';
8926     specified: false;
8927     }
8928     attribute {
8929     node-name: 'at4';
8930     text-content: 'value4';
8931     specified: false;
8932     }
8933     attribute {
8934     node-name: 'at5';
8935     text-content: 'value5';
8936     specified: false;
8937     }
8938     attribute {
8939     node-name: 'at6';
8940     text-content: 'value6';
8941     specified: false;
8942     }
8943     }
8944     }
8945    
8946     @@XMLTest:
8947     @@@QName: xp.doctype.internal.attr.cdata.default.normalize.test
8948     @@@DEnt:
8949     @@@@test:value:
8950     <!DOCTYPE a [
8951     <!ATTLIST a
8952     at CDATA " default &#x0A;value "
8953     >
8954     ]>
8955     <a></a>
8956     @@@test:domTree:
8957     document {
8958     xml-version: '1.0';
8959     xml-encoding: null;
8960     xml-standalone: false;
8961     document-type {
8962     node-name: 'a';
8963     element-type-definition {
8964     node-name: 'a';
8965     attribute-definition {
8966     node-name: 'at';
8967     declared-type: const (CDATA_ATTR);
8968     allowed-tokens: DOMStringList ();
8969     default-type: const (EXPLICIT_DEFAULT);
8970     text-content: ' default ' U+000A 'value ';
8971     }
8972     }
8973     }
8974     element {
8975     namespace-uri: null;
8976     local-name: 'a';
8977     attribute {
8978     node-name: 'at';
8979     text-content: ' default ' U+000A 'value ';
8980     specified: false;
8981     }
8982     }
8983     }
8984     @@XMLTest:
8985     @@@QName: xp.doctype.internal.attr.nmtoken.default.normalize.test
8986     @@@DEnt:
8987     @@@@test:value:
8988     <!DOCTYPE a [
8989     <!ATTLIST a
8990     at NMTOKEN " default &#x0A;value "
8991     >
8992     ]>
8993     <a></a>
8994     @@@test:domTree:
8995     document {
8996     xml-version: '1.0';
8997     xml-encoding: null;
8998     xml-standalone: false;
8999     document-type {
9000     node-name: 'a';
9001     element-type-definition {
9002     node-name: 'a';
9003     attribute-definition {
9004     node-name: 'at';
9005     declared-type: const (NMTOKEN_ATTR);
9006     allowed-tokens: DOMStringList ();
9007     default-type: const (EXPLICIT_DEFAULT);
9008     text-content: ' default ' U+000A 'value ';
9009     }
9010     }
9011     }
9012     element {
9013     namespace-uri: null;
9014     local-name: 'a';
9015     attribute {
9016     node-name: 'at';
9017     text-content: ' default ' U+000A 'value ';
9018     specified: false;
9019     }
9020     }
9021     }
9022    
9023     @@XMLTest:
9024     @@@QName: xp.doctype.attrtype.no-value.test
9025     @@@DEnt:
9026     @@@@test:value:
9027     <!DOCTYPE a>
9028     <a at=" at value "></a>
9029     @@@test:domTree:
9030     document {
9031     xml-version: '1.0';
9032     xml-encoding: null;
9033     xml-standalone: false;
9034     document-type { }
9035     element {
9036     namespace-uri: null;
9037     local-name: 'a';
9038     attribute {
9039     namespace-uri: null;
9040     local-name: 'at';
9041     value: ' at value ';
9042     text {
9043     data: ' at value ';
9044     }
9045     schema-type-info: TypeInfo (null, null);
9046     specified: true;
9047     }
9048     }
9049     }
9050     @@XMLTest:
9051     @@@QName: xp.doctype.attrtype.cdata.test
9052     @@@DEnt:
9053     @@@@test:value:
9054     <!DOCTYPE a [
9055     <!ATTLIST a
9056     at CDATA #IMPLIED
9057     >
9058     ]>
9059     <a at=" at value "></a>
9060     @@@test:domTree:
9061     document {
9062     xml-version: '1.0';
9063     xml-encoding: null;
9064     xml-standalone: false;
9065     document-type { }
9066     element {
9067     namespace-uri: null;
9068     local-name: 'a';
9069     attribute {
9070     namespace-uri: null;
9071     local-name: 'at';
9072     value: ' at value ';
9073     text {
9074     data: ' at value ';
9075     }
9076     schema-type-info:
9077     TypeInfo ('http://www.w3.org/TR/REC-xml', 'CDATA');
9078     specified: true;
9079     }
9080     }
9081     }
9082     @@XMLTest:
9083     @@@QName: xp.doctype.attrtype.nmtoken.test
9084     @@@DEnt:
9085     @@@@test:value:
9086     <!DOCTYPE a [
9087     <!ATTLIST a
9088     at NMTOKEN #IMPLIED
9089     >
9090     ]>
9091     <a at=" at value "></a>
9092     @@@test:domTree:
9093     document {
9094     xml-version: '1.0';
9095     xml-encoding: null;
9096     xml-standalone: false;
9097     document-type { }
9098     element {
9099     namespace-uri: null;
9100     local-name: 'a';
9101     attribute {
9102     namespace-uri: null;
9103     local-name: 'at';
9104     value: 'at value';
9105     text {
9106     data: ' at value ';
9107     }
9108     schema-type-info:
9109     TypeInfo ('http://www.w3.org/TR/REC-xml', 'NMTOKEN');
9110     specified: true;
9111     }
9112     }
9113     }
9114    
9115     @@XMLTest:
9116     @@@QName: xp.doctype.attr.normalization.1.test
9117     @@@DEnt:
9118     @@@@test:value:
9119     <a at=" at &#xA;value "></a>
9120     @@@test:domTree:
9121     document {
9122     element {
9123     attribute {
9124     node-name: 'at';
9125     value: ' at ' U+000A 'value ';
9126     schema-type-info: TypeInfo (null, null);
9127     specified: true;
9128     }
9129     }
9130     }
9131     @@XMLTest:
9132     @@@QName: xp.doctype.attr.normalization.2.test
9133     @@@DEnt:
9134     @@@@test:value:
9135     <a at=" at &#xD;value "></a>
9136     @@@test:domTree:
9137     document {
9138     element {
9139     attribute {
9140     value: ' at ' U+000D 'value ';
9141     schema-type-info: TypeInfo (null, null);
9142     specified: true;
9143     }
9144     }
9145     }
9146     @@XMLTest:
9147     @@@QName: xp.doctype.attr.normalization.3.test
9148     @@@DEnt:
9149     @@@@test:value:
9150     <a at=" at &#x9;value "></a>
9151     @@@test:domTree:
9152     document {
9153     element {
9154     attribute {
9155     node-name: 'at';
9156     value: ' at ' U+0009 'value ';
9157     schema-type-info: TypeInfo (null, null);
9158     specified: true;
9159     }
9160     }
9161     }
9162    
9163     @@XMLTest:
9164     @@@QName: xp.doctype.attr.specified.1.test
9165     @@@DEnt:
9166     @@@@test:value:
9167     <!DOCTYPE a [
9168     <!ATTLIST a
9169     at CDATA "default"
9170     >
9171     ]>
9172     <a></a>
9173     @@@test:domTree:
9174     document {
9175     document-type { }
9176     element {
9177     attribute {
9178     node-name: 'at';
9179     value: 'default';
9180     specified: false;
9181     }
9182     }
9183     }
9184     @@XMLTest:
9185     @@@QName: xp.doctype.attr.specified.2.test
9186     @@@DEnt:
9187     @@@@test:value:
9188     <!DOCTYPE a [
9189     <!ATTLIST a
9190     at CDATA "default"
9191     >
9192     ]>
9193     <a at2="specified"></a>
9194     @@@test:domTree:
9195     document {
9196     document-type { }
9197     element {
9198     attribute {
9199     node-name: 'at';
9200     value: 'default';
9201     specified: false;
9202     }
9203     attribute {
9204     node-name: 'at2';
9205     value: 'specified';
9206     specified: true;
9207     }
9208     }
9209     }
9210     @@XMLTest:
9211     @@@QName: xp.doctype.attr.specified.3.test
9212     @@@DEnt:
9213     @@@@test:value:
9214     <!DOCTYPE a [
9215     <!ATTLIST a
9216     at CDATA "default"
9217     >
9218     ]>
9219     <a at="specified"></a>
9220     @@@test:domTree:
9221     document {
9222     document-type { }
9223     element {
9224     attribute {
9225     node-name: 'at';
9226     value: 'specified';
9227     specified: true;
9228     }
9229     }
9230     }
9231    
9232     @@XMLTest:
9233     @@@QName: xp.attr.literal.charref.test
9234     @@@DEnt:
9235     @@@@test:value:
9236     <a at1 = "value&#33;_&#x25;value"
9237     at2 = 'value&#x25;_&#33;value'></a>
9238     @@@test:domTree:
9239     document {
9240     element {
9241     attribute {
9242     node-name: 'at1';
9243     text-content: 'value!_%value';
9244     }
9245     attribute {
9246     node-name: 'at2';
9247     text-content: 'value%_!value';
9248     }
9249     }
9250     }
9251     @@XMLTest:
9252     @@@QName: xp.attr.literal.entref.test
9253     @@@DEnt:
9254     @@@@test:value:
9255     <!DOCTYPE a [
9256     <!ENTITY ent "entity&#x26;#33;_&#x26;#x29;value">
9257     ]>
9258     <a at1 = "value&ent;value"
9259     at2 = 'value&ent;value'></a>
9260     @@@test:domTree:
9261     document {
9262     document-type {
9263     general-entity {
9264     node-name: 'ent';
9265     text-content: 'entity!_)value';
9266     }
9267     }
9268     element {
9269     attribute {
9270     node-name: 'at1';
9271     text-content: 'valueentity!_)valuevalue';
9272     }
9273     attribute {
9274     node-name: 'at2';
9275     text-content: 'valueentity!_)valuevalue';
9276     }
9277     }
9278     }
9279     @@XMLTest:
9280     @@@QName: xp.attr.literal.entref.nest.test
9281     @@@DEnt:
9282     @@@@test:value:
9283     <!DOCTYPE a [
9284     <!ENTITY ent1 "entity&#x26;#33;_&#x26;#x29;value">
9285     <!ENTITY ent2 "@&ent1;@">
9286     ]>
9287     <a at1 = "value&ent2;value"
9288     at2 = 'value&ent2;value'></a>
9289     @@@test:domTree:
9290     document {
9291     document-type {
9292     general-entity {
9293     node-name: 'ent1';
9294     text-content: 'entity!_)value';
9295     }
9296     general-entity {
9297     node-name: 'ent2';
9298     text-content: '@entity!_)value@';
9299     }
9300     }
9301     element {
9302     attribute {
9303     node-name: 'at1';
9304     text-content: 'value@entity!_)value@value';
9305     }
9306     attribute {
9307     node-name: 'at2';
9308     text-content: 'value@entity!_)value@value';
9309     }
9310     }
9311     }
9312    
9313     @@XMLTest:
9314     @@@QName: xp.element.content.ncr.1.test
9315     @@@DEnt:
9316     @@@@test:value:
9317     <e>&#33;</e>
9318     @@@test:domTree:
9319     document {
9320     element {
9321     text-content: '!';
9322     }
9323     }
9324     @@XMLTest:
9325     @@@QName: xp.element.content.ncr.2.test
9326     @@@DEnt:
9327     @@@@test:value:
9328     <e>aaaa&#33;bbbb</e>
9329     @@@test:domTree:
9330     document {
9331     element {
9332     text-content: 'aaaa!bbbb';
9333     }
9334     }
9335     @@XMLTest:
9336     @@@QName: xp.attrval.ncr.1.test
9337     @@@DEnt:
9338     @@@@test:value:
9339     <e a="&#33;"/>
9340     @@@test:domTree:
9341     document {
9342     element {
9343     attribute {
9344     node-name: 'a';
9345     text-content: '!';
9346     }
9347     }
9348     }
9349     @@XMLTest:
9350     @@@QName: xp.attrval.ncr.2.test
9351     @@@DEnt:
9352     @@@@test:value:
9353     <e a="aaaaa&#33;bbbbb"/>
9354     @@@test:domTree:
9355     document {
9356     element {
9357     attribute {
9358     node-name: 'a';
9359     text-content: 'aaaaa!bbbbb';
9360     }
9361     }
9362     }
9363     @@XMLTest:
9364     @@@QName: xp.attrval.ncr.3.test
9365     @@@DEnt:
9366     @@@@test:value:
9367     <e a='&#33;'/>
9368     @@@test:domTree:
9369     document {
9370     element {
9371     attribute {
9372     node-name: 'a';
9373     text-content: '!';
9374     }
9375     }
9376     }
9377     @@XMLTest:
9378     @@@QName: xp.attrval.ncr.4.test
9379     @@@DEnt:
9380     @@@@test:value:
9381     <e a='aaaaa&#33;bbbbb'/>
9382     @@@test:domTree:
9383     document {
9384     element {
9385     attribute {
9386     node-name: 'a';
9387     text-content: 'aaaaa!bbbbb';
9388     }
9389     }
9390     }
9391     @@XMLTest:
9392     @@@QName: xp.entval.ncr.1.test
9393     @@@DEnt:
9394     @@@@test:value:
9395     <!DOCTYPE e [
9396     <!ENTITY ent "&#33;">
9397     ]>
9398     <e/>
9399     @@@test:domTree:
9400     document {
9401     document-type {
9402     general-entity {
9403     node-name: 'ent';
9404     text-content: '!';
9405     }
9406     }
9407     element { }
9408     }
9409     @@XMLTest:
9410     @@@QName: xp.entval.ncr.2.test
9411     @@@DEnt:
9412     @@@@test:value:
9413     <!DOCTYPE e [
9414     <!ENTITY ent "aaaaa&#33;bbbbb">
9415     ]>
9416     <e/>
9417     @@@test:domTree:
9418     document {
9419     document-type {
9420     general-entity {
9421     node-name: 'ent';
9422     text-content: 'aaaaa!bbbbb';
9423     }
9424     }
9425     element { }
9426     }
9427     @@XMLTest:
9428     @@@QName: xp.element.content.reptxt.ncr.1.test
9429     @@@DEnt:
9430     @@@@test:value:
9431     <!DOCTYPE e [
9432     <!ENTITY ent "&#38;#33;">
9433     ]>
9434     <e>&ent;</e>
9435     @@@test:domTree:
9436     document {
9437     document-type { }
9438     element {
9439     general-entity-reference {
9440     node-name: 'ent';
9441     text-content: '!';
9442 wakaba 1.19 is-expanded: true;
9443 wakaba 1.18 }
9444     }
9445     }
9446     @@XMLTest:
9447     @@@QName: xp.element.content.reptxt.ncr.2.test
9448     @@@DEnt:
9449     @@@@test:value:
9450     <!DOCTYPE e [
9451     <!ENTITY ent "aaaaa&#38;#33;bbbbb">
9452     ]>
9453     <e>&ent;</e>
9454     @@@test:domTree:
9455     document {
9456     document-type { }
9457     element {
9458     general-entity-reference {
9459     node-name: 'ent';
9460     text-content: 'aaaaa!bbbbb';
9461 wakaba 1.19 is-expanded: true;
9462 wakaba 1.18 }
9463     }
9464     }
9465     @@XMLTest:
9466     @@@QName: xp.element.content.reptxt.reptxt.ncr.1.test
9467     @@@DEnt:
9468     @@@@test:value:
9469     <!DOCTYPE e [
9470     <!ENTITY ent "&#38;#33;">
9471     <!ENTITY ent2 "&ent;">
9472     ]>
9473     <e>&ent2;</e>
9474     @@@test:domTree:
9475     document {
9476     document-type { }
9477     element {
9478     general-entity-reference {
9479     node-name: 'ent2';
9480     general-entity-reference {
9481     node-name: 'ent';
9482     text-content: '!';
9483 wakaba 1.19 is-expanded: true;
9484 wakaba 1.18 }
9485 wakaba 1.19 is-expanded: true;
9486 wakaba 1.18 }
9487     }
9488     }
9489     @@XMLTest:
9490     @@@QName: xp.element.content.reptxt.reptxt.ncr.2.test
9491     @@@DEnt:
9492     @@@@test:value:
9493     <!DOCTYPE e [
9494     <!ENTITY ent "aa&#38;#33;bb">
9495     <!ENTITY ent2 "&ent;">
9496     ]>
9497     <e>&ent2;</e>
9498     @@@test:domTree:
9499     document {
9500     document-type { }
9501     element {
9502     general-entity-reference {
9503     node-name: 'ent2';
9504     general-entity-reference {
9505     node-name: 'ent';
9506     text-content: 'aa!bb';
9507 wakaba 1.19 is-expanded: true;
9508 wakaba 1.18 }
9509 wakaba 1.19 is-expanded: true;
9510 wakaba 1.18 }
9511     }
9512     }
9513     @@XMLTest:
9514     @@@QName: xp.attval.reptxt.ncr.1.test
9515     @@@DEnt:
9516     @@@@test:value:
9517     <!DOCTYPE e [
9518     <!ENTITY ent "&#38;#33;">
9519     ]>
9520     <e a="&ent;"/>
9521     @@@test:domTree:
9522     document {
9523     document-type { }
9524     element {
9525     attribute {
9526     node-name: 'a';
9527     general-entity-reference {
9528     node-name: 'ent';
9529     text-content: '!';
9530 wakaba 1.19 is-expanded: true;
9531 wakaba 1.18 }
9532     }
9533     }
9534     }
9535     @@XMLTest:
9536     @@@QName: xp.attval.reptxt.ncr.2.test
9537     @@@DEnt:
9538     @@@@test:value:
9539     <!DOCTYPE e [
9540     <!ENTITY ent "aaaaa&#38;#33;bbbbb">
9541     ]>
9542     <e a="&ent;"/>
9543     @@@test:domTree:
9544     document {
9545     document-type { }
9546     element {
9547     attribute {
9548     node-name: 'a';
9549     general-entity-reference {
9550     node-name: 'ent';
9551     text-content: 'aaaaa!bbbbb';
9552 wakaba 1.19 is-expanded: true;
9553 wakaba 1.18 }
9554     }
9555     }
9556     }
9557     @@XMLTest:
9558     @@@QName: xp.attval.reptxt.reptxt.ncr.1.test
9559     @@@DEnt:
9560     @@@@test:value:
9561     <!DOCTYPE e [
9562     <!ENTITY ent "&#38;#33;">
9563     <!ENTITY ent2 "&ent;">
9564     ]>
9565     <e a="&ent2;"/>
9566     @@@test:domTree:
9567     document {
9568     document-type { }
9569     element {
9570     attribute {
9571     node-name: 'a';
9572     general-entity-reference {
9573     node-name: 'ent2';
9574 wakaba 1.19 is-expanded: true;
9575 wakaba 1.18 general-entity-reference {
9576     node-name: 'ent';
9577     text-content: '!';
9578 wakaba 1.19 is-expanded: true;
9579 wakaba 1.18 }
9580     }
9581     }
9582     }
9583     }
9584     @@XMLTest:
9585     @@@QName: xp.attval.reptxt.reptxt.ncr.2.test
9586     @@@DEnt:
9587     @@@@test:value:
9588     <!DOCTYPE e [
9589     <!ENTITY ent "aa&#38;#33;bb">
9590     <!ENTITY ent2 "&ent;">
9591     ]>
9592     <e a="&ent2;"/>
9593     @@@test:domTree:
9594     document {
9595     document-type { }
9596     element {
9597     attribute {
9598     node-name: 'a';
9599     general-entity-reference {
9600     node-name: 'ent2';
9601 wakaba 1.19 is-expanded: true;
9602 wakaba 1.18 general-entity-reference {
9603     node-name: 'ent';
9604     text-content: 'aa!bb';
9605 wakaba 1.19 is-expanded: true;
9606 wakaba 1.18 }
9607     }
9608     }
9609     }
9610     }
9611    
9612     @@XMLTest:
9613     @@@QName: xp.element.content.hcr.1.test
9614     @@@DEnt:
9615     @@@@test:value:
9616     <e>&#x21;</e>
9617     @@@test:domTree:
9618     document {
9619     element {
9620     text-content: '!';
9621     }
9622     }
9623     @@XMLTest:
9624     @@@QName: xp.element.content.hcr.2.test
9625     @@@DEnt:
9626     @@@@test:value:
9627     <e>aaaa&#x21;bbbb</e>
9628     @@@test:domTree:
9629     document {
9630     element {
9631     text-content: 'aaaa!bbbb';
9632     }
9633     }
9634     @@XMLTest:
9635     @@@QName: xp.attrval.hcr.1.test
9636     @@@DEnt:
9637     @@@@test:value:
9638     <e a="&#x21;"/>
9639     @@@test:domTree:
9640     document {
9641     element {
9642     attribute {
9643     node-name: 'a';
9644     text-content: '!';
9645     }
9646     }
9647     }
9648     @@XMLTest:
9649     @@@QName: xp.attrval.hcr.2.test
9650     @@@DEnt:
9651     @@@@test:value:
9652     <e a="aaaaa&#x21;bbbbb"/>
9653     @@@test:domTree:
9654     document {
9655     element {
9656     attribute {
9657     node-name: 'a';
9658     text-content: 'aaaaa!bbbbb';
9659     }
9660     }
9661     }
9662     @@XMLTest:
9663     @@@QName: xp.attrval.hcr.3.test
9664     @@@DEnt:
9665     @@@@test:value:
9666     <e a='&#x21;'/>
9667     @@@test:domTree:
9668     document {
9669     element {
9670     attribute {
9671     node-name: 'a';
9672     text-content: '!';
9673     }
9674     }
9675     }
9676     @@XMLTest:
9677     @@@QName: xp.attrval.hcr.4.test
9678     @@@DEnt:
9679     @@@@test:value:
9680     <e a='aaaaa&#x21;bbbbb'/>
9681     @@@test:domTree:
9682     document {
9683     element {
9684     attribute {
9685     node-name: 'a';
9686     text-content: 'aaaaa!bbbbb';
9687     }
9688     }
9689     }
9690     @@XMLTest:
9691     @@@QName: xp.entval.hcr.1.test
9692     @@@DEnt:
9693     @@@@test:value:
9694     <!DOCTYPE e [
9695     <!ENTITY ent "&#x21;">
9696     ]>
9697     <e/>
9698     @@@test:domTree:
9699     document {
9700     document-type {
9701     general-entity {
9702     node-name: 'ent';
9703     text-content: '!';
9704 wakaba 1.10 }
9705 wakaba 1.9 }
9706 wakaba 1.18 element { }
9707 wakaba 1.9 }
9708     @@XMLTest:
9709 wakaba 1.18 @@@QName: xp.entval.hcr.2.test
9710 wakaba 1.9 @@@DEnt:
9711     @@@@test:value:
9712 wakaba 1.18 <!DOCTYPE e [
9713     <!ENTITY ent "aaaaa&#x21;bbbbb">
9714     ]>
9715     <e/>
9716 wakaba 1.9 @@@test:domTree:
9717     document {
9718 wakaba 1.18 document-type {
9719     general-entity {
9720     node-name: 'ent';
9721     text-content: 'aaaaa!bbbbb';
9722 wakaba 1.9 }
9723     }
9724 wakaba 1.18 element { }
9725 wakaba 1.9 }
9726     @@XMLTest:
9727 wakaba 1.18 @@@QName: xp.element.content.reptxt.hcr.1.test
9728 wakaba 1.9 @@@DEnt:
9729     @@@@test:value:
9730 wakaba 1.18 <!DOCTYPE e [
9731     <!ENTITY ent "&#38;#x21;">
9732 wakaba 1.9 ]>
9733 wakaba 1.18 <e>&ent;</e>
9734 wakaba 1.9 @@@test:domTree:
9735     document {
9736     document-type { }
9737     element {
9738 wakaba 1.18 general-entity-reference {
9739     node-name: 'ent';
9740     text-content: '!';
9741 wakaba 1.19 is-expanded: true;
9742 wakaba 1.9 }
9743     }
9744     }
9745     @@XMLTest:
9746 wakaba 1.18 @@@QName: xp.element.content.reptxt.hcr.2.test
9747 wakaba 1.9 @@@DEnt:
9748     @@@@test:value:
9749 wakaba 1.18 <!DOCTYPE e [
9750     <!ENTITY ent "aaaaa&#38;#x21;bbbbb">
9751 wakaba 1.9 ]>
9752 wakaba 1.18 <e>&ent;</e>
9753 wakaba 1.9 @@@test:domTree:
9754     document {
9755     document-type { }
9756     element {
9757 wakaba 1.18 general-entity-reference {
9758     node-name: 'ent';
9759     text-content: 'aaaaa!bbbbb';
9760 wakaba 1.19 is-expanded: true;
9761 wakaba 1.9 }
9762     }
9763     }
9764     @@XMLTest:
9765 wakaba 1.18 @@@QName: xp.element.content.reptxt.reptxt.hcr.1.test
9766 wakaba 1.9 @@@DEnt:
9767     @@@@test:value:
9768 wakaba 1.18 <!DOCTYPE e [
9769     <!ENTITY ent "&#38;#x21;">
9770     <!ENTITY ent2 "&ent;">
9771     ]>
9772     <e>&ent2;</e>
9773 wakaba 1.9 @@@test:domTree:
9774     document {
9775 wakaba 1.18 document-type { }
9776 wakaba 1.9 element {
9777 wakaba 1.18 general-entity-reference {
9778     node-name: 'ent2';
9779 wakaba 1.19 is-expanded: true;
9780 wakaba 1.18 general-entity-reference {
9781     node-name: 'ent';
9782     text-content: '!';
9783 wakaba 1.19 is-expanded: true;
9784 wakaba 1.18 }
9785 wakaba 1.9 }
9786     }
9787     }
9788     @@XMLTest:
9789 wakaba 1.18 @@@QName: xp.element.content.reptxt.reptxt.hcr.2.test
9790 wakaba 1.9 @@@DEnt:
9791     @@@@test:value:
9792 wakaba 1.18 <!DOCTYPE e [
9793     <!ENTITY ent "aa&#38;#x21;bb">
9794     <!ENTITY ent2 "&ent;">
9795     ]>
9796     <e>&ent2;</e>
9797 wakaba 1.9 @@@test:domTree:
9798     document {
9799 wakaba 1.18 document-type { }
9800 wakaba 1.9 element {
9801 wakaba 1.18 general-entity-reference {
9802     node-name: 'ent2';
9803 wakaba 1.19 is-expanded: true;
9804 wakaba 1.18 general-entity-reference {
9805     node-name: 'ent';
9806 wakaba 1.19 is-expanded: true;
9807 wakaba 1.18 text-content: 'aa!bb';
9808     }
9809 wakaba 1.9 }
9810     }
9811     }
9812     @@XMLTest:
9813 wakaba 1.18 @@@QName: xp.attval.reptxt.hcr.1.test
9814 wakaba 1.9 @@@DEnt:
9815     @@@@test:value:
9816 wakaba 1.18 <!DOCTYPE e [
9817     <!ENTITY ent "&#38;#x21;">
9818     ]>
9819     <e a="&ent;"/>
9820 wakaba 1.9 @@@test:domTree:
9821     document {
9822 wakaba 1.18 document-type { }
9823 wakaba 1.9 element {
9824     attribute {
9825 wakaba 1.18 node-name: 'a';
9826     general-entity-reference {
9827     node-name: 'ent';
9828 wakaba 1.19 is-expanded: true;
9829 wakaba 1.18 text-content: '!';
9830     }
9831 wakaba 1.10 }
9832     }
9833     }
9834     @@XMLTest:
9835 wakaba 1.18 @@@QName: xp.attval.reptxt.hcr.2.test
9836 wakaba 1.10 @@@DEnt:
9837     @@@@test:value:
9838 wakaba 1.18 <!DOCTYPE e [
9839     <!ENTITY ent "aaaaa&#38;#x21;bbbbb">
9840 wakaba 1.10 ]>
9841 wakaba 1.18 <e a="&ent;"/>
9842 wakaba 1.10 @@@test:domTree:
9843     document {
9844     document-type { }
9845     element {
9846     attribute {
9847 wakaba 1.18 node-name: 'a';
9848     general-entity-reference {
9849     node-name: 'ent';
9850 wakaba 1.19 is-expanded: true;
9851 wakaba 1.18 text-content: 'aaaaa!bbbbb';
9852     }
9853 wakaba 1.10 }
9854     }
9855     }
9856     @@XMLTest:
9857 wakaba 1.18 @@@QName: xp.attval.reptxt.reptxt.hcr.1.test
9858 wakaba 1.10 @@@DEnt:
9859     @@@@test:value:
9860 wakaba 1.18 <!DOCTYPE e [
9861     <!ENTITY ent "&#38;#x21;">
9862     <!ENTITY ent2 "&ent;">
9863 wakaba 1.10 ]>
9864 wakaba 1.18 <e a="&ent2;"/>
9865 wakaba 1.10 @@@test:domTree:
9866     document {
9867     document-type { }
9868     element {
9869     attribute {
9870 wakaba 1.18 node-name: 'a';
9871     general-entity-reference {
9872     node-name: 'ent2';
9873 wakaba 1.19 is-expanded: true;
9874 wakaba 1.18 general-entity-reference {
9875     node-name: 'ent';
9876 wakaba 1.19 is-expanded: true;
9877 wakaba 1.18 text-content: '!';
9878     }
9879     }
9880 wakaba 1.10 }
9881     }
9882     }
9883     @@XMLTest:
9884 wakaba 1.18 @@@QName: xp.attval.reptxt.reptxt.hcr.2.test
9885 wakaba 1.10 @@@DEnt:
9886     @@@@test:value:
9887 wakaba 1.18 <!DOCTYPE e [
9888     <!ENTITY ent "aa&#38;#x21;bb">
9889     <!ENTITY ent2 "&ent;">
9890 wakaba 1.10 ]>
9891 wakaba 1.18 <e a="&ent2;"/>
9892 wakaba 1.10 @@@test:domTree:
9893     document {
9894     document-type { }
9895     element {
9896     attribute {
9897 wakaba 1.18 node-name: 'a';
9898     general-entity-reference {
9899     node-name: 'ent2';
9900 wakaba 1.19 is-expanded: true;
9901 wakaba 1.18 general-entity-reference {
9902     node-name: 'ent';
9903 wakaba 1.19 is-expanded: true;
9904 wakaba 1.18 text-content: 'aa!bb';
9905     }
9906     }
9907 wakaba 1.11 }
9908     }
9909     }
9910    
9911     @@XMLTest:
9912 wakaba 1.18 @@@QName: xp.element.content.ncr.legal.char.1.0.1.test
9913     @@@DEnt:
9914     @@@@test:value:
9915     <?xml version="1.0"?>
9916     <e>&#0;</e>
9917     @@@c:erred: <[[xp|wf-legal-character]]> { (2, 4)..(2, 7); }
9918     @@XMLTest:
9919     @@@QName: xp.element.content.ncr.legal.char.1.1.1.test
9920     @@@DEnt:
9921     @@@@test:value:
9922     <?xml version="1.1"?>
9923     <e>&#0;</e>
9924     @@@c:erred: <[[xp|wf-legal-character]]> { (2, 4)..(2, 7); }
9925     @@XMLTest:
9926     @@@QName: xp.element.content.ncr.legal.char.1.0.2.test
9927     @@@DEnt:
9928     @@@@test:value:
9929     <?xml version="1.0"?>
9930     <e>&#1;</e>
9931     @@@c:erred: <[[xp|wf-legal-character]]> { (2, 4)..(2, 7); }
9932     @@XMLTest:
9933     @@@QName: xp.element.content.ncr.legal.char.1.1.2.test
9934 wakaba 1.11 @@@DEnt:
9935     @@@@test:value:
9936 wakaba 1.18 <?xml version="1.1"?>
9937     <e>&#1;</e>
9938 wakaba 1.11 @@@test:domTree:
9939     document {
9940 wakaba 1.18 xml-version: '1.1';
9941 wakaba 1.11 element {
9942 wakaba 1.18 text-content: U+0001;
9943 wakaba 1.11 }
9944     }
9945     @@XMLTest:
9946 wakaba 1.18 @@@QName: xp.element.content.hcr.legal.char.1.0.1.test
9947     @@@DEnt:
9948     @@@@test:value:
9949     <?xml version="1.0"?>
9950     <e>&#x0;</e>
9951     @@@c:erred: <[[xp|wf-legal-character]]> { (2, 4)..(2, 8); }
9952     @@XMLTest:
9953     @@@QName: xp.element.content.hcr.legal.char.1.1.1.test
9954     @@@DEnt:
9955     @@@@test:value:
9956     <?xml version="1.1"?>
9957     <e>&#x0;</e>
9958     @@@c:erred: <[[xp|wf-legal-character]]> { (2, 4)..(2, 8); }
9959     @@XMLTest:
9960     @@@QName: xp.element.content.hcr.legal.char.1.0.2.test
9961 wakaba 1.11 @@@DEnt:
9962     @@@@test:value:
9963 wakaba 1.18 <?xml version="1.0"?>
9964     <e>&#x1;</e>
9965     @@@c:erred: <[[xp|wf-legal-character]]> { (2, 4)..(2, 8); }
9966 wakaba 1.11 @@XMLTest:
9967 wakaba 1.18 @@@QName: xp.element.content.hcr.legal.char.1.1.2.test
9968 wakaba 1.11 @@@DEnt:
9969     @@@@test:value:
9970 wakaba 1.18 <?xml version="1.1"?>
9971     <e>&#x1;</e>
9972 wakaba 1.11 @@@test:domTree:
9973     document {
9974 wakaba 1.18 xml-version: '1.1';
9975 wakaba 1.11 element {
9976 wakaba 1.18 text-content: U+0001;
9977 wakaba 1.6 }
9978     }
9979    
9980 wakaba 1.19 @@XMLTest:
9981     @@@QName: xp.element.content.ger.entity.declared.nodtd.1.test
9982     @@@DEnt:
9983     @@@@test:value:
9984     <p>&entity;</p>
9985     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 4)..(1, 11); }
9986     @@XMLTest:
9987     @@@QName: xp.element.content.ger.entity.declared.nodtd.2.test
9988     @@@DEnt:
9989     @@@@test:value:
9990     <?xml version="1.0" standalone="yes"?>
9991     <p>&entity;</p>
9992     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 4)..(2, 11); }
9993     @@XMLTest:
9994     @@@QName: xp.element.content.ger.entity.declared.nodtd.3.test
9995     @@@DEnt:
9996     @@@@test:value:
9997     <?xml version="1.0" standalone="no"?>
9998     <p>&entity;</p>
9999     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 4)..(2, 11); }
10000     @@XMLTest:
10001     @@@QName: xp.element.content.ger.entity.declared.nodtd.-1.test
10002     @@@DEnt:
10003     @@@@test:value:
10004     <p>&lt;&gt;&amp;&quot;&apos;</p>
10005     @@@test:domTree:
10006     document {
10007     element {
10008     text-content: '<>&"' U+0027;
10009     }
10010     }
10011     @@XMLTest:
10012     @@@QName: xp.element.content.ger.entity.declared.nopref.1.test
10013     @@@DEnt:
10014     @@@@test:value:
10015     <!DOCTYPE p []>
10016     <p>&entity;</p>
10017     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 4)..(2, 11); }
10018     @@XMLTest:
10019     @@@QName: xp.element.content.ger.entity.declared.nopref.2.test
10020     @@@DEnt:
10021     @@@@test:value:
10022     <!DOCTYPE p [
10023     <!ENTITY other "aa">
10024     <!ENTITY % another "aa">
10025     ]>
10026     <p>&entity;</p>
10027     @@@c:erred: <[[xp|wf-entity-declared]]> { (5, 4)..(5, 11); }
10028     @@XMLTest:
10029     @@@QName: xp.element.content.ger.entity.declared.nopref.3.test
10030     @@@DEnt:
10031     @@@@test:value:
10032     <?xml version="1.0" standalone="yes"?>
10033     <!DOCTYPE p []>
10034     <p>&entity;</p>
10035     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 4)..(3, 11); }
10036     @@XMLTest:
10037     @@@QName: xp.element.content.ger.entity.declared.nopref.4.test
10038     @@@DEnt:
10039     @@@@test:value:
10040     <?xml version="1.0" standalone="no"?>
10041     <!DOCTYPE p []>
10042     <p>&entity;</p>
10043     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 4)..(3, 11); }
10044     @@XMLTest:
10045     @@@QName: xp.element.content.ger.entity.declared.nopref.5.test
10046     @@@DEnt:
10047     @@@@test:value:
10048     <?xml version="1.0" standalone="yes"?>
10049     <!DOCTYPE p [
10050     <!ENTITY other "aa">
10051     <!ENTITY % another "aa">
10052     ]>
10053     <p>&entity;</p>
10054     @@@c:erred: <[[xp|wf-entity-declared]]> { (6, 4)..(6, 11); }
10055     @@XMLTest:
10056     @@@QName: xp.element.content.ger.entity.declared.nopref.6.test
10057     @@@DEnt:
10058     @@@@test:value:
10059     <?xml version="1.0" standalone="no"?>
10060     <!DOCTYPE p [
10061     <!ENTITY other "aa">
10062     <!ENTITY % another "aa">
10063     ]>
10064     <p>&entity;</p>
10065     @@@c:erred: <[[xp|wf-entity-declared]]> { (6, 4)..(6, 11); }
10066     @@XMLTest:
10067     @@@QName: xp.element.content.ger.entity.declared.nopref.-1.test
10068     @@@DEnt:
10069     @@@@test:value:
10070     <!DOCTYPE p [
10071     <!ENTITY entity "value">
10072     ]>
10073     <p>&entity;</p>
10074     @@@test:domTree:
10075     document {
10076     document-type {
10077     general-entity {
10078     node-name: 'entity';
10079     text-content: 'value';
10080     }
10081     }
10082     element {
10083 wakaba 1.20 general-entity-reference {
10084 wakaba 1.19 node-name: 'entity';
10085 wakaba 1.20 is-expanded: true;
10086 wakaba 1.19 text-content: 'value';
10087     }
10088     }
10089     }
10090     @@XMLTest:
10091     @@@QName: xp.element.content.ger.entity.declared.nopref.-2.test
10092     @@@DEnt:
10093     @@@@test:value:
10094     <!DOCTYPE p [
10095     <!ENTITY entity "value">
10096     <!ENTITY another SYSTEM "another">
10097     ]>
10098     <p>&entity;</p>
10099     @@@test:domTree:
10100     document {
10101     document-type {
10102     general-entity {
10103     node-name: 'entity';
10104     text-content: 'value';
10105     }
10106 wakaba 1.20 general-entity {
10107     node-name: 'another';
10108     public-id: null;
10109     system-id: 'another';
10110     }
10111 wakaba 1.19 }
10112     element {
10113 wakaba 1.20 general-entity-reference {
10114 wakaba 1.19 node-name: 'entity';
10115 wakaba 1.20 is-expanded: true;
10116 wakaba 1.19 text-content: 'value';
10117     }
10118     }
10119     }
10120     @@XMLTest:
10121     @@@QName: xp.element.content.ger.entity.declared.standalone.1.test
10122     @@@DEnt:
10123     @@@@test:value:
10124     <?xml version="1.0" standalone="yes"?>
10125     <p>&entity;</p>
10126     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 4)..(2, 11); }
10127     @@XMLTest:
10128     @@@QName: xp.element.content.ger.entity.declared.standalone.2.test
10129     @@@DEnt:
10130     @@@@test:value:
10131     <?xml version="1.0" standalone="yes"?>
10132     <!DOCTYPE p []>
10133     <p>&entity;</p>
10134     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 4)..(3, 11); }
10135     @@XMLTest:
10136     @@@QName: xp.element.content.ger.entity.declared.standalone.3.test
10137     @@@DEnt:
10138     @@@@test:value:
10139     <?xml version="1.0" standalone="yes"?>
10140     <!DOCTYPE p [
10141     <!ENTITY % para "<!-- -->">
10142     %para;
10143     ]>
10144     <p>&entity;</p>
10145     @@@c:erred: <[[xp|wf-entity-declared]]> { (6, 4)..(6, 11); }
10146     @@XMLTest:
10147     @@@QName: xp.element.content.ger.entity.declared.standalone.-1.test
10148     @@@DEnt:
10149     @@@@test:value:
10150     <?xml version="1.0" standalone="no"?>
10151     <!DOCTYPE p [
10152     <!ENTITY % para "<!-- -->">
10153     %para;
10154     ]>
10155     <p>&entity;</p>
10156     @@@test:domTree:
10157     document {
10158     document-type { }
10159     element {
10160     general-entity-reference {
10161     is-expanded: false;
10162     }
10163     }
10164     }
10165     @@XMLTest:
10166     @@@QName: xp.element.content.ger.entity.declared.standalone.-2.test
10167     @@@DEnt:
10168     @@@@test:value:
10169     <!DOCTYPE p [
10170     <!ENTITY % para "<!-- -->">
10171     %para;
10172     ]>
10173     <p>&entity;</p>
10174     @@@test:domTree:
10175     document {
10176     document-type { }
10177     element {
10178     general-entity-reference {
10179     is-expanded: false;
10180     }
10181     }
10182     }
10183     @@XMLTest:
10184     @@@QName: xp.element.content.ger.entity.declared.standalone.4.test
10185     @@@DEnt:
10186     @@@@test:value:
10187     <?xml version="1.0" standalone="yes"?>
10188     <!DOCTYPE p [
10189     <!ENTITY % para SYSTEM "para">
10190     %para;
10191     ]>
10192     <p>&entity;</p>
10193     @@@c:erred: <[[xp|wf-entity-declared]]> { (6, 4)..(6, 11); }
10194     @@XMLTest:
10195     @@@QName: xp.element.content.ger.entity.declared.standalone.-3.test
10196     @@@DEnt:
10197     @@@@test:value:
10198     <?xml version="1.0" standalone="no"?>
10199     <!DOCTYPE p [
10200     <!ENTITY % para SYSTEM "para">
10201     %para;
10202     ]>
10203     <p>&entity;</p>
10204     @@@test:domTree:
10205     document {
10206     document-type { }
10207     element {
10208     general-entity-reference {
10209     is-expanded: false;
10210     }
10211     }
10212     }
10213     @@XMLTest:
10214     @@@QName: xp.element.content.ger.entity.declared.standalone.-4.test
10215     @@@DEnt:
10216     @@@@test:value:
10217     <!DOCTYPE p [
10218     <!ENTITY % para SYSTEM "para">
10219     %para;
10220     ]>
10221     <p>&entity;</p>
10222     @@@test:domTree:
10223     document {
10224     document-type { }
10225     element {
10226     general-entity-reference {
10227     is-expanded: false;
10228     }
10229     }
10230     }
10231     @@XMLTest:
10232     @@@QName: xp.element.content.ger.entity.declared.standalone.5.test
10233     @@@DEnt:
10234     @@@@test:value:
10235     <?xml version="1.0" standalone="yes"?>
10236     <!DOCTYPE p SYSTEM "dtd">
10237     <p>&entity;</p>
10238     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 4)..(3, 11); }
10239     @@XMLTest:
10240     @@@QName: xp.element.content.ger.entity.declared.standalone.-5.test
10241     @@@DEnt:
10242     @@@@test:value:
10243     <?xml version="1.0" standalone="no"?>
10244     <!DOCTYPE p SYSTEM "dtd">
10245     <p>&entity;</p>
10246     @@@test:domTree:
10247     document {
10248     document-type { }
10249     element {
10250     general-entity-reference {
10251     is-expanded: false;
10252     }
10253     }
10254     }
10255     @@XMLTest:
10256     @@@QName: xp.element.content.ger.entity.declared.standalone.-6.test
10257     @@@DEnt:
10258     @@@@test:value:
10259     <!DOCTYPE p SYSTEM "dtd">
10260     <p>&entity;</p>
10261     @@@test:domTree:
10262     document {
10263     document-type { }
10264     element {
10265     general-entity-reference {
10266     is-expanded: false;
10267     }
10268     }
10269     }
10270    
10271 wakaba 1.20 @@XMLTest:
10272     @@@QName: xp.reptxt.element.content.ger.entity.declared.nopref.1.test
10273     @@@DEnt:
10274     @@@@test:value:
10275     <!DOCTYPE p [
10276     <!ENTITY c "&entity;">
10277     ]>
10278     <p>&c;</p>
10279     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
10280     @@XMLTest:
10281     @@@QName: xp.reptxt.element.content.ger.entity.declared.nopref.2.test
10282     @@@DEnt:
10283     @@@@test:value:
10284     <!DOCTYPE p [
10285     <!ENTITY other "aa">
10286     <!ENTITY % another "aa">
10287     <!ENTITY c "&entity;">
10288     ]>
10289     <p>&c;</p>
10290     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
10291     @@XMLTest:
10292     @@@QName: xp.reptxt.element.content.ger.entity.declared.nopref.3.test
10293     @@@DEnt:
10294     @@@@test:value:
10295     <?xml version="1.0" standalone="yes"?>
10296     <!DOCTYPE p [
10297     <!ENTITY c "&entity;">
10298     ]>
10299     <p>&c;</p>
10300     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
10301     @@XMLTest:
10302     @@@QName: xp.reptxt.element.content.ger.entity.declared.nopref.4.test
10303     @@@DEnt:
10304     @@@@test:value:
10305     <?xml version="1.0" standalone="no"?>
10306     <!DOCTYPE p [
10307     <!ENTITY c "&entity;">
10308     ]>
10309     <p>&c;</p>
10310     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
10311     @@XMLTest:
10312     @@@QName: xp.reptxt.element.content.ger.entity.declared.nopref.5.test
10313     @@@DEnt:
10314     @@@@test:value:
10315     <?xml version="1.0" standalone="yes"?>
10316     <!DOCTYPE p [
10317     <!ENTITY other "aa">
10318     <!ENTITY % another "aa">
10319     <!ENTITY c "&entity;">
10320     ]>
10321     <p>&c;</p>
10322     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
10323     @@XMLTest:
10324     @@@QName: xp.reptxt.element.content.ger.entity.declared.nopref.6.test
10325     @@@DEnt:
10326     @@@@test:value:
10327     <?xml version="1.0" standalone="no"?>
10328     <!DOCTYPE p [
10329     <!ENTITY other "aa">
10330     <!ENTITY % another "aa">
10331     <!ENTITY c "&entity;">
10332     ]>
10333     <p>&c;</p>
10334     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
10335     @@XMLTest:
10336     @@@QName: xp.reptxt.element.content.ger.entity.declared.nopref.-1.test
10337     @@@DEnt:
10338     @@@@test:value:
10339     <!DOCTYPE p [
10340     <!ENTITY entity "value">
10341     <!ENTITY c "&entity;">
10342     ]>
10343     <p>&c;</p>
10344     @@@test:domTree:
10345     document {
10346     document-type {
10347     general-entity {
10348     node-name: 'entity';
10349     text-content: 'value';
10350     }
10351     general-entity {
10352     node-name: 'c';
10353     general-entity-reference {
10354     node-name: 'entity';
10355     text-content: 'value';
10356     }
10357     }
10358     }
10359     element {
10360     general-entity-reference {
10361     node-name: 'c';
10362     general-entity-reference {
10363     node-name: 'entity';
10364     text-content: 'value';
10365     }
10366     }
10367     }
10368     }
10369     @@XMLTest:
10370     @@@QName: xp.reptxt.element.content.ger.entity.declared.nopref.-2.test
10371     @@@DEnt:
10372     @@@@test:value:
10373     <!DOCTYPE p [
10374     <!ENTITY entity "value">
10375     <!ENTITY another SYSTEM "another">
10376     <!ENTITY c "&entity;">
10377     ]>
10378     <p>&c;</p>
10379     @@@test:domTree:
10380     document {
10381     document-type {
10382     general-entity {
10383     node-name: 'entity';
10384     text-content: 'value';
10385     }
10386     general-entity {
10387     node-name: 'c';
10388     general-entity-reference {
10389     node-name: 'entity';
10390 wakaba 1.23 is-expanded: true;
10391 wakaba 1.20 text-content: 'value';
10392     }
10393     }
10394     general-entity {
10395     node-name: 'another';
10396     public-id: null;
10397     system-id: 'another';
10398     has-replacement-tree: false;
10399     }
10400     }
10401     element {
10402     general-entity-reference {
10403     node-name: 'c';
10404 wakaba 1.23 is-expanded: true;
10405 wakaba 1.20 general-entity-reference {
10406     node-name: 'entity';
10407 wakaba 1.23 is-expanded: true;
10408 wakaba 1.20 text-content: 'value';
10409     }
10410     }
10411     }
10412     }
10413     @@XMLTest:
10414     @@@QName: xp.reptxt.element.content.ger.entity.declared.standalone.2.test
10415     @@@DEnt:
10416     @@@@test:value:
10417     <?xml version="1.0" standalone="yes"?>
10418     <!DOCTYPE p [
10419     <!ENTITY c "&entity;">
10420     ]>
10421     <p>&c;</p>
10422     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
10423     @@XMLTest:
10424     @@@QName: xp.reptxt.element.content.ger.entity.declared.standalone.3.test
10425     @@@DEnt:
10426     @@@@test:value:
10427     <?xml version="1.0" standalone="yes"?>
10428     <!DOCTYPE p [
10429     <!ENTITY % para "<!-- -->">
10430     %para;
10431     <!ENTITY c "&entity;">
10432     ]>
10433     <p>&c;</p>
10434     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
10435     @@XMLTest:
10436     @@@QName: xp.reptxt.element.content.ger.entity.declared.standalone.-1.test
10437     @@@DEnt:
10438     @@@@test:value:
10439     <?xml version="1.0" standalone="no"?>
10440     <!DOCTYPE p [
10441     <!ENTITY c "&entity;">
10442     <!ENTITY % para "<!-- -->">
10443     %para;
10444     ]>
10445     <p>&c;</p>
10446     @@@test:domTree:
10447     document {
10448     document-type {
10449     general-entity {
10450     node-name: 'c';
10451     general-entity-reference {
10452     node-name: 'entity';
10453     is-expanded: false;
10454     }
10455     }
10456     }
10457     element {
10458     general-entity-reference {
10459     node-name: 'c';
10460     general-entity-reference {
10461     node-name: 'entity';
10462     is-expanded: false;
10463     }
10464     }
10465     }
10466     }
10467     @@XMLTest:
10468     @@@QName:
10469     xp.reptxt.element.content.ger.entity.declared.standalone.-1.2.test
10470     @@@DEnt:
10471     @@@@test:value:
10472     <?xml version="1.0" standalone="no"?>
10473     <!DOCTYPE p [
10474     <!ENTITY % para "<!-- -->">
10475     %para;
10476     <!ENTITY c "&entity;">
10477     ]>
10478     <p>&c;</p>
10479     @@@test:domTree:
10480     document {
10481     document-type { }
10482     element {
10483     general-entity-reference {
10484     node-name: 'c';
10485     is-expanded: false;
10486     }
10487     }
10488     }
10489     @@XMLTest:
10490     @@@QName: xp.reptxt.element.content.ger.entity.declared.standalone.-2.test
10491     @@@DEnt:
10492     @@@@test:value:
10493     <!DOCTYPE p [
10494     <!ENTITY c "&entity;">
10495     <!ENTITY % para "<!-- -->">
10496     %para;
10497     ]>
10498     <p>&c;</p>
10499     @@@test:domTree:
10500     document {
10501     document-type { }
10502     element {
10503     general-entity-reference {
10504     node-name: 'c';
10505     is-expanded: true;
10506     general-entity-reference {
10507     node-name: 'entity';
10508     is-expanded: false;
10509     }
10510     }
10511     }
10512     }
10513     @@XMLTest:
10514     @@@QName:
10515     xp.reptxt.element.content.ger.entity.declared.standalone.-2.2.test
10516     @@@DEnt:
10517     @@@@test:value:
10518     <!DOCTYPE p [
10519     <!ENTITY % para "<!-- -->">
10520     %para;
10521     <!ENTITY c "&entity;">
10522     ]>
10523     <p>&c;</p>
10524     @@@test:domTree:
10525     document {
10526     document-type { }
10527     element {
10528     general-entity-reference {
10529     node-name: 'c';
10530     is-expanded: false;
10531     }
10532     }
10533     }
10534     @@XMLTest:
10535     @@@QName: xp.reptxt.element.content.ger.entity.declared.standalone.4.test
10536     @@@DEnt:
10537     @@@@test:value:
10538     <?xml version="1.0" standalone="yes"?>
10539     <!DOCTYPE p [
10540     <!ENTITY % para SYSTEM "para">
10541     %para;
10542     <!ENTITY c "&entity;">
10543     ]>
10544     <p>&c;</p>
10545     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
10546     @@XMLTest:
10547     @@@QName: xp.reptxt.element.content.ger.entity.declared.standalone.-3.test
10548     @@@DEnt:
10549     @@@@test:value:
10550     <?xml version="1.0" standalone="no"?>
10551     <!DOCTYPE p [
10552     <!ENTITY c "&entity;">
10553     <!ENTITY % para SYSTEM "para">
10554     %para;
10555     ]>
10556     <p>&c;</p>
10557     @@@test:domTree:
10558     document {
10559     document-type { }
10560     element {
10561     general-entity-reference {
10562     node-name: 'c';
10563     is-expanded: true;
10564     general-entity-reference {
10565     node-name: 'entity';
10566     is-expanded: false;
10567     }
10568     }
10569     }
10570     }
10571     @@XMLTest:
10572     @@@QName:
10573     xp.reptxt.element.content.ger.entity.declared.standalone.-3.2.test
10574     @@@DEnt:
10575     @@@@test:value:
10576     <?xml version="1.0" standalone="no"?>
10577     <!DOCTYPE p [
10578     <!ENTITY % para SYSTEM "para">
10579     %para;
10580     <!ENTITY c "&entity;">
10581     ]>
10582     <p>&c;</p>
10583     @@@test:domTree:
10584     document {
10585     document-type { }
10586     element {
10587     general-entity-reference {
10588     node-name: 'c';
10589     is-expanded: false;
10590     }
10591     }
10592     }
10593     @@XMLTest:
10594     @@@QName: xp.reptxt.element.content.ger.entity.declared.standalone.-4.test
10595     @@@DEnt:
10596     @@@@test:value:
10597     <!DOCTYPE p [
10598     <!ENTITY c "&entity;">
10599     <!ENTITY % para SYSTEM "para">
10600     %para;
10601     ]>
10602     <p>&c;</p>
10603     @@@test:domTree:
10604     document {
10605     document-type { }
10606     element {
10607     general-entity-reference {
10608     node-name: 'c';
10609     is-expanded: true;
10610     general-entity-reference {
10611     node-name: 'entity';
10612     is-expanded: false;
10613     }
10614     }
10615     }
10616     }
10617     @@XMLTest:
10618     @@@QName:
10619     xp.reptxt.element.content.ger.entity.declared.standalone.-4.2.test
10620     @@@DEnt:
10621     @@@@test:value:
10622     <!DOCTYPE p [
10623     <!ENTITY % para SYSTEM "para">
10624     %para;
10625     <!ENTITY c "&entity;">
10626     ]>
10627     <p>&c;</p>
10628     @@@test:domTree:
10629     document {
10630     document-type { }
10631     element {
10632     general-entity-reference {
10633     node-name: 'c';
10634     is-expanded: false;
10635     }
10636     }
10637     }
10638     @@XMLTest:
10639     @@@QName: xp.reptxt.element.content.ger.entity.declared.standalone.5.test
10640     @@@DEnt:
10641     @@@@test:value:
10642     <?xml version="1.0" standalone="yes"?>
10643     <!DOCTYPE p SYSTEM "dtd" [
10644     <!ENTITY c "&entity;">
10645     ]>
10646     <p>&c;</p>
10647     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
10648     @@XMLTest:
10649     @@@QName: xp.reptxt.element.content.ger.entity.declared.standalone.-5.test
10650     @@@DEnt:
10651     @@@@test:value:
10652     <?xml version="1.0" standalone="no"?>
10653     <!DOCTYPE p SYSTEM "dtd" [
10654     <!ENTITY c "&entity;">
10655     ]>
10656     <p>&c;</p>
10657     @@@test:domTree:
10658     document {
10659     document-type { }
10660     element {
10661     general-entity-reference {
10662     node-name: 'c';
10663     is-expanded: true;
10664     general-entity-reference {
10665     node-name: 'entity';
10666     is-expanded: false;
10667     }
10668     }
10669     }
10670     }
10671     @@XMLTest:
10672     @@@QName: xp.reptxt.element.content.ger.entity.declared.standalone.-6.test
10673     @@@DEnt:
10674     @@@@test:value:
10675     <!DOCTYPE p SYSTEM "dtd" [<!ENTITY c "&entity;">]>
10676     <p>&c;</p>
10677     @@@test:domTree:
10678     document {
10679     document-type { }
10680     element {
10681     general-entity-reference {
10682     node-name: 'c';
10683     is-expanded: true;
10684     general-entity-reference {
10685     node-name: 'entity';
10686     is-expanded: false;
10687     }
10688     }
10689     }
10690     }
10691    
10692     @@XMLTest:
10693     @@@QName: xp.attval.ger.entity.declared.nodtd.1.test
10694     @@@DEnt:
10695     @@@@test:value:
10696     <p a="&entity;"/>
10697     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 7)..(1, 14); }
10698     @@XMLTest:
10699     @@@QName: xp.attval.ger.entity.declared.nodtd.2.test
10700     @@@DEnt:
10701     @@@@test:value:
10702     <?xml version="1.0" standalone="yes"?>
10703     <p a="&entity;"/>
10704     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 7)..(2, 14); }
10705     @@XMLTest:
10706     @@@QName: xp.attval.ger.entity.declared.nodtd.3.test
10707     @@@DEnt:
10708     @@@@test:value:
10709     <?xml version="1.0" standalone="no"?>
10710     <p a="&entity;"/>
10711     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 7)..(2, 14); }
10712     @@XMLTest:
10713     @@@QName: xp.attval.ger.entity.declared.nodtd.-1.test
10714     @@@DEnt:
10715     @@@@test:value:
10716     <p a="&lt;&gt;&amp;&quot;&apos;"/>
10717     @@@test:domTree:
10718     document {
10719     element {
10720     attribute {
10721     node-name: 'a';
10722     text-content: '<>&"' U+0027;
10723     }
10724     }
10725     }
10726     @@XMLTest:
10727     @@@QName: xp.attval.ger.entity.declared.nopref.1.test
10728     @@@DEnt:
10729     @@@@test:value:
10730     <!DOCTYPE p []>
10731     <p a="&entity;"/>
10732     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 7)..(2, 14); }
10733     @@XMLTest:
10734     @@@QName: xp.attval.ger.entity.declared.nopref.2.test
10735     @@@DEnt:
10736     @@@@test:value:
10737     <!DOCTYPE p [
10738     <!ENTITY other "aa">
10739     <!ENTITY % another "aa">
10740     ]>
10741     <p a="&entity;"/>
10742     @@@c:erred: <[[xp|wf-entity-declared]]> { (5, 7)..(5, 14); }
10743     @@XMLTest:
10744     @@@QName: xp.attval.ger.entity.declared.nopref.3.test
10745     @@@DEnt:
10746     @@@@test:value:
10747     <?xml version="1.0" standalone="yes"?>
10748     <!DOCTYPE p []>
10749     <p a="&entity;"/>
10750     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 7)..(3, 14); }
10751     @@XMLTest:
10752     @@@QName: xp.attval.ger.entity.declared.nopref.4.test
10753     @@@DEnt:
10754     @@@@test:value:
10755     <?xml version="1.0" standalone="no"?>
10756     <!DOCTYPE p []>
10757     <p a="&entity;"/>
10758     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 7)..(3, 14); }
10759     @@XMLTest:
10760     @@@QName: xp.attval.ger.entity.declared.nopref.5.test
10761     @@@DEnt:
10762     @@@@test:value:
10763     <?xml version="1.0" standalone="yes"?>
10764     <!DOCTYPE p [
10765     <!ENTITY other "aa">
10766     <!ENTITY % another "aa">
10767     ]>
10768     <p a="&entity;"/>
10769     @@@c:erred: <[[xp|wf-entity-declared]]> { (6, 7)..(6, 14); }
10770     @@XMLTest:
10771     @@@QName: xp.attval.ger.entity.declared.nopref.6.test
10772     @@@DEnt:
10773     @@@@test:value:
10774     <?xml version="1.0" standalone="no"?>
10775     <!DOCTYPE p [
10776     <!ENTITY other "aa">
10777     <!ENTITY % another "aa">
10778     ]>
10779     <p a="&entity;"/>
10780     @@@c:erred: <[[xp|wf-entity-declared]]> { (6, 7)..(6, 14); }
10781     @@XMLTest:
10782     @@@QName: xp.attval.ger.entity.declared.nopref.-1.test
10783     @@@DEnt:
10784     @@@@test:value:
10785     <!DOCTYPE p [
10786     <!ENTITY entity "value">
10787     ]>
10788     <p a="&entity;"/>
10789     @@@test:domTree:
10790     document {
10791     document-type {
10792     general-entity {
10793     node-name: 'entity';
10794     text-content: 'value';
10795     }
10796     }
10797     element {
10798     attribute {
10799     node-name: 'a';
10800     general-entity-reference {
10801     node-name: 'entity';
10802     is-expanded: true;
10803     text-content: 'value';
10804     }
10805     }
10806     }
10807     }
10808     @@XMLTest:
10809     @@@QName: xp.attval.ger.entity.declared.nopref.-2.test
10810     @@@DEnt:
10811     @@@@test:value:
10812     <!DOCTYPE p [
10813     <!ENTITY entity "value">
10814     <!ENTITY another SYSTEM "another">
10815     ]>
10816     <p a="&entity;"/>
10817     @@@test:domTree:
10818     document {
10819     document-type {
10820     general-entity {
10821     node-name: 'entity';
10822     text-content: 'value';
10823     has-replacement-tree: true;
10824     }
10825     general-entity {
10826     node-name: 'another';
10827     public-id: null;
10828     system-id: 'another';
10829     has-replacement-tree: false;
10830     }
10831     }
10832     element {
10833     attribute {
10834     node-name: 'a';
10835     general-entity-reference {
10836     node-name: 'entity';
10837     is-expanded: true;
10838     text-content: 'value';
10839     }
10840     }
10841     }
10842     }
10843     @@XMLTest:
10844     @@@QName: xp.attval.ger.entity.declared.standalone.1.test
10845     @@@DEnt:
10846     @@@@test:value:
10847     <?xml version="1.0" standalone="yes"?>
10848     <p a="&entity;"/>
10849     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 7)..(2, 14); }
10850     @@XMLTest:
10851     @@@QName: xp.attval.ger.entity.declared.standalone.2.test
10852     @@@DEnt:
10853     @@@@test:value:
10854     <?xml version="1.0" standalone="yes"?>
10855     <!DOCTYPE p []>
10856     <p a="&entity;"/>
10857     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 7)..(3, 14); }
10858     @@XMLTest:
10859     @@@QName: xp.attval.ger.entity.declared.standalone.3.test
10860     @@@DEnt:
10861     @@@@test:value:
10862     <?xml version="1.0" standalone="yes"?>
10863     <!DOCTYPE p [
10864     <!ENTITY % para "<!-- -->">
10865     %para;
10866     ]>
10867     <p a="&entity;"/>
10868     @@@c:erred: <[[xp|wf-entity-declared]]> { (6, 7)..(6, 14); }
10869     @@XMLTest:
10870     @@@QName: xp.attval.ger.entity.declared.standalone.-1.test
10871     @@@DEnt:
10872     @@@@test:value:
10873     <?xml version="1.0" standalone="no"?>
10874     <!DOCTYPE p [
10875     <!ENTITY % para "<!-- -->">
10876     %para;
10877     ]>
10878     <p a="&entity;"/>
10879     @@@test:domTree:
10880     document {
10881     document-type { }
10882     element {
10883     attribute {
10884     node-name: 'a';
10885     general-entity-reference {
10886     is-expanded: false;
10887     }
10888     }
10889     }
10890     }
10891     @@XMLTest:
10892     @@@QName: xp.attval.ger.entity.declared.standalone.-2.test
10893     @@@DEnt:
10894     @@@@test:value:
10895     <!DOCTYPE p [
10896     <!ENTITY % para "<!-- -->">
10897     %para;
10898     ]>
10899     <p a="&entity;"/>
10900     @@@test:domTree:
10901     document {
10902     document-type { }
10903     element {
10904     attribute {
10905     node-name: 'a';
10906     general-entity-reference {
10907     is-expanded: false;
10908     }
10909     }
10910     }
10911     }
10912     @@XMLTest:
10913     @@@QName: xp.attval.ger.entity.declared.standalone.4.test
10914     @@@DEnt:
10915     @@@@test:value:
10916     <?xml version="1.0" standalone="yes"?>
10917     <!DOCTYPE p [
10918     <!ENTITY % para SYSTEM "para">
10919     %para;
10920     ]>
10921     <p a="&entity;"/>
10922     @@@c:erred: <[[xp|wf-entity-declared]]> { (6, 7)..(6, 14); }
10923     @@XMLTest:
10924     @@@QName: xp.attval.ger.entity.declared.standalone.-3.test
10925     @@@DEnt:
10926     @@@@test:value:
10927     <?xml version="1.0" standalone="no"?>
10928     <!DOCTYPE p [
10929     <!ENTITY % para SYSTEM "para">
10930     %para;
10931     ]>
10932     <p a="&entity;"/>
10933     @@@test:domTree:
10934     document {
10935     document-type { }
10936     element {
10937     attribute {
10938     node-name: 'a';
10939     general-entity-reference {
10940     is-expanded: false;
10941     }
10942     }
10943     }
10944     }
10945     @@XMLTest:
10946     @@@QName: xp.attval.ger.entity.declared.standalone.-4.test
10947     @@@DEnt:
10948     @@@@test:value:
10949     <!DOCTYPE p [
10950     <!ENTITY % para SYSTEM "para">
10951     %para;
10952     ]>
10953     <p a="&entity;"/>
10954     @@@test:domTree:
10955     document {
10956     document-type { }
10957     element {
10958     attribute {
10959     node-name: 'a';
10960     general-entity-reference {
10961     is-expanded: false;
10962     }
10963     }
10964     }
10965     }
10966     @@XMLTest:
10967     @@@QName: xp.attval.ger.entity.declared.standalone.5.test
10968     @@@DEnt:
10969     @@@@test:value:
10970     <?xml version="1.0" standalone="yes"?>
10971     <!DOCTYPE p SYSTEM "dtd">
10972     <p a="&entity;"/>
10973     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 7)..(3, 14); }
10974     @@XMLTest:
10975     @@@QName: xp.attval.ger.entity.declared.standalone.-5.test
10976     @@@DEnt:
10977     @@@@test:value:
10978     <?xml version="1.0" standalone="no"?>
10979     <!DOCTYPE p SYSTEM "dtd">
10980     <p a="&entity;"/>
10981     @@@test:domTree:
10982     document {
10983     document-type { }
10984     element {
10985     attribute {
10986     node-name: 'a';
10987     general-entity-reference {
10988     is-expanded: false;
10989     }
10990     }
10991     }
10992     }
10993     @@XMLTest:
10994     @@@QName: xp.attval.ger.entity.declared.standalone.-6.test
10995     @@@DEnt:
10996     @@@@test:value:
10997     <!DOCTYPE p SYSTEM "dtd">
10998     <p a="&entity;"/>
10999     @@@test:domTree:
11000     document {
11001     document-type { }
11002     element {
11003     attribute {
11004     node-name: 'a';
11005     general-entity-reference {
11006     is-expanded: false;
11007     }
11008     }
11009     }
11010     }
11011    
11012 wakaba 1.21 @@XMLTest:
11013 wakaba 1.22 @@@QName: xp.reptxt.attval.ger.entity.declared.nopref.1.test
11014 wakaba 1.21 @@@DEnt:
11015     @@@@test:value:
11016     <!DOCTYPE p [
11017 wakaba 1.22 <!ENTITY c "&entity;">
11018 wakaba 1.21 ]>
11019 wakaba 1.22 <p a="&c;"/>
11020     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11021 wakaba 1.21 @@XMLTest:
11022 wakaba 1.22 @@@QName: xp.reptxt.attval.ger.entity.declared.nopref.2.test
11023 wakaba 1.21 @@@DEnt:
11024     @@@@test:value:
11025     <!DOCTYPE p [
11026     <!ENTITY other "aa">
11027     <!ENTITY % another "aa">
11028 wakaba 1.22 <!ENTITY c "&entity;">
11029 wakaba 1.21 ]>
11030 wakaba 1.22 <p a="&c;"/>
11031     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11032 wakaba 1.21 @@XMLTest:
11033 wakaba 1.22 @@@QName: xp.reptxt.attval.ger.entity.declared.nopref.3.test
11034 wakaba 1.21 @@@DEnt:
11035     @@@@test:value:
11036     <?xml version="1.0" standalone="yes"?>
11037     <!DOCTYPE p [
11038 wakaba 1.22 <!ENTITY c "&entity;">
11039 wakaba 1.21 ]>
11040 wakaba 1.22 <p a="&c;"/>
11041     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11042 wakaba 1.21 @@XMLTest:
11043 wakaba 1.22 @@@QName: xp.reptxt.attval.ger.entity.declared.nopref.4.test
11044 wakaba 1.21 @@@DEnt:
11045     @@@@test:value:
11046     <?xml version="1.0" standalone="no"?>
11047     <!DOCTYPE p [
11048 wakaba 1.22 <!ENTITY c "&entity;">
11049 wakaba 1.21 ]>
11050 wakaba 1.22 <p a="&c;"/>
11051     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11052 wakaba 1.21 @@XMLTest:
11053 wakaba 1.22 @@@QName: xp.reptxt.attval.ger.entity.declared.nopref.5.test
11054 wakaba 1.21 @@@DEnt:
11055     @@@@test:value:
11056     <?xml version="1.0" standalone="yes"?>
11057     <!DOCTYPE p [
11058     <!ENTITY other "aa">
11059     <!ENTITY % another "aa">
11060 wakaba 1.22 <!ENTITY c "&entity;">
11061 wakaba 1.21 ]>
11062 wakaba 1.22 <p a="&c;"/>
11063     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11064 wakaba 1.21 @@XMLTest:
11065 wakaba 1.22 @@@QName: xp.reptxt.attval.ger.entity.declared.nopref.6.test
11066 wakaba 1.21 @@@DEnt:
11067     @@@@test:value:
11068     <?xml version="1.0" standalone="no"?>
11069     <!DOCTYPE p [
11070     <!ENTITY other "aa">
11071     <!ENTITY % another "aa">
11072 wakaba 1.22 <!ENTITY c "&entity;">
11073 wakaba 1.21 ]>
11074 wakaba 1.22 <p a="&c;"/>
11075     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11076 wakaba 1.21 @@XMLTest:
11077 wakaba 1.22 @@@QName: xp.reptxt.attval.ger.entity.declared.nopref.-1.test
11078 wakaba 1.21 @@@DEnt:
11079     @@@@test:value:
11080     <!DOCTYPE p [
11081     <!ENTITY entity "value">
11082 wakaba 1.22 <!ENTITY c "&entity;">
11083 wakaba 1.21 ]>
11084 wakaba 1.22 <p a="&c;"/>
11085 wakaba 1.21 @@@test:domTree:
11086     document {
11087     document-type {
11088     general-entity {
11089     node-name: 'entity';
11090     text-content: 'value';
11091     }
11092 wakaba 1.22 general-entity {
11093     node-name: 'c';
11094     general-entity-reference {
11095     node-name: 'entity';
11096     text-content: 'value';
11097 wakaba 1.21 }
11098     }
11099     }
11100     element {
11101     attribute {
11102     node-name: 'a';
11103     general-entity-reference {
11104 wakaba 1.22 node-name: 'c';
11105     general-entity-reference {
11106     node-name: 'entity';
11107     text-content: 'value';
11108     }
11109 wakaba 1.21 }
11110     }
11111     }
11112     }
11113     @@XMLTest:
11114 wakaba 1.22 @@@QName: xp.reptxt.attval.ger.entity.declared.nopref.-2.test
11115 wakaba 1.21 @@@DEnt:
11116     @@@@test:value:
11117     <!DOCTYPE p [
11118     <!ENTITY entity "value">
11119     <!ENTITY another SYSTEM "another">
11120 wakaba 1.22 <!ENTITY c "&entity;">
11121 wakaba 1.21 ]>
11122 wakaba 1.22 <p a="&c;"/>
11123 wakaba 1.21 @@@test:domTree:
11124     document {
11125     document-type {
11126     general-entity {
11127     node-name: 'entity';
11128     text-content: 'value';
11129 wakaba 1.22 }
11130     general-entity {
11131     node-name: 'c';
11132     general-entity-reference {
11133     node-name: 'entity';
11134     text-content: 'value';
11135     }
11136 wakaba 1.21 }
11137     general-entity {
11138     node-name: 'another';
11139     public-id: null;
11140     system-id: 'another';
11141     has-replacement-tree: false;
11142     }
11143     }
11144     element {
11145     attribute {
11146     node-name: 'a';
11147     general-entity-reference {
11148 wakaba 1.22 node-name: 'c';
11149     general-entity-reference {
11150     node-name: 'entity';
11151     text-content: 'value';
11152     }
11153 wakaba 1.21 }
11154     }
11155     }
11156     }
11157     @@XMLTest:
11158 wakaba 1.22 @@@QName: xp.reptxt.attval.ger.entity.declared.standalone.2.test
11159 wakaba 1.21 @@@DEnt:
11160     @@@@test:value:
11161     <?xml version="1.0" standalone="yes"?>
11162     <!DOCTYPE p [
11163 wakaba 1.22 <!ENTITY c "&entity;">
11164 wakaba 1.21 ]>
11165 wakaba 1.22 <p a="&c;"/>
11166     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11167 wakaba 1.21 @@XMLTest:
11168 wakaba 1.22 @@@QName: xp.reptxt.attval.ger.entity.declared.standalone.3.test
11169 wakaba 1.21 @@@DEnt:
11170     @@@@test:value:
11171     <?xml version="1.0" standalone="yes"?>
11172     <!DOCTYPE p [
11173     <!ENTITY % para "<!-- -->">
11174     %para;
11175 wakaba 1.22 <!ENTITY c "&entity;">
11176 wakaba 1.21 ]>
11177 wakaba 1.22 <p a="&c;"/>
11178     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11179 wakaba 1.21 @@XMLTest:
11180 wakaba 1.22 @@@QName: xp.reptxt.attval.ger.entity.declared.standalone.-1.test
11181 wakaba 1.21 @@@DEnt:
11182     @@@@test:value:
11183 wakaba 1.22 <?xml version="1.0" standalone="no"?>
11184 wakaba 1.21 <!DOCTYPE p [
11185 wakaba 1.22 <!ENTITY c "&entity;">
11186 wakaba 1.21 <!ENTITY % para "<!-- -->">
11187     %para;
11188     ]>
11189 wakaba 1.22 <p a="&c;"/>
11190     @@@test:domTree:
11191     document {
11192     document-type {
11193     general-entity {
11194     node-name: 'c';
11195     general-entity-reference {
11196     node-name: 'entity';
11197     is-expanded: false;
11198     }
11199     }
11200     }
11201     element {
11202     attribute {
11203     node-name: 'a';
11204     general-entity-reference {
11205     node-name: 'c';
11206     general-entity-reference {
11207     node-name: 'entity';
11208     is-expanded: false;
11209     }
11210     }
11211     }
11212     }
11213     }
11214 wakaba 1.21 @@XMLTest:
11215 wakaba 1.22 @@@QName:
11216     xp.reptxt.attval.ger.entity.declared.standalone.-1.2.test
11217 wakaba 1.21 @@@DEnt:
11218     @@@@test:value:
11219     <?xml version="1.0" standalone="no"?>
11220     <!DOCTYPE p [
11221     <!ENTITY % para "<!-- -->">
11222     %para;
11223 wakaba 1.22 <!ENTITY c "&entity;">
11224 wakaba 1.21 ]>
11225 wakaba 1.22 <p a="&c;"/>
11226     @@@test:domTree:
11227     document {
11228     document-type { }
11229     element {
11230     attribute {
11231     node-name: 'a';
11232     general-entity-reference {
11233     node-name: 'c';
11234     is-expanded: false;
11235     }
11236     }
11237     }
11238     }
11239 wakaba 1.21 @@XMLTest:
11240 wakaba 1.22 @@@QName: xp.reptxt.attval.ger.entity.declared.standalone.-2.test
11241 wakaba 1.21 @@@DEnt:
11242     @@@@test:value:
11243     <!DOCTYPE p [
11244 wakaba 1.22 <!ENTITY c "&entity;">
11245     <!ENTITY % para "<!-- -->">
11246     %para;
11247     ]>
11248     <p a="&c;"/>
11249     @@@test:domTree:
11250     document {
11251     document-type { }
11252     element {
11253     attribute {
11254     node-name: 'a';
11255     general-entity-reference {
11256     node-name: 'c';
11257     is-expanded: true;
11258     general-entity-reference {
11259     node-name: 'entity';
11260     is-expanded: false;
11261     }
11262     }
11263     }
11264     }
11265     }
11266     @@XMLTest:
11267     @@@QName:
11268     xp.reptxt.attval.ger.entity.declared.standalone.-2.2.test
11269     @@@DEnt:
11270     @@@@test:value:
11271     <!DOCTYPE p [
11272     <!ENTITY % para "<!-- -->">
11273     %para;
11274     <!ENTITY c "&entity;">
11275     ]>
11276     <p a="&c;"/>
11277     @@@test:domTree:
11278     document {
11279     document-type { }
11280     element {
11281     attribute {
11282     node-name: 'a';
11283     general-entity-reference {
11284     node-name: 'c';
11285     is-expanded: false;
11286     }
11287     }
11288     }
11289     }
11290     @@XMLTest:
11291     @@@QName: xp.reptxt.attval.ger.entity.declared.standalone.4.test
11292     @@@DEnt:
11293     @@@@test:value:
11294     <?xml version="1.0" standalone="yes"?>
11295     <!DOCTYPE p [
11296     <!ENTITY % para SYSTEM "para">
11297     %para;
11298     <!ENTITY c "&entity;">
11299     ]>
11300     <p a="&c;"/>
11301     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11302     @@XMLTest:
11303     @@@QName: xp.reptxt.attval.ger.entity.declared.standalone.-3.test
11304     @@@DEnt:
11305     @@@@test:value:
11306     <?xml version="1.0" standalone="no"?>
11307     <!DOCTYPE p [
11308     <!ENTITY c "&entity;">
11309     <!ENTITY % para SYSTEM "para">
11310     %para;
11311     ]>
11312     <p a="&c;"/>
11313     @@@test:domTree:
11314     document {
11315     document-type { }
11316     element {
11317     attribute {
11318     node-name: 'a';
11319     general-entity-reference {
11320     node-name: 'c';
11321     is-expanded: true;
11322     general-entity-reference {
11323     node-name: 'entity';
11324     is-expanded: false;
11325     }
11326     }
11327     }
11328     }
11329     }
11330     @@XMLTest:
11331     @@@QName:
11332     xp.reptxt.attval.ger.entity.declared.standalone.-3.2.test
11333     @@@DEnt:
11334     @@@@test:value:
11335     <?xml version="1.0" standalone="no"?>
11336     <!DOCTYPE p [
11337     <!ENTITY % para SYSTEM "para">
11338     %para;
11339     <!ENTITY c "&entity;">
11340     ]>
11341     <p a="&c;"/>
11342     @@@test:domTree:
11343     document {
11344     document-type { }
11345     element {
11346     attribute {
11347     node-name: 'a';
11348     general-entity-reference {
11349     node-name: 'c';
11350     is-expanded: false;
11351     }
11352     }
11353     }
11354     }
11355     @@XMLTest:
11356     @@@QName: xp.reptxt.attval.ger.entity.declared.standalone.-4.test
11357     @@@DEnt:
11358     @@@@test:value:
11359     <!DOCTYPE p [
11360     <!ENTITY c "&entity;">
11361     <!ENTITY % para SYSTEM "para">
11362     %para;
11363     ]>
11364     <p a="&c;"/>
11365     @@@test:domTree:
11366     document {
11367     document-type { }
11368     element {
11369     attribute {
11370     node-name: 'a';
11371     general-entity-reference {
11372     node-name: 'c';
11373     is-expanded: true;
11374     general-entity-reference {
11375     node-name: 'entity';
11376     is-expanded: false;
11377     }
11378     }
11379     }
11380     }
11381     }
11382     @@XMLTest:
11383     @@@QName:
11384     xp.reptxt.attval.ger.entity.declared.standalone.-4.2.test
11385     @@@DEnt:
11386     @@@@test:value:
11387     <!DOCTYPE p [
11388     <!ENTITY % para SYSTEM "para">
11389     %para;
11390     <!ENTITY c "&entity;">
11391     ]>
11392     <p a="&c;"/>
11393     @@@test:domTree:
11394     document {
11395     document-type { }
11396     element {
11397     attribute {
11398     node-name: 'a';
11399     general-entity-reference {
11400     node-name: 'c';
11401     is-expanded: false;
11402     }
11403     }
11404     }
11405     }
11406     @@XMLTest:
11407     @@@QName: xp.reptxt.attval.ger.entity.declared.standalone.5.test
11408     @@@DEnt:
11409     @@@@test:value:
11410     <?xml version="1.0" standalone="yes"?>
11411     <!DOCTYPE p SYSTEM "dtd" [
11412     <!ENTITY c "&entity;">
11413     ]>
11414     <p a="&c;"/>
11415     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11416     @@XMLTest:
11417     @@@QName: xp.reptxt.attval.ger.entity.declared.standalone.-5.test
11418     @@@DEnt:
11419     @@@@test:value:
11420     <?xml version="1.0" standalone="no"?>
11421     <!DOCTYPE p SYSTEM "dtd" [
11422     <!ENTITY c "&entity;">
11423     ]>
11424     <p a="&c;"/>
11425     @@@test:domTree:
11426     document {
11427     document-type { }
11428     element {
11429     attribute {
11430     node-name: 'a';
11431     general-entity-reference {
11432     node-name: 'c';
11433     is-expanded: true;
11434     general-entity-reference {
11435     node-name: 'entity';
11436     is-expanded: false;
11437     }
11438     }
11439     }
11440     }
11441     }
11442     @@XMLTest:
11443     @@@QName: xp.reptxt.attval.ger.entity.declared.standalone.-6.test
11444     @@@DEnt:
11445     @@@@test:value:
11446     <!DOCTYPE p SYSTEM "dtd" [<!ENTITY c "&entity;">]>
11447     <p a="&c;"/>
11448     @@@test:domTree:
11449     document {
11450     document-type { }
11451     element {
11452     attribute {
11453     node-name: 'a';
11454     general-entity-reference {
11455     node-name: 'c';
11456     is-expanded: true;
11457     general-entity-reference {
11458     node-name: 'entity';
11459     is-expanded: false;
11460     }
11461     }
11462     }
11463     }
11464     }
11465    
11466     @@XMLTest:
11467     @@@QName: xp.attlist.dup.entity.declared.1.test
11468     @@@DEnt:
11469     @@@@test:value:
11470     <!DOCTYPE p [
11471     <!ATTLIST p a CDATA "no-entity">
11472     <!ATTLIST p a CDATA "&entity;">
11473     ]>
11474     <p/>
11475     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 21)..(3, 29); }
11476     @@XMLTest:
11477     @@@QName: xp.attlist.dup.entity.declared.2.test
11478     @@@DEnt:
11479     @@@@test:value:
11480     <!DOCTYPE p [
11481     <!ATTLIST p a CDATA "no-entity"
11482     a CDATA "&entity;">
11483     ]>
11484     <p/>
11485     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 21)..(3, 29); }
11486     @@XMLTest:
11487     @@@QName: xp.attlist.unused.entity.declared.1.test
11488     @@@DEnt:
11489     @@@@test:value:
11490     <!DOCTYPE p [
11491     <!ATTLIST q a CDATA "&entity;">
11492     ]>
11493     <p/>
11494     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 21)..(2, 29); }
11495     @@XMLTest:
11496     @@@QName: xp.attlist.unused.entity.declared.2.test
11497     @@@DEnt:
11498     @@@@test:value:
11499     <!DOCTYPE p [
11500     <!ATTLIST p a CDATA "&entity;">
11501     ]>
11502     <p a="bb"/>
11503     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 21)..(2, 29); }
11504    
11505     @@XMLTest:
11506     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.nopref.1.test
11507     @@@DEnt:
11508     @@@@test:value:
11509     <!DOCTYPE p [
11510     <!ENTITY c "&entity;">
11511     <!ATTLIST p a CDATA "&c;">
11512     ]>
11513     <p/>
11514     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11515     @@XMLTest:
11516     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.nopref.2.test
11517     @@@DEnt:
11518     @@@@test:value:
11519     <!DOCTYPE p [
11520     <!ENTITY other "aa">
11521     <!ENTITY % another "aa">
11522     <!ENTITY c "&entity;">
11523     <!ATTLIST p a CDATA "&c;">
11524     ]>
11525     <p/>
11526     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11527     @@XMLTest:
11528     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.nopref.3.test
11529     @@@DEnt:
11530     @@@@test:value:
11531     <?xml version="1.0" standalone="yes"?>
11532     <!DOCTYPE p [
11533     <!ENTITY c "&entity;">
11534     <!ATTLIST p a CDATA "&c;">
11535     ]>
11536     <p/>
11537     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11538     @@XMLTest:
11539     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.nopref.4.test
11540     @@@DEnt:
11541     @@@@test:value:
11542     <?xml version="1.0" standalone="no"?>
11543     <!DOCTYPE p [
11544     <!ENTITY c "&entity;">
11545     <!ATTLIST p a CDATA "&c;">
11546     ]>
11547     <p/>
11548     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11549     @@XMLTest:
11550     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.nopref.5.test
11551     @@@DEnt:
11552     @@@@test:value:
11553     <?xml version="1.0" standalone="yes"?>
11554     <!DOCTYPE p [
11555     <!ENTITY other "aa">
11556     <!ENTITY % another "aa">
11557     <!ENTITY c "&entity;">
11558     <!ATTLIST p a CDATA "&c;">
11559     ]>
11560     <p/>
11561     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11562     @@XMLTest:
11563     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.nopref.6.test
11564     @@@DEnt:
11565     @@@@test:value:
11566     <?xml version="1.0" standalone="no"?>
11567     <!DOCTYPE p [
11568     <!ENTITY other "aa">
11569     <!ENTITY % another "aa">
11570     <!ENTITY c "&entity;">
11571     <!ATTLIST p a CDATA "&c;">
11572     ]>
11573     <p/>
11574     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11575     @@XMLTest:
11576     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.nopref.-1.test
11577     @@@DEnt:
11578     @@@@test:value:
11579     <!DOCTYPE p [
11580     <!ENTITY entity "value">
11581     <!ENTITY c "&entity;">
11582     <!ATTLIST p a CDATA "&c;">
11583     ]>
11584     <p/>
11585     @@@test:domTree:
11586     document {
11587     document-type {
11588     general-entity {
11589     node-name: 'entity';
11590     text-content: 'value';
11591     }
11592     general-entity {
11593     node-name: 'c';
11594     general-entity-reference {
11595     node-name: 'entity';
11596     is-expanded: true;
11597     text-content: 'value';
11598     }
11599     }
11600     element-type-definition {
11601     node-name: 'p';
11602     attribute-definition {
11603     node-name: 'a';
11604     general-entity-reference {
11605     node-name: 'c';
11606     is-expanded: true;
11607     general-entity-reference {
11608     node-name: 'entity';
11609     is-expanded: true;
11610     text-content: 'value';
11611     }
11612     }
11613     }
11614     }
11615     }
11616     element {
11617     attribute {
11618     node-name: 'a';
11619     specified: false;
11620     general-entity-reference {
11621     node-name: 'c';
11622     general-entity-reference {
11623     node-name: 'entity';
11624     text-content: 'value';
11625     }
11626     }
11627     }
11628     }
11629     }
11630     @@XMLTest:
11631     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.nopref.-2.test
11632     @@@DEnt:
11633     @@@@test:value:
11634     <!DOCTYPE p [
11635     <!ENTITY entity "value">
11636     <!ENTITY another SYSTEM "another">
11637     <!ENTITY c "&entity;">
11638     <!ATTLIST p a CDATA "&c;">
11639     ]>
11640     <p/>
11641     @@@test:domTree:
11642     document {
11643     document-type {
11644     general-entity {
11645     node-name: 'entity';
11646     text-content: 'value';
11647     }
11648     general-entity {
11649     node-name: 'c';
11650     general-entity-reference {
11651     node-name: 'entity';
11652     text-content: 'value';
11653     }
11654     }
11655     general-entity {
11656     node-name: 'another';
11657     public-id: null;
11658     system-id: 'another';
11659     has-replacement-tree: false;
11660     }
11661     element-type-definition {
11662     node-name: 'p';
11663     attribute-definition {
11664     node-name: 'a';
11665     general-entity-reference {
11666     node-name: 'c';
11667     is-expanded: true;
11668     general-entity-reference {
11669     node-name: 'entity';
11670     is-expanded: true;
11671     text-content: 'value';
11672     }
11673     }
11674     }
11675     }
11676     }
11677     element {
11678     attribute {
11679     node-name: 'a';
11680     specified: false;
11681     general-entity-reference {
11682     node-name: 'c';
11683     general-entity-reference {
11684     node-name: 'entity';
11685     text-content: 'value';
11686     }
11687     }
11688     }
11689     }
11690     }
11691     @@XMLTest:
11692     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.standalone.2.test
11693     @@@DEnt:
11694     @@@@test:value:
11695     <?xml version="1.0" standalone="yes"?>
11696     <!DOCTYPE p [
11697     <!ENTITY c "&entity;">
11698     <!ATTLIST p a CDATA "&c;">
11699     ]>
11700     <p/>
11701     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11702     @@XMLTest:
11703     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.standalone.3.test
11704     @@@DEnt:
11705     @@@@test:value:
11706     <?xml version="1.0" standalone="yes"?>
11707     <!DOCTYPE p [
11708     <!ENTITY % para "<!-- -->">
11709     %para;
11710     <!ENTITY c "&entity;">
11711     <!ATTLIST p a CDATA "&c;">
11712     ]>
11713     <p/>
11714     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11715     @@XMLTest:
11716     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.standalone.-1.test
11717     @@@DEnt:
11718     @@@@test:value:
11719     <?xml version="1.0" standalone="no"?>
11720     <!DOCTYPE p [
11721     <!ENTITY c "&entity;">
11722     <!ATTLIST p a CDATA "&c;">
11723     <!ENTITY % para "<!-- -->">
11724     %para;
11725     ]>
11726     <p/>
11727     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11728     @@XMLTest:
11729     @@@QName:
11730     xp.reptxt.attlist.attval.ger.entity.declared.standalone.-1.2.test
11731     @@@DEnt:
11732     @@@@test:value:
11733     <?xml version="1.0" standalone="no"?>
11734     <!DOCTYPE p [
11735     <!ENTITY % para "<!-- -->">
11736     %para;
11737     <!ENTITY c "&entity;">
11738     <!ATTLIST p a CDATA "&c;">
11739     ]>
11740     <p g="h"/>
11741     @@@test:domTree:
11742     document {
11743     document-type { }
11744     element {
11745     attribute {
11746     node-name: 'g';
11747     text-content: 'h';
11748     }
11749     }
11750     }
11751     @@XMLTest:
11752     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.standalone.-2.test
11753     @@@DEnt:
11754     @@@@test:value:
11755     <!DOCTYPE p [
11756     <!ENTITY c "&entity;">
11757     <!ATTLIST p a CDATA "&c;">
11758     <!ENTITY % para "<!-- -->">
11759     %para;
11760     ]>
11761     <p/>
11762     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11763     @@XMLTest:
11764     @@@QName:
11765     xp.reptxt.attlist.attval.ger.entity.declared.standalone.-2.2.test
11766     @@@DEnt:
11767     @@@@test:value:
11768     <!DOCTYPE p [
11769     <!ENTITY % para "<!-- -->">
11770     %para;
11771     <!ENTITY c "&entity;">
11772     <!ATTLIST p a CDATA "&c;">
11773     ]>
11774     <p g="h"/>
11775     @@@test:domTree:
11776     document {
11777     document-type { }
11778     element {
11779     attribute {
11780     node-name: 'g';
11781     text-content: 'h';
11782     }
11783     }
11784     }
11785     @@XMLTest:
11786     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.standalone.4.test
11787     @@@DEnt:
11788     @@@@test:value:
11789     <?xml version="1.0" standalone="yes"?>
11790     <!DOCTYPE p [
11791     <!ENTITY % para SYSTEM "para">
11792     %para;
11793     <!ENTITY c "&entity;">
11794     <!ATTLIST p a CDATA "&c;">
11795     ]>
11796     <p/>
11797     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11798     @@XMLTest:
11799     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.standalone.-3.test
11800     @@@DEnt:
11801     @@@@test:value:
11802     <?xml version="1.0" standalone="no"?>
11803     <!DOCTYPE p [
11804     <!ENTITY c "&entity;">
11805     <!ATTLIST p a CDATA "&c;">
11806     <!ENTITY % para SYSTEM "para">
11807     %para;
11808     ]>
11809     <p/>
11810     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11811     @@XMLTest:
11812     @@@QName:
11813     xp.reptxt.attlist.attval.ger.entity.declared.standalone.-3.2.test
11814     @@@DEnt:
11815     @@@@test:value:
11816     <?xml version="1.0" standalone="no"?>
11817     <!DOCTYPE p [
11818     <!ENTITY % para SYSTEM "para">
11819     %para;
11820     <!ENTITY c "&entity;">
11821     <!ATTLIST p a CDATA "&c;">
11822     ]>
11823     <p g="h"/>
11824     @@@test:domTree:
11825     document {
11826     document-type { }
11827     element {
11828     attribute {
11829     node-name: 'g';
11830     text-content: 'h';
11831     }
11832     }
11833     }
11834     @@XMLTest:
11835     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.standalone.-4.test
11836     @@@DEnt:
11837     @@@@test:value:
11838     <!DOCTYPE p [
11839     <!ENTITY c "&entity;">
11840     <!ATTLIST p a CDATA "&c;">
11841     <!ENTITY % para SYSTEM "para">
11842     %para;
11843     ]>
11844     <p/>
11845     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11846     @@XMLTest:
11847     @@@QName:
11848     xp.reptxt.attlist.attval.ger.entity.declared.standalone.-4.2.test
11849     @@@DEnt:
11850     @@@@test:value:
11851     <!DOCTYPE p [
11852     <!ENTITY % para SYSTEM "para">
11853     %para;
11854     <!ENTITY c "&entity;">
11855     <!ATTLIST p a CDATA "&c;">
11856     ]>
11857     <p g="h"/>
11858     @@@test:domTree:
11859     document {
11860     document-type { }
11861     element {
11862     attribute {
11863     node-name: 'g';
11864     text-content: 'h';
11865     }
11866     }
11867     }
11868     @@XMLTest:
11869     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.standalone.5.test
11870     @@@DEnt:
11871     @@@@test:value:
11872     <?xml version="1.0" standalone="yes"?>
11873     <!DOCTYPE p SYSTEM "dtd" [
11874     <!ENTITY c "&entity;">
11875     <!ATTLIST p a CDATA "&c;">
11876     ]>
11877     <p/>
11878     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11879     @@XMLTest:
11880     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.standalone.-5.test
11881     @@@DEnt:
11882     @@@@test:value:
11883     <?xml version="1.0" standalone="no"?>
11884     <!DOCTYPE p SYSTEM "dtd" [
11885     <!ENTITY c "&entity;">
11886     <!ATTLIST p a CDATA "&c;">
11887     ]>
11888     <p/>
11889     @@@test:domTree:
11890     document {
11891     document-type { }
11892     element {
11893     attribute {
11894     node-name: 'a';
11895     specified: false;
11896     general-entity-reference {
11897     node-name: 'c';
11898     is-expanded: true;
11899     general-entity-reference {
11900     node-name: 'entity';
11901     is-expanded: false;
11902     }
11903     }
11904     }
11905     }
11906     }
11907     @@XMLTest:
11908     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.standalone.-6.test
11909     @@@DEnt:
11910     @@@@test:value:
11911     <!DOCTYPE p SYSTEM "dtd" [<!ENTITY c "&entity;">
11912     <!ATTLIST p a CDATA "&c;">
11913     ]>
11914     <p/>
11915     @@@test:domTree:
11916     document {
11917     document-type { }
11918     element {
11919     attribute {
11920     node-name: 'a';
11921     specified: false;
11922     general-entity-reference {
11923     node-name: 'c';
11924     is-expanded: true;
11925     general-entity-reference {
11926     node-name: 'entity';
11927     is-expanded: false;
11928     }
11929     }
11930     }
11931     }
11932     }
11933    
11934     @@XMLTest:
11935     @@@QName: xp.attlist.attval.ger.entity.declared.nopref.1.test
11936     @@@DEnt:
11937     @@@@test:value:
11938     <!DOCTYPE p [
11939     <!ATTLIST p a CDATA "&entity;">
11940     ]>
11941     <p/>
11942     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 22)..(2, 29); }
11943     @@XMLTest:
11944     @@@QName: xp.attlist.attval.ger.entity.declared.nopref.2.test
11945     @@@DEnt:
11946     @@@@test:value:
11947     <!DOCTYPE p [
11948     <!ENTITY other "aa">
11949     <!ENTITY % another "aa">
11950     <!ATTLIST p a CDATA "&entity;">
11951     ]>
11952     <p/>
11953     @@@c:erred: <[[xp|wf-entity-declared]]> { (4, 22)..(4, 29); }
11954     @@XMLTest:
11955     @@@QName: xp.attlist.attval.ger.entity.declared.nopref.3.test
11956     @@@DEnt:
11957     @@@@test:value:
11958     <?xml version="1.0" standalone="yes"?>
11959     <!DOCTYPE p [
11960     <!ATTLIST p a CDATA "&entity;">
11961     ]>
11962     <p/>
11963     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 22)..(3, 29); }
11964     @@XMLTest:
11965     @@@QName: xp.attlist.attval.ger.entity.declared.nopref.4.test
11966     @@@DEnt:
11967     @@@@test:value:
11968     <?xml version="1.0" standalone="no"?>
11969     <!DOCTYPE p [
11970     <!ATTLIST p a CDATA "&entity;">
11971     ]>
11972     <p/>
11973     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 22)..(3, 29); }
11974     @@XMLTest:
11975     @@@QName: xp.attlist.attval.ger.entity.declared.nopref.5.test
11976     @@@DEnt:
11977     @@@@test:value:
11978     <?xml version="1.0" standalone="yes"?>
11979     <!DOCTYPE p [
11980     <!ENTITY other "aa">
11981     <!ENTITY % another "aa">
11982     <!ATTLIST p a CDATA "&entity;">
11983     ]>
11984     <p/>
11985     @@@c:erred: <[[xp|wf-entity-declared]]> { (5, 22)..(5, 29); }
11986     @@XMLTest:
11987     @@@QName: xp.attlist.attval.ger.entity.declared.nopref.6.test
11988     @@@DEnt:
11989     @@@@test:value:
11990     <?xml version="1.0" standalone="no"?>
11991     <!DOCTYPE p [
11992     <!ENTITY other "aa">
11993     <!ENTITY % another "aa">
11994     <!ATTLIST p a CDATA "&entity;">
11995     ]>
11996     <p/>
11997     @@@c:erred: <[[xp|wf-entity-declared]]> { (5, 22)..(5, 29); }
11998     @@XMLTest:
11999     @@@QName: xp.attlist.attval.ger.entity.declared.nopref.-1.test
12000     @@@DEnt:
12001     @@@@test:value:
12002     <!DOCTYPE p [
12003     <!ENTITY entity "value">
12004     <!ATTLIST p a CDATA "&entity;">
12005     ]>
12006     <p/>
12007     @@@test:domTree:
12008     document {
12009     document-type {
12010     general-entity {
12011     node-name: 'entity';
12012     text-content: 'value';
12013     }
12014     element-type-definition {
12015     node-name: 'p';
12016     attribute-definition {
12017     node-name: 'a';
12018     general-entity-reference {
12019     node-name: 'entity';
12020     is-expanded: true;
12021     text-content: 'value';
12022     }
12023     }
12024     }
12025     }
12026     element {
12027     attribute {
12028     node-name: 'a';
12029     specified: false;
12030     general-entity-reference {
12031     node-name: 'entity';
12032     is-expanded: true;
12033     text-content: 'value';
12034     }
12035     }
12036     }
12037     }
12038     @@XMLTest:
12039     @@@QName: xp.attlist.attval.ger.entity.declared.nopref.-1.2.test
12040     @@@DEnt:
12041     @@@@test:value:
12042     <!DOCTYPE p [
12043     <!ATTLIST p a CDATA "&entity;">
12044     <!ENTITY entity "value">
12045     ]>
12046     <p/>
12047     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 22)..(2, 29); }
12048     @@XMLTest:
12049     @@@QName: xp.attlist.attval.ger.entity.declared.nopref.-2.test
12050     @@@DEnt:
12051     @@@@test:value:
12052     <!DOCTYPE p [
12053     <!ENTITY entity "value">
12054     <!ENTITY another SYSTEM "another">
12055     <!ATTLIST p a CDATA "&entity;">
12056     ]>
12057     <p/>
12058     @@@test:domTree:
12059     document {
12060     document-type {
12061     element-type-definition {
12062     node-name: 'p';
12063     attribute-definition {
12064     node-name: 'a';
12065     general-entity-reference {
12066     node-name: 'entity';
12067     is-expanded: true;
12068     text-content: 'value';
12069     }
12070     }
12071     }
12072     general-entity {
12073     node-name: 'entity';
12074     text-content: 'value';
12075     has-replacement-tree: true;
12076     }
12077     general-entity {
12078     node-name: 'another';
12079     public-id: null;
12080     system-id: 'another';
12081     has-replacement-tree: false;
12082     }
12083     }
12084     element {
12085     attribute {
12086     node-name: 'a';
12087     specified: false;
12088     general-entity-reference {
12089     node-name: 'entity';
12090     is-expanded: true;
12091     text-content: 'value';
12092     }
12093     }
12094     }
12095     }
12096     @@XMLTest:
12097     @@@QName: xp.attlist.attval.ger.entity.declared.nopref.-2.2.test
12098     @@@DEnt:
12099     @@@@test:value:
12100     <!DOCTYPE p [
12101     <!ATTLIST p a CDATA "&entity;">
12102     <!ENTITY entity "value">
12103     <!ENTITY another SYSTEM "another">
12104     ]>
12105     <p/>
12106     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 22)..(2, 29); }
12107     @@XMLTest:
12108     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.2.test
12109     @@@DEnt:
12110     @@@@test:value:
12111     <?xml version="1.0" standalone="yes"?>
12112     <!DOCTYPE p [
12113     <!ATTLIST p a CDATA "&entity;">
12114     ]>
12115     <p/>
12116     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 22)..(3, 29); }
12117     @@XMLTest:
12118     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.3.test
12119     @@@DEnt:
12120     @@@@test:value:
12121     <?xml version="1.0" standalone="yes"?>
12122     <!DOCTYPE p [
12123     <!ATTLIST p a CDATA "&entity;">
12124     <!ENTITY % para "<!-- -->">
12125     %para;
12126     ]>
12127     <p/>
12128     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 22)..(3, 29); }
12129     @@XMLTest:
12130     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.3.2.test
12131     @@@DEnt:
12132     @@@@test:value:
12133     <?xml version="1.0" standalone="yes"?>
12134     <!DOCTYPE p [
12135     <!ENTITY % para "<!-- -->">
12136     %para;
12137     <!ATTLIST p a CDATA "&entity;">
12138     ]>
12139     <p/>
12140     @@@c:erred: <[[xp|wf-entity-declared]]> { (5, 22)..(5, 29); }
12141     @@@enImplNote:
12142     The <XML::ATTLIST> declaration is processed since
12143     it is a <XA::standalone> document.
12144     @@XMLTest:
12145     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.-1.test
12146     @@@DEnt:
12147     @@@@test:value:
12148     <?xml version="1.0" standalone="no"?>
12149     <!DOCTYPE p [
12150     <!ATTLIST p a CDATA "&entity;">
12151     <!ENTITY % para "<!-- -->">
12152     %para;
12153     ]>
12154     <p/>
12155     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 22)..(3, 29); }
12156     @@XMLTest:
12157     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.-1.2.test
12158     @@@DEnt:
12159     @@@@test:value:
12160     <?xml version="1.0" standalone="no"?>
12161     <!DOCTYPE p [
12162 wakaba 1.25 <!ATTLIST p b CDATA #IMPLIED>
12163 wakaba 1.21 <!ENTITY % para "<!-- -->">
12164     %para;
12165     <!ATTLIST p a CDATA "&entity;">
12166     ]>
12167     <p c="d"/>
12168 wakaba 1.25 @@@c:erred:
12169     <[[xp|warning-attribute-definition-not-processed]]> { (6, 13)..(6, 30); }
12170 wakaba 1.21 @@@test:domTree:
12171     document {
12172     document-type {
12173     element-type-definition {
12174 wakaba 1.25 node-name: 'p';
12175 wakaba 1.21 attribute-definition {
12176     node-name: 'b';
12177     }
12178     }
12179     }
12180     element {
12181     attribute {
12182     node-name: 'c';
12183     text-content: 'd';
12184     }
12185     }
12186     }
12187     @@@enImplNote:
12188     The second <XML::ATTLIST> declaration is read but not processed
12189     and its <XML::&entity;> general entity reference violates
12190     entity declared validty constraint rather than well-formedness
12191     constraint.
12192     @@XMLTest:
12193     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.-2.test
12194     @@@DEnt:
12195     @@@@test:value:
12196     <!DOCTYPE p [
12197     <!ATTLIST p a CDATA "&entity;">
12198     <!ENTITY % para "<!-- -->">
12199     %para;
12200     ]>
12201     <p/>
12202     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 22)..(2, 29); }
12203     @@XMLTest:
12204     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.-2.2.test
12205     @@@DEnt:
12206     @@@@test:value:
12207     <!DOCTYPE p [
12208 wakaba 1.25 <!ATTLIST p b CDATA #IMPLIED>
12209 wakaba 1.21 <!ENTITY % para "<!-- -->">
12210     %para;
12211     <!ATTLIST p a CDATA "&entity;">
12212     ]>
12213     <p c="d"/>
12214 wakaba 1.25 @@@c:erred:
12215     <[[xp|warning-attribute-definition-not-processed]]> { (5, 13)..(5, 30); }
12216 wakaba 1.21 @@@test:domTree:
12217     document {
12218     document-type {
12219     element-type-definition {
12220 wakaba 1.25 node-name: 'p';
12221 wakaba 1.21 attribute-definition {
12222     node-name: 'b';
12223     }
12224     }
12225     }
12226     element {
12227     attribute {
12228     node-name: 'c';
12229     text-content: 'd';
12230     }
12231     }
12232     }
12233     @@XMLTest:
12234     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.4.test
12235     @@@DEnt:
12236     @@@@test:value:
12237     <?xml version="1.0" standalone="yes"?>
12238     <!DOCTYPE p [
12239     <!ATTLIST p a CDATA "&entity;">
12240     <!ENTITY % para SYSTEM "p">
12241     %para;
12242     ]>
12243     <p/>
12244     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 22)..(3, 29); }
12245     @@XMLTest:
12246     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.4.2.test
12247     @@@DEnt:
12248     @@@@test:value:
12249     <?xml version="1.0" standalone="yes"?>
12250     <!DOCTYPE p [
12251     <!ENTITY % para SYSTEM "p">
12252     %para;
12253     <!ATTLIST p a CDATA "&entity;">
12254     ]>
12255     <p/>
12256     @@@c:erred: <[[xp|wf-entity-declared]]> { (5, 22)..(5, 29); }
12257     @@@enImplNote:
12258     The <XML::ATTLIST> declaration is processed since
12259     it is a <XA::standalone> document.
12260     @@XMLTest:
12261     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.-3.test
12262     @@@DEnt:
12263     @@@@test:value:
12264     <?xml version="1.0" standalone="no"?>
12265     <!DOCTYPE p [
12266     <!ATTLIST p a CDATA "&entity;">
12267     <!ENTITY % para SYSTEM "p">
12268     %para;
12269     ]>
12270     <p/>
12271     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 22)..(3, 29); }
12272     @@@enImplNote:
12273     Is this well-formed? It has a parameter entity reference,
12274     therefore, it does not violates Entity Declared WFC, isn't it?
12275    
12276     Note that Firefox 1.5 and Opera 9 TP1 reports that this document has a
12277     fatal error (also note that they does not support unexpanded).
12278    
12279     See also:
12280     <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>
12281     @@XMLTest:
12282     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.-3.2.test
12283     @@@DEnt:
12284     @@@@test:value:
12285     <?xml version="1.0" standalone="no"?>
12286     <!DOCTYPE p [
12287 wakaba 1.25 <!ATTLIST p b CDATA #IMPLIED>
12288 wakaba 1.21 <!ENTITY % para SYSTEM "p">
12289     %para;
12290     <!ATTLIST p a CDATA "&entity;">
12291     ]>
12292     <p c="d"/>
12293 wakaba 1.25 @@@c:erred:
12294     <[[xp|warning-attribute-definition-not-processed]]> { (6, 13)..(6, 30); }
12295 wakaba 1.21 @@@test:domTree:
12296     document {
12297     document-type {
12298     element-type-definition {
12299 wakaba 1.25 node-name: 'p';
12300 wakaba 1.21 attribute-definition {
12301     node-name: 'b';
12302     }
12303     }
12304     }
12305     element {
12306     attribute {
12307     node-name: 'c';
12308     text-content: 'd';
12309     }
12310     }
12311     }
12312     @@@enImplNote:
12313     The second <XML::ATTLIST> declaration is read but not processed
12314     and its <XML::&entity;> general entity reference violates
12315     entity declared validty constraint rather than well-formedness
12316     constraint.
12317     @@XMLTest:
12318     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.-4.test
12319     @@@DEnt:
12320     @@@@test:value:
12321     <!DOCTYPE p [
12322     <!ATTLIST p a CDATA "&entity;">
12323     <!ENTITY % para SYSTEM "p">
12324     %para;
12325     ]>
12326     <p/>
12327     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 22)..(2, 29); }
12328     @@XMLTest:
12329     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.-4.2.test
12330     @@@DEnt:
12331     @@@@test:value:
12332     <!DOCTYPE p [
12333 wakaba 1.25 <!ATTLIST p b CDATA #IMPLIED>
12334 wakaba 1.21 <!ENTITY % para SYSTEM "p">
12335     %para;
12336     <!ATTLIST p a CDATA "&entity;">
12337     ]>
12338     <p c="d"/>
12339 wakaba 1.25 @@@c:erred:
12340     <[[xp|warning-attribute-definition-not-processed]]> { (5, 13)..(5, 30); }
12341 wakaba 1.21 @@@test:domTree:
12342     document {
12343     document-type {
12344     element-type-definition {
12345 wakaba 1.25 node-name: 'p';
12346 wakaba 1.21 attribute-definition {
12347     node-name: 'b';
12348     }
12349     }
12350     }
12351     element {
12352     attribute {
12353     node-name: 'c';
12354     text-content: 'd';
12355     }
12356     }
12357     }
12358     @@XMLTest:
12359     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.5.test
12360     @@@DEnt:
12361     @@@@test:value:
12362     <?xml version="1.0" standalone="yes"?>
12363     <!DOCTYPE p SYSTEM "dtd" [
12364     <!ATTLIST p a CDATA "&entity;">
12365     ]>
12366     <p/>
12367     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 22)..(3, 29); }
12368     @@@enImplNote:
12369     This document has an error - result is implementation dependent.
12370     @@XMLTest:
12371     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.-5.test
12372     @@@DEnt:
12373     @@@@test:value:
12374     <?xml version="1.0" standalone="no"?>
12375     <!DOCTYPE p SYSTEM "dtd" [
12376     <!ATTLIST p a CDATA "&entity;">
12377     ]>
12378     <p/>
12379     @@@test:domTree:
12380     document {
12381     document-type {
12382     element-type-definition {
12383     node-name: 'p';
12384     attribute-definition {
12385     node-name: 'a';
12386     general-entity-reference {
12387     node-name: 'entity';
12388     is-expanded: false;
12389     }
12390     }
12391     }
12392     }
12393     element {
12394     attribute {
12395     node-name: 'a';
12396     specified: false;
12397     general-entity-reference {
12398     node-name: 'entity';
12399     is-expanded: false;
12400     }
12401     }
12402     }
12403     }
12404     @@@enImplNote:
12405     This document has an error - result is implementation dependent.
12406     @@XMLTest:
12407     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.-6.test
12408     @@@DEnt:
12409     @@@@test:value:
12410     <!DOCTYPE p SYSTEM "dtd" [
12411     <!ATTLIST p a CDATA "&entity;">
12412     ]>
12413     <p/>
12414     @@@test:domTree:
12415     document {
12416     document-type {
12417     element-type-definition {
12418     node-name: 'p';
12419     attribute-definition {
12420     node-name: 'a';
12421     general-entity-reference {
12422     node-name: 'entity';
12423     is-expanded: false;
12424     }
12425     }
12426     }
12427     }
12428     element {
12429     attribute {
12430     node-name: 'a';
12431     specified: false;
12432     general-entity-reference {
12433     node-name: 'entity';
12434     is-expanded: false;
12435     }
12436     }
12437     }
12438     }
12439     @@@enImplNote:
12440     This document has an error - result is implementation dependent.
12441    
12442 wakaba 1.19 @@enImplNote:
12443     {TODO:: Entity declared WFC for
12444 wakaba 1.20
12445     - General entity references in entity value??
12446 wakaba 1.19
12447     }
12448    
12449 wakaba 1.23 @@XMLTest:
12450     @@@QName: xp.element.content.parsed.entity.reference.test
12451     @@@DEnt:
12452     @@@@test:value:
12453     <!DOCTYPE p [
12454     <!NOTATION n SYSTEM "notation">
12455     <!ENTITY ext SYSTEM "system" NDATA n>
12456     ]>
12457     <p>&ext;</p>
12458     @@@c:erred: <[[xp|wf-parsed-entity]]> { (5, 4)..(5, 8); }
12459     @@XMLTest:
12460     @@@QName: xp.attval.parsed.entity.reference.test
12461     @@@DEnt:
12462     @@@@test:value:
12463     <!DOCTYPE p [
12464     <!NOTATION n SYSTEM "notation">
12465     <!ENTITY ext SYSTEM "system" NDATA n>
12466     ]>
12467     <p a="&ext;"/>
12468     # @@@c:erred: <[[xp|wf-parsed-entity]]> { (5, 7)..(5, 11); }
12469     @@@c:erred: <[[xp|wf-no-external-entity-references]]> { (5, 7)..(5, 11); }
12470     @@XMLTest:
12471     @@@QName: xp.element.content.reptxt.parsed.entity.reference.test
12472     @@@DEnt:
12473     @@@@test:value:
12474     <!DOCTYPE p [
12475     <!NOTATION n SYSTEM "notation">
12476     <!ENTITY ext SYSTEM "system" NDATA n>
12477     <!ENTITY c "&#x26;ext;">
12478     ]>
12479     <p>&c;</p>
12480     @@@c:erred: <[[xp|wf-parsed-entity]]> { (1, 1)..(1, 5); }
12481     @@XMLTest:
12482     @@@QName: xp.attval.reptxt.parsed.entity.reference.test
12483     @@@DEnt:
12484     @@@@test:value:
12485     <!DOCTYPE p [
12486     <!NOTATION n SYSTEM "notation">
12487     <!ENTITY ext SYSTEM "system" NDATA n>
12488     <!ENTITY c "&#x26;ext;">
12489     ]>
12490     <p a="&c;"/>
12491     @@@c:erred: <[[xp|wf-no-external-entity-references]]> { (1, 1)..(1, 5); }
12492     @@@c:erred:
12493     @@@@@: <[[xp|wf-parsed-entity]]> { }
12494     @@@@enImplNote: During entity node construction.
12495     @@XMLTest:
12496     @@@QName: xp.element.content.entval.parsed.entity.reference.test
12497     @@@DEnt:
12498     @@@@test:value:
12499     <!DOCTYPE p [
12500     <!NOTATION n SYSTEM "notation">
12501     <!ENTITY ext SYSTEM "system" NDATA n>
12502     <!ENTITY c "&ext;">
12503     ]>
12504     <p>&c;</p>
12505     @@@c:erred: <[[xp|wf-parsed-entity]]> { }
12506     @@XMLTest:
12507     @@@QName: xp.attval.entval.parsed.entity.reference.test
12508     @@@DEnt:
12509     @@@@test:value:
12510     <!DOCTYPE p [
12511     <!NOTATION n SYSTEM "notation">
12512     <!ENTITY ext SYSTEM "system" NDATA n>
12513     <!ENTITY c "&ext;">
12514     ]>
12515     <p a="&c;"/>
12516     @@@c:erred: <[[xp|wf-no-external-entity-references]]> { }
12517     @@@c:erred: <[[xp|wf-parsed-entity]]> { }
12518    
12519     @@XMLTest:
12520     @@@QName: xp.element.content.no.recursion.direct.test
12521     @@@DEnt:
12522     @@@@test:value:
12523     <!DOCTYPE p [
12524     <!ENTITY c "&c;">
12525     ]>
12526     <p>&c;</p>
12527     @@@c:erred: <[[xp|wf-no-recursion]]> { (1, 1)..(1, 3); }
12528     @@XMLTest:
12529     @@@QName: xp.element.content.no.recursion.indirect.test
12530     @@@DEnt:
12531     @@@@test:value:
12532     <!DOCTYPE p [
12533     <!ENTITY d "&c;">
12534     <!ENTITY c "&d;">
12535     ]>
12536     <p>&c;</p>
12537     @@@c:erred: <[[xp|wf-no-recursion]]> { /* |d| */ (1, 1)..(1, 3); }
12538     @@XMLTest:
12539     @@@QName: xp.attval.no.recursion.direct.test
12540     @@@DEnt:
12541     @@@@test:value:
12542     <!DOCTYPE p [
12543     <!ENTITY c "&c;">
12544     ]>
12545     <p a="&c;"/>
12546     @@@c:erred: <[[xp|wf-no-recursion]]> { (1, 1)..(1, 3); }
12547     @@XMLTest:
12548     @@@QName: xp.attval.no.recursion.indirect.test
12549     @@@DEnt:
12550     @@@@test:value:
12551     <!DOCTYPE p [
12552     <!ENTITY d "&c;">
12553     <!ENTITY c "&d;">
12554     ]>
12555     <p a="&c;"/>
12556     @@@c:erred: <[[xp|wf-no-recursion]]> { /* |d| */ (1, 1)..(1, 3); }
12557     @@XMLTest:
12558     @@@QName: xp.reptxt.element.content.no.recursion.direct.test
12559     @@@DEnt:
12560     @@@@test:value:
12561     <!DOCTYPE p [
12562     <!ENTITY c "&c;">
12563     <!ENTITY e "&#x26;c;">
12564     ]>
12565     <p>&e;</p>
12566     @@@c:erred: <[[xp|wf-no-recursion]]> { /* |e| */ (1, 1)..(1, 3); }
12567     @@XMLTest:
12568     @@@QName: xp.reptxt.element.content.no.recursion.indirect.test
12569     @@@DEnt:
12570     @@@@test:value:
12571     <!DOCTYPE p [
12572     <!ENTITY d "&c;">
12573     <!ENTITY c "&d;">
12574     <!ENTITY e "&#x26;c;">
12575     ]>
12576     <p>&e;</p>
12577     @@@c:erred: <[[xp|wf-no-recursion]]> { /* |d| */ (1, 1)..(1, 3); }
12578     @@XMLTest:
12579     @@@QName: xp.reptxt.attval.no.recursion.direct.test
12580     @@@DEnt:
12581     @@@@test:value:
12582     <!DOCTYPE p [
12583     <!ENTITY c "&c;">
12584     <!ENTITY e "&#x26;c;">
12585     ]>
12586     <p a="&e;"/>
12587     @@@c:erred: <[[xp|wf-no-recursion]]> { /* |e| */ (1, 1)..(1, 3); }
12588     @@XMLTest:
12589     @@@QName: xp.reptxt.attval.no.recursion.indirect.test
12590     @@@DEnt:
12591     @@@@test:value:
12592     <!DOCTYPE p [
12593     <!ENTITY d "&c;">
12594     <!ENTITY c "&d;">
12595     <!ENTITY e "&#x26;c;">
12596     ]>
12597     <p a="&e;"/>
12598     @@@c:erred: <[[xp|wf-no-recursion]]> { /* |d| */ (1, 1)..(1, 3); }
12599    
12600     @@XMLTest:
12601     @@@QName: xp.ENTITY.system.ndata.name.test
12602     @@@DEnt:
12603     @@@@test:value:
12604     <!DOCTYPE a [
12605     <!NOTATION n SYSTEM "n">
12606     <!ENTITY % e SYSTEM "sys" NDATA n>
12607     ]><a/>
12608     @@@c:erred: <[[xp|wf-syntax-error]]> { (3, 26)..(3, 30); }
12609     @@XMLTest:
12610     @@@QName: xp.ENTITY.public.ndata.name.test
12611     @@@DEnt:
12612     @@@@test:value:
12613     <!DOCTYPE a [
12614     <!NOTATION n SYSTEM "n">
12615     <!ENTITY % e PUBLIC "pub" "sys" NDATA n>
12616     ]><a/>
12617     @@@c:erred: <[[xp|wf-syntax-error]]> { (3, 33)..(3, 37); }
12618     @@XMLTest:
12619     @@@QName: xp.ENTITY.public.ndata.name.-1.test
12620     @@@DEnt:
12621     @@@@test:value:
12622     <!DOCTYPE a [
12623     <!NOTATION n SYSTEM "n">
12624     <!ENTITY % e PUBLIC "pub" "sys" >
12625     ]><a/>
12626     @@@test:domTree:
12627     document { }
12628    
12629     @@XMLTest:
12630     @@@QName: xp.ENTITY.pubid.1.test
12631     @@@DEnt:
12632     @@@@test:value:
12633     <!DOCTYPE a [
12634     <!ENTITY e PUBLIC "p" "s">
12635     ]><a/>
12636     @@@test:domTree:
12637     document {
12638     document-type {
12639     general-entity {
12640     node-name: 'e';
12641     public-id: 'p';
12642     system-id: 's';
12643     }
12644     }
12645     element { }
12646     }
12647     @@XMLTest:
12648     @@@QName: xp.ENTITY.pubid.2.test
12649     @@@DEnt:
12650     @@@@test:value:
12651     <!DOCTYPE a [
12652     <!ENTITY e PUBLIC " p " "s">
12653     ]><a/>
12654     @@@test:domTree:
12655     document {
12656     document-type {
12657     general-entity {
12658     node-name: 'e';
12659     public-id: 'p';
12660     system-id: 's';
12661     }
12662     }
12663     element { }
12664     }
12665     @@XMLTest:
12666     @@@QName: xp.ENTITY.pubid.3.test
12667     @@@DEnt:
12668     @@@@test:value:
12669     <!DOCTYPE a [
12670     <!ENTITY e PUBLIC " p $u000Aq$u000A " "s">
12671     ]><a/>
12672     @@@test:domTree:
12673     document {
12674     document-type {
12675     general-entity {
12676     node-name: 'e';
12677     public-id: 'p q';
12678     system-id: 's';
12679     }
12680     }
12681     element { }
12682     }
12683     @@XMLTest:
12684     @@@QName: xp.ENTITY.pubid.4.test
12685     @@@DEnt:
12686     @@@@test:value:
12687     <!DOCTYPE a [
12688     <!ENTITY e PUBLIC " p $u000D$u000Aq" "s">
12689     ]><a/>
12690     @@@test:domTree:
12691     document {
12692     document-type {
12693     general-entity {
12694     node-name: 'e';
12695     public-id: 'p q';
12696     system-id: 's';
12697     }
12698     }
12699     element { }
12700     }
12701     @@XMLTest:
12702     @@@QName: xp.ENTITY.pubid.5.test
12703     @@@DEnt:
12704     @@@@test:value:
12705     <?xml version="1.1"?>
12706     <!DOCTYPE a [
12707 wakaba 1.27 <!ENTITY e PUBLIC " p $u000D$u0085q" "s">
12708 wakaba 1.23 ]><a/>
12709     @@@test:domTree:
12710     document {
12711     document-type {
12712     general-entity {
12713     node-name: 'e';
12714     public-id: 'p q';
12715     system-id: 's';
12716     }
12717     }
12718     element { }
12719     }
12720    
12721 wakaba 1.24 @@XMLTest:
12722     @@@QName: xp.ENTITY.ignored.test
12723     @@@DEnt:
12724     @@@@test:value:
12725     <!DOCTYPE a [
12726     <!ENTITY e "a">
12727     <!ENTITY e "b">
12728     ]><a/>
12729     @@@test:domTree:
12730     document {
12731     document-type {
12732     general-entity {
12733     node-name: 'e';
12734     text-content: 'a';
12735     }
12736     }
12737     element { }
12738     }
12739     @@@c:erred:
12740     <[[xp|warning-entity-declaration-ignored]]> { (3, 1)..(3, 15); }
12741     @@XMLTest:
12742     @@@QName: xp.ENTITY.ignored.2.test
12743     @@@DEnt:
12744     @@@@test:value:
12745     <!DOCTYPE a [
12746     <!ENTITY % e "a">
12747     <!ENTITY % e "b">
12748     ]><a/>
12749     @@@test:domTree:
12750     document { }
12751     @@@c:erred:
12752     <[[xp|warning-entity-declaration-ignored]]> { (3, 1)..(3, 17); }
12753    
12754     @@XMLTest:
12755     @@@QName: xp.ENTITY.predefined.1.test
12756     @@@DEnt:
12757     @@@@test:value:
12758     <!DOCTYPE a [
12759     <!ENTITY lt "&#38;#60;">
12760     <!ENTITY gt "&#62;">
12761     <!ENTITY amp "&#38;#38;">
12762     <!ENTITY apos "&#39;">
12763     <!ENTITY quot "&#34;">
12764     <!ENTITY e "f">
12765     ]><a>&lt;&gt;&amp;&apos;&quot;</a>
12766     @@@test:domTree:
12767     document {
12768     document-type {
12769     general-entity {
12770     node-name: 'e';
12771     text-content: 'f';
12772     }
12773     }
12774     element {
12775     text-content: '<>&' U+0027 '"';
12776     }
12777     }
12778     @@XMLTest:
12779     @@@QName: xp.ENTITY.predefined.2.test
12780     @@@DEnt:
12781     @@@@test:value:
12782     <!DOCTYPE a [
12783     <!ENTITY lt "&#38;#60;">
12784     <!ENTITY gt "&#x26;#62;">
12785     <!ENTITY amp "&#38;#38;">
12786     <!ENTITY apos "&#x26;#39;">
12787     <!ENTITY quot "&#x26;#34;">
12788     <!ENTITY e "f">
12789     ]><a>&lt;&gt;&amp;&apos;&quot;</a>
12790     @@@test:domTree:
12791     document {
12792     document-type {
12793     general-entity {
12794     node-name: 'e';
12795     text-content: 'f';
12796     }
12797     }
12798     element {
12799     text-content: '<>&' U+0027 '"';
12800     }
12801     }
12802     @@XMLTest:
12803     @@@QName: xp.ENTITY.predefined.3.test
12804     @@@DEnt:
12805     @@@@test:value:
12806     <!DOCTYPE a [
12807     <!ENTITY lt "&#60;">
12808     <!ENTITY gt "&#62;">
12809     <!ENTITY amp "&#38;">
12810     <!ENTITY apos "&#39;">
12811     <!ENTITY quot "&#34;">
12812     <!ENTITY e "f">
12813     ]><a>&lt;&gt;&amp;&apos;&quot;</a>
12814     @@@c:erred: <[[xp|error-malformed-predefined-entity]]> { (2, 1)..(2, 24); }
12815     @@@c:erred: <[[xp|error-malformed-predefined-entity]]> { (4, 1)..(4, 24); }
12816     @@@test:domTree:
12817     document {
12818     document-type {
12819     general-entity {
12820     node-name: 'e';
12821     text-content: 'f';
12822     }
12823     }
12824     element {
12825     text-content: '<>&' U+0027 '"';
12826     }
12827     }
12828     @@XMLTest:
12829     @@@QName: xp.ENTITY.predefined.4.test
12830     @@@DEnt:
12831     @@@@test:value:
12832     <!DOCTYPE a [
12833     <!ENTITY lt "1">
12834     <!ENTITY gt "2">
12835     <!ENTITY amp "3">
12836     <!ENTITY apos "4">
12837     <!ENTITY quot "5">
12838     <!ENTITY e "f">
12839     ]><a>&lt;&gt;&amp;&apos;&quot;</a>
12840     @@@c:erred: <[[xp|error-malformed-predefined-entity]]> { (2, 1)..(2, 24); }
12841     @@@c:erred: <[[xp|error-malformed-predefined-entity]]> { (3, 1)..(3, 24); }
12842     @@@c:erred: <[[xp|error-malformed-predefined-entity]]> { (4, 1)..(4, 24); }
12843     @@@c:erred: <[[xp|error-malformed-predefined-entity]]> { (5, 1)..(5, 24); }
12844     @@@c:erred: <[[xp|error-malformed-predefined-entity]]> { (6, 1)..(6, 24); }
12845     @@@test:domTree:
12846     document {
12847     document-type {
12848     general-entity {
12849     node-name: 'e';
12850     text-content: 'f';
12851     }
12852     }
12853     element {
12854     text-content: '<>&' U+0027 '"';
12855     }
12856     }
12857     @@XMLTest:
12858     @@@QName: xp.ENTITY.predefined.5.test
12859     @@@DEnt:
12860     @@@@test:value:
12861     <!DOCTYPE a [
12862     <!ENTITY lt SYSTEM "1">
12863     <!ENTITY gt SYSTEM "2">
12864     <!ENTITY amp SYSTEM "3">
12865     <!ENTITY apos SYSTEM "4">
12866     <!ENTITY quot SYSTEM "5">
12867     <!ENTITY e "f">
12868     ]><a>&lt;&gt;&amp;&apos;&quot;</a>
12869     @@@c:erred: <[[xp|error-internal-predefined-entity]]> { (2, 1)..(2, 27); }
12870     @@@c:erred: <[[xp|error-internal-predefined-entity]]> { (3, 1)..(3, 27); }
12871     @@@c:erred: <[[xp|error-internal-predefined-entity]]> { (4, 1)..(4, 27); }
12872     @@@c:erred: <[[xp|error-internal-predefined-entity]]> { (5, 1)..(5, 27); }
12873     @@@c:erred: <[[xp|error-internal-predefined-entity]]> { (6, 1)..(6, 27); }
12874     @@@test:domTree:
12875     document {
12876     document-type {
12877     general-entity {
12878     node-name: 'e';
12879     text-content: 'f';
12880     }
12881     }
12882     element {
12883     text-content: '<>&' U+0027 '"';
12884     }
12885     }
12886     @@XMLTest:
12887     @@@QName: xp.ENTITY.predefined.6.test
12888     @@@DEnt:
12889     @@@@test:value:
12890     <!DOCTYPE a [
12891     <!ENTITY % lt SYSTEM "1">
12892     <!ENTITY % gt SYSTEM "2">
12893     <!ENTITY % amp SYSTEM "3">
12894     <!ENTITY % apos SYSTEM "4">
12895     <!ENTITY % quot SYSTEM "5">
12896     <!ENTITY e "f">
12897     ]><a>&lt;&gt;&amp;&apos;&quot;</a>
12898     @@@test:domTree:
12899     document {
12900     document-type {
12901     general-entity {
12902     node-name: 'e';
12903     text-content: 'f';
12904     }
12905     }
12906     element {
12907     text-content: '<>&' U+0027 '"';
12908     }
12909     }
12910     @@XMLTest:
12911     @@@QName: xp.ENTITY.predefined.7.test
12912     @@@DEnt:
12913     @@@@test:value:
12914     <!DOCTYPE a [
12915     <!ENTITY lt "&#38;#x3C;">
12916     <!ENTITY gt "&#x3E;">
12917     <!ENTITY amp "&#38;#x26;">
12918     <!ENTITY apos "&#x27;">
12919     <!ENTITY quot "&#x22;">
12920     <!ENTITY e "f">
12921     ]><a>&lt;&gt;&amp;&apos;&quot;</a>
12922     @@@test:domTree:
12923     document {
12924     document-type {
12925     general-entity {
12926     node-name: 'e';
12927     text-content: 'f';
12928     }
12929     }
12930     element {
12931     text-content: '<>&' U+0027 '"';
12932     }
12933     }
12934     @@XMLTest:
12935     @@@QName: xp.ENTITY.predefined.8.test
12936     @@@DEnt:
12937     @@@@test:value:
12938     <!DOCTYPE a [
12939     <!ENTITY lt "&#38;#x3c;">
12940     <!ENTITY gt "&#x3e;">
12941     <!ENTITY amp "&#38;#x26;">
12942     <!ENTITY apos "&#x27;">
12943     <!ENTITY quot "&#x22;">
12944     <!ENTITY e "f">
12945     ]><a>&lt;&gt;&amp;&apos;&quot;</a>
12946     @@@test:domTree:
12947     document {
12948     document-type {
12949     general-entity {
12950     node-name: 'e';
12951     text-content: 'f';
12952     }
12953     }
12954     element {
12955     text-content: '<>&' U+0027 '"';
12956     }
12957     }
12958     @@XMLTest:
12959     @@@QName: xp.ENTITY.predefined.9.test
12960     @@@DEnt:
12961     @@@@test:value:
12962     <!DOCTYPE a [
12963     <!ENTITY lt "&#38;#x00003C;">
12964     <!ENTITY gt "&#x0003E;">
12965     <!ENTITY amp "&#38;#x026;">
12966     <!ENTITY apos "&#x000027;">
12967     <!ENTITY quot "&#x0022;">
12968     <!ENTITY e "f">
12969     ]><a>&lt;&gt;&amp;&apos;&quot;</a>
12970     @@@test:domTree:
12971     document {
12972     document-type {
12973     general-entity {
12974     node-name: 'e';
12975     text-content: 'f';
12976     }
12977     }
12978     element {
12979     text-content: '<>&' U+0027 '"';
12980     }
12981     }
12982     @@XMLTest:
12983     @@@QName: xp.ENTITY.predefined.10.test
12984     @@@DEnt:
12985     @@@@test:value:
12986     <!DOCTYPE a [
12987     <!ENTITY lt "&#38;#00060;">
12988     <!ENTITY gt "&#062;">
12989     <!ENTITY amp "&#38;#000038;">
12990     <!ENTITY apos "&#0000039;">
12991     <!ENTITY quot "&#0034;">
12992     <!ENTITY e "f">
12993     ]><a>&lt;&gt;&amp;&apos;&quot;</a>
12994     @@@test:domTree:
12995     document {
12996     document-type {
12997     general-entity {
12998     node-name: 'e';
12999     text-content: 'f';
13000     }
13001     }
13002     element {
13003     text-content: '<>&' U+0027 '"';
13004     }
13005     }
13006    
13007 wakaba 1.25 @@XMLTest:
13008     @@@QName: xp.processed.1.test
13009     @@@DEnt:
13010     @@@@test:value:
13011     <a/>
13012     @@@test:domTree:
13013     document {
13014     all-declarations-processed: true;
13015     element { }
13016     }
13017     @@XMLTest:
13018     @@@QName: xp.processed.2.test
13019     @@@DEnt:
13020     @@@@test:value:
13021     <!DOCTYPE a [
13022     <!ENTITY e "f">
13023     <!ATTLIST a b NMTOKEN " c ">
13024     ]><a>&e;</a>
13025     @@@test:domTree:
13026     document {
13027     document-type {
13028     general-entity {
13029     node-name: 'e';
13030     }
13031     element-type-definition {
13032     node-name: 'a';
13033     attribute-definition {
13034     node-name: 'b';
13035     }
13036     }
13037     }
13038     all-declarations-processed: true;
13039     element {
13040     attribute {
13041     node-name: 'b';
13042     node-value: 'c';
13043     }
13044     text-content: 'f';
13045     }
13046     }
13047     @@XMLTest:
13048     @@@QName: xp.processed.3.test
13049     @@@DEnt:
13050     @@@@test:value:
13051     <!DOCTYPE a [
13052     <!ENTITY % p SYSTEM "p">
13053     %p;
13054     <!ENTITY e "f">
13055     <!ATTLIST a b NMTOKEN " c ">
13056     ]><a d="e">&e;</a>
13057     @@@test:domTree:
13058     document {
13059     document-type { }
13060     all-declarations-processed: false;
13061     element {
13062     attribute {
13063     node-name: 'd';
13064     node-value: 'e';
13065     }
13066     general-entity-reference {
13067     node-name: 'e';
13068     is-expanded: false;
13069     }
13070     }
13071     }
13072     @@@c:erred:
13073     <[[xp|warning-entity-declaration-not-processed]]> { (4, 1)..(4, 20); }
13074     @@@c:erred:
13075     <[[xp|warning-attribute-definition-not-processed]]> { (5, 13)..(5, 31); }
13076     @@XMLTest:
13077     @@@QName: xp.processed.4.test
13078     @@@DEnt:
13079     @@@@test:value:
13080     <?xml version="1.1" standalone="yes"?>
13081     <!DOCTYPE a [
13082     <!ENTITY % p SYSTEM "p">
13083     %p;
13084     <!ENTITY e "f">
13085     <!ATTLIST a b NMTOKEN " c ">
13086     ]><a>&e;</a>
13087     @@@test:domTree:
13088     document {
13089     document-type {
13090     general-entity {
13091     node-name: 'e';
13092     }
13093     element-type-definition {
13094     node-name: 'a';
13095     attribute-definition {
13096     node-name: 'b';
13097     }
13098     }
13099     }
13100     all-declarations-processed: false;
13101     element {
13102     attribute {
13103     node-name: 'b';
13104     node-value: 'c';
13105     }
13106     text-content: 'f';
13107     }
13108     }
13109     @@XMLTest:
13110     @@@QName: xp.processed.5.test
13111     @@@DEnt:
13112     @@@@test:value:
13113     <!DOCTYPE a SYSTEM "p" [
13114     <!ENTITY e "f">
13115     <!ATTLIST a b NMTOKEN " c ">
13116     ]><a>&e;</a>
13117     @@@test:domTree:
13118     document {
13119     document-type {
13120     general-entity {
13121     node-name: 'e';
13122     }
13123     element-type-definition {
13124     node-name: 'a';
13125     attribute-definition {
13126     node-name: 'b';
13127     }
13128     }
13129     }
13130     all-declarations-processed: false;
13131     element {
13132     attribute {
13133     node-name: 'b';
13134     node-value: 'c';
13135     }
13136     text-content: 'f';
13137     }
13138     }
13139    
13140     @@XMLTest:
13141     @@@QName: xp.PEs.in.internal.subset.1.test
13142     @@@DEnt:
13143     @@@@test:value:
13144     <!DOCTYPE a [
13145     <!ENTITY % p " ">
13146 wakaba 1.26 <!ENTITY % q "%p;">
13147 wakaba 1.25 ]><a/>
13148     @@@c:erred: <[[xp|wf-pes-in-internal-subset]]> { (3, 15)..(3, 17); }
13149     @@XMLTest:
13150     @@@QName: xp.PEs.in.internal.subset.2.test
13151     @@@DEnt:
13152     @@@@test:value:
13153     <!DOCTYPE a [
13154     <!ENTITY % p " ">
13155 wakaba 1.26 <!ENTITY % q '%p;'>
13156 wakaba 1.25 ]><a/>
13157     @@@c:erred: <[[xp|wf-pes-in-internal-subset]]> { (3, 15)..(3, 17); }
13158    
13159 wakaba 1.26 @@XMLTest:
13160     @@@QName: xp.name.pitarget.content.1.0.2.test
13161     @@@DEnt:
13162     @@@@test:value:
13163     <?xml version="1.0"?>
13164     <p>
13165     <?$u3001$u3002?>
13166     </p>
13167     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]> { (3, 3)..(3, 4); }
13168     @@XMLTest:
13169     @@@QName: xp.name.pitarget.content.1.1.2.test
13170     @@@DEnt:
13171     @@@@test:value:
13172     <?xml version="1.1"?>
13173     <p>$
13174     <?$u3001$u3002?>$
13175     </p>
13176     @@@test:domTree:
13177     document {
13178     xml-version: '1.1';
13179     element {
13180     pi {
13181     node-name: U+3001 U+3002;
13182 wakaba 1.14 }
13183 wakaba 1.12 }
13184 wakaba 1.26 }
13185     @@XMLTest:
13186     @@@QName: xp.name.pitarget.content.1.0.3.test
13187     @@@DEnt:
13188     @@@@test:value:
13189     <?xml version="1.0"?>
13190     <p>
13191     <?$u3005b?>
13192     </p>
13193     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]> { (3, 3)..(3, 4); }
13194     @@XMLTest:
13195     @@@QName: xp.name.pitarget.content.1.1.3.test
13196     @@@DEnt:
13197     @@@@test:value:
13198     <?xml version="1.1"?>
13199     <p>$
13200     <?$u3005b?>$
13201     </p>
13202     @@@test:domTree:
13203     document {
13204     xml-version: '1.1';
13205     element {
13206     pi {
13207     node-name: U+3005 'b';
13208 wakaba 1.12 }
13209     }
13210 wakaba 1.26 }
13211     @@XMLTest:
13212     @@@QName: xp.name.pitarget.content.names.1.0.1.test
13213     @@@DEnt:
13214     @@@@test:value:
13215     <?xml version="1.0"?>
13216     <p>
13217     <?a:b?>
13218     </p>
13219     @@@c:erred: <[[xp|nswf-legal-ncname]]> { (3, 3)..(3, 5); }
13220     @@XMLTest:
13221     @@@QName: xp.name.pitarget.content.names.1.1.1.test
13222     @@@DEnt:
13223     @@@@test:value:
13224     <?xml version="1.1"?>
13225     <p>
13226     <?a:b?>
13227     </p>
13228     @@@c:erred: <[[xp|nswf-legal-ncname]]> { (3, 3)..(3, 5); }
13229     @@XMLTest:
13230     @@@QName: xp.name.pitarget.intsubset.1.0.2.test
13231     @@@DEnt:
13232     @@@@test:value:
13233     <?xml version="1.0"?>
13234     <!DOCTYPE p [
13235     <?$u3001$u3002?>
13236     ]><p/>
13237     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]> { (3, 3)..(3, 4); }
13238     @@XMLTest:
13239     @@@QName: xp.name.pitarget.intsubset.1.1.2.test
13240     @@@DEnt:
13241     @@@@test:value:
13242     <?xml version="1.1"?>
13243     <!DOCTYPE p [
13244     <?$u3001$u3002?>
13245     ]><p/>
13246     @@@test:domTree:
13247     document {
13248     xml-version: '1.1';
13249     document-type {
13250     pi {
13251     node-name: U+3001 U+3002;
13252     }
13253     }
13254     element { }
13255     }
13256     @@XMLTest:
13257     @@@QName: xp.name.pitarget.intsubset.1.0.3.test
13258     @@@DEnt:
13259     @@@@test:value:
13260     <?xml version="1.0"?>
13261     <!DOCTYPE p [
13262     <?$u3005b?>
13263     ]><p/>
13264     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]> { (3, 3)..(3, 4); }
13265     @@XMLTest:
13266     @@@QName: xp.name.pitarget.intsubset.1.1.3.test
13267     @@@DEnt:
13268     @@@@test:value:
13269     <?xml version="1.1"?>
13270     <!DOCTYPE p [
13271     <?$u3005b?>
13272     ]><p/>
13273     @@@test:domTree:
13274     document {
13275     xml-version: '1.1';
13276     document-type {
13277     pi {
13278     node-name: U+3005 'b';
13279     }
13280     }
13281     element { }
13282     }
13283     @@XMLTest:
13284     @@@QName: xp.name.pitarget.intsubset.names.1.0.1.test
13285     @@@DEnt:
13286     @@@@test:value:
13287     <?xml version="1.0"?>
13288     <!DOCTYPE p [
13289     <?a:b?>
13290     ]><p/>
13291     @@@c:erred: <[[xp|nswf-legal-ncname]]> { (3, 3)..(3, 5); }
13292     @@XMLTest:
13293     @@@QName: xp.name.pitarget.intsubset.names.1.1.1.test
13294     @@@DEnt:
13295     @@@@test:value:
13296     <?xml version="1.1"?>
13297     <!DOCTYPE p [
13298     <?a:b?>
13299     ]><p/>
13300     @@@c:erred: <[[xp|nswf-legal-ncname]]> { (3, 3)..(3, 5); }
13301     @@XMLTest:
13302     @@@QName: xp.name.doctypedecl.stag.etag.1.0.2.test
13303     @@@DEnt:
13304     @@@@test:value:
13305     <?xml version="1.0"?>
13306     <!DOCTYPE $u3001$u3002>
13307     <$u3001$u3002>
13308     </$u3001$u3002>
13309     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (2, 11)..(2, 12); }
13310     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (3, 2)..(3, 3); }
13311     # @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (4, 3)..(4, 4); }
13312     @@XMLTest:
13313     @@@QName: xp.name.doctypedecl.stag.etag.1.1.2.test
13314     @@@DEnt:
13315     @@@@test:value:
13316     <?xml version="1.1"?>
13317     <!DOCTYPE $u3001$u3002>
13318     <$u3001$u3002>
13319     </$u3001$u3002>
13320     @@@test:domTree:
13321     document {
13322     xml-version: '1.1';
13323     document-type {
13324     node-name: U+3001 U+3002;
13325     }
13326     element {
13327     node-name: U+3001 U+3002;
13328     }
13329     }
13330     @@XMLTest:
13331     @@@QName: xp.name.doctypedecl.stag.etag.1.0.3.test
13332     @@@DEnt:
13333     @@@@test:value:
13334     <?xml version="1.0"?>
13335     <!DOCTYPE $u3005b>
13336     <$u3005b>
13337     </$u3005b>
13338     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (2, 11)..(2, 12); }
13339     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (3, 2)..(3, 3); }
13340     # @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (4, 3)..(4, 4); }
13341     @@XMLTest:
13342     @@@QName: xp.name.doctype.decl.stag.etag.1.1.3.test
13343     @@@DEnt:
13344     @@@@test:value:
13345     <?xml version="1.1"?>
13346     <!DOCTYPE $u3005b>
13347     <$u3005b>
13348     </$u3005b>
13349     @@@test:domTree:
13350     document {
13351     xml-version: '1.1';
13352     document-type {
13353     node-name: U+3005 'b';
13354     }
13355     element {
13356     node-name: U+3005 'b';
13357     }
13358     }
13359     @@XMLTest:
13360     @@@QName: xp.name.doctypedecl.stag.etag.names.1.0.1.test
13361     @@@DEnt:
13362     @@@@test:value:
13363     <?xml version="1.0"?>
13364     <!DOCTYPE a:b>
13365     <a:b xmlns:a="http://a.example/">
13366     </a:b>
13367     @@@test:domTree:
13368     document {
13369     xml-version: '1.0';
13370     document-type {
13371     node-name: 'a:b';
13372     }
13373     element {
13374     prefix: 'a';
13375     local-name: 'b';
13376     namespace-uri: 'http://a.example/';
13377     attribute {
13378     namespace-uri: 'http://www.w3.org/2000/xmlns/';
13379     prefix: 'xmlns';
13380     local-name: 'a';
13381     value: 'http://a.example/';
13382     specified: true;
13383     }
13384     }
13385     }
13386     @@XMLTest:
13387     @@@QName: xp.name.doctypedecl.stag.etag.names.1.1.1.test
13388     @@@DEnt:
13389     @@@@test:value:
13390     <?xml version="1.1"?>
13391     <!DOCTYPE a:b>
13392     <a:b xmlns:a="http://a.example/">
13393     </a:b>
13394     @@@test:domTree:
13395     document {
13396     xml-version: '1.1';
13397     document-type {
13398     node-name: 'a:b';
13399     }
13400     element {
13401     prefix: 'a';
13402     local-name: 'b';
13403     namespace-uri: 'http://a.example/';
13404     attribute {
13405     namespace-uri: 'http://www.w3.org/2000/xmlns/';
13406     prefix: 'xmlns';
13407     local-name: 'a';
13408     specified: true;
13409     }
13410     }
13411     }
13412     @@XMLTest:
13413     @@@QName: xp.name.doctypedecl.stag.etag.names.1.0.2.test
13414     @@@DEnt:
13415     @@@@test:value:
13416     <?xml version="1.0"?>
13417     <!DOCTYPE :ab>
13418     <:ab>
13419     </:ab>
13420     @@@c:erred: <[[xp|nswf-legal-qname]]> { (2, 11)..(2, 13); }
13421     @@@c:erred: <[[xp|nswf-legal-qname]]> { (3, 2)..(3, 4); }
13422     @@@c:erred: <[[xp|nsc-prefix-declared]]> { /* prefix || */ }
13423     @@XMLTest:
13424     @@@QName: xp.name.doctypedecl.stag.etag.names.1.1.2.test
13425     @@@DEnt:
13426     @@@@test:value:
13427     <?xml version="1.1"?>
13428     <!DOCTYPE :ab>
13429     <:ab>
13430     </:ab>
13431     @@@c:erred: <[[xp|nswf-legal-qname]]> { (2, 11)..(2, 13); }
13432     @@@c:erred: <[[xp|nswf-legal-qname]]> { (3, 2)..(3, 4); }
13433     @@@c:erred: <[[xp|nsc-prefix-declared]]> { /* prefix || */ }
13434     @@XMLTest:
13435     @@@QName: xp.name.doctypedecl.stag.etag.names.1.0.3.test
13436     @@@DEnt:
13437     @@@@test:value:
13438     <?xml version="1.0"?>
13439     <!DOCTYPE a:$u3005>
13440     <a:$u3005 xmlns:a="http://a.example/">
13441     </a:$u3005>
13442     @@@c:erred: <[[xp|nswf-legal-qname]]> { (2, 11)..(2, 13); }
13443     @@@c:erred: <[[xp|nswf-legal-qname]]> { (3, 2)..(3, 4); }
13444     @@XMLTest:
13445     @@@QName: xp.name.doctypedecl.stag.etag.names.1.1.3.test
13446     @@@DEnt:
13447     @@@@test:value:
13448     <?xml version="1.1"?>
13449     <!DOCTYPE a:$u3005>
13450     <a:$u3005 xmlns:a="http://a.example/">
13451     </a:$u3005>
13452     @@@test:domTree:
13453     document {
13454     xml-version: '1.1';
13455     document-type {
13456     node-name: 'a:' U+3005;
13457     }
13458     element {
13459     prefix: 'a';
13460     local-name: U+3005;
13461     namespace-uri: 'http://a.example/';
13462     attribute {
13463     namespace-uri: 'http://www.w3.org/2000/xmlns/';
13464     prefix: 'xmlns';
13465     local-name: 'a';
13466     value: 'http://a.example/';
13467     specified: true;
13468     }
13469     }
13470     }
13471     @@XMLTest:
13472     @@@QName: xp.name.doctypedecl.stag.etag.names.1.0.4.test
13473     @@@DEnt:
13474     @@@@test:value:
13475     <?xml version="1.0"?>
13476     <!DOCTYPE a:b>
13477     <a:b>
13478     </a:b>
13479     @@@c:erred: <[[xp|nsc-prefix-declared]]> { (3, 1)..(3, 5); }
13480     @@XMLTest:
13481     @@@QName: xp.name.doctypedecl.stag.etag.names.1.1.4.test
13482     @@@DEnt:
13483     @@@@test:value:
13484     <?xml version="1.1"?>
13485     <!DOCTYPE a:b>
13486     <a:b>
13487     </a:b>
13488     @@@c:erred: <[[xp|nsc-prefix-declared]]> { (3, 1)..(3, 5); }
13489     @@XMLTest:
13490     @@@QName: xp.name.emptyelemtag.1.0.2.test
13491     @@@DEnt:
13492     @@@@test:value:
13493     <?xml version="1.0"?>
13494     <$u3001$u3002/>
13495     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (2, 2)..(2, 3); }
13496     @@XMLTest:
13497     @@@QName: xp.name.emptyelemtag.1.1.2.test
13498     @@@DEnt:
13499     @@@@test:value:
13500     <?xml version="1.1"?>
13501     <$u3001$u3002/>
13502     @@@test:domTree:
13503     document {
13504     xml-version: '1.1';
13505     element {
13506     node-name: U+3001 U+3002;
13507     }
13508     }
13509     @@XMLTest:
13510     @@@QName: xp.name.emptyelemtag.1.0.3.test
13511     @@@DEnt:
13512     @@@@test:value:
13513     <?xml version="1.0"?>
13514     <$u3005b/>
13515     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (2, 2)..(2, 3); }
13516     @@XMLTest:
13517     @@@QName: xp.name.emptyelemtag.1.1.3.test
13518     @@@DEnt:
13519     @@@@test:value:
13520     <?xml version="1.1"?>
13521     <$u3005b/>
13522     @@@test:domTree:
13523     document {
13524     xml-version: '1.1';
13525     element {
13526     node-name: U+3005 'b';
13527     }
13528     }
13529     @@XMLTest:
13530     @@@QName: xp.name.emptyelemtag.names.1.0.1.test
13531     @@@DEnt:
13532     @@@@test:value:
13533     <?xml version="1.0"?>
13534     <a:b/>
13535     @@@c:erred: <[[xp|nsc-prefix-declared]]>{ (2, 1)..(2, 6); }
13536     @@XMLTest:
13537     @@@QName: xp.name.emptyelemtag.names.1.1.1.test
13538     @@@DEnt:
13539     @@@@test:value:
13540     <?xml version="1.1"?>
13541     <a:b/>
13542     @@@c:erred: <[[xp|nsc-prefix-declared]]>{ (2, 1)..(2, 6); }
13543     @@XMLTest:
13544     @@@QName: xp.name.attr.1.0.2.test
13545     @@@DEnt:
13546     @@@@test:value:
13547     <?xml version="1.0"?>
13548     <a $u3001$u3002=""/>
13549     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (2, 4)..(2, 5); }
13550     @@XMLTest:
13551     @@@QName: xp.name.attr.1.1.2.test
13552     @@@DEnt:
13553     @@@@test:value:
13554     <?xml version="1.1"?>
13555     <a $u3001$u3002=""/>
13556     @@@test:domTree:
13557     document {
13558     xml-version: '1.1';
13559     element {
13560     attribute {
13561     node-name: U+3001 U+3002;
13562     }
13563     }
13564     }
13565     @@XMLTest:
13566     @@@QName: xp.name.attr.1.0.3.test
13567     @@@DEnt:
13568     @@@@test:value:
13569     <?xml version="1.0"?>
13570     <a $u3005b=""/>
13571     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (2, 4)..(2, 5); }
13572     @@XMLTest:
13573     @@@QName: xp.name.attr.1.1.3.test
13574     @@@DEnt:
13575     @@@@test:value:
13576     <?xml version="1.1"?>
13577     <a $u3005b=""/>
13578     @@@test:domTree:
13579     document {
13580     xml-version: '1.1';
13581     element {
13582     attribute {
13583     node-name: U+3005 'b';
13584     }
13585     }
13586     }
13587     @@XMLTest:
13588     @@@QName: xp.name.attr.names.1.0.1.test
13589     @@@DEnt:
13590     @@@@test:value:
13591     <?xml version="1.0"?>
13592     <a a:b=""/>
13593     @@@c:erred: <[[xp|nsc-prefix-declared]]>{ (2, 1)..(2, 11); }
13594     @@XMLTest:
13595     @@@QName: xp.name.attr.names.1.1.1.test
13596     @@@DEnt:
13597     @@@@test:value:
13598     <?xml version="1.1"?>
13599     <a a:b=""/>
13600     @@@c:erred: <[[xp|nsc-prefix-declared]]>{ (2, 1)..(2, 11); }
13601     @@XMLTest:
13602     @@@QName: xp.name.attr.names.1.0.2.test
13603     @@@DEnt:
13604     @@@@test:value:
13605     <?xml version="1.0"?>
13606     <a :ab=""/>
13607     @@@c:erred: <[[xp|nswf-legal-qname]]>{ (2, 4)..(2, 6); }
13608     @@@c:erred: <[[xp|nsc-prefix-declared]]> { }
13609     @@XMLTest:
13610     @@@QName: xp.name.attr.names.1.1.2.test
13611     @@@DEnt:
13612     @@@@test:value:
13613     <?xml version="1.1"?>
13614     <a :ab=""/>
13615     @@@c:erred: <[[xp|nswf-legal-qname]]>{ (2, 4)..(2, 6); }
13616     @@@c:erred: <[[xp|nsc-prefix-declared]]> { }
13617     @@XMLTest:
13618     @@@QName: xp.name.attlist.1.0.2.test
13619     @@@DEnt:
13620     @@@@test:value:
13621     <?xml version="1.0"?>
13622     <!DOCTYPE p [
13623     <!NOTATION $u3001$u3002 SYSTEM "n">
13624     <!ATTLIST $u3001$u3002
13625     $u3001$u3002
13626     NOTATION
13627     ($u3001$u3002)
13628     #IMPLIED>
13629     ]><p/>
13630     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (3, 12)..(3, 13); }
13631     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (4, 11)..(4, 12); }
13632     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (5, 1)..(5, 2); }
13633     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (7, 2)..(7, 3); }
13634     @@XMLTest:
13635     @@@QName: xp.name.attlist.1.1.2.test
13636     @@@DEnt:
13637     @@@@test:value:
13638     <?xml version="1.1"?>
13639     <!DOCTYPE p [
13640     <!NOTATION $u3001$u3002 SYSTEM "n">
13641     <!ATTLIST $u3001$u3002
13642     $u3001$u3002
13643     NOTATION
13644     ($u3001$u3002)
13645     #IMPLIED>
13646     ]><p/>
13647     @@@test:domTree:
13648     document {
13649     xml-version: '1.1';
13650     document-type {
13651     notation {
13652     node-name: U+3001 U+3002;
13653     }
13654     element-type-definition {
13655     node-name: U+3001 U+3002;
13656     attribute-definition {
13657     node-name: U+3001 U+3002;
13658     allowed-tokens: DOMStringList (U+3001 U+3002);
13659     }
13660     }
13661     }
13662     element { }
13663     }
13664     @@XMLTest:
13665     @@@QName: xp.name.attlist.1.0.3.test
13666     @@@DEnt:
13667     @@@@test:value:
13668     <?xml version="1.0"?>
13669     <!DOCTYPE p [
13670     <!NOTATION $u3005b SYSTEM "n">
13671     <!ATTLIST $u3005b
13672     $u3005b
13673     NOTATION
13674     ($u3005b)
13675     #IMPLIED>
13676     ]><p/>
13677     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (3, 12)..(3, 13); }
13678     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (4, 11)..(4, 12); }
13679     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (5, 1)..(5, 2); }
13680     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (7, 2)..(7, 3); }
13681     @@XMLTest:
13682     @@@QName: xp.name.attlist.1.1.3.test
13683     @@@DEnt:
13684     @@@@test:value:
13685     <?xml version="1.1"?>
13686     <!DOCTYPE p [
13687     <!NOTATION $u3005b SYSTEM "n">
13688     <!ATTLIST $u3005b
13689     $u3005b
13690     NOTATION
13691     ($u3005b)
13692     #IMPLIED>
13693     ]><p/>
13694     @@@test:domTree:
13695     document {
13696     xml-version: '1.1';
13697     document-type {
13698     notation {
13699     node-name: U+3005 'b';
13700     }
13701     element-type-definition {
13702     node-name: U+3005 'b';
13703     attribute-definition {
13704     node-name: U+3005 'b';
13705     allowed-tokens: DOMStringList (U+3005 'b');
13706     }
13707     }
13708     }
13709     element { }
13710     }
13711     @@XMLTest:
13712     @@@QName: xp.name.attlist.names.1.0.1.test
13713     @@@DEnt:
13714     @@@@test:value:
13715     <?xml version="1.0"?>
13716     <!DOCTYPE p [
13717     <!NOTATION a:b SYSTEM "n">
13718     <!ATTLIST a:b
13719     a:b
13720     NOTATION
13721     (a:b)
13722     #IMPLIED>
13723     ]><p/>
13724     @@@c:erred: <[[xp|nswf-legal-ncname]]>{ (3, 12)..(3, 14); }
13725     @@@c:erred: <[[xp|nswf-legal-ncname]]>{ (7, 2)..(7, 4); }
13726     @@XMLTest:
13727     @@@QName: xp.name.attlist.names.1.1.1.test
13728     @@@DEnt:
13729     @@@@test:value:
13730     <?xml version="1.1"?>
13731     <!DOCTYPE p [
13732     <!NOTATION a:b SYSTEM "n">
13733     <!ATTLIST a:b
13734     a:b
13735     NOTATION
13736     (a:b)
13737     #IMPLIED>
13738     ]><p/>
13739     @@@c:erred: <[[xp|nswf-legal-ncname]]>{ (3, 12)..(3, 14); }
13740     @@@c:erred: <[[xp|nswf-legal-ncname]]>{ (7, 2)..(7, 4); }
13741     @@XMLTest:
13742     @@@QName: xp.name.attlist.names.1.0.2.test
13743     @@@DEnt:
13744     @@@@test:value:
13745     <?xml version="1.0"?>
13746     <!DOCTYPE p [
13747     <!NOTATION :ab SYSTEM "n">
13748     <!ATTLIST :ab
13749     :ab
13750     NOTATION
13751     (:ab)
13752     #IMPLIED>
13753     ]><p/>
13754     @@@c:erred: <[[xp|nswf-legal-ncname]]>{ (3, 12)..(3, 14); }
13755     @@@c:erred: <[[xp|nswf-legal-qname]]>{ (4, 11)..(4, 13); }
13756     @@@c:erred: <[[xp|nswf-legal-qname]]>{ (5, 1)..(5, 3); }
13757     @@@c:erred: <[[xp|nswf-legal-ncname]]>{ (7, 2)..(7, 4); }
13758     @@XMLTest:
13759     @@@QName: xp.name.attlist.names.1.1.2.test
13760     @@@DEnt:
13761     @@@@test:value:
13762     <?xml version="1.1"?>
13763     <!DOCTYPE p [
13764     <!NOTATION :ab SYSTEM "n">
13765     <!ATTLIST :ab
13766     :ab
13767     NOTATION
13768     (:ab)
13769     #IMPLIED>
13770     ]><p/>
13771     @@@c:erred: <[[xp|nswf-legal-ncname]]>{ (3, 12)..(3, 14); }
13772     @@@c:erred: <[[xp|nswf-legal-qname]]>{ (4, 11)..(4, 13); }
13773     @@@c:erred: <[[xp|nswf-legal-qname]]>{ (5, 1)..(5, 3); }
13774     @@@c:erred: <[[xp|nswf-legal-ncname]]>{ (7, 2)..(7, 4); }
13775     @@XMLTest:
13776     @@@QName: xp.name.gent.1.0.2.test
13777     @@@DEnt:
13778     @@@@test:value:
13779     <?xml version="1.0"?>
13780     <!DOCTYPE p [
13781     <!ENTITY $u3001$u3002 "n">
13782     ]>
13783     <p a="&$u3001$u3002;">
13784     &$u3001$u3002;
13785     </p>
13786     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (3, 10)..(3, 11); }
13787     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (5, 8)..(5, 9); }
13788     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (6, 2)..(6, 3); }
13789     @@XMLTest:
13790     @@@QName: xp.name.ger.1.1.2.test
13791     @@@DEnt:
13792     @@@@test:value:
13793     <?xml version="1.1"?>
13794     <!DOCTYPE p [
13795     <!ENTITY $u3001$u3002 "n">
13796     ]>
13797     <p a="&$u3001$u3002;">$
13798     &$u3001$u3002;$
13799     </p>
13800     @@@test:domTree:
13801     document {
13802     xml-version: '1.1';
13803     document-type {
13804     general-entity {
13805     node-name: U+3001 U+3002;
13806     }
13807     }
13808     element {
13809     attribute {
13810     node-name: 'a';
13811     general-entity-reference {
13812     node-name: U+3001 U+3002;
13813     }
13814     }
13815     general-entity-reference {
13816     node-name: U+3001 U+3002;
13817     }
13818     }
13819     }
13820     @@XMLTest:
13821     @@@QName: xp.name.ger.1.0.3.test
13822     @@@DEnt:
13823     @@@@test:value:
13824     <?xml version="1.0"?>
13825     <!DOCTYPE p [
13826     <!ENTITY $u3005b "n">
13827     ]>
13828     <p a="&$u3005b;">
13829     &$u3005b;
13830     </p>
13831     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (3, 10)..(3, 11); }
13832     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (5, 8)..(5, 9); }
13833     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (6, 2)..(6, 3); }
13834     @@XMLTest:
13835     @@@QName: xp.name.ger.1.1.3.test
13836     @@@DEnt:
13837     @@@@test:value:
13838     <?xml version="1.1"?>
13839     <!DOCTYPE p [
13840     <!ENTITY $u3005b "n">
13841     ]>
13842     <p a="&$u3005b;">$
13843     &$u3005b;$
13844     </p>
13845     @@@test:domTree:
13846     document {
13847     xml-version: '1.1';
13848     document-type {
13849     general-entity {
13850     node-name: U+3005 'b';
13851     }
13852     }
13853     element {
13854     attribute {
13855     node-name: 'a';
13856     general-entity-reference {
13857     node-name: U+3005 'b';
13858     }
13859     }
13860     general-entity-reference {
13861     node-name: U+3005 'b';
13862     }
13863     }
13864     }
13865     @@XMLTest:
13866     @@@QName: xp.name.ger.names.1.0.1.test
13867     @@@DEnt:
13868     @@@@test:value:
13869     <?xml version="1.0"?>
13870     <!DOCTYPE p [
13871     <!ENTITY a:b "n">
13872     ]>
13873     <p a="&a:b;">
13874     &a:b;
13875     </p>
13876     @@@c:erred: <[[xp|nswf-legal-ncname]]>{ (3, 10)..(3, 12); }
13877     @@@c:erred: <[[xp|nswf-legal-ncname]]>{ (5, 8)..(5, 10); }
13878     @@@c:erred: <[[xp|nswf-legal-ncname]]>{ (6, 2)..(6, 4); }
13879     @@XMLTest:
13880     @@@QName: xp.name.ger.names.1.1.1.test
13881     @@@DEnt:
13882     @@@@test:value:
13883     <?xml version="1.1"?>
13884     <!DOCTYPE p [
13885     <!ENTITY a:b "n">
13886     ]>
13887     <p a="&a:b;">
13888     &a:b;
13889     </p>
13890     @@@c:erred: <[[xp|nswf-legal-ncname]]>{ (3, 10)..(3, 12); }
13891     @@@c:erred: <[[xp|nswf-legal-ncname]]>{ (5, 8)..(5, 10); }
13892     @@@c:erred: <[[xp|nswf-legal-ncname]]>{ (6, 2)..(6, 4); }
13893     @@XMLTest:
13894     @@@QName: xp.name.ndata.1.0.2.test
13895     @@@DEnt:
13896     @@@@test:value:
13897     <?xml version="1.0"?>
13898     <!DOCTYPE p [
13899     <!NOTATION $u3001$u3002 SYSTEM "n">
13900     <!ENTITY e SYSTEM "s" NDATA $u3001$u3002>
13901     ]><p/>
13902     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (3, 12)..(3, 13); }
13903     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (4, 29)..(4, 30); }
13904     @@XMLTest:
13905     @@@QName: xp.name.ndata.1.1.2.test
13906     @@@DEnt:
13907     @@@@test:value:
13908     <?xml version="1.1"?>
13909     <!DOCTYPE p [
13910     <!NOTATION $u3001$u3002 SYSTEM "n">
13911     <!ENTITY e SYSTEM "s" NDATA $u3001$u3002>
13912     ]><p/>
13913     @@@test:domTree:
13914     document {
13915     xml-version: '1.1';
13916     document-type {
13917     notation {
13918     node-name: U+3001 U+3002;
13919     }
13920     general-entity {
13921     node-name: 'e';
13922     notation-name: U+3001 U+3002;
13923     }
13924     }
13925     element { }
13926     }
13927     @@XMLTest:
13928     @@@QName: xp.name.ndata.1.0.3.test
13929     @@@DEnt:
13930     @@@@test:value:
13931     <?xml version="1.0"?>
13932     <!DOCTYPE p [
13933     <!NOTATION $u3005b SYSTEM "n">
13934     <!ENTITY e SYSTEM "s" NDATA $u3005b>
13935     ]><p/>
13936     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (3, 12)..(3, 13); }
13937     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (4, 29)..(4, 30); }
13938     @@XMLTest:
13939     @@@QName: xp.name.ndata.1.1.3.test
13940     @@@DEnt:
13941     @@@@test:value:
13942     <?xml version="1.1"?>
13943     <!DOCTYPE p [
13944     <!NOTATION $u3005b SYSTEM "n">
13945     <!ENTITY e SYSTEM "s" NDATA $u3005b>
13946     ]><p/>
13947     @@@test:domTree:
13948     document {
13949     xml-version: '1.1';
13950     document-type {
13951     notation {
13952     node-name: U+3005 'b';
13953     }
13954     general-entity {
13955     node-name: 'e';
13956     notation-name: U+3005 'b';
13957     }
13958     }
13959     element { }
13960     }
13961     @@XMLTest:
13962     @@@QName: xp.name.ndata.names.1.0.1.test
13963     @@@DEnt:
13964     @@@@test:value:
13965     <?xml version="1.0"?>
13966     <!DOCTYPE p [
13967     <!NOTATION a:b SYSTEM "n">
13968     <!ENTITY e SYSTEM "s" NDATA a:b>
13969     ]><p/>
13970     @@@c:erred: <[[xp|nswf-legal-ncname]]>{ (3, 12)..(3, 14); }
13971     @@@c:erred: <[[xp|nswf-legal-ncname]]>{ (4, 29)..(4, 31); }
13972     @@XMLTest:
13973     @@@QName: xp.name.ndata.names.1.1.1.test
13974     @@@DEnt:
13975     @@@@test:value:
13976     <?xml version="1.1"?>
13977     <!DOCTYPE p [
13978     <!NOTATION a:b SYSTEM "n">
13979     <!ENTITY e SYSTEM "s" NDATA a:b>
13980     ]><p/>
13981     @@@c:erred: <[[xp|nswf-legal-ncname]]>{ (3, 12)..(3, 14); }
13982     @@@c:erred: <[[xp|nswf-legal-ncname]]>{ (4, 29)..(4, 31); }
13983    
13984     @@enImplNote:
13985     @@@ddid: wf-invalid-character-in-node-name
13986     @@@@:
13987     {ISSUE::
13988     {P:: Tests required for:
13989    
13990     - <CODE::Name> in element type declaration
13991    
13992     - <CODE::Name> in model group
13993    
13994     - <CODE::Name> in parameter entity declaration
13995    
13996     - <CODE::Name> in parameter entity reference
13997    
13998     }
13999     }
14000    
14001     @@XMLTest:
14002     @@@QName: xp.NOTATION.1.test
14003     @@@DEnt:
14004     @@@@test:value:
14005     <!DOCTYPE p [
14006     <!NOTATION n SYSTEM "m">
14007     ]><p/>
14008     @@@test:domTree:
14009     document {
14010     document-type {
14011     notation {
14012     node-name: 'n';
14013     public-id: null;
14014     system-id: 'm';
14015     }
14016     }
14017     element { }
14018     }
14019     @@XMLTest:
14020     @@@QName: xp.NOTATION.2.test
14021     @@@DEnt:
14022     @@@@test:value:
14023     <!DOCTYPE p [
14024     <!NOTATION n PUBLIC "m">
14025     ]><p/>
14026     @@@test:domTree:
14027     document {
14028     document-type {
14029     notation {
14030     node-name: 'n';
14031     system-id: null;
14032     public-id: 'm';
14033     }
14034     }
14035     element { }
14036     }
14037     @@XMLTest:
14038     @@@QName: xp.NOTATION.3.test
14039     @@@DEnt:
14040     @@@@test:value:
14041     <!DOCTYPE p [
14042     <!NOTATION n PUBLIC "m" "l">
14043     ]><p/>
14044     @@@test:domTree:
14045     document {
14046     document-type {
14047     notation {
14048     node-name: 'n';
14049     public-id: 'm';
14050     system-id: 'l';
14051     }
14052     }
14053     element { }
14054     }
14055     @@XMLTest:
14056     @@@QName: xp.NOTATION.4.test
14057     @@@DEnt:
14058     @@@@test:value:
14059     <!DOCTYPE p [
14060     <!NOTATION n SYSTEM "m">
14061     <!NOTATION n SYSTEM "l">
14062     ]><p/>
14063     @@@c:erred: <[[xp|vc-unique-notation-name]]> { (3, 1)..(3, 24); }
14064     @@@test:domTree:
14065     document {
14066     document-type {
14067     notation {
14068     node-name: 'n';
14069     system-id: 'm';
14070     }
14071     }
14072     element { }
14073     }
14074    
14075     @@XMLTest:
14076     @@@QName: xp.names.1.test
14077     @@@DEnt:
14078     @@@@test:value:
14079     <p xmlns="http://1.example/" a="b"/>
14080     @@@test:domTree:
14081     document {
14082     element {
14083     prefix: null;
14084     local-name: 'p';
14085     namespace-uri: 'http://1.example/';
14086     attribute {
14087     prefix: null;
14088     local-name: 'xmlns';
14089     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14090     specified: true;
14091     }
14092     attribute {
14093     prefix: null;
14094     local-name: 'a';
14095     specified: true;
14096     }
14097     }
14098     }
14099     @@XMLTest:
14100     @@@QName: xp.names.2.test
14101     @@@DEnt:
14102     @@@@test:value:
14103     <p xmlns:a="http://1.example/" a="b" a:a="c"/>
14104     @@@test:domTree:
14105     document {
14106     element {
14107     prefix: null;
14108     local-name: 'p';
14109     namespace-uri: null;
14110     attribute {
14111     prefix: 'xmlns';
14112     local-name: 'a';
14113     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14114     specified: true;
14115     }
14116     attribute {
14117     prefix: null;
14118     local-name: 'a';
14119     specified: true;
14120     }
14121     attribute {
14122     prefix: 'a';
14123     local-name: 'a';
14124     namespace-uri: 'http://1.example/';
14125     specified: true;
14126     }
14127     }
14128     }
14129     @@XMLTest:
14130     @@@QName: xp.names.3.test
14131     @@@DEnt:
14132     @@@@test:value:
14133     <a:p xmlns:a="http://1.example/" a="b" a:a="c"/>
14134     @@@test:domTree:
14135     document {
14136     element {
14137     prefix: 'a';
14138     local-name: 'p';
14139     namespace-uri: 'http://1.example/';
14140     attribute {
14141     prefix: 'xmlns';
14142     local-name: 'a';
14143     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14144     specified: true;
14145     }
14146     attribute {
14147     prefix: null;
14148     local-name: 'a';
14149     specified: true;
14150     }
14151     attribute {
14152     prefix: 'a';
14153     local-name: 'a';
14154     namespace-uri: 'http://1.example/';
14155     specified: true;
14156     }
14157     }
14158     }
14159     @@XMLTest:
14160     @@@QName: xp.names.5.test
14161     @@@DEnt:
14162     @@@@test:value:
14163     <p xmlns:a="http://1.example/">$
14164     <a:q/>$
14165     </p>
14166     @@@test:domTree:
14167     document {
14168     element {
14169     prefix: null;
14170     local-name: 'p';
14171     namespace-uri: null;
14172     attribute {
14173     prefix: 'xmlns';
14174     local-name: 'a';
14175     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14176     specified: true;
14177     }
14178     element {
14179     prefix: 'a';
14180     local-name: 'q';
14181     namespace-uri: 'http://1.example/';
14182     }
14183     }
14184     }
14185     @@XMLTest:
14186     @@@QName: xp.names.6.test
14187     @@@DEnt:
14188     @@@@test:value:
14189     <p xmlns:a="http://1.example/">$
14190     <q a:b="c"/>$
14191     </p>
14192     @@@test:domTree:
14193     document {
14194     element {
14195     prefix: null;
14196     local-name: 'p';
14197     namespace-uri: null;
14198     attribute {
14199     prefix: 'xmlns';
14200     local-name: 'a';
14201     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14202     specified: true;
14203     }
14204     element {
14205     prefix: null;
14206     local-name: 'q';
14207     namespace-uri: null;
14208     attribute {
14209     prefix: 'a';
14210     local-name: 'b';
14211     namespace-uri: 'http://1.example/';
14212     specified: true;
14213     }
14214     }
14215     }
14216     }
14217     @@XMLTest:
14218     @@@QName: xp.names.7.test
14219     @@@DEnt:
14220     @@@@test:value:
14221     <p xmlns:a="http://1.example/">$
14222     <q a:b="c" xmlns:a="http://2.example/"/>$
14223     </p>
14224     @@@test:domTree:
14225     document {
14226     element {
14227     prefix: null;
14228     local-name: 'p';
14229     namespace-uri: null;
14230     attribute {
14231     prefix: 'xmlns';
14232     local-name: 'a';
14233     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14234     specified: true;
14235     }
14236     element {
14237     prefix: null;
14238     local-name: 'q';
14239     namespace-uri: null;
14240     attribute {
14241     prefix: 'a';
14242     local-name: 'b';
14243     namespace-uri: 'http://2.example/';
14244     specified: true;
14245     }
14246     attribute {
14247     prefix: 'xmlns';
14248     local-name: 'a';
14249     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14250     specified: true;
14251     }
14252     }
14253     }
14254     }
14255    
14256     @@XMLTest:
14257     @@@QName: xp.names.undeclare.1.test
14258     @@@DEnt:
14259     @@@@test:value:
14260     <p xmlns="http://1.example/">$
14261     <q xmlns="">$
14262     <r xmlns="http://2.example/"/>$
14263     </q>$
14264     </p>
14265     @@@test:domTree:
14266     document {
14267     element {
14268     prefix: null;
14269     local-name: 'p';
14270     namespace-uri: 'http://1.example/';
14271     attribute {
14272     prefix: null;
14273     local-name: 'xmlns';
14274     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14275     specified: true;
14276     }
14277     element {
14278     prefix: null;
14279     local-name: 'q';
14280     namespace-uri: null;
14281     attribute {
14282     prefix: null;
14283     local-name: 'xmlns';
14284     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14285     specified: true;
14286     }
14287     element {
14288     prefix: null;
14289     local-name: 'r';
14290     namespace-uri: 'http://2.example/';
14291     attribute {
14292     prefix: null;
14293     local-name: 'xmlns';
14294     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14295     specified: true;
14296     }
14297     }
14298     }
14299     }
14300     }
14301    
14302     @@XMLTest:
14303     @@@QName: xp.names.undeclare.1.0.1.test
14304     @@@DEnt:
14305     @@@@test:value:
14306     <?xml version="1.0"?>
14307     <a:p xmlns:a="http://1.example/">$
14308     <q xmlns:a="">$
14309     <a:r xmlns:a="http://2.example/"/>$
14310     </q>$
14311     </a:p>
14312     @@@c:erred: <[[xp|nswf-empty-namespace-name]]> { (2, 34)..(2, 47); }
14313     @@XMLTest:
14314     @@@QName: xp.names.undeclare.1.1.1.test
14315     @@@DEnt:
14316     @@@@test:value:
14317     <?xml version="1.1"?>
14318     <a:p xmlns:a="http://1.example/">$
14319     <q xmlns:a="">$
14320     <a:r xmlns:a="http://2.example/"/>$
14321     </q>$
14322     </a:p>
14323     @@@test:domTree:
14324     document {
14325     element {
14326     prefix: 'a';
14327     local-name: 'p';
14328     namespace-uri: 'http://1.example/';
14329     attribute {
14330     prefix: 'xmlns';
14331     local-name: 'a';
14332     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14333     specified: true;
14334     }
14335     element {
14336     prefix: null;
14337     local-name: 'q';
14338     namespace-uri: null;
14339     attribute {
14340     prefix: 'xmlns';
14341     local-name: 'a';
14342     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14343     specified: true;
14344     }
14345     element {
14346     prefix: 'a';
14347     local-name: 'r';
14348     namespace-uri: 'http://2.example/';
14349     attribute {
14350     prefix: 'xmlns';
14351     local-name: 'a';
14352     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14353     specified: true;
14354     }
14355     }
14356     }
14357     }
14358     }
14359     @@XMLTest:
14360     @@@QName: xp.names.undeclare.1.1.2.test
14361     @@@DEnt:
14362     @@@@test:value:
14363     <?xml version="1.1"?>
14364     <a:p xmlns:a="http://1.example/">$
14365     <q xmlns:a="">$
14366     <a:r/>$
14367     </q>$
14368     </a:p>
14369     @@@c:erred: <[[xp|nsc-prefix-declared]]> { (2, 48)..(2, 53); }
14370    
14371     @@XMLTest:
14372     @@@QName: xp.names.xml.prefix.1.test
14373     @@@DEnt:
14374     @@@@test:value:
14375     <a xmlns:xml="http://www.w3.org/XML/1998/namespace"/>
14376     @@@test:domTree:
14377     document {
14378     element {
14379     attribute {
14380     prefix: 'xmlns';
14381     local-name: 'xml';
14382     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14383     }
14384     }
14385     }
14386     @@XMLTest:
14387     @@@QName: xp.names.xml.prefix.2.test
14388     @@@DEnt:
14389     @@@@test:value:
14390     <a xmlns:xml="a"/>
14391     @@@c:erred: <[[xp|nsc-reserved-prefix-xml]]> { (1, 1)..(1, 18); }
14392     @@XMLTest:
14393     @@@QName: xp.names.xml.prefix.3.test
14394     @@@DEnt:
14395     @@@@test:value:
14396     <a xmlns:a="http://www.w3.org/XML/1998/namespace"
14397     />
14398     @@@c:erred: <[[xp|nsc-reserved-namespace-name-xml]]> { (1, 1)..(2, 2); }
14399     @@XMLTest:
14400     @@@QName: xp.names.xml.prefix.4.test
14401     @@@DEnt:
14402     @@@@test:value:
14403     <a xml:lang="ja"/>
14404     @@@test:domTree:
14405     document {
14406     element {
14407     attribute {
14408     prefix: 'xml';
14409     local-name: 'lang';
14410     namespace-uri: 'http://www.w3.org/XML/1998/namespace';
14411     }
14412     }
14413     }
14414    
14415     @@XMLTest:
14416     @@@QName: xp.names.prefix.declared.1.test
14417     @@@DEnt:
14418     @@@@test:value:
14419     <!DOCTYPE a [
14420     <!ATTLIST a
14421     b:c CDATA "d"
14422     >
14423     ]>
14424     <a/>
14425     @@@c:erred: <[[xp|nsc-prefix-declared]]> { (6, 1)..(6, 4); }
14426    
14427     @@XMLTest:
14428     @@@QName: xp.names.xmlns.reserved.1.test
14429     @@@DEnt:
14430     @@@@test:value:
14431     <a xmlns:xmlns="http://www.w3.org/2000/xmlns/"
14432     />
14433     @@@c:erred: <[[xp|nsc-reserved-prefix-xmlns]]> { (1, 1)..(2, 2); }
14434     @@@c:erred: <[[xp|nsc-reserved-namespace-name-xmlns]]> { (1, 1)..(2, 2); }
14435     @@XMLTest:
14436     @@@QName: xp.names.xmlns.reserved.2.test
14437     @@@DEnt:
14438     @@@@test:value:
14439     <a xmlns:xmlns="a"
14440     />
14441     @@@c:erred: <[[xp|nsc-reserved-prefix-xmlns]]> { (1, 1)..(2, 2); }
14442     @@XMLTest:
14443     @@@QName: xp.names.xmlns.reserved.3.test
14444     @@@DEnt:
14445     @@@@test:value:
14446     <a xmlns:a="http://www.w3.org/2000/xmlns/"
14447     />
14448     @@@c:erred: <[[xp|nsc-reserved-namespace-name-xmlns]]> { (1, 1)..(2, 2); }
14449    
14450     @@XMLTest:
14451     @@@QName: xp.names.default.1.test
14452     @@@DEnt:
14453     @@@@test:value:
14454     <!DOCTYPE a [
14455     <!ATTLIST a
14456     xmlns CDATA "http://1.example/">
14457     ]>
14458     <a/>
14459     @@@test:domTree:
14460     document {
14461     document-type {
14462     element-type-definition {
14463     node-name: 'a';
14464     attribute-definition {
14465     node-name: 'xmlns';
14466     node-value: 'http://1.example/';
14467     }
14468     }
14469     }
14470     element {
14471     prefix: null;
14472     local-name: 'a';
14473     namespace-uri: 'http://1.example/';
14474     attribute {
14475     prefix: null;
14476     local-name: 'xmlns';
14477     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14478     value: 'http://1.example/';
14479     specified: false;
14480     }
14481     }
14482     }
14483     @@XMLTest:
14484     @@@QName: xp.names.default.2.test
14485     @@@DEnt:
14486     @@@@test:value:
14487     <!DOCTYPE a [
14488     <!ATTLIST a
14489     xmlns CDATA "http://1.example/">
14490     ]>
14491     <a xmlns="http://2.example/"/>
14492     @@@test:domTree:
14493     document {
14494     document-type {
14495     element-type-definition {
14496     node-name: 'a';
14497     attribute-definition {
14498     node-name: 'xmlns';
14499     node-value: 'http://1.example/';
14500     }
14501     }
14502     }
14503     element {
14504     prefix: null;
14505     local-name: 'a';
14506     namespace-uri: 'http://2.example/';
14507     attribute {
14508     prefix: null;
14509     local-name: 'xmlns';
14510     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14511     value: 'http://2.example/';
14512     specified: true;
14513     }
14514     }
14515     }
14516     @@XMLTest:
14517     @@@QName: xp.names.default.3.test
14518     @@@DEnt:
14519     @@@@test:value:
14520     <!DOCTYPE b:a [
14521     <!ATTLIST b:a
14522     xmlns:b CDATA "http://1.example/">
14523     ]>
14524     <b:a/>
14525     @@@test:domTree:
14526     document {
14527     document-type {
14528     element-type-definition {
14529     node-name: 'b:a';
14530     attribute-definition {
14531     node-name: 'xmlns:b';
14532     node-value: 'http://1.example/';
14533     }
14534     }
14535     }
14536     element {
14537     prefix: 'b';
14538     local-name: 'a';
14539     namespace-uri: 'http://1.example/';
14540     attribute {
14541     prefix: 'xmlns';
14542     local-name: 'b';
14543     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14544     value: 'http://1.example/';
14545     specified: false;
14546     }
14547     }
14548     }
14549     @@XMLTest:
14550     @@@QName: xp.names.default.4.test
14551     @@@DEnt:
14552     @@@@test:value:
14553     <!DOCTYPE b:a [
14554     <!ATTLIST b:a
14555     xmlns:b CDATA "http://1.example/">
14556     ]>
14557     <b:a xmlns:b="http://2.example/"/>
14558     @@@test:domTree:
14559     document {
14560     document-type {
14561     element-type-definition {
14562     node-name: 'b:a';
14563     attribute-definition {
14564     node-name: 'xmlns:b';
14565     node-value: 'http://1.example/';
14566     }
14567     }
14568     }
14569     element {
14570     prefix: 'b';
14571     local-name: 'a';
14572     namespace-uri: 'http://2.example/';
14573     attribute {
14574     prefix: 'xmlns';
14575     local-name: 'b';
14576     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14577     value: 'http://2.example/';
14578     specified: true;
14579     }
14580     }
14581     }
14582     @@XMLTest:
14583     @@@QName: xp.names.default.5.test
14584     @@@DEnt:
14585     @@@@test:value:
14586     <!DOCTYPE a [
14587     <!ATTLIST a
14588     xmlns:b CDATA "http://1.example/"
14589     b:c CDATA "http://1.example/">
14590     ]>
14591     <a xmlns:b="http://2.example/"/>
14592     @@@test:domTree:
14593     document {
14594     document-type {
14595     element-type-definition {
14596     node-name: 'a';
14597     attribute-definition {
14598     node-name: 'xmlns:b';
14599     text-content: 'http://1.example/';
14600     }
14601     attribute-definition {
14602     node-name: 'b:c';
14603     text-content: 'http://1.example/';
14604     }
14605     }
14606     }
14607     element {
14608     prefix: null;
14609     local-name: 'a';
14610     namespace-uri: null;
14611     attribute {
14612     prefix: 'xmlns';
14613     local-name: 'b';
14614     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14615     value: 'http://2.example/';
14616     specified: true;
14617     }
14618     attribute {
14619     prefix: 'b';
14620     local-name: 'c';
14621     namespace-uri: 'http://2.example/';
14622     specified: false;
14623     }
14624     }
14625     }
14626    
14627     @@XMLTest:
14628     @@@QName: xp.names.unique.1.test
14629     @@@DEnt:
14630     @@@@test:value:
14631     <a
14632     xmlns:b="http://2.example/"
14633     xmlns:c="http://2.example/"
14634     b:d=""
14635     c:d=""
14636     />
14637     @@@c:erred: <[[xp|nswf-unique-att-spec-expanded-name]]> { (1, 1)..(6, 2); }
14638     @@XMLTest:
14639     @@@QName: xp.names.unique.2.test
14640     @@@DEnt:
14641     @@@@test:value:
14642     <!DOCTYPE a [
14643     <!ATTLIST a
14644     c:d CDATA ""
14645     >
14646     ]>
14647     <a
14648     xmlns:b="http://2.example/"
14649     xmlns:c="http://2.example/"
14650     b:d=""
14651     />
14652     @@@c:erred: <[[xp|nswf-unique-att-spec-expanded-name]]> { (6, 1)..(10, 2);}
14653     @@XMLTest:
14654     @@@QName: xp.names.unique.3.test
14655     @@@DEnt:
14656     @@@@test:value:
14657     <!DOCTYPE a [
14658     <!ATTLIST a
14659     c:d CDATA "value1"
14660     >
14661     ]>
14662     <a
14663     xmlns:c="http://2.example/"
14664     c:d="value2"
14665     />
14666     @@@test:domTree:
14667     document {
14668     document-type { }
14669     element {
14670     attribute {
14671     prefix: 'xmlns';
14672     local-name: 'c';
14673     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14674     specified: true;
14675     }
14676     attribute {
14677     prefix: 'c';
14678     local-name: 'd';
14679     namespace-uri: 'http://2.example/';
14680     value: 'value2';
14681     specified: true;
14682     }
14683     }
14684     }
14685    
14686     @@XMLTest:
14687     @@@QName: xp.names.normalize.1.test
14688     @@@DEnt:
14689     @@@@test:value:
14690     <!DOCTYPE a [
14691     <!ATTLIST a
14692     xmlns NMTOKEN #IMPLIED
14693     >
14694     ]>
14695     <a xmlns=" "/>
14696     @@@test:domTree:
14697     document {
14698     document-type { }
14699     element {
14700     namespace-uri: null;
14701     prefix: null;
14702     local-name: 'a';
14703     }
14704     }
14705     @@XMLTest:
14706     @@@QName: xp.names.normalize.2.test
14707     @@@DEnt:
14708     @@@@test:value:
14709     <!DOCTYPE a [
14710     <!ATTLIST a
14711     xmlns NMTOKEN #IMPLIED
14712     >
14713     ]>
14714     <a xmlns=" about:blank "/>
14715     @@@test:domTree:
14716     document {
14717     document-type { }
14718     element {
14719     namespace-uri: 'about:blank';
14720     prefix: null;
14721     local-name: 'a';
14722     }
14723     }
14724     @@XMLTest:
14725     @@@QName: xp.names.normalize.3.test
14726     @@@DEnt:
14727     @@@@test:value:
14728     <!DOCTYPE a:a [
14729     <!ATTLIST a:a
14730     xmlns:a NMTOKEN #IMPLIED
14731     >
14732     ]>
14733     <a:a xmlns:a=" about:blank "/>
14734     @@@test:domTree:
14735     document {
14736     document-type { }
14737     element {
14738     namespace-uri: 'about:blank';
14739     prefix: 'a';
14740     local-name: 'a';
14741     }
14742     }
14743    
14744 wakaba 1.29 @@XMLTest:
14745     @@@QName: xp.no.baseuri.test
14746     @@@DEnt:
14747     @@@@test:value:
14748     <p/>
14749     @@@test:domTree:
14750     document {
14751     document-uri: null;
14752     base-uri: null;
14753     element {
14754     node-name: 'p';
14755     base-uri: null;
14756     }
14757     }
14758     @@XMLTest:
14759     @@@QName: xp.docuri.no.baseuri.test
14760     @@@DEnt:
14761     @@@@test:uri:
14762     http://www.example.com/
14763     @@@@test:value:
14764     <p/>
14765     @@@test:domTree:
14766     document {
14767     document-uri: 'http://www.example.com/';
14768     base-uri: 'http://www.example.com/';
14769     element {
14770     node-name: 'p';
14771     base-uri: 'http://www.example.com/';
14772     }
14773     }
14774     @@XMLTest:
14775     @@@QName: xp.docuri.baseuri.test
14776     @@@DEnt:
14777     @@@@test:uri:
14778     http://www.example.com/
14779     @@@@test:baseURI:
14780     ftp://ftp.example.com/
14781     @@@@test:value:
14782     <p/>
14783     @@@test:domTree:
14784     document {
14785     document-uri: 'http://www.example.com/';
14786     base-uri: 'ftp://ftp.example.com/';
14787     element {
14788     node-name: 'p';
14789     base-uri: 'ftp://ftp.example.com/';
14790     }
14791     }
14792     @@XMLTest:
14793     @@@QName: xp.doctype.baseuri.test
14794     @@@DEnt:
14795     @@@@test:uri:
14796     http://www.example.com/
14797     @@@@test:baseURI:
14798     ftp://ftp.example.com/
14799     @@@@test:value:
14800     <!DOCTYPE p SYSTEM "sys">
14801     <p/>
14802     @@@test:domTree:
14803     document {
14804     document-uri: 'http://www.example.com/';
14805     base-uri: 'ftp://ftp.example.com/';
14806     document-type {
14807     system-id: 'sys';
14808     manakai-declaration-base-uri: 'ftp://ftp.example.com/';
14809     }
14810     element {
14811     node-name: 'p';
14812     base-uri: 'ftp://ftp.example.com/';
14813     }
14814     }
14815     @@XMLTest:
14816     @@@QName: xp.entdecl.baseuri.test
14817     @@@DEnt:
14818     @@@@test:uri:
14819     http://www.example.com/
14820     @@@@test:baseURI:
14821     ftp://ftp.example.com/
14822     @@@@test:value:
14823     <!DOCTYPE p [
14824     <!ENTITY ent SYSTEM "ent">
14825     ]>
14826     <p/>
14827     @@@test:domTree:
14828     document {
14829     document-uri: 'http://www.example.com/';
14830     base-uri: 'ftp://ftp.example.com/';
14831     document-type {
14832     general-entity {
14833     node-name: 'ent';
14834     manakai-declaration-base-uri: 'ftp://ftp.example.com/';
14835     }
14836     }
14837     element {
14838     node-name: 'p';
14839     base-uri: 'ftp://ftp.example.com/';
14840     }
14841     }
14842     @@XMLTest:
14843     @@@QName: xp.notdecl.baseuri.test
14844     @@@DEnt:
14845     @@@@test:uri:
14846     http://www.example.com/
14847     @@@@test:baseURI:
14848     ftp://ftp.example.com/
14849     @@@@test:value:
14850     <!DOCTYPE p [
14851     <!NOTATION not SYSTEM "not">
14852     ]>
14853     <p/>
14854     @@@test:domTree:
14855     document {
14856     document-uri: 'http://www.example.com/';
14857     base-uri: 'ftp://ftp.example.com/';
14858     document-type {
14859     notation {
14860     node-name: 'not';
14861     manakai-declaration-base-uri: 'ftp://ftp.example.com/';
14862     }
14863     }
14864     element {
14865     node-name: 'p';
14866     base-uri: 'ftp://ftp.example.com/';
14867     }
14868     }
14869     @@XMLTest:
14870     @@@QName: xp.doctype.intsubset.pi.baseuri.test
14871     @@@DEnt:
14872     @@@@test:uri:
14873     http://www.example.com/
14874     @@@@test:baseURI:
14875     ftp://ftp.example.com/
14876     @@@@test:value:
14877     <!DOCTYPE p [
14878     <?pi?>
14879     ]>
14880     <p/>
14881     @@@test:domTree:
14882     document {
14883     document-uri: 'http://www.example.com/';
14884     base-uri: 'ftp://ftp.example.com/';
14885     document-type {
14886     pi {
14887     node-name: 'pi';
14888     base-uri: 'ftp://ftp.example.com/';
14889     }
14890     }
14891     element {
14892     node-name: 'p';
14893     base-uri: 'ftp://ftp.example.com/';
14894     }
14895     }
14896    
14897 wakaba 1.30 @@XMLTest:
14898     @@@QName: xp.xmlid.attr.test
14899     @@@DEnt:
14900     @@@@test:value:
14901     <p xml:id="idv"/>
14902     @@@test:domTree:
14903     document {
14904     element {
14905     attribute {
14906     node-name: 'xml:id';
14907     value: 'idv';
14908     schema-type-info: TypeInfo ('http://www.w3.org/TR/REC-xml',
14909     'ID');
14910     specified: true;
14911     }
14912     }
14913     }
14914     @@XMLTest:
14915     @@@QName: xp.xmlid.attr.norm.test
14916     @@@DEnt:
14917     @@@@test:value:
14918     <p xml:id=" $u000Aidv "/>
14919     @@@test:domTree:
14920     document {
14921     element {
14922     attribute {
14923     node-name: 'xml:id';
14924     value: 'idv';
14925     schema-type-info: TypeInfo ('http://www.w3.org/TR/REC-xml',
14926     'ID');
14927     specified: true;
14928     }
14929     }
14930     }
14931     @@XMLTest:
14932     @@@QName: xp.xmlid.attrdef.test
14933     @@@DEnt:
14934     @@@@test:value:
14935     <!DOCTYPE p [
14936     <!ATTLIST p xml:id ID #IMPLIED>
14937     ]>
14938     <p/>
14939     @@@test:domTree:
14940     document {
14941     document-type {
14942     element-type-definition {
14943     node-name: 'p';
14944     attribute-definition {
14945     node-name: 'xml:id';
14946     declared-type: const (ID_ATTR);
14947     default-type: const (IMPLIED_DEFAULT);
14948     }
14949     }
14950     }
14951     element { }
14952     }
14953     @@XMLTest:
14954     @@@QName: xp.xmlid.attrdef.defaultattr.test
14955     @@@DEnt:
14956     @@@@test:value:
14957     <!DOCTYPE p [
14958     <!ATTLIST p xml:id ID "idv"><!-- invalid -->
14959     ]>
14960     <p/>
14961     @@@test:domTree:
14962     document {
14963     document-type {
14964     element-type-definition {
14965     node-name: 'p';
14966     attribute-definition {
14967     node-name: 'xml:id';
14968     declared-type: const (ID_ATTR);
14969     default-type: const (EXPLICIT_DEFAULT);
14970     node-value: 'idv';
14971     }
14972     }
14973     }
14974     element {
14975     attribute {
14976     node-name: 'xml:id';
14977     schema-type-info: TypeInfo ('http://www.w3.org/TR/REC-xml',
14978     'ID');
14979     value: 'idv';
14980     specified: false;
14981     }
14982     }
14983     }
14984    
14985 wakaba 1.26 @@PerlDef:
14986     my $impl = $Message::DOM::ImplementationRegistry->get_implementation ({
14987     'Core' => '3.0',
14988     'XML' => '3.0',
14989     'XMLVersion' => ['1.0', '1.1'],
14990     });
14991     my $parser = <Class::ManakaiXMLParser>->new ($impl);
14992    
14993     for my $test_data (@$TestData) {
14994     $test->start_new_test ($test_data->{uri});
14995     my $doc_ent = $test_data->{entity}->{$test_data->{root_uri}};
14996     my $not_ok;
14997    
14998     $parser->dom_config->set_parameter ('error-handler' => sub ($$) {
14999     my (undef, $err) = @_;
15000     my $err_type = $err->type;
15001     if ($test_data->{dom_error}->{$err_type}) {
15002     $test->assert_error_equals
15003     (actual_value => $err,
15004     expected_hash => shift @{$test_data->{dom_error}
15005     ->{$err_type}});
15006     } else { # Uncatched error
15007     warn $err;
15008     unless ($err->severity == <C::c|DOMError.SEVERITY_WARNING>) {
15009     $test->failure_comment ('Unexpected error |'.$err->type.'|');
15010     $not_ok = true;
15011     }
15012     }
15013     return true; # continue as far as possible
15014     });
15015    
15016 wakaba 1.27 my $input = {string_data => \$doc_ent->{<Q::test:value>},
15017     system_id => $doc_ent->{<Q::test:uri>},
15018     base_uri => $doc_ent->{<Q::test:baseURI>}};
15019 wakaba 1.26 if ($test_data->{dom_tree}) { # Successful test
15020     try {
15021 wakaba 1.27 my $doc = $parser->parse ($input);
15022 wakaba 1.26 $test->assert_dom_tree_equals
15023     (actual_value => $doc,
15024     expected_hash => $test_data->{dom_tree});
15025     for (values %{$test_data->{dom_error}||{}}) {
15026     if (@$_) {
15027     $test->failure_comment
15028     (@$_.' |DOMError|s of type |'.
15029     $_->[0]->{type}->{value}.'| are not reported');
15030     $not_ok = true;
15031     }
15032     }
15033     $not_ok ? $test->not_ok : $test->ok;
15034     } catch Message::Util::IF::DTException with {
15035     #
15036     } catch Message::DOM::IF::LSException with {
15037     # not_ok
15038     } otherwise {
15039     my $err = shift;
15040     warn $err;
15041     $test->not_ok;
15042     };
15043     } else {
15044     try {
15045 wakaba 1.27 my $doc = $parser->parse ($input);
15046 wakaba 1.26 } catch Message::Util::IF::DTException with {
15047     #
15048     } catch Message::DOM::IF::LSException with {
15049     #
15050     } otherwise {
15051     my $err = shift;
15052     warn $err;
15053     $test->not_ok;
15054     };
15055     for (values %{$test_data->{dom_error}||{}}) {
15056     if (@$_) {
15057     $test->failure_comment
15058     (@$_.' |DOMError|s of type |'.
15059     $_->[0]->{type}->{value}.'| are not reported');
15060     $not_ok = true;
15061     }
15062     }
15063     $not_ok ? $test->not_ok : $test->ok;
15064 wakaba 1.12 }
15065 wakaba 1.5 }
15066 wakaba 1.6
15067     @ResourceDef:
15068 wakaba 1.19 @@QName: getEmptyEntityState
15069     @@rdf:type: DISPerl|InlineCode
15070     @@ForCheck: ManakaiDOM|ForClass
15071     @@PerlDef:
15072     {reptxt => \'', line => 1, column => 1, pos => 0,
15073 wakaba 1.27 is_externally_declared => true, name => $name,
15074     fh => do {
15075     open my $empty, '<', \'';
15076     $empty;
15077     },
15078     close_file => sub { }}
15079 wakaba 1.19
15080     @ResourceDef:
15081 wakaba 1.6 @@QName: getCopyOfEntityState
15082     @@rdf:type: DISPerl|InlineCode
15083     @@ForCheck: ManakaiDOM|ForClass
15084     @@PerlDef:
15085     {%{$self->{$entity_type}->{$entity_name}},
15086 wakaba 1.27 line => 1, column => 1, pos => 0,
15087     fh => do {
15088     require IO::String;
15089     IO::String->new
15090     (${$self->{$entity_type}->{$entity_name}->{reptxt}});
15091     ## TODO: External entities.
15092     },
15093     close_file => sub { }}
15094 wakaba 1.1 ##ManakaiXMLParser
15095 wakaba 1.5
15096     ElementTypeBinding:
15097 wakaba 1.27 @Name: Test
15098     @ElementType:
15099     dis:ResourceDef
15100     @ShadowContent:
15101     @@ForCheck: ManakaiDOM|ForClass
15102     @@rdf:type: test|StandaloneTest
15103    
15104     ElementTypeBinding:
15105 wakaba 1.5 @Name: XMLTests
15106     @ElementType:
15107     dis:ResourceDef
15108     @ShadowContent:
15109     @@ForCheck: ManakaiDOM|ForClass
15110     @@rdf:type: test|ParserTestSet
15111    
15112     ElementTypeBinding:
15113     @Name: XMLTest
15114     @ElementType:
15115     dis:ResourceDef
15116     @ShadowContent:
15117     @@ForCheck: ManakaiDOM|ForClass
15118     @@rdf:type: test|ParserTest
15119    
15120     ElementTypeBinding:
15121     @Name: DEnt
15122     @ElementType:
15123     dis:ResourceDef
15124     @ShadowContent:
15125     @@rdf:type: test|RootEntity
15126    
15127     ElementTypeBinding:
15128     @Name: Ent
15129     @ElementType:
15130     dis:ResourceDef
15131     @ShadowContent:
15132     @@rdf:type: test|Entity
15133 wakaba 1.1
15134 wakaba 1.3 ResourceDef:
15135     @QName: xp|get-location-from-token
15136     @rdf:type: DISPerl|BlockCode
15137     @enDesc:
15138     Creates a <IF::DOMCore:DOMLocator> object from a token.
15139     @PerlDef:
15140 wakaba 1.14 my $__d = $token->{type} ne '#EOF'
15141     ? $token->{location}->{char_d}
15142     : 0;
15143 wakaba 1.15 $__d -= $token->{location_d} if $token->{location_d};
15144 wakaba 1.3 $result = {
15145 wakaba 1.14 utf32_offset => $token->{location}->{pos} - $__d,
15146     line_number => $token->{location}->{line},
15147     column_number => $token->{location}->{column} - $__d,
15148 wakaba 1.3 };
15149 wakaba 1.14 $result->{utf32_offset} = 0 if $result->{utf32_offset} < 0;
15150     $result->{column_number} = 0 if $result->{column_number} < 0;
15151     ## 0 or 1, which should be?
15152 wakaba 1.3 @For: ManakaiDOM|ManakaiDOM3
15153 wakaba 1.1
15154     ElementTypeBinding:
15155     @Name: RuleDef
15156     @ElementType:
15157     dis:ResourceDef
15158     @ShadowContent:
15159     @@ForCheck: ManakaiDOM|ForClass
15160     @@rdf:type: Muf2003|RuleDefClass
15161    
15162     ElementTypeBinding:
15163     @Name: RuleParam
15164     @ElementType:
15165     dis:ResourceDef
15166     @ShadowContent:
15167     @@rdf:type: Muf2003|RuleParameter
15168    
15169     ElementTypeBinding:
15170     @Name: enImplNote
15171     @ElementType:
15172     dis:ImplNote
15173     @ShadowContent:
15174     @@lang:en
15175    
15176     ElementTypeBinding:
15177 wakaba 1.24 @Name: WFErrDef
15178 wakaba 1.1 @ElementType:
15179     dis:ResourceDef
15180     @ShadowContent:
15181     @@rdf:type: DOMCore|DOMErrorType
15182     @@For: ManakaiDOM|DOM3
15183     @@ecore:textFormatter: ManakaiXMLParserExceptionFormatter
15184 wakaba 1.24 @@c:severity: c|SEVERITY_FATAL_ERROR
15185 wakaba 1.1
15186 wakaba 1.3 ElementTypeBinding:
15187 wakaba 1.24 @Name: FatalErrDef
15188 wakaba 1.3 @ElementType:
15189     dis:ResourceDef
15190     @ShadowContent:
15191     @@rdf:type: DOMCore|DOMErrorType
15192     @@For: ManakaiDOM|DOM3
15193     @@ecore:textFormatter: ManakaiXMLParserExceptionFormatter
15194 wakaba 1.24 @@c:severity: c|SEVERITY_FATAL_ERROR
15195    
15196     ElementTypeBinding:
15197 wakaba 1.26 @Name: NSFatalErrDef
15198     @ElementType:
15199     dis:ResourceDef
15200     @ShadowContent:
15201     @@rdf:type: c|DOMErrorType
15202     @@For: ManakaiDOM|DOM3
15203     @@ecore:textFormatter: ManakaiXMLParserExceptionFormatter
15204     @@c:severity: c|SEVERITY_FATAL_ERROR
15205    
15206     ElementTypeBinding:
15207     @Name: NSCErrDef
15208     @ElementType:
15209     dis:ResourceDef
15210     @ShadowContent:
15211     @@rdf:type: c|DOMErrorType
15212     @@For: ManakaiDOM|DOM3
15213     @@ecore:textFormatter: ManakaiXMLParserExceptionFormatter
15214     @@c:severity: c|SEVERITY_FATAL_ERROR
15215    
15216     ElementTypeBinding:
15217 wakaba 1.24 @Name: VCErrDef
15218     @ElementType:
15219     dis:ResourceDef
15220     @ShadowContent:
15221     @@rdf:type: c|DOMErrorType
15222     @@For: ManakaiDOM|DOM3
15223     @@ecore:textFormatter: ManakaiXMLParserExceptionFormatter
15224     @@c:severity: c|SEVERITY_ERROR
15225    
15226     ElementTypeBinding:
15227     @Name: ErrDef
15228     @ElementType:
15229     dis:ResourceDef
15230     @ShadowContent:
15231     @@rdf:type: c|DOMErrorType
15232     @@For: ManakaiDOM|DOM3
15233     @@ecore:textFormatter: ManakaiXMLParserExceptionFormatter
15234     @@c:severity: c|SEVERITY_ERROR
15235 wakaba 1.3
15236 wakaba 1.16 ElementTypeBinding:
15237 wakaba 1.24 @Name: WarnDef
15238 wakaba 1.16 @ElementType:
15239     dis:ResourceDef
15240     @ShadowContent:
15241 wakaba 1.24 @@rdf:type: c|DOMErrorType
15242 wakaba 1.16 @@For: ManakaiDOM|DOM3
15243     @@ecore:textFormatter: ManakaiXMLParserExceptionFormatter
15244 wakaba 1.24 @@c:severity: c|SEVERITY_WARNING
15245 wakaba 1.16
15246 wakaba 1.3 WFErrDef:
15247     @QName: xp|wf-syntax-error
15248     @enDesc:
15249     The entity does not match to the production rule; it is not
15250     well-formed.
15251     @enMufDef:
15252     |%xp-error-token-type;|%xp-error-token-value
15253     (prefix => { (|}, suffix => {|)}); is not
15254     allowed%xp-error-lines (prefix => { (|}, suffix => {|)});
15255     @ecore:hasParameter:
15256     @@@: xp|error-token
15257     @@enDesc:
15258     The token that is not allowed.
15259    
15260     WFErrDef:
15261     @QName: xp|wf-pi-target-is-xml
15262     @enDesc:
15263     A processing instruction has its <CODE::PITarget> of
15264     <XML::xml> (in any case) which is not allowed.
15265     @enMufDef:
15266     Processing instruction target name cannot be |%p
15267     (name => {<Q::xp|name>});|
15268     @ecore:hasParameter:
15269     @@@: xp|error-token
15270     @@enDesc:
15271     The token that contains the name.
15272     @ecore:hasParameter:
15273     @@@: xp|name
15274     @@enDesc:
15275     A string that is specified as target name of the
15276     processing instruction.
15277     @ecore:hasParameter: xp|parent
15278    
15279     WFErrDef:
15280     @QName: xp|wf-no-end-tag
15281     @enDesc:
15282     An end-tag is not found.
15283     @enMufDef:
15284     End-tag |</%p (name => {<Q::xp|expected-element-type>});>| is required
15285     @ecore:hasParameter: xp|error-token
15286     @ecore:hasParameter:
15287     @@@: xp|node
15288     @@enDesc:
15289     The element node that is not closed.
15290     @ecore:hasParameter:
15291     @@@: xp|expected-element-type
15292     @@enDesc:
15293     The element type name of the element that is not closed.
15294    
15295     WFErrDef:
15296     @QName: xp|wf-unsupported-xml-version
15297     @enDesc:
15298     The XML version specified in the version declaration is not supported.
15299     @enMufDef:
15300     XML version |%p (name => {<Q::infoset|version>});| is not supported
15301     @ecore:hasParameter: xp|bad-token
15302     @ecore:hasParameter:
15303     @@@: xp|parent
15304     @@enDesc:
15305     The document node.
15306     @ecore:hasParameter:
15307     @@@: infoset|version
15308     @@enDesc:
15309     The specified XML version.
15310    
15311     WFErrDef:
15312     @QName: xp|wf-malformed-enc-name
15313     @enDesc:
15314     An <XA::encoding> pseudo-attribute value does not match
15315     to the procduction rule <CODE::EncName>.
15316     @enMufDef:
15317     Encoding name |%p (name => {<Q::xp|name>});| is not allowed
15318     @ecore:hasParameter: xp|error-token
15319     @ecore:hasParameter:
15320     @@@: xp|parent
15321     @@enDesc: The document node.
15322     @ecore:hasParameter:
15323     @@@: xp|name
15324     @@enDesc:
15325     The <XA::encoding> value.
15326    
15327     WFErrDef:
15328     @QName: xp|wf-malformed-xml-standalone
15329     @enDesc:
15330     An <XA::standalone> pseudo-attribute value is neither <XML::yes>
15331     or <XML::no>.
15332     @enMufDef:
15333     |standalone| pseudo-attribute value |%p (name => {<Q::xp|name>});|
15334     is not allowed
15335     @ecore:hasParameter: xp|error-token
15336     @ecore:hasParameter:
15337     @@@: xp|parent
15338     @@enDesc: The document node.
15339     @ecore:hasParameter:
15340     @@@: xp|name
15341     @@enDesc:
15342     The <XA::standalone> value.
15343    
15344     WFErrDef:
15345     @QName: xp|wf-legal-literal-character
15346     @enDesc:
15347     Each character in XML entity must match to the production
15348     rule <CODE::Char - RestrictedChar>.
15349     @enMufDef:
15350     Character %character-code-point
15351     (v => {<Q::xp|character-number>}); is not allowed
15352     @ecore:hasParameter:
15353     @@@: xp|character-number
15354     @@enDesc:
15355     The code position of the character being referred.
15356    
15357     WFErrDef:
15358 wakaba 1.26 @QName: xp|wf-invalid-character-in-node-name
15359     @c:errorType:
15360     @@@: wf-invalid-character-in-node-name
15361     @@ContentType: DISCore|String
15362     @enDesc:
15363     If a name contains a character that is not a name character
15364     in the XML version in use, or if the first character of a name
15365     is not a name start character in the XML version in use.
15366    
15367     {NOTE::
15368     When an invalid character is encountered in an entity
15369     where a <CODE::Name> is expected, what type of error
15370     is issued is implementation dependent: <Q::xp|wf-syntax-error>,
15371     <Q::xp|wf-pi-target-is-xml> or other error might be reported.
15372     }
15373    
15374     {NOTE::
15375     This error type is defined in DOM Level 3 Core and Load and Save
15376     modules and redefined herein for the purpose of XML parser.
15377     }
15378     @enMufDef:
15379     Character %character-code-point
15380     (v => {<Q::xp|character-number>}); is not allowed in name
15381     @ecore:hasParameter: xp|error-token
15382     @ecore:hasParameter:
15383     @@@: xp|character-number
15384     @@enDesc:
15385     The code position of the character being referred.
15386     @ecore:hasParameter:
15387     @@@: infoset|version
15388     @@enDesc:
15389     The version of XML in use.
15390    
15391     WFErrDef:
15392 wakaba 1.25 @QName: xp|wf-pes-in-internal-subset
15393     @enDesc:
15394     In the internal subset of the DTD, parameter entity references
15395     <kwd:MUST-NOT> occur within markup declarations.
15396     @enMufDef:
15397     Parameter entity reference |%percent;%param (name => {<Q::xp|name>});;|
15398     cannot occur within a markup declaration
15399     @ecore:hasParameter: xp|error-token
15400     @ecore:hasParameter:
15401     @@@: xp|name
15402     @@enDesc:
15403     The name of the parameter entity.
15404    
15405     WFErrDef:
15406 wakaba 1.3 @QName: xp|wf-element-type-match
15407 wakaba 1.1 @enDesc:
15408 wakaba 1.3 The <CODE::Name> in an element's end-tag must match the element type
15409     in the start-tag.
15410     @enMufDef:
15411     End-tag |</%p (name => {<Q::xp|actual-element-type>});>| does
15412     not match to start-tag |<%p (name => {<Q::xp|expected-element-type>});>|
15413     @ecore:hasParameter: xp|error-token
15414     @ecore:hasParameter:
15415     @@@: xp|node
15416     @@enDesc:
15417     The current opening element node.
15418     @ecore:hasParameter:
15419     @@@: xp|expected-element-type
15420     @@enDesc:
15421     The element type name of the current element.
15422     @ecore:hasParameter:
15423     @@@: xp|actual-element-type
15424     @@enDesc:
15425     The <CODE::Name> occurs in the end-tag.
15426    
15427     WFErrDef:
15428     @QName: xp|wf-unique-att-spec
15429     @enDesc:
15430     An attribute name <kwd:MUST-NOT> appear more than once in
15431     the same start-tag or empty-element tag.
15432 wakaba 1.1 @enMufDef:
15433 wakaba 1.3 Attribute |%p (name => {<Q::xp|name>});| is specified more
15434     than once in the same tag
15435     @ecore:hasParameter: xp|error-token
15436     @ecore:hasParameter:
15437     @@@: xp|name
15438     @@enDesc:
15439     The name of the attribute.
15440 wakaba 1.18
15441     WFErrDef:
15442     @QName: xp|wf-no-external-entity-references
15443     @enDesc:
15444     Attribute values <kwd:MUST-NOT> contain direct or indirect
15445     entity references to external entities.
15446     @enMufDef:
15447     External entity |%p (name => {<Q::xp|name>});| is referenced
15448     in an attribute value literal
15449     @ecore:hasParameter: xp|error-token
15450     @ecore:hasParameter:
15451     @@@: xp|name
15452     @@enDesc:
15453     The name of the entity.
15454    
15455     WFErrDef:
15456     @QName: xp|wf-no-lt-in-attribute-values
15457     @enDesc:
15458     The replacement text of any entity referred to directly or indirectly
15459     in an attribute value literal <kwd:MUST-NOT> contain a
15460     <CHAR::LESS-THAN SIGN>.
15461     @enMufDef:
15462     Entity replacement text cannot contain a
15463     |LESS-THAN SIGN| since it is referenced from an attribute
15464     value literal
15465     @ecore:hasParameter: xp|error-token
15466 wakaba 1.3
15467 wakaba 1.25 WarnDef:
15468     @QName: xp|warning-attribute-definition-ignored
15469     @enDesc:
15470     An attribute definition is ignored because the same attribute
15471     is declared before.
15472     @enMufDef:
15473     Attribute definition for |%p (name => {<Q::xp|name>});| is ignored
15474     @ecore:hasParameter: xp|error-token
15475     @ecore:hasParameter:
15476     @@@: xp|name
15477     @@enDesc:
15478     The name of the attribute.
15479    
15480 wakaba 1.3 WFErrDef:
15481     @QName: xp|wf-legal-character
15482     @enDesc:
15483     Characters referred to using character references <kwd:MUST>
15484     match the production for <CODE::Char>.
15485     @enMufDef:
15486     Reference to character %character-code-point
15487     (v => {<Q::xp|character-number>}); is not allowed
15488     @ecore:hasParameter: xp|error-token
15489     @ecore:hasParameter:
15490     @@@: xp|character-number
15491     @@enDesc:
15492     The code position of the character being referred.
15493     @ecore:hasParameter:
15494     @@@: xp|parent
15495     @@enDesc:
15496     The parent node in which the character reference has
15497     occurred, if available.
15498 wakaba 1.19
15499     WFErrDef:
15500     @QName: xp|wf-entity-declared
15501     @enDesc:
15502     {P:: In a document
15503    
15504     - without any DTD,
15505    
15506     - with only an internal DTD subset that contains no parameter
15507     entity references, or
15508    
15509     - with <XML::standalone="yes">,
15510    
15511     for an entity reference that does not occur within the external
15512     subset or a parameter entity, the <CODE::Name> given in the
15513     entity reference <kwd:MUST> match the <CODE::Name> does not
15514     occur within the external subset or a parameter entity,
15515     except that five predefined character entities need not
15516     be declared. The declaration of a general entity <kwd:MUST>
15517     precede any reference to it which appears in a default value
15518     in an attribute list declaration.
15519     @enMufDef:
15520     Entity |%p (name => {<Q::xp|name>});| must be declared
15521     in the internal subset
15522 wakaba 1.23 @ecore:hasParameter: xp|error-token
15523     @ecore:hasParameter:
15524     @@@: xp|name
15525     @@enDesc:
15526     The name of the entity.
15527    
15528     WFErrDef:
15529     @QName: xp|wf-parsed-entity
15530     @enDesc:
15531     An entity reference <kwd:MUST-NOT> contain the name of an
15532     unparsed entity.
15533     @enMufDef:
15534     Entity |%p (name => {<Q::xp|name>});| is an unparsed entity
15535     @ecore:hasParameter: xp|error-token
15536     @ecore:hasParameter:
15537     @@@: xp|name
15538     @@enDesc:
15539     The name of the entity.
15540    
15541     WFErrDef:
15542     @QName: xp|wf-no-recursion
15543     @enDesc:
15544     A parsed entity <kwd:MUST-NOT> contain a recursive reference
15545     to itself, either directly or indirectly.
15546     @enMufDef:
15547     Entity |%p (name => {<Q::xp|name>});| is recursively referenced
15548 wakaba 1.19 @ecore:hasParameter: xp|error-token
15549     @ecore:hasParameter:
15550     @@@: xp|name
15551     @@enDesc:
15552     The name of the entity.
15553 wakaba 1.16
15554     FatalErrDef:
15555     @QName: xp|fatal-xml11-end-of-line-in-xml-declaration
15556     @enDesc:
15557     An end-of-line character <CODE::U+0085> or <CODE::U+2028> is appeared
15558     within an XML declaration or text declaration.
15559     @enMufDef:
15560     End-of-line character %character-code-point
15561     (v => {<Q::xp|character-number>}); cannot be used within the
15562     XML or text declaration
15563     @ecore:hasParameter:
15564     @@@: xp|character-number
15565     @@enDesc:
15566     The code position of the end-of-line character.
15567 wakaba 1.24
15568     ErrDef:
15569     @QName: xp|error-internal-predefined-entity
15570     @enDesc:
15571     A general entity declaration whose <CODE::Name> equals to one
15572     of predefined entities <kwd:MUST> declare it as an internal entity.
15573     @enMufDef:
15574     Entity |%p (name => {<Q::xp|name>});| must be declared as an
15575     internal entity
15576     @ecore:hasParameter: xp|error-token
15577     @ecore:hasParameter:
15578     @@@: xp|name
15579     @@enDesc:
15580     The name of the entity.
15581    
15582     ErrDef:
15583     @QName: xp|error-malformed-predefined-entity
15584     @enDesc:
15585     A general entity declaration whose <CODE::Name> equals to one
15586     of predefined entities <kwd:MUST> declare it as a data
15587     character for the entity.
15588     @enMufDef:
15589     Entity declaration for |%p (name => {<Q::xp|name>});|
15590     (replacement text |%p (name => {<Q::xp|replacement-text>});|) is malformed
15591     @ecore:hasParameter: xp|error-token
15592     @ecore:hasParameter:
15593     @@@: xp|name
15594     @@enDesc:
15595     The name of the entity.
15596     @ecore:hasParameter:
15597     @@@: xp|replacement-text
15598     @@enDesc:
15599     The replacement text of the entity declaration.
15600    
15601     WarnDef:
15602     @QName: xp|warning-entity-declaration-ignored
15603     @enDesc:
15604     An entity declaration is ignored because the same entity
15605     is declared before.
15606     @enMufDef:
15607     Entity declaration for |%p (name => {<Q::xp|name>});| is ignored
15608     @ecore:hasParameter: xp|error-token
15609     @ecore:hasParameter:
15610     @@@: xp|name
15611     @@enDesc:
15612     The name of the entity.
15613    
15614     VCErrDef:
15615     @QName: xp|vc-unique-notation-name
15616     @enDesc:
15617     A <CODE::Name> <kwd:MUST-NOT> be declared in more than
15618     one notation declaration.
15619     @enMufDef:
15620     Notation |%p (name => {<Q::xp|name>});| is already declared
15621     @ecore:hasParameter: xp|error-token
15622     @ecore:hasParameter:
15623     @@@: xp|name
15624     @@enDesc:
15625     The name of the notation.
15626 wakaba 1.25
15627     WarnDef:
15628     @QName: xp|warning-entity-declaration-not-processed
15629     @enDesc:
15630     An entity declaration is not processed because there
15631     is a reference to parameter entity before the declaration
15632     and the entity is not read.
15633     @enMufDef:
15634     Entity declaration for |%p (name => {<Q::xp|name>});| is not processed
15635     @ecore:hasParameter: xp|error-token
15636     @ecore:hasParameter:
15637     @@@: xp|name
15638     @@enDesc:
15639     The name of the entity.
15640    
15641     WarnDef:
15642     @QName: xp|warning-attribute-definition-not-processed
15643     @enDesc:
15644     An attribute definition is not processed because there
15645     is a reference to parameter entity before the declaration
15646     and the entity is not read.
15647     @enMufDef:
15648     Attribute definition for |%p (name => {<Q::xp|name>});| is not processed
15649     @ecore:hasParameter: xp|error-token
15650     @ecore:hasParameter:
15651     @@@: xp|name
15652     @@enDesc:
15653     The name of the attribute.
15654 wakaba 1.26
15655     NSFatalErrDef:
15656     @QName: xp|nswf-legal-ncname
15657     @enDesc:
15658     <CODE::Name>s other than element type names and attribute names
15659     <kwd:MUST> be <CODE::NCName>s.
15660     @enMufDef:
15661     <CODE::Name> |%p (name => {<Q::xp|name>});| is not an <CODE::NCName>
15662     @ecore:hasParameter: xp|error-token
15663     @ecore:hasParameter:
15664     @@@: xp|name
15665     @@enDesc:
15666     The name.
15667     @ecore:hasParameter:
15668     @@@: infoset|version
15669     @@enDesc:
15670     The version of XML in use.
15671    
15672     NSFatalErrDef:
15673     @QName: xp|nswf-legal-qname
15674     @enDesc:
15675     An element type name or an attribute name <kwd:MUST> be a
15676     <CODE::QName>.
15677     @enMufDef:
15678     <CODE::Name> |%p (name => {<Q::xp|name>});| is not a <CODE::QName>
15679     @ecore:hasParameter: xp|error-token
15680     @ecore:hasParameter:
15681     @@@: xp|name
15682     @@enDesc:
15683     The name.
15684     @ecore:hasParameter:
15685     @@@: infoset|version
15686     @@enDesc:
15687     The version of XML in use.
15688    
15689     NSCErrDef:
15690     @QName: xp|nsc-reserved-prefix-xml
15691     @enDesc:
15692     The prefix <XML::xml> <kwd:MUST-NOT> be undeclared or bound
15693     to any namespace name other than <URI::http://www.w3.org/XML/1998/namespace>.
15694     @enMufDef:
15695     Namespace prefix |xml| cannot be bound to namespace
15696     name |%p (name => {<Q::infoset|namespaceName>});|
15697     @ecore:hasParameter: xp|error-token
15698     @ecore:hasParameter:
15699     @@@: infoset|prefix
15700     @@enDesc:
15701     The namespace prefix.
15702     @ecore:hasParameter:
15703     @@@: infoset|namespaceName
15704     @@enDesc:
15705     The namespace name bound to or an empty string for undeclaring.
15706    
15707     NSCErrDef:
15708     @QName: xp|nsc-reserved-namespace-name-xml
15709     @enDesc:
15710     Namespace prefixes other than <XML::xml> <kwd:MUST-NOT> be bound
15711     to the namespace name <URI::http://www.w3.org/XML/1998/namespace>.
15712     @enMufDef:
15713     Namespace prefix |%p (name => {<Q::infoset|prefix>});| cannot be
15714     bound to namespace name |http://www.w3.org/XML/1998/namespace|
15715     @enImplNote:
15716     The XMLNames spec does not prohibit the URI bound to
15717     the default namespace (!)
15718     @ecore:hasParameter: xp|error-token
15719     @ecore:hasParameter:
15720     @@@: infoset|prefix
15721     @@enDesc:
15722     The namespace prefix or <DOM::null> for default namespace.
15723     @ecore:hasParameter:
15724     @@@: infoset|namespaceName
15725     @@enDesc:
15726     The namespace name bound to.
15727    
15728     NSCErrDef:
15729     @QName: xp|nsc-reserved-prefix-xmlns
15730     @enDesc:
15731     The prefix <XML::xmlns> <kwd:MUST-NOT> be declared or undeclared.
15732     @enMufDef:
15733     Namespace prefix |xmlns| cannot be declared or undeclared
15734     @ecore:hasParameter: xp|error-token
15735     @ecore:hasParameter:
15736     @@@: infoset|prefix
15737     @@enDesc:
15738     The namespace prefix.
15739     @ecore:hasParameter:
15740     @@@: infoset|namespaceName
15741     @@enDesc:
15742     The namespace name bound to or an empty string for undeclaring.
15743    
15744     NSCErrDef:
15745     @QName: xp|nsc-reserved-namespace-name-xmlns
15746     @enDesc:
15747     Namespace prefixes <kwd:MUST-NOT> be bound
15748     to the namespace name <URI::http://www.w3.org/2000/xmlns/>.
15749     @enMufDef:
15750     Namespace prefix |%p (name => {<Q::infoset|prefix>});| cannot be
15751     bound to namespace name |http://www.w3.org/2000/xmlns/|
15752     @enImplNote:
15753     The XMLNames spec does not prohibit the URI bound to
15754     the default namespace (!)
15755     @ecore:hasParameter: xp|error-token
15756     @ecore:hasParameter:
15757     @@@: infoset|prefix
15758     @@enDesc:
15759     The namespace prefix or <DOM::null> for default namespace.
15760     @ecore:hasParameter:
15761     @@@: infoset|namespaceName
15762     @@enDesc:
15763     The namespace name bound to.
15764    
15765     NSCErrDef:
15766     @QName: xp|nsc-prefix-declared
15767     @enDesc:
15768     A namespace prefix other than <XML::xml> or <XML::xmlns>
15769     <kwd:MUST> have been declared in a namespace declaration
15770     attribute in either the start or empty element tag of the
15771     element where the prefix is used or in an ancestor
15772     element. Furthermore, the attribute value in the innermost
15773     such declaration <kwd:MUST-NOT> be an empty string.
15774     @enMufDef:
15775     Namespace prefix |%p (name => {<Q::infoset|prefix>});| in
15776     qualified name |%p (name => {<Q::xp|name>});| is not declared
15777     @ecore:hasParameter: xp|error-token
15778     @ecore:hasParameter:
15779     @@@: infoset|prefix
15780     @@enDesc:
15781     The namespace prefix.
15782     @ecore:hasParameter:
15783     @@@: xp|name
15784     @@enDesc:
15785     The qualified name.
15786    
15787     NSFatalErrDef:
15788     @QName: xp|nswf-empty-namespace-name
15789     @enDesc:
15790     If the XML version of the document is 1.0 and the
15791     normalized value of the prefixed namespace declaration attribute is empty.
15792     @enMufDef:
15793     Namespace |%p (name => {<Q::infoset|prefix>});| cannot be
15794     undeclared in XML 1.0
15795     @ecore:hasParameter: xp|error-token
15796     @ecore:hasParameter:
15797     @@@: infoset|prefix
15798     @@enDesc:
15799     The namespace prefix.
15800     @ecore:hasParameter:
15801     @@@: infoset|namespaceName
15802     @@enDesc:
15803     An empty string.
15804    
15805     NSFatalErrDef:
15806     @QName: xp|nswf-unique-att-spec-expanded-name
15807     @enDesc:
15808     No element may have two attributes that have qualified name
15809     with the same local part and with namespace prefixes
15810     that have been bound to namespace names that are identical.
15811     @enMufDef:
15812     Attribute |%p (name => {<Q::infoset|localName>});| in
15813     namespace |%p (name => {<Q::infoset|namespaceName>});| is
15814     attached to the same element more than once (as
15815     |%p (name => {<Q::xp|name>});| and
15816     |%p (name => {<Q::xp|another-attribute-name>});|)
15817     @enImplNote:
15818     The XMLNames spec doesn't mention default attributes
15819     for this constraint...
15820     @ecore:hasParameter: xp|error-token
15821     @ecore:hasParameter:
15822     @@@: infoset|localName
15823     @@enDesc:
15824     The local part of the attribute.
15825     @ecore:hasParameter:
15826     @@@: infoset|namespaceName
15827     @@enDesc:
15828     The namespace URI of the attribute.
15829     @ecore:hasParameter:
15830     @@@: xp|name
15831     @@enDesc:
15832     The name, i.e. a qualified name consist of <Q::infoset:localName>
15833     and <Q::infoset:namespaceName> parameter values.
15834     @ecore:hasParameter:
15835     @@@: xp|another-attribute-name
15836     @@enDesc:
15837     Another attribute qualified name expanded to the same expanded name
15838     as <Q::xp|name>.
15839    
15840     XWParam:
15841     @QName: xp|another-attribute-name
15842 wakaba 1.24
15843     XWParam:
15844     @QName: xp|replacement-text
15845     @enDesc:
15846     The replacement text.
15847 wakaba 1.1
15848 wakaba 1.3 XWParam:
15849 wakaba 1.1 @QName: xp|error-token
15850     @enDesc:
15851     The token where the parser found an error.
15852    
15853 wakaba 1.3 XWParam:
15854     @QName: xp|name
15855     @enDesc:
15856     A name.
15857    
15858     XWParam:
15859     @QName: xp|parent
15860     @enDesc:
15861     The parent node in which the error occurs.
15862    
15863     XWParam:
15864     @QName: xp|node
15865     @enDesc:
15866     The current node.
15867    
15868     XWParam:
15869     @QName: xp|actual-element-type
15870     @enDesc:
15871     The actual element type name occured in the source.
15872    
15873     XWParam:
15874     @QName: xp|expected-element-type
15875 wakaba 1.1 @enDesc:
15876 wakaba 1.3 The element type name expected.
15877    
15878     XWParam:
15879     @QName: xp|character-number
15880     @enDesc:
15881     The character code position.
15882    
15883     ElementTypeBinding:
15884     @Name: XWParam
15885     @ElementType:
15886     dis:ResourceDef
15887     @ShadowContent:
15888     @@For: =ManakaiDOM|all
15889     @@rdf:type: ecore|Parameter
15890 wakaba 1.1
15891     ElementTypeBinding:
15892     @Name:enMufDef
15893     @ElementType:
15894     ecore:defaultMessage
15895     @ShadowContent:
15896     @@lang:en
15897     @@ContentType:
15898     lang:muf
15899    
15900     ResourceDef:
15901     @QName: DOMImpl
15902     @AliasFor: DOMCore|DOMImplementation
15903     @For: ManakaiDOM|DOM
15904    
15905 wakaba 1.27 ResourceDef:
15906     @QName: LSInput
15907     @AliasFor: DOMLS|LSInput
15908     @For: ManakaiDOM|DOM
15909    
15910     ResourceDef:
15911     @QName: LSParser
15912     @AliasFor: DOMLS|LSParser
15913     @For: ManakaiDOM|DOM
15914    
15915 wakaba 1.1 ElementTypeBinding:
15916     @Name: Attr
15917     @ElementType:
15918     dis:ResourceDef
15919     @ShadowContent:
15920     @@rdf:type: DISLang|Attribute
15921     @@ForCheck: !=ManakaiDOM|ManakaiDOM
15922    
15923     ElementTypeBinding:
15924     @Name: Get
15925     @ElementType:
15926     dis:ResourceDef
15927     @ShadowContent:
15928     @@rdf:type: DISLang|AttributeGet
15929    
15930     ElementTypeBinding:
15931     @Name: Set
15932     @ElementType:
15933     dis:ResourceDef
15934     @ShadowContent:
15935     @@rdf:type: DISLang|AttributeSet
15936    
15937     ElementTypeBinding:
15938     @Name: enDesc
15939     @ElementType:
15940     dis:Description
15941     @ShadowContent:
15942     @@lang:en
15943    
15944     ElementTypeBinding:
15945     @Name: Method
15946     @ElementType:
15947     dis:ResourceDef
15948     @ShadowContent:
15949     @@rdf:type: DISLang|Method
15950     @@For: !=ManakaiDOM|ManakaiDOM
15951    
15952     ElementTypeBinding:
15953     @Name: Return
15954     @ElementType:
15955     dis:ResourceDef
15956     @ShadowContent:
15957     @@rdf:type: DISLang|MethodReturn
15958    
15959     ElementTypeBinding:
15960     @Name: Param
15961     @ElementType:
15962     dis:ResourceDef
15963     @ShadowContent:
15964     @@rdf:type: DISLang|MethodParameter
15965    
15966     ElementTypeBinding:
15967     @Name: PerlDef
15968     @ElementType:
15969     dis:Def
15970     @ShadowContent:
15971     @@ContentType: lang|Perl
15972    
15973     ElementTypeBinding:
15974 wakaba 1.27 @Name: PerlDefC
15975     @ElementType:
15976     dis:Def
15977     @ShadowContent:
15978     @@ContentType: lang|Perl
15979    
15980     ElementTypeBinding:
15981 wakaba 1.1 @Name: PropDef
15982     @ElementType:
15983     dis:ResourceDef
15984     @ShadowContent:
15985     @@rdf:type: rdf|Property
15986    
15987     ClsDef:
15988     @ClsQName: ManakaiXMLParserExceptionFormatter
15989    
15990     @ClsISA: ecore|MUErrorFormatter||ManakaiDOM|Perl
15991    
15992     @RuleDef:
15993     @@Name: xp-error-token-type
15994     @@enDesc:
15995     The type of the token the parser is encountered.
15996    
15997     @@Method:
15998     @@@Name: after
15999     @@@Param:
16000     @@@@Name: name
16001     @@@@Type: DOMString
16002     @@@@enDesc: The name of the method.
16003     @@@Param:
16004     @@@@Name: p
16005     @@@@Type: DISPerl|HASH
16006     @@@@enDesc: The set of the parameters to the method.
16007     @@@Param:
16008     @@@@Name: o
16009     @@@@Type: DISPerl|HASH
16010     @@@@enDesc: The option value.
16011     @@@Return:
16012     @@@@PerlDef:
16013     $p->{-result} = $o->{<H::xp|error-token>}->{type}
16014     if defined $o->{<H::xp|error-token>}->{type};
16015    
16016     @RuleDef:
16017     @@Name: xp-error-token-value
16018     @@enDesc:
16019     The value of the token the parser is encountered, if any.
16020    
16021     @@Method:
16022     @@@Name: after
16023     @@@Param:
16024     @@@@Name: name
16025     @@@@Type: DOMString
16026     @@@@enDesc: The name of the method.
16027     @@@Param:
16028     @@@@Name: p
16029     @@@@Type: DISPerl|HASH
16030     @@@@enDesc: The set of the parameters to the method.
16031     @@@Param:
16032     @@@@Name: o
16033     @@@@Type: DISPerl|HASH
16034     @@@@enDesc: The option value.
16035     @@@Return:
16036     @@@@PerlDef:
16037     $p->{-result} = $o->{<H::xp|error-token>}->{value}
16038     if defined $o->{<H::xp|error-token>}->{value};
16039    
16040     @RuleDef:
16041     @@Name: xp-error-lines
16042     @@enDesc:
16043     A copy of fragment of the source text that contains the line
16044     where the error occurred, if available.
16045    
16046     @@Method:
16047     @@@Name: after
16048     @@@Param:
16049     @@@@Name: name
16050     @@@@Type: DOMString
16051     @@@@enDesc: The name of the method.
16052     @@@Param:
16053     @@@@Name: p
16054     @@@@Type: DISPerl|HASH
16055     @@@@enDesc: The set of the parameters to the method.
16056     @@@Param:
16057     @@@@Name: o
16058     @@@@Type: DISPerl|HASH
16059     @@@@enDesc: The option value.
16060     @@@Return:
16061     @@@@PerlDef:
16062     my $pos = $o-><AG::DOMCore|DOMError.location>
16063     -><AG::DOMCore|DOMLocator.utf32Offset>;
16064 wakaba 1.27 my $src = $o->{<H::ecore|object>}->{entity}->[-1]->{reptxt};
16065     if (defined $src and $pos > -1) {
16066 wakaba 1.1 my $start = $pos;
16067     $start = rindex ($$src, "\x0A", $start - 1) for 0..2;
16068     $start++;
16069     my $end = $pos;
16070     $end = index ($$src, "\x0A", $end + 1) for 0..2;
16071     $end = length $$src if $end < 0;
16072     $p->{-result} = substr $$src, $start, $end - $start;
16073     }
16074 wakaba 1.3
16075     @RuleDef:
16076     @@Name: character-code-point
16077     @@enDesc:
16078     The character code position, in <CODE::U+<VAR::HHHH>> notation.
16079    
16080     @@Method:
16081     @@@Name: after
16082     @@@Param:
16083     @@@@Name: name
16084     @@@@Type: DOMString
16085     @@@@enDesc: The name of the method.
16086     @@@Param:
16087     @@@@Name: p
16088     @@@@Type: DISPerl|HASH
16089     @@@@enDesc: The set of the parameters to the method.
16090     @@@Param:
16091     @@@@Name: o
16092     @@@@Type: DISPerl|HASH
16093     @@@@enDesc: The option value.
16094     @@@RuleParam:
16095     @@@@Name: v
16096     @@@@Type: DISPerl|Number
16097     @@@@enDesc:
16098     The name of the error parameter that contains the character code.
16099     @@@Return:
16100     @@@@PerlDef:
16101     $p->{-result} = sprintf 'U+%04X', $o->{$p->{v}};
16102 wakaba 1.1 ##XMLParserExceptionFormatter
16103 wakaba 1.27
16104     ElementTypeBinding:
16105     @Name: CParam
16106     @ElementType:
16107     dis:ResourceDef
16108     @ShadowContent:
16109     @@rdf:type:
16110     @@@@: c|DOMConfigurationParameter
16111     @@@For: ManakaiDOM|DOM
16112     @@rdf:type:
16113     @@@@: DISCore|Property
16114     @@@For: =ManakaiDOM|all
16115     @@For: ManakaiDOM|DOM3
16116     @@For: =ManakaiDOM|all
16117    
16118     ElementTypeBinding:
16119     @Name: CParamApp
16120     @ElementType:
16121     dis:ResourceDef
16122     @ShadowContent:
16123     @@rdf:type:
16124     @@@@: c|DOMConfigurationParameterApplication
16125     @@@For: ManakaiDOM|DOM
16126     @@For: ManakaiDOM|DOM3
16127 wakaba 1.30
16128     CParamApp:
16129     @QName: xml-id
16130     @c:domConfigurationParameter: cfg|xml-id
16131     @c:targetType: xp|ManakaiXMLParser
16132 wakaba 1.27
16133     CParamApp:
16134     @QName: error-handler
16135     @c:domConfigurationParameter: c|error-handler
16136     @c:targetType: xp|ManakaiXMLParser
16137    
16138     CParam:
16139     @QName: xp|ls-input-to-input-file
16140     @DOMLS:lsKey:
16141     @@@: i2i
16142     @@For: =ManakaiDOM|all
16143     @Type: ManakaiDOMLSInputToInputFile
16144     @c:targetType: xp|ManakaiXMLParser
16145     @IsSupportRequired: 1
16146     @c:isSupported: 1
16147     @enDesc:
16148     An <IF::LSInput> to Perl filehandle converter.
16149    
16150     @Method:
16151     @@rdf:type: c|DOMConfigurationParameterDefaultGetter
16152     @@Param:
16153     @@@Name: name
16154     @@@Type: DOMString
16155     @@@dis:actualType: c|DOMConfigurationParameterName
16156     @@@enDesc: The parameter name.
16157     @@Return:
16158     @@@Type: ManakaiDOMLSInputToInputFile
16159     @@@enDesc:
16160     The default resolver.
16161     @@@PerlDefC:
16162     $r = sub {
16163     my ($self, $input, $errorHandler) = @_;
16164     ## As defined in DOM Level 3 LS |LSInput| interface
16165    
16166     my $r = {};
16167    
16168     __DEEP{
16169    
16170     FH: {
16171     ## 1. |characterStream|
16172     my $v = $input-><AG::LSInput.characterStream>;
16173     if (defined $v) {
16174     $r->{filehandle} = $v;
16175     last FH;
16176     }
16177    
16178     ## 2. |byteStream|
16179     $v = $input-><AG::LSInput.byteStream>;
16180     if (defined $v) {
16181     ## TODO: Support byte filehandle
16182     ## |encoding|
16183     ## TODO: How to guess?
16184     return null;
16185     }
16186    
16187     ## 3. |stringData|
16188     $v = $input-><AG::LSInput.stringData>;
16189     if (defined $v) {
16190     require IO::String;
16191     $r->{filehandle} = IO::String->new ($v);
16192     last FH;
16193     }
16194    
16195     ## 4. |systemId|
16196     ## TODO:
16197     ## resolve relative URI
16198     ## open
16199     ## set document_uri
16200    
16201     ## 5. |publicId|
16202     ## The default resolver does not support only-|publicId| input.
16203    
16204     return null;
16205     } # FH
16206    
16207     DURI: {
16208     last DURI if defined $r->{document_uri};
16209    
16210     my $v = $input-><AG::LSInput.systemId>;
16211     if (defined $v) {
16212 wakaba 1.29 $r->{base_uri} = $input-><AG::LSInput.baseURI>
16213     unless defined $r->{base_uri};
16214     if (defined $r->{base_uri}) {
16215     $r->{document_uri}
16216     = <ClassM::urigen|ManakaiURIReference.new> (\$v)
16217     -><M::urigen|URIReference.getAbsoluteReference>
16218     ($r->{base_uri})
16219     -><AG::urigen|URIReference.uriReference>;
16220     } else {
16221     $r->{document_uri} = $v;
16222     }
16223 wakaba 1.27 last DURI;
16224     }
16225    
16226     ## TODO: pubid -> pubid URN -> document_uri
16227     } # DURI
16228    
16229     BURI: {
16230     last BURI if defined $r->{base_uri};
16231    
16232     my $v = $input-><AG::LSInput.baseURI>;
16233     if (defined $v) {
16234     $r->{base_uri} = $v;
16235     last BURI;
16236     }
16237    
16238     if (defined $r->{document_uri}) {
16239     $r->{base_uri} = $r->{document_uri};
16240     }
16241     } # BURI
16242    
16243     }__;
16244    
16245     ## ISSUE: Is |certifiedText| required by parsers?
16246    
16247     return $r;
16248     };
16249     @Method:
16250     @@rdf:type: c|DOMConfigurationParameterSetter
16251     @@Param:
16252     @@@Name: name
16253     @@@Type: DOMString
16254     @@@dis:actualType: c|DOMConfigurationParameterName
16255     @@@enDesc: The parameter name.
16256     @@Param:
16257     @@@Name: value
16258     @@@Type: DOMMain|DOMUserData
16259     @@@dis:actualType: ManakaiDOMLSInputToInputFile
16260     @@@enDesc: The new value.
16261     @@Return:
16262     @@@Type: idl|void||ManakaiDOM|all
16263     @@@PerlDefC:
16264     $self->[1]->{<H::xp|ls-input-to-input-file>} = $value;
16265     @@enImplNote:
16266     Implied input processor converts non-blessed code references
16267     into a <Class::ManakaiDOMLSInputToInputFile> object.
16268     @Method:
16269     @@rdf:type: c|DOMConfigurationParameterChecker
16270     @@Param:
16271     @@@Name: name
16272     @@@Type: DOMString
16273     @@@dis:actualType: c|DOMConfigurationParameterName
16274     @@@enDesc: The parameter name.
16275     @@Param:
16276     @@@Name: value
16277     @@@Type: DOMMain|DOMUserData
16278     #@@@dis:actualType: ManakaiDOMLSInputToInputFile
16279     @@@enDesc: The new value.
16280     @@Return:
16281     @@@Type: idl|boolean||ManakaiDOM|all
16282     @@@PerlDefC:
16283     $r = UNIVERSAL::isa ($value, 'CODE') or
16284     UNIVERSAL::isa ($value, <ClassName::ManakaiDOMLSInputToInputFile>);
16285    
16286     @@Test:
16287     @@@QName: cp.ls-input-to-input-file.test
16288     @@@PerlDefC:
16289     my $xp;
16290     __CODE{createParserForTest:: $xp => $xp}__;
16291     my $cfg = $xp-><AG::LSInput.domConfig>;
16292    
16293     my $cp = <Q::xp|ls-input-to-input-file>;
16294    
16295     $test->id ('default');
16296     my $default = $cfg-><M::c|DOMConfiguration.getParameter> ($cp);
16297     $test->assert_isa ($default,
16298     <ClassName::ManakaiDOMLSInputToInputFile>);
16299    
16300     $test->id ('set');
16301     my $sub1 = sub { };
16302     $cfg-><M::c|DOMConfiguration.setParameter> ($cp => $sub1);
16303     my $sub2 = $cfg-><M::c|DOMConfiguration.getParameter> ($cp);
16304     $test->assert_isa ($sub2, <ClassName::ManakaiDOMLSInputToInputFile>);
16305     $test->assert_equals ($sub2, $sub1);
16306    
16307     $test->id ('reset');
16308     $cfg-><M::c|DOMConfiguration.setParameter> ($cp => null);
16309     my $sub3 = $cfg-><M::c|DOMConfiguration.getParameter> ($cp);
16310     $test->assert_isa ($sub3, <ClassName::ManakaiDOMLSInputToInputFile>);
16311     $test->assert_equals ($sub3, $default);
16312 wakaba 1.29
16313     @@Test:
16314     @@@QName: cp.ls-input-to-input-file.default.test
16315     @@@PerlDefC:
16316     my $xp;
16317     __CODE{createParserForTest:: $xp => $xp}__;
16318     my $cfg = $xp-><AG::LSInput.domConfig>;
16319     my $cp = <Q::xp|ls-input-to-input-file>;
16320     my $default = $cfg-><M::c|DOMConfiguration.getParameter> ($cp);
16321    
16322     my $err = sub {}; # dummy error handler
16323    
16324     my $cs = \*STDOUT; # dummy input
16325    
16326     $test->id ('cs.sysid');
16327     my $r1 = $default->resolve_ls_input ({
16328     character_stream => $cs,
16329     system_id => q<http://example.com/sysid>,
16330     }, $err);
16331     $test->assert_equals
16332     ($r1->document_uri, q<http://example.com/sysid>);
16333     $test->assert_equals
16334     ($r1->base_uri, q<http://example.com/sysid>);
16335    
16336     $test->id ('cs.baseuri.sysid');
16337     my $r1 = $default->resolve_ls_input ({
16338     character_stream => $cs,
16339     system_id => q<sysid>,
16340     base_uri => q<http://example.com/>,
16341     }, $err);
16342     $test->assert_equals
16343     ($r1->document_uri, q<http://example.com/sysid>);
16344     $test->assert_equals
16345     ($r1->base_uri, q<http://example.com/>);
16346 wakaba 1.27 ##ls-input-to-input-file
16347    
16348     ClsDef:
16349     @ClsQName: ManakaiDOMLSInputToInputFile
16350     @enDesc:
16351     An <Class::ManakaiDOMLSInputToInputFile> object is used to covert
16352     a <IF::LSInput> object into a Perl filehandle.
16353    
16354     {ISSUE::
16355     In which module this class should be placed?
16356    
16357     Better interface name?
16358     }
16359    
16360     @enDesc:
16361     @@ddid: perl
16362     @@ForCheck: ManakaiDOM|ManakaiDOM
16363     @@@:
16364     For Perl binding, any parameter that accepts
16365     a <Class::ManakaiDOMLSInputToInputFile> would also accept a Perl code
16366     reference (subroutine reference). The code reference
16367     will be blessed as a <Class::ManakaiDOMLSInputToInputFile> whose
16368     <M::ManakaiDOMLSInputToInputFile.resolveLSInput> method invokes the code.
16369    
16370     @ResourceDef:
16371     @@rdf:type: DISLang|InputProcessor
16372     @@rdf:type: DISLang|OutputProcessor
16373     @@PerlDef:
16374     $INPUT = bless $INPUT, <ClassName::ManakaiDOMLSInputToInputFile>
16375     if ref $INPUT eq 'CODE';
16376    
16377     @Method:
16378     @@Name: resolveLSInput
16379     @@enDesc:
16380     Converts a <IF::LSInput> into a Perl filehandle.
16381     @@Param:
16382     @@@Name: input
16383     @@@Type: LSInput
16384     @@@enDesc:
16385     The input.
16386     @@Param:
16387     @@@Name: errorHandler
16388     @@@Type: c|DOMErrorHandler
16389     @@@enDesc:
16390     An error handler. If the method encounters an error
16391     or warning, it <kwd:MAY> notify it to application
16392     via this handler.
16393     @@Return:
16394     @@@Type: ManakaiDOMInputFile
16395     @@@enDesc:
16396     A <Class::ManakaiDOMInputFile> object created from <P::input>.
16397     @@@nullCase:
16398     @@@@enDesc:
16399     If the method was unable to resolve the <P::input>.
16400    
16401     {ISSUE::
16402     Should we allow the method to throw exceptions?
16403     }
16404     @@@PerlDef:
16405     __DEEP{
16406     $r = $self->($self, $input, $errorHandler);
16407     }__;
16408     @@@enImplNote:
16409     Notet that the input / output processor for <CODE::$input>
16410     and return value might or might not be inserted in
16411     the <Perl::$self> code.
16412     ##LSInputToInputFile
16413    
16414     ClsDef:
16415     @ClsQName: ManakaiDOMInputFile
16416     @enDesc:
16417     A set of information on the input, including filehandle.
16418    
16419     @enDesc:
16420     @@ddid: perl
16421     @@ForCheck: ManakaiDOM|ManakaiDOM
16422     @@@:
16423     For Perl binding, any parameter that accepts
16424     a <Class::ManakaiDOMInputFile> would also accept a Perl hash reference.
16425     If a hash reference is given to parameter that expects
16426     a <Class::ManakaiDOMInputFile> object, then it
16427     bless the hash with the class.
16428    
16429     Each attributes defined
16430     in the class is associated to the hash value with the
16431     key equals to the attribut name. Each method defined in
16432     the class will invoke the code reference retrieved
16433     from the hash by the key equals to the method name.
16434    
16435     If there is no value in the hash for an attribute,
16436     then its value is <DOM::null>.
16437    
16438     @ResourceDef:
16439     @@rdf:type: DISLang|InputProcessor
16440     @@rdf:type: DISLang|OutputProcessor
16441     @@PerlDef:
16442     $INPUT = bless $INPUT, <ClassName::ManakaiDOMInputFile>
16443     if ref $INPUT eq 'HASH';
16444    
16445     @Attr:
16446     @@Name: filehandle
16447     @@Type: DISPerl|filehandle||ManakaiDOM|all
16448     @@enDesc:
16449     The input filehandle.
16450    
16451     It <kwd:MUST> be an <Perl::open>ed (and not <Perl::close>d)
16452     filehandle. Note that
16453     it does not have to be associated with an actual file
16454     in the local file system.
16455    
16456     It <kwd:MUST> return a character (rather than byte)
16457     by <Perl::getc>.
16458     @@Get:
16459     @@@PerlDef: $r = $self->{filehandle};
16460     @@Set:
16461     @@@PerlDef: $self->{filehandle} = $given;
16462    
16463     @Attr:
16464     @@Name: baseURI
16465     @@enDesc:
16466     The base URI of the input.
16467    
16468     It <kwd:MUST> be an absolute DOM URI or <DOM::null>.
16469     Otherwise, the result is undefined.
16470     @@Type: DOMString
16471     @@nullCase:
16472     @@@enDesc:
16473     If the base URI is not available.
16474     @@Get:
16475     @@@PerlDef: $r = $self->{base_uri};
16476     @@Set:
16477     @@@PerlDef: $self->{base_uri} = $given;
16478    
16479     @Attr:
16480     @@Name: documentURI
16481     @@enDesc:
16482     The URI of the document.
16483    
16484     It <kwd:MUST> be an absolute DOM URI or <DOM::null>.
16485     Otherwise, the result is undefined.
16486     @@Type: DOMString
16487     @@nullCase:
16488     @@@enDesc:
16489     If the document URI is not available.
16490     @@Get:
16491     @@@PerlDef: $r = $self->{document_uri};
16492     @@Set:
16493     @@@PerlDef: $self->{document_uri} = $given;
16494    
16495     @Method:
16496     @@Name: close
16497     @@enDesc:
16498     Closes the file.
16499    
16500     Since when the Perl's destructor is invoked is unreliable,
16501     this method is explicitly called when the file is no longer
16502     in use.
16503    
16504     If the <Class::ManakaiDOMInputFile> is given as a hash
16505     reference and whose value for <CODE::close> is not defined,
16506     then the statement <Perl::close $filehandle> is done
16507     (where <Perl::$filehandle> is the <A::ManakaiDOMInputFile.filehandle>
16508     value).
16509     @@Return:
16510     @@@PerlDef:
16511     __DEEP{
16512     if ($self->{close}) {
16513     $self->{close}->($self);
16514     } else {
16515     close $self->{filehandle};
16516     }
16517     }__;
16518     ##ManakaiDOMInputFile
16519    
16520    
16521    

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24