/[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.44 - (hide annotations) (download)
Fri Dec 29 14:45:43 2006 UTC (17 years, 10 months ago) by wakaba
Branch: MAIN
Changes since 1.43: +2 -4 lines
++ manakai/t/ChangeLog	29 Dec 2006 13:56:36 -0000
2006-12-29  Wakaba  <wakaba@suika.fam.cx>

	* .cvsignore: New auto-generated Perl test files
	are added.

++ manakai/lib/Message/Util/ChangeLog	29 Dec 2006 13:53:51 -0000
2006-12-29  Wakaba  <wakaba@suika.fam.cx>

	* PerlCode.dis (createPCFile): Removed.
	(createPCDocument): New method.

++ manakai/lib/Message/Util/DIS/ChangeLog	29 Dec 2006 13:54:30 -0000
2006-12-29  Wakaba  <wakaba@suika.fam.cx>

	* Perl.dis (plGeneratePerlModuleFile): Removed.
	(plGeneratePerlModuleDocument): New method.

++ manakai/lib/Message/DOM/ChangeLog	29 Dec 2006 13:53:21 -0000
2006-12-29  Wakaba  <wakaba@suika.fam.cx>

	* TreeCore.dis, DOMCore.dis, Document.dis,
	Element.dis, CharacterData.dis, XML.dis,
	XDoctype.dis, DOMString.dis, TreeStore.dis,
	XMLParser.dis: Use Perl native
	hashs and |Scalar::Util|'s weak references in favor of |Grove.dis|
	for DOM nodes.  See
	also <http://suika.fam.cx/gate/2005/sw/manakai/%E3%83%A1%E3%83%A2/2006-12-29>.

++ manakai/lib/manakai/ChangeLog	29 Dec 2006 13:56:06 -0000
2006-12-29  Wakaba  <wakaba@suika.fam.cx>

	* daf-perl-pm.pl: Use |pl_generate_perl_module_document|
	instead of |pl_generate_perl_module_file|.

	* daf-perl-t.pl: Use |create_pc_document|
	instead of |create_pc_file|.
	(daf_generate_perl_test_file|: Removed.
	(daf_generate_perl_test_document|: New function.

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.44 $Date: 2006/12/03 05:40:35 $
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 wakaba 1.35 @@@QName: MDOM|XML
23     @@@WithFor: ManakaiDOM|ManakaiDOMLatest
24     @@Module:
25 wakaba 1.6 @@@QName: MDOM|XDoctype
26     @@@WithFor: ManakaiDOM|ManakaiDOMLatest
27 wakaba 1.37 @@Module:
28     @@@QName: MCharset|Encode
29     @@@WithFor: ManakaiDOM|ManakaiDOMLatest
30 wakaba 1.1
31     Namespace:
32 wakaba 1.8 @c:
33     http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#
34 wakaba 1.11 @cfg:
35     http://suika.fam.cx/www/2006/dom-config/
36 wakaba 1.37 @cs:
37     http://suika.fam.cx/~wakaba/archive/2004/dis/Charset/
38 wakaba 1.6 @d:
39     http://suika.fam.cx/~wakaba/archive/2004/dom/xdt#
40 wakaba 1.1 @dis:
41     http://suika.fam.cx/~wakaba/archive/2004/8/18/lang#dis--
42 wakaba 1.5 @dtest:
43     http://suika.fam.cx/~wakaba/archive/2005/manakai/Util/DIS#Test/
44 wakaba 1.1 @dx:
45     http://suika.fam.cx/~wakaba/archive/2005/manakai/Util/Error/DOMException#
46     @ecore:
47     http://suika.fam.cx/~wakaba/archive/2005/manakai/Util/Error/Core/
48     @f:
49     http://suika.fam.cx/~wakaba/archive/2004/dom/feature#
50 wakaba 1.11 @fe:
51     http://suika.fam.cx/www/2006/feature/
52     @gls:
53     http://suika.fam.cx/~wakaba/archive/2004/dom/gls#
54 wakaba 1.1 @idl:
55     http://suika.fam.cx/~wakaba/archive/2004/dis/IDL#
56     @infoset:
57     http://www.w3.org/2001/04/infoset#
58     @lang:
59     http://suika.fam.cx/~wakaba/archive/2004/8/18/lang#
60     @license:
61     http://suika.fam.cx/~wakaba/archive/2004/8/18/license#
62     @LSEV:
63     http://www.w3.org/2002/DOMLS
64     @ManakaiDOM:
65     http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom#
66     @ManakaiDOMLS:
67     http://suika.fam.cx/~wakaba/archive/2004/mdom-ls#
68 wakaba 1.37 @MCharset:
69     http://suika.fam.cx/~wakaba/archive/2005/manakai/Charset/
70     @mce:
71     http://suika.fam.cx/~wakaba/archive/2005/manakai/Charset/Encode/
72 wakaba 1.1 @MDOM:
73     http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom#ManakaiDOM.
74     @MDOMX:
75     http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#
76     @rdf:
77     http://www.w3.org/1999/02/22-rdf-syntax-ns#
78     @rdfs:
79     http://www.w3.org/2000/01/rdf-schema#
80     @t:
81     http://suika.fam.cx/~wakaba/archive/2004/dom/tree#
82 wakaba 1.35 @tc:
83     http://suika.fam.cx/~wakaba/archive/2005/manakai/DOM/TreeCore/
84     @td:
85     http://suika.fam.cx/~wakaba/archive/2005/manakai/DOM/Document/
86     @te:
87     http://suika.fam.cx/~wakaba/archive/2005/manakai/DOM/Element/
88 wakaba 1.5 @test:
89     http://suika.fam.cx/~wakaba/archive/2004/dis/Test#
90 wakaba 1.35 @tx:
91     http://suika.fam.cx/~wakaba/archive/2005/manakai/DOM/XML/
92 wakaba 1.29 @urigen:
93     http://suika.fam.cx/~wakaba/archive/2005/manakai/URI/Generic/
94 wakaba 1.8 @x:
95     http://suika.fam.cx/~wakaba/archive/2004/dom/xml#
96 wakaba 1.1 @xml:
97     http://www.w3.org/XML/1998/namespace
98 wakaba 1.37 @xml-auto-charset:
99     http://suika.fam.cx/www/2006/03/xml-entity/
100 wakaba 1.9 @xml-dtd:
101     http://www.w3.org/TR/REC-xml
102 wakaba 1.1 @xmlns:
103     http://www.w3.org/2000/xmlns/
104     @xp:
105     http://suika.fam.cx/~wakaba/archive/2004/dom/xml-parser#
106    
107     ## -- Features
108    
109     ElementTypeBinding:
110     @Name: FeatureDef
111     @ElementType:
112     dis:ResourceDef
113     @ShadowContent:
114     @@rdf:type: f|Feature
115     @@For: =ManakaiDOM|all
116    
117     ElementTypeBinding:
118     @Name: FeatureVerDef
119     @ElementType:
120     dis:ResourceDef
121     @ShadowContent:
122     @@rdf:type: f|Feature
123    
124     ElementTypeBinding:
125     @Name: featureQName
126     @ElementType:
127     f:name
128     @ShadowContent:
129     @@ContentType: DISCore|QName
130    
131     ResourceDef:
132     @QName: DOMString
133     @AliasFor: DOMMain|DOMString
134     @For: ManakaiDOM|DOM
135    
136     ResourceDef:
137     @QName: Node
138 wakaba 1.35 @AliasFor: tc|Node
139 wakaba 1.1 @For: ManakaiDOM|DOM
140    
141     ResourceDef:
142     @QName: Element
143 wakaba 1.35 @AliasFor: te|Element
144     @For: ManakaiDOM|DOM
145    
146     ResourceDef:
147     @QName: Attr
148     @AliasFor: te|Attr
149 wakaba 1.1 @For: ManakaiDOM|DOM
150    
151     ResourceDef:
152     @QName: Document
153 wakaba 1.35 @AliasFor: td|Document
154 wakaba 1.1 @For: ManakaiDOM|DOM
155    
156 wakaba 1.6 ResourceDef:
157     @QName: DocumentXDoctype
158     @AliasFor: d|DocumentXDoctype
159     @For: ManakaiDOM|DOM
160    
161 wakaba 1.8 ResourceDef:
162     @QName: DTDef
163     @AliasFor: d|DocumentTypeDefinition
164     @For: ManakaiDOM|DOM
165    
166     ResourceDef:
167     @QName: ETDef
168     @AliasFor: d|ElementTypeDefinition
169     @For: ManakaiDOM|DOM
170    
171     ResourceDef:
172     @QName: ATDef
173     @AliasFor: d|AttributeDefinition
174     @For: ManakaiDOM|DOM
175    
176 wakaba 1.35 ResourceDef:
177     @QName: GE
178     @AliasFor: tx|Entity
179     @For: ManakaiDOM|DOM
180    
181     ResourceDef:
182     @QName: GERef
183     @AliasFor: tx|EntityReference
184     @For: ManakaiDOM|DOM
185    
186 wakaba 1.1 ElementTypeBinding:
187     @Name: ClsDef
188     @ElementType:
189     dis:ResourceDef
190     @ShadowContent:
191     @@rdf:type:
192     @@@@: dis|MultipleResource
193     @@@ForCheck: !ManakaiDOM|ForIF !ManakaiDOM|ForClass
194     @@resourceFor:
195     @@@@: ManakaiDOM|ForClass
196     @@@ForCheck: ManakaiDOM|ManakaiDOM !=ManakaiDOM|ManakaiDOM
197     @@For: ManakaiDOM|DOM3
198     @@For: =ManakaiDOM|ManakaiDOM
199    
200     @@rdf:type:
201     @@@@: DISLang|Class
202     @@@ForCheck: ManakaiDOM|ForClass
203    
204     ElementTypeBinding:
205     @Name: ClsQName
206     @ElementType:
207     dis:QName
208     @ShadowContent:
209     @@ForCheck: ManakaiDOM|ForClass
210    
211     ElementTypeBinding:
212     @Name: ClsISA
213     @ElementType:
214     dis:ISA
215     @ShadowContent:
216     @@ForCheck: ManakaiDOM|ForClass
217    
218     ElementTypeBinding:
219     @Name: nullCase
220     @ElementType:
221     dis:ResourceDef
222     @ShadowContent:
223     @@rdf:type: ManakaiDOM|InCase
224     @@Value:
225     @@@is-null:1
226    
227 wakaba 1.27 ElementTypeBinding:
228     @Name: TrueCase
229     @ElementType:
230     dis:ResourceDef
231     @ShadowContent:
232     @@rdf:type:
233     ManakaiDOM:InCase
234     @@Value:
235     @@@@: 1
236     @@@ContentType: DISCore|Boolean
237     @@Type: idl|boolean||ManakaiDOM|all
238    
239     ElementTypeBinding:
240     @Name: FalseCase
241     @ElementType:
242     dis:ResourceDef
243     @ShadowContent:
244     @@rdf:type:
245     ManakaiDOM:InCase
246     @@Value:
247     @@@@: 0
248     @@@ContentType: DISCore|Boolean
249     @@Type: idl|boolean||ManakaiDOM|all
250    
251 wakaba 1.1 ResourceDef:
252     @QName: LSParser
253     @AliasFor: DOMLS|LSParser
254     @For: ManakaiDOM|DOM3
255    
256     ClsDef:
257     @ClsQName: ManakaiXMLParser
258    
259     @Implement: DOMLS|LSParser
260    
261 wakaba 1.28 @f:implements: DOMLS|LSFeature30
262     @f:implements: DOMLS|ParseString10
263     @enImplNote:
264     @@ddid: dtdfeature
265     @@@:
266     {TODO::
267     Once DTD validation is implemented, add <Q::f:implements>
268     for XML-DTD-feature.
269     }
270 wakaba 1.1
271 wakaba 1.11 @DISLang:role: gls|ParserRole
272 wakaba 1.1
273 wakaba 1.3 @enDesc:
274     Note that the <Class::ManakaiXMLParser> reports any XML errors
275     (syntax errors and / or well-formedness constraint errors)
276     via the <IF::DOMCore:error-handler> registered to
277     the <A::DOMLS:LSParser.domConfig> object. Each error has
278     its <A::DOMCore:DOMError.severity>, either <C::DOMCore:SEVERITY_ERROR>
279     or <C::DOMCore:SEVERITY_FATAL_ERROR>. However, their semantics
280     are slight different from the ones of <QUOTE::error> and
281     <QUOTE::fatal error> in XML; in this implemenetation,
282     <C::DOMCore:SEVERITY_ERROR> implies that the parsing process
283     can effectively be continued to detect more errors while
284     <C::DOMCore:SEVERITY_FATAL_ERROR> implies that the error
285     is serious so that the result document tree and any errors
286     might be far from the ones obtained when the error would not
287     be found.
288 wakaba 1.28
289     @Test:
290     @@QName: GLSImpl.createGLSParser.LS.test
291     @@enDesc:
292     Since there is at least one implementation of the feature (i.e.
293     this class), the <M::gls|GLSImplementation.createGLSParser>
294     must not throw an exception.
295     @@PerlDef:
296     my $impl;
297     __CODE{DOMLS|createImplForTest:: $impl => $impl}__;
298    
299     my $p = $impl-><M::gls|GLSImplementation.createGLSParser>
300     ({LS => '3.0'});
301    
302     $test->assert_isa ($p, <IFName::LSParser>);
303     @Test:
304     @@QName: GLSImpl.createGLSParser.ParseXMLString.test
305     @@enDesc:
306     Since there is at least one implementation of the feature (i.e.
307     this class), the <M::gls|GLSImplementation.createGLSParser>
308     must not throw an exception.
309     @@PerlDef:
310     my $impl;
311     __CODE{DOMLS|createImplForTest:: $impl => $impl}__;
312    
313     my $p = $impl-><M::gls|GLSImplementation.createGLSParser>
314     ({<Q::fe|ParseXMLString> => '1.0'});
315    
316     $test->assert_not_null ($p);
317     @Test:
318     @@QName: GLSImpl.createGLSParser.LS.ParseXMLString.test
319     @@enDesc:
320     Since there is at least one implementation of the feature (i.e.
321     this class), the <M::gls|GLSImplementation.createGLSParser>
322     must not throw an exception.
323     @@PerlDef:
324     my $impl;
325     __CODE{DOMLS|createImplForTest:: $impl => $impl}__;
326    
327     my $p = $impl-><M::gls|GLSImplementation.createGLSParser>
328     ({LS => '3.0', <Q::fe|ParseXMLString> => '1.0'});
329    
330     $test->assert_isa ($p, <IFName::LSParser>);
331    
332     @Test:
333     @@QName: DOMImplLS.createLSParser.1.test
334     @@enDesc:
335     Since there is at least one implementation of the feature (i.e.
336     this class), the <M::gls|GLSImplementation.createGLSParser>
337     must not throw an exception.
338     @@PerlDef:
339     my $impl;
340     __CODE{DOMLS|createImplForTest:: $impl => $impl}__;
341    
342     my $p = $impl-><M::DOMLS|DOMImplementationLS.createLSParser>
343     (<C::DOMLS|DOMImplementationLS.MODE_SYNCHRONOUS>);
344     $test->assert_isa ($p, <IFName::LSParser>);
345     @enImplNote:
346     @@ddid: lsparsertext
347     @@@:
348     Future version should add test:
349     @@QName: DOMImplLS.createLSParser.2.test
350     @@enDesc:
351     Since there is at least one implementation of the feature (i.e.
352     this class), the <M::gls|GLSImplementation.createGLSParser>
353     must not throw an exception.
354     @@PerlDef:
355     my $impl;
356     __CODE{DOMLS|createImplForTest:: $impl => $impl}__;
357    
358     my $p = $impl-><M::DOMLS|DOMImplementationLS.createLSParser>
359     (<C::DOMLS|DOMImplementationLS.MODE_SYNCHRONOUS>,
360     <Q::xml-dtd:>);
361     $test->assert_isa ($p, <IFName::LSParser>);
362 wakaba 1.3
363 wakaba 1.27 @Test:
364     @@QName: Perl.open.utf8.strref.1.test
365     @@enDesc:
366     Does PerlIO works as intended?
367     @@PerlDef:
368     my $s = qq<\x{3001}\x0A\x{10001}>;
369     #open my $a, '<'.':utf8', \$s;
370     require IO::String;
371     my $a = IO::String->new ($s);
372     $test->assert_num_equals
373     (actual_value => ord getc $a,
374     expected_value => 0x3001);
375     $test->assert_num_equals
376     (actual_value => ord getc $a,
377     expected_value => 0x000A);
378     $test->assert_num_equals
379     (actual_value => ord getc $a,
380     expected_value => 0x10001);
381     $a->ungetc (0x10001);
382     $test->assert_num_equals
383     (actual_value => ord getc $a,
384     expected_value => 0x10001);
385     $test->assert_null (getc $a);
386     close $a;
387     @Test:
388     @@QName: Perl.open.8859.strref.2.test
389     @@enDesc:
390     Does PerlIO works as intended?
391     @@PerlDef:
392     my $s = qq<\x{0080}\x0A\x{00A9}>;
393     #open my $a, '<', \$s;
394     require IO::String;
395     my $a = IO::String->new ($s);
396     $test->assert_num_equals
397     (actual_value => ord getc $a,
398     expected_value => 0x0080);
399     $test->assert_num_equals
400     (actual_value => ord getc $a,
401     expected_value => 0x000A);
402     $test->assert_num_equals
403     (actual_value => ord getc $a,
404     expected_value => 0x00A9);
405     $a->ungetc (0x00A9);
406     $test->assert_num_equals
407     (actual_value => ord getc $a,
408     expected_value => 0x00A9);
409     $test->assert_null (getc $a);
410     close $a;
411    
412 wakaba 1.1 @Attr:
413     @@Name: domConfig
414     @@enDesc:
415     The configuration of the parser.
416    
417     @@Get:
418     @@@Type: DOMCore|DOMConfiguration
419     @@@enDesc: The DOM configuration object.
420     @@@PerlDef:
421     __CODE{DOMCore|getConfigObject::
422     $target => $self,
423     $targetHash => $self,
424 wakaba 1.27 $targetType => {<ClassName::xp|ManakaiXMLParser>},
425 wakaba 1.1 $result => $r,
426     }__;
427    
428 wakaba 1.27 @Attr:
429     @@ForCheck: ManakaiDOM|ForClass
430     @@Name: async
431     @@enDesc:
432     Whether the parser is asynchronous or not.
433     @@Type: idl|boolean||ManakaiDOM|all
434     @@Get:
435     @@@FalseCase:
436     @@@@enDesc:
437     The parser does not in asynchronous mode.
438     @@@PerlDef: \
439     @@Test:
440     @@@QName: XMLParser.async.test
441     @@@PerlDef:
442     my $xp;
443     __CODE{createParserForTest:: $xp => $xp}__;
444    
445     $test->assert_false ($xp-><AG::DOMLS|LSParser.async>);
446    
447     @Attr:
448     @@ForCheck: ManakaiDOM|ForClass
449     @@Name: busy
450     @@enDesc:
451     Whether the parser is currently busy loading a document or not.
452     @@Type: idl|boolean||ManakaiDOM|all
453     @@Get:
454     @@@TrueCase:
455     @@@@enDesc:
456     The parser is currently busy.
457     @@@FalseCase:
458     @@@@enDesc:
459     The parser is not busy.
460     @@@PerlDef:
461     $r = $self->{<H::DOMLS|busy>};
462    
463     @enImplNote:
464     @@ddid: abort
465     @@@:
466     {ISSUE::
467     LSParser.abort:
468    
469     Is it required to support even in synchronous mode?
470     }
471    
472     {TODO::
473     LSParser.filter
474     }
475    
476     @ResourceDef:
477     @@QName: createParserForTest
478     @@ForCheck: ManakaiDOM|ForClass
479     @@rdf:type: DISPerl|BlockCode
480     @@PerlDef:
481     require Message::DOM::GenericLS;
482     $xp = <Class::ManakaiXMLParser>
483 wakaba 1.40 ->new (<Class::c|ManakaiDOMImplementation>->_new, '');
484 wakaba 1.27
485 wakaba 1.1 @Method:
486     @@ManakaiDOM:isForInternal:1
487     @@ForCheck: ManakaiDOM|ForClass
488     @@Operator: DISPerl|NewMethod
489     @@enDesc:
490     Creates a new instance of the object.
491     @@Param:
492     @@@Name: impl
493 wakaba 1.11 @@@Type: gls|GLSImplementation
494 wakaba 1.1 @@@enDesc:
495     The implementation from which the parser is created.
496     @@Param:
497     @@@Name: features
498     @@@Type: DOMString
499     @@@dis:actualType: f|FeaturesString
500     @@@enDesc:
501     The set of features requested for the parser.
502     @@Return:
503     @@@Type: DOMMain|DOMObject
504     @@@dis:actualType: LSParser
505     @@@enDesc:
506     The newly created parser.
507     @@@PerlDef:
508     $r = bless {
509 wakaba 1.35 <H::f|implementation> => $impl,
510 wakaba 1.1 }, $self;
511    
512     @Method:
513 wakaba 1.27 @@Name: parseURI
514     @@enDesc:
515     Parses an XML document identified by a DOM URI.
516 wakaba 1.1
517 wakaba 1.27 It is equivalent to <M::.parse> method with its <P::input>
518     parameter set to a <IF::LSInput> object whose
519     <A::LSInput.systemId> set to <P::uri>.
520 wakaba 1.1 @@Param:
521 wakaba 1.27 @@@Name: uri
522 wakaba 1.1 @@@Type: DOMString
523 wakaba 1.27 @@@enDesc:
524     The DOM URI of the XML document to be read.
525 wakaba 1.1 @@Return:
526     @@@Type: Document
527 wakaba 1.27 @@@enDesc:
528     The newly created and populated <IF::Document> node.
529     @@@dx:raises:
530     @@@@@: ManakaiDOMLS|MDOMLS_BUSY
531     @@@@enDesc:
532     If <A::LSParser.busy> is <DOM::true>.
533     @@@dx:raises:
534     @@@@@: DOMLS|PARSE_ERR
535     @@@@enDesc:
536     If the <IF::LSParser> was unable to load the document.
537     @@@PerlDef:
538     __DEEP{
539     $r = $self-><M::LSParser.parse> ({system_id => $uri});
540     }__;
541    
542     @Method:
543     @@Name: parse
544     @@enDesc:
545     Parses an XML document from a resource identified
546     by a <IF::LSInput>.
547     @@Param:
548     @@@Name: input
549     @@@Type: LSInput
550     @@@enDesc:
551     The <IF::LSInput> from which the source of the document
552     is to be read.
553     @@Return:
554     @@@Type: Document
555     @@@enDesc:
556     The newly created and populated <IF::Document> node.
557     @@@dx:raises:
558     @@@@@: ManakaiDOMLS|MDOMLS_BUSY
559     @@@@enDesc:
560     If the <A::LSParser.busy> is <DOM::true>.
561     @@@dx:raises:
562     @@@@@: DOMLS|PARSE_ERR
563     @@@@enDesc:
564     If the <IF::LSParser> was unable to load the document.
565 wakaba 1.1 @@@PerlDef:
566 wakaba 1.27 if ($self->{<H::DOMLS|busy>}) {
567     __EXCEPTION{ManakaiDOMLS|MDOMLS_BUSY}__;
568     }
569     local $self->{<H::DOMLS|busy>} = true;
570    
571     my $in;
572     __DEEP{
573     $self->{parser_cfg} = $self-><AG::LSParser.domConfig>;
574     ## Parser's |domConfig| object.
575     $self->{in_in} = $self->{parser_cfg}
576     -><M::c|DOMConfiguration.getParameter>
577     (<Q::xp|ls-input-to-input-file>);
578     $in = $self->{in_in}-><M::ManakaiDOMLSInputToInputFile.resolveLSInput>
579 wakaba 1.37 ($self->{<H::f|implementation>}, $input,
580     $self,
581 wakaba 1.27 $self->{parser_cfg}
582     -><M::c|DOMConfiguration.getParameter>
583     ('error-handler'));
584     }__;
585     unless (defined $in) {
586     __c|ERROR{DOMLS|no-input-specified::
587     MDOMX:param-name => 'input',
588     }__;
589     __CODE{ParseError}__;
590     }
591    
592     require IO::Handle;
593 wakaba 1.1
594     $self->{char} = [];
595     $self->{token} = [];
596 wakaba 1.6 $self->{entity} = [{
597 wakaba 1.27 fh => $in-><AG::ManakaiDOMInputFile.filehandle>,
598     base_uri => $in-><AG::ManakaiDOMInputFile.baseURI>,
599     doc_uri => $in-><AG::ManakaiDOMInputFile.documentURI>,
600 wakaba 1.37 in_enc => $in-><AG::ManakaiDOMInputFile.inputEncoding>,
601 wakaba 1.6 line => 1,
602     column => 1,
603     pos => 0,
604 wakaba 1.27 close_file => sub { $in-><M::ManakaiDOMInputFile.close> },
605     reptxt => \'',
606     is_external_entity => true,
607 wakaba 1.6 }];
608 wakaba 1.27 ## Entity stack.
609 wakaba 1.14 $self->{location} = $self->{entity}->[-1];
610 wakaba 1.27 ## Parsing location object as required by DPG.
611     ## It must always be equal to |{entity}->[-1]|.
612 wakaba 1.6 $self->{entity_char} = [];
613 wakaba 1.27 ## Stack for |{char}| stacks analog to |{entity}| stack.
614 wakaba 1.6 $self->{entity_token} = [];
615 wakaba 1.27 ## Stack for |{token}| stacks analog to |{entity}| stack.
616 wakaba 1.3 $self->{xml_version} = '1.0';
617 wakaba 1.27 ## Document XML version: either |1.0| or |1.1|.
618 wakaba 1.3 $self->{standalone} = false;
619 wakaba 1.27 ## True iff |standalone=yes| is explicitly specified.
620 wakaba 1.19 $self->{has_xref} = false;
621 wakaba 1.27 ## There is an unread external entity.
622     $self->{dont_process} = false;
623     ## So, don't process |ENTITY| and |ATTLIST| declarations.
624 wakaba 1.11 $self->{general_entity} = {
625     lt => {is_predefined => true},
626     gt => {is_predefined => true},
627     amp => {is_predefined => true},
628     quot => {is_predefined => true},
629     apos => {is_predefined => true},
630     };
631 wakaba 1.27 ## Declared general entities.
632 wakaba 1.6 $self->{param_entity} = {};
633 wakaba 1.27 ## Declared parameter entities.
634 wakaba 1.9 $self->{attr} = {};
635     # $self->{attr}->{$element_type_name}->{$attr_name} = $attr_def
636 wakaba 1.27 ## Declared attributes.
637 wakaba 1.1
638     __DEEP{
639 wakaba 1.35 $r = $self->{<H::f|implementation>}-><M::DOMImpl.createDocument>;
640 wakaba 1.11 $self->{doc} = $r;
641 wakaba 1.27 ## |Document| object.
642     CORE::delete $self->{docx};
643     ## |DocumentXDoctype| object (if necessary).
644 wakaba 1.21 $self->{doc_cfg} = $r-><AG::Document.domConfig>;
645 wakaba 1.27 ## |Document|'s configuration.
646 wakaba 1.11 CORE::delete $self->{dtdef};
647 wakaba 1.27 ## |DocumentTypeDefinition| object (if created).
648 wakaba 1.17 CORE::delete $self->{dtdecl};
649 wakaba 1.27 ## |DocumentTypeDeclaration| object (if created).
650 wakaba 1.21
651     $r-><AS::Document.strictErrorChecking> (false);
652     ## NOTE: Any checks such as |Name| validity done by
653     ## methods on DOM nodes are disabled. It might result
654     ## in creating an ill-formed DOM tree when parser
655     ## errors are traped by |error-handler|.
656     $self->{doc_cfg}-><M::c|DOMConfiguration.setParameter>
657     (<Q::cfg|clone-entity-reference-subtree> => true);
658     ## NOTE: Turn this configuration parameter on makes
659     ## entity reference subtrees in attribute default values
660     ## cloned as is into default attribute node subtrees.
661 wakaba 1.26 $self->{doc_cfg}-><M::c|DOMConfiguration.setParameter>
662 wakaba 1.36 (<Q::cfg|dtd-default-attribute> => false);
663 wakaba 1.26 ## NOTE: Don't create DTD default attributes by
664     ## |createElementNS| method.
665     $self->{doc_cfg}-><M::c|DOMConfiguration.setParameter>
666 wakaba 1.30 (<Q::cfg|xml-id> => $self->{parser_cfg}
667     -><M::c|DOMConfiguration.getParameter>
668     (<Q::cfg|xml-id>));
669     $self->{doc_cfg}-><M::c|DOMConfiguration.setParameter>
670 wakaba 1.26 ('error-handler' => sub {
671     my (undef, $err) = @_;
672     return ($err-><AG::c|DOMError.severity> !=
673     <C::c|DOMError.SEVERITY_FATAL_ERROR>);
674     })
675     unless $Message::DOM::XMLParser::DEBUG;
676 wakaba 1.29 ## NOTE: The default error handler in manakai |warn|s error
677 wakaba 1.26 ## description.
678 wakaba 1.11
679 wakaba 1.29 ## Document entity's URI and base URI
680     $r-><AS::Document.documentURI> ($self->{entity}->[0]->{doc_uri});
681     $r-><AS::Document.manakaiEntityBaseURI>
682     ($self->{entity}->[0]->{base_uri});
683    
684 wakaba 1.37 ## Encoding name
685     $r-><AS::Document.inputEncoding> ($self->{entity}->[0]->{in_enc});
686    
687 wakaba 1.11 ## Document entity -> |Document| node
688     $self->_parse_DocumentEntity;
689    
690 wakaba 1.27 for (@{$self->{entity}}) {
691     $_->{close_file}->();
692     ## NOTE: There should be only the document entity.
693     }
694    
695 wakaba 1.11 ## Replacement tree for general |Entity| nodes
696 wakaba 1.34 if ($self->{parser_cfg}-><M::c|DOMConfiguration.getParameter>
697     (<Q::cfg|entity-replacement-tree>)) {
698     my @ent = values %{$self->{general_entity}};
699     for my $ent (@ent) {
700     if (exists $ent->{has_replacement_text}) {
701 wakaba 1.11 my $ent_name = $ent->{name};
702     $self->{entity} = [<Code::getCopyOfEntityState::
703     $entity_type = 'general_entity',
704     $entity_name = $ent_name>];
705 wakaba 1.14 $self->{location} = $self->{entity}->[-1];
706 wakaba 1.11 $self->{token} = [];
707     $self->{char} = [];
708 wakaba 1.23 local $ent->{is_opened} = true;
709 wakaba 1.11 ## TODO: External entity support
710 wakaba 1.35 $ent->{node}-><M::Node.manakaiSetReadOnly> (false, true);
711 wakaba 1.11 $self->_parse_InternalGeneralParsedEntity ($ent->{node});
712 wakaba 1.35 $ent->{node}-><AS::GE.hasReplacementTree> (true);
713     $ent->{node}-><M::Node.manakaiSetReadOnly> (true, true);
714 wakaba 1.27 $self->{entity}->[-1]->{close_file}->();
715 wakaba 1.35 ## ISSUE: Should errors detected by this phase result
716     ## in |DOMLS:PARSE_ERR| exception thrown?
717     }
718 wakaba 1.34 }
719     } # cfg|entity-replacement-tree
720 wakaba 1.11
721 wakaba 1.21 ## Turns flags to their default value
722     $self->{doc_cfg}-><M::c|DOMConfiguration.setParameter>
723     (<Q::cfg|clone-entity-reference-subtree> => null);
724 wakaba 1.26 $self->{doc_cfg}-><M::c|DOMConfiguration.setParameter>
725 wakaba 1.36 (<Q::cfg|dtd-default-attribute> => null);
726 wakaba 1.26 $self->{doc_cfg}-><M::c|DOMConfiguration.setParameter>
727 wakaba 1.30 (<Q::cfg|xml-id> => null);
728     $self->{doc_cfg}-><M::c|DOMConfiguration.setParameter>
729 wakaba 1.26 ('error-handler' => null);
730 wakaba 1.11 $r-><AS::Document.strictErrorChecking> (true);
731 wakaba 1.1 }__;
732    
733     @Method:
734     @@Name: shiftChar
735     @@ManakaiDOM:isForInternal:1
736     @@ForCheck: ManakaiDOM|ForClass
737     @@enDesc:
738     Returns the next character.
739     @@Return:
740     @@@Type: idl|long||ManakaiDOM|all
741     @@@enDesc:
742     The code position number of the next character, if any,
743 wakaba 1.6 or <CODE::-1>.
744 wakaba 1.1 @@@PerlDef:
745     if (@{$self->{char}}) {
746     $r = shift @{$self->{char}};
747     } else {
748 wakaba 1.6 GETCHAR: {
749 wakaba 1.27 no warnings 'closed'; # getc() on closed filehandle warning
750     my $ent = $self->{entity}->[-1];
751 wakaba 1.32 my $char = $ent->{fh}->getc;
752 wakaba 1.6
753 wakaba 1.7 if (defined $char and length $char) {
754 wakaba 1.27 $ent->{pos}++;
755 wakaba 1.6 $r = ord $char;
756     if ($r == 0x000A) {
757 wakaba 1.27 $ent->{line}++;
758     $ent->{column} = 1;
759 wakaba 1.6 } elsif ($r == 0x000D) {
760 wakaba 1.32 my $next_char = $ent->{fh}->getc;
761 wakaba 1.6 if ($next_char eq "\x0A") {
762 wakaba 1.27 if ($ent->{is_external_entity}) {
763     $ent->{pos}++;
764     $ent->{line}++;
765     $ent->{column} = 1;
766     $r = 0x000A; # ^ U+000D U+000A -> U+000A ^
767     } else { # Internal entity
768     $ent->{column}++;
769     ## Line number will be increased by next |shiftChar|.
770     $ent->{fh}->ungetc (0x000A);
771     #$r = 0x000D; # ^ U+000D U+000A -> U+000D ^ U+000A
772     # no change
773     }
774 wakaba 1.6 } elsif ($next_char eq "\x85") {
775     if ($self->{xml_version} eq '1.1') {
776 wakaba 1.27 if ($ent->{is_external_entity}) {
777     if ($ent->{no_xml11_eol}) {
778     my $location = {
779     utf32_offset => $ent->{pos} - 1,
780     line_number => $ent->{line},
781     column_number => $ent->{column},
782     };
783     my $continue = __c|ERROR{
784     xp|fatal-xml11-end-of-line-in-xml-declaration::
785     c|location => {$location},
786     xp|character-number => {$r},
787     }__;
788     unless ($continue) {
789     __CODE{ParseError}__;
790     }
791     } # no_xml11_eol
792     $ent->{pos}++;
793     $ent->{line}++;
794     $ent->{column} = 1;
795     $r = 0x000A; # ^ U+000D U+0085 -> U+000A ^
796     } else { # internal entity
797     $ent->{column}++;
798     ## Line number will be increased by next |shiftChar|.
799     $ent->{fh}->ungetc (0x0085);
800     #$r = 0x000D; # ^ U+000D U+0085 -> U+000D ^ U+0085
801     # no change
802     }
803     } else { # XML 1.0
804 wakaba 1.16 ## |no_xml11_eol| will be tested later.
805 wakaba 1.27 $ent->{column}++;
806     ## Line number will be increased by next |shiftChar|.
807     $ent->{fh}->ungetc (0x0085);
808     $r = 0x000A if $ent->{is_external_entity};
809     # external: ^ U+000D U+0085 -> U+000A ^ U+0085
810     # internal: ^ U+000D U+0085 -> U+000D ^ U+0085 (as is)
811 wakaba 1.6 }
812 wakaba 1.27 } else { # neither U+000A nor U+0085
813     $ent->{line}++;
814     $ent->{column} = 1;
815     $ent->{fh}->ungetc (ord $next_char);
816     $r = 0x000A if $ent->{is_external_entity};
817     # external: ^ U+000D _ -> U+000A ^ _
818     # internal: ^ U+000D _ -> U+000D ^ _ (as is)
819 wakaba 1.6 }
820 wakaba 1.27 } elsif ($r == 0x0085 or $r == 0x2028) {
821     if ($ent->{no_xml11_eol}) {
822     my $location = {
823     utf32_offset => $ent->{pos} - 1,
824     line_number => $ent->{line},
825     column_number => $ent->{column},
826     };
827     my $continue = __c|ERROR{
828     xp|fatal-xml11-end-of-line-in-xml-declaration::
829     c|location => {$location},
830     xp|character-number => {$r},
831     }__;
832     unless ($continue) {
833     __CODE{ParseError}__;
834     }
835     } # no_xml11_eol
836     $r = 0x000A if $self->{xml_version} eq '1.1' and
837     $ent->{is_external_entity};
838     ## Even in XML 1.0 it increases the line number.
839     $ent->{line}++;
840     $ent->{column} = 1;
841 wakaba 1.6 } elsif (
842     not ((0x0020 <= $r and $r <= 0x007E) or
843     (0x00A0 <= $r and $r <= 0xD7FF) or
844     (0xE000 <= $r and $r <= 0xFFFD) or
845     (0x10000 <= $r and $r <= 0x10FFFF)) and
846 wakaba 1.27 $r != 0x0009 and
847     not (($self->{xml_version} eq '1.0' or
848     not $ent->{is_external_entity}) and
849     (0x007F <= $r and $r <= 0x009F)) and
850     not ($self->{xml_version} eq '1.1' and
851     not $ent->{is_external_entity} and
852     0x0001 <= $r and $r <= 0x001F)
853 wakaba 1.6 ) {
854     my $location = {
855 wakaba 1.27 utf32_offset => $ent->{pos} - 1,
856     line_number => $ent->{line},
857     column_number => $ent->{column},
858 wakaba 1.6 };
859 wakaba 1.27 my $continue = __c|ERROR{xp|wf-legal-literal-character::
860     c|location => {$location},
861 wakaba 1.6 xp|character-number => {$r},
862     }__;
863     unless ($continue) {
864 wakaba 1.27 __CODE{ParseError}__;
865 wakaba 1.3 }
866 wakaba 1.27 $ent->{column}++;
867     } else { # XML |Char|
868     $ent->{column}++;
869 wakaba 1.3 }
870     } else {
871 wakaba 1.6 $r = -1;
872 wakaba 1.3 }
873 wakaba 1.6 } # GETCHAR
874 wakaba 1.1 }
875    
876     @Method:
877     @@ManakaiDOM:isForInternal: 1
878     @@Operator: ManakaiDOM|MUErrorHandler
879     @@enDesc:
880     When a <IF::ecore|ErrorInterface||ManakaiDOM|Perl> is <Perl::report>ed,
881     then this method is invoked.
882    
883     The method calls the <cfg::DOMCore|error-handler> if the error is of
884     <IF::DOMCore|DOMError>. Otherwise, the error is re-thrown so that
885     corresponding <Perl::catch> clause, if any, can catch the error.
886     @@Param:
887     @@@Name: err
888     @@@Type: ecore|ErrorInterface||ManakaiDOM|Perl
889     @@@enDesc:
890     The reported error object.
891     @@Return:
892     @@@Type: DISPerl|Any
893     @@@enDesc:
894     If the <P::err> is a <IF::DOMCore|DOMError>, then the return value
895     of the error handler.
896    
897     {NOTE:: If the error is thrown, the method never returns.
898     }
899     @@@nullCase:
900     @@@@enDesc:
901     No error handler.
902     @@@PerlDef:
903     if ($err->isa (<IFName::DOMCore|DOMError||ManakaiDOM|ManakaiDOM>)) {
904     __DEEP{
905     A: {
906     my $cfg = $self-><AG::LSParser.domConfig>;
907     my $h = $cfg-><M::DOMCore|DOMConfiguration.getParameter>
908     ('error-handler');
909     $r = $h-><M::DOMCore|DOMErrorHandler.handleError> ($err);
910     } # A
911     }__;
912     } else {
913     $err-><M::ecore|ErrorInterface||ManakaiDOM|Perl.throw>;
914     }
915    
916     @DISPerl:dpgDef:
917    
918     /*
919     XML Document Entity
920    
921     document := prolog element *Misc
922     - *Char RestrictedChar *Char ;; [1]
923     */
924 wakaba 1.11 rule DocumentEntity : standalone {
925 wakaba 1.1 /*
926     prolog := XMLDecl? *Misc [doctypedecl *Misc] ;; [22]
927     */
928 wakaba 1.16 ?lexmode DocumentStart;
929 wakaba 1.11
930     my $doc;
931     lang:Perl {
932     $doc = $self->{doc};
933     }
934 wakaba 1.1
935 wakaba 1.3 ~? (XDO) {
936 wakaba 1.16 ?lexmode XMLDeclarationOrPI;
937     lang:Perl {
938     $self->{entity}->[-1]->{no_xml11_eol} = true;
939     }
940     ~ (S) { // XML declaration
941     &_XMLDeclaration_ ($doc => $doc);
942     ~ (PIC2) {
943     ?lexmode DocumentProlog;
944     } else {
945     ?lexmode DocumentProlog;
946     }
947     } (NameChar) { // Processing instruction whose target begins with |xml|
948     my $target_token;
949     lang:Perl ($v => $token.value) {
950     $target_token = $token;
951     $target_token->{value} = 'xml'.$target_token->{value};
952     $self->{entity}->[-1]->{no_xml11_eol} = false;
953     }
954     ?lexmode PINmtoken;
955     ~? (Nmtoken) {
956     lang:Perl ($v => $token.value) {
957     $target_token->{value} .= $v;
958     }
959     ?lexmode PIName;
960     }
961     lang:Perl {
962     $target_token->{type} = 'Name';
963     $target_token->{location_d} += 3; # 'xml'
964     unshift @{$self->{token}}, $token;
965     $token = $target_token;
966     }
967     &_ProcessingInstruction_ ($doc => $doc, $parent => $doc);
968     ~ (PIC) {
969     ?lexmode DocumentProlog;
970     } else {
971     ?lexmode DocumentProlog;
972     }
973 wakaba 1.3 } else {
974 wakaba 1.16 lang:Perl {
975     $self->{entity}->[-1]->{no_xml11_eol} = false;
976     }
977 wakaba 1.3 }
978     } else {
979     ?lexmode 'DocumentProlog';
980     }
981 wakaba 1.1
982     // *Misc
983 wakaba 1.2 ~* (CDO) {
984 wakaba 1.1 &_CommentDeclaration_ ($doc => $doc, $parent => $doc);
985    
986     ~ (MDC) {
987     ?lexmode DocumentProlog;
988     } else {
989     ?lexmode DocumentProlog;
990     }
991     } (PIO) {
992     &_ProcessingInstruction_ ($doc => $doc, $parent => $doc);
993    
994     ~ (PIC) {
995     ?lexmode 'DocumentProlog';
996     } else {
997     ?lexmode DocumentProlog;
998     }
999     } (S) {
1000     //
1001     }
1002    
1003     // doctypedecl
1004     ~? (MDO) {
1005     &_DocumentTypeDeclaration_ ($doc => $doc);
1006    
1007 wakaba 1.3 ~ (MDC) {
1008     ?lexmode DocumentMisc;
1009     } else {
1010     ?lexmode DocumentMisc;
1011     }
1012     } else {
1013     ?lexmode DocumentMisc;
1014 wakaba 1.1 }
1015 wakaba 1.25
1016     lang:Perl {
1017     $self->{doc}-><AS::Document.allDeclarationsProcessed> (true)
1018     unless $self->{dont_process};
1019     }
1020 wakaba 1.1
1021     // *Misc
1022 wakaba 1.2 ~* (CDO) {
1023 wakaba 1.1 &_CommentDeclaration_ ($doc => $doc, $parent => $doc);
1024    
1025     ~ (MDC) {
1026     ?lexmode DocumentMisc;
1027     } else {
1028     ?lexmode DocumentMisc;
1029     }
1030     } (PIO) {
1031     &_ProcessingInstruction_ ($doc => $doc, $parent => $doc);
1032    
1033     ~ (PIC) {
1034     ?lexmode 'DocumentMisc';
1035     } else {
1036     ?lexmode DocumentMisc;
1037     }
1038     } (S) {
1039     //
1040     }
1041    
1042     // Document element
1043     ~ (STAGO) {
1044     &Element_ ($doc => $doc, $parent => $doc)
1045     : unshift-current-token;
1046     ~ (TAGC) {
1047     ?lexmode DocumentEnd;
1048     } else {
1049     ?lexmode DocumentEnd;
1050     }
1051     } else {
1052     ?lexmode 'DocumentEnd';
1053     }
1054    
1055     // *Misc
1056 wakaba 1.2 ~* (CDO) {
1057 wakaba 1.1 &_CommentDeclaration_ ($doc => $doc, $parent => $doc);
1058    
1059     ~ (MDC) {
1060     ?lexmode DocumentEnd;
1061     } else {
1062     ?lexmode DocumentEnd;
1063     }
1064     } (PIO) {
1065     &_ProcessingInstruction_ ($doc => $doc, $parent => $doc);
1066     ~ (PIC) {
1067     ?lexmode 'DocumentEnd';
1068     } else {
1069     ?lexmode DocumentEnd;
1070     }
1071     } (S) {
1072     //
1073     }
1074    
1075     ~ (#EOF) { }
1076     } // DocumentEntity
1077 wakaba 1.11
1078     /*
1079     Internal General Parsed Entity
1080    
1081     An internal general parsed entity is well-formed if its
1082     replacement text matches the production labeled |content|.
1083     */
1084     rule InternalGeneralParsedEntity ($ent) : standalone {
1085     ?lexmode ElementContent;
1086    
1087     my $ns;
1088     lang:Perl {
1089     $ns = {
1090     xml => <Q::xml:>,
1091     xmlns => <Q::xmlns:>,
1092     };
1093     }
1094    
1095     &content ($parent => $ent, $ns => $ns);
1096    
1097     ~ (#EOF) { }
1098     } // InternalGeneralParsedEntity
1099    
1100 wakaba 1.1 /*
1101     XML Declaration
1102    
1103     XMLDecl := '<?xml' VersionInfo
1104     [EncodingDecl]
1105     [SDDecl]
1106     [S] '?>' ;; [23]
1107    
1108     NOTE: XML declaration is optional in XML 1.0
1109     while it is required in XML 1.1.
1110     */
1111 wakaba 1.16 rule _XMLDeclaration_ {
1112     // ~ (XDO) { }
1113 wakaba 1.3 ?lexmode XMLDeclaration;
1114 wakaba 1.16 //lang:Perl {
1115     // $self->{entity}->[-1]->{no_xml11_eol} = true;
1116     //}
1117     //~ (S) { }
1118 wakaba 1.3
1119     ~ (Name == 'version') {
1120     ~? (S) { }
1121     ~ (VI) { }
1122     ~? (S) { }
1123 wakaba 1.1
1124 wakaba 1.3 my $ver;
1125     my $bad_token;
1126    
1127     ~ (LIT) {
1128     ?lexmode AttributeValueLiteral;
1129    
1130     ~ (STRING) {
1131     lang:Perl ($version => $token.value) {
1132     $ver = $version;
1133     $bad_token = $token;
1134     }
1135     }
1136    
1137     ~ (LIT) {
1138     ?lexmode XMLDeclaration;
1139     }
1140     } (LITA) {
1141     ?lexmode AttributeValueLiteralA;
1142    
1143     ~ (STRING) {
1144     lang:Perl ($version => $token.value) {
1145     $ver = $version;
1146     $bad_token = $token;
1147     }
1148     }
1149    
1150     ~ (LITA) {
1151     ?lexmode XMLDeclaration;
1152     }
1153     }
1154    
1155     lang:Perl : has-error {
1156     unless ($ver eq '1.0' or $ver eq '1.1') {
1157     my $location;
1158     __CODE{xp|get-location-from-token::
1159     $token => {$bad_token},
1160     $result => {$location},
1161     }__;
1162     my $continue = __DOMCore:ERROR{xp|wf-unsupported-xml-version::
1163     DOMCore|location => {$location},
1164 wakaba 1.16 xp|parent => {$self->{doc}},
1165 wakaba 1.3 infoset|version => {$ver},
1166     xp|error-token => {$bad_token},
1167     }__;
1168     unless ($continue) {
1169 wakaba 1.27 __CODE{ParseError}__;
1170 wakaba 1.3 }
1171     }
1172 wakaba 1.16 $self->{doc}-><AS::Document.xmlVersion> ($ver);
1173 wakaba 1.3 $self->{xml_version} = $ver;
1174     }
1175    
1176     ~? (S) { }
1177 wakaba 1.1 }
1178    
1179 wakaba 1.3 ~? (Name == 'encoding') {
1180     ~? (S) { }
1181     ~ (VI) { }
1182     ~? (S) { }
1183    
1184     my $ver;
1185     my $bad_token;
1186    
1187     ~ (LIT) {
1188     ?lexmode AttributeValueLiteral;
1189    
1190     ~ (STRING) {
1191     lang:Perl ($version => $token.value) {
1192     $ver = $version;
1193     $bad_token = $token;
1194     }
1195     }
1196    
1197     ~ (LIT) {
1198     ?lexmode XMLDeclaration;
1199     }
1200     } (LITA) {
1201     ?lexmode AttributeValueLiteralA;
1202    
1203     ~ (STRING) {
1204     lang:Perl ($version => $token.value) {
1205     $ver = $version;
1206     $bad_token = $token;
1207     }
1208     }
1209    
1210     ~ (LITA) {
1211     ?lexmode XMLDeclaration;
1212     }
1213     }
1214    
1215     lang:Perl : has-error {
1216     unless ($ver =~ /\A[A-Za-z][A-Za-z0-9._-]*\z/) {
1217     my $location;
1218     __CODE{xp|get-location-from-token::
1219     $token => {$bad_token},
1220     $result => {$location},
1221     }__;
1222     my $continue = __DOMCore:ERROR{xp|wf-malformed-enc-name::
1223     DOMCore|location => {$location},
1224 wakaba 1.16 xp|parent => {$self->{doc}},
1225 wakaba 1.3 xp|name => {$ver},
1226     xp|error-token => {$bad_token},
1227     }__;
1228     unless ($continue) {
1229 wakaba 1.27 __CODE{ParseError}__;
1230 wakaba 1.3 }
1231     }
1232 wakaba 1.16 $self->{doc}-><AS::Document.xmlEncoding> ($ver);
1233 wakaba 1.3 }
1234    
1235     ~? (S) { }
1236 wakaba 1.1 }
1237 wakaba 1.3
1238     ~? (Name == 'standalone') {
1239     ~? (S) { }
1240     ~ (VI) { }
1241     ~? (S) { }
1242    
1243     my $ver;
1244     my $bad_token;
1245    
1246     ~ (LIT) {
1247     ?lexmode AttributeValueLiteral;
1248    
1249     ~ (STRING) {
1250     lang:Perl ($version => $token.value) {
1251     $ver = $version;
1252     $bad_token = $token;
1253     }
1254     }
1255    
1256     ~ (LIT) {
1257     ?lexmode XMLDeclaration;
1258     }
1259     } (LITA) {
1260     ?lexmode AttributeValueLiteralA;
1261    
1262     ~ (STRING) {
1263     lang:Perl ($version => $token.value) {
1264     $ver = $version;
1265     $bad_token = $token;
1266     }
1267     }
1268 wakaba 1.1
1269 wakaba 1.3 ~ (LITA) {
1270     ?lexmode XMLDeclaration;
1271     }
1272     }
1273    
1274     lang:Perl : has-error {
1275     unless ($ver eq 'yes' or $ver eq 'no') {
1276     my $location;
1277     __CODE{xp|get-location-from-token::
1278     $token => {$bad_token},
1279     $result => {$location},
1280     }__;
1281     my $continue = __DOMCore:ERROR{xp|wf-malformed-xml-standalone::
1282     DOMCore|location => {$location},
1283 wakaba 1.16 xp|parent => {$self->{doc}},
1284 wakaba 1.3 xp|name => {$ver},
1285     xp|error-token => {$bad_token},
1286     }__;
1287     unless ($continue) {
1288 wakaba 1.27 __CODE{ParseError}__;
1289 wakaba 1.3 }
1290     }
1291 wakaba 1.13 if ($ver eq 'yes') {
1292 wakaba 1.16 $self->{doc}-><AS::Document.xmlStandalone> (true);
1293 wakaba 1.13 $self->{standalone} = true;
1294     }
1295 wakaba 1.3 }
1296    
1297     ~? (S) { }
1298     }
1299    
1300 wakaba 1.16 ~ (PIC1) {
1301     lang:Perl {
1302     $self->{entity}->[-1]->{no_xml11_eol} = false;
1303     }
1304     } else {
1305     lang:Perl {
1306     $self->{entity}->[-1]->{no_xml11_eol} = false;
1307     }
1308     }
1309    
1310     // ~ (PIC2) { }
1311 wakaba 1.3 } // _XMLDeclaration_
1312 wakaba 1.1
1313     /*
1314     Comment Declaration
1315    
1316     Comment := '<!--' *(Char - '-' / '-' (Char - '-'))
1317     '-->' ;; [15]
1318 wakaba 1.4 */
1319 wakaba 1.1 rule _CommentDeclaration_ ($doc, $parent) {
1320     ?lexmode 'CommentDeclaration';
1321    
1322     ~? (STRING) {
1323     lang:Perl ($data => $token.value) {
1324     my $com = $doc-><M::Document.createComment> ($data);
1325     $parent-><M::Node.appendChild> ($com);
1326     }
1327     } else {
1328     lang:Perl {
1329     my $com = $doc-><M::Document.createComment> ('');
1330     $parent-><M::Node.appendChild> ($com);
1331     }
1332     }
1333    
1334     ~ (COM) {
1335     ?lexmode MarkupDeclaration;
1336     } else {
1337     ?lexmode MarkupDeclaration;
1338     }
1339    
1340     // ~ (MDC) { }
1341 wakaba 1.4 } // _CommentDeclaration
1342 wakaba 1.15
1343     rule _CommentDeclarationDTD {
1344     ?lexmode CommentDeclaration;
1345 wakaba 1.4
1346     ~? (STRING) {
1347     //
1348     }
1349    
1350     ~ (COM) {
1351     ?lexmode MarkupDeclaration;
1352     } else {
1353     ?lexmode MarkupDeclaration;
1354     }
1355    
1356     ~ (MDC) {
1357     ?lexmode DTD;
1358     } else {
1359     ?lexmode DTD;
1360     }
1361     } // _CommentDeclarationDTD
1362    
1363 wakaba 1.1 /*
1364     Processing Instruction
1365    
1366     PI := '<?' PITarget [S *Char - *Char '?>' *Char]
1367     '?>' ;; [16]
1368     */
1369     rule _ProcessingInstruction_ ($doc, $parent) {
1370     ?lexmode 'PIName';
1371    
1372     my $pi;
1373    
1374     ~ (Name) {
1375 wakaba 1.3 lang:Perl ($name => $token.value) : has-error {
1376 wakaba 1.1 if (lc $name eq 'xml') {
1377 wakaba 1.3 my $location;
1378     __CODE{xp|get-location-from-token::
1379     $token => {$token},
1380     $result => {$location},
1381     }__;
1382     my $continue = __DOMCore:ERROR{xp|wf-pi-target-is-xml::
1383     xp|name => {$name},
1384     DOMCore|location => {$location},
1385     xp|parent => {$parent},
1386     }__;
1387     unless ($continue) {
1388 wakaba 1.27 __CODE{ParseError}__;
1389 wakaba 1.3 }
1390 wakaba 1.1 }
1391 wakaba 1.26 __CODE{checkNCName:: $name => $name}__;
1392    
1393 wakaba 1.1 $pi = $doc-><M::Document.createProcessingInstruction>
1394     ($name);
1395     }
1396 wakaba 1.14 } else {
1397     lang:Perl {
1398     $pi = $doc-><M::Document.createProcessingInstruction> ('#INVALID');
1399     }
1400 wakaba 1.1 }
1401    
1402 wakaba 1.14 ~? (S) {
1403 wakaba 1.1 ?lexmode 'PIData';
1404    
1405     my $tdata;
1406    
1407     ~? (DATA) {
1408     lang:Perl ($data => $token.value) {
1409     $tdata = $data;
1410     }
1411     } else {
1412     lang:Perl {
1413     $tdata = '';
1414     }
1415     }
1416    
1417     lang:Perl {
1418     $pi-><AS::Node.nodeValue> ($tdata);
1419     }
1420     }
1421    
1422     lang:Perl {
1423     $parent-><M::Node.appendChild> ($pi);
1424     }
1425    
1426     // ~ (PIC) { }
1427     } // _ProcessingInstruction_
1428 wakaba 1.4
1429 wakaba 1.6 /*
1430     Processing instruction in DTD
1431     */
1432     rule _ProcessingInstructionDTD ($doc, $doctype) {
1433 wakaba 1.4 ?lexmode 'PIName';
1434 wakaba 1.6
1435     my $pi;
1436 wakaba 1.4
1437     ~ (Name) {
1438 wakaba 1.6 lang:Perl ($name => $token.value) : has-error {
1439     if (lc $name eq 'xml') {
1440     my $location;
1441     __CODE{xp|get-location-from-token::
1442     $token => {$token},
1443     $result => {$location},
1444     }__;
1445     my $continue = __DOMCore:ERROR{xp|wf-pi-target-is-xml::
1446     xp|name => {$name},
1447     DOMCore|location => {$location},
1448     xp|parent => {$doctype},
1449     }__;
1450     unless ($continue) {
1451 wakaba 1.27 __CODE{ParseError}__;
1452 wakaba 1.6 }
1453     }
1454 wakaba 1.26 __CODE{checkNCName:: $name => $name}__;
1455    
1456 wakaba 1.6 $pi = $doc-><M::Document.createProcessingInstruction>
1457     ($name);
1458 wakaba 1.35 $pi-><AS::tx|ProcessingInstruction.manakaiBaseURI>
1459 wakaba 1.29 ($self->{location}->{base_uri});
1460 wakaba 1.6 }
1461 wakaba 1.14 } else {
1462     lang:Perl {
1463     $pi = $doc-><M::Document.createProcessingInstruction> ('#INVALID');
1464     }
1465 wakaba 1.4 }
1466    
1467 wakaba 1.14 ~? (S) {
1468 wakaba 1.4 ?lexmode 'PIData';
1469    
1470 wakaba 1.6 my $tdata;
1471    
1472 wakaba 1.4 ~? (DATA) {
1473 wakaba 1.6 lang:Perl ($data => $token.value) {
1474     $tdata = $data;
1475     }
1476     } else {
1477     lang:Perl {
1478     $tdata = '';
1479     }
1480     }
1481    
1482     lang:Perl {
1483     $pi-><AS::Node.nodeValue> ($tdata);
1484 wakaba 1.4 }
1485     }
1486    
1487 wakaba 1.6 lang:Perl {
1488     $doctype-><M::Node.appendChild> ($pi);
1489     }
1490    
1491 wakaba 1.4 ~ (PIC) {
1492     ?lexmode DTD;
1493     } else {
1494     ?lexmode DTD;
1495     }
1496     } // _ProcessingInstructionDTD
1497 wakaba 1.1
1498     /*
1499     Element content parsing mode
1500    
1501     element := EmptyElemTag /
1502     STag content ETag ;; [39]
1503     content := (CharData / element / Reference / CDSect /
1504     PI / Comment) ;; [43]
1505     */
1506 wakaba 1.6 rule Element_ ($doc, $parent, $ns) : standalone {
1507 wakaba 1.1 ?lexmode 'ElementContent';
1508    
1509     my $node; // Current "parent" node
1510     my $nodes; // Node stack (w/o $current_node)
1511     my $type; // Current "parent" element type QName
1512     my $types; // Element type stack (w/o $current_type)
1513 wakaba 1.6 //my $ns; // Current in-scope namespace bindings
1514 wakaba 1.1 my $nses; // Namespace binding stack (w/o $current_ns)
1515    
1516     lang:Perl {
1517     $node = $parent;
1518     $nodes = [];
1519     $type = '';
1520     $types = [];
1521 wakaba 1.6 $ns ||= {
1522 wakaba 1.1 xml => <Q::xml:>,
1523     xmlns => <Q::xmlns:>,
1524     };
1525     $nses = [];
1526     }
1527    
1528     ~* : name => CONTENT
1529     (CharData) {
1530     // Character data
1531     lang:Perl ($data => $token.value) {
1532 wakaba 1.31 $node-><M::Node.manakaiAppendText> (\($data));
1533 wakaba 1.1 }
1534     } (STAGO) {
1535     // Start tag or empty element tag
1536    
1537     ?lexmode 'StartTag';
1538    
1539     ~ (Name) {
1540     my $attrs;
1541 wakaba 1.26 lang:Perl ($name => $token.value) : has-error {
1542     __CODE{checkQName:: $name => $name}__;
1543 wakaba 1.1 push @{$types}, $type;
1544     $type = $name;
1545     $attrs = {};
1546     }
1547    
1548     ~? (S) {
1549     &AttributeSpecificationList
1550     ($doc => $doc, $attrs => $attrs);
1551     }
1552    
1553     my $el;
1554 wakaba 1.9
1555     /*
1556     Note that this implementation does not perform
1557     attribute value tokenization (but does white space
1558     normalization common to attribute types) and
1559     construct the tree as is. DOM Level 3 Core spec
1560     is unclear on this point. With tokenization,
1561     entity references cannot be preserved.
1562    
1563     The manakai Node.nodeValue and Attr.value attributes
1564     do tokenization according to attribute types.
1565     */
1566    
1567     /*
1568     ISSUE: Should |xml:id| attribute be typed?
1569     */
1570 wakaba 1.1
1571     lang:Perl {
1572     push @{$nses}, $ns;
1573     $ns = {%$ns};
1574 wakaba 1.26
1575     ## Default attributes
1576     DA: for my $atqname (%{$self->{attr}->{$type}}) {
1577     next DA unless $self->{attr}->{$type}->{$atqname};
1578     next DA if exists $attrs->{$atqname}; # specified
1579     my $dtype = $self->{attr}->{$type}->{$atqname}
1580     -><AG::ATDef.defaultType>;
1581     next DA unless $dtype == <C::ATDef.EXPLICIT_DEFAULT> or
1582     $dtype == <C::ATDef.FIXED_DEFAULT>;
1583     $attrs->{$atqname} = {is_default => true, nodes => []};
1584     for (@{$self->{attr}->{$type}->{$atqname}
1585     -><AG::Node.childNodes>}) {
1586     push @{$attrs->{$atqname}->{nodes}},
1587     $_-><M::Node.cloneNode> (true);
1588     }
1589     }
1590 wakaba 1.1
1591     my %gattr;
1592     my %lattr;
1593     for my $atqname (keys %$attrs) {
1594     my ($pfx, $lname) = split /:/, $atqname;
1595 wakaba 1.9 $attrs->{$atqname}->{def} = $self->{attr}->{$type}->{$atqname};
1596 wakaba 1.1 if (defined $lname) { ## Global attribute
1597     if ($pfx eq 'xmlns') {
1598 wakaba 1.26 my $nsuri = $attrs->{$atqname}->{is_default}
1599     ? $attrs->{$atqname}->{def}-><AG::Node.nodeValue>
1600     : $attrs->{$atqname}->{value};
1601     if (not $attrs->{$atqname}->{is_default} and
1602     $attrs->{$atqname}->{def}) {
1603 wakaba 1.9 my $dt = $attrs->{$atqname}->{def}-><AG::ATDef.declaredType>;
1604     if ({
1605     <C::ATDef.ID_ATTR> => true,
1606     <C::ATDef.IDREF_ATTR> => true,
1607     <C::ATDef.IDREFS_ATTR> => true,
1608     <C::ATDef.ENTITY_ATTR> => true,
1609     <C::ATDef.ENTITIES_ATTR> => true,
1610     <C::ATDef.NMTOKEN_ATTR> => true,
1611     <C::ATDef.NMTOKENS_ATTR> => true,
1612     <C::ATDef.NOTATION_ATTR> => true,
1613     <C::ATDef.ENUMERATION_ATTR> => true,
1614     }->{$dt}) {
1615     ## Tokenization (XML 1 3.3.3)
1616 wakaba 1.26 for ($nsuri) {
1617 wakaba 1.9 s/^\x20+//;
1618     s/\x20+\z//;
1619     s/\x20+/ /g;
1620     }
1621     }
1622     }
1623 wakaba 1.26 if ($lname eq 'xml' and
1624     $nsuri ne <Q::xml:>) {
1625     my $location;
1626     __CODE{xp|get-location-from-token::
1627     $token => $token,
1628     $result => $location,
1629     }__;
1630     my $continue = __c|ERROR{xp|nsc-reserved-prefix-xml::
1631     c|location => {$location},
1632     xp|token => {$token},
1633     infoset|prefix => {$lname},
1634     infoset|namespaceName => {$nsuri},
1635     }__;
1636     unless ($continue) {
1637 wakaba 1.27 __CODE{ParseError}__;
1638 wakaba 1.26 }
1639     } elsif ($lname eq 'xmlns') {
1640     my $location;
1641     __CODE{xp|get-location-from-token::
1642     $token => $token,
1643     $result => $location,
1644     }__;
1645     my $continue = __c|ERROR{xp|nsc-reserved-prefix-xmlns::
1646     c|location => {$location},
1647     xp|token => {$token},
1648     infoset|prefix => {$lname},
1649     infoset|namespaceName => {$nsuri},
1650     }__;
1651     unless ($continue) {
1652 wakaba 1.27 __CODE{ParseError}__;
1653 wakaba 1.26 }
1654     }
1655     if ($nsuri eq '') {
1656     if ($self->{xml_version} eq '1.0') {
1657     my $location;
1658     __CODE{xp|get-location-from-token::
1659     $token => $token,
1660     $result => $location,
1661     }__;
1662     my $continue = __c|ERROR{xp|nswf-empty-namespace-name::
1663     c|location => {$location},
1664     xp|token => {$token},
1665     infoset|namespaceName => {$nsuri},
1666     infoset|prefix => {$lname},
1667     }__;
1668     unless ($continue) {
1669 wakaba 1.27 __CODE{ParseError}__;
1670 wakaba 1.26 }
1671     }
1672     } elsif ($nsuri eq <Q::xml:> and
1673     $lname ne 'xml') {
1674     my $location;
1675     __CODE{xp|get-location-from-token::
1676     $token => $token,
1677     $result => $location,
1678     }__;
1679     my $continue = __c|ERROR{
1680     xp|nsc-reserved-namespace-name-xml::
1681     c|location => {$location},
1682     xp|token => {$token},
1683     infoset|prefix => {$lname},
1684     infoset|namespaceName => {$nsuri},
1685     }__;
1686     unless ($continue) {
1687 wakaba 1.27 __CODE{ParseError}__;
1688 wakaba 1.26 }
1689     } elsif ($nsuri eq <Q::xmlns:>) {
1690     my $location;
1691     __CODE{xp|get-location-from-token::
1692     $token => $token,
1693     $result => $location,
1694     }__;
1695     my $continue = __c|ERROR{
1696     xp|nsc-reserved-namespace-name-xmlns::
1697     c|location => {$location},
1698     xp|token => {$token},
1699     infoset|prefix => {$lname},
1700     infoset|namespaceName => {$nsuri},
1701     }__;
1702     unless ($continue) {
1703 wakaba 1.27 __CODE{ParseError}__;
1704 wakaba 1.26 }
1705     }
1706     $ns->{$lname} = $nsuri;
1707 wakaba 1.1 delete $ns->{$lname} unless length $ns->{$lname};
1708     }
1709     $gattr{$pfx}->{$lname} = $attrs->{$atqname};
1710     } else { ## Local attribute
1711     if ($pfx eq 'xmlns') {
1712 wakaba 1.26 $ns->{''} = $attrs->{xmlns}->{is_default}
1713     ? $attrs->{xmlns}->{def}-><AG::Node.nodeValue>
1714     : $attrs->{xmlns}->{value};
1715     if (not $attrs->{$atqname}->{is_default} and
1716     $attrs->{$atqname}->{def}) {
1717 wakaba 1.9 my $dt = $attrs->{$atqname}->{def}-><AG::ATDef.declaredType>;
1718     if ({
1719     <C::ATDef.ID_ATTR> => true,
1720     <C::ATDef.IDREF_ATTR> => true,
1721     <C::ATDef.IDREFS_ATTR> => true,
1722     <C::ATDef.ENTITY_ATTR> => true,
1723     <C::ATDef.ENTITIES_ATTR> => true,
1724     <C::ATDef.NMTOKEN_ATTR> => true,
1725     <C::ATDef.NMTOKENS_ATTR> => true,
1726     <C::ATDef.NOTATION_ATTR> => true,
1727     <C::ATDef.ENUMERATION_ATTR> => true,
1728     }->{$dt}) {
1729     ## Tokenization (XML 1 3.3.3)
1730     for ($ns->{''}) {
1731     s/^\x20+//;
1732     s/\x20+\z//;
1733     s/\x20+/ /g;
1734     }
1735     }
1736     }
1737 wakaba 1.26 unless ($ns->{''}) {
1738     delete $ns->{''};
1739     } elsif ($ns->{''} eq <Q::xml:>) {
1740     my $location;
1741     __CODE{xp|get-location-from-token::
1742     $token => $token,
1743     $result => $location,
1744     }__;
1745     my $continue = __c|ERROR{
1746     xp|nsc-reserved-namespace-name-xml::
1747     c|location => {$location},
1748     xp|token => {$token},
1749     infoset|prefix => {null},
1750     infoset|namespaceName => {<Q::xml:>},
1751     }__;
1752     unless ($continue) {
1753 wakaba 1.27 __CODE{ParseError}__;
1754 wakaba 1.26 }
1755     } elsif ($ns->{''} eq <Q::xmlns:>) {
1756     my $location;
1757     __CODE{xp|get-location-from-token::
1758     $token => $token,
1759     $result => $location,
1760     }__;
1761     my $continue = __c|ERROR{
1762     xp|nsc-reserved-namespace-name-xmlns::
1763     c|location => {$location},
1764     xp|token => {$token},
1765     infoset|prefix => {null},
1766     infoset|namespaceName => {<Q::xmlns:>},
1767     }__;
1768     unless ($continue) {
1769 wakaba 1.27 __CODE{ParseError}__;
1770 wakaba 1.26 }
1771     }
1772 wakaba 1.1 } else {
1773     $lattr{$pfx} = $attrs->{$atqname};
1774     }
1775     }
1776     }
1777    
1778     my ($pfx, $lname) = split /:/, $type;
1779     my $nsuri;
1780     if (defined $lname) { ## Prefixed namespace
1781     if (defined $ns->{$pfx}) {
1782     $nsuri = $ns->{$pfx};
1783     } else {
1784 wakaba 1.26 my $location;
1785     __CODE{xp|get-location-from-token::
1786     $token => $token,
1787     $result => $location,
1788     }__;
1789     my $continue = __c|ERROR{xp|nsc-prefix-declared::
1790     c|location => {$location},
1791     xp|token => {$token},
1792     infoset|prefix => {$pfx},
1793     xp|name => {$type},
1794     }__;
1795     unless ($continue) {
1796 wakaba 1.27 __CODE{ParseError}__;
1797 wakaba 1.26 }
1798 wakaba 1.1 }
1799     } else { ## Default namespace
1800     $nsuri = $ns->{''};
1801     }
1802    
1803     $el = $doc-><M::Document.createElementNS>
1804     ($nsuri, $type);
1805    
1806     if ($attrs->{xmlns}) {
1807     my $attr = $doc-><M::Document.createAttributeNS>
1808     (<Q::xmlns:>, 'xmlns');
1809     for (@{$attrs->{xmlns}->{nodes}}) {
1810 wakaba 1.31 if ($_-><AG::Node.nodeType> == <C::Node.TEXT_NODE>) {
1811     $attr-><M::Node.manakaiAppendText>
1812     (\($_-><AG::Node.textContent>));
1813     } else {
1814     $attr-><M::Node.appendChild> ($_);
1815     }
1816 wakaba 1.1 }
1817 wakaba 1.9 if ($attrs->{xmlns}->{def}) {
1818 wakaba 1.35 $attr-><AS::Attr.manakaiAttributeType>
1819     ($attrs->{xmlns}->{def}-><AG::ATDef.declaredType>);
1820 wakaba 1.9 }
1821 wakaba 1.1 $el-><M::Element.setAttributeNodeNS> ($attr);
1822 wakaba 1.35 $attr-><AS::Attr.specified> (false)
1823 wakaba 1.26 if $attrs->{xmlns}->{is_default};
1824 wakaba 1.1 }
1825    
1826     for my $lname (keys %lattr) {
1827     my $attr = $doc-><M::Document.createAttributeNS>
1828     (null, $lname);
1829     for (@{$lattr{$lname}->{nodes}}) {
1830 wakaba 1.31 if ($_-><AG::Node.nodeType> == <C::Node.TEXT_NODE>) {
1831     $attr-><M::Node.manakaiAppendText>
1832     (\($_-><AG::Node.textContent>));
1833     } else {
1834     $attr-><M::Node.appendChild> ($_);
1835     }
1836 wakaba 1.1 }
1837 wakaba 1.9 if ($attrs->{$lname}->{def}) {
1838 wakaba 1.35 $attr-><AS::Attr.manakaiAttributeType>
1839     ($attrs->{$lname}->{def}-><AG::ATDef.declaredType>);
1840 wakaba 1.9 }
1841 wakaba 1.1 $el-><M::Element.setAttributeNodeNS> ($attr);
1842 wakaba 1.35 $attr-><AS::Attr.specified> (false)
1843 wakaba 1.26 if $attrs->{$lname}->{is_default};
1844 wakaba 1.1 }
1845    
1846     for my $pfx (keys %gattr) {
1847 wakaba 1.26 LN: for my $lname (keys %{$gattr{$pfx}}) {
1848     my $name = $pfx.':'.$lname;
1849     unless (defined $ns->{$pfx}) {
1850     my $location;
1851     __CODE{xp|get-location-from-token::
1852     $token => $token,
1853     $result => $location,
1854     }__;
1855     my $continue = __c|ERROR{xp|nsc-prefix-declared::
1856     c|location => {$location},
1857     xp|token => {$token},
1858     xp|name => {$name},
1859     infoset|prefix => {$pfx},
1860     }__;
1861     unless ($continue) {
1862 wakaba 1.27 __CODE{ParseError}__;
1863 wakaba 1.26 }
1864     }
1865     my $attr = $el-><M::Element.getAttributeNodeNS>
1866     ($ns->{$pfx}, $lname);
1867     if ($attr) {
1868     my $another_name = $attr-><AG::Node.nodeName>;
1869     if ($name ne $another_name) {
1870     my $location;
1871     __CODE{xp|get-location-from-token::
1872     $token => $token,
1873     $result => $location,
1874     }__;
1875     my $continue = __c|ERROR{
1876     xp|nswf-unique-att-spec-expanded-name::
1877     c|location => {$location},
1878     xp|token => {$token},
1879     xp|another-attribute-name => {$another_name},
1880     xp|name => {$name},
1881     infoset|namespaceName => {$ns->{$pfx}},
1882     infoset|localName => {$lname},
1883     }__;
1884     unless ($continue) {
1885 wakaba 1.27 __CODE{ParseError}__;
1886 wakaba 1.26 }
1887 wakaba 1.35 unless ($attr-><AG::Attr.specified>) {
1888 wakaba 1.26 ## It is a default attribute
1889     $attr = $doc-><M::Document.createAttributeNS>
1890     ($ns->{$pfx}, $name);
1891     } else {
1892     ## It is a specified attribute
1893     next LN;
1894     }
1895     } else { ## There is default attribute
1896     $attr = $doc-><M::Document.createAttributeNS>
1897     ($ns->{$pfx}, $name);
1898     }
1899     } else {
1900     $attr = $doc-><M::Document.createAttributeNS>
1901     ($ns->{$pfx}, $name);
1902     }
1903 wakaba 1.1 for (@{$gattr{$pfx}->{$lname}->{nodes}}) {
1904 wakaba 1.31 if ($_-><AG::Node.nodeType> == <C::Node.TEXT_NODE>) {
1905     $attr-><M::Node.manakaiAppendText>
1906     (\($_-><AG::Node.textContent>));
1907     } else {
1908     $attr-><M::Node.appendChild> ($_);
1909     }
1910 wakaba 1.1 }
1911 wakaba 1.26 if ($gattr{$pfx}->{$lname}->{def}) {
1912 wakaba 1.35 $attr-><AS::Attr.manakaiAttributeType>
1913     ($gattr{$pfx}->{$lname}->{def}
1914     -><AG::ATDef.declaredType>);
1915 wakaba 1.9 }
1916 wakaba 1.1 $el-><M::Element.setAttributeNodeNS> ($attr);
1917 wakaba 1.35 $attr-><AS::Attr.specified> (false)
1918 wakaba 1.26 if $gattr{$pfx}->{$lname}->{is_default};
1919     } # PFX
1920 wakaba 1.1 }
1921    
1922     $node-><M::Node.appendChild> ($el);
1923     }
1924    
1925     ~ (TAGC) {
1926     lang:Perl {
1927     push @{$nodes}, $node;
1928     $node = $el;
1929     }
1930     ?lexmode ElementContent;
1931 wakaba 1.6 } (NESTC) {
1932     my $is_docel;
1933 wakaba 1.1 lang:Perl {
1934     $ns = pop @{$nses};
1935     $type = pop @{$types};
1936 wakaba 1.6 $is_docel = (@{$types} == 0);
1937     }
1938    
1939     if-true ($is_docel) {
1940     return;
1941     }
1942    
1943     ~ (TAGC) {
1944     ?lexmode ElementContent;
1945     } else {
1946     ?lexmode ElementContent;
1947 wakaba 1.1 }
1948     } else {
1949     ?lexmode ElementContent;
1950     }
1951     } else {
1952     ?lexmode ElementContent;
1953     }
1954    
1955     } (ETAGO) {
1956     // End tag
1957    
1958     ?lexmode 'EndTag';
1959    
1960     my $is_docel;
1961    
1962     ~ (Name) {
1963 wakaba 1.26 // No NCName & QName check (it must match to start-tag)
1964 wakaba 1.3 lang:Perl ($name => $token.value) : has-error {
1965 wakaba 1.1 if ($name eq $type) {
1966     $type = pop @{$types};
1967     if ($type eq '') {
1968     $is_docel = true;
1969     }
1970     $node = pop @{$nodes};
1971     $ns = pop @{$nses};
1972     } else {
1973 wakaba 1.3 my $location;
1974     __CODE{xp|get-location-from-token::
1975     $token => $token,
1976     $result => $location,
1977     }__;
1978     my $continue = __DOMCore:ERROR{xp|wf-element-type-match::
1979     DOMCore:location => {$location},
1980     xp|token => {$token},
1981     xp|expected-element-type => {$type},
1982     xp|actual-element-type => {$name},
1983     xp|node => {$node},
1984     }__;
1985     unless ($continue) {
1986 wakaba 1.27 __CODE{ParseError}__;
1987 wakaba 1.3 }
1988 wakaba 1.1 }
1989     }
1990     }
1991    
1992     ~? (S) { }
1993    
1994     if-true ($is_docel) {
1995 wakaba 1.3 lang:Perl : has-error {
1996 wakaba 1.1 if (@{$types}) {
1997 wakaba 1.3 my $location;
1998     __CODE{xp|get-location-from-token::
1999     $token => $token,
2000     $result => $location,
2001     }__;
2002     for my $type (reverse @{$types}) {
2003     my $continue = __DOMCore:ERROR{xp|wf-no-end-tag::
2004     DOMCore:location => {$location},
2005     xp|token => {$token},
2006     xp|expected-element-type => {$type},
2007     xp|node => {$node},
2008     }__;
2009     unless ($continue) {
2010 wakaba 1.27 __CODE{ParseError}__;
2011 wakaba 1.3 }
2012     $node = shift @{$nodes};
2013     }
2014 wakaba 1.1 }
2015     }
2016     return;
2017     }
2018    
2019     ~ (TAGC) {
2020     ?lexmode ElementContent;
2021     } else {
2022     ?lexmode 'ElementContent';
2023     }
2024    
2025     } (HCRO) {
2026     &_HexadecimalCharacterReference_
2027     ($doc => $doc, $parent => $node);
2028    
2029     ~ (REFC) {
2030     ?lexmode 'ElementContent';
2031     } else {
2032     ?lexmode ElementContent;
2033     }
2034     } (CRO) {
2035     &_NumericCharacterReference_
2036     ($doc => $doc, $parent => $node);
2037    
2038     ~ (REFC) {
2039     ?lexmode 'ElementContent';
2040     } else {
2041     ?lexmode ElementContent;
2042     }
2043     } (ERO) {
2044 wakaba 1.6 &_GeneralEntityReferenceEC
2045     ($doc => $doc, $parent => $node, $ns => $ns);
2046 wakaba 1.1 } (CDO) {
2047     &_CommentDeclaration_ ($doc => $doc, $parent => $node);
2048    
2049     ~ (MDC) {
2050     ?lexmode ElementContent;
2051     } else {
2052     ?lexmode ElementContent;
2053     }
2054     } (CDSO) {
2055     &_CDATASection_ ($doc => $doc, $parent => $node);
2056    
2057     ~ (MSE) {
2058     ?lexmode 'ElementContent';
2059     } else {
2060     ?lexmode ElementContent;
2061     }
2062     } (PIO) {
2063     &_ProcessingInstruction_ ($doc => $doc, $parent => $node);
2064    
2065     ~ (PIC) {
2066     ?lexmode 'ElementContent';
2067     } else {
2068     ?lexmode ElementContent;
2069     }
2070     }
2071 wakaba 1.3
2072     ~ (#NONE) { }
2073 wakaba 1.1 } // Element_
2074 wakaba 1.11
2075     /*
2076     content := [CharData]
2077     *((element / Reference / CDSect / PI / Comment) [CharData])
2078     */
2079     rule content ($parent, $ns) {
2080     // ?lexmode ElementContent;
2081    
2082     my $doc;
2083     lang:Perl {
2084     $doc = $self->{doc};
2085     }
2086    
2087     ~* (CharData) {
2088     lang:Perl ($data => $token.value) {
2089 wakaba 1.31 $parent-><M::Node.manakaiAppendText> (\($data));
2090 wakaba 1.11 }
2091     } (STAGO) {
2092     &Element_ ($doc => $doc, $parent => $parent, $ns => $ns)
2093     : unshift-current-token;
2094     ~ (TAGC) {
2095     ?lexmode ElementContent;
2096     } else {
2097     ?lexmode ElementContent;
2098     }
2099     } (HCRO) {
2100 wakaba 1.31 &_HexadecimalCharacterReference_ ($parent => $parent);
2101 wakaba 1.11
2102     ~ (REFC) {
2103     ?lexmode 'ElementContent';
2104     } else {
2105     ?lexmode ElementContent;
2106     }
2107     } (CRO) {
2108 wakaba 1.31 &_NumericCharacterReference_ ($parent => $parent);
2109 wakaba 1.11
2110     ~ (REFC) {
2111     ?lexmode 'ElementContent';
2112     } else {
2113     ?lexmode ElementContent;
2114     }
2115     } (ERO) {
2116     &_GeneralEntityReferenceEC
2117     ($doc => $doc, $parent => $parent, $ns => $ns);
2118     } (CDO) {
2119     &_CommentDeclaration_ ($doc => $doc, $parent => $parent);
2120    
2121     ~ (MDC) {
2122     ?lexmode ElementContent;
2123     } else {
2124     ?lexmode ElementContent;
2125     }
2126     } (CDSO) {
2127     &_CDATASection_ ($doc => $doc, $parent => $parent);
2128    
2129     ~ (MSE) {
2130     ?lexmode 'ElementContent';
2131     } else {
2132     ?lexmode ElementContent;
2133     }
2134     } (PIO) {
2135     &_ProcessingInstruction_ ($doc => $doc, $parent => $parent);
2136    
2137     ~ (PIC) {
2138     ?lexmode 'ElementContent';
2139     } else {
2140     ?lexmode ElementContent;
2141     }
2142     }
2143     } // content
2144 wakaba 1.1
2145     rule AttributeSpecificationList ($doc, $attrs)
2146     : standalone
2147     {
2148     ?lexmode 'StartTag';
2149    
2150     my $i;
2151     lang:Perl {
2152     $i = 0;
2153     }
2154    
2155     ~* (Name) {
2156     my $atqname;
2157 wakaba 1.26 lang:Perl ($name => $token.value) : has-error {
2158     __CODE{checkQName:: $name => $name}__;
2159 wakaba 1.1 $atqname = $name;
2160     }
2161    
2162     my $vals;
2163 wakaba 1.18 lang:Perl : has-error {
2164 wakaba 1.1 if ($attrs->{$atqname}) {
2165 wakaba 1.3 my $location;
2166     __CODE{xp|get-location-from-token::
2167     $token => $token,
2168     $result => $location,
2169     }__;
2170     my $continue = __DOMCore:ERROR{xp|wf-unique-att-spec::
2171     DOMCore:location => {$location},
2172     xp|token => {$token},
2173     xp|name => {$atqname},
2174     }__;
2175     unless ($continue) {
2176 wakaba 1.27 __CODE{ParseError}__;
2177 wakaba 1.3 }
2178 wakaba 1.1 }
2179    
2180     $vals = $attrs->{$atqname} = {
2181     nodes => [],
2182     value => '',
2183     index => $i++,
2184     };
2185     }
2186 wakaba 1.3
2187     ~? (S) { }
2188     ~ (VI) { }
2189     ~? (S) { }
2190 wakaba 1.1
2191     ~ (LIT) {
2192     &_AttributeValueSpecification_
2193     ($doc => $doc, $vals => $vals);
2194    
2195     ~ (LIT) {
2196     ?lexmode StartTag;
2197     } else {
2198     ?lexmode StartTag;
2199     }
2200     } (LITA) {
2201     &_AttributeValueSpecificationA_
2202     ($doc => $doc, $vals => $vals);
2203    
2204     ~ (LITA) {
2205     ?lexmode StartTag;
2206     } else {
2207     ?lexmode StartTag;
2208     }
2209     }
2210     } (S) : separator : terminator? { }
2211     } // AttributeSpecificationList
2212    
2213     rule _AttributeValueSpecification_ ($doc, $vals) {
2214     // ~ (LIT) { }
2215     ?lexmode 'AttributeValueLiteral';
2216    
2217     ~* (STRING) {
2218     lang:Perl ($value => $token.value) {
2219     $value =~ s/[\x09\x0A\x0D]/ /g;
2220     my $text = $doc-><M::Document.createTextNode> ($value);
2221     push @{$vals->{nodes}}, $text;
2222     $vals->{value} .= $value;
2223     }
2224     } (HCRO) {
2225     &_HexadecimalCharacterReferenceV_
2226     ($doc => $doc, $vals => $vals);
2227    
2228     ~ (REFC) {
2229     ?lexmode AttributeValueLiteral;
2230     } else {
2231     ?lexmode AttributeValueLiteral;
2232     }
2233     } (CRO) {
2234     &_NumericCharacterReferenceV_
2235     ($doc => $doc, $vals => $vals);
2236    
2237     ~ (REFC) {
2238     ?lexmode AttributeValueLiteral;
2239     } else {
2240     ?lexmode AttributeValueLiteral;
2241     }
2242     } (ERO) {
2243     // TODO: Attribute value normalization
2244     &_GeneralEntityReferenceV_
2245     ($doc => $doc, $vals => $vals);
2246    
2247     ~ (REFC) {
2248     ?lexmode AttributeValueLiteral;
2249     } else {
2250     ?lexmode AttributeValueLiteral;
2251     }
2252     }
2253    
2254     // ~ (LIT) { } (LITA) { }
2255     } // _AttributeValueSpecification_
2256    
2257     rule _AttributeValueSpecificationA_ ($doc, $vals) {
2258     // ~ (LITA) { }
2259     ?lexmode 'AttributeValueLiteralA';
2260    
2261     ~* (STRING) {
2262     lang:Perl ($value => $token.value) {
2263     $value =~ s/[\x09\x0A\x0D]/ /g;
2264     my $text = $doc-><M::Document.createTextNode> ($value);
2265     push @{$vals->{nodes}}, $text;
2266     $vals->{value} .= $value;
2267     }
2268     } (HCRO) {
2269     &_HexadecimalCharacterReferenceV_
2270     ($doc => $doc, $vals => $vals);
2271    
2272     ~ (REFC) {
2273     ?lexmode AttributeValueLiteralA;
2274     } else {
2275     ?lexmode AttributeValueLiteralA;
2276     }
2277     } (CRO) {
2278     &_NumericCharacterReferenceV_
2279     ($doc => $doc, $vals => $vals);
2280    
2281     ~ (REFC) {
2282     ?lexmode AttributeValueLiteralA;
2283     } else {
2284     ?lexmode AttributeValueLiteralA;
2285     }
2286     } (ERO) {
2287     // TODO: Attribute value normalization
2288     &_GeneralEntityReferenceV_
2289     ($doc => $doc, $vals => $vals);
2290    
2291     ~ (REFC) {
2292     ?lexmode AttributeValueLiteralA;
2293     } else {
2294     ?lexmode AttributeValueLiteralA;
2295     }
2296     }
2297    
2298     // ~ (LITA) { }
2299     } // _AttributeValueSpecificationA_
2300    
2301     /*
2302 wakaba 1.11 Parsing replacement text of an entity referenced in
2303     an attribute value specification.
2304     */
2305     rule AttributeValueLiteralE_ ($parent, $vals)
2306     : recursive
2307     {
2308     // ?lexmode AttributeValueLiteralE;
2309    
2310     ~* (STRING) {
2311     lang:Perl ($value => $token.value) {
2312     $value =~ s/[\x09\x0A\x0D]/ /g;
2313 wakaba 1.31 $parent-><M::Node.manakaiAppendText> (\($value));
2314 wakaba 1.11 $vals->{value} .= $value;
2315     }
2316     } (HCRO) {
2317     &_HexadecimalCharacterReferenceAE_
2318     ($parent => $parent, $vals => $vals);
2319    
2320     ~ (REFC) {
2321     ?lexmode AttributeValueLiteralE;
2322     } else {
2323     ?lexmode AttributeValueLiteralE;
2324     }
2325     } (CRO) {
2326     &_NumericCharacterReferenceAE_
2327     ($parent => $parent, $vals => $vals);
2328    
2329     ~ (REFC) {
2330     ?lexmode AttributeValueLiteralE;
2331     } else {
2332     ?lexmode AttributeValueLiteralE;
2333     }
2334     } (ERO) {
2335     &_GeneralEntityReferenceAE_ ($parent => $parent, $vals => $vals);
2336    
2337     ~ (REFC) {
2338     ?lexmode AttributeValueLiteralE;
2339     } else {
2340     ?lexmode AttributeValueLiteralE;
2341     }
2342 wakaba 1.18 } (#INVALID == '<') {
2343     lang:Perl : has-error {
2344     my $location;
2345     __CODE{xp|get-location-from-token::
2346     $token => $token,
2347     $result => $location,
2348     }__;
2349     my $continue = __DOMCore:ERROR{xp|wf-no-lt-in-attribute-values::
2350     c|location => {$location},
2351     xp|token => {$token},
2352     }__;
2353     unless ($continue) {
2354 wakaba 1.27 __CODE{ParseError}__;
2355 wakaba 1.18 }
2356    
2357 wakaba 1.31 $parent-><M::Node.manakaiAppendText> ('<');
2358 wakaba 1.18 $vals->{value} .= '<';
2359     }
2360 wakaba 1.11 }
2361    
2362     // ~ (#EOF) { }
2363     } // AttributeValueLiteralE_
2364    
2365     /*
2366 wakaba 1.1 CDATA Section Content Parsing Mode
2367     */
2368     rule _CDATASection_ ($doc, $parent) {
2369     ?lexmode 'CDATASectionContent';
2370    
2371     my $cdata;
2372    
2373 wakaba 1.2 ~? (CData) {
2374 wakaba 1.1 lang:Perl ($data => $token.value) {
2375     $cdata = $data;
2376     }
2377     } else {
2378     lang:Perl {
2379     $cdata = '';
2380     }
2381     }
2382    
2383     lang:Perl {
2384     my $cdsect = $doc-><M::Document.createCDATASection>
2385     ($cdata);
2386     $parent-><M::Node.appendChild> ($cdsect);
2387     }
2388    
2389     // ~ (MSE) { }
2390     } // _CDATASection_
2391    
2392 wakaba 1.31 rule _NumericCharacterReference_ ($parent) {
2393 wakaba 1.1 ?lexmode 'NumericCharacterReference';
2394    
2395     ~ (NUMBER) {
2396 wakaba 1.3 lang:Perl ($num => $token.value) : has-error {
2397     $num += 0;
2398     unless (
2399     ($self->{xml_version} eq '1.0' and
2400     ((0x0020 <= $num and $num <= 0xD7FF) or
2401     (0xE000 <= $num and $num <= 0xFFFD) or
2402     (0x10000 <= $num and $num <= 0x10FFFF) or
2403     $num == 0x9 or $num == 0xA or $num == 0xD)) or
2404     ($self->{xml_version} eq '1.1' and
2405     ((0x0001 <= $num and $num <= 0xD7FF) or
2406     (0xE000 <= $num and $num <= 0xFFFD) or
2407     (0x10000 <= $num and $num <= 0x10FFFF)))
2408     ) {
2409     my $location;
2410     __CODE{xp|get-location-from-token::
2411     $token => $token,
2412     $result => $location,
2413     }__;
2414     my $continue = __DOMCore:ERROR{xp|wf-legal-character::
2415     DOMCore:location => {$location},
2416     xp|token => {$token},
2417     xp|character-number => {$num},
2418     xp|parent => {$parent},
2419     }__;
2420     unless ($continue) {
2421 wakaba 1.27 __CODE{ParseError}__;
2422 wakaba 1.3 }
2423     }
2424 wakaba 1.31 $parent-><M::Node.manakaiAppendText> (chr $num);
2425 wakaba 1.1 }
2426     }
2427    
2428     // ~ (REFC) { }
2429     } // _NumericCharacterReference_
2430    
2431     rule _NumericCharacterReferenceV_ ($doc, $vals) {
2432     ?lexmode 'NumericCharacterReference';
2433    
2434     ~ (NUMBER) {
2435 wakaba 1.3 lang:Perl ($num => $token.value) : has-error {
2436     $num += 0;
2437     unless (
2438     ($self->{xml_version} eq '1.0' and
2439     ((0x0020 <= $num and $num <= 0xD7FF) or
2440     (0xE000 <= $num and $num <= 0xFFFD) or
2441     (0x10000 <= $num and $num <= 0x10FFFF) or
2442     $num == 0x9 or $num == 0xA or $num == 0xD)) or
2443     ($self->{xml_version} eq '1.1' and
2444     ((0x0001 <= $num and $num <= 0xD7FF) or
2445     (0xE000 <= $num and $num <= 0xFFFD) or
2446     (0x10000 <= $num and $num <= 0x10FFFF)))
2447     ) {
2448     my $location;
2449     __CODE{xp|get-location-from-token::
2450     $token => $token,
2451     $result => $location,
2452     }__;
2453     my $continue = __DOMCore:ERROR{xp|wf-legal-character::
2454     DOMCore:location => {$location},
2455     xp|token => {$token},
2456     xp|character-number => {$num},
2457     }__;
2458     unless ($continue) {
2459 wakaba 1.27 __CODE{ParseError}__;
2460 wakaba 1.3 }
2461     }
2462 wakaba 1.1 my $ncr = $doc-><M::Document.createTextNode>
2463 wakaba 1.9 (my $char = chr $num);
2464 wakaba 1.1 push @{$vals->{nodes}}, $ncr;
2465     $vals->{value} .= $char;
2466     }
2467     }
2468    
2469     // ~ (REFC) { }
2470     } // _NumericCharacterReferenceV_
2471    
2472 wakaba 1.11 /*
2473     Numeric character reference in the replacement text
2474     of the entity referenced in an attribute value specification
2475     */
2476     rule _NumericCharacterReferenceAE_ ($parent, $vals)
2477     {
2478     ?lexmode NumericCharacterReference;
2479    
2480     ~ (NUMBER) {
2481     lang:Perl ($num => $token.value) : has-error {
2482     $num += 0;
2483     unless (
2484     ($self->{xml_version} eq '1.0' and
2485     ((0x0020 <= $num and $num <= 0xD7FF) or
2486     (0xE000 <= $num and $num <= 0xFFFD) or
2487     (0x10000 <= $num and $num <= 0x10FFFF) or
2488     $num == 0x9 or $num == 0xA or $num == 0xD)) or
2489     ($self->{xml_version} eq '1.1' and
2490     ((0x0001 <= $num and $num <= 0xD7FF) or
2491     (0xE000 <= $num and $num <= 0xFFFD) or
2492     (0x10000 <= $num and $num <= 0x10FFFF)))
2493     ) {
2494     my $location;
2495     __CODE{xp|get-location-from-token::
2496     $token => $token,
2497     $result => $location,
2498     }__;
2499     my $continue = __DOMCore:ERROR{xp|wf-legal-character::
2500     DOMCore:location => {$location},
2501     xp|token => {$token},
2502     xp|character-number => {$num},
2503     }__;
2504     unless ($continue) {
2505 wakaba 1.27 __CODE{ParseError}__;
2506 wakaba 1.11 }
2507     }
2508 wakaba 1.31 my $char = chr $num;
2509     $parent-><M::Node.manakaiAppendText> (\$char);
2510 wakaba 1.11 $vals->{value} .= $char;
2511     }
2512     }
2513    
2514     // ~ (REFC) { }
2515     } // _NumericCharacterReferenceAE_
2516    
2517     rule _NumericCharacterReferenceEV_ ($vals)
2518     {
2519     ?lexmode 'NumericCharacterReference';
2520    
2521     ~ (NUMBER) {
2522     lang:Perl ($num => $token.value) : has-error {
2523     $num += 0;
2524     unless (
2525     ($self->{xml_version} eq '1.0' and
2526     ((0x0020 <= $num and $num <= 0xD7FF) or
2527     (0xE000 <= $num and $num <= 0xFFFD) or
2528     (0x10000 <= $num and $num <= 0x10FFFF) or
2529     $num == 0x9 or $num == 0xA or $num == 0xD)) or
2530     ($self->{xml_version} eq '1.1' and
2531     ((0x0001 <= $num and $num <= 0xD7FF) or
2532     (0xE000 <= $num and $num <= 0xFFFD) or
2533     (0x10000 <= $num and $num <= 0x10FFFF)))
2534     ) {
2535     my $location;
2536     __CODE{xp|get-location-from-token::
2537     $token => $token,
2538     $result => $location,
2539     }__;
2540     my $continue = __DOMCore:ERROR{xp|wf-legal-character::
2541     DOMCore:location => {$location},
2542     xp|token => {$token},
2543     xp|character-number => {$num},
2544     }__;
2545     unless ($continue) {
2546 wakaba 1.27 __CODE{ParseError}__;
2547 wakaba 1.11 }
2548     }
2549     push @{$vals}, chr $num;
2550     }
2551     }
2552    
2553     // ~ (REFC) { }
2554     } // _NumericCharacterReferenceEV_
2555    
2556 wakaba 1.31 rule _HexadecimalCharacterReference_ ($parent) {
2557 wakaba 1.1 ?lexmode 'HexadecimalCharacterReference';
2558    
2559     ~ (Hex) {
2560 wakaba 1.9 lang:Perl ($v => $token.value) : has-error {
2561     my $num = hex $v;
2562 wakaba 1.3 unless (
2563     ($self->{xml_version} eq '1.0' and
2564     ((0x0020 <= $num and $num <= 0xD7FF) or
2565     (0xE000 <= $num and $num <= 0xFFFD) or
2566     (0x10000 <= $num and $num <= 0x10FFFF) or
2567     $num == 0x9 or $num == 0xA or $num == 0xD)) or
2568     ($self->{xml_version} eq '1.1' and
2569     ((0x0001 <= $num and $num <= 0xD7FF) or
2570     (0xE000 <= $num and $num <= 0xFFFD) or
2571     (0x10000 <= $num and $num <= 0x10FFFF)))
2572     ) {
2573     my $location;
2574     __CODE{xp|get-location-from-token::
2575     $token => $token,
2576     $result => $location,
2577     }__;
2578     my $continue = __DOMCore:ERROR{xp|wf-legal-character::
2579     DOMCore:location => {$location},
2580     xp|token => {$token},
2581     xp|character-number => {$num},
2582     xp|parent => {$parent},
2583     }__;
2584     unless ($continue) {
2585 wakaba 1.27 __CODE{ParseError}__;
2586 wakaba 1.3 }
2587     }
2588 wakaba 1.31 $parent-><M::Node.manakaiAppendText> (chr $num);
2589 wakaba 1.1 }
2590     }
2591    
2592     // ~ (REFC) { }
2593     } // _HexadecimalCharacterReference_
2594    
2595 wakaba 1.3 rule _HexadecimalCharacterReferenceV_ ($doc, $vals) {
2596 wakaba 1.1 ?lexmode 'HexadecimalCharacterReference';
2597    
2598     ~ (Hex) {
2599 wakaba 1.9 lang:Perl ($v => $token.value) : has-error {
2600     my $num = hex $v;
2601 wakaba 1.3 unless (
2602     ($self->{xml_version} eq '1.0' and
2603     ((0x0020 <= $num and $num <= 0xD7FF) or
2604     (0xE000 <= $num and $num <= 0xFFFD) or
2605     (0x10000 <= $num and $num <= 0x10FFFF) or
2606     $num == 0x9 or $num == 0xA or $num == 0xD)) or
2607     ($self->{xml_version} eq '1.1' and
2608     ((0x0001 <= $num and $num <= 0xD7FF) or
2609     (0xE000 <= $num and $num <= 0xFFFD) or
2610     (0x10000 <= $num and $num <= 0x10FFFF)))
2611     ) {
2612     my $location;
2613     __CODE{xp|get-location-from-token::
2614     $token => $token,
2615     $result => $location,
2616     }__;
2617     my $continue = __DOMCore:ERROR{xp|wf-legal-character::
2618     DOMCore:location => {$location},
2619     xp|token => {$token},
2620     xp|character-number => {$num},
2621     }__;
2622     unless ($continue) {
2623 wakaba 1.27 __CODE{ParseError}__;
2624 wakaba 1.3 }
2625     }
2626 wakaba 1.1 my $ncr = $doc-><M::Document.createTextNode>
2627 wakaba 1.9 (my $char = chr $num);
2628 wakaba 1.1 push @{$vals->{nodes}}, $ncr;
2629     $vals->{value} .= $char;
2630     }
2631     }
2632    
2633     // ~ (REFC) { }
2634 wakaba 1.11 } // _HexadecimalCharacterReferenceV_
2635    
2636     /*
2637     Hexadecimal character reference in the replacement text
2638     of the entity referenced in an attribute value literal
2639     */
2640     rule _HexadecimalCharacterReferenceAE_ ($parent, $vals)
2641     {
2642     ?lexmode HexadecimalCharacterReference;
2643    
2644     ~ (Hex) {
2645     lang:Perl ($v => $token.value) : has-error {
2646     my $num = hex $v;
2647     unless (
2648     ($self->{xml_version} eq '1.0' and
2649     ((0x0020 <= $num and $num <= 0xD7FF) or
2650     (0xE000 <= $num and $num <= 0xFFFD) or
2651     (0x10000 <= $num and $num <= 0x10FFFF) or
2652     $num == 0x9 or $num == 0xA or $num == 0xD)) or
2653     ($self->{xml_version} eq '1.1' and
2654     ((0x0001 <= $num and $num <= 0xD7FF) or
2655     (0xE000 <= $num and $num <= 0xFFFD) or
2656     (0x10000 <= $num and $num <= 0x10FFFF)))
2657     ) {
2658     my $location;
2659     __CODE{xp|get-location-from-token::
2660     $token => $token,
2661     $result => $location,
2662     }__;
2663     my $continue = __DOMCore:ERROR{xp|wf-legal-character::
2664     DOMCore:location => {$location},
2665     xp|token => {$token},
2666     xp|character-number => {$num},
2667     }__;
2668     unless ($continue) {
2669 wakaba 1.27 __CODE{ParseError}__;
2670 wakaba 1.11 }
2671     }
2672 wakaba 1.31 my $char = chr $num;
2673     $parent-><M::Node.manakaiAppendText> (\$char);
2674 wakaba 1.11 $vals->{value} .= $char;
2675     }
2676     }
2677    
2678     // ~ (REFC) { }
2679     } // _HexadecimalCharacterReferenceAE_
2680    
2681     rule _HexadecimalCharacterReferenceEV_ ($vals) {
2682     ?lexmode HexadecimalCharacterReference;
2683    
2684     ~ (Hex) {
2685     lang:Perl ($v => $token.value) : has-error {
2686     my $num = hex $v;
2687     unless (
2688     ($self->{xml_version} eq '1.0' and
2689     ((0x0020 <= $num and $num <= 0xD7FF) or
2690     (0xE000 <= $num and $num <= 0xFFFD) or
2691     (0x10000 <= $num and $num <= 0x10FFFF) or
2692     $num == 0x9 or $num == 0xA or $num == 0xD)) or
2693     ($self->{xml_version} eq '1.1' and
2694     ((0x0001 <= $num and $num <= 0xD7FF) or
2695     (0xE000 <= $num and $num <= 0xFFFD) or
2696     (0x10000 <= $num and $num <= 0x10FFFF)))
2697     ) {
2698     my $location;
2699     __CODE{xp|get-location-from-token::
2700     $token => $token,
2701     $result => $location,
2702     }__;
2703     my $continue = __DOMCore:ERROR{xp|wf-legal-character::
2704     DOMCore:location => {$location},
2705     xp|token => {$token},
2706     xp|character-number => {$num},
2707     }__;
2708     unless ($continue) {
2709 wakaba 1.27 __CODE{ParseError}__;
2710 wakaba 1.11 }
2711     }
2712     push @{$vals}, chr $num;
2713     }
2714     }
2715    
2716     // ~ (REFC) { }
2717     } // _HexadecimalCharacterReferenceEV_
2718    
2719     /*
2720     General entity reference in element's content
2721     */
2722     rule _GeneralEntityReferenceEC ($doc, $parent, $ns)
2723     : recursive
2724     {
2725     ?lexmode 'EntityReference';
2726    
2727     ~ (Name == 'lt') {
2728     lang:Perl {
2729 wakaba 1.31 $parent-><M::Node.manakaiAppendText> ('<');
2730 wakaba 1.11 }
2731     } (Name == 'gt') {
2732     lang:Perl {
2733 wakaba 1.31 $parent-><M::Node.manakaiAppendText> ('>');
2734 wakaba 1.11 }
2735     } (Name == 'amp') {
2736     lang:Perl {
2737 wakaba 1.31 $parent-><M::Node.manakaiAppendText> ('&');
2738 wakaba 1.11 }
2739     } (Name == 'quot') {
2740     lang:Perl {
2741 wakaba 1.31 $parent-><M::Node.manakaiAppendText> ('"');
2742 wakaba 1.11 }
2743     } (Name == 'apos') {
2744     lang:Perl {
2745 wakaba 1.31 $parent-><M::Node.manakaiAppendText> ("'");
2746 wakaba 1.11 }
2747     } (Name) {
2748     my $er;
2749 wakaba 1.19 lang:Perl ($name => $token.value) : has-error {
2750 wakaba 1.26 __CODE{checkNCName:: $name => $name}__;
2751    
2752 wakaba 1.11 $er = $doc-><M::Document.createEntityReference>
2753     ($name);
2754 wakaba 1.35 $er-><M::Node.manakaiSetReadOnly> (false, true);
2755 wakaba 1.20 $er-><AS::Node.textContent> ('');
2756     ## NOTE: When document entity (and entities referenced directly
2757     ## or indirectly from it) is parsed, no general entity
2758     ## node have its replacement tree. During general
2759     ## entity node collection construction, however,
2760     ## some entity node has replacement tree.
2761 wakaba 1.11 $parent-><M::Node.appendChild> ($er);
2762 wakaba 1.19
2763     my $ent = $self->{general_entity}->{$name};
2764     if (not $ent) { # no entity declaration
2765     if ($self->{standalone} or not $self->{has_xref}) { # WFC error
2766     my $location;
2767     __CODE{xp|get-location-from-token::
2768     $token => {$token},
2769     $result => {$location},
2770     }__;
2771     my $continue = __DOMCore:ERROR{xp|wf-entity-declared::
2772     xp|error-token => {$token},
2773     c|location => {$location},
2774     xp|name => {$name},
2775     }__;
2776     unless ($continue) {
2777 wakaba 1.27 __CODE{ParseError}__;
2778 wakaba 1.19 }
2779     } # Otherwise VC error
2780 wakaba 1.23 push @{$self->{entity}}, <Code::getEmptyEntityState::
2781     $name = $name>;
2782 wakaba 1.35 $er-><AS::GERef.manakaiExpanded> (false);
2783 wakaba 1.19
2784     } else { # there IS entity declaration
2785     if (($self->{standalone} or not $self->{has_xref}) and
2786     $ent->{is_externally_declared} and
2787     not $self->{entity}->[-1]->{is_externally_declared}) {
2788     my $location;
2789     __CODE{xp|get-location-from-token::
2790     $token => {$token},
2791     $result => {$location},
2792     }__;
2793     my $continue = __DOMCore:ERROR{xp|wf-entity-declared::
2794     xp|error-token => {$token},
2795     c|location => {$location},
2796     xp|name => {$name},
2797     }__;
2798     unless ($continue) {
2799 wakaba 1.27 __CODE{ParseError}__;
2800 wakaba 1.19 }
2801     }
2802 wakaba 1.35 $er-><AS::GERef.manakaiExpanded>
2803 wakaba 1.19 ($ent->{has_replacement_text});
2804     push @{$self->{entity}}, <Code::getCopyOfEntityState::
2805 wakaba 1.11 $entity_type = 'general_entity',
2806     $entity_name = $name>;
2807 wakaba 1.23
2808     if (defined $ent->{notation}) {
2809     my $location;
2810     __CODE{xp|get-location-from-token::
2811     $token => {$token},
2812     $result => {$location},
2813     }__;
2814     my $continue = __c|ERROR{xp|wf-parsed-entity::
2815     xp|error-token => {$token},
2816     c|location => {$location},
2817     xp|name => {$name},
2818     }__;
2819     unless ($continue) {
2820 wakaba 1.27 __CODE{ParseError}__;
2821 wakaba 1.23 }
2822     } # if unparsed entity
2823    
2824     if ($ent->{is_opened}) {
2825     my $location;
2826     __CODE{xp|get-location-from-token::
2827     $token => {$token},
2828     $result => {$location},
2829     }__;
2830     my $continue = __c|ERROR{xp|wf-no-recursion::
2831     xp|error-token => {$token},
2832     c|location => {$location},
2833     xp|name => {$name},
2834     }__;
2835     unless ($continue) {
2836 wakaba 1.27 __CODE{ParseError}__;
2837 wakaba 1.23 }
2838 wakaba 1.27 open my $empty, '<', \'';
2839     $self->{entity}->[-1]->{fh} = $empty;
2840 wakaba 1.35 $er-><AS::GERef.manakaiExpanded> (false);
2841 wakaba 1.23 } # recursive
2842     $ent->{is_opened} = true;
2843     } # entity declared
2844 wakaba 1.14 $self->{location} = $self->{entity}->[-1];
2845 wakaba 1.11 push @{$self->{entity_token}}, $self->{token};
2846     $self->{token} = [];
2847     push @{$self->{entity_char}}, $self->{char};
2848     $self->{char} = [];
2849     }
2850    
2851     ?lexmode ElementContent;
2852     &content ($doc => $doc, $parent => $er, $ns => $ns);
2853     ~ (#EOF) { }
2854     lang:Perl {
2855 wakaba 1.23 $self->{general_entity}->{$self->{entity}->[-1]->{name}}
2856     ->{is_opened} = false
2857     if $self->{general_entity}->{$self->{entity}->[-1]->{name}};
2858 wakaba 1.11 $self->{token} = pop @{$self->{entity_token}};
2859     $self->{char} = pop @{$self->{entity_char}};
2860 wakaba 1.27 pop (@{$self->{entity}})->{close_file}->();
2861 wakaba 1.14 $self->{location} = $self->{entity}->[-1];
2862 wakaba 1.35
2863     $er-><M::Node.manakaiSetReadOnly> (true, true);
2864 wakaba 1.11 }
2865    
2866     ?lexmode EntityReference;
2867     ?requires-next-token;
2868     }
2869    
2870     ~ (REFC) {
2871     ?lexmode ElementContent;
2872     } else {
2873     ?lexmode ElementContent;
2874     }
2875     } // _GeneralEntityReferenceEC
2876    
2877     /*
2878     General entity reference in an attribute value literal
2879     */
2880     rule _GeneralEntityReferenceV_ ($vals) {
2881     ?lexmode EntityReference;
2882    
2883     ~ (Name == 'lt') {
2884     lang:Perl {
2885     push @{$vals->{nodes}}, $self->{doc}-><M::Document.createTextNode>
2886     ('<');
2887     $vals->{value} .= '<';
2888     }
2889     } (Name == 'gt') {
2890     lang:Perl {
2891     push @{$vals->{nodes}}, $self->{doc}-><M::Document.createTextNode>
2892     ('>');
2893     $vals->{value} .= '>';
2894     }
2895     } (Name == 'amp') {
2896     lang:Perl {
2897     push @{$vals->{nodes}}, $self->{doc}-><M::Document.createTextNode>
2898     ('&');
2899     $vals->{value} .= '&';
2900     }
2901     } (Name == 'quot') {
2902     lang:Perl {
2903     push @{$vals->{nodes}}, $self->{doc}-><M::Document.createTextNode>
2904     ('"');
2905     $vals->{value} .= '"';
2906     }
2907     } (Name == 'apos') {
2908     lang:Perl {
2909     push @{$vals->{nodes}}, $self->{doc}-><M::Document.createTextNode>
2910     ("'");
2911     $vals->{value} .= "'";
2912     }
2913     } (Name) {
2914     my $er;
2915 wakaba 1.18 lang:Perl ($name => $token.value) : has-error {
2916 wakaba 1.26 __CODE{checkNCName:: $name => $name}__;
2917 wakaba 1.18
2918 wakaba 1.11 $er = $self->{doc}-><M::Document.createEntityReference> ($name);
2919 wakaba 1.35 $er-><M::Node.manakaiSetReadOnly> (false, true);
2920 wakaba 1.20 $er-><AS::Node.textContent> ('');
2921     ## NOTE: When document entity (and entities referenced directly
2922     ## or indirectly from it) is parsed, no general entity
2923     ## node have its replacement tree. During general
2924     ## entity node collection construction, however,
2925     ## some entity node has replacement tree.
2926 wakaba 1.19 my $ent = $self->{general_entity}->{$name};
2927 wakaba 1.20 if (not $ent) { # no entity declaration
2928     if ($self->{standalone} or not $self->{has_xref}) { # WFC error
2929     my $location;
2930     __CODE{xp|get-location-from-token::
2931     $token => {$token},
2932     $result => {$location},
2933     }__;
2934     my $continue = __DOMCore:ERROR{xp|wf-entity-declared::
2935     xp|error-token => {$token},
2936     c|location => {$location},
2937     xp|name => {$name},
2938     }__;
2939     unless ($continue) {
2940 wakaba 1.27 __CODE{ParseError}__;
2941 wakaba 1.20 }
2942     } # Otherwise VC error
2943 wakaba 1.23 push @{$self->{entity}}, <Code::getEmptyEntityState::
2944     $name = $name>;
2945 wakaba 1.35 $er-><AS::GERef.manakaiExpanded> (false);
2946 wakaba 1.20
2947     } else { # there IS entity declaration
2948     if (($self->{standalone} or not $self->{has_xref}) and
2949     $ent->{is_externally_declared} and
2950     not $self->{entity}->[-1]->{is_externally_declared}) {
2951     my $location;
2952     __CODE{xp|get-location-from-token::
2953     $token => {$token},
2954     $result => {$location},
2955     }__;
2956     my $continue = __DOMCore:ERROR{xp|wf-entity-declared::
2957     xp|error-token => {$token},
2958     c|location => {$location},
2959     xp|name => {$name},
2960     }__;
2961     unless ($continue) {
2962 wakaba 1.27 __CODE{ParseError}__;
2963 wakaba 1.20 }
2964     }
2965    
2966     if ($ent->{is_external_entity}) {
2967     my $location;
2968     __CODE{xp|get-location-from-token::
2969     $token => {$token},
2970     $result => {$location},
2971     }__;
2972     my $continue = __c|ERROR{xp|wf-no-external-entity-references::
2973     xp|error-token => {$token},
2974     c|location => {$location},
2975     xp|name => {$name},
2976     }__;
2977     unless ($continue) {
2978 wakaba 1.27 __CODE{ParseError}__;
2979 wakaba 1.20 }
2980 wakaba 1.23 ## NOTE: |xp:wf-parsed-entity| is not checked
2981 wakaba 1.20 } # if external entity
2982    
2983 wakaba 1.35 $er-><AS::GERef.manakaiExpanded>
2984 wakaba 1.19 ($ent->{has_replacement_text});
2985 wakaba 1.20 push @{$self->{entity}}, <Code::getCopyOfEntityState::
2986 wakaba 1.11 $entity_type = 'general_entity',
2987     $entity_name = $name>;
2988 wakaba 1.23
2989     if ($ent->{is_opened}) {
2990     my $location;
2991     __CODE{xp|get-location-from-token::
2992     $token => {$token},
2993     $result => {$location},
2994     }__;
2995     my $continue = __c|ERROR{xp|wf-no-recursion::
2996     xp|error-token => {$token},
2997     c|location => {$location},
2998     xp|name => {$name},
2999     }__;
3000     unless ($continue) {
3001 wakaba 1.27 __CODE{ParseError}__;
3002 wakaba 1.23 }
3003 wakaba 1.27 open my $empty, '<', \'';
3004     $self->{entity}->[-1]->{fh} = $empty;
3005 wakaba 1.35 $er-><AS::GERef.manakaiExpanded> (false);
3006 wakaba 1.23 } # recursive
3007     $ent->{is_opened} = true;
3008 wakaba 1.20 }
3009     push @{$vals->{nodes}}, $er;
3010 wakaba 1.14 $self->{location} = $self->{entity}->[-1];
3011 wakaba 1.11 push @{$self->{entity_token}}, $self->{token};
3012     $self->{token} = [];
3013     push @{$self->{entity_char}}, $self->{char};
3014     $self->{char} = [];
3015     }
3016    
3017     ?lexmode AttributeValueLiteralE;
3018     &AttributeValueLiteralE_ ($parent => $er, $vals => $vals);
3019     ~ (#EOF) { }
3020     lang:Perl {
3021 wakaba 1.23 $self->{general_entity}->{$self->{entity}->[-1]->{name}}
3022     ->{is_opened} = false
3023     if $self->{general_entity}->{$self->{entity}->[-1]->{name}};
3024 wakaba 1.11 $self->{token} = pop @{$self->{entity_token}};
3025     $self->{char} = pop @{$self->{entity_char}};
3026 wakaba 1.27 pop (@{$self->{entity}})->{close_file}->();
3027 wakaba 1.14 $self->{location} = $self->{entity}->[-1];
3028 wakaba 1.35
3029     $er-><M::Node.manakaiSetReadOnly> (true, true);
3030 wakaba 1.11 }
3031    
3032     ?lexmode EntityReference;
3033     ?requires-next-token;
3034     }
3035    
3036     // ~ (REFC) { }
3037     } // _GeneralEntityReferenceV_
3038 wakaba 1.1
3039 wakaba 1.6 /*
3040 wakaba 1.11 General entity reference in the replacement text
3041     of the entity referenced in an attribute value literal
3042 wakaba 1.6 */
3043 wakaba 1.11 rule _GeneralEntityReferenceAE_ ($parent, $vals)
3044 wakaba 1.6 {
3045 wakaba 1.11 ?lexmode EntityReference;
3046 wakaba 1.1
3047 wakaba 1.11 ~ (Name == 'lt') {
3048     lang:Perl {
3049 wakaba 1.31 $parent-><M::Node.manakaiAppendText> ('<');
3050 wakaba 1.11 $vals->{value} .= '<';
3051     }
3052     } (Name == 'gt') {
3053     lang:Perl {
3054 wakaba 1.31 $parent-><M::Node.manakaiAppendText> ('>');
3055 wakaba 1.11 $vals->{value} .= '>';
3056     }
3057     } (Name == 'amp') {
3058     lang:Perl {
3059 wakaba 1.31 $parent-><M::Node.manakaiAppendText> ('&');
3060 wakaba 1.11 $vals->{value} .= '&';
3061     }
3062     } (Name == 'quot') {
3063     lang:Perl {
3064 wakaba 1.31 $parent-><M::Node.manakaiAppendText> ('"');
3065 wakaba 1.11 $vals->{value} .= '"';
3066     }
3067     } (Name == 'apos') {
3068     lang:Perl {
3069 wakaba 1.31 $parent-><M::Node.manakaiAppendText> ("'");
3070 wakaba 1.11 $vals->{value} .= "'";
3071     }
3072     } (Name) {
3073 wakaba 1.6 my $er;
3074 wakaba 1.26 lang:Perl ($name => $token.value) : has-error {
3075     __CODE{checkNCName:: $name => $name}__;
3076 wakaba 1.18
3077 wakaba 1.11 $er = $self->{doc}-><M::Document.createEntityReference> ($name);
3078 wakaba 1.35 $er-><M::Node.manakaiSetReadOnly> (false, true);
3079 wakaba 1.20 $er-><AS::Node.textContent> ('');
3080     ## NOTE: When document entity (and entities referenced directly
3081     ## or indirectly from it) is parsed, no general entity
3082     ## node have its replacement tree. During general
3083     ## entity node collection construction, however,
3084     ## some entity node has replacement tree.
3085 wakaba 1.19 my $ent = $self->{general_entity}->{$name};
3086 wakaba 1.22 if (not $ent) { # no entity declaration
3087     if ($self->{standalone} or not $self->{has_xref}) { # WFC error
3088     my $location;
3089     __CODE{xp|get-location-from-token::
3090     $token => {$token},
3091     $result => {$location},
3092     }__;
3093     my $continue = __DOMCore:ERROR{xp|wf-entity-declared::
3094     xp|error-token => {$token},
3095     c|location => {$location},
3096     xp|name => {$name},
3097     }__;
3098     unless ($continue) {
3099 wakaba 1.27 __CODE{ParseError}__;
3100 wakaba 1.22 }
3101     } # Otherwise VC error
3102 wakaba 1.23 push @{$self->{entity}}, <Code::getEmptyEntityState::
3103     $name = $name>;
3104 wakaba 1.35 $er-><AS::GERef.manakaiExpanded> (false);
3105 wakaba 1.22
3106     } else { # there IS entity declaration
3107     if (($self->{standalone} or not $self->{has_xref}) and
3108     $ent->{is_externally_declared} and
3109     not $self->{entity}->[-1]->{is_externally_declared}) {
3110     my $location;
3111     __CODE{xp|get-location-from-token::
3112     $token => {$token},
3113     $result => {$location},
3114     }__;
3115     my $continue = __DOMCore:ERROR{xp|wf-entity-declared::
3116     xp|error-token => {$token},
3117     c|location => {$location},
3118     xp|name => {$name},
3119     }__;
3120     unless ($continue) {
3121 wakaba 1.27 __CODE{ParseError}__;
3122 wakaba 1.22 }
3123     }
3124    
3125     if ($ent->{is_external_entity}) {
3126     my $location;
3127     __CODE{xp|get-location-from-token::
3128     $token => {$token},
3129     $result => {$location},
3130     }__;
3131     my $continue = __c|ERROR{xp|wf-no-external-entity-references::
3132     xp|error-token => {$token},
3133     c|location => {$location},
3134     xp|name => {$name},
3135     }__;
3136     unless ($continue) {
3137 wakaba 1.27 __CODE{ParseError}__;
3138 wakaba 1.22 }
3139 wakaba 1.23 ## NOTE: |xp:wf-parsed-entity| is not checked
3140 wakaba 1.22 } # if external entity
3141    
3142 wakaba 1.35 $er-><AS::GERef.manakaiExpanded>
3143 wakaba 1.19 ($ent->{has_replacement_text});
3144 wakaba 1.22 push @{$self->{entity}}, <Code::getCopyOfEntityState::
3145 wakaba 1.6 $entity_type = 'general_entity',
3146     $entity_name = $name>;
3147 wakaba 1.23
3148     if ($ent->{is_opened}) {
3149     my $location;
3150     __CODE{xp|get-location-from-token::
3151     $token => {$token},
3152     $result => {$location},
3153     }__;
3154     my $continue = __c|ERROR{xp|wf-no-recursion::
3155     xp|error-token => {$token},
3156     c|location => {$location},
3157     xp|name => {$name},
3158     }__;
3159     unless ($continue) {
3160 wakaba 1.27 __CODE{ParseError}__;
3161 wakaba 1.23 }
3162 wakaba 1.27 open my $empty, '<', \'';
3163     $self->{entity}->[-1]->{fh} = $empty;
3164 wakaba 1.35 $er-><AS::GERef.manakaiExpanded> (false);
3165 wakaba 1.23 } # recursive
3166     $ent->{is_opened} = true;
3167 wakaba 1.22 }
3168     $parent-><M::Node.appendChild> ($er);
3169 wakaba 1.14 $self->{location} = $self->{entity}->[-1];
3170 wakaba 1.6 push @{$self->{entity_token}}, $self->{token};
3171     $self->{token} = [];
3172     push @{$self->{entity_char}}, $self->{char};
3173     $self->{char} = [];
3174     }
3175    
3176 wakaba 1.11 ?lexmode AttributeValueLiteralE;
3177     &AttributeValueLiteralE_ ($parent => $er, $vals => $vals);
3178 wakaba 1.6 ~ (#EOF) { }
3179     lang:Perl {
3180 wakaba 1.23 $self->{general_entity}->{$self->{entity}->[-1]->{name}}
3181     ->{is_opened} = false
3182     if $self->{general_entity}->{$self->{entity}->[-1]->{name}};
3183 wakaba 1.6 $self->{token} = pop @{$self->{entity_token}};
3184     $self->{char} = pop @{$self->{entity_char}};
3185 wakaba 1.27 pop (@{$self->{entity}})->{close_file}->();
3186 wakaba 1.14 $self->{location} = $self->{entity}->[-1];
3187 wakaba 1.35
3188     $er-><M::Node.manakaiSetReadOnly> (true, true);
3189 wakaba 1.6 }
3190    
3191     ?lexmode EntityReference;
3192     ?requires-next-token;
3193 wakaba 1.1 }
3194    
3195     // ~ (REFC) { }
3196 wakaba 1.11 } // _GeneralEntityReferenceAE_
3197 wakaba 1.6
3198     /*
3199 wakaba 1.24 General Entity Reference in Literal Entity Value in Entity Declaration
3200 wakaba 1.6 */
3201 wakaba 1.11 rule _GeneralEntityReferenceEV_ ($vals) {
3202 wakaba 1.6 ?lexmode 'EntityReference';
3203    
3204     ~ (Name) {
3205     lang:Perl ($name => $token.value) {
3206 wakaba 1.26 __CODE{checkNCName:: $name => $name}__;
3207 wakaba 1.6 push @$vals, $name;
3208     }
3209 wakaba 1.24 /*
3210     WFCs such as Entity Declared are not checked
3211     <http://www.w3.org/TR/xml11/#bypass>
3212    
3213     Note that violation to the Parsed Entity WFC is an error
3214     rather than fatal error here.
3215     */
3216 wakaba 1.6 }
3217 wakaba 1.11
3218     // No expansion
3219 wakaba 1.6
3220     // ~ (REFC) { }
3221     } // _GeneralEntityReferenceEV_
3222 wakaba 1.1
3223     /*
3224 wakaba 1.4 Document Type Declaration
3225 wakaba 1.1 */
3226 wakaba 1.4 rule _DocumentTypeDeclaration_ ($doc) {
3227     ?lexmode MarkupDeclaration;
3228    
3229     ~ (Name == 'DOCTYPE') { }
3230    
3231     ~ (S) { }
3232    
3233     // Document type name
3234 wakaba 1.6 my $name;
3235 wakaba 1.4 ~ (Name) {
3236 wakaba 1.6 lang:Perl ($v => $token.value) {
3237 wakaba 1.26 __CODE{checkQName:: $name => $v}__;
3238 wakaba 1.6 $name = $v;
3239     }
3240     }
3241 wakaba 1.17
3242     my $node;
3243     my $decl;
3244 wakaba 1.6 lang:Perl {
3245 wakaba 1.11 $self->{docx} = $self->{doc}
3246     -><M::Node.getFeature> (<Q::fe:XDoctype>, '3.0');
3247     $node = $self->{docx}-><M::DocumentXDoctype.createDocumentTypeDefinition>
3248     ($name);
3249 wakaba 1.17 $decl = $self->{dtdecl} = $node-><M::Node.getFeature>
3250     (<Q::fe:XDoctypeDeclaration>, '3.0');
3251 wakaba 1.4 }
3252    
3253 wakaba 1.25 my $has_extid;
3254 wakaba 1.4 ~? (S) {
3255     ~? (Name == 'PUBLIC') {
3256     ~ (S) { }
3257    
3258 wakaba 1.17 &PubidLiteral ($decl => $decl);
3259 wakaba 1.4
3260     ~ (S) { }
3261    
3262 wakaba 1.17 &SystemLiteral ($decl => $decl);
3263 wakaba 1.4
3264     ~? (S) { }
3265 wakaba 1.19
3266     lang:Perl {
3267     $self->{has_xref} = true;
3268 wakaba 1.25 $has_extid = true;
3269 wakaba 1.19 }
3270 wakaba 1.4 } (Name == 'SYSTEM') {
3271     ~ (S) { }
3272    
3273 wakaba 1.17 &SystemLiteral ($decl => $decl);
3274 wakaba 1.4
3275     ~? (S) { }
3276 wakaba 1.19
3277     lang:Perl {
3278     $self->{has_xref} = true;
3279 wakaba 1.25 $has_extid = true;
3280 wakaba 1.19 }
3281 wakaba 1.4 }
3282     }
3283 wakaba 1.17
3284 wakaba 1.11 lang:Perl {
3285     $self->{dtdef} = $node;
3286 wakaba 1.21 $self->{doc}-><M::Node.appendChild> ($node);
3287     $self->{doc_cfg}-><M::c|DOMConfiguration.setParameter>
3288     ('schema-type' => <Q::xml-dtd:>);
3289     ## ISSUE: Should default schema language information be
3290     ## preserved by some other flag?
3291 wakaba 1.11 }
3292    
3293 wakaba 1.4 ~? (DSO) {
3294 wakaba 1.6 &InternalSubset ($doc => $doc, $doctype => $node);
3295 wakaba 1.4
3296     ~ (DSC) {
3297     ?lexmode MarkupDeclaration;
3298     } else {
3299     ?lexmode MarkupDeclaration;
3300     }
3301    
3302     ~? (S) { }
3303     }
3304    
3305 wakaba 1.25 // TODO: Read and process external subset if any.
3306     lang:Perl {
3307     $self->{dont_process} = true if $has_extid;
3308 wakaba 1.35 $node-><M::Node.manakaiSetReadOnly> (true, true);
3309 wakaba 1.25 }
3310    
3311 wakaba 1.4 // ~ (MDC) { }
3312     } // _DocumentTypeDeclaration_
3313    
3314 wakaba 1.17 /*
3315     Public Identifier Literal
3316     */
3317     rule PubidLiteral ($decl) {
3318     my $pubid;
3319     my $pubid_token;
3320 wakaba 1.4 ~ (LIT) {
3321     ?lexmode SystemLiteral;
3322    
3323     ~? (STRING) {
3324 wakaba 1.17 lang:Perl ($v => $token.value) {
3325     $pubid = $v;
3326     $pubid_token = $token;
3327     }
3328 wakaba 1.4 }
3329    
3330     ~ (LIT) {
3331     ?lexmode MarkupDeclaration;
3332     } else {
3333     ?lexmode MarkupDeclaration;
3334     }
3335     } (LITA) {
3336     ?lexmode SystemLiteralA;
3337    
3338     ~? (STRING) {
3339 wakaba 1.17 lang:Perl ($v => $token.value) {
3340     $pubid = $v;
3341     $pubid_token = $token;
3342     }
3343 wakaba 1.4 }
3344    
3345     ~ (LITA) {
3346     ?lexmode MarkupDeclaration;
3347     } else {
3348     ?lexmode MarkupDeclaration;
3349     }
3350     }
3351 wakaba 1.17
3352     if-true ($pubid_token) {
3353     lang:Perl : has-error {
3354     if ($pubid =~ m{[^\x20\x0D\x0Aa-zA-Z0-9'()+,./:=?;!*#\@\$_%-]}s) {
3355     my $location;
3356     __CODE{xp|get-location-from-token::
3357     $token => {$pubid_token},
3358     $result => {$location},
3359     }__;
3360     ## Should this be other (new) error type?
3361     my $continue = __DOMCore:ERROR{xp|wf-syntax-error::
3362     xp|error-token => {$token},
3363     c|location => {$location},
3364     }__;
3365     unless ($continue) {
3366 wakaba 1.27 __CODE{ParseError}__;
3367 wakaba 1.17 }
3368     }
3369    
3370     ## NOTE: U+0009 is syntactically illegal.
3371 wakaba 1.23 $pubid =~ s/[\x09\x0A\x0D\x20]+/\x20/gs;
3372 wakaba 1.17 $pubid =~ s/\A\x20//s;
3373     $pubid =~ s/\x20\z//s;
3374     ## NOTE: Bare attribute name is written.
3375     $decl->public_id ($pubid);
3376     }
3377     }
3378 wakaba 1.4 } // PubidLiteral
3379    
3380 wakaba 1.17 /*
3381     System Identifier Literal
3382     */
3383     rule SystemLiteral ($decl) {
3384 wakaba 1.4 ~ (LIT) {
3385     ?lexmode SystemLiteral;
3386 wakaba 1.17 &_SystemLiteral ($decl => $decl);
3387 wakaba 1.4 } (LITA) {
3388     ?lexmode SystemLiteralA;
3389 wakaba 1.17 &_SystemLiteral ($decl => $decl);
3390 wakaba 1.4 }
3391     } // SystemLiteral
3392    
3393 wakaba 1.17 /*
3394     System Identifier Literal Content
3395 wakaba 1.29
3396     Used in document type declaration, entity declaration,
3397     and notation declaration.
3398 wakaba 1.17 */
3399     rule _SystemLiteral ($decl) {
3400     // LIT or LITA
3401    
3402 wakaba 1.4 ~? (STRING) {
3403 wakaba 1.17 lang:Perl ($v => $token.value) {
3404 wakaba 1.35 $decl-><AS::GE.systemId> ($v);
3405     $decl-><AS::GE.manakaiDeclarationBaseURI>
3406 wakaba 1.29 ($self->{location}->{base_uri});
3407 wakaba 1.17 }
3408 wakaba 1.4 }
3409    
3410     ~ (LIT) {
3411     ?lexmode MarkupDeclaration;
3412     } (LITA) {
3413     ?lexmode MarkupDeclaration;
3414     } else {
3415     ?lexmode MarkupDeclaration;
3416     }
3417     } // _SystemLiteral
3418    
3419     /*
3420     DTD Internal Subset
3421    
3422     intSubset := *(markupdecl / DeclSep) ;; [28b]
3423     */
3424 wakaba 1.6 rule InternalSubset ($doc, $doctype) {
3425 wakaba 1.4 ?lexmode DTD;
3426    
3427     ~* (MDO) {
3428     ?lexmode MarkupDeclaration;
3429    
3430     ~ (Name == 'ELEMENT') {
3431     &_ElementDeclaration ($doc => $doc);
3432     } (Name == 'ATTLIST') {
3433 wakaba 1.8 &_AttlistDeclaration ($doc => $doc, $doctype => $doctype);
3434 wakaba 1.4 } (Name == 'ENTITY') {
3435     &_EntityDeclaration ($doc => $doc);
3436     } (Name == 'NOTATION') {
3437     &_NotationDeclaration ($doc => $doc);
3438     }
3439     } (S) {
3440     //
3441     } (CDO) {
3442     &_CommentDeclarationDTD ($doc => $doc);
3443     } (PIO) {
3444 wakaba 1.6 &_ProcessingInstructionDTD ($doc => $doc, $doctype => $doctype);
3445 wakaba 1.4 } (PERO) {
3446     ?lexmode EntityReference;
3447    
3448 wakaba 1.19 lang:Perl {
3449     $self->{has_xref} = true;
3450 wakaba 1.25 $self->{dont_process} = true;
3451 wakaba 1.19 }
3452    
3453 wakaba 1.4 ~ (Name) {
3454 wakaba 1.26 // TODO: __CODE{checkNCName:: $name => $name}__;
3455 wakaba 1.4
3456     }
3457    
3458     ~ (REFC) {
3459     ?lexmode DTD;
3460     } else {
3461     ?lexmode DTD;
3462     }
3463     }
3464     } // InternalSubset
3465    
3466     rule _ElementDeclaration ($doc) {
3467     // ~ (MDO) { }
3468     // ?lexmode MarkupDeclaration
3469     // ~ (Name == 'Element') { }
3470    
3471     ~ (S) { }
3472    
3473     ~ (Name) {
3474 wakaba 1.26 // TODO: __CODE{checkQName:: $name => $name}__;
3475 wakaba 1.4
3476     }
3477    
3478     ?lexmode ElementDeclaration;
3479    
3480     ~ (S) { }
3481    
3482     // contentspec
3483     ~ (MGO) {
3484     &_ContentModel ($doc => $doc);
3485     } (Name == 'EMPTY') {
3486    
3487     } (Name == 'ANY') {
3488    
3489     }
3490    
3491     ~? (S) { }
3492    
3493     ~ (MDC) {
3494     ?lexmode DTD;
3495     } else {
3496     ?lexmode DTD;
3497     }
3498     } // _ElementDeclaration
3499    
3500     rule _ContentModel ($doc) {
3501     // ~ (MGO) { }
3502    
3503     ~? (S) { }
3504    
3505     ~ (Name) {
3506     // Element content model
3507     &_ModelGroup ($doc => $doc)
3508     : unshift-current-token;
3509    
3510     ~? (OPT) {
3511    
3512     } (REP) {
3513    
3514     } (PLUS) {
3515    
3516     }
3517    
3518     } (MDO) {
3519     &_ModelGroup ($doc => $doc)
3520     : unshift-current-token;
3521    
3522     ~? (OPT) {
3523    
3524     } (REP) {
3525    
3526     } (PLUS) {
3527    
3528     }
3529    
3530     } (PCDATA) {
3531     // Mixed content declaration
3532     ~? (S) { }
3533    
3534     ~* (OR) {
3535     ~? (S) { }
3536    
3537     ~ (Name) {
3538 wakaba 1.26 // TODO: Name & QName check
3539 wakaba 1.4
3540     }
3541    
3542     ~? (S) { }
3543     }
3544    
3545     ~ (MGC) { }
3546    
3547     ~? (REP) {
3548    
3549     } else {
3550     // TODO: error if |Name|
3551     }
3552    
3553    
3554     }
3555     } // _ContentModel
3556    
3557     rule _ModelGroup ($doc)
3558     : standalone
3559     : recursive
3560     {
3561     // ~ (MGO) { }
3562     // ~? (S) { }
3563    
3564     &ContentParticle ($doc => $doc);
3565    
3566     ~? (S) { }
3567    
3568     ~? (OR) {
3569     ~? (S) { }
3570    
3571     &ContentParticle ($doc => $doc);
3572    
3573     ~? (S) { }
3574    
3575     ~* (OR) {
3576     ~? (S) { }
3577    
3578     &ContentParticle ($doc => $doc);
3579    
3580     ~? (S) { }
3581     }
3582    
3583     } (SEQ) {
3584     ~? (S) { }
3585    
3586     &ContentParticle ($doc => $doc);
3587    
3588     ~? (S) { }
3589    
3590     ~* (SEQ) {
3591     ~? (S) { }
3592    
3593     &ContentParticle ($doc => $doc);
3594    
3595     ~? (S) { }
3596     }
3597    
3598     }
3599    
3600     ~ (MGC) { }
3601     } // _ModelGroup
3602    
3603     rule ContentParticle ($doc) {
3604     ~ (Name) {
3605 wakaba 1.26 // TODO: Name & QName check
3606 wakaba 1.4
3607     } (MGO) {
3608     ~? (S) { }
3609    
3610     &_ModelGroup ($doc => $doc);
3611     }
3612    
3613     ~? (OPT) {
3614    
3615     } (REP) {
3616    
3617     } (PLUS) {
3618    
3619     }
3620     } // ContentParticle
3621    
3622 wakaba 1.8 /*
3623     Attribute list declaration
3624     */
3625     rule _AttlistDeclaration ($doc, $doctype) {
3626 wakaba 1.4 // ~ (MDO) { }
3627     // ~ (Name == 'ATTLIST') { }
3628    
3629     ?lexmode AttlistDeclaration;
3630    
3631     ~ (S) { }
3632    
3633 wakaba 1.8 my $name;
3634 wakaba 1.4 ~ (Name) {
3635 wakaba 1.8 lang:Perl ($v => $token.value) {
3636 wakaba 1.26 __CODE{checkQName:: $name => $v}__;
3637 wakaba 1.8 $name = $v;
3638     }
3639     } else {
3640     lang:Perl { $name = '#ILLEGAL' }
3641     }
3642 wakaba 1.4
3643 wakaba 1.8 my $docxd;
3644     my $et;
3645     lang:Perl {
3646     $et = $doctype-><M::DTDef.getElementTypeDefinitionNode> ($name);
3647     unless ($et) {
3648 wakaba 1.11 $docxd = $doc-><M::Node.getFeature> (<Q::fe:XDoctype>, '3.0');
3649 wakaba 1.8 $et = $docxd-><M::DocumentXDoctype.createElementTypeDefinition>
3650     ($name);
3651     $doctype-><M::DTDef.setElementTypeDefinitionNode> ($et)
3652     unless $name eq '#ILLEGAL';
3653     }
3654 wakaba 1.4 }
3655    
3656     ~? (S) { }
3657    
3658     ~* (Name) {
3659 wakaba 1.8 my $at;
3660 wakaba 1.25 lang:Perl ($v => $token.value) : has-error {
3661 wakaba 1.26 __CODE{checkQName:: $name => $v}__;
3662 wakaba 1.8 $docxd ||= $doc-><M::Node.getFeature>
3663 wakaba 1.11 (<Q::fe:XDoctype>, '3.0');
3664 wakaba 1.8 $at = $docxd-><M::DocumentXDoctype.createAttributeDefinition> ($v);
3665 wakaba 1.25 if (exists $et-><AG::ETDef.attributeDefinitions>->{$v}) {
3666     my $location;
3667     __CODE{xp|get-location-from-token::
3668     $token => {$token},
3669     $result => {$location},
3670     }__;
3671     my $continue = __c|ERROR{xp|warning-attribute-definition-ignored::
3672     xp|error-token => {$token},
3673     c|location => {$location},
3674     xp|name => {$v},
3675     }__;
3676     unless ($continue) {
3677 wakaba 1.27 __CODE{ParseError}__;
3678 wakaba 1.25 }
3679     } elsif ($self->{dont_process} and not $self->{standalone}) {
3680     my $location;
3681     __CODE{xp|get-location-from-token::
3682     $token => {$token},
3683     $result => {$location},
3684     }__;
3685     my $continue = __c|ERROR{
3686     xp|warning-attribute-definition-not-processed::
3687     xp|error-token => {$token},
3688     c|location => {$location},
3689     xp|name => {$v},
3690     }__;
3691     unless ($continue) {
3692 wakaba 1.27 __CODE{ParseError}__;
3693 wakaba 1.25 }
3694     } else {
3695 wakaba 1.9 $et-><M::ETDef.setAttributeDefinitionNode> ($at);
3696     $self->{attr}->{$name}->{$v} = $at;
3697     }
3698 wakaba 1.8 }
3699 wakaba 1.4
3700     ~ (S) { }
3701    
3702     // AttType
3703     ~ (Name == 'NOTATION') {
3704     ~ (S) { }
3705    
3706 wakaba 1.8 my $kwd;
3707     lang:Perl {
3708     $at-><AS::ATDef.declaredType> (<C::ATDef.NOTATION_ATTR>);
3709     $kwd = $at-><AG::ATDef.allowedTokens>;
3710     }
3711    
3712 wakaba 1.4 ~ (EGO) {
3713     ~? (S) { }
3714    
3715 wakaba 1.8 ~+ (Name) {
3716 wakaba 1.26 lang:Perl ($v => $token.value) : has-error {
3717     __CODE{checkNCName:: $name => $v}__;
3718 wakaba 1.8 push @$kwd, $v;
3719     }
3720 wakaba 1.4
3721     ~? (S) { }
3722     } (OR) : separator {
3723     ~? (S) { }
3724     }
3725    
3726     ~ (EGC) { }
3727     }
3728 wakaba 1.8
3729 wakaba 1.4 } (Name) {
3730 wakaba 1.8 my $type;
3731     lang:Perl ($v => $token.value) : has-error {
3732     my $map = {
3733     CDATA => <C::ATDef.CDATA_ATTR>,
3734     ID => <C::ATDef.ID_ATTR>,
3735     IDREF => <C::ATDef.IDREF_ATTR>,
3736     IDREFS => <C::ATDef.IDREFS_ATTR>,
3737     ENTITY => <C::ATDef.ENTITY_ATTR>,
3738     ENTITIES => <C::ATDef.ENTITIES_ATTR>,
3739     NMTOKEN => <C::ATDef.NMTOKEN_ATTR>,
3740     NMTOKENS => <C::ATDef.NMTOKENS_ATTR>,
3741     };
3742     if ($map->{$v}) {
3743     $at-><AS::ATDef.declaredType> ($map->{$v});
3744     } else {
3745     ## TODO: Exception
3746     }
3747     }
3748 wakaba 1.4
3749     } (EGO) {
3750     ?lexmode Enumeration;
3751    
3752     ~? (S) { }
3753    
3754 wakaba 1.8 my $kwd;
3755     lang:Perl {
3756     $at-><AS::ATDef.declaredType> (<C::ATDef.ENUMERATION_ATTR>);
3757     $kwd = $at-><AG::ATDef.allowedTokens>;
3758     }
3759    
3760     ~+ (Nmtoken) {
3761     lang:Perl ($v => $token.value) {
3762     push @$kwd, $v;
3763     }
3764 wakaba 1.4
3765     ~? (S) { }
3766     } (OR) : separator {
3767     ~? (S) { }
3768     }
3769    
3770     ~ (EGC) {
3771     ?lexmode AttlistDeclaration;
3772     } else {
3773     ?lexmode AttlistDeclaration;
3774     }
3775    
3776     }
3777    
3778     ~ (S) { }
3779    
3780     // DefaultDecl
3781     ~ (RNI) {
3782     ~ (Name == 'REQUIRED') {
3783 wakaba 1.8 lang:Perl {
3784     $at-><AS::ATDef.defaultType> (<C::ATDef.REQUIRED_DEFAULT>);
3785     }
3786 wakaba 1.4 } (Name == 'IMPLIED') {
3787 wakaba 1.8 lang:Perl {
3788     $at-><AS::ATDef.defaultType> (<C::ATDef.IMPLIED_DEFAULT>);
3789     }
3790 wakaba 1.4 } (Name == 'FIXED') {
3791     ~ (S) { }
3792 wakaba 1.8
3793     lang:Perl {
3794     $at-><AS::ATDef.defaultType> (<C::ATDef.FIXED_DEFAULT>);
3795     }
3796 wakaba 1.4
3797     ~ (LIT) {
3798     my $vals;
3799     lang:Perl {
3800 wakaba 1.8 $vals = {nodes => [], value => ''};
3801 wakaba 1.4 }
3802    
3803     &_AttributeValueSpecification_ ($doc => $doc, $vals => $vals);
3804    
3805 wakaba 1.8 lang:Perl {
3806     for (@{$vals->{nodes}}) {
3807     $at-><M::Node.appendChild> ($_);
3808     }
3809     }
3810    
3811 wakaba 1.4 ~ (LIT) {
3812     ?lexmode AttlistDeclaration;
3813     } else {
3814     ?lexmode AttlistDeclaration;
3815     }
3816     } (LITA) {
3817     my $vals;
3818     lang:Perl {
3819 wakaba 1.8 $vals = {nodes => [], value => ''};
3820 wakaba 1.4 }
3821    
3822     &_AttributeValueSpecificationA_ ($doc => $doc, $vals => $vals);
3823    
3824 wakaba 1.8 lang:Perl {
3825     for (@{$vals->{nodes}}) {
3826     $at-><M::Node.appendChild> ($_);
3827     }
3828     }
3829    
3830     ~ (LITA) {
3831 wakaba 1.4 ?lexmode AttlistDeclaration;
3832     } else {
3833     ?lexmode AttlistDeclaration;
3834     }
3835     }
3836     }
3837    
3838     } (LIT) {
3839     my $vals;
3840     lang:Perl {
3841 wakaba 1.8 $at-><AS::ATDef.defaultType> (<C::ATDef.EXPLICIT_DEFAULT>);
3842     $vals = {nodes => [], value => ''};
3843 wakaba 1.4 }
3844    
3845     &_AttributeValueSpecification_ ($doc => $doc, $vals => $vals);
3846    
3847 wakaba 1.8 lang:Perl {
3848     for (@{$vals->{nodes}}) {
3849     $at-><M::Node.appendChild> ($_);
3850     }
3851     }
3852    
3853 wakaba 1.4 ~ (LIT) {
3854     ?lexmode AttlistDeclaration;
3855     } else {
3856     ?lexmode AttlistDeclaration;
3857     }
3858     } (LITA) {
3859     my $vals;
3860     lang:Perl {
3861 wakaba 1.8 $at-><AS::ATDef.defaultType> (<C::ATDef.EXPLICIT_DEFAULT>);
3862     $vals = {nodes => [], value => ''};
3863 wakaba 1.4 }
3864    
3865     &_AttributeValueSpecificationA_ ($doc => $doc, $vals => $vals);
3866    
3867 wakaba 1.8 lang:Perl {
3868     for (@{$vals->{nodes}}) {
3869     $at-><M::Node.appendChild> ($_);
3870     }
3871     }
3872    
3873 wakaba 1.4 ~ (LITA) {
3874     ?lexmode AttlistDeclaration;
3875     } else {
3876     ?lexmode AttlistDeclaration;
3877     }
3878     }
3879    
3880     } (S) : separator : terminator? {
3881     //
3882     }
3883    
3884     ~ (MDC) {
3885     ?lexmode DTD;
3886     } else {
3887     ?lexmode DTD;
3888     }
3889     } // _AttlistDeclaration
3890    
3891 wakaba 1.11 /*
3892 wakaba 1.26 Entity Declaration
3893 wakaba 1.11 */
3894 wakaba 1.4 rule _EntityDeclaration ($doc) {
3895     // ~ (MDO) { }
3896     // ~ (Name == ENTITY) { }
3897    
3898     ~ (S) { }
3899    
3900 wakaba 1.23 my $is_param_entity;
3901 wakaba 1.6 my $decl;
3902 wakaba 1.27 lang:Perl {
3903     $decl = {
3904     name => '#ILLEGAL',
3905     reptxt => \'',
3906     is_external_entity => false,
3907     document_uri => $self->{location}->{document_uri},
3908     base_uri => $self->{location}->{base_uri},
3909     };
3910     }
3911 wakaba 1.6
3912 wakaba 1.4 ~? (PERO) {
3913     ~ (S) { }
3914 wakaba 1.6 lang:Perl {
3915 wakaba 1.23 $is_param_entity = $decl->{is_param_entity} = true;
3916 wakaba 1.6 }
3917 wakaba 1.4 }
3918    
3919 wakaba 1.19 /*
3920     TODO: Set |$decl->{is_externally_declared}| flag
3921     and |Entity.isExternallyDeclared| attribute
3922     for entity declarations in external subset or
3923     in parameter entity.
3924     */
3925    
3926 wakaba 1.4 ~ (Name) {
3927 wakaba 1.6 lang:Perl ($v => $token.value) {
3928 wakaba 1.26 __CODE{checkNCName:: $name => $v}__;
3929 wakaba 1.6 $decl->{name} = $v;
3930     }
3931 wakaba 1.4 }
3932    
3933 wakaba 1.18 my $node;
3934 wakaba 1.11 lang:Perl {
3935 wakaba 1.18 $node =
3936 wakaba 1.11 $decl->{node} = $self->{docx}-><M::DocumentXDoctype.createGeneralEntity>
3937     ($decl->{name});
3938     ## TODO: Parameter entity...
3939     }
3940    
3941 wakaba 1.4 ~ (S) { }
3942    
3943     ~ (LIT) {
3944 wakaba 1.6 &_EntityValue ($doc => $doc, $decl => $decl);
3945 wakaba 1.4 } (LITA) {
3946 wakaba 1.6 &_EntityValueA ($doc => $doc, $decl => $decl);
3947 wakaba 1.4 } (Name == 'PUBLIC') {
3948     ~ (S) { }
3949    
3950 wakaba 1.18 &PubidLiteral ($decl => $node);
3951 wakaba 1.4
3952     ~ (S) { }
3953    
3954 wakaba 1.18 &SystemLiteral ($decl => $node);
3955    
3956     lang:Perl {
3957     $decl->{is_external_entity} = true;
3958     }
3959 wakaba 1.4 } (Name == 'SYSTEM') {
3960     ~ (S) { }
3961    
3962 wakaba 1.18 &SystemLiteral ($decl => $node);
3963    
3964     lang:Perl {
3965     $decl->{is_external_entity} = true;
3966     }
3967 wakaba 1.4 }
3968    
3969     ~? (S) {
3970     ~? (Name == 'NDATA') {
3971 wakaba 1.23 if-true ($is_param_entity) {
3972     lang:Perl : has-error {
3973     my $location;
3974     __CODE{xp|get-location-from-token::
3975     $token => {$token},
3976     $result => {$location},
3977     }__;
3978     my $continue = __DOMCore:ERROR{xp|wf-syntax-error::
3979     xp|error-token => {$token},
3980     c|location => {$location},
3981     }__;
3982     unless ($continue) {
3983 wakaba 1.27 __CODE{ParseError}__;
3984 wakaba 1.23 }
3985     }
3986     }
3987 wakaba 1.4
3988     ~ (S) { }
3989    
3990     ~ (Name) {
3991 wakaba 1.26 lang:Perl ($v => $token.value) : has-error {
3992     __CODE{checkNCName:: $name => $v}__;
3993 wakaba 1.6 $decl->{notation} = $v;
3994 wakaba 1.35 $decl->{node}-><AG::GE.notationName> ($v);
3995 wakaba 1.6 }
3996 wakaba 1.4 }
3997    
3998     ~? (S) { }
3999     }
4000     }
4001    
4002 wakaba 1.24 lang:Perl : has-error {
4003 wakaba 1.6 if ($self->{$decl->{is_param_entity} ? 'param_entity' : 'general_entity'}
4004     ->{$decl->{name}}) {
4005 wakaba 1.24 ## Predefined entity
4006     if (not $decl->{is_param_entity} and
4007     {lt => true, gt => true, amp => true,
4008     quot => true, apos => true}->{$decl->{name}}) {
4009     if ($decl->{is_external_entity}) {
4010     my $location;
4011     __CODE{xp|get-location-from-token::
4012     $token => {$token},
4013     $result => {$location},
4014     }__;
4015     my $continue = __c|ERROR{xp|error-internal-predefined-entity::
4016     xp|error-token => {$token},
4017     c|location => {$location},
4018     xp|name => {$decl->{name}},
4019     }__;
4020     unless ($continue) {
4021 wakaba 1.27 __CODE{ParseError}__;
4022 wakaba 1.24 }
4023     } elsif (
4024     not ({gt => true, apos => true, quot => true}->{$decl->{name}} and
4025     ${$decl->{reptxt}} eq {
4026     gt => '>', apos => "'", quot => '"',
4027     }->{$decl->{name}}) and
4028     not (${$decl->{reptxt}} =~ /\A&#0*@{[{
4029     lt => '60', gt => '62', amp => '38',
4030     apos => '39', quot => '34',
4031     }->{$decl->{name}}]};\z/) and
4032     not (${$decl->{reptxt}} =~ /\A&#x0*(?:(?i)@{[{
4033     lt => '3C', gt => '3E', amp => '26',
4034     apos => '27', quot => '22',
4035     }->{$decl->{name}}]});\z/)
4036     ) {
4037     ## NOTE: See "SuikaWiki - Predefined Entities"
4038     ## "http://suika.fam.cx/gate/2005/sw/%E5%AE%9A%E7%BE%A9%E6%B8%88%E5%AE%9F%E4%BD%93".
4039     my $location;
4040     __CODE{xp|get-location-from-token::
4041     $token => {$token},
4042     $result => {$location},
4043     }__;
4044     my $continue = __c|ERROR{xp|error-malformed-predefined-entity::
4045     xp|error-token => {$token},
4046     c|location => {$location},
4047     xp|name => {$decl->{name}},
4048     xp|replacement-text => {${$decl->{reptxt}}},
4049     }__;
4050     unless ($continue) {
4051 wakaba 1.27 __CODE{ParseError}__;
4052 wakaba 1.24 }
4053     }
4054 wakaba 1.44 ${$self->{dtdecl}}->{{
4055 wakaba 1.25 lt => <H::d|hasLtDeclaration>,
4056     gt => <H::d|hasGtDeclaration>,
4057     amp => <H::d|hasAmpDeclaration>,
4058     apos => <H::d|hasAposDeclaration>,
4059     quot => <H::d|hasQuotDeclaration>,
4060     }->{$decl->{name}}} = true;
4061 wakaba 1.24 } else { ## Dupulicating declaration
4062     my $location;
4063     __CODE{xp|get-location-from-token::
4064     $token => {$token},
4065     $result => {$location},
4066     }__;
4067     my $continue = __c|ERROR{xp|warning-entity-declaration-ignored::
4068     xp|error-token => {$token},
4069     c|location => {$location},
4070     xp|name => {$decl->{name}},
4071     }__;
4072     unless ($continue) {
4073 wakaba 1.27 __CODE{ParseError}__;
4074 wakaba 1.24 }
4075     }
4076 wakaba 1.25 } elsif ($self->{dont_process} and not $self->{standalone}) {
4077     ## TODO: |standalone| and parameter entities??
4078     my $location;
4079     __CODE{xp|get-location-from-token::
4080     $token => {$token},
4081     $result => {$location},
4082     }__;
4083     my $continue = __c|ERROR{xp|warning-entity-declaration-not-processed::
4084     xp|error-token => {$token},
4085     c|location => {$location},
4086     xp|name => {$decl->{name}},
4087     }__;
4088     unless ($continue) {
4089 wakaba 1.27 __CODE{ParseError}__;
4090 wakaba 1.25 }
4091 wakaba 1.6 } else {
4092     $self->{$decl->{is_param_entity} ? 'param_entity' : 'general_entity'}
4093     ->{$decl->{name}} = $decl;
4094 wakaba 1.11 $self->{dtdef}-><M::DTDef.setGeneralEntityNode> ($decl->{node})
4095     unless $decl->{is_param_entity};
4096 wakaba 1.6 }
4097     }
4098    
4099 wakaba 1.4 ~ (MDC) {
4100     ?lexmode DTD;
4101     } else {
4102     ?lexmode DTD;
4103     }
4104     } // _EntityDeclaration
4105    
4106 wakaba 1.26 /*
4107     Notation Declaration
4108     */
4109     rule _NotationDeclaration {
4110 wakaba 1.4 // ~ (MDO) { }
4111     // ~ (Name == NOTATION) { }
4112    
4113     ~ (S) { }
4114    
4115 wakaba 1.26 my $name;
4116 wakaba 1.4 ~ (Name) {
4117 wakaba 1.26 lang:Perl ($v => $token.value) : has-error {
4118     __CODE{checkNCName:: $name => $v}__;
4119     $name = $v;
4120     }
4121     } else {
4122     lang:Perl {
4123     $name = '#INVALID';
4124     }
4125     }
4126 wakaba 1.4
4127     ~ (S) { }
4128    
4129 wakaba 1.17 lang:Perl {
4130 wakaba 1.26 $decl = $self->{docx}-><M::DocumentXDoctype.createNotation> ($name);
4131 wakaba 1.17 }
4132    
4133 wakaba 1.4 ~ (Name == 'PUBLIC') {
4134     ~ (S) { }
4135    
4136 wakaba 1.17 &PubidLiteral ($decl => $decl);
4137 wakaba 1.4
4138     ~? (S) {
4139     ~? (LIT) {
4140     ?lexmode SystemLiteral;
4141 wakaba 1.17 &_SystemLiteral ($decl => $decl);
4142 wakaba 1.4
4143     ~? (S) { }
4144     } (LITA) {
4145     ?lexmode SystemLiteralA;
4146 wakaba 1.17 &_SystemLiteral ($decl => $decl);
4147 wakaba 1.4
4148     ~? (S) { }
4149     }
4150     }
4151     } (Name == 'SYSTEM') {
4152     ~ (S) { }
4153    
4154 wakaba 1.17 &SystemLiteral ($decl => $decl);
4155 wakaba 1.4
4156     ~? (S) { }
4157     }
4158    
4159 wakaba 1.26 lang:Perl : has-error {
4160     if ($self->{dtdef}-><M::DTDef.getNotationNode> ($name)) {
4161     ## Dupulication
4162     my $location;
4163     __CODE{xp|get-location-from-token::
4164     $token => {$token},
4165     $result => {$location},
4166     }__;
4167     my $continue = __c|ERROR{xp|vc-unique-notation-name::
4168     xp|error-token => {$token},
4169     c|location => {$location},
4170     xp|name => {$name},
4171     }__;
4172     unless ($continue) {
4173 wakaba 1.27 __CODE{ParseError}__;
4174 wakaba 1.26 }
4175     } else {
4176     $self->{dtdef}-><M::DTDef.setNotationNode> ($decl);
4177     }
4178     }
4179    
4180 wakaba 1.4 ~ (MDC) {
4181     ?lexmode DTD;
4182     } else {
4183     ?lexmode DTD;
4184     }
4185     } // _NotationDeclaration
4186    
4187 wakaba 1.11 rule _EntityValue ($decl) {
4188 wakaba 1.4 ?lexmode EntityValue;
4189    
4190     my $vals;
4191 wakaba 1.6 my $reptxt;
4192 wakaba 1.4 lang:Perl {
4193     $vals = [];
4194 wakaba 1.6 $reptxt = '';
4195 wakaba 1.4 }
4196    
4197     ~* (STRING) {
4198 wakaba 1.6 lang:Perl ($v => $token.value) {
4199     $reptxt .= $v;
4200     }
4201 wakaba 1.4 } (PERO) {
4202 wakaba 1.25 ?lexmode EntityReference;
4203 wakaba 1.19
4204     lang:Perl {
4205     $self->{has_xref} = true;
4206 wakaba 1.25 $self->{dont_process} = true;
4207 wakaba 1.19 }
4208 wakaba 1.6
4209     // TODO: Expand or wferror if internal subset
4210 wakaba 1.4
4211     ~ (Name) {
4212    
4213 wakaba 1.25 // Note that external subset and parameter entities are not supported
4214     lang:Perl ($name => $token.value) : has-error {
4215 wakaba 1.26 __CODE{checkNCName:: $name => $name}__;
4216 wakaba 1.25 my $location;
4217     __CODE{xp|get-location-from-token::
4218     $token => {$token},
4219     $result => {$location},
4220     }__;
4221     my $continue = __c|ERROR{xp|wf-pes-in-internal-subset::
4222     xp|error-token => {$token},
4223     c|location => {$location},
4224     xp|name => {$name},
4225     }__;
4226     unless ($continue) {
4227 wakaba 1.27 __CODE{ParseError}__;
4228 wakaba 1.25 }
4229     }
4230 wakaba 1.4 }
4231    
4232     ~ (REFC) {
4233     ?lexmode EntityValue;
4234     } else {
4235     ?lexmode EntityValue;
4236     }
4237     } (HCRO) {
4238 wakaba 1.11 &_HexadecimalCharacterReferenceEV_ ($vals => $vals);
4239 wakaba 1.4
4240 wakaba 1.6 lang:Perl {
4241 wakaba 1.11 $reptxt .= $vals->[-1];
4242 wakaba 1.6 }
4243    
4244 wakaba 1.4 ~ (REFC) {
4245     ?lexmode EntityValue;
4246     } else {
4247     ?lexmode EntityValue;
4248     }
4249     } (CRO) {
4250 wakaba 1.11 &_NumericCharacterReferenceEV_ ($vals => $vals);
4251 wakaba 1.6
4252     lang:Perl {
4253 wakaba 1.11 $reptxt .= $vals->[-1];
4254 wakaba 1.6 }
4255 wakaba 1.4
4256     ~ (REFC) {
4257     ?lexmode EntityValue;
4258     } else {
4259     ?lexmode EntityValue;
4260     }
4261     } (ERO) {
4262 wakaba 1.11 &_GeneralEntityReferenceEV_ ($vals => $vals);
4263 wakaba 1.4
4264 wakaba 1.6 lang:Perl {
4265 wakaba 1.11 $reptxt .= '&' . $vals->[-1] . ';';
4266 wakaba 1.6 }
4267    
4268 wakaba 1.4 ~ (REFC) {
4269     ?lexmode EntityValue;
4270     } else {
4271     ?lexmode EntityValue;
4272     }
4273     }
4274    
4275     ~ (LIT) {
4276     ?lexmode MarkupDeclaration;
4277     } (LITA) {
4278     ?lexmode MarkupDeclaration;
4279     } else {
4280     ?lexmode MarkupDeclaration;
4281     }
4282 wakaba 1.6
4283     lang:Perl {
4284     $decl->{reptxt} = \$reptxt;
4285 wakaba 1.19 $decl->{has_replacement_text} = true;
4286 wakaba 1.6 }
4287 wakaba 1.4 } // _EntityValue
4288    
4289 wakaba 1.11 rule _EntityValueA ($decl) {
4290 wakaba 1.4 ?lexmode EntityValueA;
4291    
4292     my $vals;
4293 wakaba 1.6 my $reptxt;
4294 wakaba 1.4 lang:Perl {
4295     $vals = [];
4296 wakaba 1.6 $reptxt = '';
4297 wakaba 1.4 }
4298    
4299     ~* (STRING) {
4300 wakaba 1.6 lang:Perl ($v => $token.value) {
4301     $reptxt .= $v;
4302     }
4303 wakaba 1.4 } (PERO) {
4304 wakaba 1.25 ?lexmode EntityReference;
4305 wakaba 1.4
4306 wakaba 1.19 lang:Perl {
4307     $self->{has_xref} = true;
4308 wakaba 1.25 $self->{dont_process} = true;
4309 wakaba 1.19 }
4310    
4311 wakaba 1.6 // TODO: implement this
4312 wakaba 1.4 ~ (Name) {
4313    
4314 wakaba 1.25 // Note that external subset and parameter entities are not supported
4315     lang:Perl ($name => $token.value) : has-error {
4316 wakaba 1.26 __CODE{checkNCName:: $name => $name}__;
4317 wakaba 1.25 my $location;
4318     __CODE{xp|get-location-from-token::
4319     $token => {$token},
4320     $result => {$location},
4321     }__;
4322     my $continue = __c|ERROR{xp|wf-pes-in-internal-subset::
4323     xp|error-token => {$token},
4324     c|location => {$location},
4325     xp|name => {$name},
4326     }__;
4327     unless ($continue) {
4328 wakaba 1.27 __CODE{ParseError}__;
4329 wakaba 1.25 }
4330     }
4331 wakaba 1.4 }
4332    
4333     ~ (REFC) {
4334     ?lexmode EntityValueA;
4335     } else {
4336     ?lexmode EntityValueA;
4337     }
4338     } (HCRO) {
4339 wakaba 1.11 &_HexadecimalCharacterReferenceEV_ ($vals => $vals);
4340 wakaba 1.4
4341 wakaba 1.6 lang:Perl {
4342 wakaba 1.11 $reptxt .= $vals->[-1];
4343 wakaba 1.6 }
4344    
4345    
4346 wakaba 1.4 ~ (REFC) {
4347     ?lexmode EntityValueA;
4348     } else {
4349     ?lexmode EntityValueA;
4350     }
4351     } (CRO) {
4352 wakaba 1.11 &_NumericCharacterReferenceEV_ ($vals => $vals);
4353 wakaba 1.4
4354 wakaba 1.6 lang:Perl {
4355 wakaba 1.11 $reptxt .= $vals->[-1];
4356 wakaba 1.6 }
4357    
4358 wakaba 1.4 ~ (REFC) {
4359     ?lexmode EntityValueA;
4360     } else {
4361     ?lexmode EntityValueA;
4362     }
4363     } (ERO) {
4364 wakaba 1.11 &_GeneralEntityReferenceEV_ ($vals => $vals);
4365 wakaba 1.4
4366 wakaba 1.6 lang:Perl {
4367 wakaba 1.11 $reptxt .= '&' . $vals->[-1] . ';';
4368 wakaba 1.6 }
4369    
4370 wakaba 1.4 ~ (REFC) {
4371     ?lexmode EntityValueA;
4372     } else {
4373     ?lexmode EntityValueA;
4374     }
4375     }
4376    
4377     ~ (LITA) {
4378     ?lexmode MarkupDeclaration;
4379     } else {
4380     ?lexmode MarkupDeclaration;
4381     }
4382 wakaba 1.6
4383     lang:Perl {
4384     $decl->{reptxt} = \$reptxt;
4385 wakaba 1.19 $decl->{has_replacement_text} = true;
4386 wakaba 1.6 }
4387 wakaba 1.4 } // _EntityValueA
4388    
4389    
4390     /*
4391     XML Name
4392     */
4393     lexmode NameChar {
4394     $NameStartChar10 := [
4395     '_' ':'
4396     // Letter
4397     // BaseChar
4398     U+0041..U+005A U+0061..U+007A U+00C0..U+00D6
4399     U+00D8..U+00F6 U+00F8..U+00FF U+0100..U+0131
4400     U+0134..U+013E U+0141..U+0148 U+014A..U+017E
4401     U+0180..U+01C3 U+01CD..U+01F0 U+01F4..U+01F5
4402     U+01FA..U+0217 U+0250..U+02A8 U+02BB..U+02C1
4403     U+0386 U+0388..U+038A U+038C U+038E..U+03A1
4404     U+03A3..U+03CE U+03D0..U+03D6 U+03DA U+03DC
4405     U+03DE U+03E0 U+03E2..U+03F3 U+0401..U+040C
4406     U+040E..U+044F U+0451..U+045C U+045E..U+0481
4407     U+0490..U+04C4 U+04C7..U+04C8 U+04CB..U+04CC
4408     U+04D0..U+04EB U+04EE..U+04F5 U+04F8..U+04F9
4409     U+0531..U+0556 U+0559 U+0561..U+0586
4410     U+05D0..U+05EA U+05F0..U+05F2 U+0621..U+063A
4411     U+0641..U+064A U+0671..U+06B7 U+06BA..U+06BE
4412     U+06C0..U+06CE U+06D0..U+06D3 U+06D5
4413     U+06E5..U+06E6 U+0905..U+0939 U+093D
4414     U+0958..U+0961 U+0985..U+098C U+098F..U+0990
4415     U+0993..U+09A8 U+09AA..U+09B0 U+09B2
4416     U+09B6..U+09B9 U+09DC..U+09DD U+09DF..U+09E1
4417     U+09F0..U+09F1 U+0A05..U+0A0A U+0A0F..U+0A10
4418     U+0A13..U+0A28 U+0A2A..U+0A30 U+0A32..U+0A33
4419     U+0A35..U+0A36 U+0A38..U+0A39 U+0A59..U+0A5C
4420     U+0A5E U+0A72..U+0A74 U+0A85..U+0A8B U+0A8D
4421     U+0A8F..U+0A91 U+0A93..U+0AA8 U+0AAA..U+0AB0
4422     U+0AB2..U+0AB3 U+0AB5..U+0AB9 U+0ABD U+0AE0
4423     U+0B05..U+0B0C U+0B0F..U+0B10 U+0B13..U+0B28
4424     U+0B2A..U+0B30 U+0B32..U+0B33 U+0B36..U+0B39
4425     U+0B3D U+0B5C..U+0B5D U+0B5F..U+0B61
4426     U+0B85..U+0B8A U+0B8E..U+0B90 U+0B92..U+0B95
4427     U+0B99..U+0B9A U+0B9C U+0B9E..U+0B9F
4428     U+0BA3..U+0BA4 U+0BA8..U+0BAA U+0BAE..U+0BB5
4429     U+0BB7..U+0BB9 U+0C05..U+0C0C U+0C0E..U+0C10
4430     U+0C12..U+0C28 U+0C2A..U+0C33 U+0C35..U+0C39
4431     U+0C60..U+0C61 U+0C85..U+0C8C U+0C8E..U+0C90
4432     U+0C92..U+0CA8 U+0CAA..U+0CB3 U+0CB5..U+0CB9
4433     U+0CDE U+0CE0..U+0CE1 U+0D05..U+0D0C
4434     U+0D0E..U+0D10 U+0D12..U+0D28 U+0D2A..U+0D39
4435     U+0D60..U+0D61 U+0E01..U+0E2E U+0E30
4436     U+0E32..U+0E33 U+0E40..U+0E45 U+0E81..U+0E82
4437     U+0E84 U+0E87..U+0E88 U+0E8A U+0E8D
4438     U+0E94..U+0E97 U+0E99..U+0E9F U+0EA1..U+0EA3
4439     U+0EA5 U+0EA7 U+0EAA..U+0EAB U+0EAD..U+0EAE
4440     U+0EB0 U+0EB2..U+0EB3 U+0EBD U+0EC0..U+0EC4
4441     U+0F40..U+0F47 U+0F49..U+0F69 U+10A0..U+10C5
4442     U+10D0..U+10F6 U+1100 U+1102..U+1103
4443     U+1105..U+1107 U+1109 U+110B..U+110C
4444     U+110E..U+1112 U+113C U+113E U+1140 U+114C
4445     U+114E U+1150 U+1154..U+1155 U+1159
4446     U+115F..U+1161 U+1163 U+1165 U+1167 U+1169
4447     U+116D..U+116E U+1172..U+1173 U+1175 U+119E
4448     U+11A8 U+11AB U+11AE..U+11AF U+11B7..U+11B8
4449     U+11BA U+11BC..U+11C2 U+11EB U+11F0 U+11F9
4450     U+1E00..U+1E9B U+1EA0..U+1EF9 U+1F00..U+1F15
4451     U+1F18..U+1F1D U+1F20..U+1F45 U+1F48..U+1F4D
4452     U+1F50..U+1F57 U+1F59 U+1F5B U+1F5D
4453     U+1F5F..U+1F7D U+1F80..U+1FB4 U+1FB6..U+1FBC
4454     U+1FBE U+1FC2..U+1FC4 U+1FC6..U+1FCC
4455     U+1FD0..U+1FD3 U+1FD6..U+1FDB U+1FE0..U+1FEC
4456     U+1FF2..U+1FF4 U+1FF6..U+1FFC U+2126
4457     U+212A..U+212B U+212E U+2180..U+2182
4458     U+3041..U+3094 U+30A1..U+30FA U+3105..U+312C
4459     U+AC00..U+D7A3
4460     // Ideographic
4461     U+4E00..U+9FA5 U+3007 U+3021..U+3029
4462     ];
4463     $NameChar10 := [
4464     '.' '-' '_' ':'
4465     // Letter
4466     // BaseChar
4467     U+0041..U+005A U+0061..U+007A U+00C0..U+00D6
4468     U+00D8..U+00F6 U+00F8..U+00FF U+0100..U+0131
4469     U+0134..U+013E U+0141..U+0148 U+014A..U+017E
4470     U+0180..U+01C3 U+01CD..U+01F0 U+01F4..U+01F5
4471     U+01FA..U+0217 U+0250..U+02A8 U+02BB..U+02C1
4472     U+0386 U+0388..U+038A U+038C U+038E..U+03A1
4473     U+03A3..U+03CE U+03D0..U+03D6 U+03DA U+03DC
4474     U+03DE U+03E0 U+03E2..U+03F3 U+0401..U+040C
4475     U+040E..U+044F U+0451..U+045C U+045E..U+0481
4476     U+0490..U+04C4 U+04C7..U+04C8 U+04CB..U+04CC
4477     U+04D0..U+04EB U+04EE..U+04F5 U+04F8..U+04F9
4478     U+0531..U+0556 U+0559 U+0561..U+0586
4479     U+05D0..U+05EA U+05F0..U+05F2 U+0621..U+063A
4480     U+0641..U+064A U+0671..U+06B7 U+06BA..U+06BE
4481     U+06C0..U+06CE U+06D0..U+06D3 U+06D5
4482     U+06E5..U+06E6 U+0905..U+0939 U+093D
4483     U+0958..U+0961 U+0985..U+098C U+098F..U+0990
4484     U+0993..U+09A8 U+09AA..U+09B0 U+09B2
4485     U+09B6..U+09B9 U+09DC..U+09DD U+09DF..U+09E1
4486     U+09F0..U+09F1 U+0A05..U+0A0A U+0A0F..U+0A10
4487     U+0A13..U+0A28 U+0A2A..U+0A30 U+0A32..U+0A33
4488     U+0A35..U+0A36 U+0A38..U+0A39 U+0A59..U+0A5C
4489     U+0A5E U+0A72..U+0A74 U+0A85..U+0A8B U+0A8D
4490     U+0A8F..U+0A91 U+0A93..U+0AA8 U+0AAA..U+0AB0
4491     U+0AB2..U+0AB3 U+0AB5..U+0AB9 U+0ABD U+0AE0
4492     U+0B05..U+0B0C U+0B0F..U+0B10 U+0B13..U+0B28
4493     U+0B2A..U+0B30 U+0B32..U+0B33 U+0B36..U+0B39
4494     U+0B3D U+0B5C..U+0B5D U+0B5F..U+0B61
4495     U+0B85..U+0B8A U+0B8E..U+0B90 U+0B92..U+0B95
4496     U+0B99..U+0B9A U+0B9C U+0B9E..U+0B9F
4497     U+0BA3..U+0BA4 U+0BA8..U+0BAA U+0BAE..U+0BB5
4498     U+0BB7..U+0BB9 U+0C05..U+0C0C U+0C0E..U+0C10
4499     U+0C12..U+0C28 U+0C2A..U+0C33 U+0C35..U+0C39
4500     U+0C60..U+0C61 U+0C85..U+0C8C U+0C8E..U+0C90
4501     U+0C92..U+0CA8 U+0CAA..U+0CB3 U+0CB5..U+0CB9
4502     U+0CDE U+0CE0..U+0CE1 U+0D05..U+0D0C
4503     U+0D0E..U+0D10 U+0D12..U+0D28 U+0D2A..U+0D39
4504     U+0D60..U+0D61 U+0E01..U+0E2E U+0E30
4505     U+0E32..U+0E33 U+0E40..U+0E45 U+0E81..U+0E82
4506     U+0E84 U+0E87..U+0E88 U+0E8A U+0E8D
4507     U+0E94..U+0E97 U+0E99..U+0E9F U+0EA1..U+0EA3
4508     U+0EA5 U+0EA7 U+0EAA..U+0EAB U+0EAD..U+0EAE
4509     U+0EB0 U+0EB2..U+0EB3 U+0EBD U+0EC0..U+0EC4
4510     U+0F40..U+0F47 U+0F49..U+0F69 U+10A0..U+10C5
4511     U+10D0..U+10F6 U+1100 U+1102..U+1103
4512     U+1105..U+1107 U+1109 U+110B..U+110C
4513     U+110E..U+1112 U+113C U+113E U+1140 U+114C
4514     U+114E U+1150 U+1154..U+1155 U+1159
4515     U+115F..U+1161 U+1163 U+1165 U+1167 U+1169
4516     U+116D..U+116E U+1172..U+1173 U+1175 U+119E
4517     U+11A8 U+11AB U+11AE..U+11AF U+11B7..U+11B8
4518     U+11BA U+11BC..U+11C2 U+11EB U+11F0 U+11F9
4519     U+1E00..U+1E9B U+1EA0..U+1EF9 U+1F00..U+1F15
4520     U+1F18..U+1F1D U+1F20..U+1F45 U+1F48..U+1F4D
4521     U+1F50..U+1F57 U+1F59 U+1F5B U+1F5D
4522     U+1F5F..U+1F7D U+1F80..U+1FB4 U+1FB6..U+1FBC
4523     U+1FBE U+1FC2..U+1FC4 U+1FC6..U+1FCC
4524     U+1FD0..U+1FD3 U+1FD6..U+1FDB U+1FE0..U+1FEC
4525     U+1FF2..U+1FF4 U+1FF6..U+1FFC U+2126
4526     U+212A..U+212B U+212E U+2180..U+2182
4527     U+3041..U+3094 U+30A1..U+30FA U+3105..U+312C
4528     U+AC00..U+D7A3
4529     // Ideographic
4530     U+4E00..U+9FA5 U+3007 U+3021..U+3029
4531     // Digit
4532     U+0030..U+0039 U+0660..U+0669 U+06F0..U+06F9
4533     U+0966..U+096F U+09E6..U+09EF U+0A66..U+0A6F
4534     U+0AE6..U+0AEF U+0B66..U+0B6F U+0BE7..U+0BEF
4535     U+0C66..U+0C6F U+0CE6..U+0CEF U+0D66..U+0D6F
4536     U+0E50..U+0E59 U+0ED0..U+0ED9 U+0F20..U+0F29
4537     // CombiningChar
4538     U+0300..U+0345 U+0360..U+0361 U+0483..U+0486
4539     U+0591..U+05A1 U+05A3..U+05B9 U+05BB..U+05BD
4540     U+05BF U+05C1..U+05C2 U+05C4 U+064B..U+0652
4541     U+0670 U+06D6..U+06DC U+06DD..U+06DF
4542     U+06E0..U+06E4 U+06E7..U+06E8 U+06EA..U+06ED
4543     U+0901..U+0903 U+093C U+093E..U+094C U+094D
4544     U+0951..U+0954 U+0962..U+0963 U+0981..U+0983
4545     U+09BC U+09BE U+09BF U+09C0..U+09C4
4546     U+09C7..U+09C8 U+09CB..U+09CD U+09D7
4547     U+09E2..U+09E3 U+0A02 U+0A3C U+0A3E U+0A3F
4548     U+0A40..U+0A42 U+0A47..U+0A48 U+0A4B..U+0A4D
4549     U+0A70..U+0A71 U+0A81..U+0A83 U+0ABC
4550     U+0ABE..U+0AC5 U+0AC7..U+0AC9 U+0ACB..U+0ACD
4551     U+0B01..U+0B03 U+0B3C U+0B3E..U+0B43
4552     U+0B47..U+0B48 U+0B4B..U+0B4D U+0B56..U+0B57
4553     U+0B82..U+0B83 U+0BBE..U+0BC2 U+0BC6..U+0BC8
4554     U+0BCA..U+0BCD U+0BD7 U+0C01..U+0C03
4555     U+0C3E..U+0C44 U+0C46..U+0C48 U+0C4A..U+0C4D
4556     U+0C55..U+0C56 U+0C82..U+0C83 U+0CBE..U+0CC4
4557     U+0CC6..U+0CC8 U+0CCA..U+0CCD U+0CD5..U+0CD6
4558     U+0D02..U+0D03 U+0D3E..U+0D43 U+0D46..U+0D48
4559     U+0D4A..U+0D4D U+0D57 U+0E31 U+0E34..U+0E3A
4560     U+0E47..U+0E4E U+0EB1 U+0EB4..U+0EB9
4561     U+0EBB..U+0EBC U+0EC8..U+0ECD U+0F18..U+0F19
4562     U+0F35 U+0F37 U+0F39 U+0F3E U+0F3F
4563     U+0F71..U+0F84 U+0F86..U+0F8B U+0F90..U+0F95
4564     U+0F97 U+0F99..U+0FAD U+0FB1..U+0FB7 U+0FB9
4565     U+20D0..U+20DC U+20E1 U+302A..U+302F U+3099
4566     U+309A
4567     // Extender
4568     U+00B7 U+02D0 U+02D1 U+0387 U+0640 U+0E46
4569     U+0EC6 U+3005 U+3031..U+3035 U+309D..U+309E
4570     U+30FC..U+30FE
4571     ];
4572 wakaba 1.1
4573     $NameStartChar11 := [
4574     ':' '_'
4575     'A' 'B' 'C' 'D' 'E' 'F' 'G' 'H' 'I' 'J' 'K' 'L' 'M'
4576     'N' 'O' 'P' 'Q' 'R' 'S' 'T' 'U' 'V' 'W' 'X' 'Y' 'Z'
4577     'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm'
4578     'n' 'o' 'p' 'q' 'r' 's' 't' 'u' 'v' 'w' 'x' 'y' 'z'
4579     U+00C0..U+00D6 U+00D8..U+00F6 U+00F8..U+02FF
4580     U+0370..U+037D U+037F..U+1FFF U+200C..U+200D
4581     U+2070..U+218F U+2C00..U+2FEF U+3001..U+D7FF
4582     U+F900..U+FDCF U+FDF0..U+FFFD U+10000..U+EFFFF
4583     ];
4584     $NameChar11 := [
4585     '-' '.' '0' '1' '2' '3' '4' '5' '6' '7' '8' '9'
4586     U+00B7 U+0300..U+036F U+203F..U+2040
4587     // NameStartChar
4588     ':' '_'
4589     'A' 'B' 'C' 'D' 'E' 'F' 'G' 'H' 'I' 'J' 'K' 'L' 'M'
4590     'N' 'O' 'P' 'Q' 'R' 'S' 'T' 'U' 'V' 'W' 'X' 'Y' 'Z'
4591     'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm'
4592     'n' 'o' 'p' 'q' 'r' 's' 't' 'u' 'v' 'w' 'x' 'y' 'z'
4593     U+00C0..U+00D6 U+00D8..U+00F6 U+00F8..U+02FF
4594     U+0370..U+037D U+037F..U+1FFF U+200C..U+200D
4595     U+2070..U+218F U+2C00..U+2FEF U+3001..U+D7FF
4596     U+F900..U+FDCF U+FDF0..U+FFFD U+10000..U+EFFFF
4597     ];
4598 wakaba 1.4 } // NameChar
4599    
4600     lexmode Name
4601     : extends => 'NameChar'
4602     {
4603 wakaba 1.1 Name : value := $NameStartChar11 $NameChar11*;
4604     } // Name
4605 wakaba 1.4
4606     lexmode Nmtoken
4607     : extends => 'NameChar'
4608     {
4609     Nmtoken : value := $NameChar11*;
4610     } // Nmtoken
4611 wakaba 1.1
4612     /*
4613 wakaba 1.14 S
4614 wakaba 1.1 */
4615     lexmode S {
4616 wakaba 1.14 $s := [U+0009 U+000A U+000D U+0020];
4617     S := $s+;
4618 wakaba 1.1 } // S
4619    
4620     /*
4621     Document end scanning mode
4622     */
4623     lexmode DocumentEnd
4624     : standalone
4625     : extends => 'S'
4626     {
4627     /*
4628     Processing instruction
4629     */
4630     PIO := ['<'] ['?'];
4631    
4632     /*
4633     Comment declaration
4634     */
4635     CDO := ['<'] ['!'] ['-'] ['-'];
4636     } // DocumentEnd
4637    
4638     /*
4639     Document misc scanning mode
4640    
4641     This mode scans |Misc| constructions as well
4642     as document element's start tag.
4643     */
4644     lexmode DocumentMisc
4645     : standalone
4646     : extends => 'DocumentEnd'
4647     {
4648     /*
4649     Document element start tag
4650     */
4651     STAGO := ['<'];
4652     } // DocumentMisc
4653    
4654     /*
4655     Document prolog scanning mode
4656     */
4657     lexmode DocumentProlog
4658     : standalone
4659     : extends => 'DocumentMisc'
4660     {
4661     /*
4662     |DOCTYPE| declaration
4663     */
4664     MDO := ['<'] ['!'];
4665     } // DocumentProlog
4666 wakaba 1.16
4667 wakaba 1.1 /*
4668 wakaba 1.16 Document Start Scanning Mode
4669 wakaba 1.1 */
4670     lexmode DocumentStart
4671     : standalone
4672     : extends => 'DocumentProlog'
4673     {
4674     /*
4675     XML declaration
4676     */
4677 wakaba 1.16 XDO := ['<'] ['?'] ['x'] ['m'] ['l'];
4678 wakaba 1.1 } // DocumentStart
4679    
4680     /*
4681     Comment declaration scanning mode
4682     */
4683     lexmode CommentDeclaration
4684     : standalone
4685     {
4686     /*
4687     Comment close
4688     */
4689     COM := ['-'] ['-'];
4690    
4691     /*
4692     Comment data
4693     */
4694 wakaba 1.15 ?default-token STRING : value;
4695 wakaba 1.1 } // CommentDeclaration
4696    
4697     /*
4698     Processing instruction name and |S| scanning mode
4699     */
4700     lexmode PIName
4701     : standalone
4702     : extends => 'Name'
4703     : extends => 'S'
4704     {
4705     /*
4706     Processing instruction close
4707     */
4708     PIC := ['?'] ['>'];
4709     } // PIName
4710    
4711     /*
4712 wakaba 1.16 Processing instruction name and |S| scanning mode
4713     */
4714     lexmode PINmtoken
4715     : standalone
4716     : extends => 'Nmtoken'
4717     : extends => 'S'
4718     {
4719     /*
4720     Processing instruction close
4721     */
4722     PIC := ['?'] ['>'];
4723     } // PINmtoken
4724    
4725     /*
4726 wakaba 1.1 Processing instruction data scanning mode
4727     */
4728     lexmode PIData
4729     : standalone
4730     {
4731     /*
4732     Processing instruction close
4733     */
4734     PIC := ['?'] ['>'];
4735    
4736     /*
4737     Processing instruction target data
4738     */
4739 wakaba 1.2 ?default-token DATA : value;
4740 wakaba 1.1 } // PIData
4741    
4742     /*
4743     Content of element scanning mode
4744     */
4745     lexmode ElementContent
4746     : standalone
4747     {
4748     /*
4749     Start tag open
4750     */
4751     STAGO := ['<'];
4752    
4753     /*
4754     End tag open
4755     */
4756     ETAGO := ['<'] ['/'];
4757    
4758     /*
4759     Hexadecimal character reference open
4760     */
4761     HCRO := ['&'] ['#'] ['x'];
4762    
4763     /*
4764     Numeric character reference open
4765     */
4766     CRO := ['&'] ['#'];
4767    
4768     /*
4769     General entity reference open
4770     */
4771     ERO := ['&'];
4772    
4773     /*
4774     Comment declaration open
4775     */
4776     CDO := ['<'] ['!'] ['-'] ['-'];
4777    
4778     /*
4779     CDATA section open
4780     */
4781     CDSO := ['<'] ['!'] ['[']
4782     ['C'] ['D'] ['A'] ['T'] ['A'] ['['];
4783    
4784     /*
4785     Processing instruction open
4786     */
4787     PIO := ['<'] ['?'];
4788 wakaba 1.2
4789     /*
4790     Markup section end
4791     */
4792     MSE := [']'] [']'] ['>'];
4793    
4794     /*
4795     Character data
4796     */
4797     /*
4798     Character data and/or |MSE|
4799     */
4800     ?default-token CharData : value;
4801 wakaba 1.1 } // ElementContent
4802    
4803     /*
4804     CDATA section content scanning mode
4805     */
4806     lexmode CDATASectionContent
4807     : standalone
4808     {
4809     /*
4810     Markup section end
4811     */
4812     MSE := [']'] [']'] ['>'];
4813    
4814     /*
4815     Character data
4816 wakaba 1.2 */
4817     ?default-token CData : value;
4818 wakaba 1.1 } // CDATASectionContent
4819    
4820     lexmode EntityReference
4821     : standalone
4822     : extends => 'Name'
4823     {
4824     /*
4825     Reference close
4826     */
4827     REFC := [';'];
4828     } // EntityReference
4829    
4830     lexmode NumericCharacterReference
4831     : standalone
4832     {
4833     /*
4834     Decimal number
4835     */
4836     $digit := ['0' '1' '2' '3' '4' '5' '6' '7' '8' '9'];
4837     NUMBER : value := $digit+;
4838    
4839     /*
4840     Reference close
4841     */
4842     REFC := [';'];
4843     } // NumericCharacterReference
4844    
4845     lexmode HexadecimalCharacterReference
4846     : standalone
4847     {
4848     /*
4849     Hexadecimal number
4850     */
4851     $hexdigit := ['0' '1' '2' '3' '4' '5' '6' '7' '8' '9'
4852     'A' 'B' 'C' 'D' 'E' 'F'
4853     'a' 'b' 'c' 'd' 'e' 'f'];
4854     Hex : value := $hexdigit+;
4855    
4856     /*
4857     Reference close
4858     */
4859     REFC := [';'];
4860     } // HexadecimalCharacterReference
4861    
4862 wakaba 1.16 /*
4863     The XML Declaration and Text Declaration Scanning Mode
4864     */
4865 wakaba 1.3 lexmode XMLDeclaration
4866     : standalone
4867     : extends => 'Name'
4868     : extends => 'S'
4869     {
4870    
4871     /*
4872     Value indicator
4873     */
4874     VI := ['='];
4875    
4876     /*
4877     Literal open
4878     */
4879     LIT := ['"'];
4880     LITA := [U+0027];
4881    
4882     /*
4883     Processing instruction close
4884 wakaba 1.16
4885     The |PIC|, i.e. |?>|, is split into two tokens |PIC1| and |PIC2|
4886     in this scanning mode to set |no_xml11_eol| flag in the
4887     |_XMLDeclaration_| |rule|.
4888 wakaba 1.3 */
4889 wakaba 1.16 PIC1 := ['?'];
4890     PIC2 := ['>'];
4891 wakaba 1.3 } // XMLDeclaration
4892 wakaba 1.16
4893     /*
4894     The XML Declaration or Processing Instruction Scanning Mode
4895    
4896     '<?xml' S ...
4897     (DocumentStart) (XMLDeclarationOrPI) (XMLDeclaration)
4898     '<?xml' '1' S ...
4899     (DocumentStart) (XMLDeclarationOrPI) (PINmtoken)(PIName) (PITarget)
4900     '<?xml' '-' 'stylesheet' S ...
4901     (DocumentStart) (XMLDeclarationOrPI) (PINmtoken) (PIName) (PITarget)
4902     */
4903     lexmode XMLDeclarationOrPI
4904     : standalone
4905     : extends => 'NameChar'
4906     : extends => 'S'
4907     {
4908     NameChar : value := $NameChar11;
4909     } // XMLDeclarationOrPI
4910 wakaba 1.3
4911 wakaba 1.1 lexmode StartTag
4912     : standalone
4913     : extends => 'Name'
4914     : extends => 'S'
4915     {
4916    
4917     /*
4918     Value indicator
4919     */
4920     VI := ['='];
4921    
4922     /*
4923     Literal open
4924     */
4925     LIT := ['"'];
4926     LITA := [U+0027];
4927    
4928     /*
4929     Tag close
4930     */
4931     TAGC := ['>'];
4932    
4933     /*
4934 wakaba 1.6 Null end-tag enabled start-tag close
4935 wakaba 1.1 */
4936 wakaba 1.6 NESTC := ['/'];
4937 wakaba 1.1 } // StartTag
4938    
4939     lexmode EndTag
4940     : standalone
4941     : extends => 'Name'
4942     : extends => 'S'
4943     {
4944     /*
4945     Tag close
4946     */
4947     TAGC := ['>'];
4948     } // EndTag
4949    
4950     lexmode AttributeValueLiteral_ {
4951     ERO := ['&'];
4952     CRO := ['&'] ['#'];
4953     HCRO := ['&'] ['#'] ['x'];
4954     } // AttributeValueLiteral_
4955    
4956     lexmode AttributeValueLiteral
4957     : standalone
4958     : extends => 'AttributeValueLiteral_'
4959     {
4960     LIT := ['"'];
4961 wakaba 1.3 STRING : value := [^'"' '&' '<']+;
4962 wakaba 1.1 } // AttributeValueLiteral
4963    
4964     lexmode AttributeValueLiteralA
4965     : standalone
4966     : extends => 'AttributeValueLiteral_'
4967     {
4968 wakaba 1.4 LITA := [U+0027];
4969 wakaba 1.3 STRING : value := [^U+0027 '&' '<']+;
4970 wakaba 1.1 } // AttributeValueLiteralA
4971 wakaba 1.11
4972     lexmode AttributeValueLiteralE
4973     : standalone
4974     : extends => 'AttributeValueLiteral_'
4975     {
4976     STRING : value := [^'&' '<']+;
4977     } // AttributeValueLiteralE
4978 wakaba 1.4
4979     lexmode EntityValue_ {
4980     PERO := ['%'];
4981     ERO := ['&'];
4982     CRO := ['&'] ['#'];
4983     HCRO := ['&'] ['#'] ['x'];
4984     } // EntityValue_
4985    
4986     lexmode EntityValue
4987     : standalone
4988     : extends => 'EntityValue_'
4989     {
4990     LIT := ['"'];
4991     STRING : value := [^'"' '&' '%']+;
4992     } // EntityValue
4993    
4994     lexmode EntityValueA
4995     : standalone
4996     : extends => 'EntityValue_'
4997     {
4998     LITA := [U+0027];
4999     STRING : value := [^U+0027 '&' '%']+;
5000     } // EntityValueA
5001    
5002     lexmode SystemLiteral
5003     : standalone
5004     {
5005     LIT := ['"'];
5006     ?default-token STRING : value;
5007     } // SystemLiteral
5008    
5009     lexmode SystemLiteralA
5010     : standalone
5011     {
5012     LITA := [U+0027];
5013     ?default-token STRING : value;
5014     } // SystemLiteralA
5015    
5016     lexmode DTD
5017     : standalone
5018     : extends => 'S'
5019     {
5020     /*
5021     Markup declaration open
5022     */
5023     MDO := ['<'] ['!'];
5024    
5025     /*
5026     Comment declaration open
5027     */
5028     CDO := ['<'] ['!'] ['-'] ['-'];
5029    
5030     /*
5031     Processing instruction open
5032     */
5033     PIO := ['<'] ['?'];
5034    
5035     /*
5036     Parameter entity reference open
5037     */
5038     PERO := ['%'];
5039    
5040     /*
5041     Declaration subset close
5042     */
5043     DSC := [']'];
5044    
5045     /*
5046     Contition section open
5047     */
5048     CSO := ['<'] ['!'] ['['];
5049     } // DTD
5050    
5051     /*
5052     Markup declaration scanning mode
5053    
5054     This mode is used to recognize |MDC| that terminates
5055     a comment declaration as well as the base |lexmode|
5056     for e.g. document type declaration scanning mode.
5057     */
5058     lexmode MarkupDeclaration
5059     : standalone
5060     : extends => 'Name'
5061     : extends => 'S'
5062     {
5063     /*
5064     Markup declaration close
5065     */
5066     MDC := ['>'];
5067    
5068     /*
5069     Literal open
5070     */
5071     LIT := ['"'];
5072    
5073     /*
5074     Alternative literal open
5075     */
5076     LITA := [U+0027];
5077    
5078     /*
5079     Parameter entity reference open
5080     */
5081     PERO := ['%'];
5082    
5083     /*
5084     Declaration subset open
5085     */
5086     DSO := ['['];
5087     } // MarkupDeclaration
5088    
5089     lexmode ElementDeclaration
5090     : standalone
5091     : extends => 'MarkupDeclaration'
5092     {
5093     /*
5094     Model group open
5095     */
5096     MGO := ['('];
5097    
5098     /*
5099     Model group close
5100     */
5101     MGC := [')'];
5102    
5103     /*
5104     Reserved name indicator
5105     */
5106     RNI := ['#'];
5107    
5108     /*
5109     Occurence indicators
5110     */
5111     OPT := ['?'];
5112     REP := ['*'];
5113     PLUS := ['+'];
5114    
5115     /*
5116     Connectors
5117     */
5118     OR := ['|'];
5119     SEQ := [','];
5120     } // ElementDeclaration
5121    
5122     lexmode AttlistDeclaration
5123     : standalone
5124     : extends => 'MarkupDeclaration'
5125     {
5126     /*
5127     Enumeration group open
5128     */
5129     EGO := ['('];
5130    
5131     /*
5132     Enumeration group close
5133     */
5134     EGC := [')'];
5135    
5136     /*
5137     Enumeration choice delimiter
5138     */
5139     OR := ['|'];
5140    
5141     /*
5142     Reserved name indicator
5143     */
5144     RNI := ['#'];
5145     } // AttlistDeclaration
5146    
5147     lexmode Enumeration
5148     : standalone
5149     : extends => 'Nmtoken'
5150     : extends => 'S'
5151     {
5152     /*
5153     Enumeration group close
5154     */
5155     EGC := [')'];
5156    
5157     /*
5158     Enumeration choice delimiter
5159     */
5160     OR := ['|'];
5161     } // Enumeration
5162    
5163 wakaba 1.1
5164     token-error default : default {
5165     lang:Perl {
5166 wakaba 1.3 my $location;
5167     __CODE{xp|get-location-from-token::
5168     $token => {$token},
5169     $result => {$location},
5170     }__;
5171     my $continue = __DOMCore:ERROR{xp|wf-syntax-error::
5172 wakaba 1.1 xp|error-token => {$token},
5173     DOMCore|location => {$location},
5174     }__;
5175     unless ($continue) {
5176 wakaba 1.27 __CODE{ParseError}__;
5177 wakaba 1.1 }
5178     }
5179     } // default
5180 wakaba 1.5
5181 wakaba 1.26 @ResourceDef:
5182     @@ForCheck: ManakaiDOM|ForClass
5183 wakaba 1.27 @@QName: ParseError
5184     @@rdf:type: DISPerl|BlockCode
5185     @@PerlDef:
5186     __DEEP{
5187     for (@{$self->{entity}}) {
5188     $_->{close_file}->();
5189     }
5190     }__;
5191     __EXCEPTION{DOMLS|PARSE_ERR}__;
5192    
5193     @ResourceDef:
5194     @@ForCheck: ManakaiDOM|ForClass
5195 wakaba 1.26 @@QName: checkNCName
5196     @@rdf:type: DISPerl|BlockCode
5197     @@PerlDef:
5198     if (($self->{xml_version} eq '1.0' and
5199     not <Code::DOMMain|testXML10Name:: $INPUT = $name>) or
5200     ($self->{xml_version} eq '1.1' and
5201     not <Code::DOMMain|testXML11Name:: $INPUT = $name>)) {
5202     my $__location;
5203     __CODE{xp|get-location-from-token::
5204     $token => {$token},
5205     $result => {$__location},
5206     }__;
5207     my $__continue = __c|ERROR{xp|wf-invalid-character-in-node-name::
5208     xp|error-token => {$token},
5209     c|location => {$__location},
5210     xp|name => {$name},
5211     infoset|version => {$self->{xml_version}},
5212     }__;
5213     unless ($__continue) {
5214 wakaba 1.27 __CODE{ParseError}__;
5215 wakaba 1.26 }
5216     } elsif (index ($name, ':') > -1) {
5217     my $__location;
5218     __CODE{xp|get-location-from-token::
5219     $token => {$token},
5220     $result => {$__location},
5221     }__;
5222     my $__continue = __c|ERROR{xp|nswf-legal-ncname::
5223     xp|error-token => {$token},
5224     c|location => {$__location},
5225     xp|name => {$name},
5226     infoset|version => {$self->{xml_version}},
5227     }__;
5228     unless ($__continue) {
5229 wakaba 1.27 __CODE{ParseError}__;
5230 wakaba 1.26 }
5231     }
5232    
5233     @ResourceDef:
5234     @@ForCheck: ManakaiDOM|ForClass
5235     @@QName: checkQName
5236     @@rdf:type: DISPerl|BlockCode
5237     @@PerlDef:
5238     if (($self->{xml_version} eq '1.0' and
5239     not <Code::DOMMain|testXML10Name:: $INPUT = $name>) or
5240     ($self->{xml_version} eq '1.1' and
5241     not <Code::DOMMain|testXML11Name:: $INPUT = $name>)) {
5242     my $__location;
5243     __CODE{xp|get-location-from-token::
5244     $token => {$token},
5245     $result => {$__location},
5246     }__;
5247     my $__continue = __c|ERROR{xp|wf-invalid-character-in-node-name::
5248     xp|error-token => {$token},
5249     c|location => {$__location},
5250     xp|name => {$name},
5251     infoset|version => {$self->{xml_version}},
5252     }__;
5253     unless ($__continue) {
5254 wakaba 1.27 __CODE{ParseError}__;
5255 wakaba 1.26 }
5256     } elsif (($self->{xml_version} eq '1.0' and
5257     not <Code::DOMMain|testXML10QName:: $INPUT = $name>) or
5258     ($self->{xml_version} eq '1.1' and
5259     not <Code::DOMMain|testXML11QName:: $INPUT = $name>)) {
5260     my $__location;
5261     __CODE{xp|get-location-from-token::
5262     $token => {$token},
5263     $result => {$__location},
5264     }__;
5265     my $__continue = __c|ERROR{xp|nswf-legal-qname::
5266     xp|error-token => {$token},
5267     c|location => {$__location},
5268     xp|name => {$name},
5269     infoset|version => {$self->{xml_version}},
5270     }__;
5271     unless ($__continue) {
5272 wakaba 1.27 __CODE{ParseError}__;
5273 wakaba 1.26 }
5274     }
5275    
5276    
5277 wakaba 1.5 @XMLTests:
5278     @@XMLTest:
5279 wakaba 1.15 @@@QName: xp.char.xml10.test
5280     @@@DEnt:
5281     @@@@test:value:
5282     <?xml version="1.0"?>
5283     <p>$u0009$u000A$u000D$u0020$uD7FF$uE000$uFFFD$U00010000$U0010FFFF</p>
5284     @@@test:domTree:
5285     document {
5286     xml-version: '1.0';
5287     element {
5288     text-content: U+0009 U+000A U+000A U+0020 U+D7FF
5289     U+E000 U+FFFD U+10000 U+10FFFF;
5290     }
5291     }
5292     @@XMLTest:
5293     @@@QName: xp.char.xml11.test
5294     @@@DEnt:
5295     @@@@test:value:
5296     <?xml version="1.1"?>
5297     <p>$u0009$u000A$u000D$u0020$uD7FF$uE000$uFFFD$U00010000$U0010FFFF</p>
5298     @@@test:domTree:
5299     document {
5300     xml-version: '1.1';
5301     element {
5302     text-content: U+0009 U+000A U+000A U+0020 U+D7FF
5303     U+E000 U+FFFD U+10000 U+10FFFF;
5304     }
5305     }
5306     @@XMLTest:
5307     @@@QName: xp.char.xml10.c0.test
5308     @@@DEnt:
5309     @@@@test:value:
5310     <?xml version="1.0"?>
5311     <p>$u0000$u0001$u0002$u0003$u0004$u0005$u0006$u0007$u0008$u000B$
5312     $u000C$u000E$u000F$u0010$u0011$u0012$u0013$u0014$u0015$u0016$
5313     $u0017$u0018$u0019$u001A$u001B$u001C$u001D$u001E$u001F</p>
5314     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 4); } /* U+0000 */
5315     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 5); } /* U+0001 */
5316     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 6); } /* U+0002 */
5317     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 7); } /* U+0003 */
5318     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 8); } /* U+0004 */
5319     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 9); } /* U+0005 */
5320     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 10); } /* U+0006 */
5321     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 11); } /* U+0007 */
5322     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 12); } /* U+0008 */
5323     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 13); } /* U+000B */
5324     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 14); } /* U+000C */
5325     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 15); } /* U+000E */
5326     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 16); } /* U+000F */
5327     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 17); } /* U+0010 */
5328     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 18); } /* U+0011 */
5329     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 19); } /* U+0012 */
5330     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 20); } /* U+0013 */
5331     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 21); } /* U+0014 */
5332     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 22); } /* U+0015 */
5333     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 23); } /* U+0016 */
5334     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 24); } /* U+0017 */
5335     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 25); } /* U+0018 */
5336     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 26); } /* U+0019 */
5337     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 27); } /* U+001A */
5338     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 28); } /* U+001B */
5339     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 29); } /* U+001C */
5340     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 30); } /* U+001D */
5341     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 31); } /* U+001E */
5342     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 32); } /* U+001F */
5343     @@XMLTest:
5344     @@@QName: xp.char.xml11.c0.test
5345     @@@DEnt:
5346     @@@@test:value:
5347     <?xml version="1.1"?>
5348     <p>$u0000$u0001$u0002$u0003$u0004$u0005$u0006$u0007$u0008$u000B$
5349     $u000C$u000E$u000F$u0010$u0011$u0012$u0013$u0014$u0015$u0016$
5350     $u0017$u0018$u0019$u001A$u001B$u001C$u001D$u001E$u001F</p>
5351     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 4); } /* U+0000 */
5352     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 5); } /* U+0001 */
5353     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 6); } /* U+0002 */
5354     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 7); } /* U+0003 */
5355     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 8); } /* U+0004 */
5356     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 9); } /* U+0005 */
5357     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 10); } /* U+0006 */
5358     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 11); } /* U+0007 */
5359     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 12); } /* U+0008 */
5360     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 13); } /* U+000B */
5361     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 14); } /* U+000C */
5362     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 15); } /* U+000E */
5363     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 16); } /* U+000F */
5364     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 17); } /* U+0010 */
5365     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 18); } /* U+0011 */
5366     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 19); } /* U+0012 */
5367     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 20); } /* U+0013 */
5368     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 21); } /* U+0014 */
5369     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 22); } /* U+0015 */
5370     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 23); } /* U+0016 */
5371     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 24); } /* U+0017 */
5372     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 25); } /* U+0018 */
5373     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 26); } /* U+0019 */
5374     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 27); } /* U+001A */
5375     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 28); } /* U+001B */
5376     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 29); } /* U+001C */
5377     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 30); } /* U+001D */
5378     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 31); } /* U+001E */
5379     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 32); } /* U+001F */
5380     @@XMLTest:
5381     @@@QName: xp.char.xml10.c1.test
5382     @@@DEnt:
5383     @@@@test:value:
5384     <?xml version="1.0"?>
5385     <p>$u007F$u0080$u0081$u0082$u0083$u0084$u0086$u0087$u0088$
5386     $u0089$u008A$u008B$u008C$
5387     $u008D$u008E$u008F$u0090$u0091$u0092$u0093$u0094$u0095$u0096$
5388     $u0097$u0098$u0099$u009A$u009B$u009C$u009D$u009E$u009F$u0085</p>
5389     @@@test:domTree:
5390     document {
5391     xml-version: '1.0';
5392     element {
5393     text-content: U+007F U+0080 U+0081 U+0082 U+0083 U+0084 U+0086
5394     U+0087 U+0088 U+0089 U+008A U+008B U+008C U+008D
5395     U+008E U+008F U+0090 U+0091 U+0092 U+0093 U+0094
5396     U+0095 U+0096 U+0097 U+0098 U+0099 U+009A U+009B
5397     U+009C U+009D U+009E U+009F U+0085;
5398     }
5399     }
5400     @@XMLTest:
5401     @@@QName: xp.char.xml11.c1.test
5402     @@@DEnt:
5403     @@@@test:value:
5404     <?xml version="1.1"?>
5405     <p>$u007F$u0080$u0081$u0082$u0083$u0084$u0086$u0087$u0088$
5406     $u0089$u008A$u008B$u008C$
5407     $u008D$u008E$u008F$u0090$u0091$u0092$u0093$u0094$u0095$u0096$
5408     $u0097$u0098$u0099$u009A$u009B$u009C$u009D$u009E$u009F$u0085</p>
5409     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 4); } /* U+007F */
5410     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 5); } /* U+0080 */
5411     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 6); } /* U+0081 */
5412     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 7); } /* U+0082 */
5413     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 8); } /* U+0083 */
5414     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 9); } /* U+0084 */
5415     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 10); } /* U+0086 */
5416     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 11); } /* U+0087 */
5417     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 12); } /* U+0088 */
5418     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 13); } /* U+0089 */
5419     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 14); } /* U+008A */
5420     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 15); } /* U+008B */
5421     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 16); } /* U+008C */
5422     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 17); } /* U+008D */
5423     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 18); } /* U+008E */
5424     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 19); } /* U+008F */
5425     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 20); } /* U+0090 */
5426     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 21); } /* U+0091 */
5427     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 22); } /* U+0092 */
5428     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 23); } /* U+0093 */
5429     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 24); } /* U+0094 */
5430     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 25); } /* U+0095 */
5431     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 26); } /* U+0096 */
5432     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 27); } /* U+0097 */
5433     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 28); } /* U+0098 */
5434     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 29); } /* U+0099 */
5435     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 30); } /* U+009A */
5436     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 31); } /* U+009B */
5437     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 32); } /* U+009C */
5438     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 33); } /* U+009D */
5439     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 34); } /* U+009E */
5440     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 35); } /* U+009F */
5441    
5442     @@XMLTest:
5443 wakaba 1.27 @@@QName: xp.c0.internal.entity.xml11.1.test
5444     @@@DEnt:
5445     @@@@test:value:
5446     <?xml version="1.1"?>
5447     <!DOCTYPE a [
5448     <!ENTITY e "&#x01;&#x02;&#x03;&#x04;&#x05;&#x06;&#x07;$
5449     &#x08;&#x09;&#x0A;&#x0B;&#x0C;&#x0D;&#x0E;&#x0F;$
5450     &#x10;&#x11;&#x12;&#x13;&#x14;&#x15;&#x16;&#x17;$
5451     &#x18;&#x19;&#x1A;&#x1B;&#x1C;&#x1D;&#x1E;&#x1F;">
5452     ]><a/>
5453 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
5454 wakaba 1.27 @@@test:domTree:
5455     document {
5456     document-type {
5457     general-entity {
5458     node-name: 'e';
5459     text-content: U+0001 U+0002 U+0003 U+0004 U+0005
5460     U+0006 U+0007 U+0008 U+0009 U+000A U+000B
5461     U+000C U+000D U+000E U+000F
5462     U+0010 U+0011 U+0012 U+0013 U+0014 U+0015
5463     U+0016 U+0017 U+0018 U+0019 U+001A U+001B
5464     U+001C U+001D U+001E U+001F;
5465     }
5466     }
5467     element { }
5468     }
5469     @@XMLTest:
5470     @@@QName: xp.c1.internal.entity.xml11.1.test
5471     @@@DEnt:
5472     @@@@test:value:
5473     <?xml version="1.1"?>
5474     <!DOCTYPE a [
5475     <!ENTITY e "&#x80;&#x81;&#x82;&#x83;&#x84;&#x85;&#x86;&#x87;$
5476     &#x88;&#x89;&#x8A;&#x8B;&#x8C;&#x8D;&#x8E;&#x8F;$
5477     &#x90;&#x91;&#x92;&#x93;&#x94;&#x95;&#x96;&#x97;$
5478     &#x98;&#x99;&#x9A;&#x9B;&#x9C;&#x9D;&#x9E;&#x9F;&#x7F;">
5479     ]><a/>
5480 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
5481 wakaba 1.27 @@@test:domTree:
5482     document {
5483     document-type {
5484     general-entity {
5485     node-name: 'e';
5486     text-content: U+0080 U+0081 U+0082 U+0083 U+0084 U+0085
5487     U+0086 U+0087 U+0088 U+0089 U+008A U+008B
5488     U+008C U+008D U+008E U+008F
5489     U+0090 U+0091 U+0092 U+0093 U+0094 U+0095
5490     U+0096 U+0097 U+0098 U+0099 U+009A U+009B
5491     U+009C U+009D U+009E U+009F U+007F;
5492     }
5493     }
5494     element { }
5495     }
5496    
5497     @@XMLTest:
5498 wakaba 1.12 @@@QName: xp.syntax.empty.test
5499     @@@DEnt:
5500     @@@@test:value: \
5501     @@@c:erred:
5502     <[[xp:wf-syntax-error]]> { (1, 1); }
5503     @@XMLTest:
5504     @@@QName: xp.syntax.space.test
5505     @@@DEnt:
5506 wakaba 1.13 @@@@test:value: \
5507 wakaba 1.12 @@@c:erred:
5508     <[[xp:wf-syntax-error]]> { (1, 4); }
5509     @@XMLTest:
5510     @@@QName: xp.syntax.newlines.test
5511     @@@DEnt:
5512     @@@@test:value:
5513     \
5514     \
5515     \
5516     @@@c:erred:
5517     <[[xp:wf-syntax-error]]> { (3, 1); }
5518    
5519     @@XMLTest:
5520 wakaba 1.6 @@@QName: xp.only.docel.test
5521 wakaba 1.5 @@@DEnt:
5522     @@@@test:value:
5523     <p></p>
5524     @@@test:domTree:
5525     document {
5526     xml-version: '1.0';
5527 wakaba 1.6 xml-encoding: null;
5528     xml-standalone: false;
5529     element {
5530     namespace-uri: null;
5531     prefix: null;
5532     local-name: 'p';
5533     text-content: '';
5534     }
5535     }
5536     @@XMLTest:
5537     @@@QName: xp.only.docel.emptyelemtag.test
5538     @@@DEnt:
5539     @@@@test:value:
5540     <p/>
5541     @@@test:domTree:
5542     document {
5543     xml-version: '1.0';
5544     xml-encoding: null;
5545     xml-standalone: false;
5546 wakaba 1.5 element {
5547     namespace-uri: null;
5548     prefix: null;
5549     local-name: 'p';
5550     text-content: '';
5551     }
5552     }
5553 wakaba 1.15 @@XMLTest:
5554     @@@QName: xp.root.s.1.test
5555     @@@DEnt:
5556     @@@@test:value:
5557     <?xml version="1.0"?>$u0020$u000D$u000A$u0009
5558     <p></p>
5559     @@@test:domTree:
5560     document {
5561     element { }
5562     }
5563    
5564     @@XMLTest:
5565     @@@QName: xp.Name.1.test
5566     @@@DEnt:
5567     @@@@test:value: <name/>
5568     @@@test:domTree:
5569     document {
5570     element {
5571     node-name: 'name';
5572     }
5573     }
5574     @@XMLTest:
5575     @@@QName: xp.Name.2.test
5576     @@@DEnt:
5577     @@@@test:value: <name0/>
5578     @@@test:domTree:
5579     document {
5580     element {
5581     node-name: 'name0';
5582     }
5583     }
5584     @@enImplNote:
5585     @@@ddid: xml11name
5586     @@@@:
5587     {TODO:: XML 1.1 Name tests required
5588     }
5589    
5590     @@XMLTest:
5591     @@@QName: xp.content.mse.1.test
5592     @@@DEnt:
5593     @@@@test:value:
5594     <p>]]></p>
5595     @@@c:erred:
5596     <[[xp|wf-syntax-error]]> { (1, 4)..(1, 6); }
5597     @@XMLTest:
5598     @@@QName: xp.content.mse.2.test
5599     @@@DEnt:
5600     @@@@test:value:
5601     <p>aaa]]>bbb</p>
5602     @@@c:erred:
5603     <[[xp|wf-syntax-error]]> { (1, 7)..(1, 9); }
5604    
5605     @@XMLTest:
5606     @@@QName: xp.root.comment.1.test
5607     @@@DEnt:
5608     @@@@test:value:
5609     <!--comment data-->
5610     <p/>
5611     @@@test:domTree:
5612     document {
5613     comment {
5614     data: 'comment data';
5615     }
5616     element { }
5617     }
5618     @@XMLTest:
5619     @@@QName: xp.root.comment.2.test
5620     @@@DEnt:
5621     @@@@test:value:
5622     <!---->
5623     <p/>
5624     @@@test:domTree:
5625     document {
5626     comment {
5627     data: '';
5628     }
5629     element { }
5630     }
5631     @@XMLTest:
5632     @@@QName: xp.root.after.pi.comment.1.test
5633     @@@DEnt:
5634     @@@@test:value:
5635     <?pi?>
5636     <!--comment data-->
5637     <p/>
5638     @@@test:domTree:
5639     document {
5640     pi { }
5641     comment {
5642     data: 'comment data';
5643     }
5644     element { }
5645     }
5646     @@XMLTest:
5647     @@@QName: xp.root.after.pi.comment.2.test
5648     @@@DEnt:
5649     @@@@test:value:
5650     <?pi?>
5651     <!---->
5652     <p/>
5653     @@@test:domTree:
5654     document {
5655     pi { }
5656     comment {
5657     data: '';
5658     }
5659     element { }
5660     }
5661     @@XMLTest:
5662     @@@QName: xp.root.after.element.comment.1.test
5663     @@@DEnt:
5664     @@@@test:value:
5665     <p/>
5666     <!--comment data-->
5667     @@@test:domTree:
5668     document {
5669     element { }
5670     comment {
5671     data: 'comment data';
5672     }
5673     }
5674     @@XMLTest:
5675     @@@QName: xp.root.after.element.comment.2.test
5676     @@@DEnt:
5677     @@@@test:value:
5678     <p/>
5679     <!---->
5680     @@@test:domTree:
5681     document {
5682     element { }
5683     comment {
5684     data: '';
5685     }
5686     }
5687     @@XMLTest:
5688     @@@QName: xp.doctype.intsubset.comment.1.test
5689     @@@DEnt:
5690     @@@@test:value:
5691     <!DOCTYPE a [
5692     <!--comment data-->
5693     ]>
5694     <p/>
5695     @@@test:domTree:
5696     document {
5697     document-type { }
5698     element { }
5699     }
5700     @@XMLTest:
5701     @@@QName: xp.doctype.intsubset.comment.2.test
5702     @@@DEnt:
5703     @@@@test:value:
5704     <!DOCTYPE a [
5705     <!---->
5706     ]>
5707     <p/>
5708     @@@test:domTree:
5709     document {
5710     document-type { }
5711     element { }
5712     }
5713     @@XMLTest:
5714     @@@QName: xp.doctype.intsubset.comment.3.test
5715     @@@DEnt:
5716     @@@@test:value:
5717     <!DOCTYPE a [
5718     <?pi?>
5719     <!---->
5720     ]>
5721     <p/>
5722     @@@test:domTree:
5723     document {
5724     document-type {
5725     pi { }
5726     }
5727     element { }
5728     }
5729     @@XMLTest:
5730     @@@QName: xp.content.comment.1.test
5731     @@@DEnt:
5732     @@@@test:value:
5733     <p><!--comment data--></p>
5734     @@@test:domTree:
5735     document {
5736     element {
5737     comment {
5738     data: 'comment data';
5739     }
5740     }
5741     }
5742     @@XMLTest:
5743     @@@QName: xp.content.comment.2.test
5744     @@@DEnt:
5745     @@@@test:value:
5746     <p><!----></p>
5747     @@@test:domTree:
5748     document {
5749     element {
5750     comment {
5751     data: '';
5752     }
5753     }
5754     }
5755     @@XMLTest:
5756     @@@QName: xp.content.comment.3.test
5757     @@@DEnt:
5758     @@@@test:value:
5759     <p>aaaaa<!---->bbbbb</p>
5760     @@@test:domTree:
5761     document {
5762     element {
5763     text {
5764     data: 'aaaaa';
5765     }
5766     comment {
5767     data: '';
5768     }
5769     text {
5770     data: 'bbbbb';
5771     }
5772     }
5773     }
5774     @@XMLTest:
5775     @@@QName: xp.content.comment.--.1.test
5776     @@@DEnt:
5777     @@@@test:value:
5778     <p><!--data--data--></p>
5779     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 12)..(1, 17); }
5780     @@XMLTest:
5781     @@@QName: xp.content.comment.---gt.test
5782     @@@DEnt:
5783     @@@@test:value:
5784     <p><!--data---></p>
5785     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 12)..(1, 15); }
5786 wakaba 1.13
5787     @@XMLTest:
5788     @@@QName: xp.xmldecl.version.1.0.test
5789     @@@DEnt:
5790     @@@@test:value:
5791     <?xml version="1.0"?>
5792     <p></p>
5793     @@@test:domTree:
5794     document {
5795     xml-version: '1.0';
5796     xml-encoding: null;
5797     xml-standalone: false;
5798     element { }
5799     }
5800     @@XMLTest:
5801     @@@QName: xp.xmldecl.version.1.0.lita.test
5802     @@@DEnt:
5803     @@@@test:value:
5804     <?xml version='1.0'?>
5805     <p></p>
5806     @@@test:domTree:
5807     document {
5808     xml-version: '1.0';
5809     xml-encoding: null;
5810     xml-standalone: false;
5811     element { }
5812     }
5813     @@XMLTest:
5814     @@@QName: xp.xmldecl.version.1.0.s.test
5815     @@@DEnt:
5816     @@@@test:value:
5817     <?xml version = "1.0" ?>
5818     <p></p>
5819     @@@test:domTree:
5820     document {
5821     xml-version: '1.0';
5822     xml-encoding: null;
5823     xml-standalone: false;
5824     element { }
5825     }
5826     @@XMLTest:
5827     @@@QName: xp.xmldecl.version.1.1.test
5828     @@@DEnt:
5829     @@@@test:value:
5830     <?xml version="1.1"?>
5831     <p></p>
5832     @@@test:domTree:
5833     document {
5834     xml-version: '1.1';
5835     xml-encoding: null;
5836     xml-standalone: false;
5837     element { }
5838     }
5839    
5840     @@XMLTest:
5841     @@@QName: xp.xmldecl.version.1.0.encoding.usascii.test
5842     @@@DEnt:
5843     @@@@test:value:
5844     <?xml version="1.0" encoding="US-ascii"?>
5845     <p></p>
5846     @@@test:domTree:
5847     document {
5848     xml-version: '1.0';
5849     xml-encoding: 'US-ascii';
5850     xml-standalone: false;
5851     element { }
5852     }
5853     @@XMLTest:
5854     @@@QName: xp.xmldecl.version.1.0.encoding.usascii.lita.test
5855     @@@DEnt:
5856     @@@@test:value:
5857     <?xml version="1.0" encoding='US-ascii'?>
5858     <p></p>
5859     @@@test:domTree:
5860     document {
5861     xml-version: '1.0';
5862     xml-encoding: 'US-ascii';
5863     xml-standalone: false;
5864     element { }
5865     }
5866     @@XMLTest:
5867     @@@QName: xp.xmldecl.version.1.0.encoding.usascii.s.test
5868     @@@DEnt:
5869     @@@@test:value:
5870     <?xml version="1.0" encoding = "US-ascii" ?>
5871     <p></p>
5872     @@@test:domTree:
5873     document {
5874     xml-version: '1.0';
5875     xml-encoding: 'US-ascii';
5876     xml-standalone: false;
5877     element { }
5878     }
5879    
5880     @@XMLTest:
5881     @@@QName: xp.xmldecl.version.1.0.encoding.usascii.standalone.yes.test
5882     @@@DEnt:
5883     @@@@test:value:
5884     <?xml version="1.0" encoding="us-ascii" standalone="yes"?>
5885     <p></p>
5886     @@@test:domTree:
5887     document {
5888     xml-version: '1.0';
5889     xml-encoding: 'us-ascii';
5890     xml-standalone: true;
5891     element { }
5892     }
5893     @@XMLTest:
5894     @@@QName: xp.xmldecl.version.1.0.encoding.usascii.standalone.no.test
5895     @@@DEnt:
5896     @@@@test:value:
5897     <?xml version="1.0" encoding="us-ascii" standalone="no"?>
5898     <p></p>
5899     @@@test:domTree:
5900     document {
5901     xml-version: '1.0';
5902     xml-encoding: 'us-ascii';
5903     xml-standalone: false;
5904     element { }
5905     }
5906     @@XMLTest:
5907     @@@QName: xp.xmldecl.version.1.0.encoding.usascii.standalone.yes.lita.test
5908     @@@DEnt:
5909     @@@@test:value:
5910     <?xml version="1.0" encoding="us-ascii" standalone='yes'?>
5911     <p></p>
5912     @@@test:domTree:
5913     document {
5914     xml-version: '1.0';
5915     xml-encoding: 'us-ascii';
5916     xml-standalone: true;
5917     element { }
5918     }
5919     @@XMLTest:
5920     @@@QName: xp.xmldecl.version.1.0.encoding.usascii.standalone.yes.s.test
5921     @@@DEnt:
5922     @@@@test:value:
5923     <?xml version="1.0" encoding="us-ascii" standalone = "yes" ?>
5924     <p></p>
5925     @@@test:domTree:
5926     document {
5927     xml-version: '1.0';
5928     xml-encoding: 'us-ascii';
5929     xml-standalone: true;
5930     element { }
5931     }
5932 wakaba 1.14 @@XMLTest:
5933     @@@QName: xp.xmldecl.no.encoding.but.standalone.attr.test
5934     @@@DEnt:
5935     @@@@test:value:
5936     <?xml version="1.0" standalone="yes"?>
5937     <p></p>
5938     @@@test:domTree:
5939     document {
5940     xml-version: '1.0';
5941     xml-encoding: null;
5942     xml-standalone: true;
5943     element { }
5944     }
5945     @@XMLTest:
5946     @@@QName: xp.xmldecl.encoding.encname.test
5947     @@@DEnt:
5948     @@@@test:value:
5949     <?xml version="1.0" encoding="a-._01-"?>
5950     <p></p>
5951     @@@test:domTree:
5952     document {
5953     xml-version: '1.0';
5954     xml-encoding: 'a-._01-';
5955     xml-standalone: false;
5956     element { }
5957     }
5958    
5959     @@XMLTest:
5960     @@@QName: xp.xmldecl.no.s.no.attr.test
5961     @@@DEnt:
5962     @@@@test:value:
5963     <?xml?>
5964     <p></p>
5965     @@@c:erred:
5966 wakaba 1.16 <[[xp:wf-syntax-error]]> { (1, 1)..(1, 7); }
5967 wakaba 1.14 @@XMLTest:
5968     @@@QName: xp.xmldecl.s.no.attr.test
5969     @@@DEnt:
5970     @@@@test:value:
5971     <?xml ?>
5972     <p></p>
5973     @@@c:erred:
5974     <[[xp:wf-syntax-error]]> { (1, 8)..(1, 9); }
5975     @@XMLTest:
5976     @@@QName: xp.xmldecl.unknown.attr.test
5977     @@@DEnt:
5978     @@@@test:value:
5979     <?xml unknown="value"?>
5980     <p></p>
5981     @@@c:erred:
5982     <[[xp:wf-syntax-error]]> { (1, 8)..(1, 22); }
5983     @@XMLTest:
5984     @@@QName: xp.xmldecl.version.unknown.attr.test
5985     @@@DEnt:
5986     @@@@test:value:
5987     <?xml version="1.0" unknown="value"?>
5988     <p></p>
5989     @@@c:erred:
5990     <[[xp:wf-syntax-error]]> { (1, 21)..(1, 35); }
5991     @@XMLTest:
5992     @@@QName: xp.xmldecl.version.encoding.unknown.attr.test
5993     @@@DEnt:
5994     @@@@test:value:
5995     <?xml version="1.0" encoding="us-ascii" unknown="value"?>
5996     <p></p>
5997     @@@c:erred:
5998     <[[xp:wf-syntax-error]]> { (1, 41)..(1, 55); }
5999     @@XMLTest:
6000     @@@QName: xp.xmldecl.version.encoding.standalone.unknown.attr.test
6001     @@@DEnt:
6002     @@@@test:value:
6003     <?xml version="1.0" encoding="us-ascii" standalone="yes"
6004     unknown="value"?>
6005     <p></p>
6006     @@@c:erred:
6007     <[[xp:wf-syntax-error]]> { (2, 1)..(2, 15); }
6008     @@XMLTest:
6009     @@@QName: xp.xmldecl.no.version.but.encoding.attr.test
6010     @@@DEnt:
6011     @@@@test:value:
6012     <?xml encoding="us-ascii"?>
6013     <p></p>
6014     @@@c:erred:
6015     <[[xp:wf-syntax-error]]> { (1, 7)..(1, 25); }
6016     @@XMLTest:
6017     @@@QName: xp.xmldecl.no.version.but.standalone.attr.test
6018     @@@DEnt:
6019     @@@@test:value:
6020     <?xml standalone="yes"?>
6021     <p></p>
6022     @@@c:erred:
6023     <[[xp:wf-syntax-error]]> { (1, 7)..(1, 24); }
6024     @@XMLTest:
6025     @@@QName: xp.xmldecl.version.unsupported.test
6026     @@@DEnt:
6027     @@@@test:value:
6028     <?xml version="1.2"?>
6029     <p></p>
6030     @@@c:erred:
6031     <[[xp:wf-unsupported-xml-version]]> { (1, 7)..(1, 19); }
6032     @@XMLTest:
6033     @@@QName: xp.xmldecl.version.unsupported.2.test
6034     @@@DEnt:
6035     @@@@test:value:
6036     <?xml version=" 1.0 "?>
6037     <p></p>
6038     @@@c:erred:
6039     <[[xp:wf-unsupported-xml-version]]> { (1, 7)..(1, 21); }
6040     @@XMLTest:
6041     @@@QName: xp.xmldecl.version.unsupported.3.test
6042     @@@DEnt:
6043     @@@@test:value:
6044     <?xml version="01.00"?>
6045     <p></p>
6046     @@@c:erred:
6047     <[[xp:wf-unsupported-xml-version]]> { (1, 7)..(1, 21); }
6048     @@XMLTest:
6049     @@@QName: xp.xmldecl.encoding.malformed.1.test
6050     @@@DEnt:
6051     @@@@test:value:
6052     <?xml version="1.0" encoding="0088"?>
6053     <p></p>
6054     @@@c:erred:
6055     <[[xp:wf-malformed-enc-name]]> { (1, 21)..(1, 35); }
6056     @@XMLTest:
6057     @@@QName: xp.xmldecl.encoding.malformed.2.test
6058     @@@DEnt:
6059     @@@@test:value:
6060     <?xml version="1.0" encoding="D.V.D!"?>
6061     <p></p>
6062     @@@c:erred:
6063     <[[xp:wf-malformed-enc-name]]> { (1, 21)..(1, 38); }
6064     @@XMLTest:
6065     @@@QName: xp.xmldecl.standalone.malformed.1.test
6066     @@@DEnt:
6067     @@@@test:value:
6068     <?xml version="1.0" standalone="true"?>
6069     <p></p>
6070     @@@c:erred:
6071     <[[xp:wf-malformed-xml-standalone]]> { (1, 21)..(1, 38); }
6072     @@XMLTest:
6073     @@@QName: xp.xmldecl.standalone.malformed.2.test
6074     @@@DEnt:
6075     @@@@test:value:
6076     <?xml version="1.0" standalone="YES"?>
6077     <p></p>
6078     @@@c:erred:
6079     <[[xp:wf-malformed-xml-standalone]]> { (1, 21)..(1, 37); }
6080     @@XMLTest:
6081     @@@QName: xp.xmldecl.standalone.malformed.3.test
6082     @@@DEnt:
6083     @@@@test:value:
6084     <?xml version="1.0" standalone="no "?>
6085     <p></p>
6086     @@@c:erred:
6087     <[[xp:wf-malformed-xml-standalone]]> { (1, 21)..(1, 38); }
6088 wakaba 1.6
6089     @@XMLTest:
6090 wakaba 1.14 @@@QName: xp.no-xmldecl.xml...-pi.test
6091     @@@DEnt:
6092     @@@@test:value:
6093     <?xmldeclaration?>
6094     <a></a>
6095     @@@test:domTree:
6096     document {
6097     pi {
6098     node-name: 'xmldeclaration';
6099     node-value: '';
6100     }
6101     element { }
6102     }
6103     @@XMLTest:
6104     @@@QName: xp.no-xmldecl.xml...-pi.after.document.element.test
6105     @@@DEnt:
6106     @@@@test:value:
6107     <a></a>
6108     <?xmldeclaration?>
6109     @@@test:domTree:
6110     document {
6111     element { }
6112     pi {
6113     node-name: 'xmldeclaration';
6114     node-value: '';
6115     }
6116     }
6117     @@XMLTest:
6118     @@@QName: xp.no-xmldecl.xml...-pi.in.document.element.test
6119     @@@DEnt:
6120     @@@@test:value:
6121     <a>
6122     <?xmldeclaration?>
6123     </a>
6124     @@@test:domTree:
6125     document {
6126     element {
6127     text { }
6128     pi {
6129     node-name: 'xmldeclaration';
6130     node-value: '';
6131     }
6132     text { }
6133     }
6134     }
6135     @@XMLTest:
6136     @@@QName: xp.no-xmldecl.xml...-pi.in.doctype.test
6137     @@@DEnt:
6138     @@@@test:value:
6139     <!DOCTYPE a [
6140     <?xmldeclaration?>
6141     ]>
6142     <a></a>
6143     @@@test:domTree:
6144     document {
6145     document-type {
6146     pi {
6147     node-name: 'xmldeclaration';
6148     node-value: '';
6149     }
6150     }
6151     element { }
6152     }
6153    
6154     @@XMLTest:
6155     @@@QName: xp.XMLdecl.test
6156     @@@DEnt:
6157     @@@@test:value:
6158     <?XML version="1.0"?>
6159     <p></p>
6160     @@@c:erred:
6161     <[[xp:wf-pi-target-is-xml]]> { (1, 1)..(1, 5); }
6162     @@XMLTest:
6163     @@@QName: xp.Xmldecl.test
6164     @@@DEnt:
6165     @@@@test:value:
6166     <?Xml version="1.0"?>
6167     <p></p>
6168     @@@c:erred:
6169     <[[xp:wf-pi-target-is-xml]]> { (1, 1)..(1, 5); }
6170     @@XMLTest:
6171     @@@QName: xp.xmldecl.after.document.element.empty.test
6172     @@@DEnt:
6173     @@@@test:value:
6174     <p></p>
6175     <?xml?>
6176     @@@c:erred:
6177     <[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); }
6178     @@XMLTest:
6179     @@@QName: xp.xmldecl.after.document.element.test
6180     @@@DEnt:
6181     @@@@test:value:
6182     <p></p>
6183     <?xml version="1.0"?>
6184     @@@c:erred:
6185     <[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); }
6186     @@XMLTest:
6187     @@@QName: xp.xmldecl.in.element.empty.test
6188     @@@DEnt:
6189     @@@@test:value:
6190     <p>
6191     <?xml?>
6192     </p>
6193     @@@c:erred:
6194     <[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); }
6195     @@XMLTest:
6196     @@@QName: xp.xmldecl.in.element.test
6197     @@@DEnt:
6198     @@@@test:value:
6199     <p>
6200     <?xml version="1.0"?>
6201     </p>
6202     @@@c:erred:
6203     <[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); }
6204     @@XMLTest:
6205     @@@QName: xp.xmldecl.after.comment.test
6206     @@@DEnt:
6207     @@@@test:value:
6208     <!---->
6209     <?xml version="1.0"?>
6210     <p></p>
6211     @@@c:erred:
6212     <[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); }
6213     @@XMLTest:
6214     @@@QName: xp.xmldecl.after.comment.empty.test
6215     @@@DEnt:
6216     @@@@test:value:
6217     <!---->
6218     <?xml?>
6219     <p></p>
6220     @@@c:erred:
6221     <[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); }
6222     @@XMLTest:
6223     @@@QName: xp.xmldecl.after.pi.test
6224     @@@DEnt:
6225     @@@@test:value:
6226     <?xml-declaration?>
6227     <?xml version="1.0"?>
6228     <p></p>
6229     @@@c:erred:
6230     <[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); }
6231     @@XMLTest:
6232     @@@QName: xp.xmldecl.after.pi.empty.test
6233     @@@DEnt:
6234     @@@@test:value:
6235     <?xml-declaration?>
6236     <?xml?>
6237     <p></p>
6238     @@@c:erred:
6239     <[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); }
6240     @@XMLTest:
6241 wakaba 1.16 @@@QName: xp.xmldecl.after.pi.2.test
6242     @@@DEnt:
6243     @@@@test:value:
6244     <?declaration?>
6245     <?xml version="1.0"?>
6246     <p></p>
6247     @@@c:erred:
6248     <[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); }
6249     @@XMLTest:
6250     @@@QName: xp.xmldecl.after.pi.empty.2.test
6251     @@@DEnt:
6252     @@@@test:value:
6253     <?declaration?>
6254     <?xml?>
6255     <p></p>
6256     @@@c:erred:
6257     <[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); }
6258     @@XMLTest:
6259 wakaba 1.14 @@@QName: xp.xmldecl.after.doctype.test
6260     @@@DEnt:
6261     @@@@test:value:
6262     <!DOCTYPE a>
6263     <?xml version="1.0"?>
6264     <p></p>
6265     @@@c:erred:
6266     <[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); }
6267     @@XMLTest:
6268     @@@QName: xp.xmldecl.after.doctype.empty.test
6269     @@@DEnt:
6270     @@@@test:value:
6271     <!DOCTYPE a>
6272     <?xml?>
6273     <p></p>
6274     @@@c:erred:
6275     <[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); }
6276     @@XMLTest:
6277     @@@QName: xp.xmldecl.in.doctype.test
6278     @@@DEnt:
6279     @@@@test:value:
6280     <!DOCTYPE a [
6281     <?xml version="1.0"?>
6282     ]>
6283     <p></p>
6284     @@@c:erred:
6285     <[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); }
6286     @@XMLTest:
6287     @@@QName: xp.xmldecl.in.doctype.empty.test
6288     @@@DEnt:
6289     @@@@test:value:
6290     <!DOCTYPE a [
6291     <?xml?>
6292     ]>
6293     <p></p>
6294     @@@c:erred:
6295     <[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); }
6296    
6297     @@XMLTest:
6298     @@@QName: xp.pi.before.element.empty.test
6299     @@@DEnt:
6300     @@@@test:value:
6301     <?target?>
6302     <a></a>
6303     @@@test:domTree:
6304     document {
6305     pi {
6306     node-name: 'target';
6307     node-value: '';
6308     }
6309     element { }
6310     }
6311     @@XMLTest:
6312     @@@QName: xp.pi.before.element.s.test
6313     @@@DEnt:
6314     @@@@test:value:
6315     <?target ?>
6316     <a></a>
6317     @@@test:domTree:
6318     document {
6319     pi {
6320     node-name: 'target';
6321     node-value: '';
6322     }
6323     element { }
6324     }
6325     @@XMLTest:
6326     @@@QName: xp.pi.before.element.string.test
6327     @@@DEnt:
6328     @@@@test:value:
6329     <?target string?>
6330     <a></a>
6331     @@@test:domTree:
6332     document {
6333     pi {
6334     node-name: 'target';
6335     node-value: 'string';
6336     }
6337     element { }
6338     }
6339     @@XMLTest:
6340     @@@QName: xp.pi.before.element.string.s.test
6341     @@@DEnt:
6342     @@@@test:value:
6343     <?target string ?>
6344     <a></a>
6345     @@@test:domTree:
6346     document {
6347     pi {
6348     node-name: 'target';
6349     node-value: 'string ';
6350     }
6351     element { }
6352     }
6353     @@XMLTest:
6354     @@@QName: xp.pi.before.element.gt.test
6355     @@@DEnt:
6356     @@@@test:value:
6357     <?target string>string?>
6358     <a></a>
6359     @@@test:domTree:
6360     document {
6361     pi {
6362     node-name: 'target';
6363     node-value: 'string>string';
6364     }
6365     element { }
6366     }
6367     @@XMLTest:
6368     @@@QName: xp.pi.doctype.empty.test
6369     @@@DEnt:
6370     @@@@test:value:
6371     <!DOCTYPE a [
6372     <?target?>
6373     ]>
6374     <a></a>
6375     @@@test:domTree:
6376     document {
6377     document-type {
6378     pi {
6379     node-name: 'target';
6380     node-value: '';
6381     }
6382     }
6383     element { }
6384     }
6385    
6386     @@XMLTest:
6387     @@@QName: xp.pi.no.target.test
6388     @@@DEnt:
6389     @@@@test:value:
6390     <??>
6391     <p></p>
6392     @@@c:erred:
6393     <[[xp:wf-syntax-error]]> { (1, 3)..(1, 4); }
6394     @@XMLTest:
6395     @@@QName: xp.pi.no.target.2.test
6396     @@@DEnt:
6397     @@@@test:value:
6398     <? ?>
6399     <p></p>
6400     @@@c:erred:
6401     <[[xp:wf-syntax-error]]> { (1, 3)..(1, 4); }
6402     @@XMLTest:
6403     @@@QName: xp.pi.bad.target.1.test
6404     @@@DEnt:
6405     @@@@test:value:
6406     <?target! ?>
6407     <p></p>
6408     @@@c:erred:
6409     <[[xp:wf-syntax-error]]> { (1, 9)..(1, 9); }
6410     @@XMLTest:
6411     @@@QName: xp.pi.bad.target.2.test
6412     @@@DEnt:
6413     @@@@test:value:
6414     <?0target ?>
6415     <p></p>
6416     @@@c:erred:
6417     <[[xp:wf-syntax-error]]> { (1, 3)..(1, 3); }
6418    
6419     @@XMLTest:
6420 wakaba 1.15 @@@QName: xp.cdatasection.empty.1.test
6421     @@@DEnt:
6422     @@@@test:value:
6423     <p><![CDATA[]]></p>
6424     @@@test:domTree:
6425     document {
6426     element {
6427     cdata-section {
6428     data: '';
6429     }
6430     }
6431     }
6432     @@XMLTest:
6433     @@@QName: xp.cdatasection.empty.2.test
6434     @@@DEnt:
6435     @@@@test:value:
6436     <p>aa<![CDATA[]]>bb</p>
6437     @@@test:domTree:
6438     document {
6439     element {
6440     text { data: 'aa'; }
6441     cdata-section {
6442     data: '';
6443     }
6444     text { data: 'bb'; }
6445     }
6446     }
6447     @@XMLTest:
6448     @@@QName: xp.cdatasection.1.test
6449     @@@DEnt:
6450     @@@@test:value:
6451     <p><![CDATA[abcdefg]]></p>
6452     @@@test:domTree:
6453     document {
6454     element {
6455     cdata-section {
6456     data: 'abcdefg';
6457     }
6458     }
6459     }
6460     @@XMLTest:
6461     @@@QName: xp.cdatasection.2.test
6462     @@@DEnt:
6463     @@@@test:value:
6464     <p>aa<![CDATA[abcdefg]]>bb</p>
6465     @@@test:domTree:
6466     document {
6467     element {
6468     text { data: 'aa'; }
6469     cdata-section {
6470     data: 'abcdefg';
6471     }
6472     text { data: 'bb'; }
6473     }
6474     }
6475     @@XMLTest:
6476     @@@QName: xp.cdatasection.ref.1.test
6477     @@@DEnt:
6478     @@@@test:value:
6479     <p><![CDATA[a&amp;&#x32;&#32;%abc;&def;]]&gt;b]]></p>
6480     @@@test:domTree:
6481     document {
6482     element {
6483     cdata-section {
6484     data: 'a&amp;&#x32;&#32;%abc;&def;]]&gt;b';
6485     }
6486     }
6487     }
6488     @@XMLTest:
6489     @@@QName: xp.cdatasection.in.general.entity.test
6490     @@@DEnt:
6491     @@@@test:value:
6492     <!DOCTYPE p [
6493     <!ENTITY cdata "<![CDATA[text]]>">
6494     ]>
6495     <p>&cdata;</p>
6496 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
6497 wakaba 1.15 @@@test:domTree:
6498     document {
6499     document-type {
6500     general-entity {
6501     node-name: 'cdata';
6502     cdata-section {
6503     data: 'text';
6504     }
6505     }
6506     }
6507     element {
6508     general-entity-reference {
6509 wakaba 1.23 node-name: 'cdata';
6510 wakaba 1.34 manakai-expanded: true;
6511 wakaba 1.15 cdata-section {
6512     data: 'text';
6513     }
6514     }
6515     }
6516     }
6517     @@XMLTest:
6518     @@@QName: xp.cdatasection.no.mse.test
6519     @@@DEnt:
6520     @@@@test:value:
6521     <p><![CDATA[text</p>
6522     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 21); }
6523     @@XMLTest:
6524     @@@QName: xp.cdatasection.nest.test
6525     @@@DEnt:
6526     @@@@test:value:
6527     <p><![CDATA[text01<![CDATA[txt2]]>text3]]></p>
6528     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 40)..(1, 42); }
6529    
6530     @@XMLTest:
6531 wakaba 1.6 @@@QName: xp.doctype.empty.test
6532     @@@DEnt:
6533     @@@@test:value:
6534     <!DOCTYPE a>
6535     <a></a>
6536     @@@test:domTree:
6537     document {
6538     xml-version: '1.0';
6539     xml-encoding: null;
6540     xml-standalone: false;
6541     document-type {
6542     node-name: 'a';
6543 wakaba 1.17 public-id: null;
6544     system-id: null;
6545 wakaba 1.6 }
6546     element {
6547     namespace-uri: null;
6548     prefix: null;
6549     local-name: 'a';
6550     text-content: '';
6551     }
6552     }
6553 wakaba 1.15 @@XMLTest:
6554     @@@QName: xp.doctype.empty.after.document.element.test
6555     @@@DEnt:
6556     @@@@test:value:
6557     <a></a>
6558     <!DOCTYPE a>
6559     @@@c:erred: <[[xp|wf-syntax-error]]> { (2, 1)..(2, 12); }
6560     @@XMLTest:
6561     @@@QName: xp.doctype.empty.in.element.test
6562     @@@DEnt:
6563     @@@@test:value:
6564     <a>
6565     <!DOCTYPE a>
6566     </a>
6567     @@@c:erred: <[[xp|wf-syntax-error]]> { (2, 1)..(2, 12); }
6568     @@XMLTest:
6569     @@@QName: xp.doctype.empty.dup.test
6570     @@@DEnt:
6571     @@@@test:value:
6572     <!DOCTYPE a>
6573     <!DOCTYPE a>
6574     <a></a>
6575     @@@c:erred: <[[xp|wf-syntax-error]]> { (2, 1)..(2, 12); }
6576     @@XMLTest:
6577     @@@QName: xp.doctype.empty.in.intsubset.test
6578     @@@DEnt:
6579     @@@@test:value:
6580     <!DOCTYPE a [
6581     <!DOCTYPE a>
6582     ]>
6583     <a></a>
6584     @@@c:erred: <[[xp|wf-syntax-error]]> { (2, 1)..(2, 12); }
6585 wakaba 1.16 @@XMLTest:
6586     @@@QName: xp.doctype.no.s.no.name.test
6587     @@@DEnt:
6588     @@@@test:value:
6589     <!DOCTYPE>
6590     <a></a>
6591     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 10); }
6592     @@XMLTest:
6593     @@@QName: xp.doctype.no.name.test
6594     @@@DEnt:
6595     @@@@test:value:
6596     <!DOCTYPE >
6597     <a></a>
6598     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 11); }
6599     @@XMLTest:
6600     @@@QName: xp.doctype.name.s.test
6601     @@@DEnt:
6602     @@@@test:value:
6603     <!DOCTYPE aa >
6604     <aa></aa>
6605     @@@test:domTree:
6606     document {
6607     document-type {
6608     node-name: 'aa';
6609 wakaba 1.17 public-id: null;
6610     system-id: null;
6611 wakaba 1.16 }
6612     element { }
6613     }
6614     @@XMLTest:
6615     @@@QName: xp.doctype.no.mdc.test
6616     @@@DEnt:
6617     @@@@test:value:
6618     <!DOCTYPE aa
6619     <aa></aa>
6620     @@@c:erred: <[[xp|wf-syntax-error]]> { (2, 1); }
6621 wakaba 1.6
6622     @@XMLTest:
6623 wakaba 1.16 @@@QName: xp.doctype.intsubset.empty.1.test
6624 wakaba 1.6 @@@DEnt:
6625     @@@@test:value:
6626 wakaba 1.16 <!DOCTYPE a []>
6627 wakaba 1.6 <a></a>
6628     @@@test:domTree:
6629     document {
6630     xml-version: '1.0';
6631     xml-encoding: null;
6632     xml-standalone: false;
6633     document-type {
6634     node-name: 'a';
6635 wakaba 1.17 public-id: null;
6636     system-id: null;
6637 wakaba 1.6 }
6638     element {
6639     namespace-uri: null;
6640     prefix: null;
6641     local-name: 'a';
6642     text-content: '';
6643     }
6644     }
6645     @@XMLTest:
6646 wakaba 1.16 @@@QName: xp.doctype.intsubset.empty.2.test
6647 wakaba 1.6 @@@DEnt:
6648     @@@@test:value:
6649     <!DOCTYPE a [
6650 wakaba 1.16
6651 wakaba 1.6 ]>
6652     <a></a>
6653     @@@test:domTree:
6654     document {
6655     xml-version: '1.0';
6656     xml-encoding: null;
6657     xml-standalone: false;
6658     document-type {
6659     node-name: 'a';
6660 wakaba 1.17 public-id: null;
6661     system-id: null;
6662 wakaba 1.6 }
6663     element {
6664     namespace-uri: null;
6665     prefix: null;
6666     local-name: 'a';
6667     text-content: '';
6668     }
6669     }
6670     @@XMLTest:
6671 wakaba 1.16 @@@QName: xp.doctype.intsubset.empty.3.test
6672 wakaba 1.6 @@@DEnt:
6673     @@@@test:value:
6674 wakaba 1.16 <!DOCTYPE a[]>
6675 wakaba 1.6 <a></a>
6676     @@@test:domTree:
6677     document {
6678     document-type {
6679     node-name: 'a';
6680 wakaba 1.17 public-id: null;
6681     system-id: null;
6682 wakaba 1.6 }
6683 wakaba 1.16 element { }
6684     }
6685     @@XMLTest:
6686     @@@QName: xp.doctype.intsubset.empty.4.test
6687     @@@DEnt:
6688     @@@@test:value:
6689     <!DOCTYPE a[] >
6690     <a></a>
6691     @@@test:domTree:
6692     document {
6693     document-type {
6694     node-name: 'a';
6695 wakaba 1.17 public-id: null;
6696     system-id: null;
6697 wakaba 1.6 }
6698 wakaba 1.16 element { }
6699 wakaba 1.6 }
6700     @@XMLTest:
6701 wakaba 1.16 @@@QName: xp.doctype.intsubset.no.dsc.1.test
6702     @@@DEnt:
6703     @@@@test:value:
6704     <!DOCTYPE a [>
6705     <a></a>
6706     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 14); }
6707     @@XMLTest:
6708     @@@QName: xp.doctype.intsubset.no.dsc.2.test
6709 wakaba 1.6 @@@DEnt:
6710     @@@@test:value:
6711     <!DOCTYPE a [
6712     <a></a>
6713 wakaba 1.16 @@@c:erred: <[[xp|wf-syntax-error]]> { (2, 1); }
6714     @@XMLTest:
6715     @@@QName: xp.doctype.intsubset.no.dsc.3.test
6716     @@@DEnt:
6717     @@@@test:value:
6718     <!DOCTYPE a [
6719     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 14); }
6720     @@XMLTest:
6721     @@@QName: xp.doctype.intsubset.no.mdc.1.test
6722     @@@DEnt:
6723     @@@@test:value:
6724     <!DOCTYPE a []
6725     <a/>
6726     @@@c:erred: <[[xp|wf-syntax-error]]> { (2, 1); }
6727     @@XMLTest:
6728     @@@QName: xp.doctype.intsubset.no.mdc.2.test
6729     @@@DEnt:
6730     @@@@test:value:
6731     <!DOCTYPE a []]>
6732     <a/>
6733     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 15); }
6734 wakaba 1.17 @@XMLTest:
6735     @@@QName: xp.doctype.pubid.sysid.1.test
6736     @@@DEnt:
6737     @@@@test:value:
6738     <!DOCTYPE a PUBLIC "pubid" "sysid">
6739     <a/>
6740     @@@test:domTree:
6741     document {
6742     document-type {
6743     node-name: 'a';
6744     public-id: 'pubid';
6745     system-id: 'sysid';
6746     }
6747     element { }
6748     }
6749     @@XMLTest:
6750     @@@QName: xp.doctype.pubid.sysid.2.test
6751     @@@DEnt:
6752     @@@@test:value:
6753     <!DOCTYPE a PUBLIC 'pubid' "sysid">
6754     <a/>
6755     @@@test:domTree:
6756     document {
6757     document-type {
6758     node-name: 'a';
6759     public-id: 'pubid';
6760     system-id: 'sysid';
6761     }
6762     element { }
6763     }
6764     @@XMLTest:
6765     @@@QName: xp.doctype.pubid.sysid.3.test
6766     @@@DEnt:
6767     @@@@test:value:
6768     <!DOCTYPE a PUBLIC "pubid" 'sysid'>
6769     <a/>
6770     @@@test:domTree:
6771     document {
6772     document-type {
6773     node-name: 'a';
6774     public-id: 'pubid';
6775     system-id: 'sysid';
6776     }
6777     element { }
6778     }
6779     @@XMLTest:
6780     @@@QName: xp.doctype.pubid.sysid.4.test
6781     @@@DEnt:
6782     @@@@test:value:
6783     <!DOCTYPE a PUBLIC 'pubid' 'sysid'>
6784     <a/>
6785     @@@test:domTree:
6786     document {
6787     document-type {
6788     node-name: 'a';
6789     public-id: 'pubid';
6790     system-id: 'sysid';
6791     }
6792     element { }
6793     }
6794     @@XMLTest:
6795     @@@QName: xp.doctype.pubid.sysid.5.test
6796     @@@DEnt:
6797     @@@@test:value:
6798     <!DOCTYPE a PUBLIC "pubid" "sysid" >
6799     <a/>
6800     @@@test:domTree:
6801     document {
6802     document-type {
6803     node-name: 'a';
6804     public-id: 'pubid';
6805     system-id: 'sysid';
6806     }
6807     element { }
6808     }
6809     @@XMLTest:
6810     @@@QName: xp.doctype.pubid.sysid.6.test
6811     @@@DEnt:
6812     @@@@test:value:
6813     <!DOCTYPE a PUBLIC 'pubid' 'sysid' >
6814     <a/>
6815     @@@test:domTree:
6816     document {
6817     document-type {
6818     node-name: 'a';
6819     public-id: 'pubid';
6820     system-id: 'sysid';
6821     }
6822     element { }
6823     }
6824     @@XMLTest:
6825     @@@QName: xp.doctype.pubid.sysid.intsubset.1.test
6826     @@@DEnt:
6827     @@@@test:value:
6828     <!DOCTYPE a PUBLIC "pubid" "sysid"[]>
6829     <a/>
6830     @@@test:domTree:
6831     document {
6832     document-type {
6833     node-name: 'a';
6834     public-id: 'pubid';
6835     system-id: 'sysid';
6836     }
6837     element { }
6838     }
6839     @@XMLTest:
6840     @@@QName: xp.doctype.pubid.sysid.intsubset.2.test
6841     @@@DEnt:
6842     @@@@test:value:
6843     <!DOCTYPE a PUBLIC "pubid" "sysid" []>
6844     <a/>
6845     @@@test:domTree:
6846     document {
6847     document-type {
6848     node-name: 'a';
6849     public-id: 'pubid';
6850     system-id: 'sysid';
6851     }
6852     element { }
6853     }
6854     @@XMLTest:
6855     @@@QName: xp.doctype.pubid.sysid.intsubset.3.test
6856     @@@DEnt:
6857     @@@@test:value:
6858     <!DOCTYPE a PUBLIC 'pubid' 'sysid'[]>
6859     <a/>
6860     @@@test:domTree:
6861     document {
6862     document-type {
6863     node-name: 'a';
6864     public-id: 'pubid';
6865     system-id: 'sysid';
6866     }
6867     element { }
6868     }
6869     @@XMLTest:
6870     @@@QName: xp.doctype.pubid.sysid.intsubset.4.test
6871     @@@DEnt:
6872     @@@@test:value:
6873     <!DOCTYPE a PUBLIC 'pubid' 'sysid' []>
6874     <a/>
6875     @@@test:domTree:
6876     document {
6877     document-type {
6878     node-name: 'a';
6879     public-id: 'pubid';
6880     system-id: 'sysid';
6881     }
6882     element { }
6883     }
6884     @@XMLTest:
6885     @@@QName: xp.doctype.sysid.1.test
6886     @@@DEnt:
6887     @@@@test:value:
6888     <!DOCTYPE a SYSTEM "sysid">
6889     <a/>
6890     @@@test:domTree:
6891     document {
6892     document-type {
6893     node-name: 'a';
6894     public-id: null;
6895     system-id: 'sysid';
6896     }
6897     element { }
6898     }
6899     @@XMLTest:
6900     @@@QName: xp.doctype.sysid.2.test
6901     @@@DEnt:
6902     @@@@test:value:
6903     <!DOCTYPE a SYSTEM 'sysid'>
6904     <a/>
6905     @@@test:domTree:
6906     document {
6907     document-type {
6908     node-name: 'a';
6909     public-id: null;
6910     system-id: 'sysid';
6911     }
6912     element { }
6913     }
6914     @@XMLTest:
6915     @@@QName: xp.doctype.sysid.3.test
6916     @@@DEnt:
6917     @@@@test:value:
6918     <!DOCTYPE a SYSTEM "sysid" >
6919     <a/>
6920     @@@test:domTree:
6921     document {
6922     document-type {
6923     node-name: 'a';
6924     public-id: null;
6925     system-id: 'sysid';
6926     }
6927     element { }
6928     }
6929     @@XMLTest:
6930     @@@QName: xp.doctype.sysid.4.test
6931     @@@DEnt:
6932     @@@@test:value:
6933     <!DOCTYPE a SYSTEM 'sysid' >
6934     <a/>
6935     @@@test:domTree:
6936     document {
6937     document-type {
6938     node-name: 'a';
6939     public-id: null;
6940     system-id: 'sysid';
6941     }
6942     element { }
6943     }
6944     @@XMLTest:
6945     @@@QName: xp.doctype.sysid.intsubset.1.test
6946     @@@DEnt:
6947     @@@@test:value:
6948     <!DOCTYPE a SYSTEM "sysid"[]>
6949     <a/>
6950     @@@test:domTree:
6951     document {
6952     document-type {
6953     node-name: 'a';
6954     public-id: null;
6955     system-id: 'sysid';
6956     }
6957     element { }
6958     }
6959     @@XMLTest:
6960     @@@QName: xp.doctype.sysid.intsubset.2.test
6961     @@@DEnt:
6962     @@@@test:value:
6963     <!DOCTYPE a SYSTEM "sysid" []>
6964     <a/>
6965     @@@test:domTree:
6966     document {
6967     document-type {
6968     node-name: 'a';
6969     public-id: null;
6970     system-id: 'sysid';
6971     }
6972     element { }
6973     }
6974     @@XMLTest:
6975     @@@QName: xp.doctype.sysid.intsubset.3.test
6976     @@@DEnt:
6977     @@@@test:value:
6978     <!DOCTYPE a SYSTEM 'sysid'[]>
6979     <a/>
6980     @@@test:domTree:
6981     document {
6982     document-type {
6983     node-name: 'a';
6984     public-id: null;
6985     system-id: 'sysid';
6986     }
6987     element { }
6988     }
6989     @@XMLTest:
6990     @@@QName: xp.doctype.sysid.intsubset.4.test
6991     @@@DEnt:
6992     @@@@test:value:
6993     <!DOCTYPE a SYSTEM 'sysid' []>
6994     <a/>
6995     @@@test:domTree:
6996     document {
6997     document-type {
6998     node-name: 'a';
6999     public-id: null;
7000     system-id: 'sysid';
7001     }
7002     element { }
7003     }
7004     @@XMLTest:
7005     @@@QName: xp.doctype.public.stago.test
7006     @@@DEnt:
7007     @@@@test:value:
7008     <!DOCTYPE a PUBLIC<a/>
7009     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 19); }
7010     @@XMLTest:
7011     @@@QName: xp.doctype.public.mdc.test
7012     @@@DEnt:
7013     @@@@test:value:
7014     <!DOCTYPE a PUBLIC>
7015     <a/>
7016     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 19); }
7017     @@XMLTest:
7018     @@@QName: xp.doctype.public.s.stago.test
7019     @@@DEnt:
7020     @@@@test:value:
7021     <!DOCTYPE a PUBLIC <a/>
7022     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 20); }
7023     @@XMLTest:
7024     @@@QName: xp.doctype.public.s.mdc.test
7025     @@@DEnt:
7026     @@@@test:value:
7027     <!DOCTYPE a PUBLIC >
7028     <a/>
7029     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 20); }
7030     @@XMLTest:
7031     @@@QName: xp.doctype.public.lit.test
7032     @@@DEnt:
7033     @@@@test:value:
7034     <!DOCTYPE a PUBLIC"p" "s">
7035     <a/>
7036     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 19); }
7037     @@XMLTest:
7038     @@@QName: xp.doctype.public.lita.test
7039     @@@DEnt:
7040     @@@@test:value:
7041     <!DOCTYPE a PUBLIC'p' "s">
7042     <a/>
7043     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 19); }
7044     @@XMLTest:
7045     @@@QName: xp.doctype.pubid.lit.lita.unmatched.1.test
7046     @@@DEnt:
7047     @@@@test:value:
7048     <!DOCTYPE a PUBLIC "p' "s">
7049     <a/>
7050     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 25); }
7051     @@XMLTest:
7052     @@@QName: xp.doctype.pubid.lit.lita.unmatched.2.test
7053     @@@DEnt:
7054     @@@@test:value:
7055     <!DOCTYPE a PUBLIC "p' 's'><a/>
7056     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 32); }
7057     @@XMLTest:
7058     @@@QName: xp.doctype.pubid.lita.lit.unmatched.1.test
7059     @@@DEnt:
7060     @@@@test:value:
7061     <!DOCTYPE a PUBLIC 'p" "s"><a/>
7062     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 32); }
7063     @@XMLTest:
7064     @@@QName: xp.doctype.pubid.lita.lit.unmatched.2.test
7065     @@@DEnt:
7066     @@@@test:value:
7067     <!DOCTYPE a PUBLIC 'p" 's'>
7068     <a/>
7069     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 21)..(1, 25); }
7070     @@XMLTest:
7071     @@@QName: xp.doctype.public.s.lit.mdc.test
7072     @@@DEnt:
7073     @@@@test:value:
7074     <!DOCTYPE a PUBLIC "><a/>
7075     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 26); }
7076     @@XMLTest:
7077     @@@QName: xp.doctype.public.s.lita.mdc.test
7078     @@@DEnt:
7079     @@@@test:value:
7080     <!DOCTYPE a PUBLIC '><a/>
7081     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 26); }
7082     @@XMLTest:
7083     @@@QName: xp.doctype.public.lit.pubid.lit.mdc.test
7084     @@@DEnt:
7085     @@@@test:value:
7086     <!DOCTYPE a PUBLIC "p">
7087     <a/>
7088     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 23); }
7089     @@XMLTest:
7090     @@@QName: xp.doctype.public.lita.pubid.lita.mdc.test
7091     @@@DEnt:
7092     @@@@test:value:
7093     <!DOCTYPE a PUBLIC 'p'>
7094     <a/>
7095     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 23); }
7096     @@XMLTest:
7097     @@@QName: xp.doctype.public.lit.pubid.lit.s.mdc.test
7098     @@@DEnt:
7099     @@@@test:value:
7100     <!DOCTYPE a PUBLIC "p" >
7101     <a/>
7102     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 24); }
7103     @@XMLTest:
7104     @@@QName: xp.doctype.public.lita.pubid.lita.s.mdc.test
7105     @@@DEnt:
7106     @@@@test:value:
7107     <!DOCTYPE a PUBLIC 'p' >
7108     <a/>
7109     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 24); }
7110     @@XMLTest:
7111     @@@QName: xp.doctype.public.lit.pubid.lit.s.lit.mdc.test
7112     @@@DEnt:
7113     @@@@test:value:
7114     <!DOCTYPE a PUBLIC "p" "><a/>
7115     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 30); }
7116     @@XMLTest:
7117     @@@QName: xp.doctype.public.lit.pubid.lit.s.lita.mdc.test
7118     @@@DEnt:
7119     @@@@test:value:
7120     <!DOCTYPE a PUBLIC "p" '><a/>
7121     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 30); }
7122     @@XMLTest:
7123     @@@QName: xp.doctype.public.lita.pubid.lita.s.lit.mdc.test
7124     @@@DEnt:
7125     @@@@test:value:
7126     <!DOCTYPE a PUBLIC 'p' "><a/>
7127     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 30); }
7128     @@XMLTest:
7129     @@@QName: xp.doctype.public.lita.pubid.lita.s.lita.mdc.test
7130     @@@DEnt:
7131     @@@@test:value:
7132     <!DOCTYPE a PUBLIC 'p' '><a/>
7133     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 30); }
7134     @@XMLTest:
7135     @@@QName: xp.doctype.public.lit.pubid.lit.lit.lita.unmatched.mdc.test
7136     @@@DEnt:
7137     @@@@test:value:
7138     <!DOCTYPE a PUBLIC "p" "s'><a/>
7139     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 32); }
7140     @@XMLTest:
7141     @@@QName: xp.doctype.public.lita.pubid.lita.lita.lit.unmatched.mdc.test
7142     @@@DEnt:
7143     @@@@test:value:
7144     <!DOCTYPE a PUBLIC 'p' 's"><a/>
7145     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 32); }
7146     @@XMLTest:
7147     @@@QName: xp.doctype.pubid.sysid.stago.1.test
7148     @@@DEnt:
7149     @@@@test:value:
7150     <!DOCTYPE a PUBLIC "p" "s"<a/>
7151     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 27); }
7152     @@XMLTest:
7153     @@@QName: xp.doctype.pubid.sysid.stago.2.test
7154     @@@DEnt:
7155     @@@@test:value:
7156     <!DOCTYPE a PUBLIC "p" 's'<a/>
7157     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 27); }
7158     @@XMLTest:
7159     @@@QName: xp.doctype.pubid.sysid.stago.s.1.test
7160     @@@DEnt:
7161     @@@@test:value:
7162     <!DOCTYPE a PUBLIC "p" "s" <a/>
7163     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 28); }
7164     @@XMLTest:
7165     @@@QName: xp.doctype.pubid.sysid.stago.s.2.test
7166     @@@DEnt:
7167     @@@@test:value:
7168     <!DOCTYPE a PUBLIC "p" 's' <a/>
7169     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 28); }
7170 wakaba 1.16
7171     @@XMLTest:
7172     @@@QName: xp.endofline.1.0.crlf.test
7173     @@@DEnt:
7174     @@@@test:value:
7175     <?xml version="1.0"?>
7176     <p>aaa$u000D$u000Abbb</p>
7177 wakaba 1.6 @@@test:domTree:
7178     document {
7179     xml-version: '1.0';
7180 wakaba 1.16 element {
7181     text-content: 'aaa' U+000A 'bbb';
7182 wakaba 1.6 }
7183 wakaba 1.16 }
7184     @@XMLTest:
7185     @@@QName: xp.endofline.1.1.crlf.test
7186     @@@DEnt:
7187     @@@@test:value:
7188     <?xml version="1.1"?>
7189     <p>aaa$u000D$u000Abbb</p>
7190     @@@test:domTree:
7191     document {
7192     xml-version: '1.1';
7193 wakaba 1.6 element {
7194 wakaba 1.16 text-content: 'aaa' U+000A 'bbb';
7195 wakaba 1.6 }
7196     }
7197     @@XMLTest:
7198 wakaba 1.16 @@@QName: xp.endofline.1.0.crnl.test
7199 wakaba 1.6 @@@DEnt:
7200     @@@@test:value:
7201 wakaba 1.16 <?xml version="1.0"?>
7202     <p>aaa$u000D$u0085bbb</p>
7203 wakaba 1.6 @@@test:domTree:
7204     document {
7205     xml-version: '1.0';
7206 wakaba 1.16 element {
7207     text-content: 'aaa' U+000A U+0085 'bbb';
7208 wakaba 1.6 }
7209 wakaba 1.16 }
7210     @@XMLTest:
7211     @@@QName: xp.endofline.1.1.crnl.test
7212     @@@DEnt:
7213     @@@@test:value:
7214     <?xml version="1.1"?>
7215     <p>aaa$u000D$u0085bbb</p>
7216     @@@test:domTree:
7217     document {
7218     xml-version: '1.1';
7219 wakaba 1.6 element {
7220 wakaba 1.16 text-content: 'aaa' U+000A 'bbb';
7221 wakaba 1.6 }
7222     }
7223     @@XMLTest:
7224 wakaba 1.16 @@@QName: xp.endofline.1.0.nl.test
7225 wakaba 1.6 @@@DEnt:
7226     @@@@test:value:
7227 wakaba 1.16 <?xml version="1.0"?>
7228     <p>aaa$u0085bbb</p>
7229 wakaba 1.6 @@@test:domTree:
7230     document {
7231     xml-version: '1.0';
7232     element {
7233 wakaba 1.16 text-content: 'aaa' U+0085 'bbb';
7234 wakaba 1.6 }
7235     }
7236     @@XMLTest:
7237 wakaba 1.16 @@@QName: xp.endofline.1.1.nl.test
7238 wakaba 1.6 @@@DEnt:
7239     @@@@test:value:
7240 wakaba 1.16 <?xml version="1.1"?>
7241     <p>aaa$u0085bbb</p>
7242     @@@test:domTree:
7243     document {
7244     xml-version: '1.1';
7245     element {
7246     text-content: 'aaa' U+000A 'bbb';
7247     }
7248     }
7249     @@XMLTest:
7250     @@@QName: xp.endofline.1.0.ls.test
7251     @@@DEnt:
7252     @@@@test:value:
7253     <?xml version="1.0"?>
7254     <p>aaa$u2028bbb</p>
7255     @@@test:domTree:
7256     document {
7257     xml-version: '1.0';
7258     element {
7259     text-content: 'aaa' U+2028 'bbb';
7260     }
7261     }
7262     @@XMLTest:
7263     @@@QName: xp.endofline.1.1.ls.test
7264     @@@DEnt:
7265     @@@@test:value:
7266     <?xml version="1.1"?>
7267     <p>aaa$u2028bbb</p>
7268     @@@test:domTree:
7269     document {
7270     xml-version: '1.1';
7271     element {
7272     text-content: 'aaa' U+000A 'bbb';
7273     }
7274     }
7275     @@XMLTest:
7276     @@@QName: xp.endofline.1.0.cr.test
7277     @@@DEnt:
7278     @@@@test:value:
7279     <?xml version="1.0"?>
7280     <p>aaa$u000Dbbb</p>
7281     @@@test:domTree:
7282     document {
7283     xml-version: '1.0';
7284     element {
7285     text-content: 'aaa' U+000A 'bbb';
7286     }
7287     }
7288     @@XMLTest:
7289     @@@QName: xp.endofline.1.1.cr.test
7290     @@@DEnt:
7291     @@@@test:value:
7292     <?xml version="1.1"?>
7293     <p>aaa$u000Dbbb</p>
7294     @@@test:domTree:
7295     document {
7296     xml-version: '1.1';
7297     element {
7298     text-content: 'aaa' U+000A 'bbb';
7299     }
7300     }
7301     @@XMLTest:
7302     @@@QName: xp.endofline.1.0.lf.test
7303     @@@DEnt:
7304     @@@@test:value:
7305     <?xml version="1.0"?>
7306     <p>aaa$u000Abbb</p>
7307     @@@test:domTree:
7308     document {
7309     xml-version: '1.0';
7310     element {
7311     text-content: 'aaa' U+000A 'bbb';
7312     }
7313     }
7314     @@XMLTest:
7315     @@@QName: xp.endofline.1.1.lf.test
7316     @@@DEnt:
7317     @@@@test:value:
7318     <?xml version="1.1"?>
7319     <p>aaa$u000Abbb</p>
7320     @@@test:domTree:
7321     document {
7322     xml-version: '1.1';
7323     element {
7324     text-content: 'aaa' U+000A 'bbb';
7325     }
7326     }
7327     @@XMLTest:
7328     @@@QName: xp.xml10.endofline.nl.in.xmldecl.1.test
7329     @@@DEnt:
7330     @@@@test:value:
7331     <?xml$u0085version="1.0"?>
7332     <p/>
7333     @@@c:erred:
7334     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 6)..(2, 0); }
7335     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7336     @@XMLTest:
7337     @@@QName: xp.xml11.endofline.nl.in.xmldecl.1.test
7338     @@@DEnt:
7339     @@@@test:value:
7340     <?xml$u0085version="1.1"?>
7341     (err)<p/>
7342     @@@c:erred:
7343     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 6)..(2, 0); }
7344     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7345     @@XMLTest:
7346     @@@QName: xp.xml10.endofline.crnl.in.xmldecl.1.test
7347     @@@DEnt:
7348     @@@@test:value:
7349     <?xml$u000D$u0085version="1.0"?>
7350     <p/>
7351     @@@c:erred:
7352     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 6)..(2, 0); }
7353     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7354     @@XMLTest:
7355     @@@QName: xp.xml11.endofline.crnl.in.xmldecl.1.test
7356     @@@DEnt:
7357     @@@@test:value:
7358     <?xml$u000D$u0085version="1.1"?>
7359     (err)<p/>
7360     @@@c:erred:
7361     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 6)..(2, 0); }
7362     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7363     @@XMLTest:
7364     @@@QName: xp.xml10.endofline.ls.in.xmldecl.1.test
7365     @@@DEnt:
7366     @@@@test:value:
7367     <?xml$u2028version="1.0"?>
7368     <p/>
7369     @@@c:erred:
7370     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 6)..(2, 0); }
7371     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7372     @@XMLTest:
7373     @@@QName: xp.xml11.endofline.ls.in.xmldecl.1.test
7374     @@@DEnt:
7375     @@@@test:value:
7376     <?xml$u2028version="1.1"?>
7377     (err)<p/>
7378     @@@c:erred:
7379     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 6)..(2, 0); }
7380     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7381     @@XMLTest:
7382     @@@QName: xp.xml10.endofline.nl.in.xmldecl.2.test
7383     @@@DEnt:
7384     @@@@test:value:
7385     <?xml version="1.0"$u0085?>
7386     <p/>
7387     @@@c:erred:
7388     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 20)..(2, 0); }
7389     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7390     @@XMLTest:
7391     @@@QName: xp.xml11.endofline.nl.in.xmldecl.2.test
7392     @@@DEnt:
7393     @@@@test:value:
7394     <?xml version="1.1"$u0085?>
7395     (err)<p/>
7396     @@@c:erred:
7397     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 20)..(2, 0); }
7398     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7399     @@XMLTest:
7400     @@@QName: xp.xml10.endofline.crnl.in.xmldecl.2.test
7401     @@@DEnt:
7402     @@@@test:value:
7403     <?xml version="1.0"$u000D$u0085?>
7404     <p/>
7405     @@@c:erred:
7406     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 20)..(2, 0); }
7407     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7408     @@XMLTest:
7409     @@@QName: xp.xml11.endofline.crnl.in.xmldecl.2.test
7410     @@@DEnt:
7411     @@@@test:value:
7412     <?xml version="1.1"$u000D$u0085?>
7413     (err)<p/>
7414     @@@c:erred:
7415     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 20)..(2, 0); }
7416     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7417     @@XMLTest:
7418     @@@QName: xp.xml10.endofline.ls.in.xmldecl.2.test
7419     @@@DEnt:
7420     @@@@test:value:
7421     <?xml version="1.0"$u2028?>
7422     <p/>
7423     @@@c:erred:
7424     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 20)..(2, 0); }
7425     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7426     @@XMLTest:
7427     @@@QName: xp.xml11.endofline.ls.in.xmldecl.2.test
7428     @@@DEnt:
7429     @@@@test:value:
7430     <?xml version="1.1"$u2028?>
7431     (err)<p/>
7432     @@@c:erred:
7433     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 20)..(2, 0); }
7434     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7435     @@XMLTest:
7436     @@@QName: xp.xml10.endofline.nl.in.xmldecl.3.test
7437     @@@DEnt:
7438     @@@@test:value:
7439     <?xml $u0085version="1.0"?>
7440     <p/>
7441     @@@c:erred:
7442     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 7)..(2, 0); }
7443     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7444     @@XMLTest:
7445     @@@QName: xp.xml11.endofline.nl.in.xmldecl.3.test
7446     @@@DEnt:
7447     @@@@test:value:
7448     <?xml $u0085version="1.1"?>
7449     (err)<p/>
7450     @@@c:erred:
7451     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 7)..(2, 0); }
7452     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7453     @@XMLTest:
7454     @@@QName: xp.xml10.endofline.crnl.in.xmldecl.3.test
7455     @@@DEnt:
7456     @@@@test:value:
7457     <?xml $u000D$u0085version="1.0"?>
7458     <p/>
7459     @@@c:erred:
7460     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 7)..(2, 0); }
7461     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7462     @@XMLTest:
7463     @@@QName: xp.xml11.endofline.crnl.in.xmldecl.3.test
7464     @@@DEnt:
7465     @@@@test:value:
7466     <?xml $u000D$u0085version="1.1"?>
7467     (err)<p/>
7468     @@@c:erred:
7469     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 7)..(2, 0); }
7470     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7471     @@XMLTest:
7472     @@@QName: xp.xml10.endofline.ls.in.xmldecl.3.test
7473     @@@DEnt:
7474     @@@@test:value:
7475     <?xml $u2028version="1.0"?>
7476     <p/>
7477     @@@c:erred:
7478     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 7)..(2, 0); }
7479     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7480     @@XMLTest:
7481     @@@QName: xp.xml11.endofline.ls.in.xmldecl.3.test
7482     @@@DEnt:
7483     @@@@test:value:
7484     <?xml $u2028version="1.1"?>
7485     (err)<p/>
7486     @@@c:erred:
7487     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 7)..(2, 0); }
7488     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7489     @@XMLTest:
7490     @@@QName: xp.xml10implied.endofline.nl.in.pi.1.test
7491     @@@DEnt:
7492     @@@@test:value:
7493     <?xml-$u0085?>
7494     <p/>
7495     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 7)..(2, 0); }
7496     @@XMLTest:
7497     @@@QName: xp.xml10.endofline.nl.in.pi.1.test
7498     @@@DEnt:
7499     @@@@test:value:
7500     <?xml version="1.0"?>
7501     <?xml-$u0085?>
7502     <p/>
7503     @@@c:erred: <[[xp|wf-syntax-error]]> { (2, 7)..(3, 0); }
7504     @@XMLTest:
7505     @@@QName: xp.xml11.endofline.nl.in.pi.1.test
7506     @@@DEnt:
7507     @@@@test:value:
7508     <?xml version="1.1"?>
7509     <?xml-$u0085?>
7510     <p/>
7511     @@@test:domTree:
7512     document {
7513     xml-version: '1.1';
7514     pi {
7515     node-name: 'xml-';
7516     node-value: '';
7517     }
7518     element { }
7519     }
7520     @@XMLTest:
7521     @@@QName: xp.xml10implied.endofline.crnl.in.pi.1.test
7522     @@@DEnt:
7523     @@@@test:value:
7524     <?xml-$u000D$u0085?>
7525     <p/>
7526     @@@test:domTree:
7527     document {
7528     xml-version: '1.0';
7529     pi {
7530     node-name: 'xml-';
7531     node-value: U+0085;
7532     }
7533     element { }
7534     }
7535     @@XMLTest:
7536     @@@QName: xp.xml10.endofline.crnl.in.pi.1.test
7537     @@@DEnt:
7538     @@@@test:value:
7539     <?xml version="1.0"?>
7540     <?xml-$u000D$u0085?>
7541     <p/>
7542     @@@test:domTree:
7543     document {
7544     xml-version: '1.0';
7545     pi {
7546     node-name: 'xml-';
7547     node-value: U+0085;
7548     }
7549     element { }
7550     }
7551     @@XMLTest:
7552     @@@QName: xp.xml11.endofline.crnl.in.pi.1.test
7553     @@@DEnt:
7554     @@@@test:value:
7555     <?xml version="1.1"?>
7556     <?xml-$u000D$u0085?>
7557     <p/>
7558     @@@test:domTree:
7559     document {
7560     xml-version: '1.1';
7561     pi {
7562     node-name: 'xml-';
7563     node-value: '';
7564     }
7565     element { }
7566     }
7567     @@XMLTest:
7568     @@@QName: xp.xml10implied.endofline.ls.in.pi.1.test
7569     @@@DEnt:
7570     @@@@test:value:
7571     <?xml-$u2028?>
7572     <p/>
7573     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 7)..(2, 0); }
7574     @@XMLTest:
7575     @@@QName: xp.xml10.endofline.ls.in.pi.1.test
7576     @@@DEnt:
7577     @@@@test:value:
7578     <?xml version="1.0"?>
7579     <?xml-$u2028?>
7580     <p/>
7581     @@@c:erred: <[[xp|wf-syntax-error]]> { (2, 7)..(3, 0); }
7582     @@XMLTest:
7583     @@@QName: xp.xml11.endofline.ls.in.pi.1.test
7584     @@@DEnt:
7585     @@@@test:value:
7586     <?xml version="1.1"?>
7587     <?xml-$u2028?>
7588     <p/>
7589     @@@test:domTree:
7590     document {
7591     xml-version: '1.1';
7592     pi {
7593     node-name: 'xml-';
7594     node-value: '';
7595     }
7596     element { }
7597     }
7598 wakaba 1.27
7599     @@XMLTest:
7600     @@@QName: xp.xml10.endofline.internal.1.test
7601     @@@DEnt:
7602     @@@@test:value:
7603     <?xml version="1.0"?>
7604     <!DOCTYPE a [
7605     <!ENTITY e "&#x000D; &#x000A; &#x0085; &#x000D;&#x000A; $
7606     &#x000D;&#x0085; &#x2028;">
7607     ]><a>&e;</a>
7608 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
7609 wakaba 1.27 @@@test:domTree:
7610     document {
7611     xml-version: '1.0';
7612     document-type {
7613     general-entity {
7614     node-name: 'e';
7615     text-content: U+000D ' ' U+000A ' ' U+0085 ' '
7616     U+000D U+000A ' ' U+000D U+0085 ' ' U+2028;
7617     }
7618     }
7619     element {
7620     text-content: U+000D ' ' U+000A ' ' U+0085 ' '
7621     U+000D U+000A ' ' U+000D U+0085 ' ' U+2028;
7622     }
7623     }
7624     @@XMLTest:
7625     @@@QName: xp.xml11.endofline.internal.1.test
7626     @@@DEnt:
7627     @@@@test:value:
7628     <?xml version="1.1"?>
7629     <!DOCTYPE a [
7630     <!ENTITY e "&#x000D; &#x000A; &#x0085; &#x000D;&#x000A; $
7631     &#x000D;&#x0085; &#x2028;">
7632     ]><a>&e;</a>
7633 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
7634 wakaba 1.27 @@@test:domTree:
7635     document {
7636     xml-version: '1.1';
7637     document-type {
7638     general-entity {
7639     node-name: 'e';
7640     text-content: U+000D ' ' U+000A ' ' U+0085 ' '
7641     U+000D U+000A ' ' U+000D U+0085 ' ' U+2028;
7642     }
7643     }
7644     element {
7645     text-content: U+000D ' ' U+000A ' ' U+0085 ' '
7646     U+000D U+000A ' ' U+000D U+0085 ' ' U+2028;
7647     }
7648     }
7649    
7650 wakaba 1.16 @@XMLTest:
7651     @@@QName: xp.noxmldecl.pi.pi.test
7652     @@@DEnt:
7653     @@@@test:value:
7654     <?noxml 1?><?noxml 2?><p/>
7655     @@@test:domTree:
7656     document {
7657     xml-version: '1.0';
7658     pi {
7659     node-name: 'noxml';
7660     node-value: '1';
7661     }
7662     pi {
7663     node-name: 'noxml';
7664     node-value: '2';
7665     }
7666     element { }
7667     }
7668     @@XMLTest:
7669     @@@QName: xp.noxmldecl.pi.pi.2.test
7670     @@@DEnt:
7671     @@@@test:value:
7672     <?xmlno 1?><?xmlno 2?><p/>
7673     @@@test:domTree:
7674     document {
7675     xml-version: '1.0';
7676     pi {
7677     node-name: 'xmlno';
7678     node-value: '1';
7679     }
7680     pi {
7681     node-name: 'xmlno';
7682     node-value: '2';
7683     }
7684     element { }
7685     }
7686     @@XMLTest:
7687     @@@QName: xp.noxmldecl.pi.pi.3.test
7688     @@@DEnt:
7689     @@@@test:value:
7690     <?xmln 1?><?xmln 2?><p/>
7691     @@@test:domTree:
7692     document {
7693     xml-version: '1.0';
7694     pi {
7695     node-name: 'xmln';
7696     node-value: '1';
7697     }
7698     pi {
7699     node-name: 'xmln';
7700     node-value: '2';
7701     }
7702     element { }
7703     }
7704     @@XMLTest:
7705     @@@QName: xp.noxml.s.nl.test
7706     @@@DEnt:
7707     @@@@test:value:
7708     $u0085<p/>
7709     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 1)..(2, 0); }
7710     @@XMLTest:
7711     @@@QName: xp.noxml.s.crnl.test
7712     @@@DEnt:
7713     @@@@test:value:
7714     $u000D$u0085<p/>
7715     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 1)..(2, 0); }
7716     @@XMLTest:
7717     @@@QName: xp.noxml.s.ls.test
7718     @@@DEnt:
7719     @@@@test:value:
7720     $u2028<p/>
7721     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 1)..(2, 0); }
7722     @@XMLTest:
7723     @@@QName: xp.xml10.decl.s.nl.test
7724     @@@DEnt:
7725     @@@@test:value:
7726     <?xml version="1.0"?>$u0085<p/>
7727     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 22)..(2, 0); }
7728     @@XMLTest:
7729     @@@QName: xp.xml10.decl.s.crnl.test
7730     @@@DEnt:
7731     @@@@test:value:
7732     <?xml version="1.0"?>$u000D$u0085<p/>
7733     @@@c:erred: <[[xp|wf-syntax-error]]> { (2, 0)..(3, 0); }
7734     @@XMLTest:
7735     @@@QName: xp.xml10.decl.s.ls.test
7736     @@@DEnt:
7737     @@@@test:value:
7738     <?xml version="1.0"?>$u2028<p/>
7739     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 22)..(2, 0); }
7740     @@XMLTest:
7741     @@@QName: xp.xml11.decl.s.nl.test
7742     @@@DEnt:
7743     @@@@test:value:
7744     <?xml version="1.1"?>$u0085<p/>
7745     @@@test:domTree:
7746     document {
7747     xml-version: '1.1';
7748     element { }
7749     }
7750     @@XMLTest:
7751     @@@QName: xp.xml11.decl.s.crnl.test
7752     @@@DEnt:
7753     @@@@test:value:
7754     <?xml version="1.1"?>$u000D$u0085<p/>
7755     @@@test:domTree:
7756     document {
7757     xml-version: '1.1';
7758     element { }
7759     }
7760     @@XMLTest:
7761     @@@QName: xp.xml11.decl.s.ls.test
7762     @@@DEnt:
7763     @@@@test:value:
7764     <?xml version="1.1"?>$u2028<p/>
7765     @@@test:domTree:
7766     document {
7767     xml-version: '1.1';
7768     element { }
7769     }
7770    
7771     @@XMLTest:
7772 wakaba 1.18 @@@QName: xp.element.type.match.1.test
7773     @@@DEnt:
7774     @@@@test:value:
7775     <p></pa>(err)
7776     @@@c:erred: <[[xp|wf-element-type-match]]> { (1, 4)..(1, 8); }
7777     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7778     @@XMLTest:
7779     @@@QName: xp.element.type.match.2.test
7780     @@@DEnt:
7781     @@@@test:value:
7782     <p><pa></pa></pa>(err)
7783     @@@c:erred: <[[xp|wf-element-type-match]]> { (1, 13)..(1, 17); }
7784     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7785     @@XMLTest:
7786     @@@QName: xp.element.type.match.3.test
7787     @@@DEnt:
7788     @@@@test:value:
7789     <p><pa></p></p>(err)
7790     @@@c:erred: <[[xp|wf-element-type-match]]> { (1, 8)..(1, 11); }
7791     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7792     @@XMLTest:
7793     @@@QName: xp.element.type.match.4.test
7794     @@@DEnt:
7795     @@@@test:value:
7796     <a:p xmlns:a="about:1"></p>(err)
7797     @@@c:erred: <[[xp|wf-element-type-match]]> { (1, 24)..(1, 27); }
7798     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7799     @@XMLTest:
7800     @@@QName: xp.element.type.match.5.test
7801     @@@DEnt:
7802     @@@@test:value:
7803     <a:p xmlns:a="about:1" xmlns:b="about:1"></b:p>(err)
7804     @@@c:erred: <[[xp|wf-element-type-match]]> { (1, 42)..(1, 47); }
7805     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7806    
7807     @@XMLTest:
7808     @@@QName: xp.stag.stago.name.etago.test
7809     @@@DEnt:
7810     @@@@test:value:
7811     <a</a>
7812     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 3); }
7813     @@XMLTest:
7814     @@@QName: xp.stag.stago.name.s.etago.test
7815     @@@DEnt:
7816     @@@@test:value:
7817     <a </a>
7818     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 4); }
7819     @@XMLTest:
7820     @@@QName: xp.stag.stago.name.s.attr.etago.test
7821     @@@DEnt:
7822     @@@@test:value:
7823     <a a="b"</a>
7824     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 9); }
7825     @@XMLTest:
7826     @@@QName: xp.stag.stago.name.s.attr.s.attr.etago.test
7827     @@@DEnt:
7828     @@@@test:value:
7829     <a a="b" c="d"</a>
7830     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 15); }
7831     @@XMLTest:
7832     @@@QName: xp.stag.stago.name.s.attr.s.etago.test
7833     @@@DEnt:
7834     @@@@test:value:
7835     <a a="b" </a>
7836     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 10); }
7837     @@XMLTest:
7838     @@@QName: xp.stag.etag.1.test
7839 wakaba 1.16 @@@DEnt:
7840     @@@@test:value:
7841 wakaba 1.18 <root><a></a></root>
7842 wakaba 1.16 @@@test:domTree:
7843     document {
7844 wakaba 1.18 element {
7845     element {
7846     node-name: 'a';
7847 wakaba 1.16 }
7848     }
7849 wakaba 1.18 }
7850     @@XMLTest:
7851     @@@QName: xp.stag.etag.2.test
7852     @@@DEnt:
7853     @@@@test:value:
7854     <root><ab></ab></root>
7855     @@@test:domTree:
7856     document {
7857 wakaba 1.16 element {
7858 wakaba 1.18 element {
7859     node-name: 'ab';
7860     }
7861 wakaba 1.16 }
7862 wakaba 1.18 }
7863 wakaba 1.16 @@XMLTest:
7864 wakaba 1.18 @@@QName: xp.stag.etag.s.1.test
7865 wakaba 1.16 @@@DEnt:
7866     @@@@test:value:
7867 wakaba 1.18 <root><a ></a ></root>
7868 wakaba 1.16 @@@test:domTree:
7869     document {
7870 wakaba 1.18 element {
7871     element {
7872     node-name: 'a';
7873 wakaba 1.16 }
7874     }
7875 wakaba 1.18 }
7876     @@XMLTest:
7877     @@@QName: xp.etag.1.test
7878     @@@DEnt:
7879     @@@@test:value:
7880     <root><a/></root>
7881     @@@test:domTree:
7882     document {
7883 wakaba 1.16 element {
7884 wakaba 1.18 element {
7885     node-name: 'a';
7886     }
7887 wakaba 1.16 }
7888 wakaba 1.18 }
7889 wakaba 1.16 @@XMLTest:
7890 wakaba 1.18 @@@QName: xp.etag.2.test
7891 wakaba 1.16 @@@DEnt:
7892     @@@@test:value:
7893 wakaba 1.18 <root><a /></root>
7894 wakaba 1.16 @@@test:domTree:
7895     document {
7896     element {
7897 wakaba 1.18 element {
7898     node-name: 'a';
7899     }
7900 wakaba 1.16 }
7901 wakaba 1.18 }
7902 wakaba 1.16 @@XMLTest:
7903 wakaba 1.18 @@@QName: xp.stag.etag.attr.1.test
7904 wakaba 1.16 @@@DEnt:
7905     @@@@test:value:
7906 wakaba 1.18 <root><a at="v"></a></root>
7907 wakaba 1.16 @@@test:domTree:
7908     document {
7909 wakaba 1.18 element {
7910     element {
7911     node-name: 'a';
7912     attribute {
7913     node-name: 'at';
7914     value: 'v';
7915     }
7916 wakaba 1.16 }
7917     }
7918 wakaba 1.18 }
7919     @@XMLTest:
7920     @@@QName: xp.stag.etag.attr.2.test
7921     @@@DEnt:
7922     @@@@test:value:
7923     <root><a at="v" ></a></root>
7924     @@@test:domTree:
7925     document {
7926 wakaba 1.16 element {
7927 wakaba 1.18 element {
7928     node-name: 'a';
7929     attribute {
7930     node-name: 'at';
7931     value: 'v';
7932 wakaba 1.16 }
7933     }
7934     }
7935 wakaba 1.18 }
7936 wakaba 1.16 @@XMLTest:
7937 wakaba 1.18 @@@QName: xp.stag.etag.attr.3.test
7938 wakaba 1.16 @@@DEnt:
7939     @@@@test:value:
7940 wakaba 1.18 <root><a at ="v"></a></root>
7941 wakaba 1.16 @@@test:domTree:
7942     document {
7943 wakaba 1.18 element {
7944     element {
7945     node-name: 'a';
7946     attribute {
7947     node-name: 'at';
7948     value: 'v';
7949     }
7950 wakaba 1.16 }
7951     }
7952 wakaba 1.18 }
7953     @@XMLTest:
7954     @@@QName: xp.stag.etag.attr.4.test
7955     @@@DEnt:
7956     @@@@test:value:
7957     <root><a at= "v"></a></root>
7958     @@@test:domTree:
7959     document {
7960 wakaba 1.16 element {
7961 wakaba 1.18 element {
7962     node-name: 'a';
7963     attribute {
7964     node-name: 'at';
7965     value: 'v';
7966 wakaba 1.16 }
7967     }
7968 wakaba 1.18 }
7969     }
7970     @@XMLTest:
7971     @@@QName: xp.stag.etag.attr.5.test
7972     @@@DEnt:
7973     @@@@test:value:
7974     <root><a at='v'></a></root>
7975     @@@test:domTree:
7976     document {
7977     element {
7978     element {
7979     node-name: 'a';
7980     attribute {
7981     node-name: 'at';
7982     value: 'v';
7983 wakaba 1.16 }
7984     }
7985     }
7986 wakaba 1.18 }
7987 wakaba 1.16 @@XMLTest:
7988 wakaba 1.18 @@@QName: xp.stag.etag.attr.6.test
7989 wakaba 1.16 @@@DEnt:
7990     @@@@test:value:
7991 wakaba 1.18 <root><a at= 'v' ></a></root>
7992 wakaba 1.6 @@@test:domTree:
7993     document {
7994 wakaba 1.18 element {
7995     element {
7996     node-name: 'a';
7997     attribute {
7998     node-name: 'at';
7999     value: 'v';
8000     }
8001 wakaba 1.11 }
8002 wakaba 1.6 }
8003 wakaba 1.18 }
8004     @@XMLTest:
8005     @@@QName: xp.stag.etag.attr.attr.1.test
8006     @@@DEnt:
8007     @@@@test:value:
8008     <root><a at="v" tr="w"></a></root>
8009     @@@test:domTree:
8010     document {
8011 wakaba 1.6 element {
8012 wakaba 1.18 element {
8013     node-name: 'a';
8014     attribute {
8015     node-name: 'at';
8016     value: 'v';
8017 wakaba 1.6 }
8018 wakaba 1.18 attribute {
8019     node-name: 'tr';
8020     value: 'w';
8021 wakaba 1.6 }
8022     }
8023     }
8024 wakaba 1.18 }
8025 wakaba 1.6 @@XMLTest:
8026 wakaba 1.18 @@@QName: xp.stag.etag.attr.attr.2.test
8027 wakaba 1.6 @@@DEnt:
8028     @@@@test:value:
8029 wakaba 1.18 <root><a tr="w" at="v"></a></root>
8030 wakaba 1.6 @@@test:domTree:
8031     document {
8032 wakaba 1.18 element {
8033     element {
8034     node-name: 'a';
8035     attribute {
8036     node-name: 'at';
8037     value: 'v';
8038     }
8039     attribute {
8040     node-name: 'tr';
8041     value: 'w';
8042 wakaba 1.11 }
8043     }
8044 wakaba 1.6 }
8045 wakaba 1.18 }
8046     @@XMLTest:
8047     @@@QName: xp.stag.etag.attr.no.s.attr.test
8048     @@@DEnt:
8049     @@@@test:value:
8050     <root><a at="v"tr="w"></a></root>
8051     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 16)..(1, 17); }
8052     @@XMLTest:
8053     @@@QName: xp.etag.attr.1.test
8054     @@@DEnt:
8055     @@@@test:value:
8056     <root><a at="v" tr="w"></a b="c"></root>
8057     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 28); }
8058     @@XMLTest:
8059     @@@QName: xp.etag.no.etagc.1.test
8060     @@@DEnt:
8061     @@@@test:value:
8062     <root><a at="v" tr="w"></a</root>
8063     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 27)..(1, 28); }
8064     @@XMLTest:
8065     @@@QName: xp.etag.no.etagc.2.test
8066     @@@DEnt:
8067     @@@@test:value:
8068     <root><a at="v" tr="w"></a </root>
8069     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 29)..(1, 30); }
8070     @@XMLTest:
8071     @@@QName: xp.mtag.attr.1.test
8072     @@@DEnt:
8073     @@@@test:value:
8074     <root><a b="c"/></root>
8075     @@@test:domTree:
8076     document {
8077 wakaba 1.6 element {
8078 wakaba 1.18 element {
8079     node-name: 'a';
8080     attribute {
8081     node-name: 'b';
8082     value: 'c';
8083 wakaba 1.6 }
8084     }
8085 wakaba 1.8 }
8086 wakaba 1.18 }
8087 wakaba 1.11 @@XMLTest:
8088 wakaba 1.18 @@@QName: xp.mtag.attr.2.test
8089 wakaba 1.11 @@@DEnt:
8090     @@@@test:value:
8091 wakaba 1.18 <root><a b="c" /></root>
8092 wakaba 1.11 @@@test:domTree:
8093     document {
8094 wakaba 1.18 element {
8095     element {
8096     node-name: 'a';
8097     attribute {
8098     node-name: 'b';
8099     value: 'c';
8100     }
8101 wakaba 1.11 }
8102     }
8103 wakaba 1.18 }
8104 wakaba 1.11 @@XMLTest:
8105 wakaba 1.18 @@@QName: xp.mtag.attr.3.test
8106 wakaba 1.11 @@@DEnt:
8107     @@@@test:value:
8108 wakaba 1.18 <root><a b='c'/></root>
8109 wakaba 1.11 @@@test:domTree:
8110     document {
8111     element {
8112 wakaba 1.18 element {
8113     node-name: 'a';
8114     attribute {
8115     node-name: 'b';
8116     value: 'c';
8117     }
8118     }
8119 wakaba 1.11 }
8120 wakaba 1.18 }
8121 wakaba 1.11 @@XMLTest:
8122 wakaba 1.18 @@@QName: xp.mtag.attr.4.test
8123 wakaba 1.11 @@@DEnt:
8124     @@@@test:value:
8125 wakaba 1.18 <root><a b="c" d="e"/></root>
8126 wakaba 1.11 @@@test:domTree:
8127     document {
8128     element {
8129 wakaba 1.18 element {
8130     node-name: 'a';
8131     attribute {
8132     node-name: 'b';
8133     value: 'c';
8134     }
8135     attribute {
8136     node-name: 'd';
8137     value: 'e';
8138     }
8139 wakaba 1.11 }
8140     }
8141 wakaba 1.18 }
8142    
8143     @@XMLTest:
8144     @@@QName: xp.attvalue.lt.1.test
8145     @@@DEnt:
8146     @@@@test:value:
8147     <a b="aa<dd"/>
8148     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 9); }
8149     @@XMLTest:
8150     @@@QName: xp.attvalue.lt.2.test
8151     @@@DEnt:
8152     @@@@test:value:
8153     <a b='aa<dd'/>
8154     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 9); }
8155     @@XMLTest:
8156     @@@QName: xp.attvalue.amp.1.test
8157     @@@DEnt:
8158     @@@@test:value:
8159     <a b="aa& dd"/>
8160     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 9)..(1, 12); }
8161     @@XMLTest:
8162     @@@QName: xp.attvalue.amp.2.test
8163     @@@DEnt:
8164     @@@@test:value:
8165     <a b='aa& dd'/>
8166     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 9)..(1, 12); }
8167     @@XMLTest:
8168     @@@QName: xp.attvalue.amp.3.test
8169     @@@DEnt:
8170     @@@@test:value:
8171     <a b="aa&# dd"/>
8172     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 9)..(1, 13); }
8173     @@XMLTest:
8174     @@@QName: xp.attvalue.amp.4.test
8175     @@@DEnt:
8176     @@@@test:value:
8177     <a b="aa&#x dd"/>
8178     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 9)..(1, 14); }
8179    
8180     @@XMLTest:
8181     @@@QName: xp.unique.att.spec.1.test
8182     @@@DEnt:
8183     @@@@test:value:
8184     <a b="c" b="d"/>
8185     @@@c:erred: <[[xp|wf-unique-att-spec]]> { (1, 4)..(1, 14); }
8186     @@XMLTest:
8187     @@@QName: xp.unique.att.spec.2.test
8188     @@@DEnt:
8189     @@@@test:value:
8190     <a d:b="c" d:b="d" xmlns:d="about:2"/>
8191     @@@c:erred: <[[xp|wf-unique-att-spec]]> { (1, 4)..(1, 18); }
8192    
8193     @@XMLTest:
8194     @@@QName: xp.no.external.entity.references.1.test
8195     @@@DEnt:
8196     @@@@test:value:
8197     <!DOCTYPE a [
8198     <!ENTITY ent SYSTEM "something">
8199     ]>
8200     <a b="c&ent;"/>
8201     @@@c:erred: <[[xp|wf-no-external-entity-references]]> { (4, 8)..(4, 12); }
8202     @@XMLTest:
8203     @@@QName: xp.no.external.entity.references.2.test
8204     @@@DEnt:
8205     @@@@test:value:
8206     <!DOCTYPE a [
8207     <!NOTATION n SYSTEM "notation">
8208     <!ENTITY ent SYSTEM "something" NDATA n>
8209     ]>
8210     <a b="c&ent;"/>
8211     @@@c:erred: <[[xp|wf-no-external-entity-references]]> { (5, 8)..(5, 12); }
8212     @@XMLTest:
8213     @@@QName: xp.no.external.entity.references.3.test
8214     @@@DEnt:
8215     @@@@test:value:
8216     <!DOCTYPE a [
8217     <!ENTITY ent SYSTEM "something">
8218     <!ENTITY ent2 "ddd&ent;">
8219     ]>
8220     <a b="c&ent2;"/>
8221     @@@c:erred: <[[xp|wf-no-external-entity-references]]> { (1, 4)..(1, 8); }
8222     @@XMLTest:
8223     @@@QName: xp.no.external.entity.references.4.test
8224     @@@DEnt:
8225     @@@@test:value:
8226     <!DOCTYPE a [
8227     <!NOTATION n SYSTEM "notation">
8228     <!ENTITY ent SYSTEM "something" NDATA n>
8229     <!ENTITY ent2 "ddd&ent;">
8230     ]>
8231     <a b="c&ent2;"/>
8232 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
8233 wakaba 1.18 @@@c:erred: <[[xp|wf-no-external-entity-references]]> { (1, 4)..(1, 8); }
8234 wakaba 1.23 @@@c:erred: <[[xp|wf-parsed-entity]]> { }
8235 wakaba 1.18 @@XMLTest:
8236     @@@QName: xp.no.lt.in.attr.value.1.test
8237     @@@DEnt:
8238     @@@@test:value:
8239     <!DOCTYPE a [
8240     <!ENTITY ent "aa<bb">
8241     ]>
8242     <a b="c&ent;"/>
8243 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
8244 wakaba 1.18 @@@c:erred: <[[xp|wf-no-lt-in-attribute-values]]> { (1, 3); }
8245 wakaba 1.20 @@@c:erred:
8246     @@@@@: <[[xp|wf-syntax-error]]> { (1, 3)..(1, 6); }
8247     @@@@enImplNote: When entity node is created.
8248 wakaba 1.18 @@XMLTest:
8249 wakaba 1.34 @@@QName: xp.no.lt.in.attr.value.1.2.test
8250     @@@DEnt:
8251     @@@@test:value:
8252     <!DOCTYPE a [
8253     <!ENTITY ent "aa<bb">
8254     ]>
8255     <a b="c&ent;"/>
8256     @@@cfg:entity-replacement-tree: 0
8257     @@@c:erred: <[[xp|wf-no-lt-in-attribute-values]]> { (1, 3); }
8258     @@XMLTest:
8259 wakaba 1.18 @@@QName: xp.no.lt.in.attr.value.2.test
8260     @@@DEnt:
8261     @@@@test:value:
8262     <!DOCTYPE a [
8263     <!ENTITY ent "aa<bb">
8264     <!ENTITY ent2 "ccc&ent;">
8265     ]>
8266     <a b="c&ent2;"/>
8267 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
8268 wakaba 1.18 @@@c:erred: <[[xp|wf-no-lt-in-attribute-values]]> { (1, 3); }
8269 wakaba 1.20 @@@c:erred:
8270     @@@@@: <[[xp|wf-syntax-error]]> { (1, 3)..(1, 6); }
8271     @@@@enImplNote: When entity node is created.
8272 wakaba 1.18 @@XMLTest:
8273     @@@QName: xp.no.lt.in.attr.value.3.test
8274     @@@DEnt:
8275     @@@@test:value:
8276     <!DOCTYPE a [
8277     <!ENTITY ent "aa&#x3C;bb">
8278     ]>
8279     <a b="c&ent;"/>
8280 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
8281 wakaba 1.18 @@@c:erred: <[[xp|wf-no-lt-in-attribute-values]]> { (1, 3); }
8282 wakaba 1.20 @@@c:erred:
8283     @@@@@: <[[xp|wf-syntax-error]]> { (1, 3)..(1, 6); }
8284     @@@@enImplNote: When entity node is created.
8285 wakaba 1.18 @@XMLTest:
8286     @@@QName: xp.no.lt.in.attr.value.4.test
8287     @@@DEnt:
8288     @@@@test:value:
8289     <!DOCTYPE a [
8290     <!ENTITY ent "aa&#x3C;bb">
8291     <!ENTITY ent2 "ccc&ent;">
8292     ]>
8293     <a b="c&ent2;"/>
8294 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
8295 wakaba 1.18 @@@c:erred: <[[xp|wf-no-lt-in-attribute-values]]> { (1, 3); }
8296 wakaba 1.20 @@@c:erred:
8297     @@@@@: <[[xp|wf-syntax-error]]> { (1, 3)..(1, 6); }
8298     @@@@enImplNote: When entity node is created.
8299 wakaba 1.11 @@XMLTest:
8300 wakaba 1.18 @@@QName: xp.ger.lt.in.attr.value.1.test
8301 wakaba 1.11 @@@DEnt:
8302     @@@@test:value:
8303     <!DOCTYPE a [
8304 wakaba 1.18 <!ENTITY ent "aa&lt;bb">
8305 wakaba 1.11 ]>
8306 wakaba 1.18 <a b="c&ent;"/>
8307 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
8308 wakaba 1.11 @@@test:domTree:
8309     document {
8310     document-type {
8311     general-entity {
8312     node-name: 'ent';
8313 wakaba 1.18 text-content: 'aa<bb';
8314 wakaba 1.11 }
8315     }
8316     element {
8317 wakaba 1.18 attribute {
8318     node-name: 'b';
8319     text { data: 'c'; }
8320     general-entity-reference {
8321 wakaba 1.34 manakai-expanded: true;
8322 wakaba 1.18 node-name: 'ent';
8323     text-content: 'aa<bb';
8324     }
8325     }
8326 wakaba 1.11 }
8327     }
8328     @@XMLTest:
8329 wakaba 1.18 @@@QName: xp.ger.lt.in.attr.value.2.test
8330 wakaba 1.11 @@@DEnt:
8331     @@@@test:value:
8332     <!DOCTYPE a [
8333 wakaba 1.18 <!ENTITY ent "aa&lt;bb">
8334     <!ENTITY ent2 "ccc&ent;">
8335 wakaba 1.11 ]>
8336 wakaba 1.18 <a b="c&ent2;"/>
8337 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
8338 wakaba 1.11 @@@test:domTree:
8339     document {
8340     document-type {
8341     general-entity {
8342 wakaba 1.18 node-name: 'ent';
8343     text-content: 'aa<bb';
8344     }
8345     general-entity {
8346     node-name: 'ent2';
8347     text { data: 'ccc'; }
8348     general-entity-reference {
8349     node-name: 'ent';
8350     text-content: 'aa<bb';
8351 wakaba 1.34 manakai-expanded: true;
8352 wakaba 1.18 }
8353 wakaba 1.11 }
8354     }
8355     element {
8356 wakaba 1.18 attribute {
8357     node-name: 'b';
8358     text { data: 'c'; }
8359     general-entity-reference {
8360     node-name: 'ent2';
8361     text { data: 'ccc'; }
8362     general-entity-reference {
8363     node-name: 'ent';
8364     text-content: 'aa<bb';
8365 wakaba 1.34 manakai-expanded: true;
8366 wakaba 1.18 }
8367 wakaba 1.34 manakai-expanded: true;
8368 wakaba 1.18 }
8369     }
8370 wakaba 1.11 }
8371     }
8372    
8373 wakaba 1.8 @@XMLTest:
8374 wakaba 1.18 @@@QName: xp.doctype.intsubset.pi.test
8375 wakaba 1.8 @@@DEnt:
8376     @@@@test:value:
8377     <!DOCTYPE a [
8378 wakaba 1.18 <?pi data ?>
8379 wakaba 1.8 ]>
8380     <a></a>
8381     @@@test:domTree:
8382     document {
8383     xml-version: '1.0';
8384     xml-encoding: null;
8385     xml-standalone: false;
8386     document-type {
8387     node-name: 'a';
8388 wakaba 1.18 pi {
8389     target: 'pi';
8390     data: 'data ';
8391 wakaba 1.8 }
8392     }
8393     element {
8394     namespace-uri: null;
8395 wakaba 1.18 prefix: null;
8396 wakaba 1.8 local-name: 'a';
8397 wakaba 1.18 text-content: '';
8398 wakaba 1.8 }
8399     }
8400 wakaba 1.18 @@@enImplNote:
8401     A DOM PI node in doctype node is a manakai extension.
8402    
8403    
8404 wakaba 1.8 @@XMLTest:
8405 wakaba 1.18 @@@QName: xp.doctype.intsubset.entity.general.internal.test
8406 wakaba 1.8 @@@DEnt:
8407     @@@@test:value:
8408     <!DOCTYPE a [
8409 wakaba 1.18 <!ENTITY entity "entity value">
8410 wakaba 1.8 ]>
8411     <a></a>
8412 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
8413 wakaba 1.8 @@@test:domTree:
8414     document {
8415     xml-version: '1.0';
8416     xml-encoding: null;
8417     xml-standalone: false;
8418     document-type {
8419     node-name: 'a';
8420 wakaba 1.18 general-entity {
8421     node-name: 'entity';
8422     text-content: 'entity value';
8423     has-replacement-tree: true;
8424 wakaba 1.8 }
8425     }
8426     element {
8427     namespace-uri: null;
8428 wakaba 1.18 prefix: null;
8429 wakaba 1.8 local-name: 'a';
8430 wakaba 1.18 text-content: '';
8431 wakaba 1.8 }
8432     }
8433     @@XMLTest:
8434 wakaba 1.18 @@@QName: xp.doctype.intsubset.entity.parameter.internal.test
8435 wakaba 1.8 @@@DEnt:
8436     @@@@test:value:
8437     <!DOCTYPE a [
8438 wakaba 1.18 <!ENTITY % entity "entity value">
8439 wakaba 1.8 ]>
8440     <a></a>
8441     @@@test:domTree:
8442     document {
8443     xml-version: '1.0';
8444     xml-encoding: null;
8445     xml-standalone: false;
8446     document-type {
8447     node-name: 'a';
8448     }
8449     element {
8450     namespace-uri: null;
8451 wakaba 1.18 prefix: null;
8452 wakaba 1.8 local-name: 'a';
8453 wakaba 1.18 text-content: '';
8454 wakaba 1.8 }
8455     }
8456 wakaba 1.18
8457 wakaba 1.8 @@XMLTest:
8458 wakaba 1.18 @@@QName: xp.doctype.internal.entity.root.element.text.only.test
8459 wakaba 1.8 @@@DEnt:
8460     @@@@test:value:
8461     <!DOCTYPE a [
8462 wakaba 1.18 <!ENTITY entity "entity value">
8463 wakaba 1.8 ]>
8464 wakaba 1.18 <a>&entity;</a>
8465 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
8466 wakaba 1.8 @@@test:domTree:
8467     document {
8468     xml-version: '1.0';
8469     xml-encoding: null;
8470     xml-standalone: false;
8471     document-type {
8472     node-name: 'a';
8473 wakaba 1.18 general-entity {
8474     node-name: 'entity';
8475     text-content: 'entity value';
8476     has-replacement-tree: true;
8477 wakaba 1.8 }
8478     }
8479     element {
8480     namespace-uri: null;
8481 wakaba 1.18 prefix: null;
8482 wakaba 1.8 local-name: 'a';
8483 wakaba 1.18 general-entity-reference {
8484     node-name: 'entity';
8485     text {
8486     data: 'entity value';
8487     }
8488 wakaba 1.34 manakai-expanded: true;
8489 wakaba 1.10 }
8490 wakaba 1.9 }
8491     }
8492     @@XMLTest:
8493 wakaba 1.18 @@@QName: xp.doctype.internal.entity.root.element.text.mult.test
8494 wakaba 1.9 @@@DEnt:
8495     @@@@test:value:
8496     <!DOCTYPE a [
8497 wakaba 1.18 <!ENTITY entity "entity value">
8498 wakaba 1.9 ]>
8499 wakaba 1.18 <a>&entity; and &entity;</a>
8500 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
8501 wakaba 1.9 @@@test:domTree:
8502     document {
8503     xml-version: '1.0';
8504     xml-encoding: null;
8505     xml-standalone: false;
8506     document-type {
8507     node-name: 'a';
8508 wakaba 1.18 general-entity {
8509     node-name: 'entity';
8510     text-content: 'entity value';
8511     has-replacement-tree: true;
8512 wakaba 1.9 }
8513     }
8514     element {
8515     namespace-uri: null;
8516 wakaba 1.18 prefix: null;
8517 wakaba 1.9 local-name: 'a';
8518 wakaba 1.18 general-entity-reference {
8519     node-name: 'entity';
8520     text {
8521     data: 'entity value';
8522     }
8523 wakaba 1.34 manakai-expanded: true;
8524 wakaba 1.18 }
8525     text { data: ' and '; }
8526     general-entity-reference {
8527     node-name: 'entity';
8528     text {
8529     data: 'entity value';
8530     }
8531 wakaba 1.34 manakai-expanded: true;
8532 wakaba 1.10 }
8533 wakaba 1.9 }
8534     }
8535     @@XMLTest:
8536 wakaba 1.18 @@@QName: xp.doctype.internal.entity.root.element.text.element.test
8537 wakaba 1.9 @@@DEnt:
8538     @@@@test:value:
8539     <!DOCTYPE a [
8540 wakaba 1.18 <!ENTITY entity "entity <p>value</p> with <e>element</e> ">
8541 wakaba 1.9 ]>
8542 wakaba 1.18 <a>&entity;</a>
8543 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
8544 wakaba 1.18 @@@test:domTree:
8545     document {
8546     xml-version: '1.0';
8547     xml-encoding: null;
8548     xml-standalone: false;
8549     document-type {
8550     node-name: 'a';
8551     general-entity {
8552     node-name: 'entity';
8553     has-replacement-tree: true;
8554     text { data: 'entity '; }
8555     element {
8556     node-name: 'p';
8557     text-content: 'value';
8558     }
8559     text { data: ' with '; }
8560     element {
8561     node-name: 'e';
8562     text-content: 'element';
8563     }
8564 wakaba 1.20 text { data: ' '; }
8565 wakaba 1.18 }
8566     }
8567     element {
8568     namespace-uri: null;
8569     prefix: null;
8570     local-name: 'a';
8571     general-entity-reference {
8572     node-name: 'entity';
8573 wakaba 1.34 manakai-expanded: true;
8574 wakaba 1.18 text {
8575     data: 'entity ';
8576     }
8577     element {
8578     namespace-uri: null;
8579     prefix: null;
8580     local-name: 'p';
8581     text {
8582     data: 'value';
8583     }
8584     }
8585     text {
8586     data: ' with ';
8587     }
8588     element {
8589     namespace-uri: null;
8590     prefix: null;
8591     local-name: 'e';
8592     text {
8593     data: 'element';
8594     }
8595     }
8596     text {
8597     data: ' ';
8598     }
8599     }
8600     }
8601     }
8602     @@XMLTest:
8603     @@@QName: xp.doctype.internal.entity.root.element.text.in.ent.test
8604     @@@DEnt:
8605     @@@@test:value:
8606     <!DOCTYPE a [
8607     <!ENTITY entity1 "entity value">
8608     <!ENTITY entity2 "e&entity1;n">
8609     ]>
8610     <a>&entity2;</a>
8611 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
8612 wakaba 1.18 @@@test:domTree:
8613     document {
8614     xml-version: '1.0';
8615     xml-encoding: null;
8616     xml-standalone: false;
8617     document-type {
8618     node-name: 'a';
8619     general-entity {
8620     node-name: 'entity1';
8621     text-content: 'entity value';
8622     }
8623     general-entity {
8624     node-name: 'entity2';
8625     text { data: 'e'; }
8626     general-entity-reference {
8627     node-name: 'entity1';
8628     text-content: 'entity value';
8629 wakaba 1.34 manakai-expanded: true;
8630 wakaba 1.18 }
8631     text { data: 'n'; }
8632     }
8633     }
8634     element {
8635     namespace-uri: null;
8636     prefix: null;
8637     local-name: 'a';
8638     general-entity-reference {
8639     node-name: 'entity2';
8640     text { data: 'e'; }
8641 wakaba 1.34 manakai-expanded: true;
8642 wakaba 1.18 general-entity-reference {
8643     node-name: 'entity1';
8644     text {
8645     data: 'entity value';
8646     }
8647 wakaba 1.34 manakai-expanded: true;
8648 wakaba 1.18 }
8649     text { data: 'n'; }
8650     }
8651     }
8652     }
8653    
8654     @@XMLTest:
8655     @@@QName: xp.doctype.entity.value.charref.test
8656     @@@DEnt:
8657     @@@@test:value:
8658     <!DOCTYPE a [
8659     <!ENTITY entity1 "entity &#x21;value&#35;">
8660     <!ENTITY entity2 '&#x21;value&#35;'>
8661     ]>
8662     <a></a>
8663 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
8664 wakaba 1.18 @@@test:domTree:
8665     document {
8666     document-type {
8667     general-entity {
8668     node-name: 'entity1';
8669     text-content: 'entity !value#';
8670     has-replacement-tree: true;
8671     }
8672     general-entity {
8673     node-name: 'entity2';
8674     text-content: '!value#';
8675     has-replacement-tree: true;
8676     }
8677     }
8678     element { }
8679     }
8680    
8681     @@XMLTest:
8682     @@@QName: xp.predefined.in.content.test
8683     @@@DEnt:
8684     @@@@test:value:
8685     <a>_&lt;_&gt;_&quot;_&apos;_&amp;_</a>
8686     @@@test:domTree:
8687     document {
8688     element {
8689     text-content: '_<_>_"_' U+0027 '_&_';
8690     }
8691     }
8692     @@XMLTest:
8693     @@@QName: xp.predefined.in.attr.test
8694     @@@DEnt:
8695     @@@@test:value:
8696     <a at="_&lt;_&gt;_&quot;_&apos;_&amp;_"></a>
8697     @@@test:domTree:
8698     document {
8699     element {
8700     attribute {
8701     node-name: 'at';
8702     text-content: '_<_>_"_' U+0027 '_&_';
8703     }
8704     }
8705     }
8706     @@XMLTest:
8707     @@@QName: xp.predefined.in.content.in.entity.test
8708     @@@DEnt:
8709     @@@@test:value:
8710     <!DOCTYPE a [
8711     <!ENTITY ent "_&lt;_&gt;_&quot;_&apos;_&amp;_">
8712     ]>
8713     <a>&ent;</a>
8714 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
8715 wakaba 1.18 @@@test:domTree:
8716     document {
8717     document-type {
8718     general-entity {
8719     node-name: 'ent';
8720     text-content: '_<_>_"_' U+0027 '_&_';
8721     }
8722     }
8723     element {
8724     text-content: '_<_>_"_' U+0027 '_&_';
8725     }
8726     }
8727     @@XMLTest:
8728     @@@QName: xp.predefined.decl.ignore.test
8729     @@@DEnt:
8730     @@@@test:value:
8731     <!DOCTYPE a [
8732     <!ENTITY lt "&#x26;#x3C;">
8733     <!ENTITY gt "&#x3E;">
8734     <!ENTITY amp "&#x26;#x26;">
8735     <!ENTITY quot "&#x22;">
8736     <!ENTITY apos "&#x27;">
8737     <!ENTITY other "other">
8738     ]>
8739     <a>_&lt;_&gt;_&quot;_&apos;_&amp;_&other;_</a>
8740 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
8741 wakaba 1.18 @@@test:domTree:
8742     document {
8743     document-type {
8744     general-entity {
8745     node-name: 'other';
8746     text-content: 'other';
8747     }
8748     }
8749     element {
8750     text-content: '_<_>_"_' U+0027 '_&_other_';
8751     }
8752     }
8753    
8754     @@XMLTest:
8755     @@@QName: xp.doctype.internal.attr.empty.test
8756     @@@DEnt:
8757     @@@@test:value:
8758     <!DOCTYPE a [
8759     <!ATTLIST a>
8760     ]>
8761     <a></a>
8762     @@@test:domTree:
8763     document {
8764     xml-version: '1.0';
8765     xml-encoding: null;
8766     xml-standalone: false;
8767     document-type {
8768     node-name: 'a';
8769     element-type-definition {
8770     node-name: 'a';
8771     }
8772     }
8773     element {
8774     namespace-uri: null;
8775     local-name: 'a';
8776     }
8777     }
8778     @@XMLTest:
8779     @@@QName: xp.doctype.internal.attr.cdata.implied.test
8780     @@@DEnt:
8781     @@@@test:value:
8782     <!DOCTYPE a [
8783     <!ATTLIST a
8784     at CDATA #IMPLIED
8785     >
8786     ]>
8787     <a></a>
8788 wakaba 1.9 @@@test:domTree:
8789     document {
8790     xml-version: '1.0';
8791     xml-encoding: null;
8792     xml-standalone: false;
8793     document-type {
8794     node-name: 'a';
8795     element-type-definition {
8796     node-name: 'a';
8797     attribute-definition {
8798     node-name: 'at';
8799 wakaba 1.18 declared-type: const (CDATA_ATTR);
8800 wakaba 1.9 allowed-tokens: DOMStringList ();
8801 wakaba 1.18 default-type: const (IMPLIED_DEFAULT);
8802     text-content: '';
8803 wakaba 1.9 }
8804     }
8805     }
8806     element {
8807     namespace-uri: null;
8808     local-name: 'a';
8809 wakaba 1.18 }
8810     }
8811     @@XMLTest:
8812     @@@QName: xp.doctype.internal.attr.types.implied.test
8813     @@@DEnt:
8814     @@@@test:value:
8815     <!DOCTYPE a [
8816     <!ATTLIST a
8817     at1 ID #IMPLIED
8818     at2 IDREF #IMPLIED
8819     at3 IDREFS #IMPLIED
8820     at4 ENTITY #IMPLIED
8821     at5 ENTITIES #IMPLIED
8822     at6 NMTOKEN #IMPLIED
8823     at7 NMTOKENS #IMPLIED
8824     at8 NOTATION (n1 | n2|n3) #IMPLIED
8825     at9 (e1| e2| e3 ) #IMPLIED
8826     >
8827     ]>
8828     <a></a>
8829     @@@test:domTree:
8830     document {
8831     xml-version: '1.0';
8832     xml-encoding: null;
8833     xml-standalone: false;
8834     document-type {
8835     node-name: 'a';
8836     element-type-definition {
8837     node-name: 'a';
8838     attribute-definition {
8839     node-name: 'at1';
8840     declared-type: const (ID_ATTR);
8841     allowed-tokens: DOMStringList ();
8842     default-type: const (IMPLIED_DEFAULT);
8843     text-content: '';
8844     }
8845     attribute-definition {
8846     node-name: 'at2';
8847     declared-type: const (IDREF_ATTR);
8848     allowed-tokens: DOMStringList ();
8849     default-type: const (IMPLIED_DEFAULT);
8850     text-content: '';
8851     }
8852     attribute-definition {
8853     node-name: 'at3';
8854     declared-type: const (IDREFS_ATTR);
8855     allowed-tokens: DOMStringList ();
8856     default-type: const (IMPLIED_DEFAULT);
8857     text-content: '';
8858     }
8859     attribute-definition {
8860     node-name: 'at4';
8861     declared-type: const (ENTITY_ATTR);
8862     allowed-tokens: DOMStringList ();
8863     default-type: const (IMPLIED_DEFAULT);
8864     text-content: '';
8865     }
8866     attribute-definition {
8867     node-name: 'at5';
8868     declared-type: const (ENTITIES_ATTR);
8869     allowed-tokens: DOMStringList ();
8870     default-type: const (IMPLIED_DEFAULT);
8871     text-content: '';
8872     }
8873     attribute-definition {
8874     node-name: 'at6';
8875     declared-type: const (NMTOKEN_ATTR);
8876     allowed-tokens: DOMStringList ();
8877     default-type: const (IMPLIED_DEFAULT);
8878     text-content: '';
8879     }
8880     attribute-definition {
8881     node-name: 'at7';
8882     declared-type: const (NMTOKENS_ATTR);
8883     allowed-tokens: DOMStringList ();
8884     default-type: const (IMPLIED_DEFAULT);
8885     text-content: '';
8886     }
8887     attribute-definition {
8888     node-name: 'at8';
8889     declared-type: const (NOTATION_ATTR);
8890     allowed-tokens: DOMStringList ('n1', 'n2', 'n3');
8891     default-type: const (IMPLIED_DEFAULT);
8892     text-content: '';
8893     }
8894     attribute-definition {
8895     node-name: 'at9';
8896     declared-type: const (ENUMERATION_ATTR);
8897     allowed-tokens: DOMStringList ('e1', 'e2', 'e3');
8898     default-type: const (IMPLIED_DEFAULT);
8899     text-content: '';
8900     }
8901     }
8902     }
8903     element {
8904     namespace-uri: null;
8905     local-name: 'a';
8906     }
8907     }
8908     @@XMLTest:
8909     @@@QName: xp.doctype.internal.attr.cdata.defaults.test
8910     @@@DEnt:
8911     @@@@test:value:
8912     <!DOCTYPE a [
8913     <!ATTLIST a
8914     at1 CDATA #IMPLIED
8915     at2 CDATA #REQUIRED
8916     at3 CDATA #FIXED "value3"
8917     at4 CDATA "value4"
8918     at5 CDATA #FIXED 'value5'
8919     at6 CDATA 'value6'
8920     >
8921     ]>
8922     <a></a>
8923     @@@test:domTree:
8924     document {
8925     xml-version: '1.0';
8926     xml-encoding: null;
8927     xml-standalone: false;
8928     document-type {
8929     node-name: 'a';
8930     element-type-definition {
8931     node-name: 'a';
8932     attribute-definition {
8933     node-name: 'at1';
8934     declared-type: const (CDATA_ATTR);
8935     allowed-tokens: DOMStringList ();
8936     default-type: const (IMPLIED_DEFAULT);
8937     text-content: '';
8938     }
8939     attribute-definition {
8940     node-name: 'at2';
8941     declared-type: const (CDATA_ATTR);
8942     allowed-tokens: DOMStringList ();
8943     default-type: const (REQUIRED_DEFAULT);
8944     text-content: '';
8945     }
8946     attribute-definition {
8947     node-name: 'at3';
8948     declared-type: const (CDATA_ATTR);
8949     allowed-tokens: DOMStringList ();
8950     default-type: const (FIXED_DEFAULT);
8951     text-content: 'value3';
8952     }
8953     attribute-definition {
8954     node-name: 'at4';
8955     declared-type: const (CDATA_ATTR);
8956     allowed-tokens: DOMStringList ();
8957     default-type: const (EXPLICIT_DEFAULT);
8958     text-content: 'value4';
8959     }
8960     attribute-definition {
8961     node-name: 'at5';
8962     declared-type: const (CDATA_ATTR);
8963     allowed-tokens: DOMStringList ();
8964     default-type: const (FIXED_DEFAULT);
8965     text-content: 'value5';
8966     }
8967     attribute-definition {
8968     node-name: 'at6';
8969     declared-type: const (CDATA_ATTR);
8970     allowed-tokens: DOMStringList ();
8971     default-type: const (EXPLICIT_DEFAULT);
8972     text-content: 'value6';
8973     }
8974     }
8975     }
8976     element {
8977     namespace-uri: null;
8978     local-name: 'a';
8979     attribute {
8980     node-name: 'at3';
8981     text-content: 'value3';
8982     specified: false;
8983     }
8984     attribute {
8985     node-name: 'at4';
8986     text-content: 'value4';
8987     specified: false;
8988     }
8989     attribute {
8990     node-name: 'at5';
8991     text-content: 'value5';
8992     specified: false;
8993     }
8994     attribute {
8995     node-name: 'at6';
8996     text-content: 'value6';
8997     specified: false;
8998     }
8999     }
9000     }
9001    
9002     @@XMLTest:
9003     @@@QName: xp.doctype.internal.attr.cdata.default.normalize.test
9004     @@@DEnt:
9005     @@@@test:value:
9006     <!DOCTYPE a [
9007     <!ATTLIST a
9008     at CDATA " default &#x0A;value "
9009     >
9010     ]>
9011     <a></a>
9012     @@@test:domTree:
9013     document {
9014     xml-version: '1.0';
9015     xml-encoding: null;
9016     xml-standalone: false;
9017     document-type {
9018     node-name: 'a';
9019     element-type-definition {
9020     node-name: 'a';
9021     attribute-definition {
9022     node-name: 'at';
9023     declared-type: const (CDATA_ATTR);
9024     allowed-tokens: DOMStringList ();
9025     default-type: const (EXPLICIT_DEFAULT);
9026     text-content: ' default ' U+000A 'value ';
9027     }
9028     }
9029     }
9030     element {
9031     namespace-uri: null;
9032     local-name: 'a';
9033     attribute {
9034     node-name: 'at';
9035     text-content: ' default ' U+000A 'value ';
9036     specified: false;
9037     }
9038     }
9039     }
9040     @@XMLTest:
9041     @@@QName: xp.doctype.internal.attr.nmtoken.default.normalize.test
9042     @@@DEnt:
9043     @@@@test:value:
9044     <!DOCTYPE a [
9045     <!ATTLIST a
9046     at NMTOKEN " default &#x0A;value "
9047     >
9048     ]>
9049     <a></a>
9050     @@@test:domTree:
9051     document {
9052     xml-version: '1.0';
9053     xml-encoding: null;
9054     xml-standalone: false;
9055     document-type {
9056     node-name: 'a';
9057     element-type-definition {
9058     node-name: 'a';
9059     attribute-definition {
9060     node-name: 'at';
9061     declared-type: const (NMTOKEN_ATTR);
9062     allowed-tokens: DOMStringList ();
9063     default-type: const (EXPLICIT_DEFAULT);
9064     text-content: ' default ' U+000A 'value ';
9065     }
9066     }
9067     }
9068     element {
9069     namespace-uri: null;
9070     local-name: 'a';
9071     attribute {
9072     node-name: 'at';
9073     text-content: ' default ' U+000A 'value ';
9074     specified: false;
9075     }
9076     }
9077     }
9078    
9079     @@XMLTest:
9080     @@@QName: xp.doctype.attrtype.no-value.test
9081     @@@DEnt:
9082     @@@@test:value:
9083     <!DOCTYPE a>
9084     <a at=" at value "></a>
9085     @@@test:domTree:
9086     document {
9087     xml-version: '1.0';
9088     xml-encoding: null;
9089     xml-standalone: false;
9090     document-type { }
9091     element {
9092     namespace-uri: null;
9093     local-name: 'a';
9094     attribute {
9095     namespace-uri: null;
9096     local-name: 'at';
9097     value: ' at value ';
9098     text {
9099     data: ' at value ';
9100     }
9101     schema-type-info: TypeInfo (null, null);
9102     specified: true;
9103     }
9104     }
9105     }
9106     @@XMLTest:
9107     @@@QName: xp.doctype.attrtype.cdata.test
9108     @@@DEnt:
9109     @@@@test:value:
9110     <!DOCTYPE a [
9111     <!ATTLIST a
9112     at CDATA #IMPLIED
9113     >
9114     ]>
9115     <a at=" at value "></a>
9116     @@@test:domTree:
9117     document {
9118     xml-version: '1.0';
9119     xml-encoding: null;
9120     xml-standalone: false;
9121     document-type { }
9122     element {
9123     namespace-uri: null;
9124     local-name: 'a';
9125     attribute {
9126     namespace-uri: null;
9127     local-name: 'at';
9128     value: ' at value ';
9129     text {
9130     data: ' at value ';
9131     }
9132     schema-type-info:
9133     TypeInfo ('http://www.w3.org/TR/REC-xml', 'CDATA');
9134     specified: true;
9135     }
9136     }
9137     }
9138     @@XMLTest:
9139     @@@QName: xp.doctype.attrtype.nmtoken.test
9140     @@@DEnt:
9141     @@@@test:value:
9142     <!DOCTYPE a [
9143     <!ATTLIST a
9144     at NMTOKEN #IMPLIED
9145     >
9146     ]>
9147     <a at=" at value "></a>
9148     @@@test:domTree:
9149     document {
9150     xml-version: '1.0';
9151     xml-encoding: null;
9152     xml-standalone: false;
9153     document-type { }
9154     element {
9155     namespace-uri: null;
9156     local-name: 'a';
9157     attribute {
9158     namespace-uri: null;
9159     local-name: 'at';
9160     value: 'at value';
9161     text {
9162     data: ' at value ';
9163     }
9164     schema-type-info:
9165     TypeInfo ('http://www.w3.org/TR/REC-xml', 'NMTOKEN');
9166     specified: true;
9167     }
9168     }
9169     }
9170    
9171     @@XMLTest:
9172     @@@QName: xp.doctype.attr.normalization.1.test
9173     @@@DEnt:
9174     @@@@test:value:
9175     <a at=" at &#xA;value "></a>
9176     @@@test:domTree:
9177     document {
9178     element {
9179     attribute {
9180     node-name: 'at';
9181     value: ' at ' U+000A 'value ';
9182     schema-type-info: TypeInfo (null, null);
9183     specified: true;
9184     }
9185     }
9186     }
9187     @@XMLTest:
9188     @@@QName: xp.doctype.attr.normalization.2.test
9189     @@@DEnt:
9190     @@@@test:value:
9191     <a at=" at &#xD;value "></a>
9192     @@@test:domTree:
9193     document {
9194     element {
9195     attribute {
9196     value: ' at ' U+000D 'value ';
9197     schema-type-info: TypeInfo (null, null);
9198     specified: true;
9199     }
9200     }
9201     }
9202     @@XMLTest:
9203     @@@QName: xp.doctype.attr.normalization.3.test
9204     @@@DEnt:
9205     @@@@test:value:
9206     <a at=" at &#x9;value "></a>
9207     @@@test:domTree:
9208     document {
9209     element {
9210     attribute {
9211     node-name: 'at';
9212     value: ' at ' U+0009 'value ';
9213     schema-type-info: TypeInfo (null, null);
9214     specified: true;
9215     }
9216     }
9217     }
9218    
9219     @@XMLTest:
9220     @@@QName: xp.doctype.attr.specified.1.test
9221     @@@DEnt:
9222     @@@@test:value:
9223     <!DOCTYPE a [
9224     <!ATTLIST a
9225     at CDATA "default"
9226     >
9227     ]>
9228     <a></a>
9229     @@@test:domTree:
9230     document {
9231     document-type { }
9232     element {
9233     attribute {
9234     node-name: 'at';
9235     value: 'default';
9236     specified: false;
9237     }
9238     }
9239     }
9240     @@XMLTest:
9241     @@@QName: xp.doctype.attr.specified.2.test
9242     @@@DEnt:
9243     @@@@test:value:
9244     <!DOCTYPE a [
9245     <!ATTLIST a
9246     at CDATA "default"
9247     >
9248     ]>
9249     <a at2="specified"></a>
9250     @@@test:domTree:
9251     document {
9252     document-type { }
9253     element {
9254     attribute {
9255     node-name: 'at';
9256     value: 'default';
9257     specified: false;
9258     }
9259     attribute {
9260     node-name: 'at2';
9261     value: 'specified';
9262     specified: true;
9263     }
9264     }
9265     }
9266     @@XMLTest:
9267     @@@QName: xp.doctype.attr.specified.3.test
9268     @@@DEnt:
9269     @@@@test:value:
9270     <!DOCTYPE a [
9271     <!ATTLIST a
9272     at CDATA "default"
9273     >
9274     ]>
9275     <a at="specified"></a>
9276     @@@test:domTree:
9277     document {
9278     document-type { }
9279     element {
9280     attribute {
9281     node-name: 'at';
9282     value: 'specified';
9283     specified: true;
9284     }
9285     }
9286     }
9287    
9288     @@XMLTest:
9289     @@@QName: xp.attr.literal.charref.test
9290     @@@DEnt:
9291     @@@@test:value:
9292     <a at1 = "value&#33;_&#x25;value"
9293     at2 = 'value&#x25;_&#33;value'></a>
9294     @@@test:domTree:
9295     document {
9296     element {
9297     attribute {
9298     node-name: 'at1';
9299     text-content: 'value!_%value';
9300     }
9301     attribute {
9302     node-name: 'at2';
9303     text-content: 'value%_!value';
9304     }
9305     }
9306     }
9307     @@XMLTest:
9308     @@@QName: xp.attr.literal.entref.test
9309     @@@DEnt:
9310     @@@@test:value:
9311     <!DOCTYPE a [
9312     <!ENTITY ent "entity&#x26;#33;_&#x26;#x29;value">
9313     ]>
9314     <a at1 = "value&ent;value"
9315     at2 = 'value&ent;value'></a>
9316 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
9317 wakaba 1.18 @@@test:domTree:
9318     document {
9319     document-type {
9320     general-entity {
9321     node-name: 'ent';
9322     text-content: 'entity!_)value';
9323     }
9324     }
9325     element {
9326     attribute {
9327     node-name: 'at1';
9328     text-content: 'valueentity!_)valuevalue';
9329     }
9330     attribute {
9331     node-name: 'at2';
9332     text-content: 'valueentity!_)valuevalue';
9333     }
9334     }
9335     }
9336     @@XMLTest:
9337     @@@QName: xp.attr.literal.entref.nest.test
9338     @@@DEnt:
9339     @@@@test:value:
9340     <!DOCTYPE a [
9341     <!ENTITY ent1 "entity&#x26;#33;_&#x26;#x29;value">
9342     <!ENTITY ent2 "@&ent1;@">
9343     ]>
9344     <a at1 = "value&ent2;value"
9345     at2 = 'value&ent2;value'></a>
9346 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
9347 wakaba 1.18 @@@test:domTree:
9348     document {
9349     document-type {
9350     general-entity {
9351     node-name: 'ent1';
9352     text-content: 'entity!_)value';
9353     }
9354     general-entity {
9355     node-name: 'ent2';
9356     text-content: '@entity!_)value@';
9357     }
9358     }
9359     element {
9360     attribute {
9361     node-name: 'at1';
9362     text-content: 'value@entity!_)value@value';
9363     }
9364     attribute {
9365     node-name: 'at2';
9366     text-content: 'value@entity!_)value@value';
9367     }
9368     }
9369     }
9370    
9371     @@XMLTest:
9372     @@@QName: xp.element.content.ncr.1.test
9373     @@@DEnt:
9374     @@@@test:value:
9375     <e>&#33;</e>
9376     @@@test:domTree:
9377     document {
9378     element {
9379     text-content: '!';
9380     }
9381     }
9382     @@XMLTest:
9383     @@@QName: xp.element.content.ncr.2.test
9384     @@@DEnt:
9385     @@@@test:value:
9386     <e>aaaa&#33;bbbb</e>
9387     @@@test:domTree:
9388     document {
9389     element {
9390     text-content: 'aaaa!bbbb';
9391 wakaba 1.31 text {
9392     text-content: 'aaaa!bbbb';
9393     }
9394 wakaba 1.18 }
9395     }
9396     @@XMLTest:
9397     @@@QName: xp.attrval.ncr.1.test
9398     @@@DEnt:
9399     @@@@test:value:
9400     <e a="&#33;"/>
9401     @@@test:domTree:
9402     document {
9403     element {
9404     attribute {
9405     node-name: 'a';
9406     text-content: '!';
9407     }
9408     }
9409     }
9410     @@XMLTest:
9411     @@@QName: xp.attrval.ncr.2.test
9412     @@@DEnt:
9413     @@@@test:value:
9414     <e a="aaaaa&#33;bbbbb"/>
9415     @@@test:domTree:
9416     document {
9417     element {
9418     attribute {
9419     node-name: 'a';
9420     text-content: 'aaaaa!bbbbb';
9421 wakaba 1.31 text {
9422     text-content: 'aaaaa!bbbbb';
9423     }
9424 wakaba 1.18 }
9425     }
9426     }
9427     @@XMLTest:
9428     @@@QName: xp.attrval.ncr.3.test
9429     @@@DEnt:
9430     @@@@test:value:
9431     <e a='&#33;'/>
9432     @@@test:domTree:
9433     document {
9434     element {
9435     attribute {
9436     node-name: 'a';
9437     text-content: '!';
9438     }
9439     }
9440     }
9441     @@XMLTest:
9442     @@@QName: xp.attrval.ncr.4.test
9443     @@@DEnt:
9444     @@@@test:value:
9445     <e a='aaaaa&#33;bbbbb'/>
9446     @@@test:domTree:
9447     document {
9448     element {
9449     attribute {
9450     node-name: 'a';
9451     text-content: 'aaaaa!bbbbb';
9452     }
9453     }
9454     }
9455     @@XMLTest:
9456     @@@QName: xp.entval.ncr.1.test
9457     @@@DEnt:
9458     @@@@test:value:
9459     <!DOCTYPE e [
9460     <!ENTITY ent "&#33;">
9461     ]>
9462     <e/>
9463 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
9464 wakaba 1.18 @@@test:domTree:
9465     document {
9466     document-type {
9467     general-entity {
9468     node-name: 'ent';
9469     text-content: '!';
9470     }
9471     }
9472     element { }
9473     }
9474     @@XMLTest:
9475     @@@QName: xp.entval.ncr.2.test
9476     @@@DEnt:
9477     @@@@test:value:
9478     <!DOCTYPE e [
9479     <!ENTITY ent "aaaaa&#33;bbbbb">
9480     ]>
9481     <e/>
9482 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
9483 wakaba 1.18 @@@test:domTree:
9484     document {
9485     document-type {
9486     general-entity {
9487     node-name: 'ent';
9488     text-content: 'aaaaa!bbbbb';
9489     }
9490     }
9491     element { }
9492     }
9493     @@XMLTest:
9494     @@@QName: xp.element.content.reptxt.ncr.1.test
9495     @@@DEnt:
9496     @@@@test:value:
9497     <!DOCTYPE e [
9498     <!ENTITY ent "&#38;#33;">
9499     ]>
9500     <e>&ent;</e>
9501     @@@test:domTree:
9502     document {
9503     document-type { }
9504     element {
9505     general-entity-reference {
9506     node-name: 'ent';
9507     text-content: '!';
9508 wakaba 1.34 manakai-expanded: true;
9509 wakaba 1.18 }
9510     }
9511     }
9512     @@XMLTest:
9513     @@@QName: xp.element.content.reptxt.ncr.2.test
9514     @@@DEnt:
9515     @@@@test:value:
9516     <!DOCTYPE e [
9517     <!ENTITY ent "aaaaa&#38;#33;bbbbb">
9518     ]>
9519     <e>&ent;</e>
9520     @@@test:domTree:
9521     document {
9522     document-type { }
9523     element {
9524     general-entity-reference {
9525     node-name: 'ent';
9526     text-content: 'aaaaa!bbbbb';
9527 wakaba 1.34 manakai-expanded: true;
9528 wakaba 1.18 }
9529     }
9530     }
9531     @@XMLTest:
9532     @@@QName: xp.element.content.reptxt.reptxt.ncr.1.test
9533     @@@DEnt:
9534     @@@@test:value:
9535     <!DOCTYPE e [
9536     <!ENTITY ent "&#38;#33;">
9537     <!ENTITY ent2 "&ent;">
9538     ]>
9539     <e>&ent2;</e>
9540     @@@test:domTree:
9541     document {
9542     document-type { }
9543     element {
9544     general-entity-reference {
9545     node-name: 'ent2';
9546     general-entity-reference {
9547     node-name: 'ent';
9548     text-content: '!';
9549 wakaba 1.34 manakai-expanded: true;
9550 wakaba 1.18 }
9551 wakaba 1.34 manakai-expanded: true;
9552 wakaba 1.18 }
9553     }
9554     }
9555     @@XMLTest:
9556     @@@QName: xp.element.content.reptxt.reptxt.ncr.2.test
9557     @@@DEnt:
9558     @@@@test:value:
9559     <!DOCTYPE e [
9560     <!ENTITY ent "aa&#38;#33;bb">
9561     <!ENTITY ent2 "&ent;">
9562     ]>
9563     <e>&ent2;</e>
9564     @@@test:domTree:
9565     document {
9566     document-type { }
9567     element {
9568     general-entity-reference {
9569     node-name: 'ent2';
9570     general-entity-reference {
9571     node-name: 'ent';
9572     text-content: 'aa!bb';
9573 wakaba 1.34 manakai-expanded: true;
9574 wakaba 1.31 text {
9575     text-content: 'aa!bb';
9576     }
9577 wakaba 1.18 }
9578 wakaba 1.34 manakai-expanded: true;
9579 wakaba 1.18 }
9580     }
9581     }
9582     @@XMLTest:
9583     @@@QName: xp.attval.reptxt.ncr.1.test
9584     @@@DEnt:
9585     @@@@test:value:
9586     <!DOCTYPE e [
9587     <!ENTITY ent "&#38;#33;">
9588     ]>
9589     <e a="&ent;"/>
9590     @@@test:domTree:
9591     document {
9592     document-type { }
9593     element {
9594     attribute {
9595     node-name: 'a';
9596     general-entity-reference {
9597     node-name: 'ent';
9598     text-content: '!';
9599 wakaba 1.34 manakai-expanded: true;
9600 wakaba 1.18 }
9601     }
9602     }
9603     }
9604     @@XMLTest:
9605     @@@QName: xp.attval.reptxt.ncr.2.test
9606     @@@DEnt:
9607     @@@@test:value:
9608     <!DOCTYPE e [
9609     <!ENTITY ent "aaaaa&#38;#33;bbbbb">
9610     ]>
9611     <e a="&ent;"/>
9612     @@@test:domTree:
9613     document {
9614     document-type { }
9615     element {
9616     attribute {
9617     node-name: 'a';
9618     general-entity-reference {
9619     node-name: 'ent';
9620     text-content: 'aaaaa!bbbbb';
9621 wakaba 1.34 manakai-expanded: true;
9622 wakaba 1.31 text {
9623     text-content: 'aaaaa!bbbbb';
9624     }
9625 wakaba 1.18 }
9626     }
9627     }
9628     }
9629     @@XMLTest:
9630     @@@QName: xp.attval.reptxt.reptxt.ncr.1.test
9631     @@@DEnt:
9632     @@@@test:value:
9633     <!DOCTYPE e [
9634     <!ENTITY ent "&#38;#33;">
9635     <!ENTITY ent2 "&ent;">
9636     ]>
9637     <e a="&ent2;"/>
9638     @@@test:domTree:
9639     document {
9640     document-type { }
9641     element {
9642     attribute {
9643     node-name: 'a';
9644     general-entity-reference {
9645     node-name: 'ent2';
9646 wakaba 1.34 manakai-expanded: true;
9647 wakaba 1.18 general-entity-reference {
9648     node-name: 'ent';
9649     text-content: '!';
9650 wakaba 1.34 manakai-expanded: true;
9651 wakaba 1.18 }
9652     }
9653     }
9654     }
9655     }
9656     @@XMLTest:
9657     @@@QName: xp.attval.reptxt.reptxt.ncr.2.test
9658     @@@DEnt:
9659     @@@@test:value:
9660     <!DOCTYPE e [
9661     <!ENTITY ent "aa&#38;#33;bb">
9662     <!ENTITY ent2 "&ent;">
9663     ]>
9664     <e a="&ent2;"/>
9665     @@@test:domTree:
9666     document {
9667     document-type { }
9668     element {
9669     attribute {
9670     node-name: 'a';
9671     general-entity-reference {
9672     node-name: 'ent2';
9673 wakaba 1.34 manakai-expanded: true;
9674 wakaba 1.18 general-entity-reference {
9675     node-name: 'ent';
9676     text-content: 'aa!bb';
9677 wakaba 1.34 manakai-expanded: true;
9678 wakaba 1.18 }
9679     }
9680     }
9681     }
9682     }
9683    
9684     @@XMLTest:
9685     @@@QName: xp.element.content.hcr.1.test
9686     @@@DEnt:
9687     @@@@test:value:
9688     <e>&#x21;</e>
9689     @@@test:domTree:
9690     document {
9691     element {
9692     text-content: '!';
9693     }
9694     }
9695     @@XMLTest:
9696     @@@QName: xp.element.content.hcr.2.test
9697     @@@DEnt:
9698     @@@@test:value:
9699     <e>aaaa&#x21;bbbb</e>
9700     @@@test:domTree:
9701     document {
9702     element {
9703     text-content: 'aaaa!bbbb';
9704 wakaba 1.31 text {
9705     text-content: 'aaaa!bbbb';
9706     }
9707 wakaba 1.18 }
9708     }
9709     @@XMLTest:
9710     @@@QName: xp.attrval.hcr.1.test
9711     @@@DEnt:
9712     @@@@test:value:
9713     <e a="&#x21;"/>
9714     @@@test:domTree:
9715     document {
9716     element {
9717     attribute {
9718     node-name: 'a';
9719     text-content: '!';
9720     }
9721     }
9722     }
9723     @@XMLTest:
9724     @@@QName: xp.attrval.hcr.2.test
9725     @@@DEnt:
9726     @@@@test:value:
9727     <e a="aaaaa&#x21;bbbbb"/>
9728     @@@test:domTree:
9729     document {
9730     element {
9731     attribute {
9732     node-name: 'a';
9733     text-content: 'aaaaa!bbbbb';
9734 wakaba 1.31 text {
9735     text-content: 'aaaaa!bbbbb';
9736     }
9737 wakaba 1.18 }
9738     }
9739     }
9740     @@XMLTest:
9741     @@@QName: xp.attrval.hcr.3.test
9742     @@@DEnt:
9743     @@@@test:value:
9744     <e a='&#x21;'/>
9745     @@@test:domTree:
9746     document {
9747     element {
9748     attribute {
9749     node-name: 'a';
9750     text-content: '!';
9751     }
9752     }
9753     }
9754     @@XMLTest:
9755     @@@QName: xp.attrval.hcr.4.test
9756     @@@DEnt:
9757     @@@@test:value:
9758     <e a='aaaaa&#x21;bbbbb'/>
9759     @@@test:domTree:
9760     document {
9761     element {
9762     attribute {
9763     node-name: 'a';
9764     text-content: 'aaaaa!bbbbb';
9765     }
9766     }
9767     }
9768     @@XMLTest:
9769     @@@QName: xp.entval.hcr.1.test
9770     @@@DEnt:
9771     @@@@test:value:
9772     <!DOCTYPE e [
9773     <!ENTITY ent "&#x21;">
9774     ]>
9775     <e/>
9776 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
9777 wakaba 1.18 @@@test:domTree:
9778     document {
9779     document-type {
9780     general-entity {
9781     node-name: 'ent';
9782     text-content: '!';
9783 wakaba 1.10 }
9784 wakaba 1.9 }
9785 wakaba 1.18 element { }
9786 wakaba 1.9 }
9787     @@XMLTest:
9788 wakaba 1.18 @@@QName: xp.entval.hcr.2.test
9789 wakaba 1.9 @@@DEnt:
9790     @@@@test:value:
9791 wakaba 1.18 <!DOCTYPE e [
9792     <!ENTITY ent "aaaaa&#x21;bbbbb">
9793     ]>
9794     <e/>
9795 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
9796 wakaba 1.9 @@@test:domTree:
9797     document {
9798 wakaba 1.18 document-type {
9799     general-entity {
9800     node-name: 'ent';
9801     text-content: 'aaaaa!bbbbb';
9802 wakaba 1.31 text {
9803     text-content: 'aaaaa!bbbbb';
9804     }
9805 wakaba 1.9 }
9806     }
9807 wakaba 1.18 element { }
9808 wakaba 1.9 }
9809     @@XMLTest:
9810 wakaba 1.18 @@@QName: xp.element.content.reptxt.hcr.1.test
9811 wakaba 1.9 @@@DEnt:
9812     @@@@test:value:
9813 wakaba 1.18 <!DOCTYPE e [
9814     <!ENTITY ent "&#38;#x21;">
9815 wakaba 1.9 ]>
9816 wakaba 1.18 <e>&ent;</e>
9817 wakaba 1.9 @@@test:domTree:
9818     document {
9819     document-type { }
9820     element {
9821 wakaba 1.18 general-entity-reference {
9822     node-name: 'ent';
9823     text-content: '!';
9824 wakaba 1.34 manakai-expanded: true;
9825 wakaba 1.9 }
9826     }
9827     }
9828     @@XMLTest:
9829 wakaba 1.18 @@@QName: xp.element.content.reptxt.hcr.2.test
9830 wakaba 1.9 @@@DEnt:
9831     @@@@test:value:
9832 wakaba 1.18 <!DOCTYPE e [
9833     <!ENTITY ent "aaaaa&#38;#x21;bbbbb">
9834 wakaba 1.9 ]>
9835 wakaba 1.18 <e>&ent;</e>
9836 wakaba 1.9 @@@test:domTree:
9837     document {
9838     document-type { }
9839     element {
9840 wakaba 1.18 general-entity-reference {
9841     node-name: 'ent';
9842     text-content: 'aaaaa!bbbbb';
9843 wakaba 1.34 manakai-expanded: true;
9844 wakaba 1.9 }
9845     }
9846     }
9847     @@XMLTest:
9848 wakaba 1.18 @@@QName: xp.element.content.reptxt.reptxt.hcr.1.test
9849 wakaba 1.9 @@@DEnt:
9850     @@@@test:value:
9851 wakaba 1.18 <!DOCTYPE e [
9852     <!ENTITY ent "&#38;#x21;">
9853     <!ENTITY ent2 "&ent;">
9854     ]>
9855     <e>&ent2;</e>
9856 wakaba 1.9 @@@test:domTree:
9857     document {
9858 wakaba 1.18 document-type { }
9859 wakaba 1.9 element {
9860 wakaba 1.18 general-entity-reference {
9861     node-name: 'ent2';
9862 wakaba 1.34 manakai-expanded: true;
9863 wakaba 1.18 general-entity-reference {
9864     node-name: 'ent';
9865     text-content: '!';
9866 wakaba 1.34 manakai-expanded: true;
9867 wakaba 1.18 }
9868 wakaba 1.9 }
9869     }
9870     }
9871     @@XMLTest:
9872 wakaba 1.18 @@@QName: xp.element.content.reptxt.reptxt.hcr.2.test
9873 wakaba 1.9 @@@DEnt:
9874     @@@@test:value:
9875 wakaba 1.18 <!DOCTYPE e [
9876     <!ENTITY ent "aa&#38;#x21;bb">
9877     <!ENTITY ent2 "&ent;">
9878     ]>
9879     <e>&ent2;</e>
9880 wakaba 1.9 @@@test:domTree:
9881     document {
9882 wakaba 1.18 document-type { }
9883 wakaba 1.9 element {
9884 wakaba 1.18 general-entity-reference {
9885     node-name: 'ent2';
9886 wakaba 1.34 manakai-expanded: true;
9887 wakaba 1.18 general-entity-reference {
9888     node-name: 'ent';
9889 wakaba 1.34 manakai-expanded: true;
9890 wakaba 1.18 text-content: 'aa!bb';
9891     }
9892 wakaba 1.9 }
9893     }
9894     }
9895     @@XMLTest:
9896 wakaba 1.18 @@@QName: xp.attval.reptxt.hcr.1.test
9897 wakaba 1.9 @@@DEnt:
9898     @@@@test:value:
9899 wakaba 1.18 <!DOCTYPE e [
9900     <!ENTITY ent "&#38;#x21;">
9901     ]>
9902     <e a="&ent;"/>
9903 wakaba 1.9 @@@test:domTree:
9904     document {
9905 wakaba 1.18 document-type { }
9906 wakaba 1.9 element {
9907     attribute {
9908 wakaba 1.18 node-name: 'a';
9909     general-entity-reference {
9910     node-name: 'ent';
9911 wakaba 1.34 manakai-expanded: true;
9912 wakaba 1.18 text-content: '!';
9913     }
9914 wakaba 1.10 }
9915     }
9916     }
9917     @@XMLTest:
9918 wakaba 1.18 @@@QName: xp.attval.reptxt.hcr.2.test
9919 wakaba 1.10 @@@DEnt:
9920     @@@@test:value:
9921 wakaba 1.18 <!DOCTYPE e [
9922     <!ENTITY ent "aaaaa&#38;#x21;bbbbb">
9923 wakaba 1.10 ]>
9924 wakaba 1.18 <e a="&ent;"/>
9925 wakaba 1.10 @@@test:domTree:
9926     document {
9927     document-type { }
9928     element {
9929     attribute {
9930 wakaba 1.18 node-name: 'a';
9931     general-entity-reference {
9932     node-name: 'ent';
9933 wakaba 1.34 manakai-expanded: true;
9934 wakaba 1.18 text-content: 'aaaaa!bbbbb';
9935 wakaba 1.31 text {
9936     text-content: 'aaaaa!bbbbb';
9937     }
9938 wakaba 1.18 }
9939 wakaba 1.10 }
9940     }
9941     }
9942     @@XMLTest:
9943 wakaba 1.18 @@@QName: xp.attval.reptxt.reptxt.hcr.1.test
9944 wakaba 1.10 @@@DEnt:
9945     @@@@test:value:
9946 wakaba 1.18 <!DOCTYPE e [
9947     <!ENTITY ent "&#38;#x21;">
9948     <!ENTITY ent2 "&ent;">
9949 wakaba 1.10 ]>
9950 wakaba 1.18 <e a="&ent2;"/>
9951 wakaba 1.10 @@@test:domTree:
9952     document {
9953     document-type { }
9954     element {
9955     attribute {
9956 wakaba 1.18 node-name: 'a';
9957     general-entity-reference {
9958     node-name: 'ent2';
9959 wakaba 1.34 manakai-expanded: true;
9960 wakaba 1.18 general-entity-reference {
9961     node-name: 'ent';
9962 wakaba 1.34 manakai-expanded: true;
9963 wakaba 1.18 text-content: '!';
9964     }
9965     }
9966 wakaba 1.10 }
9967     }
9968     }
9969     @@XMLTest:
9970 wakaba 1.18 @@@QName: xp.attval.reptxt.reptxt.hcr.2.test
9971 wakaba 1.10 @@@DEnt:
9972     @@@@test:value:
9973 wakaba 1.18 <!DOCTYPE e [
9974     <!ENTITY ent "aa&#38;#x21;bb">
9975     <!ENTITY ent2 "&ent;">
9976 wakaba 1.10 ]>
9977 wakaba 1.18 <e a="&ent2;"/>
9978 wakaba 1.10 @@@test:domTree:
9979     document {
9980     document-type { }
9981     element {
9982     attribute {
9983 wakaba 1.18 node-name: 'a';
9984     general-entity-reference {
9985     node-name: 'ent2';
9986 wakaba 1.34 manakai-expanded: true;
9987 wakaba 1.18 general-entity-reference {
9988     node-name: 'ent';
9989 wakaba 1.34 manakai-expanded: true;
9990 wakaba 1.18 text-content: 'aa!bb';
9991     }
9992     }
9993 wakaba 1.11 }
9994     }
9995     }
9996    
9997     @@XMLTest:
9998 wakaba 1.18 @@@QName: xp.element.content.ncr.legal.char.1.0.1.test
9999     @@@DEnt:
10000     @@@@test:value:
10001     <?xml version="1.0"?>
10002     <e>&#0;</e>
10003     @@@c:erred: <[[xp|wf-legal-character]]> { (2, 4)..(2, 7); }
10004     @@XMLTest:
10005     @@@QName: xp.element.content.ncr.legal.char.1.1.1.test
10006     @@@DEnt:
10007     @@@@test:value:
10008     <?xml version="1.1"?>
10009     <e>&#0;</e>
10010     @@@c:erred: <[[xp|wf-legal-character]]> { (2, 4)..(2, 7); }
10011     @@XMLTest:
10012     @@@QName: xp.element.content.ncr.legal.char.1.0.2.test
10013     @@@DEnt:
10014     @@@@test:value:
10015     <?xml version="1.0"?>
10016     <e>&#1;</e>
10017     @@@c:erred: <[[xp|wf-legal-character]]> { (2, 4)..(2, 7); }
10018     @@XMLTest:
10019     @@@QName: xp.element.content.ncr.legal.char.1.1.2.test
10020 wakaba 1.11 @@@DEnt:
10021     @@@@test:value:
10022 wakaba 1.18 <?xml version="1.1"?>
10023     <e>&#1;</e>
10024 wakaba 1.11 @@@test:domTree:
10025     document {
10026 wakaba 1.18 xml-version: '1.1';
10027 wakaba 1.11 element {
10028 wakaba 1.18 text-content: U+0001;
10029 wakaba 1.11 }
10030     }
10031     @@XMLTest:
10032 wakaba 1.18 @@@QName: xp.element.content.hcr.legal.char.1.0.1.test
10033     @@@DEnt:
10034     @@@@test:value:
10035     <?xml version="1.0"?>
10036     <e>&#x0;</e>
10037     @@@c:erred: <[[xp|wf-legal-character]]> { (2, 4)..(2, 8); }
10038     @@XMLTest:
10039     @@@QName: xp.element.content.hcr.legal.char.1.1.1.test
10040     @@@DEnt:
10041     @@@@test:value:
10042     <?xml version="1.1"?>
10043     <e>&#x0;</e>
10044     @@@c:erred: <[[xp|wf-legal-character]]> { (2, 4)..(2, 8); }
10045     @@XMLTest:
10046     @@@QName: xp.element.content.hcr.legal.char.1.0.2.test
10047 wakaba 1.11 @@@DEnt:
10048     @@@@test:value:
10049 wakaba 1.18 <?xml version="1.0"?>
10050     <e>&#x1;</e>
10051     @@@c:erred: <[[xp|wf-legal-character]]> { (2, 4)..(2, 8); }
10052 wakaba 1.11 @@XMLTest:
10053 wakaba 1.18 @@@QName: xp.element.content.hcr.legal.char.1.1.2.test
10054 wakaba 1.11 @@@DEnt:
10055     @@@@test:value:
10056 wakaba 1.18 <?xml version="1.1"?>
10057     <e>&#x1;</e>
10058 wakaba 1.11 @@@test:domTree:
10059     document {
10060 wakaba 1.18 xml-version: '1.1';
10061 wakaba 1.11 element {
10062 wakaba 1.18 text-content: U+0001;
10063 wakaba 1.6 }
10064     }
10065    
10066 wakaba 1.19 @@XMLTest:
10067     @@@QName: xp.element.content.ger.entity.declared.nodtd.1.test
10068     @@@DEnt:
10069     @@@@test:value:
10070     <p>&entity;</p>
10071     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 4)..(1, 11); }
10072     @@XMLTest:
10073     @@@QName: xp.element.content.ger.entity.declared.nodtd.2.test
10074     @@@DEnt:
10075     @@@@test:value:
10076     <?xml version="1.0" standalone="yes"?>
10077     <p>&entity;</p>
10078     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 4)..(2, 11); }
10079     @@XMLTest:
10080     @@@QName: xp.element.content.ger.entity.declared.nodtd.3.test
10081     @@@DEnt:
10082     @@@@test:value:
10083     <?xml version="1.0" standalone="no"?>
10084     <p>&entity;</p>
10085     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 4)..(2, 11); }
10086     @@XMLTest:
10087     @@@QName: xp.element.content.ger.entity.declared.nodtd.-1.test
10088     @@@DEnt:
10089     @@@@test:value:
10090     <p>&lt;&gt;&amp;&quot;&apos;</p>
10091     @@@test:domTree:
10092     document {
10093     element {
10094     text-content: '<>&"' U+0027;
10095     }
10096     }
10097     @@XMLTest:
10098     @@@QName: xp.element.content.ger.entity.declared.nopref.1.test
10099     @@@DEnt:
10100     @@@@test:value:
10101     <!DOCTYPE p []>
10102     <p>&entity;</p>
10103     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 4)..(2, 11); }
10104     @@XMLTest:
10105     @@@QName: xp.element.content.ger.entity.declared.nopref.2.test
10106     @@@DEnt:
10107     @@@@test:value:
10108     <!DOCTYPE p [
10109     <!ENTITY other "aa">
10110     <!ENTITY % another "aa">
10111     ]>
10112     <p>&entity;</p>
10113     @@@c:erred: <[[xp|wf-entity-declared]]> { (5, 4)..(5, 11); }
10114     @@XMLTest:
10115     @@@QName: xp.element.content.ger.entity.declared.nopref.3.test
10116     @@@DEnt:
10117     @@@@test:value:
10118     <?xml version="1.0" standalone="yes"?>
10119     <!DOCTYPE p []>
10120     <p>&entity;</p>
10121     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 4)..(3, 11); }
10122     @@XMLTest:
10123     @@@QName: xp.element.content.ger.entity.declared.nopref.4.test
10124     @@@DEnt:
10125     @@@@test:value:
10126     <?xml version="1.0" standalone="no"?>
10127     <!DOCTYPE p []>
10128     <p>&entity;</p>
10129     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 4)..(3, 11); }
10130     @@XMLTest:
10131     @@@QName: xp.element.content.ger.entity.declared.nopref.5.test
10132     @@@DEnt:
10133     @@@@test:value:
10134     <?xml version="1.0" standalone="yes"?>
10135     <!DOCTYPE p [
10136     <!ENTITY other "aa">
10137     <!ENTITY % another "aa">
10138     ]>
10139     <p>&entity;</p>
10140     @@@c:erred: <[[xp|wf-entity-declared]]> { (6, 4)..(6, 11); }
10141     @@XMLTest:
10142     @@@QName: xp.element.content.ger.entity.declared.nopref.6.test
10143     @@@DEnt:
10144     @@@@test:value:
10145     <?xml version="1.0" standalone="no"?>
10146     <!DOCTYPE p [
10147     <!ENTITY other "aa">
10148     <!ENTITY % another "aa">
10149     ]>
10150     <p>&entity;</p>
10151     @@@c:erred: <[[xp|wf-entity-declared]]> { (6, 4)..(6, 11); }
10152     @@XMLTest:
10153     @@@QName: xp.element.content.ger.entity.declared.nopref.-1.test
10154     @@@DEnt:
10155     @@@@test:value:
10156     <!DOCTYPE p [
10157     <!ENTITY entity "value">
10158     ]>
10159     <p>&entity;</p>
10160 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
10161 wakaba 1.19 @@@test:domTree:
10162     document {
10163     document-type {
10164     general-entity {
10165     node-name: 'entity';
10166     text-content: 'value';
10167     }
10168     }
10169     element {
10170 wakaba 1.20 general-entity-reference {
10171 wakaba 1.19 node-name: 'entity';
10172 wakaba 1.34 manakai-expanded: true;
10173 wakaba 1.19 text-content: 'value';
10174     }
10175     }
10176     }
10177     @@XMLTest:
10178     @@@QName: xp.element.content.ger.entity.declared.nopref.-2.test
10179     @@@DEnt:
10180     @@@@test:value:
10181     <!DOCTYPE p [
10182     <!ENTITY entity "value">
10183     <!ENTITY another SYSTEM "another">
10184     ]>
10185     <p>&entity;</p>
10186 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
10187 wakaba 1.19 @@@test:domTree:
10188     document {
10189     document-type {
10190     general-entity {
10191     node-name: 'entity';
10192     text-content: 'value';
10193     }
10194 wakaba 1.20 general-entity {
10195     node-name: 'another';
10196     public-id: null;
10197     system-id: 'another';
10198     }
10199 wakaba 1.19 }
10200     element {
10201 wakaba 1.20 general-entity-reference {
10202 wakaba 1.19 node-name: 'entity';
10203 wakaba 1.34 manakai-expanded: true;
10204 wakaba 1.19 text-content: 'value';
10205     }
10206     }
10207     }
10208     @@XMLTest:
10209     @@@QName: xp.element.content.ger.entity.declared.standalone.1.test
10210     @@@DEnt:
10211     @@@@test:value:
10212     <?xml version="1.0" standalone="yes"?>
10213     <p>&entity;</p>
10214     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 4)..(2, 11); }
10215     @@XMLTest:
10216     @@@QName: xp.element.content.ger.entity.declared.standalone.2.test
10217     @@@DEnt:
10218     @@@@test:value:
10219     <?xml version="1.0" standalone="yes"?>
10220     <!DOCTYPE p []>
10221     <p>&entity;</p>
10222     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 4)..(3, 11); }
10223     @@XMLTest:
10224     @@@QName: xp.element.content.ger.entity.declared.standalone.3.test
10225     @@@DEnt:
10226     @@@@test:value:
10227     <?xml version="1.0" standalone="yes"?>
10228     <!DOCTYPE p [
10229     <!ENTITY % para "<!-- -->">
10230     %para;
10231     ]>
10232     <p>&entity;</p>
10233     @@@c:erred: <[[xp|wf-entity-declared]]> { (6, 4)..(6, 11); }
10234     @@XMLTest:
10235     @@@QName: xp.element.content.ger.entity.declared.standalone.-1.test
10236     @@@DEnt:
10237     @@@@test:value:
10238     <?xml version="1.0" standalone="no"?>
10239     <!DOCTYPE p [
10240     <!ENTITY % para "<!-- -->">
10241     %para;
10242     ]>
10243     <p>&entity;</p>
10244     @@@test:domTree:
10245     document {
10246     document-type { }
10247     element {
10248     general-entity-reference {
10249 wakaba 1.34 manakai-expanded: false;
10250 wakaba 1.19 }
10251     }
10252     }
10253     @@XMLTest:
10254     @@@QName: xp.element.content.ger.entity.declared.standalone.-2.test
10255     @@@DEnt:
10256     @@@@test:value:
10257     <!DOCTYPE p [
10258     <!ENTITY % para "<!-- -->">
10259     %para;
10260     ]>
10261     <p>&entity;</p>
10262     @@@test:domTree:
10263     document {
10264     document-type { }
10265     element {
10266     general-entity-reference {
10267 wakaba 1.34 manakai-expanded: false;
10268 wakaba 1.19 }
10269     }
10270     }
10271     @@XMLTest:
10272     @@@QName: xp.element.content.ger.entity.declared.standalone.4.test
10273     @@@DEnt:
10274     @@@@test:value:
10275     <?xml version="1.0" standalone="yes"?>
10276     <!DOCTYPE p [
10277     <!ENTITY % para SYSTEM "para">
10278     %para;
10279     ]>
10280     <p>&entity;</p>
10281     @@@c:erred: <[[xp|wf-entity-declared]]> { (6, 4)..(6, 11); }
10282     @@XMLTest:
10283     @@@QName: xp.element.content.ger.entity.declared.standalone.-3.test
10284     @@@DEnt:
10285     @@@@test:value:
10286     <?xml version="1.0" standalone="no"?>
10287     <!DOCTYPE p [
10288     <!ENTITY % para SYSTEM "para">
10289     %para;
10290     ]>
10291     <p>&entity;</p>
10292     @@@test:domTree:
10293     document {
10294     document-type { }
10295     element {
10296     general-entity-reference {
10297 wakaba 1.34 manakai-expanded: false;
10298 wakaba 1.19 }
10299     }
10300     }
10301     @@XMLTest:
10302     @@@QName: xp.element.content.ger.entity.declared.standalone.-4.test
10303     @@@DEnt:
10304     @@@@test:value:
10305     <!DOCTYPE p [
10306     <!ENTITY % para SYSTEM "para">
10307     %para;
10308     ]>
10309     <p>&entity;</p>
10310     @@@test:domTree:
10311     document {
10312     document-type { }
10313     element {
10314     general-entity-reference {
10315 wakaba 1.34 manakai-expanded: false;
10316 wakaba 1.19 }
10317     }
10318     }
10319     @@XMLTest:
10320     @@@QName: xp.element.content.ger.entity.declared.standalone.5.test
10321     @@@DEnt:
10322     @@@@test:value:
10323     <?xml version="1.0" standalone="yes"?>
10324     <!DOCTYPE p SYSTEM "dtd">
10325     <p>&entity;</p>
10326     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 4)..(3, 11); }
10327     @@XMLTest:
10328     @@@QName: xp.element.content.ger.entity.declared.standalone.-5.test
10329     @@@DEnt:
10330     @@@@test:value:
10331     <?xml version="1.0" standalone="no"?>
10332     <!DOCTYPE p SYSTEM "dtd">
10333     <p>&entity;</p>
10334     @@@test:domTree:
10335     document {
10336     document-type { }
10337     element {
10338     general-entity-reference {
10339 wakaba 1.34 manakai-expanded: false;
10340 wakaba 1.19 }
10341     }
10342     }
10343     @@XMLTest:
10344     @@@QName: xp.element.content.ger.entity.declared.standalone.-6.test
10345     @@@DEnt:
10346     @@@@test:value:
10347     <!DOCTYPE p SYSTEM "dtd">
10348     <p>&entity;</p>
10349     @@@test:domTree:
10350     document {
10351     document-type { }
10352     element {
10353     general-entity-reference {
10354 wakaba 1.34 manakai-expanded: false;
10355 wakaba 1.19 }
10356     }
10357     }
10358    
10359 wakaba 1.20 @@XMLTest:
10360     @@@QName: xp.reptxt.element.content.ger.entity.declared.nopref.1.test
10361     @@@DEnt:
10362     @@@@test:value:
10363     <!DOCTYPE p [
10364     <!ENTITY c "&entity;">
10365     ]>
10366     <p>&c;</p>
10367     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
10368     @@XMLTest:
10369     @@@QName: xp.reptxt.element.content.ger.entity.declared.nopref.2.test
10370     @@@DEnt:
10371     @@@@test:value:
10372     <!DOCTYPE p [
10373     <!ENTITY other "aa">
10374     <!ENTITY % another "aa">
10375     <!ENTITY c "&entity;">
10376     ]>
10377     <p>&c;</p>
10378     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
10379     @@XMLTest:
10380     @@@QName: xp.reptxt.element.content.ger.entity.declared.nopref.3.test
10381     @@@DEnt:
10382     @@@@test:value:
10383     <?xml version="1.0" standalone="yes"?>
10384     <!DOCTYPE p [
10385     <!ENTITY c "&entity;">
10386     ]>
10387     <p>&c;</p>
10388     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
10389     @@XMLTest:
10390     @@@QName: xp.reptxt.element.content.ger.entity.declared.nopref.4.test
10391     @@@DEnt:
10392     @@@@test:value:
10393     <?xml version="1.0" standalone="no"?>
10394     <!DOCTYPE p [
10395     <!ENTITY c "&entity;">
10396     ]>
10397     <p>&c;</p>
10398     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
10399     @@XMLTest:
10400     @@@QName: xp.reptxt.element.content.ger.entity.declared.nopref.5.test
10401     @@@DEnt:
10402     @@@@test:value:
10403     <?xml version="1.0" standalone="yes"?>
10404     <!DOCTYPE p [
10405     <!ENTITY other "aa">
10406     <!ENTITY % another "aa">
10407     <!ENTITY c "&entity;">
10408     ]>
10409     <p>&c;</p>
10410     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
10411     @@XMLTest:
10412     @@@QName: xp.reptxt.element.content.ger.entity.declared.nopref.6.test
10413     @@@DEnt:
10414     @@@@test:value:
10415     <?xml version="1.0" standalone="no"?>
10416     <!DOCTYPE p [
10417     <!ENTITY other "aa">
10418     <!ENTITY % another "aa">
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.nopref.-1.test
10425     @@@DEnt:
10426     @@@@test:value:
10427     <!DOCTYPE p [
10428     <!ENTITY entity "value">
10429     <!ENTITY c "&entity;">
10430     ]>
10431     <p>&c;</p>
10432 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
10433 wakaba 1.20 @@@test:domTree:
10434     document {
10435     document-type {
10436     general-entity {
10437     node-name: 'entity';
10438     text-content: 'value';
10439     }
10440     general-entity {
10441     node-name: 'c';
10442     general-entity-reference {
10443     node-name: 'entity';
10444     text-content: 'value';
10445     }
10446     }
10447     }
10448     element {
10449     general-entity-reference {
10450     node-name: 'c';
10451     general-entity-reference {
10452     node-name: 'entity';
10453     text-content: 'value';
10454     }
10455     }
10456     }
10457     }
10458     @@XMLTest:
10459     @@@QName: xp.reptxt.element.content.ger.entity.declared.nopref.-2.test
10460     @@@DEnt:
10461     @@@@test:value:
10462     <!DOCTYPE p [
10463     <!ENTITY entity "value">
10464     <!ENTITY another SYSTEM "another">
10465     <!ENTITY c "&entity;">
10466     ]>
10467     <p>&c;</p>
10468 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
10469 wakaba 1.20 @@@test:domTree:
10470     document {
10471     document-type {
10472     general-entity {
10473     node-name: 'entity';
10474     text-content: 'value';
10475     }
10476     general-entity {
10477     node-name: 'c';
10478     general-entity-reference {
10479     node-name: 'entity';
10480 wakaba 1.34 manakai-expanded: true;
10481 wakaba 1.20 text-content: 'value';
10482     }
10483     }
10484     general-entity {
10485     node-name: 'another';
10486     public-id: null;
10487     system-id: 'another';
10488     has-replacement-tree: false;
10489     }
10490     }
10491     element {
10492     general-entity-reference {
10493     node-name: 'c';
10494 wakaba 1.34 manakai-expanded: true;
10495 wakaba 1.20 general-entity-reference {
10496     node-name: 'entity';
10497 wakaba 1.34 manakai-expanded: true;
10498 wakaba 1.20 text-content: 'value';
10499     }
10500     }
10501     }
10502     }
10503     @@XMLTest:
10504     @@@QName: xp.reptxt.element.content.ger.entity.declared.standalone.2.test
10505     @@@DEnt:
10506     @@@@test:value:
10507     <?xml version="1.0" standalone="yes"?>
10508     <!DOCTYPE p [
10509     <!ENTITY c "&entity;">
10510     ]>
10511     <p>&c;</p>
10512     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
10513     @@XMLTest:
10514     @@@QName: xp.reptxt.element.content.ger.entity.declared.standalone.3.test
10515     @@@DEnt:
10516     @@@@test:value:
10517     <?xml version="1.0" standalone="yes"?>
10518     <!DOCTYPE p [
10519     <!ENTITY % para "<!-- -->">
10520     %para;
10521     <!ENTITY c "&entity;">
10522     ]>
10523     <p>&c;</p>
10524     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
10525     @@XMLTest:
10526     @@@QName: xp.reptxt.element.content.ger.entity.declared.standalone.-1.test
10527     @@@DEnt:
10528     @@@@test:value:
10529     <?xml version="1.0" standalone="no"?>
10530     <!DOCTYPE p [
10531     <!ENTITY c "&entity;">
10532     <!ENTITY % para "<!-- -->">
10533     %para;
10534     ]>
10535     <p>&c;</p>
10536 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
10537 wakaba 1.20 @@@test:domTree:
10538     document {
10539     document-type {
10540     general-entity {
10541     node-name: 'c';
10542     general-entity-reference {
10543     node-name: 'entity';
10544 wakaba 1.34 manakai-expanded: false;
10545 wakaba 1.20 }
10546     }
10547     }
10548     element {
10549     general-entity-reference {
10550     node-name: 'c';
10551     general-entity-reference {
10552     node-name: 'entity';
10553 wakaba 1.34 manakai-expanded: false;
10554 wakaba 1.20 }
10555     }
10556     }
10557     }
10558     @@XMLTest:
10559     @@@QName:
10560     xp.reptxt.element.content.ger.entity.declared.standalone.-1.2.test
10561     @@@DEnt:
10562     @@@@test:value:
10563     <?xml version="1.0" standalone="no"?>
10564     <!DOCTYPE p [
10565     <!ENTITY % para "<!-- -->">
10566     %para;
10567     <!ENTITY c "&entity;">
10568     ]>
10569     <p>&c;</p>
10570     @@@test:domTree:
10571     document {
10572     document-type { }
10573     element {
10574     general-entity-reference {
10575     node-name: 'c';
10576 wakaba 1.34 manakai-expanded: false;
10577 wakaba 1.20 }
10578     }
10579     }
10580     @@XMLTest:
10581     @@@QName: xp.reptxt.element.content.ger.entity.declared.standalone.-2.test
10582     @@@DEnt:
10583     @@@@test:value:
10584     <!DOCTYPE p [
10585     <!ENTITY c "&entity;">
10586     <!ENTITY % para "<!-- -->">
10587     %para;
10588     ]>
10589     <p>&c;</p>
10590     @@@test:domTree:
10591     document {
10592     document-type { }
10593     element {
10594     general-entity-reference {
10595     node-name: 'c';
10596 wakaba 1.34 manakai-expanded: true;
10597 wakaba 1.20 general-entity-reference {
10598     node-name: 'entity';
10599 wakaba 1.34 manakai-expanded: false;
10600 wakaba 1.20 }
10601     }
10602     }
10603     }
10604     @@XMLTest:
10605     @@@QName:
10606     xp.reptxt.element.content.ger.entity.declared.standalone.-2.2.test
10607     @@@DEnt:
10608     @@@@test:value:
10609     <!DOCTYPE p [
10610     <!ENTITY % para "<!-- -->">
10611     %para;
10612     <!ENTITY c "&entity;">
10613     ]>
10614     <p>&c;</p>
10615     @@@test:domTree:
10616     document {
10617     document-type { }
10618     element {
10619     general-entity-reference {
10620     node-name: 'c';
10621 wakaba 1.34 manakai-expanded: false;
10622 wakaba 1.20 }
10623     }
10624     }
10625     @@XMLTest:
10626     @@@QName: xp.reptxt.element.content.ger.entity.declared.standalone.4.test
10627     @@@DEnt:
10628     @@@@test:value:
10629     <?xml version="1.0" standalone="yes"?>
10630     <!DOCTYPE p [
10631     <!ENTITY % para SYSTEM "para">
10632     %para;
10633     <!ENTITY c "&entity;">
10634     ]>
10635     <p>&c;</p>
10636     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
10637     @@XMLTest:
10638     @@@QName: xp.reptxt.element.content.ger.entity.declared.standalone.-3.test
10639     @@@DEnt:
10640     @@@@test:value:
10641     <?xml version="1.0" standalone="no"?>
10642     <!DOCTYPE p [
10643     <!ENTITY c "&entity;">
10644     <!ENTITY % para SYSTEM "para">
10645     %para;
10646     ]>
10647     <p>&c;</p>
10648     @@@test:domTree:
10649     document {
10650     document-type { }
10651     element {
10652     general-entity-reference {
10653     node-name: 'c';
10654 wakaba 1.34 manakai-expanded: true;
10655 wakaba 1.20 general-entity-reference {
10656     node-name: 'entity';
10657 wakaba 1.34 manakai-expanded: false;
10658 wakaba 1.20 }
10659     }
10660     }
10661     }
10662     @@XMLTest:
10663     @@@QName:
10664     xp.reptxt.element.content.ger.entity.declared.standalone.-3.2.test
10665     @@@DEnt:
10666     @@@@test:value:
10667     <?xml version="1.0" standalone="no"?>
10668     <!DOCTYPE p [
10669     <!ENTITY % para SYSTEM "para">
10670     %para;
10671     <!ENTITY c "&entity;">
10672     ]>
10673     <p>&c;</p>
10674     @@@test:domTree:
10675     document {
10676     document-type { }
10677     element {
10678     general-entity-reference {
10679     node-name: 'c';
10680 wakaba 1.34 manakai-expanded: false;
10681 wakaba 1.20 }
10682     }
10683     }
10684     @@XMLTest:
10685     @@@QName: xp.reptxt.element.content.ger.entity.declared.standalone.-4.test
10686     @@@DEnt:
10687     @@@@test:value:
10688     <!DOCTYPE p [
10689     <!ENTITY c "&entity;">
10690     <!ENTITY % para SYSTEM "para">
10691     %para;
10692     ]>
10693     <p>&c;</p>
10694     @@@test:domTree:
10695     document {
10696     document-type { }
10697     element {
10698     general-entity-reference {
10699     node-name: 'c';
10700 wakaba 1.34 manakai-expanded: true;
10701 wakaba 1.20 general-entity-reference {
10702     node-name: 'entity';
10703 wakaba 1.34 manakai-expanded: false;
10704 wakaba 1.20 }
10705     }
10706     }
10707     }
10708     @@XMLTest:
10709     @@@QName:
10710     xp.reptxt.element.content.ger.entity.declared.standalone.-4.2.test
10711     @@@DEnt:
10712     @@@@test:value:
10713     <!DOCTYPE p [
10714     <!ENTITY % para SYSTEM "para">
10715     %para;
10716     <!ENTITY c "&entity;">
10717     ]>
10718     <p>&c;</p>
10719     @@@test:domTree:
10720     document {
10721     document-type { }
10722     element {
10723     general-entity-reference {
10724     node-name: 'c';
10725 wakaba 1.34 manakai-expanded: false;
10726 wakaba 1.20 }
10727     }
10728     }
10729     @@XMLTest:
10730     @@@QName: xp.reptxt.element.content.ger.entity.declared.standalone.5.test
10731     @@@DEnt:
10732     @@@@test:value:
10733     <?xml version="1.0" standalone="yes"?>
10734     <!DOCTYPE p SYSTEM "dtd" [
10735     <!ENTITY c "&entity;">
10736     ]>
10737     <p>&c;</p>
10738     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
10739     @@XMLTest:
10740     @@@QName: xp.reptxt.element.content.ger.entity.declared.standalone.-5.test
10741     @@@DEnt:
10742     @@@@test:value:
10743     <?xml version="1.0" standalone="no"?>
10744     <!DOCTYPE p SYSTEM "dtd" [
10745     <!ENTITY c "&entity;">
10746     ]>
10747     <p>&c;</p>
10748     @@@test:domTree:
10749     document {
10750     document-type { }
10751     element {
10752     general-entity-reference {
10753     node-name: 'c';
10754 wakaba 1.34 manakai-expanded: true;
10755 wakaba 1.20 general-entity-reference {
10756     node-name: 'entity';
10757 wakaba 1.34 manakai-expanded: false;
10758 wakaba 1.20 }
10759     }
10760     }
10761     }
10762     @@XMLTest:
10763     @@@QName: xp.reptxt.element.content.ger.entity.declared.standalone.-6.test
10764     @@@DEnt:
10765     @@@@test:value:
10766     <!DOCTYPE p SYSTEM "dtd" [<!ENTITY c "&entity;">]>
10767     <p>&c;</p>
10768     @@@test:domTree:
10769     document {
10770     document-type { }
10771     element {
10772     general-entity-reference {
10773     node-name: 'c';
10774 wakaba 1.34 manakai-expanded: true;
10775 wakaba 1.20 general-entity-reference {
10776     node-name: 'entity';
10777 wakaba 1.34 manakai-expanded: false;
10778 wakaba 1.20 }
10779     }
10780     }
10781     }
10782    
10783     @@XMLTest:
10784     @@@QName: xp.attval.ger.entity.declared.nodtd.1.test
10785     @@@DEnt:
10786     @@@@test:value:
10787     <p a="&entity;"/>
10788     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 7)..(1, 14); }
10789     @@XMLTest:
10790     @@@QName: xp.attval.ger.entity.declared.nodtd.2.test
10791     @@@DEnt:
10792     @@@@test:value:
10793     <?xml version="1.0" standalone="yes"?>
10794     <p a="&entity;"/>
10795     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 7)..(2, 14); }
10796     @@XMLTest:
10797     @@@QName: xp.attval.ger.entity.declared.nodtd.3.test
10798     @@@DEnt:
10799     @@@@test:value:
10800     <?xml version="1.0" standalone="no"?>
10801     <p a="&entity;"/>
10802     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 7)..(2, 14); }
10803     @@XMLTest:
10804     @@@QName: xp.attval.ger.entity.declared.nodtd.-1.test
10805     @@@DEnt:
10806     @@@@test:value:
10807     <p a="&lt;&gt;&amp;&quot;&apos;"/>
10808     @@@test:domTree:
10809     document {
10810     element {
10811     attribute {
10812     node-name: 'a';
10813     text-content: '<>&"' U+0027;
10814     }
10815     }
10816     }
10817     @@XMLTest:
10818     @@@QName: xp.attval.ger.entity.declared.nopref.1.test
10819     @@@DEnt:
10820     @@@@test:value:
10821     <!DOCTYPE p []>
10822     <p a="&entity;"/>
10823     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 7)..(2, 14); }
10824     @@XMLTest:
10825     @@@QName: xp.attval.ger.entity.declared.nopref.2.test
10826     @@@DEnt:
10827     @@@@test:value:
10828     <!DOCTYPE p [
10829     <!ENTITY other "aa">
10830     <!ENTITY % another "aa">
10831     ]>
10832     <p a="&entity;"/>
10833     @@@c:erred: <[[xp|wf-entity-declared]]> { (5, 7)..(5, 14); }
10834     @@XMLTest:
10835     @@@QName: xp.attval.ger.entity.declared.nopref.3.test
10836     @@@DEnt:
10837     @@@@test:value:
10838     <?xml version="1.0" standalone="yes"?>
10839     <!DOCTYPE p []>
10840     <p a="&entity;"/>
10841     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 7)..(3, 14); }
10842     @@XMLTest:
10843     @@@QName: xp.attval.ger.entity.declared.nopref.4.test
10844     @@@DEnt:
10845     @@@@test:value:
10846     <?xml version="1.0" standalone="no"?>
10847     <!DOCTYPE p []>
10848     <p a="&entity;"/>
10849     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 7)..(3, 14); }
10850     @@XMLTest:
10851     @@@QName: xp.attval.ger.entity.declared.nopref.5.test
10852     @@@DEnt:
10853     @@@@test:value:
10854     <?xml version="1.0" standalone="yes"?>
10855     <!DOCTYPE p [
10856     <!ENTITY other "aa">
10857     <!ENTITY % another "aa">
10858     ]>
10859     <p a="&entity;"/>
10860     @@@c:erred: <[[xp|wf-entity-declared]]> { (6, 7)..(6, 14); }
10861     @@XMLTest:
10862     @@@QName: xp.attval.ger.entity.declared.nopref.6.test
10863     @@@DEnt:
10864     @@@@test:value:
10865     <?xml version="1.0" standalone="no"?>
10866     <!DOCTYPE p [
10867     <!ENTITY other "aa">
10868     <!ENTITY % another "aa">
10869     ]>
10870     <p a="&entity;"/>
10871     @@@c:erred: <[[xp|wf-entity-declared]]> { (6, 7)..(6, 14); }
10872     @@XMLTest:
10873     @@@QName: xp.attval.ger.entity.declared.nopref.-1.test
10874     @@@DEnt:
10875     @@@@test:value:
10876     <!DOCTYPE p [
10877     <!ENTITY entity "value">
10878     ]>
10879     <p a="&entity;"/>
10880 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
10881 wakaba 1.20 @@@test:domTree:
10882     document {
10883     document-type {
10884     general-entity {
10885     node-name: 'entity';
10886     text-content: 'value';
10887     }
10888     }
10889     element {
10890     attribute {
10891     node-name: 'a';
10892     general-entity-reference {
10893     node-name: 'entity';
10894 wakaba 1.34 manakai-expanded: true;
10895 wakaba 1.20 text-content: 'value';
10896     }
10897     }
10898     }
10899     }
10900     @@XMLTest:
10901     @@@QName: xp.attval.ger.entity.declared.nopref.-2.test
10902     @@@DEnt:
10903     @@@@test:value:
10904     <!DOCTYPE p [
10905     <!ENTITY entity "value">
10906     <!ENTITY another SYSTEM "another">
10907     ]>
10908     <p a="&entity;"/>
10909 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
10910 wakaba 1.20 @@@test:domTree:
10911     document {
10912     document-type {
10913     general-entity {
10914     node-name: 'entity';
10915     text-content: 'value';
10916     has-replacement-tree: true;
10917     }
10918     general-entity {
10919     node-name: 'another';
10920     public-id: null;
10921     system-id: 'another';
10922     has-replacement-tree: false;
10923     }
10924     }
10925     element {
10926     attribute {
10927     node-name: 'a';
10928     general-entity-reference {
10929     node-name: 'entity';
10930 wakaba 1.34 manakai-expanded: true;
10931 wakaba 1.20 text-content: 'value';
10932     }
10933     }
10934     }
10935     }
10936     @@XMLTest:
10937     @@@QName: xp.attval.ger.entity.declared.standalone.1.test
10938     @@@DEnt:
10939     @@@@test:value:
10940     <?xml version="1.0" standalone="yes"?>
10941     <p a="&entity;"/>
10942     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 7)..(2, 14); }
10943     @@XMLTest:
10944     @@@QName: xp.attval.ger.entity.declared.standalone.2.test
10945     @@@DEnt:
10946     @@@@test:value:
10947     <?xml version="1.0" standalone="yes"?>
10948     <!DOCTYPE p []>
10949     <p a="&entity;"/>
10950     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 7)..(3, 14); }
10951     @@XMLTest:
10952     @@@QName: xp.attval.ger.entity.declared.standalone.3.test
10953     @@@DEnt:
10954     @@@@test:value:
10955     <?xml version="1.0" standalone="yes"?>
10956     <!DOCTYPE p [
10957     <!ENTITY % para "<!-- -->">
10958     %para;
10959     ]>
10960     <p a="&entity;"/>
10961     @@@c:erred: <[[xp|wf-entity-declared]]> { (6, 7)..(6, 14); }
10962     @@XMLTest:
10963     @@@QName: xp.attval.ger.entity.declared.standalone.-1.test
10964     @@@DEnt:
10965     @@@@test:value:
10966     <?xml version="1.0" standalone="no"?>
10967     <!DOCTYPE p [
10968     <!ENTITY % para "<!-- -->">
10969     %para;
10970     ]>
10971     <p a="&entity;"/>
10972     @@@test:domTree:
10973     document {
10974     document-type { }
10975     element {
10976     attribute {
10977     node-name: 'a';
10978     general-entity-reference {
10979 wakaba 1.34 manakai-expanded: false;
10980 wakaba 1.20 }
10981     }
10982     }
10983     }
10984     @@XMLTest:
10985     @@@QName: xp.attval.ger.entity.declared.standalone.-2.test
10986     @@@DEnt:
10987     @@@@test:value:
10988     <!DOCTYPE p [
10989     <!ENTITY % para "<!-- -->">
10990     %para;
10991     ]>
10992     <p a="&entity;"/>
10993     @@@test:domTree:
10994     document {
10995     document-type { }
10996     element {
10997     attribute {
10998     node-name: 'a';
10999     general-entity-reference {
11000 wakaba 1.34 manakai-expanded: false;
11001 wakaba 1.20 }
11002     }
11003     }
11004     }
11005     @@XMLTest:
11006     @@@QName: xp.attval.ger.entity.declared.standalone.4.test
11007     @@@DEnt:
11008     @@@@test:value:
11009     <?xml version="1.0" standalone="yes"?>
11010     <!DOCTYPE p [
11011     <!ENTITY % para SYSTEM "para">
11012     %para;
11013     ]>
11014     <p a="&entity;"/>
11015     @@@c:erred: <[[xp|wf-entity-declared]]> { (6, 7)..(6, 14); }
11016     @@XMLTest:
11017     @@@QName: xp.attval.ger.entity.declared.standalone.-3.test
11018     @@@DEnt:
11019     @@@@test:value:
11020     <?xml version="1.0" standalone="no"?>
11021     <!DOCTYPE p [
11022     <!ENTITY % para SYSTEM "para">
11023     %para;
11024     ]>
11025     <p a="&entity;"/>
11026     @@@test:domTree:
11027     document {
11028     document-type { }
11029     element {
11030     attribute {
11031     node-name: 'a';
11032     general-entity-reference {
11033 wakaba 1.34 manakai-expanded: false;
11034 wakaba 1.20 }
11035     }
11036     }
11037     }
11038     @@XMLTest:
11039     @@@QName: xp.attval.ger.entity.declared.standalone.-4.test
11040     @@@DEnt:
11041     @@@@test:value:
11042     <!DOCTYPE p [
11043     <!ENTITY % para SYSTEM "para">
11044     %para;
11045     ]>
11046     <p a="&entity;"/>
11047     @@@test:domTree:
11048     document {
11049     document-type { }
11050     element {
11051     attribute {
11052     node-name: 'a';
11053     general-entity-reference {
11054 wakaba 1.34 manakai-expanded: false;
11055 wakaba 1.20 }
11056     }
11057     }
11058     }
11059     @@XMLTest:
11060     @@@QName: xp.attval.ger.entity.declared.standalone.5.test
11061     @@@DEnt:
11062     @@@@test:value:
11063     <?xml version="1.0" standalone="yes"?>
11064     <!DOCTYPE p SYSTEM "dtd">
11065     <p a="&entity;"/>
11066     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 7)..(3, 14); }
11067     @@XMLTest:
11068     @@@QName: xp.attval.ger.entity.declared.standalone.-5.test
11069     @@@DEnt:
11070     @@@@test:value:
11071     <?xml version="1.0" standalone="no"?>
11072     <!DOCTYPE p SYSTEM "dtd">
11073     <p a="&entity;"/>
11074     @@@test:domTree:
11075     document {
11076     document-type { }
11077     element {
11078     attribute {
11079     node-name: 'a';
11080     general-entity-reference {
11081 wakaba 1.34 manakai-expanded: false;
11082 wakaba 1.20 }
11083     }
11084     }
11085     }
11086     @@XMLTest:
11087     @@@QName: xp.attval.ger.entity.declared.standalone.-6.test
11088     @@@DEnt:
11089     @@@@test:value:
11090     <!DOCTYPE p SYSTEM "dtd">
11091     <p a="&entity;"/>
11092     @@@test:domTree:
11093     document {
11094     document-type { }
11095     element {
11096     attribute {
11097     node-name: 'a';
11098     general-entity-reference {
11099 wakaba 1.34 manakai-expanded: false;
11100 wakaba 1.20 }
11101     }
11102     }
11103     }
11104    
11105 wakaba 1.21 @@XMLTest:
11106 wakaba 1.22 @@@QName: xp.reptxt.attval.ger.entity.declared.nopref.1.test
11107 wakaba 1.21 @@@DEnt:
11108     @@@@test:value:
11109     <!DOCTYPE p [
11110 wakaba 1.22 <!ENTITY c "&entity;">
11111 wakaba 1.21 ]>
11112 wakaba 1.22 <p a="&c;"/>
11113     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11114 wakaba 1.21 @@XMLTest:
11115 wakaba 1.22 @@@QName: xp.reptxt.attval.ger.entity.declared.nopref.2.test
11116 wakaba 1.21 @@@DEnt:
11117     @@@@test:value:
11118     <!DOCTYPE p [
11119     <!ENTITY other "aa">
11120     <!ENTITY % another "aa">
11121 wakaba 1.22 <!ENTITY c "&entity;">
11122 wakaba 1.21 ]>
11123 wakaba 1.22 <p a="&c;"/>
11124     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11125 wakaba 1.21 @@XMLTest:
11126 wakaba 1.22 @@@QName: xp.reptxt.attval.ger.entity.declared.nopref.3.test
11127 wakaba 1.21 @@@DEnt:
11128     @@@@test:value:
11129     <?xml version="1.0" standalone="yes"?>
11130     <!DOCTYPE p [
11131 wakaba 1.22 <!ENTITY c "&entity;">
11132 wakaba 1.21 ]>
11133 wakaba 1.22 <p a="&c;"/>
11134     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11135 wakaba 1.21 @@XMLTest:
11136 wakaba 1.22 @@@QName: xp.reptxt.attval.ger.entity.declared.nopref.4.test
11137 wakaba 1.21 @@@DEnt:
11138     @@@@test:value:
11139     <?xml version="1.0" standalone="no"?>
11140     <!DOCTYPE p [
11141 wakaba 1.22 <!ENTITY c "&entity;">
11142 wakaba 1.21 ]>
11143 wakaba 1.22 <p a="&c;"/>
11144     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11145 wakaba 1.21 @@XMLTest:
11146 wakaba 1.22 @@@QName: xp.reptxt.attval.ger.entity.declared.nopref.5.test
11147 wakaba 1.21 @@@DEnt:
11148     @@@@test:value:
11149     <?xml version="1.0" standalone="yes"?>
11150     <!DOCTYPE p [
11151     <!ENTITY other "aa">
11152     <!ENTITY % another "aa">
11153 wakaba 1.22 <!ENTITY c "&entity;">
11154 wakaba 1.21 ]>
11155 wakaba 1.22 <p a="&c;"/>
11156     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11157 wakaba 1.21 @@XMLTest:
11158 wakaba 1.22 @@@QName: xp.reptxt.attval.ger.entity.declared.nopref.6.test
11159 wakaba 1.21 @@@DEnt:
11160     @@@@test:value:
11161     <?xml version="1.0" standalone="no"?>
11162     <!DOCTYPE p [
11163     <!ENTITY other "aa">
11164     <!ENTITY % another "aa">
11165 wakaba 1.22 <!ENTITY c "&entity;">
11166 wakaba 1.21 ]>
11167 wakaba 1.22 <p a="&c;"/>
11168     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11169 wakaba 1.21 @@XMLTest:
11170 wakaba 1.22 @@@QName: xp.reptxt.attval.ger.entity.declared.nopref.-1.test
11171 wakaba 1.21 @@@DEnt:
11172     @@@@test:value:
11173     <!DOCTYPE p [
11174     <!ENTITY entity "value">
11175 wakaba 1.22 <!ENTITY c "&entity;">
11176 wakaba 1.21 ]>
11177 wakaba 1.22 <p a="&c;"/>
11178 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
11179 wakaba 1.21 @@@test:domTree:
11180     document {
11181     document-type {
11182     general-entity {
11183     node-name: 'entity';
11184     text-content: 'value';
11185     }
11186 wakaba 1.22 general-entity {
11187     node-name: 'c';
11188     general-entity-reference {
11189     node-name: 'entity';
11190     text-content: 'value';
11191 wakaba 1.21 }
11192     }
11193     }
11194     element {
11195     attribute {
11196     node-name: 'a';
11197     general-entity-reference {
11198 wakaba 1.22 node-name: 'c';
11199     general-entity-reference {
11200     node-name: 'entity';
11201     text-content: 'value';
11202     }
11203 wakaba 1.21 }
11204     }
11205     }
11206     }
11207     @@XMLTest:
11208 wakaba 1.22 @@@QName: xp.reptxt.attval.ger.entity.declared.nopref.-2.test
11209 wakaba 1.21 @@@DEnt:
11210     @@@@test:value:
11211     <!DOCTYPE p [
11212     <!ENTITY entity "value">
11213     <!ENTITY another SYSTEM "another">
11214 wakaba 1.22 <!ENTITY c "&entity;">
11215 wakaba 1.21 ]>
11216 wakaba 1.22 <p a="&c;"/>
11217 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
11218 wakaba 1.21 @@@test:domTree:
11219     document {
11220     document-type {
11221     general-entity {
11222     node-name: 'entity';
11223     text-content: 'value';
11224 wakaba 1.22 }
11225     general-entity {
11226     node-name: 'c';
11227     general-entity-reference {
11228     node-name: 'entity';
11229     text-content: 'value';
11230     }
11231 wakaba 1.21 }
11232     general-entity {
11233     node-name: 'another';
11234     public-id: null;
11235     system-id: 'another';
11236     has-replacement-tree: false;
11237     }
11238     }
11239     element {
11240     attribute {
11241     node-name: 'a';
11242     general-entity-reference {
11243 wakaba 1.22 node-name: 'c';
11244     general-entity-reference {
11245     node-name: 'entity';
11246     text-content: 'value';
11247     }
11248 wakaba 1.21 }
11249     }
11250     }
11251     }
11252     @@XMLTest:
11253 wakaba 1.22 @@@QName: xp.reptxt.attval.ger.entity.declared.standalone.2.test
11254 wakaba 1.21 @@@DEnt:
11255     @@@@test:value:
11256     <?xml version="1.0" standalone="yes"?>
11257     <!DOCTYPE p [
11258 wakaba 1.22 <!ENTITY c "&entity;">
11259 wakaba 1.21 ]>
11260 wakaba 1.22 <p a="&c;"/>
11261     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11262 wakaba 1.21 @@XMLTest:
11263 wakaba 1.22 @@@QName: xp.reptxt.attval.ger.entity.declared.standalone.3.test
11264 wakaba 1.21 @@@DEnt:
11265     @@@@test:value:
11266     <?xml version="1.0" standalone="yes"?>
11267     <!DOCTYPE p [
11268     <!ENTITY % para "<!-- -->">
11269     %para;
11270 wakaba 1.22 <!ENTITY c "&entity;">
11271 wakaba 1.21 ]>
11272 wakaba 1.22 <p a="&c;"/>
11273     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11274 wakaba 1.21 @@XMLTest:
11275 wakaba 1.22 @@@QName: xp.reptxt.attval.ger.entity.declared.standalone.-1.test
11276 wakaba 1.21 @@@DEnt:
11277     @@@@test:value:
11278 wakaba 1.22 <?xml version="1.0" standalone="no"?>
11279 wakaba 1.21 <!DOCTYPE p [
11280 wakaba 1.22 <!ENTITY c "&entity;">
11281 wakaba 1.21 <!ENTITY % para "<!-- -->">
11282     %para;
11283     ]>
11284 wakaba 1.22 <p a="&c;"/>
11285 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
11286 wakaba 1.22 @@@test:domTree:
11287     document {
11288     document-type {
11289     general-entity {
11290     node-name: 'c';
11291     general-entity-reference {
11292     node-name: 'entity';
11293 wakaba 1.34 manakai-expanded: false;
11294 wakaba 1.22 }
11295     }
11296     }
11297     element {
11298     attribute {
11299     node-name: 'a';
11300     general-entity-reference {
11301     node-name: 'c';
11302     general-entity-reference {
11303     node-name: 'entity';
11304 wakaba 1.34 manakai-expanded: false;
11305 wakaba 1.22 }
11306     }
11307     }
11308     }
11309     }
11310 wakaba 1.21 @@XMLTest:
11311 wakaba 1.22 @@@QName:
11312     xp.reptxt.attval.ger.entity.declared.standalone.-1.2.test
11313 wakaba 1.21 @@@DEnt:
11314     @@@@test:value:
11315     <?xml version="1.0" standalone="no"?>
11316     <!DOCTYPE p [
11317     <!ENTITY % para "<!-- -->">
11318     %para;
11319 wakaba 1.22 <!ENTITY c "&entity;">
11320 wakaba 1.21 ]>
11321 wakaba 1.22 <p a="&c;"/>
11322     @@@test:domTree:
11323     document {
11324     document-type { }
11325     element {
11326     attribute {
11327     node-name: 'a';
11328     general-entity-reference {
11329     node-name: 'c';
11330 wakaba 1.34 manakai-expanded: false;
11331 wakaba 1.22 }
11332     }
11333     }
11334     }
11335 wakaba 1.21 @@XMLTest:
11336 wakaba 1.22 @@@QName: xp.reptxt.attval.ger.entity.declared.standalone.-2.test
11337 wakaba 1.21 @@@DEnt:
11338     @@@@test:value:
11339     <!DOCTYPE p [
11340 wakaba 1.22 <!ENTITY c "&entity;">
11341     <!ENTITY % para "<!-- -->">
11342     %para;
11343     ]>
11344     <p a="&c;"/>
11345     @@@test:domTree:
11346     document {
11347     document-type { }
11348     element {
11349     attribute {
11350     node-name: 'a';
11351     general-entity-reference {
11352     node-name: 'c';
11353 wakaba 1.34 manakai-expanded: true;
11354 wakaba 1.22 general-entity-reference {
11355     node-name: 'entity';
11356 wakaba 1.34 manakai-expanded: false;
11357 wakaba 1.22 }
11358     }
11359     }
11360     }
11361     }
11362     @@XMLTest:
11363     @@@QName:
11364     xp.reptxt.attval.ger.entity.declared.standalone.-2.2.test
11365     @@@DEnt:
11366     @@@@test:value:
11367     <!DOCTYPE p [
11368     <!ENTITY % para "<!-- -->">
11369     %para;
11370     <!ENTITY c "&entity;">
11371     ]>
11372     <p a="&c;"/>
11373     @@@test:domTree:
11374     document {
11375     document-type { }
11376     element {
11377     attribute {
11378     node-name: 'a';
11379     general-entity-reference {
11380     node-name: 'c';
11381 wakaba 1.34 manakai-expanded: false;
11382 wakaba 1.22 }
11383     }
11384     }
11385     }
11386     @@XMLTest:
11387     @@@QName: xp.reptxt.attval.ger.entity.declared.standalone.4.test
11388     @@@DEnt:
11389     @@@@test:value:
11390     <?xml version="1.0" standalone="yes"?>
11391     <!DOCTYPE p [
11392     <!ENTITY % para SYSTEM "para">
11393     %para;
11394     <!ENTITY c "&entity;">
11395     ]>
11396     <p a="&c;"/>
11397     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11398     @@XMLTest:
11399     @@@QName: xp.reptxt.attval.ger.entity.declared.standalone.-3.test
11400     @@@DEnt:
11401     @@@@test:value:
11402     <?xml version="1.0" standalone="no"?>
11403     <!DOCTYPE p [
11404     <!ENTITY c "&entity;">
11405     <!ENTITY % para SYSTEM "para">
11406     %para;
11407     ]>
11408     <p a="&c;"/>
11409     @@@test:domTree:
11410     document {
11411     document-type { }
11412     element {
11413     attribute {
11414     node-name: 'a';
11415     general-entity-reference {
11416     node-name: 'c';
11417 wakaba 1.34 manakai-expanded: true;
11418 wakaba 1.22 general-entity-reference {
11419     node-name: 'entity';
11420 wakaba 1.34 manakai-expanded: false;
11421 wakaba 1.22 }
11422     }
11423     }
11424     }
11425     }
11426     @@XMLTest:
11427     @@@QName:
11428     xp.reptxt.attval.ger.entity.declared.standalone.-3.2.test
11429     @@@DEnt:
11430     @@@@test:value:
11431     <?xml version="1.0" standalone="no"?>
11432     <!DOCTYPE p [
11433     <!ENTITY % para SYSTEM "para">
11434     %para;
11435     <!ENTITY c "&entity;">
11436     ]>
11437     <p a="&c;"/>
11438     @@@test:domTree:
11439     document {
11440     document-type { }
11441     element {
11442     attribute {
11443     node-name: 'a';
11444     general-entity-reference {
11445     node-name: 'c';
11446 wakaba 1.34 manakai-expanded: false;
11447 wakaba 1.22 }
11448     }
11449     }
11450     }
11451     @@XMLTest:
11452     @@@QName: xp.reptxt.attval.ger.entity.declared.standalone.-4.test
11453     @@@DEnt:
11454     @@@@test:value:
11455     <!DOCTYPE p [
11456     <!ENTITY c "&entity;">
11457     <!ENTITY % para SYSTEM "para">
11458     %para;
11459     ]>
11460     <p a="&c;"/>
11461     @@@test:domTree:
11462     document {
11463     document-type { }
11464     element {
11465     attribute {
11466     node-name: 'a';
11467     general-entity-reference {
11468     node-name: 'c';
11469 wakaba 1.34 manakai-expanded: true;
11470 wakaba 1.22 general-entity-reference {
11471     node-name: 'entity';
11472 wakaba 1.34 manakai-expanded: false;
11473 wakaba 1.22 }
11474     }
11475     }
11476     }
11477     }
11478     @@XMLTest:
11479     @@@QName:
11480     xp.reptxt.attval.ger.entity.declared.standalone.-4.2.test
11481     @@@DEnt:
11482     @@@@test:value:
11483     <!DOCTYPE p [
11484     <!ENTITY % para SYSTEM "para">
11485     %para;
11486     <!ENTITY c "&entity;">
11487     ]>
11488     <p a="&c;"/>
11489     @@@test:domTree:
11490     document {
11491     document-type { }
11492     element {
11493     attribute {
11494     node-name: 'a';
11495     general-entity-reference {
11496     node-name: 'c';
11497 wakaba 1.34 manakai-expanded: false;
11498 wakaba 1.22 }
11499     }
11500     }
11501     }
11502     @@XMLTest:
11503     @@@QName: xp.reptxt.attval.ger.entity.declared.standalone.5.test
11504     @@@DEnt:
11505     @@@@test:value:
11506     <?xml version="1.0" standalone="yes"?>
11507     <!DOCTYPE p SYSTEM "dtd" [
11508     <!ENTITY c "&entity;">
11509     ]>
11510     <p a="&c;"/>
11511     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11512     @@XMLTest:
11513     @@@QName: xp.reptxt.attval.ger.entity.declared.standalone.-5.test
11514     @@@DEnt:
11515     @@@@test:value:
11516     <?xml version="1.0" standalone="no"?>
11517     <!DOCTYPE p SYSTEM "dtd" [
11518     <!ENTITY c "&entity;">
11519     ]>
11520     <p a="&c;"/>
11521     @@@test:domTree:
11522     document {
11523     document-type { }
11524     element {
11525     attribute {
11526     node-name: 'a';
11527     general-entity-reference {
11528     node-name: 'c';
11529 wakaba 1.34 manakai-expanded: true;
11530 wakaba 1.22 general-entity-reference {
11531     node-name: 'entity';
11532 wakaba 1.34 manakai-expanded: false;
11533 wakaba 1.22 }
11534     }
11535     }
11536     }
11537     }
11538     @@XMLTest:
11539     @@@QName: xp.reptxt.attval.ger.entity.declared.standalone.-6.test
11540     @@@DEnt:
11541     @@@@test:value:
11542     <!DOCTYPE p SYSTEM "dtd" [<!ENTITY c "&entity;">]>
11543     <p a="&c;"/>
11544     @@@test:domTree:
11545     document {
11546     document-type { }
11547     element {
11548     attribute {
11549     node-name: 'a';
11550     general-entity-reference {
11551     node-name: 'c';
11552 wakaba 1.34 manakai-expanded: true;
11553 wakaba 1.22 general-entity-reference {
11554     node-name: 'entity';
11555 wakaba 1.34 manakai-expanded: false;
11556 wakaba 1.22 }
11557     }
11558     }
11559     }
11560     }
11561    
11562     @@XMLTest:
11563     @@@QName: xp.attlist.dup.entity.declared.1.test
11564     @@@DEnt:
11565     @@@@test:value:
11566     <!DOCTYPE p [
11567     <!ATTLIST p a CDATA "no-entity">
11568     <!ATTLIST p a CDATA "&entity;">
11569     ]>
11570     <p/>
11571     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 21)..(3, 29); }
11572     @@XMLTest:
11573     @@@QName: xp.attlist.dup.entity.declared.2.test
11574     @@@DEnt:
11575     @@@@test:value:
11576     <!DOCTYPE p [
11577     <!ATTLIST p a CDATA "no-entity"
11578     a CDATA "&entity;">
11579     ]>
11580     <p/>
11581     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 21)..(3, 29); }
11582     @@XMLTest:
11583     @@@QName: xp.attlist.unused.entity.declared.1.test
11584     @@@DEnt:
11585     @@@@test:value:
11586     <!DOCTYPE p [
11587     <!ATTLIST q a CDATA "&entity;">
11588     ]>
11589     <p/>
11590     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 21)..(2, 29); }
11591     @@XMLTest:
11592     @@@QName: xp.attlist.unused.entity.declared.2.test
11593     @@@DEnt:
11594     @@@@test:value:
11595     <!DOCTYPE p [
11596     <!ATTLIST p a CDATA "&entity;">
11597     ]>
11598     <p a="bb"/>
11599     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 21)..(2, 29); }
11600    
11601     @@XMLTest:
11602     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.nopref.1.test
11603     @@@DEnt:
11604     @@@@test:value:
11605     <!DOCTYPE p [
11606     <!ENTITY c "&entity;">
11607     <!ATTLIST p a CDATA "&c;">
11608     ]>
11609     <p/>
11610     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11611     @@XMLTest:
11612     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.nopref.2.test
11613     @@@DEnt:
11614     @@@@test:value:
11615     <!DOCTYPE p [
11616     <!ENTITY other "aa">
11617     <!ENTITY % another "aa">
11618     <!ENTITY c "&entity;">
11619     <!ATTLIST p a CDATA "&c;">
11620     ]>
11621     <p/>
11622     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11623     @@XMLTest:
11624     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.nopref.3.test
11625     @@@DEnt:
11626     @@@@test:value:
11627     <?xml version="1.0" standalone="yes"?>
11628     <!DOCTYPE p [
11629     <!ENTITY c "&entity;">
11630     <!ATTLIST p a CDATA "&c;">
11631     ]>
11632     <p/>
11633     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11634     @@XMLTest:
11635     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.nopref.4.test
11636     @@@DEnt:
11637     @@@@test:value:
11638     <?xml version="1.0" standalone="no"?>
11639     <!DOCTYPE p [
11640     <!ENTITY c "&entity;">
11641     <!ATTLIST p a CDATA "&c;">
11642     ]>
11643     <p/>
11644     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11645     @@XMLTest:
11646     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.nopref.5.test
11647     @@@DEnt:
11648     @@@@test:value:
11649     <?xml version="1.0" standalone="yes"?>
11650     <!DOCTYPE p [
11651     <!ENTITY other "aa">
11652     <!ENTITY % another "aa">
11653     <!ENTITY c "&entity;">
11654     <!ATTLIST p a CDATA "&c;">
11655     ]>
11656     <p/>
11657     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11658     @@XMLTest:
11659     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.nopref.6.test
11660     @@@DEnt:
11661     @@@@test:value:
11662     <?xml version="1.0" standalone="no"?>
11663     <!DOCTYPE p [
11664     <!ENTITY other "aa">
11665     <!ENTITY % another "aa">
11666     <!ENTITY c "&entity;">
11667     <!ATTLIST p a CDATA "&c;">
11668     ]>
11669     <p/>
11670     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11671     @@XMLTest:
11672     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.nopref.-1.test
11673     @@@DEnt:
11674     @@@@test:value:
11675     <!DOCTYPE p [
11676     <!ENTITY entity "value">
11677     <!ENTITY c "&entity;">
11678     <!ATTLIST p a CDATA "&c;">
11679     ]>
11680     <p/>
11681 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
11682 wakaba 1.22 @@@test:domTree:
11683     document {
11684     document-type {
11685     general-entity {
11686     node-name: 'entity';
11687     text-content: 'value';
11688     }
11689     general-entity {
11690     node-name: 'c';
11691     general-entity-reference {
11692     node-name: 'entity';
11693 wakaba 1.34 manakai-expanded: true;
11694 wakaba 1.22 text-content: 'value';
11695     }
11696     }
11697     element-type-definition {
11698     node-name: 'p';
11699     attribute-definition {
11700     node-name: 'a';
11701     general-entity-reference {
11702     node-name: 'c';
11703 wakaba 1.34 manakai-expanded: true;
11704 wakaba 1.22 general-entity-reference {
11705     node-name: 'entity';
11706 wakaba 1.34 manakai-expanded: true;
11707 wakaba 1.22 text-content: 'value';
11708     }
11709     }
11710     }
11711     }
11712     }
11713     element {
11714     attribute {
11715     node-name: 'a';
11716     specified: false;
11717     general-entity-reference {
11718     node-name: 'c';
11719     general-entity-reference {
11720     node-name: 'entity';
11721     text-content: 'value';
11722     }
11723     }
11724     }
11725     }
11726     }
11727     @@XMLTest:
11728     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.nopref.-2.test
11729     @@@DEnt:
11730     @@@@test:value:
11731     <!DOCTYPE p [
11732     <!ENTITY entity "value">
11733     <!ENTITY another SYSTEM "another">
11734     <!ENTITY c "&entity;">
11735     <!ATTLIST p a CDATA "&c;">
11736     ]>
11737     <p/>
11738 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
11739 wakaba 1.22 @@@test:domTree:
11740     document {
11741     document-type {
11742     general-entity {
11743     node-name: 'entity';
11744     text-content: 'value';
11745     }
11746     general-entity {
11747     node-name: 'c';
11748     general-entity-reference {
11749     node-name: 'entity';
11750     text-content: 'value';
11751     }
11752     }
11753     general-entity {
11754     node-name: 'another';
11755     public-id: null;
11756     system-id: 'another';
11757     has-replacement-tree: false;
11758     }
11759     element-type-definition {
11760     node-name: 'p';
11761     attribute-definition {
11762     node-name: 'a';
11763     general-entity-reference {
11764     node-name: 'c';
11765 wakaba 1.34 manakai-expanded: true;
11766 wakaba 1.22 general-entity-reference {
11767     node-name: 'entity';
11768 wakaba 1.34 manakai-expanded: true;
11769 wakaba 1.22 text-content: 'value';
11770     }
11771     }
11772     }
11773     }
11774     }
11775     element {
11776     attribute {
11777     node-name: 'a';
11778     specified: false;
11779     general-entity-reference {
11780     node-name: 'c';
11781     general-entity-reference {
11782     node-name: 'entity';
11783     text-content: 'value';
11784     }
11785     }
11786     }
11787     }
11788     }
11789     @@XMLTest:
11790     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.standalone.2.test
11791     @@@DEnt:
11792     @@@@test:value:
11793     <?xml version="1.0" standalone="yes"?>
11794     <!DOCTYPE p [
11795     <!ENTITY c "&entity;">
11796     <!ATTLIST p a CDATA "&c;">
11797     ]>
11798     <p/>
11799     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11800     @@XMLTest:
11801     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.standalone.3.test
11802     @@@DEnt:
11803     @@@@test:value:
11804     <?xml version="1.0" standalone="yes"?>
11805     <!DOCTYPE p [
11806     <!ENTITY % para "<!-- -->">
11807     %para;
11808     <!ENTITY c "&entity;">
11809     <!ATTLIST p a CDATA "&c;">
11810     ]>
11811     <p/>
11812     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11813     @@XMLTest:
11814     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.standalone.-1.test
11815     @@@DEnt:
11816     @@@@test:value:
11817     <?xml version="1.0" standalone="no"?>
11818     <!DOCTYPE p [
11819     <!ENTITY c "&entity;">
11820     <!ATTLIST p a CDATA "&c;">
11821     <!ENTITY % para "<!-- -->">
11822     %para;
11823     ]>
11824     <p/>
11825     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11826     @@XMLTest:
11827     @@@QName:
11828     xp.reptxt.attlist.attval.ger.entity.declared.standalone.-1.2.test
11829     @@@DEnt:
11830     @@@@test:value:
11831     <?xml version="1.0" standalone="no"?>
11832     <!DOCTYPE p [
11833     <!ENTITY % para "<!-- -->">
11834     %para;
11835     <!ENTITY c "&entity;">
11836     <!ATTLIST p a CDATA "&c;">
11837     ]>
11838     <p g="h"/>
11839     @@@test:domTree:
11840     document {
11841     document-type { }
11842     element {
11843     attribute {
11844     node-name: 'g';
11845     text-content: 'h';
11846     }
11847     }
11848     }
11849     @@XMLTest:
11850     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.standalone.-2.test
11851     @@@DEnt:
11852     @@@@test:value:
11853     <!DOCTYPE p [
11854     <!ENTITY c "&entity;">
11855     <!ATTLIST p a CDATA "&c;">
11856     <!ENTITY % para "<!-- -->">
11857     %para;
11858     ]>
11859     <p/>
11860     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11861     @@XMLTest:
11862     @@@QName:
11863     xp.reptxt.attlist.attval.ger.entity.declared.standalone.-2.2.test
11864     @@@DEnt:
11865     @@@@test:value:
11866     <!DOCTYPE p [
11867     <!ENTITY % para "<!-- -->">
11868     %para;
11869     <!ENTITY c "&entity;">
11870     <!ATTLIST p a CDATA "&c;">
11871     ]>
11872     <p g="h"/>
11873     @@@test:domTree:
11874     document {
11875     document-type { }
11876     element {
11877     attribute {
11878     node-name: 'g';
11879     text-content: 'h';
11880     }
11881     }
11882     }
11883     @@XMLTest:
11884     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.standalone.4.test
11885     @@@DEnt:
11886     @@@@test:value:
11887     <?xml version="1.0" standalone="yes"?>
11888     <!DOCTYPE p [
11889     <!ENTITY % para SYSTEM "para">
11890     %para;
11891     <!ENTITY c "&entity;">
11892     <!ATTLIST p a CDATA "&c;">
11893     ]>
11894     <p/>
11895     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11896     @@XMLTest:
11897     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.standalone.-3.test
11898     @@@DEnt:
11899     @@@@test:value:
11900     <?xml version="1.0" standalone="no"?>
11901     <!DOCTYPE p [
11902     <!ENTITY c "&entity;">
11903     <!ATTLIST p a CDATA "&c;">
11904     <!ENTITY % para SYSTEM "para">
11905     %para;
11906     ]>
11907     <p/>
11908     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11909     @@XMLTest:
11910     @@@QName:
11911     xp.reptxt.attlist.attval.ger.entity.declared.standalone.-3.2.test
11912     @@@DEnt:
11913     @@@@test:value:
11914     <?xml version="1.0" standalone="no"?>
11915     <!DOCTYPE p [
11916     <!ENTITY % para SYSTEM "para">
11917     %para;
11918     <!ENTITY c "&entity;">
11919     <!ATTLIST p a CDATA "&c;">
11920     ]>
11921     <p g="h"/>
11922     @@@test:domTree:
11923     document {
11924     document-type { }
11925     element {
11926     attribute {
11927     node-name: 'g';
11928     text-content: 'h';
11929     }
11930     }
11931     }
11932     @@XMLTest:
11933     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.standalone.-4.test
11934     @@@DEnt:
11935     @@@@test:value:
11936     <!DOCTYPE p [
11937     <!ENTITY c "&entity;">
11938     <!ATTLIST p a CDATA "&c;">
11939     <!ENTITY % para SYSTEM "para">
11940     %para;
11941     ]>
11942     <p/>
11943     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11944     @@XMLTest:
11945     @@@QName:
11946     xp.reptxt.attlist.attval.ger.entity.declared.standalone.-4.2.test
11947     @@@DEnt:
11948     @@@@test:value:
11949     <!DOCTYPE p [
11950     <!ENTITY % para SYSTEM "para">
11951     %para;
11952     <!ENTITY c "&entity;">
11953     <!ATTLIST p a CDATA "&c;">
11954     ]>
11955     <p g="h"/>
11956     @@@test:domTree:
11957     document {
11958     document-type { }
11959     element {
11960     attribute {
11961     node-name: 'g';
11962     text-content: 'h';
11963     }
11964     }
11965     }
11966     @@XMLTest:
11967     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.standalone.5.test
11968     @@@DEnt:
11969     @@@@test:value:
11970     <?xml version="1.0" standalone="yes"?>
11971     <!DOCTYPE p SYSTEM "dtd" [
11972     <!ENTITY c "&entity;">
11973     <!ATTLIST p a CDATA "&c;">
11974     ]>
11975     <p/>
11976     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11977     @@XMLTest:
11978     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.standalone.-5.test
11979     @@@DEnt:
11980     @@@@test:value:
11981     <?xml version="1.0" standalone="no"?>
11982     <!DOCTYPE p SYSTEM "dtd" [
11983     <!ENTITY c "&entity;">
11984     <!ATTLIST p a CDATA "&c;">
11985     ]>
11986     <p/>
11987     @@@test:domTree:
11988     document {
11989     document-type { }
11990     element {
11991     attribute {
11992     node-name: 'a';
11993     specified: false;
11994     general-entity-reference {
11995     node-name: 'c';
11996 wakaba 1.34 manakai-expanded: true;
11997 wakaba 1.22 general-entity-reference {
11998     node-name: 'entity';
11999 wakaba 1.34 manakai-expanded: false;
12000 wakaba 1.22 }
12001     }
12002     }
12003     }
12004     }
12005     @@XMLTest:
12006     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.standalone.-6.test
12007     @@@DEnt:
12008     @@@@test:value:
12009     <!DOCTYPE p SYSTEM "dtd" [<!ENTITY c "&entity;">
12010     <!ATTLIST p a CDATA "&c;">
12011     ]>
12012     <p/>
12013     @@@test:domTree:
12014     document {
12015     document-type { }
12016     element {
12017     attribute {
12018     node-name: 'a';
12019     specified: false;
12020     general-entity-reference {
12021     node-name: 'c';
12022 wakaba 1.34 manakai-expanded: true;
12023 wakaba 1.22 general-entity-reference {
12024     node-name: 'entity';
12025 wakaba 1.34 manakai-expanded: false;
12026 wakaba 1.22 }
12027     }
12028     }
12029     }
12030     }
12031    
12032     @@XMLTest:
12033     @@@QName: xp.attlist.attval.ger.entity.declared.nopref.1.test
12034     @@@DEnt:
12035     @@@@test:value:
12036     <!DOCTYPE p [
12037     <!ATTLIST p a CDATA "&entity;">
12038     ]>
12039     <p/>
12040     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 22)..(2, 29); }
12041     @@XMLTest:
12042     @@@QName: xp.attlist.attval.ger.entity.declared.nopref.2.test
12043     @@@DEnt:
12044     @@@@test:value:
12045     <!DOCTYPE p [
12046     <!ENTITY other "aa">
12047     <!ENTITY % another "aa">
12048     <!ATTLIST p a CDATA "&entity;">
12049     ]>
12050     <p/>
12051     @@@c:erred: <[[xp|wf-entity-declared]]> { (4, 22)..(4, 29); }
12052     @@XMLTest:
12053     @@@QName: xp.attlist.attval.ger.entity.declared.nopref.3.test
12054     @@@DEnt:
12055     @@@@test:value:
12056     <?xml version="1.0" standalone="yes"?>
12057     <!DOCTYPE p [
12058     <!ATTLIST p a CDATA "&entity;">
12059     ]>
12060     <p/>
12061     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 22)..(3, 29); }
12062     @@XMLTest:
12063     @@@QName: xp.attlist.attval.ger.entity.declared.nopref.4.test
12064     @@@DEnt:
12065     @@@@test:value:
12066     <?xml version="1.0" standalone="no"?>
12067     <!DOCTYPE p [
12068     <!ATTLIST p a CDATA "&entity;">
12069     ]>
12070     <p/>
12071     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 22)..(3, 29); }
12072     @@XMLTest:
12073     @@@QName: xp.attlist.attval.ger.entity.declared.nopref.5.test
12074     @@@DEnt:
12075     @@@@test:value:
12076     <?xml version="1.0" standalone="yes"?>
12077     <!DOCTYPE p [
12078     <!ENTITY other "aa">
12079     <!ENTITY % another "aa">
12080     <!ATTLIST p a CDATA "&entity;">
12081     ]>
12082     <p/>
12083     @@@c:erred: <[[xp|wf-entity-declared]]> { (5, 22)..(5, 29); }
12084     @@XMLTest:
12085     @@@QName: xp.attlist.attval.ger.entity.declared.nopref.6.test
12086     @@@DEnt:
12087     @@@@test:value:
12088     <?xml version="1.0" standalone="no"?>
12089     <!DOCTYPE p [
12090     <!ENTITY other "aa">
12091     <!ENTITY % another "aa">
12092     <!ATTLIST p a CDATA "&entity;">
12093     ]>
12094     <p/>
12095     @@@c:erred: <[[xp|wf-entity-declared]]> { (5, 22)..(5, 29); }
12096     @@XMLTest:
12097     @@@QName: xp.attlist.attval.ger.entity.declared.nopref.-1.test
12098     @@@DEnt:
12099     @@@@test:value:
12100     <!DOCTYPE p [
12101     <!ENTITY entity "value">
12102     <!ATTLIST p a CDATA "&entity;">
12103     ]>
12104     <p/>
12105 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
12106 wakaba 1.22 @@@test:domTree:
12107     document {
12108     document-type {
12109     general-entity {
12110     node-name: 'entity';
12111     text-content: 'value';
12112     }
12113     element-type-definition {
12114     node-name: 'p';
12115     attribute-definition {
12116     node-name: 'a';
12117     general-entity-reference {
12118     node-name: 'entity';
12119 wakaba 1.34 manakai-expanded: true;
12120 wakaba 1.22 text-content: 'value';
12121     }
12122     }
12123     }
12124     }
12125     element {
12126     attribute {
12127     node-name: 'a';
12128     specified: false;
12129     general-entity-reference {
12130     node-name: 'entity';
12131 wakaba 1.34 manakai-expanded: true;
12132 wakaba 1.22 text-content: 'value';
12133     }
12134     }
12135     }
12136     }
12137     @@XMLTest:
12138     @@@QName: xp.attlist.attval.ger.entity.declared.nopref.-1.2.test
12139     @@@DEnt:
12140     @@@@test:value:
12141     <!DOCTYPE p [
12142     <!ATTLIST p a CDATA "&entity;">
12143     <!ENTITY entity "value">
12144     ]>
12145     <p/>
12146     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 22)..(2, 29); }
12147     @@XMLTest:
12148     @@@QName: xp.attlist.attval.ger.entity.declared.nopref.-2.test
12149     @@@DEnt:
12150     @@@@test:value:
12151     <!DOCTYPE p [
12152     <!ENTITY entity "value">
12153     <!ENTITY another SYSTEM "another">
12154     <!ATTLIST p a CDATA "&entity;">
12155     ]>
12156     <p/>
12157 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
12158 wakaba 1.22 @@@test:domTree:
12159     document {
12160     document-type {
12161     element-type-definition {
12162     node-name: 'p';
12163     attribute-definition {
12164     node-name: 'a';
12165     general-entity-reference {
12166     node-name: 'entity';
12167 wakaba 1.34 manakai-expanded: true;
12168 wakaba 1.22 text-content: 'value';
12169     }
12170     }
12171     }
12172     general-entity {
12173     node-name: 'entity';
12174     text-content: 'value';
12175     has-replacement-tree: true;
12176     }
12177     general-entity {
12178     node-name: 'another';
12179     public-id: null;
12180     system-id: 'another';
12181     has-replacement-tree: false;
12182     }
12183     }
12184     element {
12185     attribute {
12186     node-name: 'a';
12187     specified: false;
12188     general-entity-reference {
12189     node-name: 'entity';
12190 wakaba 1.34 manakai-expanded: true;
12191 wakaba 1.22 text-content: 'value';
12192     }
12193     }
12194     }
12195     }
12196     @@XMLTest:
12197     @@@QName: xp.attlist.attval.ger.entity.declared.nopref.-2.2.test
12198     @@@DEnt:
12199     @@@@test:value:
12200     <!DOCTYPE p [
12201     <!ATTLIST p a CDATA "&entity;">
12202     <!ENTITY entity "value">
12203     <!ENTITY another SYSTEM "another">
12204     ]>
12205     <p/>
12206     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 22)..(2, 29); }
12207     @@XMLTest:
12208     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.2.test
12209     @@@DEnt:
12210     @@@@test:value:
12211     <?xml version="1.0" standalone="yes"?>
12212     <!DOCTYPE p [
12213     <!ATTLIST p a CDATA "&entity;">
12214     ]>
12215     <p/>
12216     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 22)..(3, 29); }
12217     @@XMLTest:
12218     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.3.test
12219     @@@DEnt:
12220     @@@@test:value:
12221     <?xml version="1.0" standalone="yes"?>
12222     <!DOCTYPE p [
12223     <!ATTLIST p a CDATA "&entity;">
12224     <!ENTITY % para "<!-- -->">
12225     %para;
12226     ]>
12227     <p/>
12228     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 22)..(3, 29); }
12229     @@XMLTest:
12230     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.3.2.test
12231     @@@DEnt:
12232     @@@@test:value:
12233     <?xml version="1.0" standalone="yes"?>
12234     <!DOCTYPE p [
12235     <!ENTITY % para "<!-- -->">
12236     %para;
12237     <!ATTLIST p a CDATA "&entity;">
12238     ]>
12239     <p/>
12240     @@@c:erred: <[[xp|wf-entity-declared]]> { (5, 22)..(5, 29); }
12241     @@@enImplNote:
12242     The <XML::ATTLIST> declaration is processed since
12243     it is a <XA::standalone> document.
12244     @@XMLTest:
12245     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.-1.test
12246     @@@DEnt:
12247     @@@@test:value:
12248     <?xml version="1.0" standalone="no"?>
12249     <!DOCTYPE p [
12250     <!ATTLIST p a CDATA "&entity;">
12251     <!ENTITY % para "<!-- -->">
12252     %para;
12253     ]>
12254     <p/>
12255     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 22)..(3, 29); }
12256     @@XMLTest:
12257     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.-1.2.test
12258     @@@DEnt:
12259     @@@@test:value:
12260     <?xml version="1.0" standalone="no"?>
12261     <!DOCTYPE p [
12262 wakaba 1.25 <!ATTLIST p b CDATA #IMPLIED>
12263 wakaba 1.21 <!ENTITY % para "<!-- -->">
12264     %para;
12265     <!ATTLIST p a CDATA "&entity;">
12266     ]>
12267     <p c="d"/>
12268 wakaba 1.25 @@@c:erred:
12269     <[[xp|warning-attribute-definition-not-processed]]> { (6, 13)..(6, 30); }
12270 wakaba 1.21 @@@test:domTree:
12271     document {
12272     document-type {
12273     element-type-definition {
12274 wakaba 1.25 node-name: 'p';
12275 wakaba 1.21 attribute-definition {
12276     node-name: 'b';
12277     }
12278     }
12279     }
12280     element {
12281     attribute {
12282     node-name: 'c';
12283     text-content: 'd';
12284     }
12285     }
12286     }
12287     @@@enImplNote:
12288     The second <XML::ATTLIST> declaration is read but not processed
12289     and its <XML::&entity;> general entity reference violates
12290     entity declared validty constraint rather than well-formedness
12291     constraint.
12292     @@XMLTest:
12293     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.-2.test
12294     @@@DEnt:
12295     @@@@test:value:
12296     <!DOCTYPE p [
12297     <!ATTLIST p a CDATA "&entity;">
12298     <!ENTITY % para "<!-- -->">
12299     %para;
12300     ]>
12301     <p/>
12302     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 22)..(2, 29); }
12303     @@XMLTest:
12304     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.-2.2.test
12305     @@@DEnt:
12306     @@@@test:value:
12307     <!DOCTYPE p [
12308 wakaba 1.25 <!ATTLIST p b CDATA #IMPLIED>
12309 wakaba 1.21 <!ENTITY % para "<!-- -->">
12310     %para;
12311     <!ATTLIST p a CDATA "&entity;">
12312     ]>
12313     <p c="d"/>
12314 wakaba 1.25 @@@c:erred:
12315     <[[xp|warning-attribute-definition-not-processed]]> { (5, 13)..(5, 30); }
12316 wakaba 1.21 @@@test:domTree:
12317     document {
12318     document-type {
12319     element-type-definition {
12320 wakaba 1.25 node-name: 'p';
12321 wakaba 1.21 attribute-definition {
12322     node-name: 'b';
12323     }
12324     }
12325     }
12326     element {
12327     attribute {
12328     node-name: 'c';
12329     text-content: 'd';
12330     }
12331     }
12332     }
12333     @@XMLTest:
12334     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.4.test
12335     @@@DEnt:
12336     @@@@test:value:
12337     <?xml version="1.0" standalone="yes"?>
12338     <!DOCTYPE p [
12339     <!ATTLIST p a CDATA "&entity;">
12340     <!ENTITY % para SYSTEM "p">
12341     %para;
12342     ]>
12343     <p/>
12344     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 22)..(3, 29); }
12345     @@XMLTest:
12346     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.4.2.test
12347     @@@DEnt:
12348     @@@@test:value:
12349     <?xml version="1.0" standalone="yes"?>
12350     <!DOCTYPE p [
12351     <!ENTITY % para SYSTEM "p">
12352     %para;
12353     <!ATTLIST p a CDATA "&entity;">
12354     ]>
12355     <p/>
12356     @@@c:erred: <[[xp|wf-entity-declared]]> { (5, 22)..(5, 29); }
12357     @@@enImplNote:
12358     The <XML::ATTLIST> declaration is processed since
12359     it is a <XA::standalone> document.
12360     @@XMLTest:
12361     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.-3.test
12362     @@@DEnt:
12363     @@@@test:value:
12364     <?xml version="1.0" standalone="no"?>
12365     <!DOCTYPE p [
12366     <!ATTLIST p a CDATA "&entity;">
12367     <!ENTITY % para SYSTEM "p">
12368     %para;
12369     ]>
12370     <p/>
12371     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 22)..(3, 29); }
12372     @@@enImplNote:
12373     Is this well-formed? It has a parameter entity reference,
12374     therefore, it does not violates Entity Declared WFC, isn't it?
12375    
12376     Note that Firefox 1.5 and Opera 9 TP1 reports that this document has a
12377     fatal error (also note that they does not support unexpanded).
12378    
12379     See also:
12380     <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>
12381     @@XMLTest:
12382     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.-3.2.test
12383     @@@DEnt:
12384     @@@@test:value:
12385     <?xml version="1.0" standalone="no"?>
12386     <!DOCTYPE p [
12387 wakaba 1.25 <!ATTLIST p b CDATA #IMPLIED>
12388 wakaba 1.21 <!ENTITY % para SYSTEM "p">
12389     %para;
12390     <!ATTLIST p a CDATA "&entity;">
12391     ]>
12392     <p c="d"/>
12393 wakaba 1.25 @@@c:erred:
12394     <[[xp|warning-attribute-definition-not-processed]]> { (6, 13)..(6, 30); }
12395 wakaba 1.21 @@@test:domTree:
12396     document {
12397     document-type {
12398     element-type-definition {
12399 wakaba 1.25 node-name: 'p';
12400 wakaba 1.21 attribute-definition {
12401     node-name: 'b';
12402     }
12403     }
12404     }
12405     element {
12406     attribute {
12407     node-name: 'c';
12408     text-content: 'd';
12409     }
12410     }
12411     }
12412     @@@enImplNote:
12413     The second <XML::ATTLIST> declaration is read but not processed
12414     and its <XML::&entity;> general entity reference violates
12415     entity declared validty constraint rather than well-formedness
12416     constraint.
12417     @@XMLTest:
12418     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.-4.test
12419     @@@DEnt:
12420     @@@@test:value:
12421     <!DOCTYPE p [
12422     <!ATTLIST p a CDATA "&entity;">
12423     <!ENTITY % para SYSTEM "p">
12424     %para;
12425     ]>
12426     <p/>
12427     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 22)..(2, 29); }
12428     @@XMLTest:
12429     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.-4.2.test
12430     @@@DEnt:
12431     @@@@test:value:
12432     <!DOCTYPE p [
12433 wakaba 1.25 <!ATTLIST p b CDATA #IMPLIED>
12434 wakaba 1.21 <!ENTITY % para SYSTEM "p">
12435     %para;
12436     <!ATTLIST p a CDATA "&entity;">
12437     ]>
12438     <p c="d"/>
12439 wakaba 1.25 @@@c:erred:
12440     <[[xp|warning-attribute-definition-not-processed]]> { (5, 13)..(5, 30); }
12441 wakaba 1.21 @@@test:domTree:
12442     document {
12443     document-type {
12444     element-type-definition {
12445 wakaba 1.25 node-name: 'p';
12446 wakaba 1.21 attribute-definition {
12447     node-name: 'b';
12448     }
12449     }
12450     }
12451     element {
12452     attribute {
12453     node-name: 'c';
12454     text-content: 'd';
12455     }
12456     }
12457     }
12458     @@XMLTest:
12459     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.5.test
12460     @@@DEnt:
12461     @@@@test:value:
12462     <?xml version="1.0" standalone="yes"?>
12463     <!DOCTYPE p SYSTEM "dtd" [
12464     <!ATTLIST p a CDATA "&entity;">
12465     ]>
12466     <p/>
12467     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 22)..(3, 29); }
12468     @@@enImplNote:
12469     This document has an error - result is implementation dependent.
12470     @@XMLTest:
12471     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.-5.test
12472     @@@DEnt:
12473     @@@@test:value:
12474     <?xml version="1.0" standalone="no"?>
12475     <!DOCTYPE p SYSTEM "dtd" [
12476     <!ATTLIST p a CDATA "&entity;">
12477     ]>
12478     <p/>
12479     @@@test:domTree:
12480     document {
12481     document-type {
12482     element-type-definition {
12483     node-name: 'p';
12484     attribute-definition {
12485     node-name: 'a';
12486     general-entity-reference {
12487     node-name: 'entity';
12488 wakaba 1.34 manakai-expanded: false;
12489 wakaba 1.21 }
12490     }
12491     }
12492     }
12493     element {
12494     attribute {
12495     node-name: 'a';
12496     specified: false;
12497     general-entity-reference {
12498     node-name: 'entity';
12499 wakaba 1.34 manakai-expanded: false;
12500 wakaba 1.21 }
12501     }
12502     }
12503     }
12504     @@@enImplNote:
12505     This document has an error - result is implementation dependent.
12506     @@XMLTest:
12507     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.-6.test
12508     @@@DEnt:
12509     @@@@test:value:
12510     <!DOCTYPE p SYSTEM "dtd" [
12511     <!ATTLIST p a CDATA "&entity;">
12512     ]>
12513     <p/>
12514     @@@test:domTree:
12515     document {
12516     document-type {
12517     element-type-definition {
12518     node-name: 'p';
12519     attribute-definition {
12520     node-name: 'a';
12521     general-entity-reference {
12522     node-name: 'entity';
12523 wakaba 1.34 manakai-expanded: false;
12524 wakaba 1.21 }
12525     }
12526     }
12527     }
12528     element {
12529     attribute {
12530     node-name: 'a';
12531     specified: false;
12532     general-entity-reference {
12533     node-name: 'entity';
12534 wakaba 1.34 manakai-expanded: false;
12535 wakaba 1.21 }
12536     }
12537     }
12538     }
12539     @@@enImplNote:
12540     This document has an error - result is implementation dependent.
12541    
12542 wakaba 1.19 @@enImplNote:
12543     {TODO:: Entity declared WFC for
12544 wakaba 1.20
12545     - General entity references in entity value??
12546 wakaba 1.19
12547     }
12548    
12549 wakaba 1.23 @@XMLTest:
12550     @@@QName: xp.element.content.parsed.entity.reference.test
12551     @@@DEnt:
12552     @@@@test:value:
12553     <!DOCTYPE p [
12554     <!NOTATION n SYSTEM "notation">
12555     <!ENTITY ext SYSTEM "system" NDATA n>
12556     ]>
12557     <p>&ext;</p>
12558     @@@c:erred: <[[xp|wf-parsed-entity]]> { (5, 4)..(5, 8); }
12559     @@XMLTest:
12560     @@@QName: xp.attval.parsed.entity.reference.test
12561     @@@DEnt:
12562     @@@@test:value:
12563     <!DOCTYPE p [
12564     <!NOTATION n SYSTEM "notation">
12565     <!ENTITY ext SYSTEM "system" NDATA n>
12566     ]>
12567     <p a="&ext;"/>
12568     # @@@c:erred: <[[xp|wf-parsed-entity]]> { (5, 7)..(5, 11); }
12569     @@@c:erred: <[[xp|wf-no-external-entity-references]]> { (5, 7)..(5, 11); }
12570     @@XMLTest:
12571     @@@QName: xp.element.content.reptxt.parsed.entity.reference.test
12572     @@@DEnt:
12573     @@@@test:value:
12574     <!DOCTYPE p [
12575     <!NOTATION n SYSTEM "notation">
12576     <!ENTITY ext SYSTEM "system" NDATA n>
12577     <!ENTITY c "&#x26;ext;">
12578     ]>
12579     <p>&c;</p>
12580     @@@c:erred: <[[xp|wf-parsed-entity]]> { (1, 1)..(1, 5); }
12581     @@XMLTest:
12582     @@@QName: xp.attval.reptxt.parsed.entity.reference.test
12583     @@@DEnt:
12584     @@@@test:value:
12585     <!DOCTYPE p [
12586     <!NOTATION n SYSTEM "notation">
12587     <!ENTITY ext SYSTEM "system" NDATA n>
12588     <!ENTITY c "&#x26;ext;">
12589     ]>
12590     <p a="&c;"/>
12591 wakaba 1.34 @@@cfg:entity-replacement-tree: 0
12592     @@@c:erred: <[[xp|wf-no-external-entity-references]]> { (1, 1)..(1, 5); }
12593     @@XMLTest:
12594     @@@QName: xp.attval.reptxt.parsed.entity.reference.2.test
12595     @@@DEnt:
12596     @@@@test:value:
12597     <!DOCTYPE p [
12598     <!NOTATION n SYSTEM "notation">
12599     <!ENTITY ext SYSTEM "system" NDATA n>
12600     <!ENTITY c "&#x26;ext;">
12601     ]>
12602     <p a="&c;"/>
12603     @@@cfg:entity-replacement-tree: 1
12604 wakaba 1.23 @@@c:erred: <[[xp|wf-no-external-entity-references]]> { (1, 1)..(1, 5); }
12605     @@@c:erred:
12606     @@@@@: <[[xp|wf-parsed-entity]]> { }
12607     @@@@enImplNote: During entity node construction.
12608     @@XMLTest:
12609     @@@QName: xp.element.content.entval.parsed.entity.reference.test
12610     @@@DEnt:
12611     @@@@test:value:
12612     <!DOCTYPE p [
12613     <!NOTATION n SYSTEM "notation">
12614     <!ENTITY ext SYSTEM "system" NDATA n>
12615     <!ENTITY c "&ext;">
12616     ]>
12617     <p>&c;</p>
12618     @@@c:erred: <[[xp|wf-parsed-entity]]> { }
12619     @@XMLTest:
12620     @@@QName: xp.attval.entval.parsed.entity.reference.test
12621     @@@DEnt:
12622     @@@@test:value:
12623     <!DOCTYPE p [
12624     <!NOTATION n SYSTEM "notation">
12625     <!ENTITY ext SYSTEM "system" NDATA n>
12626     <!ENTITY c "&ext;">
12627     ]>
12628     <p a="&c;"/>
12629 wakaba 1.34 @@@cfg:entity-replacement-tree: 0
12630     @@@c:erred: <[[xp|wf-no-external-entity-references]]> { }
12631     @@XMLTest:
12632     @@@QName: xp.attval.entval.parsed.entity.reference.2.test
12633     @@@DEnt:
12634     @@@@test:value:
12635     <!DOCTYPE p [
12636     <!NOTATION n SYSTEM "notation">
12637     <!ENTITY ext SYSTEM "system" NDATA n>
12638     <!ENTITY c "&ext;">
12639     ]>
12640     <p a="&c;"/>
12641     @@@cfg:entity-replacement-tree: 1
12642 wakaba 1.23 @@@c:erred: <[[xp|wf-no-external-entity-references]]> { }
12643     @@@c:erred: <[[xp|wf-parsed-entity]]> { }
12644    
12645     @@XMLTest:
12646     @@@QName: xp.element.content.no.recursion.direct.test
12647     @@@DEnt:
12648     @@@@test:value:
12649     <!DOCTYPE p [
12650     <!ENTITY c "&c;">
12651     ]>
12652     <p>&c;</p>
12653     @@@c:erred: <[[xp|wf-no-recursion]]> { (1, 1)..(1, 3); }
12654     @@XMLTest:
12655     @@@QName: xp.element.content.no.recursion.indirect.test
12656     @@@DEnt:
12657     @@@@test:value:
12658     <!DOCTYPE p [
12659     <!ENTITY d "&c;">
12660     <!ENTITY c "&d;">
12661     ]>
12662     <p>&c;</p>
12663     @@@c:erred: <[[xp|wf-no-recursion]]> { /* |d| */ (1, 1)..(1, 3); }
12664     @@XMLTest:
12665     @@@QName: xp.attval.no.recursion.direct.test
12666     @@@DEnt:
12667     @@@@test:value:
12668     <!DOCTYPE p [
12669     <!ENTITY c "&c;">
12670     ]>
12671     <p a="&c;"/>
12672     @@@c:erred: <[[xp|wf-no-recursion]]> { (1, 1)..(1, 3); }
12673     @@XMLTest:
12674     @@@QName: xp.attval.no.recursion.indirect.test
12675     @@@DEnt:
12676     @@@@test:value:
12677     <!DOCTYPE p [
12678     <!ENTITY d "&c;">
12679     <!ENTITY c "&d;">
12680     ]>
12681     <p a="&c;"/>
12682     @@@c:erred: <[[xp|wf-no-recursion]]> { /* |d| */ (1, 1)..(1, 3); }
12683     @@XMLTest:
12684     @@@QName: xp.reptxt.element.content.no.recursion.direct.test
12685     @@@DEnt:
12686     @@@@test:value:
12687     <!DOCTYPE p [
12688     <!ENTITY c "&c;">
12689     <!ENTITY e "&#x26;c;">
12690     ]>
12691     <p>&e;</p>
12692     @@@c:erred: <[[xp|wf-no-recursion]]> { /* |e| */ (1, 1)..(1, 3); }
12693     @@XMLTest:
12694     @@@QName: xp.reptxt.element.content.no.recursion.indirect.test
12695     @@@DEnt:
12696     @@@@test:value:
12697     <!DOCTYPE p [
12698     <!ENTITY d "&c;">
12699     <!ENTITY c "&d;">
12700     <!ENTITY e "&#x26;c;">
12701     ]>
12702     <p>&e;</p>
12703     @@@c:erred: <[[xp|wf-no-recursion]]> { /* |d| */ (1, 1)..(1, 3); }
12704     @@XMLTest:
12705     @@@QName: xp.reptxt.attval.no.recursion.direct.test
12706     @@@DEnt:
12707     @@@@test:value:
12708     <!DOCTYPE p [
12709     <!ENTITY c "&c;">
12710     <!ENTITY e "&#x26;c;">
12711     ]>
12712     <p a="&e;"/>
12713     @@@c:erred: <[[xp|wf-no-recursion]]> { /* |e| */ (1, 1)..(1, 3); }
12714     @@XMLTest:
12715     @@@QName: xp.reptxt.attval.no.recursion.indirect.test
12716     @@@DEnt:
12717     @@@@test:value:
12718     <!DOCTYPE p [
12719     <!ENTITY d "&c;">
12720     <!ENTITY c "&d;">
12721     <!ENTITY e "&#x26;c;">
12722     ]>
12723     <p a="&e;"/>
12724     @@@c:erred: <[[xp|wf-no-recursion]]> { /* |d| */ (1, 1)..(1, 3); }
12725    
12726     @@XMLTest:
12727     @@@QName: xp.ENTITY.system.ndata.name.test
12728     @@@DEnt:
12729     @@@@test:value:
12730     <!DOCTYPE a [
12731     <!NOTATION n SYSTEM "n">
12732     <!ENTITY % e SYSTEM "sys" NDATA n>
12733     ]><a/>
12734     @@@c:erred: <[[xp|wf-syntax-error]]> { (3, 26)..(3, 30); }
12735     @@XMLTest:
12736     @@@QName: xp.ENTITY.public.ndata.name.test
12737     @@@DEnt:
12738     @@@@test:value:
12739     <!DOCTYPE a [
12740     <!NOTATION n SYSTEM "n">
12741     <!ENTITY % e PUBLIC "pub" "sys" NDATA n>
12742     ]><a/>
12743     @@@c:erred: <[[xp|wf-syntax-error]]> { (3, 33)..(3, 37); }
12744     @@XMLTest:
12745     @@@QName: xp.ENTITY.public.ndata.name.-1.test
12746     @@@DEnt:
12747     @@@@test:value:
12748     <!DOCTYPE a [
12749     <!NOTATION n SYSTEM "n">
12750     <!ENTITY % e PUBLIC "pub" "sys" >
12751     ]><a/>
12752     @@@test:domTree:
12753     document { }
12754    
12755     @@XMLTest:
12756     @@@QName: xp.ENTITY.pubid.1.test
12757     @@@DEnt:
12758     @@@@test:value:
12759     <!DOCTYPE a [
12760     <!ENTITY e PUBLIC "p" "s">
12761     ]><a/>
12762     @@@test:domTree:
12763     document {
12764     document-type {
12765     general-entity {
12766     node-name: 'e';
12767     public-id: 'p';
12768     system-id: 's';
12769     }
12770     }
12771     element { }
12772     }
12773     @@XMLTest:
12774     @@@QName: xp.ENTITY.pubid.2.test
12775     @@@DEnt:
12776     @@@@test:value:
12777     <!DOCTYPE a [
12778     <!ENTITY e PUBLIC " p " "s">
12779     ]><a/>
12780     @@@test:domTree:
12781     document {
12782     document-type {
12783     general-entity {
12784     node-name: 'e';
12785     public-id: 'p';
12786     system-id: 's';
12787     }
12788     }
12789     element { }
12790     }
12791     @@XMLTest:
12792     @@@QName: xp.ENTITY.pubid.3.test
12793     @@@DEnt:
12794     @@@@test:value:
12795     <!DOCTYPE a [
12796     <!ENTITY e PUBLIC " p $u000Aq$u000A " "s">
12797     ]><a/>
12798     @@@test:domTree:
12799     document {
12800     document-type {
12801     general-entity {
12802     node-name: 'e';
12803     public-id: 'p q';
12804     system-id: 's';
12805     }
12806     }
12807     element { }
12808     }
12809     @@XMLTest:
12810     @@@QName: xp.ENTITY.pubid.4.test
12811     @@@DEnt:
12812     @@@@test:value:
12813     <!DOCTYPE a [
12814     <!ENTITY e PUBLIC " p $u000D$u000Aq" "s">
12815     ]><a/>
12816     @@@test:domTree:
12817     document {
12818     document-type {
12819     general-entity {
12820     node-name: 'e';
12821     public-id: 'p q';
12822     system-id: 's';
12823     }
12824     }
12825     element { }
12826     }
12827     @@XMLTest:
12828     @@@QName: xp.ENTITY.pubid.5.test
12829     @@@DEnt:
12830     @@@@test:value:
12831     <?xml version="1.1"?>
12832     <!DOCTYPE a [
12833 wakaba 1.27 <!ENTITY e PUBLIC " p $u000D$u0085q" "s">
12834 wakaba 1.23 ]><a/>
12835     @@@test:domTree:
12836     document {
12837     document-type {
12838     general-entity {
12839     node-name: 'e';
12840     public-id: 'p q';
12841     system-id: 's';
12842     }
12843     }
12844     element { }
12845     }
12846    
12847 wakaba 1.24 @@XMLTest:
12848     @@@QName: xp.ENTITY.ignored.test
12849     @@@DEnt:
12850     @@@@test:value:
12851     <!DOCTYPE a [
12852     <!ENTITY e "a">
12853     <!ENTITY e "b">
12854     ]><a/>
12855 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
12856 wakaba 1.24 @@@test:domTree:
12857     document {
12858     document-type {
12859     general-entity {
12860     node-name: 'e';
12861     text-content: 'a';
12862     }
12863     }
12864     element { }
12865     }
12866     @@@c:erred:
12867     <[[xp|warning-entity-declaration-ignored]]> { (3, 1)..(3, 15); }
12868     @@XMLTest:
12869     @@@QName: xp.ENTITY.ignored.2.test
12870     @@@DEnt:
12871     @@@@test:value:
12872     <!DOCTYPE a [
12873     <!ENTITY % e "a">
12874     <!ENTITY % e "b">
12875     ]><a/>
12876     @@@test:domTree:
12877     document { }
12878     @@@c:erred:
12879     <[[xp|warning-entity-declaration-ignored]]> { (3, 1)..(3, 17); }
12880    
12881     @@XMLTest:
12882     @@@QName: xp.ENTITY.predefined.1.test
12883     @@@DEnt:
12884     @@@@test:value:
12885     <!DOCTYPE a [
12886     <!ENTITY lt "&#38;#60;">
12887     <!ENTITY gt "&#62;">
12888     <!ENTITY amp "&#38;#38;">
12889     <!ENTITY apos "&#39;">
12890     <!ENTITY quot "&#34;">
12891     <!ENTITY e "f">
12892     ]><a>&lt;&gt;&amp;&apos;&quot;</a>
12893 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
12894 wakaba 1.24 @@@test:domTree:
12895     document {
12896     document-type {
12897     general-entity {
12898     node-name: 'e';
12899     text-content: 'f';
12900     }
12901     }
12902     element {
12903     text-content: '<>&' U+0027 '"';
12904     }
12905     }
12906     @@XMLTest:
12907     @@@QName: xp.ENTITY.predefined.2.test
12908     @@@DEnt:
12909     @@@@test:value:
12910     <!DOCTYPE a [
12911     <!ENTITY lt "&#38;#60;">
12912     <!ENTITY gt "&#x26;#62;">
12913     <!ENTITY amp "&#38;#38;">
12914     <!ENTITY apos "&#x26;#39;">
12915     <!ENTITY quot "&#x26;#34;">
12916     <!ENTITY e "f">
12917     ]><a>&lt;&gt;&amp;&apos;&quot;</a>
12918 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
12919 wakaba 1.24 @@@test:domTree:
12920     document {
12921     document-type {
12922     general-entity {
12923     node-name: 'e';
12924     text-content: 'f';
12925     }
12926     }
12927     element {
12928     text-content: '<>&' U+0027 '"';
12929     }
12930     }
12931     @@XMLTest:
12932     @@@QName: xp.ENTITY.predefined.3.test
12933     @@@DEnt:
12934     @@@@test:value:
12935     <!DOCTYPE a [
12936     <!ENTITY lt "&#60;">
12937     <!ENTITY gt "&#62;">
12938     <!ENTITY amp "&#38;">
12939     <!ENTITY apos "&#39;">
12940     <!ENTITY quot "&#34;">
12941     <!ENTITY e "f">
12942     ]><a>&lt;&gt;&amp;&apos;&quot;</a>
12943 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
12944 wakaba 1.24 @@@c:erred: <[[xp|error-malformed-predefined-entity]]> { (2, 1)..(2, 24); }
12945     @@@c:erred: <[[xp|error-malformed-predefined-entity]]> { (4, 1)..(4, 24); }
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.4.test
12960     @@@DEnt:
12961     @@@@test:value:
12962     <!DOCTYPE a [
12963     <!ENTITY lt "1">
12964     <!ENTITY gt "2">
12965     <!ENTITY amp "3">
12966     <!ENTITY apos "4">
12967     <!ENTITY quot "5">
12968     <!ENTITY e "f">
12969     ]><a>&lt;&gt;&amp;&apos;&quot;</a>
12970 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
12971 wakaba 1.24 @@@c:erred: <[[xp|error-malformed-predefined-entity]]> { (2, 1)..(2, 24); }
12972     @@@c:erred: <[[xp|error-malformed-predefined-entity]]> { (3, 1)..(3, 24); }
12973     @@@c:erred: <[[xp|error-malformed-predefined-entity]]> { (4, 1)..(4, 24); }
12974     @@@c:erred: <[[xp|error-malformed-predefined-entity]]> { (5, 1)..(5, 24); }
12975     @@@c:erred: <[[xp|error-malformed-predefined-entity]]> { (6, 1)..(6, 24); }
12976     @@@test:domTree:
12977     document {
12978     document-type {
12979     general-entity {
12980     node-name: 'e';
12981     text-content: 'f';
12982     }
12983     }
12984     element {
12985     text-content: '<>&' U+0027 '"';
12986     }
12987     }
12988     @@XMLTest:
12989     @@@QName: xp.ENTITY.predefined.5.test
12990     @@@DEnt:
12991     @@@@test:value:
12992     <!DOCTYPE a [
12993     <!ENTITY lt SYSTEM "1">
12994     <!ENTITY gt SYSTEM "2">
12995     <!ENTITY amp SYSTEM "3">
12996     <!ENTITY apos SYSTEM "4">
12997     <!ENTITY quot SYSTEM "5">
12998     <!ENTITY e "f">
12999     ]><a>&lt;&gt;&amp;&apos;&quot;</a>
13000 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
13001 wakaba 1.24 @@@c:erred: <[[xp|error-internal-predefined-entity]]> { (2, 1)..(2, 27); }
13002     @@@c:erred: <[[xp|error-internal-predefined-entity]]> { (3, 1)..(3, 27); }
13003     @@@c:erred: <[[xp|error-internal-predefined-entity]]> { (4, 1)..(4, 27); }
13004     @@@c:erred: <[[xp|error-internal-predefined-entity]]> { (5, 1)..(5, 27); }
13005     @@@c:erred: <[[xp|error-internal-predefined-entity]]> { (6, 1)..(6, 27); }
13006     @@@test:domTree:
13007     document {
13008     document-type {
13009     general-entity {
13010     node-name: 'e';
13011     text-content: 'f';
13012     }
13013     }
13014     element {
13015     text-content: '<>&' U+0027 '"';
13016     }
13017     }
13018     @@XMLTest:
13019     @@@QName: xp.ENTITY.predefined.6.test
13020     @@@DEnt:
13021     @@@@test:value:
13022     <!DOCTYPE a [
13023     <!ENTITY % lt SYSTEM "1">
13024     <!ENTITY % gt SYSTEM "2">
13025     <!ENTITY % amp SYSTEM "3">
13026     <!ENTITY % apos SYSTEM "4">
13027     <!ENTITY % quot SYSTEM "5">
13028     <!ENTITY e "f">
13029     ]><a>&lt;&gt;&amp;&apos;&quot;</a>
13030 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
13031 wakaba 1.24 @@@test:domTree:
13032     document {
13033     document-type {
13034     general-entity {
13035     node-name: 'e';
13036     text-content: 'f';
13037     }
13038     }
13039     element {
13040     text-content: '<>&' U+0027 '"';
13041     }
13042     }
13043     @@XMLTest:
13044     @@@QName: xp.ENTITY.predefined.7.test
13045     @@@DEnt:
13046     @@@@test:value:
13047     <!DOCTYPE a [
13048     <!ENTITY lt "&#38;#x3C;">
13049     <!ENTITY gt "&#x3E;">
13050     <!ENTITY amp "&#38;#x26;">
13051     <!ENTITY apos "&#x27;">
13052     <!ENTITY quot "&#x22;">
13053     <!ENTITY e "f">
13054     ]><a>&lt;&gt;&amp;&apos;&quot;</a>
13055 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
13056 wakaba 1.24 @@@test:domTree:
13057     document {
13058     document-type {
13059     general-entity {
13060     node-name: 'e';
13061     text-content: 'f';
13062     }
13063     }
13064     element {
13065     text-content: '<>&' U+0027 '"';
13066     }
13067     }
13068     @@XMLTest:
13069     @@@QName: xp.ENTITY.predefined.8.test
13070     @@@DEnt:
13071     @@@@test:value:
13072     <!DOCTYPE a [
13073     <!ENTITY lt "&#38;#x3c;">
13074     <!ENTITY gt "&#x3e;">
13075     <!ENTITY amp "&#38;#x26;">
13076     <!ENTITY apos "&#x27;">
13077     <!ENTITY quot "&#x22;">
13078     <!ENTITY e "f">
13079     ]><a>&lt;&gt;&amp;&apos;&quot;</a>
13080 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
13081 wakaba 1.24 @@@test:domTree:
13082     document {
13083     document-type {
13084     general-entity {
13085     node-name: 'e';
13086     text-content: 'f';
13087     }
13088     }
13089     element {
13090     text-content: '<>&' U+0027 '"';
13091     }
13092     }
13093     @@XMLTest:
13094     @@@QName: xp.ENTITY.predefined.9.test
13095     @@@DEnt:
13096     @@@@test:value:
13097     <!DOCTYPE a [
13098     <!ENTITY lt "&#38;#x00003C;">
13099     <!ENTITY gt "&#x0003E;">
13100     <!ENTITY amp "&#38;#x026;">
13101     <!ENTITY apos "&#x000027;">
13102     <!ENTITY quot "&#x0022;">
13103     <!ENTITY e "f">
13104     ]><a>&lt;&gt;&amp;&apos;&quot;</a>
13105 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
13106 wakaba 1.24 @@@test:domTree:
13107     document {
13108     document-type {
13109     general-entity {
13110     node-name: 'e';
13111     text-content: 'f';
13112     }
13113     }
13114     element {
13115     text-content: '<>&' U+0027 '"';
13116     }
13117     }
13118     @@XMLTest:
13119     @@@QName: xp.ENTITY.predefined.10.test
13120     @@@DEnt:
13121     @@@@test:value:
13122     <!DOCTYPE a [
13123     <!ENTITY lt "&#38;#00060;">
13124     <!ENTITY gt "&#062;">
13125     <!ENTITY amp "&#38;#000038;">
13126     <!ENTITY apos "&#0000039;">
13127     <!ENTITY quot "&#0034;">
13128     <!ENTITY e "f">
13129     ]><a>&lt;&gt;&amp;&apos;&quot;</a>
13130 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
13131 wakaba 1.24 @@@test:domTree:
13132     document {
13133     document-type {
13134     general-entity {
13135     node-name: 'e';
13136     text-content: 'f';
13137     }
13138     }
13139     element {
13140     text-content: '<>&' U+0027 '"';
13141     }
13142     }
13143    
13144 wakaba 1.25 @@XMLTest:
13145     @@@QName: xp.processed.1.test
13146     @@@DEnt:
13147     @@@@test:value:
13148     <a/>
13149     @@@test:domTree:
13150     document {
13151     all-declarations-processed: true;
13152     element { }
13153     }
13154     @@XMLTest:
13155     @@@QName: xp.processed.2.test
13156     @@@DEnt:
13157     @@@@test:value:
13158     <!DOCTYPE a [
13159     <!ENTITY e "f">
13160     <!ATTLIST a b NMTOKEN " c ">
13161     ]><a>&e;</a>
13162     @@@test:domTree:
13163     document {
13164     document-type {
13165     general-entity {
13166     node-name: 'e';
13167     }
13168     element-type-definition {
13169     node-name: 'a';
13170     attribute-definition {
13171     node-name: 'b';
13172     }
13173     }
13174     }
13175     all-declarations-processed: true;
13176     element {
13177     attribute {
13178     node-name: 'b';
13179     node-value: 'c';
13180     }
13181     text-content: 'f';
13182     }
13183     }
13184     @@XMLTest:
13185     @@@QName: xp.processed.3.test
13186     @@@DEnt:
13187     @@@@test:value:
13188     <!DOCTYPE a [
13189     <!ENTITY % p SYSTEM "p">
13190     %p;
13191     <!ENTITY e "f">
13192     <!ATTLIST a b NMTOKEN " c ">
13193     ]><a d="e">&e;</a>
13194     @@@test:domTree:
13195     document {
13196     document-type { }
13197     all-declarations-processed: false;
13198     element {
13199     attribute {
13200     node-name: 'd';
13201     node-value: 'e';
13202     }
13203     general-entity-reference {
13204     node-name: 'e';
13205 wakaba 1.34 manakai-expanded: false;
13206 wakaba 1.25 }
13207     }
13208     }
13209     @@@c:erred:
13210     <[[xp|warning-entity-declaration-not-processed]]> { (4, 1)..(4, 20); }
13211     @@@c:erred:
13212     <[[xp|warning-attribute-definition-not-processed]]> { (5, 13)..(5, 31); }
13213     @@XMLTest:
13214     @@@QName: xp.processed.4.test
13215     @@@DEnt:
13216     @@@@test:value:
13217     <?xml version="1.1" standalone="yes"?>
13218     <!DOCTYPE a [
13219     <!ENTITY % p SYSTEM "p">
13220     %p;
13221     <!ENTITY e "f">
13222     <!ATTLIST a b NMTOKEN " c ">
13223     ]><a>&e;</a>
13224     @@@test:domTree:
13225     document {
13226     document-type {
13227     general-entity {
13228     node-name: 'e';
13229     }
13230     element-type-definition {
13231     node-name: 'a';
13232     attribute-definition {
13233     node-name: 'b';
13234     }
13235     }
13236     }
13237     all-declarations-processed: false;
13238     element {
13239     attribute {
13240     node-name: 'b';
13241     node-value: 'c';
13242     }
13243     text-content: 'f';
13244     }
13245     }
13246     @@XMLTest:
13247     @@@QName: xp.processed.5.test
13248     @@@DEnt:
13249     @@@@test:value:
13250     <!DOCTYPE a SYSTEM "p" [
13251     <!ENTITY e "f">
13252     <!ATTLIST a b NMTOKEN " c ">
13253     ]><a>&e;</a>
13254     @@@test:domTree:
13255     document {
13256     document-type {
13257     general-entity {
13258     node-name: 'e';
13259     }
13260     element-type-definition {
13261     node-name: 'a';
13262     attribute-definition {
13263     node-name: 'b';
13264     }
13265     }
13266     }
13267     all-declarations-processed: false;
13268     element {
13269     attribute {
13270     node-name: 'b';
13271     node-value: 'c';
13272     }
13273     text-content: 'f';
13274     }
13275     }
13276    
13277     @@XMLTest:
13278     @@@QName: xp.PEs.in.internal.subset.1.test
13279     @@@DEnt:
13280     @@@@test:value:
13281     <!DOCTYPE a [
13282     <!ENTITY % p " ">
13283 wakaba 1.26 <!ENTITY % q "%p;">
13284 wakaba 1.25 ]><a/>
13285     @@@c:erred: <[[xp|wf-pes-in-internal-subset]]> { (3, 15)..(3, 17); }
13286     @@XMLTest:
13287     @@@QName: xp.PEs.in.internal.subset.2.test
13288     @@@DEnt:
13289     @@@@test:value:
13290     <!DOCTYPE a [
13291     <!ENTITY % p " ">
13292 wakaba 1.26 <!ENTITY % q '%p;'>
13293 wakaba 1.25 ]><a/>
13294     @@@c:erred: <[[xp|wf-pes-in-internal-subset]]> { (3, 15)..(3, 17); }
13295    
13296 wakaba 1.26 @@XMLTest:
13297     @@@QName: xp.name.pitarget.content.1.0.2.test
13298     @@@DEnt:
13299     @@@@test:value:
13300     <?xml version="1.0"?>
13301     <p>
13302     <?$u3001$u3002?>
13303     </p>
13304     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]> { (3, 3)..(3, 4); }
13305     @@XMLTest:
13306     @@@QName: xp.name.pitarget.content.1.1.2.test
13307     @@@DEnt:
13308     @@@@test:value:
13309     <?xml version="1.1"?>
13310     <p>$
13311     <?$u3001$u3002?>$
13312     </p>
13313     @@@test:domTree:
13314     document {
13315     xml-version: '1.1';
13316     element {
13317     pi {
13318     node-name: U+3001 U+3002;
13319 wakaba 1.14 }
13320 wakaba 1.12 }
13321 wakaba 1.26 }
13322     @@XMLTest:
13323     @@@QName: xp.name.pitarget.content.1.0.3.test
13324     @@@DEnt:
13325     @@@@test:value:
13326     <?xml version="1.0"?>
13327     <p>
13328     <?$u3005b?>
13329     </p>
13330     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]> { (3, 3)..(3, 4); }
13331     @@XMLTest:
13332     @@@QName: xp.name.pitarget.content.1.1.3.test
13333     @@@DEnt:
13334     @@@@test:value:
13335     <?xml version="1.1"?>
13336     <p>$
13337     <?$u3005b?>$
13338     </p>
13339     @@@test:domTree:
13340     document {
13341     xml-version: '1.1';
13342     element {
13343     pi {
13344     node-name: U+3005 'b';
13345 wakaba 1.12 }
13346     }
13347 wakaba 1.26 }
13348     @@XMLTest:
13349     @@@QName: xp.name.pitarget.content.names.1.0.1.test
13350     @@@DEnt:
13351     @@@@test:value:
13352     <?xml version="1.0"?>
13353     <p>
13354     <?a:b?>
13355     </p>
13356     @@@c:erred: <[[xp|nswf-legal-ncname]]> { (3, 3)..(3, 5); }
13357     @@XMLTest:
13358     @@@QName: xp.name.pitarget.content.names.1.1.1.test
13359     @@@DEnt:
13360     @@@@test:value:
13361     <?xml version="1.1"?>
13362     <p>
13363     <?a:b?>
13364     </p>
13365     @@@c:erred: <[[xp|nswf-legal-ncname]]> { (3, 3)..(3, 5); }
13366     @@XMLTest:
13367     @@@QName: xp.name.pitarget.intsubset.1.0.2.test
13368     @@@DEnt:
13369     @@@@test:value:
13370     <?xml version="1.0"?>
13371     <!DOCTYPE p [
13372     <?$u3001$u3002?>
13373     ]><p/>
13374     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]> { (3, 3)..(3, 4); }
13375     @@XMLTest:
13376     @@@QName: xp.name.pitarget.intsubset.1.1.2.test
13377     @@@DEnt:
13378     @@@@test:value:
13379     <?xml version="1.1"?>
13380     <!DOCTYPE p [
13381     <?$u3001$u3002?>
13382     ]><p/>
13383     @@@test:domTree:
13384     document {
13385     xml-version: '1.1';
13386     document-type {
13387     pi {
13388     node-name: U+3001 U+3002;
13389     }
13390     }
13391     element { }
13392     }
13393     @@XMLTest:
13394     @@@QName: xp.name.pitarget.intsubset.1.0.3.test
13395     @@@DEnt:
13396     @@@@test:value:
13397     <?xml version="1.0"?>
13398     <!DOCTYPE p [
13399     <?$u3005b?>
13400     ]><p/>
13401     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]> { (3, 3)..(3, 4); }
13402     @@XMLTest:
13403     @@@QName: xp.name.pitarget.intsubset.1.1.3.test
13404     @@@DEnt:
13405     @@@@test:value:
13406     <?xml version="1.1"?>
13407     <!DOCTYPE p [
13408     <?$u3005b?>
13409     ]><p/>
13410     @@@test:domTree:
13411     document {
13412     xml-version: '1.1';
13413     document-type {
13414     pi {
13415     node-name: U+3005 'b';
13416     }
13417     }
13418     element { }
13419     }
13420     @@XMLTest:
13421     @@@QName: xp.name.pitarget.intsubset.names.1.0.1.test
13422     @@@DEnt:
13423     @@@@test:value:
13424     <?xml version="1.0"?>
13425     <!DOCTYPE p [
13426     <?a:b?>
13427     ]><p/>
13428     @@@c:erred: <[[xp|nswf-legal-ncname]]> { (3, 3)..(3, 5); }
13429     @@XMLTest:
13430     @@@QName: xp.name.pitarget.intsubset.names.1.1.1.test
13431     @@@DEnt:
13432     @@@@test:value:
13433     <?xml version="1.1"?>
13434     <!DOCTYPE p [
13435     <?a:b?>
13436     ]><p/>
13437     @@@c:erred: <[[xp|nswf-legal-ncname]]> { (3, 3)..(3, 5); }
13438     @@XMLTest:
13439     @@@QName: xp.name.doctypedecl.stag.etag.1.0.2.test
13440     @@@DEnt:
13441     @@@@test:value:
13442     <?xml version="1.0"?>
13443     <!DOCTYPE $u3001$u3002>
13444     <$u3001$u3002>
13445     </$u3001$u3002>
13446     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (2, 11)..(2, 12); }
13447     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (3, 2)..(3, 3); }
13448     # @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (4, 3)..(4, 4); }
13449     @@XMLTest:
13450     @@@QName: xp.name.doctypedecl.stag.etag.1.1.2.test
13451     @@@DEnt:
13452     @@@@test:value:
13453     <?xml version="1.1"?>
13454     <!DOCTYPE $u3001$u3002>
13455     <$u3001$u3002>
13456     </$u3001$u3002>
13457     @@@test:domTree:
13458     document {
13459     xml-version: '1.1';
13460     document-type {
13461     node-name: U+3001 U+3002;
13462     }
13463     element {
13464     node-name: U+3001 U+3002;
13465     }
13466     }
13467     @@XMLTest:
13468     @@@QName: xp.name.doctypedecl.stag.etag.1.0.3.test
13469     @@@DEnt:
13470     @@@@test:value:
13471     <?xml version="1.0"?>
13472     <!DOCTYPE $u3005b>
13473     <$u3005b>
13474     </$u3005b>
13475     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (2, 11)..(2, 12); }
13476     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (3, 2)..(3, 3); }
13477     # @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (4, 3)..(4, 4); }
13478     @@XMLTest:
13479     @@@QName: xp.name.doctype.decl.stag.etag.1.1.3.test
13480     @@@DEnt:
13481     @@@@test:value:
13482     <?xml version="1.1"?>
13483     <!DOCTYPE $u3005b>
13484     <$u3005b>
13485     </$u3005b>
13486     @@@test:domTree:
13487     document {
13488     xml-version: '1.1';
13489     document-type {
13490     node-name: U+3005 'b';
13491     }
13492     element {
13493     node-name: U+3005 'b';
13494     }
13495     }
13496     @@XMLTest:
13497     @@@QName: xp.name.doctypedecl.stag.etag.names.1.0.1.test
13498     @@@DEnt:
13499     @@@@test:value:
13500     <?xml version="1.0"?>
13501     <!DOCTYPE a:b>
13502     <a:b xmlns:a="http://a.example/">
13503     </a:b>
13504     @@@test:domTree:
13505     document {
13506     xml-version: '1.0';
13507     document-type {
13508     node-name: 'a:b';
13509     }
13510     element {
13511     prefix: 'a';
13512     local-name: 'b';
13513     namespace-uri: 'http://a.example/';
13514     attribute {
13515     namespace-uri: 'http://www.w3.org/2000/xmlns/';
13516     prefix: 'xmlns';
13517     local-name: 'a';
13518     value: 'http://a.example/';
13519     specified: true;
13520     }
13521     }
13522     }
13523     @@XMLTest:
13524     @@@QName: xp.name.doctypedecl.stag.etag.names.1.1.1.test
13525     @@@DEnt:
13526     @@@@test:value:
13527     <?xml version="1.1"?>
13528     <!DOCTYPE a:b>
13529     <a:b xmlns:a="http://a.example/">
13530     </a:b>
13531     @@@test:domTree:
13532     document {
13533     xml-version: '1.1';
13534     document-type {
13535     node-name: 'a:b';
13536     }
13537     element {
13538     prefix: 'a';
13539     local-name: 'b';
13540     namespace-uri: 'http://a.example/';
13541     attribute {
13542     namespace-uri: 'http://www.w3.org/2000/xmlns/';
13543     prefix: 'xmlns';
13544     local-name: 'a';
13545     specified: true;
13546     }
13547     }
13548     }
13549     @@XMLTest:
13550     @@@QName: xp.name.doctypedecl.stag.etag.names.1.0.2.test
13551     @@@DEnt:
13552     @@@@test:value:
13553     <?xml version="1.0"?>
13554     <!DOCTYPE :ab>
13555     <:ab>
13556     </:ab>
13557     @@@c:erred: <[[xp|nswf-legal-qname]]> { (2, 11)..(2, 13); }
13558     @@@c:erred: <[[xp|nswf-legal-qname]]> { (3, 2)..(3, 4); }
13559     @@@c:erred: <[[xp|nsc-prefix-declared]]> { /* prefix || */ }
13560     @@XMLTest:
13561     @@@QName: xp.name.doctypedecl.stag.etag.names.1.1.2.test
13562     @@@DEnt:
13563     @@@@test:value:
13564     <?xml version="1.1"?>
13565     <!DOCTYPE :ab>
13566     <:ab>
13567     </:ab>
13568     @@@c:erred: <[[xp|nswf-legal-qname]]> { (2, 11)..(2, 13); }
13569     @@@c:erred: <[[xp|nswf-legal-qname]]> { (3, 2)..(3, 4); }
13570     @@@c:erred: <[[xp|nsc-prefix-declared]]> { /* prefix || */ }
13571     @@XMLTest:
13572     @@@QName: xp.name.doctypedecl.stag.etag.names.1.0.3.test
13573     @@@DEnt:
13574     @@@@test:value:
13575     <?xml version="1.0"?>
13576     <!DOCTYPE a:$u3005>
13577     <a:$u3005 xmlns:a="http://a.example/">
13578     </a:$u3005>
13579     @@@c:erred: <[[xp|nswf-legal-qname]]> { (2, 11)..(2, 13); }
13580     @@@c:erred: <[[xp|nswf-legal-qname]]> { (3, 2)..(3, 4); }
13581     @@XMLTest:
13582     @@@QName: xp.name.doctypedecl.stag.etag.names.1.1.3.test
13583     @@@DEnt:
13584     @@@@test:value:
13585     <?xml version="1.1"?>
13586     <!DOCTYPE a:$u3005>
13587     <a:$u3005 xmlns:a="http://a.example/">
13588     </a:$u3005>
13589     @@@test:domTree:
13590     document {
13591     xml-version: '1.1';
13592     document-type {
13593     node-name: 'a:' U+3005;
13594     }
13595     element {
13596     prefix: 'a';
13597     local-name: U+3005;
13598     namespace-uri: 'http://a.example/';
13599     attribute {
13600     namespace-uri: 'http://www.w3.org/2000/xmlns/';
13601     prefix: 'xmlns';
13602     local-name: 'a';
13603     value: 'http://a.example/';
13604     specified: true;
13605     }
13606     }
13607     }
13608     @@XMLTest:
13609     @@@QName: xp.name.doctypedecl.stag.etag.names.1.0.4.test
13610     @@@DEnt:
13611     @@@@test:value:
13612     <?xml version="1.0"?>
13613     <!DOCTYPE a:b>
13614     <a:b>
13615     </a:b>
13616     @@@c:erred: <[[xp|nsc-prefix-declared]]> { (3, 1)..(3, 5); }
13617     @@XMLTest:
13618     @@@QName: xp.name.doctypedecl.stag.etag.names.1.1.4.test
13619     @@@DEnt:
13620     @@@@test:value:
13621     <?xml version="1.1"?>
13622     <!DOCTYPE a:b>
13623     <a:b>
13624     </a:b>
13625     @@@c:erred: <[[xp|nsc-prefix-declared]]> { (3, 1)..(3, 5); }
13626     @@XMLTest:
13627     @@@QName: xp.name.emptyelemtag.1.0.2.test
13628     @@@DEnt:
13629     @@@@test:value:
13630     <?xml version="1.0"?>
13631     <$u3001$u3002/>
13632     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (2, 2)..(2, 3); }
13633     @@XMLTest:
13634     @@@QName: xp.name.emptyelemtag.1.1.2.test
13635     @@@DEnt:
13636     @@@@test:value:
13637     <?xml version="1.1"?>
13638     <$u3001$u3002/>
13639     @@@test:domTree:
13640     document {
13641     xml-version: '1.1';
13642     element {
13643     node-name: U+3001 U+3002;
13644     }
13645     }
13646     @@XMLTest:
13647     @@@QName: xp.name.emptyelemtag.1.0.3.test
13648     @@@DEnt:
13649     @@@@test:value:
13650     <?xml version="1.0"?>
13651     <$u3005b/>
13652     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (2, 2)..(2, 3); }
13653     @@XMLTest:
13654     @@@QName: xp.name.emptyelemtag.1.1.3.test
13655     @@@DEnt:
13656     @@@@test:value:
13657     <?xml version="1.1"?>
13658     <$u3005b/>
13659     @@@test:domTree:
13660     document {
13661     xml-version: '1.1';
13662     element {
13663     node-name: U+3005 'b';
13664     }
13665     }
13666     @@XMLTest:
13667     @@@QName: xp.name.emptyelemtag.names.1.0.1.test
13668     @@@DEnt:
13669     @@@@test:value:
13670     <?xml version="1.0"?>
13671     <a:b/>
13672     @@@c:erred: <[[xp|nsc-prefix-declared]]>{ (2, 1)..(2, 6); }
13673     @@XMLTest:
13674     @@@QName: xp.name.emptyelemtag.names.1.1.1.test
13675     @@@DEnt:
13676     @@@@test:value:
13677     <?xml version="1.1"?>
13678     <a:b/>
13679     @@@c:erred: <[[xp|nsc-prefix-declared]]>{ (2, 1)..(2, 6); }
13680     @@XMLTest:
13681     @@@QName: xp.name.attr.1.0.2.test
13682     @@@DEnt:
13683     @@@@test:value:
13684     <?xml version="1.0"?>
13685     <a $u3001$u3002=""/>
13686     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (2, 4)..(2, 5); }
13687     @@XMLTest:
13688     @@@QName: xp.name.attr.1.1.2.test
13689     @@@DEnt:
13690     @@@@test:value:
13691     <?xml version="1.1"?>
13692     <a $u3001$u3002=""/>
13693     @@@test:domTree:
13694     document {
13695     xml-version: '1.1';
13696     element {
13697     attribute {
13698     node-name: U+3001 U+3002;
13699     }
13700     }
13701     }
13702     @@XMLTest:
13703     @@@QName: xp.name.attr.1.0.3.test
13704     @@@DEnt:
13705     @@@@test:value:
13706     <?xml version="1.0"?>
13707     <a $u3005b=""/>
13708     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (2, 4)..(2, 5); }
13709     @@XMLTest:
13710     @@@QName: xp.name.attr.1.1.3.test
13711     @@@DEnt:
13712     @@@@test:value:
13713     <?xml version="1.1"?>
13714     <a $u3005b=""/>
13715     @@@test:domTree:
13716     document {
13717     xml-version: '1.1';
13718     element {
13719     attribute {
13720     node-name: U+3005 'b';
13721     }
13722     }
13723     }
13724     @@XMLTest:
13725     @@@QName: xp.name.attr.names.1.0.1.test
13726     @@@DEnt:
13727     @@@@test:value:
13728     <?xml version="1.0"?>
13729     <a a:b=""/>
13730     @@@c:erred: <[[xp|nsc-prefix-declared]]>{ (2, 1)..(2, 11); }
13731     @@XMLTest:
13732     @@@QName: xp.name.attr.names.1.1.1.test
13733     @@@DEnt:
13734     @@@@test:value:
13735     <?xml version="1.1"?>
13736     <a a:b=""/>
13737     @@@c:erred: <[[xp|nsc-prefix-declared]]>{ (2, 1)..(2, 11); }
13738     @@XMLTest:
13739     @@@QName: xp.name.attr.names.1.0.2.test
13740     @@@DEnt:
13741     @@@@test:value:
13742     <?xml version="1.0"?>
13743     <a :ab=""/>
13744     @@@c:erred: <[[xp|nswf-legal-qname]]>{ (2, 4)..(2, 6); }
13745     @@@c:erred: <[[xp|nsc-prefix-declared]]> { }
13746     @@XMLTest:
13747     @@@QName: xp.name.attr.names.1.1.2.test
13748     @@@DEnt:
13749     @@@@test:value:
13750     <?xml version="1.1"?>
13751     <a :ab=""/>
13752     @@@c:erred: <[[xp|nswf-legal-qname]]>{ (2, 4)..(2, 6); }
13753     @@@c:erred: <[[xp|nsc-prefix-declared]]> { }
13754     @@XMLTest:
13755     @@@QName: xp.name.attlist.1.0.2.test
13756     @@@DEnt:
13757     @@@@test:value:
13758     <?xml version="1.0"?>
13759     <!DOCTYPE p [
13760     <!NOTATION $u3001$u3002 SYSTEM "n">
13761     <!ATTLIST $u3001$u3002
13762     $u3001$u3002
13763     NOTATION
13764     ($u3001$u3002)
13765     #IMPLIED>
13766     ]><p/>
13767     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (3, 12)..(3, 13); }
13768     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (4, 11)..(4, 12); }
13769     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (5, 1)..(5, 2); }
13770     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (7, 2)..(7, 3); }
13771     @@XMLTest:
13772     @@@QName: xp.name.attlist.1.1.2.test
13773     @@@DEnt:
13774     @@@@test:value:
13775     <?xml version="1.1"?>
13776     <!DOCTYPE p [
13777     <!NOTATION $u3001$u3002 SYSTEM "n">
13778     <!ATTLIST $u3001$u3002
13779     $u3001$u3002
13780     NOTATION
13781     ($u3001$u3002)
13782     #IMPLIED>
13783     ]><p/>
13784     @@@test:domTree:
13785     document {
13786     xml-version: '1.1';
13787     document-type {
13788     notation {
13789     node-name: U+3001 U+3002;
13790     }
13791     element-type-definition {
13792     node-name: U+3001 U+3002;
13793     attribute-definition {
13794     node-name: U+3001 U+3002;
13795     allowed-tokens: DOMStringList (U+3001 U+3002);
13796     }
13797     }
13798     }
13799     element { }
13800     }
13801     @@XMLTest:
13802     @@@QName: xp.name.attlist.1.0.3.test
13803     @@@DEnt:
13804     @@@@test:value:
13805     <?xml version="1.0"?>
13806     <!DOCTYPE p [
13807     <!NOTATION $u3005b SYSTEM "n">
13808     <!ATTLIST $u3005b
13809     $u3005b
13810     NOTATION
13811     ($u3005b)
13812     #IMPLIED>
13813     ]><p/>
13814     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (3, 12)..(3, 13); }
13815     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (4, 11)..(4, 12); }
13816     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (5, 1)..(5, 2); }
13817     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (7, 2)..(7, 3); }
13818     @@XMLTest:
13819     @@@QName: xp.name.attlist.1.1.3.test
13820     @@@DEnt:
13821     @@@@test:value:
13822     <?xml version="1.1"?>
13823     <!DOCTYPE p [
13824     <!NOTATION $u3005b SYSTEM "n">
13825     <!ATTLIST $u3005b
13826     $u3005b
13827     NOTATION
13828     ($u3005b)
13829     #IMPLIED>
13830     ]><p/>
13831     @@@test:domTree:
13832     document {
13833     xml-version: '1.1';
13834     document-type {
13835     notation {
13836     node-name: U+3005 'b';
13837     }
13838     element-type-definition {
13839     node-name: U+3005 'b';
13840     attribute-definition {
13841     node-name: U+3005 'b';
13842     allowed-tokens: DOMStringList (U+3005 'b');
13843     }
13844     }
13845     }
13846     element { }
13847     }
13848     @@XMLTest:
13849     @@@QName: xp.name.attlist.names.1.0.1.test
13850     @@@DEnt:
13851     @@@@test:value:
13852     <?xml version="1.0"?>
13853     <!DOCTYPE p [
13854     <!NOTATION a:b SYSTEM "n">
13855     <!ATTLIST a:b
13856     a:b
13857     NOTATION
13858     (a:b)
13859     #IMPLIED>
13860     ]><p/>
13861     @@@c:erred: <[[xp|nswf-legal-ncname]]>{ (3, 12)..(3, 14); }
13862     @@@c:erred: <[[xp|nswf-legal-ncname]]>{ (7, 2)..(7, 4); }
13863     @@XMLTest:
13864     @@@QName: xp.name.attlist.names.1.1.1.test
13865     @@@DEnt:
13866     @@@@test:value:
13867     <?xml version="1.1"?>
13868     <!DOCTYPE p [
13869     <!NOTATION a:b SYSTEM "n">
13870     <!ATTLIST a:b
13871     a:b
13872     NOTATION
13873     (a:b)
13874     #IMPLIED>
13875     ]><p/>
13876     @@@c:erred: <[[xp|nswf-legal-ncname]]>{ (3, 12)..(3, 14); }
13877     @@@c:erred: <[[xp|nswf-legal-ncname]]>{ (7, 2)..(7, 4); }
13878     @@XMLTest:
13879     @@@QName: xp.name.attlist.names.1.0.2.test
13880     @@@DEnt:
13881     @@@@test:value:
13882     <?xml version="1.0"?>
13883     <!DOCTYPE p [
13884     <!NOTATION :ab SYSTEM "n">
13885     <!ATTLIST :ab
13886     :ab
13887     NOTATION
13888     (:ab)
13889     #IMPLIED>
13890     ]><p/>
13891     @@@c:erred: <[[xp|nswf-legal-ncname]]>{ (3, 12)..(3, 14); }
13892     @@@c:erred: <[[xp|nswf-legal-qname]]>{ (4, 11)..(4, 13); }
13893     @@@c:erred: <[[xp|nswf-legal-qname]]>{ (5, 1)..(5, 3); }
13894     @@@c:erred: <[[xp|nswf-legal-ncname]]>{ (7, 2)..(7, 4); }
13895     @@XMLTest:
13896     @@@QName: xp.name.attlist.names.1.1.2.test
13897     @@@DEnt:
13898     @@@@test:value:
13899     <?xml version="1.1"?>
13900     <!DOCTYPE p [
13901     <!NOTATION :ab SYSTEM "n">
13902     <!ATTLIST :ab
13903     :ab
13904     NOTATION
13905     (:ab)
13906     #IMPLIED>
13907     ]><p/>
13908     @@@c:erred: <[[xp|nswf-legal-ncname]]>{ (3, 12)..(3, 14); }
13909     @@@c:erred: <[[xp|nswf-legal-qname]]>{ (4, 11)..(4, 13); }
13910     @@@c:erred: <[[xp|nswf-legal-qname]]>{ (5, 1)..(5, 3); }
13911     @@@c:erred: <[[xp|nswf-legal-ncname]]>{ (7, 2)..(7, 4); }
13912     @@XMLTest:
13913     @@@QName: xp.name.gent.1.0.2.test
13914     @@@DEnt:
13915     @@@@test:value:
13916     <?xml version="1.0"?>
13917     <!DOCTYPE p [
13918     <!ENTITY $u3001$u3002 "n">
13919     ]>
13920     <p a="&$u3001$u3002;">
13921     &$u3001$u3002;
13922     </p>
13923     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (3, 10)..(3, 11); }
13924     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (5, 8)..(5, 9); }
13925     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (6, 2)..(6, 3); }
13926     @@XMLTest:
13927     @@@QName: xp.name.ger.1.1.2.test
13928     @@@DEnt:
13929     @@@@test:value:
13930     <?xml version="1.1"?>
13931     <!DOCTYPE p [
13932     <!ENTITY $u3001$u3002 "n">
13933     ]>
13934     <p a="&$u3001$u3002;">$
13935     &$u3001$u3002;$
13936     </p>
13937     @@@test:domTree:
13938     document {
13939     xml-version: '1.1';
13940     document-type {
13941     general-entity {
13942     node-name: U+3001 U+3002;
13943     }
13944     }
13945     element {
13946     attribute {
13947     node-name: 'a';
13948     general-entity-reference {
13949     node-name: U+3001 U+3002;
13950     }
13951     }
13952     general-entity-reference {
13953     node-name: U+3001 U+3002;
13954     }
13955     }
13956     }
13957     @@XMLTest:
13958     @@@QName: xp.name.ger.1.0.3.test
13959     @@@DEnt:
13960     @@@@test:value:
13961     <?xml version="1.0"?>
13962     <!DOCTYPE p [
13963     <!ENTITY $u3005b "n">
13964     ]>
13965     <p a="&$u3005b;">
13966     &$u3005b;
13967     </p>
13968     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (3, 10)..(3, 11); }
13969     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (5, 8)..(5, 9); }
13970     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (6, 2)..(6, 3); }
13971     @@XMLTest:
13972     @@@QName: xp.name.ger.1.1.3.test
13973     @@@DEnt:
13974     @@@@test:value:
13975     <?xml version="1.1"?>
13976     <!DOCTYPE p [
13977     <!ENTITY $u3005b "n">
13978     ]>
13979     <p a="&$u3005b;">$
13980     &$u3005b;$
13981     </p>
13982     @@@test:domTree:
13983     document {
13984     xml-version: '1.1';
13985     document-type {
13986     general-entity {
13987     node-name: U+3005 'b';
13988     }
13989     }
13990     element {
13991     attribute {
13992     node-name: 'a';
13993     general-entity-reference {
13994     node-name: U+3005 'b';
13995     }
13996     }
13997     general-entity-reference {
13998     node-name: U+3005 'b';
13999     }
14000     }
14001     }
14002     @@XMLTest:
14003     @@@QName: xp.name.ger.names.1.0.1.test
14004     @@@DEnt:
14005     @@@@test:value:
14006     <?xml version="1.0"?>
14007     <!DOCTYPE p [
14008     <!ENTITY a:b "n">
14009     ]>
14010     <p a="&a:b;">
14011     &a:b;
14012     </p>
14013     @@@c:erred: <[[xp|nswf-legal-ncname]]>{ (3, 10)..(3, 12); }
14014     @@@c:erred: <[[xp|nswf-legal-ncname]]>{ (5, 8)..(5, 10); }
14015     @@@c:erred: <[[xp|nswf-legal-ncname]]>{ (6, 2)..(6, 4); }
14016     @@XMLTest:
14017     @@@QName: xp.name.ger.names.1.1.1.test
14018     @@@DEnt:
14019     @@@@test:value:
14020     <?xml version="1.1"?>
14021     <!DOCTYPE p [
14022     <!ENTITY a:b "n">
14023     ]>
14024     <p a="&a:b;">
14025     &a:b;
14026     </p>
14027     @@@c:erred: <[[xp|nswf-legal-ncname]]>{ (3, 10)..(3, 12); }
14028     @@@c:erred: <[[xp|nswf-legal-ncname]]>{ (5, 8)..(5, 10); }
14029     @@@c:erred: <[[xp|nswf-legal-ncname]]>{ (6, 2)..(6, 4); }
14030     @@XMLTest:
14031     @@@QName: xp.name.ndata.1.0.2.test
14032     @@@DEnt:
14033     @@@@test:value:
14034     <?xml version="1.0"?>
14035     <!DOCTYPE p [
14036     <!NOTATION $u3001$u3002 SYSTEM "n">
14037     <!ENTITY e SYSTEM "s" NDATA $u3001$u3002>
14038     ]><p/>
14039     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (3, 12)..(3, 13); }
14040     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (4, 29)..(4, 30); }
14041     @@XMLTest:
14042     @@@QName: xp.name.ndata.1.1.2.test
14043     @@@DEnt:
14044     @@@@test:value:
14045     <?xml version="1.1"?>
14046     <!DOCTYPE p [
14047     <!NOTATION $u3001$u3002 SYSTEM "n">
14048     <!ENTITY e SYSTEM "s" NDATA $u3001$u3002>
14049     ]><p/>
14050     @@@test:domTree:
14051     document {
14052     xml-version: '1.1';
14053     document-type {
14054     notation {
14055     node-name: U+3001 U+3002;
14056     }
14057     general-entity {
14058     node-name: 'e';
14059     notation-name: U+3001 U+3002;
14060     }
14061     }
14062     element { }
14063     }
14064     @@XMLTest:
14065     @@@QName: xp.name.ndata.1.0.3.test
14066     @@@DEnt:
14067     @@@@test:value:
14068     <?xml version="1.0"?>
14069     <!DOCTYPE p [
14070     <!NOTATION $u3005b SYSTEM "n">
14071     <!ENTITY e SYSTEM "s" NDATA $u3005b>
14072     ]><p/>
14073     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (3, 12)..(3, 13); }
14074     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (4, 29)..(4, 30); }
14075     @@XMLTest:
14076     @@@QName: xp.name.ndata.1.1.3.test
14077     @@@DEnt:
14078     @@@@test:value:
14079     <?xml version="1.1"?>
14080     <!DOCTYPE p [
14081     <!NOTATION $u3005b SYSTEM "n">
14082     <!ENTITY e SYSTEM "s" NDATA $u3005b>
14083     ]><p/>
14084     @@@test:domTree:
14085     document {
14086     xml-version: '1.1';
14087     document-type {
14088     notation {
14089     node-name: U+3005 'b';
14090     }
14091     general-entity {
14092     node-name: 'e';
14093     notation-name: U+3005 'b';
14094     }
14095     }
14096     element { }
14097     }
14098     @@XMLTest:
14099     @@@QName: xp.name.ndata.names.1.0.1.test
14100     @@@DEnt:
14101     @@@@test:value:
14102     <?xml version="1.0"?>
14103     <!DOCTYPE p [
14104     <!NOTATION a:b SYSTEM "n">
14105     <!ENTITY e SYSTEM "s" NDATA a:b>
14106     ]><p/>
14107     @@@c:erred: <[[xp|nswf-legal-ncname]]>{ (3, 12)..(3, 14); }
14108     @@@c:erred: <[[xp|nswf-legal-ncname]]>{ (4, 29)..(4, 31); }
14109     @@XMLTest:
14110     @@@QName: xp.name.ndata.names.1.1.1.test
14111     @@@DEnt:
14112     @@@@test:value:
14113     <?xml version="1.1"?>
14114     <!DOCTYPE p [
14115     <!NOTATION a:b SYSTEM "n">
14116     <!ENTITY e SYSTEM "s" NDATA a:b>
14117     ]><p/>
14118     @@@c:erred: <[[xp|nswf-legal-ncname]]>{ (3, 12)..(3, 14); }
14119     @@@c:erred: <[[xp|nswf-legal-ncname]]>{ (4, 29)..(4, 31); }
14120    
14121     @@enImplNote:
14122     @@@ddid: wf-invalid-character-in-node-name
14123     @@@@:
14124     {ISSUE::
14125     {P:: Tests required for:
14126    
14127     - <CODE::Name> in element type declaration
14128    
14129     - <CODE::Name> in model group
14130    
14131     - <CODE::Name> in parameter entity declaration
14132    
14133     - <CODE::Name> in parameter entity reference
14134    
14135     }
14136     }
14137    
14138     @@XMLTest:
14139     @@@QName: xp.NOTATION.1.test
14140     @@@DEnt:
14141     @@@@test:value:
14142     <!DOCTYPE p [
14143     <!NOTATION n SYSTEM "m">
14144     ]><p/>
14145     @@@test:domTree:
14146     document {
14147     document-type {
14148     notation {
14149     node-name: 'n';
14150     public-id: null;
14151     system-id: 'm';
14152     }
14153     }
14154     element { }
14155     }
14156     @@XMLTest:
14157     @@@QName: xp.NOTATION.2.test
14158     @@@DEnt:
14159     @@@@test:value:
14160     <!DOCTYPE p [
14161     <!NOTATION n PUBLIC "m">
14162     ]><p/>
14163     @@@test:domTree:
14164     document {
14165     document-type {
14166     notation {
14167     node-name: 'n';
14168     system-id: null;
14169     public-id: 'm';
14170     }
14171     }
14172     element { }
14173     }
14174     @@XMLTest:
14175     @@@QName: xp.NOTATION.3.test
14176     @@@DEnt:
14177     @@@@test:value:
14178     <!DOCTYPE p [
14179     <!NOTATION n PUBLIC "m" "l">
14180     ]><p/>
14181     @@@test:domTree:
14182     document {
14183     document-type {
14184     notation {
14185     node-name: 'n';
14186     public-id: 'm';
14187     system-id: 'l';
14188     }
14189     }
14190     element { }
14191     }
14192     @@XMLTest:
14193     @@@QName: xp.NOTATION.4.test
14194     @@@DEnt:
14195     @@@@test:value:
14196     <!DOCTYPE p [
14197     <!NOTATION n SYSTEM "m">
14198     <!NOTATION n SYSTEM "l">
14199     ]><p/>
14200     @@@c:erred: <[[xp|vc-unique-notation-name]]> { (3, 1)..(3, 24); }
14201     @@@test:domTree:
14202     document {
14203     document-type {
14204     notation {
14205     node-name: 'n';
14206     system-id: 'm';
14207     }
14208     }
14209     element { }
14210     }
14211    
14212     @@XMLTest:
14213     @@@QName: xp.names.1.test
14214     @@@DEnt:
14215     @@@@test:value:
14216     <p xmlns="http://1.example/" a="b"/>
14217     @@@test:domTree:
14218     document {
14219     element {
14220     prefix: null;
14221     local-name: 'p';
14222     namespace-uri: 'http://1.example/';
14223     attribute {
14224     prefix: null;
14225     local-name: 'xmlns';
14226     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14227     specified: true;
14228     }
14229     attribute {
14230     prefix: null;
14231     local-name: 'a';
14232     specified: true;
14233     }
14234     }
14235     }
14236     @@XMLTest:
14237     @@@QName: xp.names.2.test
14238     @@@DEnt:
14239     @@@@test:value:
14240     <p xmlns:a="http://1.example/" a="b" a:a="c"/>
14241     @@@test:domTree:
14242     document {
14243     element {
14244     prefix: null;
14245     local-name: 'p';
14246     namespace-uri: null;
14247     attribute {
14248     prefix: 'xmlns';
14249     local-name: 'a';
14250     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14251     specified: true;
14252     }
14253     attribute {
14254     prefix: null;
14255     local-name: 'a';
14256     specified: true;
14257     }
14258     attribute {
14259     prefix: 'a';
14260     local-name: 'a';
14261     namespace-uri: 'http://1.example/';
14262     specified: true;
14263     }
14264     }
14265     }
14266     @@XMLTest:
14267     @@@QName: xp.names.3.test
14268     @@@DEnt:
14269     @@@@test:value:
14270     <a:p xmlns:a="http://1.example/" a="b" a:a="c"/>
14271     @@@test:domTree:
14272     document {
14273     element {
14274     prefix: 'a';
14275     local-name: 'p';
14276     namespace-uri: 'http://1.example/';
14277     attribute {
14278     prefix: 'xmlns';
14279     local-name: 'a';
14280     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14281     specified: true;
14282     }
14283     attribute {
14284     prefix: null;
14285     local-name: 'a';
14286     specified: true;
14287     }
14288     attribute {
14289     prefix: 'a';
14290     local-name: 'a';
14291     namespace-uri: 'http://1.example/';
14292     specified: true;
14293     }
14294     }
14295     }
14296     @@XMLTest:
14297     @@@QName: xp.names.5.test
14298     @@@DEnt:
14299     @@@@test:value:
14300     <p xmlns:a="http://1.example/">$
14301     <a:q/>$
14302     </p>
14303     @@@test:domTree:
14304     document {
14305     element {
14306     prefix: null;
14307     local-name: 'p';
14308     namespace-uri: null;
14309     attribute {
14310     prefix: 'xmlns';
14311     local-name: 'a';
14312     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14313     specified: true;
14314     }
14315     element {
14316     prefix: 'a';
14317     local-name: 'q';
14318     namespace-uri: 'http://1.example/';
14319     }
14320     }
14321     }
14322     @@XMLTest:
14323     @@@QName: xp.names.6.test
14324     @@@DEnt:
14325     @@@@test:value:
14326     <p xmlns:a="http://1.example/">$
14327     <q a:b="c"/>$
14328     </p>
14329     @@@test:domTree:
14330     document {
14331     element {
14332     prefix: null;
14333     local-name: 'p';
14334     namespace-uri: null;
14335     attribute {
14336     prefix: 'xmlns';
14337     local-name: 'a';
14338     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14339     specified: true;
14340     }
14341     element {
14342     prefix: null;
14343     local-name: 'q';
14344     namespace-uri: null;
14345     attribute {
14346     prefix: 'a';
14347     local-name: 'b';
14348     namespace-uri: 'http://1.example/';
14349     specified: true;
14350     }
14351     }
14352     }
14353     }
14354     @@XMLTest:
14355     @@@QName: xp.names.7.test
14356     @@@DEnt:
14357     @@@@test:value:
14358     <p xmlns:a="http://1.example/">$
14359     <q a:b="c" xmlns:a="http://2.example/"/>$
14360     </p>
14361     @@@test:domTree:
14362     document {
14363     element {
14364     prefix: null;
14365     local-name: 'p';
14366     namespace-uri: null;
14367     attribute {
14368     prefix: 'xmlns';
14369     local-name: 'a';
14370     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14371     specified: true;
14372     }
14373     element {
14374     prefix: null;
14375     local-name: 'q';
14376     namespace-uri: null;
14377     attribute {
14378     prefix: 'a';
14379     local-name: 'b';
14380     namespace-uri: 'http://2.example/';
14381     specified: true;
14382     }
14383     attribute {
14384     prefix: 'xmlns';
14385     local-name: 'a';
14386     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14387     specified: true;
14388     }
14389     }
14390     }
14391     }
14392    
14393     @@XMLTest:
14394     @@@QName: xp.names.undeclare.1.test
14395     @@@DEnt:
14396     @@@@test:value:
14397     <p xmlns="http://1.example/">$
14398     <q xmlns="">$
14399     <r xmlns="http://2.example/"/>$
14400     </q>$
14401     </p>
14402     @@@test:domTree:
14403     document {
14404     element {
14405     prefix: null;
14406     local-name: 'p';
14407     namespace-uri: 'http://1.example/';
14408     attribute {
14409     prefix: null;
14410     local-name: 'xmlns';
14411     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14412     specified: true;
14413     }
14414     element {
14415     prefix: null;
14416     local-name: 'q';
14417     namespace-uri: null;
14418     attribute {
14419     prefix: null;
14420     local-name: 'xmlns';
14421     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14422     specified: true;
14423     }
14424     element {
14425     prefix: null;
14426     local-name: 'r';
14427     namespace-uri: 'http://2.example/';
14428     attribute {
14429     prefix: null;
14430     local-name: 'xmlns';
14431     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14432     specified: true;
14433     }
14434     }
14435     }
14436     }
14437     }
14438    
14439     @@XMLTest:
14440     @@@QName: xp.names.undeclare.1.0.1.test
14441     @@@DEnt:
14442     @@@@test:value:
14443     <?xml version="1.0"?>
14444     <a:p xmlns:a="http://1.example/">$
14445     <q xmlns:a="">$
14446     <a:r xmlns:a="http://2.example/"/>$
14447     </q>$
14448     </a:p>
14449     @@@c:erred: <[[xp|nswf-empty-namespace-name]]> { (2, 34)..(2, 47); }
14450     @@XMLTest:
14451     @@@QName: xp.names.undeclare.1.1.1.test
14452     @@@DEnt:
14453     @@@@test:value:
14454     <?xml version="1.1"?>
14455     <a:p xmlns:a="http://1.example/">$
14456     <q xmlns:a="">$
14457     <a:r xmlns:a="http://2.example/"/>$
14458     </q>$
14459     </a:p>
14460     @@@test:domTree:
14461     document {
14462     element {
14463     prefix: 'a';
14464     local-name: 'p';
14465     namespace-uri: 'http://1.example/';
14466     attribute {
14467     prefix: 'xmlns';
14468     local-name: 'a';
14469     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14470     specified: true;
14471     }
14472     element {
14473     prefix: null;
14474     local-name: 'q';
14475     namespace-uri: null;
14476     attribute {
14477     prefix: 'xmlns';
14478     local-name: 'a';
14479     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14480     specified: true;
14481     }
14482     element {
14483     prefix: 'a';
14484     local-name: 'r';
14485     namespace-uri: 'http://2.example/';
14486     attribute {
14487     prefix: 'xmlns';
14488     local-name: 'a';
14489     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14490     specified: true;
14491     }
14492     }
14493     }
14494     }
14495     }
14496     @@XMLTest:
14497     @@@QName: xp.names.undeclare.1.1.2.test
14498     @@@DEnt:
14499     @@@@test:value:
14500     <?xml version="1.1"?>
14501     <a:p xmlns:a="http://1.example/">$
14502     <q xmlns:a="">$
14503     <a:r/>$
14504     </q>$
14505     </a:p>
14506     @@@c:erred: <[[xp|nsc-prefix-declared]]> { (2, 48)..(2, 53); }
14507    
14508     @@XMLTest:
14509     @@@QName: xp.names.xml.prefix.1.test
14510     @@@DEnt:
14511     @@@@test:value:
14512     <a xmlns:xml="http://www.w3.org/XML/1998/namespace"/>
14513     @@@test:domTree:
14514     document {
14515     element {
14516     attribute {
14517     prefix: 'xmlns';
14518     local-name: 'xml';
14519     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14520     }
14521     }
14522     }
14523     @@XMLTest:
14524     @@@QName: xp.names.xml.prefix.2.test
14525     @@@DEnt:
14526     @@@@test:value:
14527     <a xmlns:xml="a"/>
14528     @@@c:erred: <[[xp|nsc-reserved-prefix-xml]]> { (1, 1)..(1, 18); }
14529     @@XMLTest:
14530     @@@QName: xp.names.xml.prefix.3.test
14531     @@@DEnt:
14532     @@@@test:value:
14533     <a xmlns:a="http://www.w3.org/XML/1998/namespace"
14534     />
14535     @@@c:erred: <[[xp|nsc-reserved-namespace-name-xml]]> { (1, 1)..(2, 2); }
14536     @@XMLTest:
14537     @@@QName: xp.names.xml.prefix.4.test
14538     @@@DEnt:
14539     @@@@test:value:
14540     <a xml:lang="ja"/>
14541     @@@test:domTree:
14542     document {
14543     element {
14544     attribute {
14545     prefix: 'xml';
14546     local-name: 'lang';
14547     namespace-uri: 'http://www.w3.org/XML/1998/namespace';
14548     }
14549     }
14550     }
14551    
14552     @@XMLTest:
14553     @@@QName: xp.names.prefix.declared.1.test
14554     @@@DEnt:
14555     @@@@test:value:
14556     <!DOCTYPE a [
14557     <!ATTLIST a
14558     b:c CDATA "d"
14559     >
14560     ]>
14561     <a/>
14562     @@@c:erred: <[[xp|nsc-prefix-declared]]> { (6, 1)..(6, 4); }
14563    
14564     @@XMLTest:
14565     @@@QName: xp.names.xmlns.reserved.1.test
14566     @@@DEnt:
14567     @@@@test:value:
14568     <a xmlns:xmlns="http://www.w3.org/2000/xmlns/"
14569     />
14570     @@@c:erred: <[[xp|nsc-reserved-prefix-xmlns]]> { (1, 1)..(2, 2); }
14571     @@@c:erred: <[[xp|nsc-reserved-namespace-name-xmlns]]> { (1, 1)..(2, 2); }
14572     @@XMLTest:
14573     @@@QName: xp.names.xmlns.reserved.2.test
14574     @@@DEnt:
14575     @@@@test:value:
14576     <a xmlns:xmlns="a"
14577     />
14578     @@@c:erred: <[[xp|nsc-reserved-prefix-xmlns]]> { (1, 1)..(2, 2); }
14579     @@XMLTest:
14580     @@@QName: xp.names.xmlns.reserved.3.test
14581     @@@DEnt:
14582     @@@@test:value:
14583     <a xmlns:a="http://www.w3.org/2000/xmlns/"
14584     />
14585     @@@c:erred: <[[xp|nsc-reserved-namespace-name-xmlns]]> { (1, 1)..(2, 2); }
14586    
14587     @@XMLTest:
14588     @@@QName: xp.names.default.1.test
14589     @@@DEnt:
14590     @@@@test:value:
14591     <!DOCTYPE a [
14592     <!ATTLIST a
14593     xmlns CDATA "http://1.example/">
14594     ]>
14595     <a/>
14596     @@@test:domTree:
14597     document {
14598     document-type {
14599     element-type-definition {
14600     node-name: 'a';
14601     attribute-definition {
14602     node-name: 'xmlns';
14603     node-value: 'http://1.example/';
14604     }
14605     }
14606     }
14607     element {
14608     prefix: null;
14609     local-name: 'a';
14610     namespace-uri: 'http://1.example/';
14611     attribute {
14612     prefix: null;
14613     local-name: 'xmlns';
14614     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14615     value: 'http://1.example/';
14616     specified: false;
14617     }
14618     }
14619     }
14620     @@XMLTest:
14621     @@@QName: xp.names.default.2.test
14622     @@@DEnt:
14623     @@@@test:value:
14624     <!DOCTYPE a [
14625     <!ATTLIST a
14626     xmlns CDATA "http://1.example/">
14627     ]>
14628     <a xmlns="http://2.example/"/>
14629     @@@test:domTree:
14630     document {
14631     document-type {
14632     element-type-definition {
14633     node-name: 'a';
14634     attribute-definition {
14635     node-name: 'xmlns';
14636     node-value: 'http://1.example/';
14637     }
14638     }
14639     }
14640     element {
14641     prefix: null;
14642     local-name: 'a';
14643     namespace-uri: 'http://2.example/';
14644     attribute {
14645     prefix: null;
14646     local-name: 'xmlns';
14647     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14648     value: 'http://2.example/';
14649     specified: true;
14650     }
14651     }
14652     }
14653     @@XMLTest:
14654     @@@QName: xp.names.default.3.test
14655     @@@DEnt:
14656     @@@@test:value:
14657     <!DOCTYPE b:a [
14658     <!ATTLIST b:a
14659     xmlns:b CDATA "http://1.example/">
14660     ]>
14661     <b:a/>
14662     @@@test:domTree:
14663     document {
14664     document-type {
14665     element-type-definition {
14666     node-name: 'b:a';
14667     attribute-definition {
14668     node-name: 'xmlns:b';
14669     node-value: 'http://1.example/';
14670     }
14671     }
14672     }
14673     element {
14674     prefix: 'b';
14675     local-name: 'a';
14676     namespace-uri: 'http://1.example/';
14677     attribute {
14678     prefix: 'xmlns';
14679     local-name: 'b';
14680     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14681     value: 'http://1.example/';
14682     specified: false;
14683     }
14684     }
14685     }
14686     @@XMLTest:
14687     @@@QName: xp.names.default.4.test
14688     @@@DEnt:
14689     @@@@test:value:
14690     <!DOCTYPE b:a [
14691     <!ATTLIST b:a
14692     xmlns:b CDATA "http://1.example/">
14693     ]>
14694     <b:a xmlns:b="http://2.example/"/>
14695     @@@test:domTree:
14696     document {
14697     document-type {
14698     element-type-definition {
14699     node-name: 'b:a';
14700     attribute-definition {
14701     node-name: 'xmlns:b';
14702     node-value: 'http://1.example/';
14703     }
14704     }
14705     }
14706     element {
14707     prefix: 'b';
14708     local-name: 'a';
14709     namespace-uri: 'http://2.example/';
14710     attribute {
14711     prefix: 'xmlns';
14712     local-name: 'b';
14713     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14714     value: 'http://2.example/';
14715     specified: true;
14716     }
14717     }
14718     }
14719     @@XMLTest:
14720     @@@QName: xp.names.default.5.test
14721     @@@DEnt:
14722     @@@@test:value:
14723     <!DOCTYPE a [
14724     <!ATTLIST a
14725     xmlns:b CDATA "http://1.example/"
14726     b:c CDATA "http://1.example/">
14727     ]>
14728     <a xmlns:b="http://2.example/"/>
14729     @@@test:domTree:
14730     document {
14731     document-type {
14732     element-type-definition {
14733     node-name: 'a';
14734     attribute-definition {
14735     node-name: 'xmlns:b';
14736     text-content: 'http://1.example/';
14737     }
14738     attribute-definition {
14739     node-name: 'b:c';
14740     text-content: 'http://1.example/';
14741     }
14742     }
14743     }
14744     element {
14745     prefix: null;
14746     local-name: 'a';
14747     namespace-uri: null;
14748     attribute {
14749     prefix: 'xmlns';
14750     local-name: 'b';
14751     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14752     value: 'http://2.example/';
14753     specified: true;
14754     }
14755     attribute {
14756     prefix: 'b';
14757     local-name: 'c';
14758     namespace-uri: 'http://2.example/';
14759     specified: false;
14760     }
14761     }
14762     }
14763    
14764     @@XMLTest:
14765     @@@QName: xp.names.unique.1.test
14766     @@@DEnt:
14767     @@@@test:value:
14768     <a
14769     xmlns:b="http://2.example/"
14770     xmlns:c="http://2.example/"
14771     b:d=""
14772     c:d=""
14773     />
14774     @@@c:erred: <[[xp|nswf-unique-att-spec-expanded-name]]> { (1, 1)..(6, 2); }
14775     @@XMLTest:
14776     @@@QName: xp.names.unique.2.test
14777     @@@DEnt:
14778     @@@@test:value:
14779     <!DOCTYPE a [
14780     <!ATTLIST a
14781     c:d CDATA ""
14782     >
14783     ]>
14784     <a
14785     xmlns:b="http://2.example/"
14786     xmlns:c="http://2.example/"
14787     b:d=""
14788     />
14789     @@@c:erred: <[[xp|nswf-unique-att-spec-expanded-name]]> { (6, 1)..(10, 2);}
14790     @@XMLTest:
14791     @@@QName: xp.names.unique.3.test
14792     @@@DEnt:
14793     @@@@test:value:
14794     <!DOCTYPE a [
14795     <!ATTLIST a
14796     c:d CDATA "value1"
14797     >
14798     ]>
14799     <a
14800     xmlns:c="http://2.example/"
14801     c:d="value2"
14802     />
14803     @@@test:domTree:
14804     document {
14805     document-type { }
14806     element {
14807     attribute {
14808     prefix: 'xmlns';
14809     local-name: 'c';
14810     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14811     specified: true;
14812     }
14813     attribute {
14814     prefix: 'c';
14815     local-name: 'd';
14816     namespace-uri: 'http://2.example/';
14817     value: 'value2';
14818     specified: true;
14819     }
14820     }
14821     }
14822    
14823     @@XMLTest:
14824     @@@QName: xp.names.normalize.1.test
14825     @@@DEnt:
14826     @@@@test:value:
14827     <!DOCTYPE a [
14828     <!ATTLIST a
14829     xmlns NMTOKEN #IMPLIED
14830     >
14831     ]>
14832     <a xmlns=" "/>
14833     @@@test:domTree:
14834     document {
14835     document-type { }
14836     element {
14837     namespace-uri: null;
14838     prefix: null;
14839     local-name: 'a';
14840     }
14841     }
14842     @@XMLTest:
14843     @@@QName: xp.names.normalize.2.test
14844     @@@DEnt:
14845     @@@@test:value:
14846     <!DOCTYPE a [
14847     <!ATTLIST a
14848     xmlns NMTOKEN #IMPLIED
14849     >
14850     ]>
14851     <a xmlns=" about:blank "/>
14852     @@@test:domTree:
14853     document {
14854     document-type { }
14855     element {
14856     namespace-uri: 'about:blank';
14857     prefix: null;
14858     local-name: 'a';
14859     }
14860     }
14861     @@XMLTest:
14862     @@@QName: xp.names.normalize.3.test
14863     @@@DEnt:
14864     @@@@test:value:
14865     <!DOCTYPE a:a [
14866     <!ATTLIST a:a
14867     xmlns:a NMTOKEN #IMPLIED
14868     >
14869     ]>
14870     <a:a xmlns:a=" about:blank "/>
14871     @@@test:domTree:
14872     document {
14873     document-type { }
14874     element {
14875     namespace-uri: 'about:blank';
14876     prefix: 'a';
14877     local-name: 'a';
14878     }
14879     }
14880    
14881 wakaba 1.29 @@XMLTest:
14882     @@@QName: xp.no.baseuri.test
14883     @@@DEnt:
14884     @@@@test:value:
14885     <p/>
14886     @@@test:domTree:
14887     document {
14888     document-uri: null;
14889     base-uri: null;
14890     element {
14891     node-name: 'p';
14892     base-uri: null;
14893     }
14894     }
14895     @@XMLTest:
14896     @@@QName: xp.docuri.no.baseuri.test
14897     @@@DEnt:
14898     @@@@test:uri:
14899     http://www.example.com/
14900     @@@@test:value:
14901     <p/>
14902     @@@test:domTree:
14903     document {
14904     document-uri: 'http://www.example.com/';
14905     base-uri: 'http://www.example.com/';
14906     element {
14907     node-name: 'p';
14908     base-uri: 'http://www.example.com/';
14909     }
14910     }
14911     @@XMLTest:
14912     @@@QName: xp.docuri.baseuri.test
14913     @@@DEnt:
14914     @@@@test:uri:
14915     http://www.example.com/
14916     @@@@test:baseURI:
14917     ftp://ftp.example.com/
14918     @@@@test:value:
14919     <p/>
14920     @@@test:domTree:
14921     document {
14922     document-uri: 'http://www.example.com/';
14923     base-uri: 'ftp://ftp.example.com/';
14924     element {
14925     node-name: 'p';
14926     base-uri: 'ftp://ftp.example.com/';
14927     }
14928     }
14929     @@XMLTest:
14930     @@@QName: xp.doctype.baseuri.test
14931     @@@DEnt:
14932     @@@@test:uri:
14933     http://www.example.com/
14934     @@@@test:baseURI:
14935     ftp://ftp.example.com/
14936     @@@@test:value:
14937     <!DOCTYPE p SYSTEM "sys">
14938     <p/>
14939     @@@test:domTree:
14940     document {
14941     document-uri: 'http://www.example.com/';
14942     base-uri: 'ftp://ftp.example.com/';
14943     document-type {
14944     system-id: 'sys';
14945     manakai-declaration-base-uri: 'ftp://ftp.example.com/';
14946     }
14947     element {
14948     node-name: 'p';
14949     base-uri: 'ftp://ftp.example.com/';
14950     }
14951     }
14952     @@XMLTest:
14953     @@@QName: xp.entdecl.baseuri.test
14954     @@@DEnt:
14955     @@@@test:uri:
14956     http://www.example.com/
14957     @@@@test:baseURI:
14958     ftp://ftp.example.com/
14959     @@@@test:value:
14960     <!DOCTYPE p [
14961     <!ENTITY ent SYSTEM "ent">
14962     ]>
14963     <p/>
14964     @@@test:domTree:
14965     document {
14966     document-uri: 'http://www.example.com/';
14967     base-uri: 'ftp://ftp.example.com/';
14968     document-type {
14969     general-entity {
14970     node-name: 'ent';
14971     manakai-declaration-base-uri: 'ftp://ftp.example.com/';
14972     }
14973     }
14974     element {
14975     node-name: 'p';
14976     base-uri: 'ftp://ftp.example.com/';
14977     }
14978     }
14979     @@XMLTest:
14980     @@@QName: xp.notdecl.baseuri.test
14981     @@@DEnt:
14982     @@@@test:uri:
14983     http://www.example.com/
14984     @@@@test:baseURI:
14985     ftp://ftp.example.com/
14986     @@@@test:value:
14987     <!DOCTYPE p [
14988     <!NOTATION not SYSTEM "not">
14989     ]>
14990     <p/>
14991     @@@test:domTree:
14992     document {
14993     document-uri: 'http://www.example.com/';
14994     base-uri: 'ftp://ftp.example.com/';
14995     document-type {
14996     notation {
14997     node-name: 'not';
14998     manakai-declaration-base-uri: 'ftp://ftp.example.com/';
14999     }
15000     }
15001     element {
15002     node-name: 'p';
15003     base-uri: 'ftp://ftp.example.com/';
15004     }
15005     }
15006     @@XMLTest:
15007     @@@QName: xp.doctype.intsubset.pi.baseuri.test
15008     @@@DEnt:
15009     @@@@test:uri:
15010     http://www.example.com/
15011     @@@@test:baseURI:
15012     ftp://ftp.example.com/
15013     @@@@test:value:
15014     <!DOCTYPE p [
15015     <?pi?>
15016     ]>
15017     <p/>
15018     @@@test:domTree:
15019     document {
15020     document-uri: 'http://www.example.com/';
15021     base-uri: 'ftp://ftp.example.com/';
15022     document-type {
15023     pi {
15024     node-name: 'pi';
15025     base-uri: 'ftp://ftp.example.com/';
15026     }
15027     }
15028     element {
15029     node-name: 'p';
15030     base-uri: 'ftp://ftp.example.com/';
15031     }
15032     }
15033    
15034 wakaba 1.30 @@XMLTest:
15035     @@@QName: xp.xmlid.attr.test
15036     @@@DEnt:
15037     @@@@test:value:
15038     <p xml:id="idv"/>
15039 wakaba 1.34 @@@cfg:xml-id: 1
15040 wakaba 1.30 @@@test:domTree:
15041     document {
15042     element {
15043     attribute {
15044     node-name: 'xml:id';
15045     value: 'idv';
15046     schema-type-info: TypeInfo ('http://www.w3.org/TR/REC-xml',
15047     'ID');
15048     specified: true;
15049     }
15050     }
15051     }
15052     @@XMLTest:
15053 wakaba 1.34 @@@QName: xp.xmlid.attr.disabled.test
15054     @@@DEnt:
15055     @@@@test:value:
15056     <p xml:id="idv"/>
15057     @@@cfg:xml-id: 0
15058     @@@test:domTree:
15059     document {
15060     element {
15061     attribute {
15062     node-name: 'xml:id';
15063     value: 'idv';
15064     schema-type-info: TypeInfo (null, null);
15065     specified: true;
15066     }
15067     }
15068     }
15069     @@XMLTest:
15070 wakaba 1.30 @@@QName: xp.xmlid.attr.norm.test
15071     @@@DEnt:
15072     @@@@test:value:
15073     <p xml:id=" $u000Aidv "/>
15074 wakaba 1.34 @@@cfg:xml-id: 1
15075 wakaba 1.30 @@@test:domTree:
15076     document {
15077     element {
15078     attribute {
15079     node-name: 'xml:id';
15080     value: 'idv';
15081     schema-type-info: TypeInfo ('http://www.w3.org/TR/REC-xml',
15082     'ID');
15083     specified: true;
15084     }
15085     }
15086     }
15087     @@XMLTest:
15088 wakaba 1.34 @@@QName: xp.xmlid.attr.norm.disabled.test
15089     @@@DEnt:
15090     @@@@test:value:
15091     <p xml:id=" $u000Aidv "/>
15092     @@@cfg:xml-id: 0
15093     @@@test:domTree:
15094     document {
15095     element {
15096     attribute {
15097     node-name: 'xml:id';
15098     value: ' idv ';
15099     schema-type-info: TypeInfo (null, null);
15100     specified: true;
15101     }
15102     }
15103     }
15104     @@XMLTest:
15105 wakaba 1.30 @@@QName: xp.xmlid.attrdef.test
15106     @@@DEnt:
15107     @@@@test:value:
15108     <!DOCTYPE p [
15109     <!ATTLIST p xml:id ID #IMPLIED>
15110     ]>
15111     <p/>
15112 wakaba 1.34 @@@cfg:xml-id: 1
15113     @@@test:domTree:
15114     document {
15115     document-type {
15116     element-type-definition {
15117     node-name: 'p';
15118     attribute-definition {
15119     node-name: 'xml:id';
15120     declared-type: const (ID_ATTR);
15121     default-type: const (IMPLIED_DEFAULT);
15122     }
15123     }
15124     }
15125     element { }
15126     }
15127     @@XMLTest:
15128     @@@QName: xp.xmlid.attrdef.disabled.test
15129     @@@DEnt:
15130     @@@@test:value:
15131     <!DOCTYPE p [
15132     <!ATTLIST p xml:id ID #IMPLIED>
15133     ]>
15134     <p/>
15135     @@@cfg:xml-id: 0
15136 wakaba 1.30 @@@test:domTree:
15137     document {
15138     document-type {
15139     element-type-definition {
15140     node-name: 'p';
15141     attribute-definition {
15142     node-name: 'xml:id';
15143     declared-type: const (ID_ATTR);
15144     default-type: const (IMPLIED_DEFAULT);
15145     }
15146     }
15147     }
15148     element { }
15149     }
15150     @@XMLTest:
15151     @@@QName: xp.xmlid.attrdef.defaultattr.test
15152     @@@DEnt:
15153     @@@@test:value:
15154     <!DOCTYPE p [
15155     <!ATTLIST p xml:id ID "idv"><!-- invalid -->
15156     ]>
15157     <p/>
15158 wakaba 1.34 @@@cfg:xml-id: 1
15159     @@@test:domTree:
15160     document {
15161     document-type {
15162     element-type-definition {
15163     node-name: 'p';
15164     attribute-definition {
15165     node-name: 'xml:id';
15166     declared-type: const (ID_ATTR);
15167     default-type: const (EXPLICIT_DEFAULT);
15168     node-value: 'idv';
15169     }
15170     }
15171     }
15172     element {
15173     attribute {
15174     node-name: 'xml:id';
15175     schema-type-info: TypeInfo ('http://www.w3.org/TR/REC-xml',
15176     'ID');
15177     value: 'idv';
15178     specified: false;
15179     }
15180     }
15181     }
15182     @@XMLTest:
15183     @@@QName: xp.xmlid.attrdef.defaultattr.disabled.test
15184     @@@DEnt:
15185     @@@@test:value:
15186     <!DOCTYPE p [
15187     <!ATTLIST p xml:id ID "idv"><!-- invalid -->
15188     ]>
15189     <p/>
15190     @@@cfg:xml-id: 0
15191 wakaba 1.30 @@@test:domTree:
15192     document {
15193     document-type {
15194     element-type-definition {
15195     node-name: 'p';
15196     attribute-definition {
15197     node-name: 'xml:id';
15198     declared-type: const (ID_ATTR);
15199     default-type: const (EXPLICIT_DEFAULT);
15200     node-value: 'idv';
15201     }
15202     }
15203     }
15204     element {
15205     attribute {
15206     node-name: 'xml:id';
15207     schema-type-info: TypeInfo ('http://www.w3.org/TR/REC-xml',
15208     'ID');
15209     value: 'idv';
15210     specified: false;
15211     }
15212     }
15213     }
15214    
15215 wakaba 1.34 @@XMLTest:
15216     @@@QName: xp.general.entity.unused.1.test
15217     @@@DEnt:
15218     @@@@test:value:
15219     <!DOCTYPE p [
15220     <!ENTITY mylt "<">
15221     ]>
15222     <p/>
15223     @@@cfg:entity-replacement-tree: 0
15224     @@@test:domTree:
15225     document {
15226     document-type {
15227     general-entity {
15228     node-name: 'mylt';
15229     }
15230     }
15231     element { }
15232     }
15233     @@XMLTest:
15234     @@@QName: xp.general.entity.unused.2.test
15235     @@@DEnt:
15236     @@@@test:value:
15237     <!DOCTYPE p [
15238     <!ENTITY mylt "<">
15239     ]>
15240     <p/>
15241     @@@cfg:entity-replacement-tree: 1
15242     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 1)..(1, 2); }
15243    
15244 wakaba 1.35 @@XMLTest:
15245     @@@QName: xp.dtdecl.readonly.test
15246     @@@DEnt:
15247     @@@@test:value:
15248     <!DOCTYPE p>
15249     <p/>
15250     @@@test:domTree:
15251     document {
15252     document-type {
15253     manakai-read-only: true;
15254     }
15255     element {
15256     manakai-read-only: false;
15257     }
15258     manakai-read-only: false;
15259     }
15260     @@XMLTest:
15261     @@@QName: xp.entity.decl.readonly.1.test
15262     @@@DEnt:
15263     @@@@test:value:
15264     <!DOCTYPE p [
15265     <!ENTITY ent "val">
15266     ]>
15267     <p/>
15268     @@@cfg:entity-replacement-tree: 1
15269     @@@test:domTree:
15270     document {
15271     document-type {
15272     general-entity {
15273     node-name: 'ent';
15274     manakai-read-only: true;
15275     has-replacement-tree: true;
15276     }
15277     manakai-read-only: true;
15278     }
15279     element {
15280     manakai-read-only: false;
15281     }
15282     manakai-read-only: false;
15283     }
15284     @@XMLTest:
15285     @@@QName: xp.entity.decl.readonly.2.test
15286     @@@DEnt:
15287     @@@@test:value:
15288     <!DOCTYPE p [
15289     <!ENTITY ent "val">
15290     ]>
15291     <p/>
15292     @@@test:domTree:
15293     document {
15294     document-type {
15295     general-entity {
15296     node-name: 'ent';
15297     manakai-read-only: true;
15298     }
15299     manakai-read-only: true;
15300     }
15301     element {
15302     manakai-read-only: false;
15303     }
15304     manakai-read-only: false;
15305     }
15306     @@XMLTest:
15307     @@@QName: xp.notation.decl.readonly.test
15308     @@@DEnt:
15309     @@@@test:value:
15310     <!DOCTYPE p [
15311     <!NOTATION ent SYSTEM "val">
15312     ]>
15313     <p/>
15314     @@@test:domTree:
15315     document {
15316     document-type {
15317     notation {
15318     node-name: 'ent';
15319     manakai-read-only: true;
15320     }
15321     manakai-read-only: true;
15322     }
15323     element {
15324     manakai-read-only: false;
15325     }
15326     manakai-read-only: false;
15327     }
15328     @@XMLTest:
15329     @@@QName: xp.dtd.pi.readonly.test
15330     @@@DEnt:
15331     @@@@test:value:
15332     <!DOCTYPE p [
15333     <?pi content?>
15334     ]>
15335     <p/>
15336     @@@test:domTree:
15337     document {
15338     document-type {
15339     pi {
15340     node-name: 'pi';
15341     manakai-read-only: true;
15342     }
15343     manakai-read-only: true;
15344     }
15345     element {
15346     manakai-read-only: false;
15347     }
15348     manakai-read-only: false;
15349     }
15350     @@XMLTest:
15351     @@@QName: xp.dtd.attlist.decl.readonly.test
15352     @@@DEnt:
15353     @@@@test:value:
15354     <!DOCTYPE p [
15355     <!ATTLIST p
15356     attr CDATA #IMPLIED
15357     >
15358     ]>
15359     <p/>
15360     @@@test:domTree:
15361     document {
15362     document-type {
15363     element-type-definition {
15364     node-name: 'p';
15365     attribute-definition {
15366     node-name: 'attr';
15367     manakai-read-only: true;
15368     }
15369     manakai-read-only: true;
15370     }
15371     manakai-read-only: true;
15372     }
15373     element {
15374     manakai-read-only: false;
15375     }
15376     manakai-read-only: false;
15377     }
15378     @@XMLTest:
15379     @@@QName: xp.general.entity.reference.readonly.1.test
15380     @@@DEnt:
15381     @@@@test:value:
15382     <!DOCTYPE p [
15383     <!ENTITY ent "val">
15384     ]>
15385     <p>&ent;</p>
15386     @@@test:domTree:
15387     document {
15388     document-type {
15389     general-entity {
15390     node-name: 'ent';
15391     manakai-read-only: true;
15392     }
15393     manakai-read-only: true;
15394     }
15395     element {
15396     general-entity-reference {
15397     text {
15398     manakai-read-only: true;
15399     }
15400     manakai-read-only: true;
15401     }
15402     manakai-read-only: false;
15403     }
15404     manakai-read-only: false;
15405     }
15406     @@XMLTest:
15407     @@@QName: xp.general.entity.reference.readonly.2.test
15408     @@@DEnt:
15409     @@@@test:value:
15410     <!DOCTYPE p [
15411     <!ENTITY ent "val">
15412     ]>
15413     <p attr="&ent;"/>
15414     @@@test:domTree:
15415     document {
15416     document-type {
15417     general-entity {
15418     node-name: 'ent';
15419     manakai-read-only: true;
15420     }
15421     manakai-read-only: true;
15422     }
15423     element {
15424     attribute {
15425     node-name: 'attr';
15426     general-entity-reference {
15427     text {
15428     manakai-read-only: true;
15429     }
15430     manakai-read-only: true;
15431     }
15432     manakai-read-only: false;
15433     }
15434     manakai-read-only: false;
15435     }
15436     manakai-read-only: false;
15437     }
15438     @@XMLTest:
15439     @@@QName: xp.general.entity.reference.readonly.3.test
15440     @@@DEnt:
15441     @@@@test:value:
15442     <!DOCTYPE p [
15443     <!ENTITY ent1 "val">
15444     <!ENTITY ent2 "&ent1;">
15445     ]>
15446     <p>&ent2;</p>
15447     @@@test:domTree:
15448     document {
15449     document-type {
15450     general-entity {
15451     node-name: 'ent1';
15452     manakai-read-only: true;
15453     }
15454     general-entity {
15455     node-name: 'ent2';
15456     manakai-read-only: true;
15457     }
15458     manakai-read-only: true;
15459     }
15460     element {
15461     general-entity-reference {
15462     general-entity-reference {
15463     text {
15464     manakai-read-only: true;
15465     }
15466     manakai-read-only: true;
15467     }
15468     manakai-read-only: true;
15469     }
15470     manakai-read-only: false;
15471     }
15472     manakai-read-only: false;
15473     }
15474    
15475 wakaba 1.26 @@PerlDef:
15476 wakaba 1.42 my $impl = $Message::DOM::ImplementationRegistry->get_dom_implementation ({
15477 wakaba 1.26 'Core' => '3.0',
15478     'XML' => '3.0',
15479     'XMLVersion' => ['1.0', '1.1'],
15480     });
15481    
15482     for my $test_data (@$TestData) {
15483 wakaba 1.34 my $parser = <Class::ManakaiXMLParser>->new ($impl);
15484    
15485 wakaba 1.26 $test->start_new_test ($test_data->{uri});
15486     my $doc_ent = $test_data->{entity}->{$test_data->{root_uri}};
15487     my $not_ok;
15488    
15489 wakaba 1.34 ## -- DOM Configuration Parameters
15490    
15491     my $pcfg = $parser->dom_config;
15492     for (keys %{$test_data->{dom_config}}) {
15493     $pcfg->set_parameter ($_ => $test_data->{dom_config}->{$_});
15494     }
15495    
15496     $pcfg->set_parameter ('error-handler' => sub ($$) {
15497 wakaba 1.26 my (undef, $err) = @_;
15498     my $err_type = $err->type;
15499     if ($test_data->{dom_error}->{$err_type}) {
15500     $test->assert_error_equals
15501     (actual_value => $err,
15502     expected_hash => shift @{$test_data->{dom_error}
15503     ->{$err_type}});
15504     } else { # Uncatched error
15505     warn $err;
15506     unless ($err->severity == <C::c|DOMError.SEVERITY_WARNING>) {
15507     $test->failure_comment ('Unexpected error |'.$err->type.'|');
15508     $not_ok = true;
15509     }
15510     }
15511     return true; # continue as far as possible
15512     });
15513    
15514 wakaba 1.34 ## -- Input Data
15515    
15516 wakaba 1.27 my $input = {string_data => \$doc_ent->{<Q::test:value>},
15517     system_id => $doc_ent->{<Q::test:uri>},
15518     base_uri => $doc_ent->{<Q::test:baseURI>}};
15519 wakaba 1.34
15520     ## -- Test and Result
15521    
15522 wakaba 1.26 if ($test_data->{dom_tree}) { # Successful test
15523 wakaba 1.31 my $doc;
15524 wakaba 1.26 try {
15525 wakaba 1.31 $doc = $parser->parse ($input);
15526 wakaba 1.26 $test->assert_dom_tree_equals
15527     (actual_value => $doc,
15528     expected_hash => $test_data->{dom_tree});
15529     for (values %{$test_data->{dom_error}||{}}) {
15530     if (@$_) {
15531     $test->failure_comment
15532     (@$_.' |DOMError|s of type |'.
15533     $_->[0]->{type}->{value}.'| are not reported');
15534     $not_ok = true;
15535     }
15536     }
15537     $not_ok ? $test->not_ok : $test->ok;
15538 wakaba 1.31 undef $doc;
15539 wakaba 1.26 } catch Message::Util::IF::DTException with {
15540 wakaba 1.31 require 'manakai/mndebug.pl';
15541     manakai::mndebug::dump ($doc);
15542 wakaba 1.26 } catch Message::DOM::IF::LSException with {
15543     # not_ok
15544     } otherwise {
15545     my $err = shift;
15546     warn $err;
15547     $test->not_ok;
15548     };
15549     } else {
15550 wakaba 1.31 my $doc;
15551 wakaba 1.26 try {
15552 wakaba 1.31 $doc = $parser->parse ($input);
15553 wakaba 1.26 } catch Message::Util::IF::DTException with {
15554 wakaba 1.31 require 'manakai/mndebug.pl';
15555     manakai::mndebug::dump ($doc);
15556 wakaba 1.26 } catch Message::DOM::IF::LSException with {
15557     #
15558     } otherwise {
15559     my $err = shift;
15560     warn $err;
15561     $test->not_ok;
15562     };
15563     for (values %{$test_data->{dom_error}||{}}) {
15564     if (@$_) {
15565     $test->failure_comment
15566     (@$_.' |DOMError|s of type |'.
15567     $_->[0]->{type}->{value}.'| are not reported');
15568     $not_ok = true;
15569     }
15570     }
15571     $not_ok ? $test->not_ok : $test->ok;
15572 wakaba 1.12 }
15573 wakaba 1.5 }
15574 wakaba 1.6
15575 wakaba 1.37 @XMLTests:
15576     @@QName: xp.byteStream.tests
15577    
15578     @@XMLTest:
15579     @@@QName: xp.labeled.utf-8.test
15580     @@@DEnt:
15581     @@@@xp:encoding: utf-8
15582     @@@@test:value:
15583     <p/>
15584     @@@test:domTree:
15585     document {
15586     input-encoding: 'utf-8';
15587     xml-encoding: null;
15588     element {
15589     node-name: 'p';
15590     }
15591     }
15592     @@XMLTest:
15593     @@@QName: xp.labeled.utf-16.be.test
15594     @@@DEnt:
15595     @@@@xp:encoding: utf-16
15596     @@@@test:value:
15597     $u00FE$u00FF$u0000<$u0000p$u0000/$u0000>
15598     @@@test:domTree:
15599     document {
15600     xml-encoding: null;
15601     input-encoding: 'utf-16';
15602     element {
15603     node-name: 'p';
15604     }
15605     }
15606     @@XMLTest:
15607     @@@QName: xp.labeled.utf-16.le.test
15608     @@@DEnt:
15609     @@@@xp:encoding: utf-16
15610     @@@@test:value:
15611     $u00FF$u00FE<$u0000p$u0000/$u0000>$u0000
15612     @@@test:domTree:
15613     document {
15614     xml-encoding: null;
15615     input-encoding: 'utf-16';
15616     element {
15617     node-name: 'p';
15618     }
15619     }
15620     @@XMLTest:
15621     @@@QName: xp.labeled.utf-16.nobom.test
15622     @@@DEnt:
15623     @@@@xp:encoding: utf-16
15624     @@@@test:value:
15625     <$u0000p$u0000/$u0000>$u0000
15626     @@@c:erred: <[[xp|fatal-utf-16-no-bom]]> {}
15627     @@XMLTest:
15628     @@@QName: xp.labeled.unknown.test
15629     @@@DEnt:
15630     @@@@xp:encoding: x-unknown-encoding-name
15631     @@@@test:value:
15632     <p/>
15633     @@@c:erred: <[[xp|fatal-unprocessable-encoding]]> {}
15634     @@XMLTest:
15635     @@@QName: xp.unlabeled.encdecl.unknown.test
15636     @@@DEnt:
15637     @@@@test:value:
15638     <?xml version="1.0" encoding="x-unknown-encoding-name"?>
15639     <p/>
15640     # @@@c:erred: <[[xp|fatal-unprocessable-encoding]]> {}
15641     @@@c:erred: <[[xp|fatal-encoding-mismatch]]> {}
15642     @@XMLTest:
15643     @@@QName: xp.labeled.utf-8.illegal.test
15644     @@@DEnt:
15645     @@@@xp:encoding: utf-8
15646     @@@@test:value:
15647     <p/$u00A0>
15648     @@@c:erred: <[[xp|fatal-illegal-byte-sequence]]> {}
15649     @@XMLTest:
15650     @@@QName: xp.unlabeled.encdecl.utf-8.illegal.test
15651     @@@DEnt:
15652     @@@@test:value:
15653     <?xml version="1.0" encoding="utf-8"?>
15654     <p/$u00A0>
15655     @@@c:erred: <[[xp|fatal-illegal-byte-sequence]]> {}
15656     @@XMLTest:
15657     @@@QName: xp.unlabeled.utf-8.illegal.test
15658     @@@DEnt:
15659     @@@@test:value:
15660     <p/$u00A0>
15661     @@@c:erred: <[[xp|fatal-illegal-byte-sequence]]> {}
15662     @@XMLTest:
15663     @@@QName: xp.mismatch.encdecl-as-utf-16.utf-8.test
15664     @@@DEnt:
15665     @@@@test:value:
15666     <?xml version="1.0" encoding="utf-16"?>
15667     <p/>
15668     @@@c:erred: <[[xp|fatal-encoding-mismatch]]> {}
15669     @@XMLTest:
15670     @@@QName: xp.mismatch.labeled-as-utf-16.utf-8.test
15671     @@@DEnt:
15672     @@@@xp:encoding: utf-16
15673     @@@@test:value:
15674     <p/>
15675     @@@c:erred: <[[xp|fatal-utf-16-no-bom]]> {}
15676     @@XMLTest:
15677     @@@QName: xp.labeled-as-utf-8.encdecl-utf-16.test
15678     @@@DEnt:
15679     @@@@xp:encoding: utf-8
15680     @@@@test:value:
15681     <?xml version="1.0" encoding="utf-16"?>
15682     <p/>
15683     @@@test:domTree:
15684     document {
15685     xml-encoding: 'utf-16';
15686     input-encoding: 'utf-8';
15687     element { }
15688     }
15689    
15690     @@PerlDef:
15691 wakaba 1.42 my $impl = $Message::DOM::ImplementationRegistry->get_dom_implementation ({
15692 wakaba 1.37 'Core' => '3.0',
15693     'XML' => '3.0',
15694     'XMLVersion' => ['1.0', '1.1'],
15695     });
15696    
15697     for my $test_data (@$TestData) {
15698     my $parser = <Class::ManakaiXMLParser>->new ($impl);
15699    
15700     $test->start_new_test ($test_data->{uri});
15701     my $doc_ent = $test_data->{entity}->{$test_data->{root_uri}};
15702     my $not_ok;
15703    
15704     ## -- DOM Configuration Parameters
15705    
15706     my $pcfg = $parser->dom_config;
15707     for (keys %{$test_data->{dom_config}}) {
15708     $pcfg->set_parameter ($_ => $test_data->{dom_config}->{$_});
15709     }
15710    
15711     $pcfg->set_parameter ('error-handler' => sub ($$) {
15712     my (undef, $err) = @_;
15713     my $err_type = $err->type;
15714     if ($test_data->{dom_error}->{$err_type}) {
15715     $test->assert_error_equals
15716     (actual_value => $err,
15717     expected_hash => shift @{$test_data->{dom_error}
15718     ->{$err_type}});
15719     } else { # Uncatched error
15720     warn $err;
15721     unless ($err->severity == <C::c|DOMError.SEVERITY_WARNING>) {
15722     $test->failure_comment ('Unexpected error |'.$err->type.'|');
15723     $not_ok = true;
15724     }
15725     }
15726     return false;
15727     });
15728    
15729     ## -- Input Data
15730    
15731     open my $byte, '<', \$doc_ent->{<Q::test|value>};
15732     my $input = {byte_stream => $byte,
15733     system_id => $doc_ent->{<Q::test:uri>},
15734     base_uri => $doc_ent->{<Q::test:baseURI>},
15735     encoding => $doc_ent->{<Q::xp|encoding>}};
15736    
15737     ## -- Test and Result
15738    
15739     if ($test_data->{dom_tree}) { # Successful test
15740     my $doc;
15741     try {
15742     $doc = $parser->parse ($input);
15743     $test->assert_dom_tree_equals
15744     (actual_value => $doc,
15745     expected_hash => $test_data->{dom_tree});
15746     for (values %{$test_data->{dom_error}||{}}) {
15747     if (@$_) {
15748     $test->failure_comment
15749     (@$_.' |DOMError|s of type |'.
15750     $_->[0]->{type}->{value}.'| are not reported');
15751     $not_ok = true;
15752     }
15753     }
15754     $not_ok ? $test->not_ok : $test->ok;
15755     undef $doc;
15756     } catch Message::Util::IF::DTException with {
15757     require 'manakai/mndebug.pl';
15758     manakai::mndebug::dump ($doc);
15759     } catch Message::DOM::IF::LSException with {
15760     # not_ok
15761     } otherwise {
15762     my $err = shift;
15763     warn $err;
15764     $test->not_ok;
15765     };
15766     } else {
15767     my $doc;
15768     try {
15769     $doc = $parser->parse ($input);
15770     } catch Message::Util::IF::DTException with {
15771     require 'manakai/mndebug.pl';
15772     manakai::mndebug::dump ($doc);
15773     } catch Message::DOM::IF::LSException with {
15774     #
15775     } otherwise {
15776     my $err = shift;
15777     warn $err;
15778     $test->not_ok;
15779     };
15780     for (values %{$test_data->{dom_error}||{}}) {
15781     if (@$_) {
15782     $test->failure_comment
15783     (@$_.' |DOMError|s of type |'.
15784     $_->[0]->{type}->{value}.'| are not reported');
15785     $not_ok = true;
15786     }
15787     }
15788     $not_ok ? $test->not_ok : $test->ok;
15789     }
15790     }
15791    
15792    
15793 wakaba 1.6 @ResourceDef:
15794 wakaba 1.19 @@QName: getEmptyEntityState
15795     @@rdf:type: DISPerl|InlineCode
15796     @@ForCheck: ManakaiDOM|ForClass
15797     @@PerlDef:
15798     {reptxt => \'', line => 1, column => 1, pos => 0,
15799 wakaba 1.27 is_externally_declared => true, name => $name,
15800     fh => do {
15801     open my $empty, '<', \'';
15802     $empty;
15803     },
15804     close_file => sub { }}
15805 wakaba 1.19
15806     @ResourceDef:
15807 wakaba 1.6 @@QName: getCopyOfEntityState
15808     @@rdf:type: DISPerl|InlineCode
15809     @@ForCheck: ManakaiDOM|ForClass
15810     @@PerlDef:
15811     {%{$self->{$entity_type}->{$entity_name}},
15812 wakaba 1.27 line => 1, column => 1, pos => 0,
15813     fh => do {
15814     require IO::String;
15815     IO::String->new
15816     (${$self->{$entity_type}->{$entity_name}->{reptxt}});
15817     ## TODO: External entities.
15818     },
15819     close_file => sub { }}
15820 wakaba 1.1 ##ManakaiXMLParser
15821 wakaba 1.5
15822     ElementTypeBinding:
15823 wakaba 1.27 @Name: Test
15824     @ElementType:
15825     dis:ResourceDef
15826     @ShadowContent:
15827     @@ForCheck: ManakaiDOM|ForClass
15828     @@rdf:type: test|StandaloneTest
15829    
15830     ElementTypeBinding:
15831 wakaba 1.5 @Name: XMLTests
15832     @ElementType:
15833     dis:ResourceDef
15834     @ShadowContent:
15835     @@ForCheck: ManakaiDOM|ForClass
15836     @@rdf:type: test|ParserTestSet
15837    
15838     ElementTypeBinding:
15839     @Name: XMLTest
15840     @ElementType:
15841     dis:ResourceDef
15842     @ShadowContent:
15843     @@ForCheck: ManakaiDOM|ForClass
15844     @@rdf:type: test|ParserTest
15845    
15846     ElementTypeBinding:
15847     @Name: DEnt
15848     @ElementType:
15849     dis:ResourceDef
15850     @ShadowContent:
15851     @@rdf:type: test|RootEntity
15852    
15853     ElementTypeBinding:
15854     @Name: Ent
15855     @ElementType:
15856     dis:ResourceDef
15857     @ShadowContent:
15858     @@rdf:type: test|Entity
15859 wakaba 1.1
15860 wakaba 1.3 ResourceDef:
15861     @QName: xp|get-location-from-token
15862     @rdf:type: DISPerl|BlockCode
15863     @enDesc:
15864     Creates a <IF::DOMCore:DOMLocator> object from a token.
15865     @PerlDef:
15866 wakaba 1.14 my $__d = $token->{type} ne '#EOF'
15867     ? $token->{location}->{char_d}
15868     : 0;
15869 wakaba 1.15 $__d -= $token->{location_d} if $token->{location_d};
15870 wakaba 1.3 $result = {
15871 wakaba 1.14 utf32_offset => $token->{location}->{pos} - $__d,
15872     line_number => $token->{location}->{line},
15873     column_number => $token->{location}->{column} - $__d,
15874 wakaba 1.3 };
15875 wakaba 1.14 $result->{utf32_offset} = 0 if $result->{utf32_offset} < 0;
15876     $result->{column_number} = 0 if $result->{column_number} < 0;
15877     ## 0 or 1, which should be?
15878 wakaba 1.3 @For: ManakaiDOM|ManakaiDOM3
15879 wakaba 1.1
15880     ElementTypeBinding:
15881     @Name: RuleDef
15882     @ElementType:
15883     dis:ResourceDef
15884     @ShadowContent:
15885     @@ForCheck: ManakaiDOM|ForClass
15886     @@rdf:type: Muf2003|RuleDefClass
15887    
15888     ElementTypeBinding:
15889     @Name: RuleParam
15890     @ElementType:
15891     dis:ResourceDef
15892     @ShadowContent:
15893     @@rdf:type: Muf2003|RuleParameter
15894    
15895     ElementTypeBinding:
15896     @Name: enImplNote
15897     @ElementType:
15898     dis:ImplNote
15899     @ShadowContent:
15900     @@lang:en
15901    
15902     ElementTypeBinding:
15903 wakaba 1.24 @Name: WFErrDef
15904 wakaba 1.1 @ElementType:
15905     dis:ResourceDef
15906     @ShadowContent:
15907     @@rdf:type: DOMCore|DOMErrorType
15908     @@For: ManakaiDOM|DOM3
15909     @@ecore:textFormatter: ManakaiXMLParserExceptionFormatter
15910 wakaba 1.24 @@c:severity: c|SEVERITY_FATAL_ERROR
15911 wakaba 1.1
15912 wakaba 1.3 ElementTypeBinding:
15913 wakaba 1.24 @Name: FatalErrDef
15914 wakaba 1.3 @ElementType:
15915     dis:ResourceDef
15916     @ShadowContent:
15917     @@rdf:type: DOMCore|DOMErrorType
15918     @@For: ManakaiDOM|DOM3
15919     @@ecore:textFormatter: ManakaiXMLParserExceptionFormatter
15920 wakaba 1.24 @@c:severity: c|SEVERITY_FATAL_ERROR
15921    
15922     ElementTypeBinding:
15923 wakaba 1.26 @Name: NSFatalErrDef
15924     @ElementType:
15925     dis:ResourceDef
15926     @ShadowContent:
15927     @@rdf:type: c|DOMErrorType
15928     @@For: ManakaiDOM|DOM3
15929     @@ecore:textFormatter: ManakaiXMLParserExceptionFormatter
15930     @@c:severity: c|SEVERITY_FATAL_ERROR
15931    
15932     ElementTypeBinding:
15933     @Name: NSCErrDef
15934     @ElementType:
15935     dis:ResourceDef
15936     @ShadowContent:
15937     @@rdf:type: c|DOMErrorType
15938     @@For: ManakaiDOM|DOM3
15939     @@ecore:textFormatter: ManakaiXMLParserExceptionFormatter
15940     @@c:severity: c|SEVERITY_FATAL_ERROR
15941    
15942     ElementTypeBinding:
15943 wakaba 1.24 @Name: VCErrDef
15944     @ElementType:
15945     dis:ResourceDef
15946     @ShadowContent:
15947     @@rdf:type: c|DOMErrorType
15948     @@For: ManakaiDOM|DOM3
15949     @@ecore:textFormatter: ManakaiXMLParserExceptionFormatter
15950     @@c:severity: c|SEVERITY_ERROR
15951    
15952     ElementTypeBinding:
15953     @Name: ErrDef
15954     @ElementType:
15955     dis:ResourceDef
15956     @ShadowContent:
15957     @@rdf:type: c|DOMErrorType
15958     @@For: ManakaiDOM|DOM3
15959     @@ecore:textFormatter: ManakaiXMLParserExceptionFormatter
15960     @@c:severity: c|SEVERITY_ERROR
15961 wakaba 1.3
15962 wakaba 1.16 ElementTypeBinding:
15963 wakaba 1.24 @Name: WarnDef
15964 wakaba 1.16 @ElementType:
15965     dis:ResourceDef
15966     @ShadowContent:
15967 wakaba 1.24 @@rdf:type: c|DOMErrorType
15968 wakaba 1.16 @@For: ManakaiDOM|DOM3
15969     @@ecore:textFormatter: ManakaiXMLParserExceptionFormatter
15970 wakaba 1.24 @@c:severity: c|SEVERITY_WARNING
15971 wakaba 1.16
15972 wakaba 1.3 WFErrDef:
15973     @QName: xp|wf-syntax-error
15974     @enDesc:
15975     The entity does not match to the production rule; it is not
15976     well-formed.
15977     @enMufDef:
15978     |%xp-error-token-type;|%xp-error-token-value
15979     (prefix => { (|}, suffix => {|)}); is not
15980     allowed%xp-error-lines (prefix => { (|}, suffix => {|)});
15981     @ecore:hasParameter:
15982     @@@: xp|error-token
15983     @@enDesc:
15984     The token that is not allowed.
15985    
15986     WFErrDef:
15987     @QName: xp|wf-pi-target-is-xml
15988     @enDesc:
15989     A processing instruction has its <CODE::PITarget> of
15990     <XML::xml> (in any case) which is not allowed.
15991     @enMufDef:
15992     Processing instruction target name cannot be |%p
15993     (name => {<Q::xp|name>});|
15994     @ecore:hasParameter:
15995     @@@: xp|error-token
15996     @@enDesc:
15997     The token that contains the name.
15998     @ecore:hasParameter:
15999     @@@: xp|name
16000     @@enDesc:
16001     A string that is specified as target name of the
16002     processing instruction.
16003     @ecore:hasParameter: xp|parent
16004    
16005     WFErrDef:
16006     @QName: xp|wf-no-end-tag
16007     @enDesc:
16008     An end-tag is not found.
16009     @enMufDef:
16010     End-tag |</%p (name => {<Q::xp|expected-element-type>});>| is required
16011     @ecore:hasParameter: xp|error-token
16012     @ecore:hasParameter:
16013     @@@: xp|node
16014     @@enDesc:
16015     The element node that is not closed.
16016     @ecore:hasParameter:
16017     @@@: xp|expected-element-type
16018     @@enDesc:
16019     The element type name of the element that is not closed.
16020    
16021     WFErrDef:
16022     @QName: xp|wf-unsupported-xml-version
16023     @enDesc:
16024     The XML version specified in the version declaration is not supported.
16025     @enMufDef:
16026     XML version |%p (name => {<Q::infoset|version>});| is not supported
16027     @ecore:hasParameter: xp|bad-token
16028     @ecore:hasParameter:
16029     @@@: xp|parent
16030     @@enDesc:
16031     The document node.
16032     @ecore:hasParameter:
16033     @@@: infoset|version
16034     @@enDesc:
16035     The specified XML version.
16036    
16037     WFErrDef:
16038     @QName: xp|wf-malformed-enc-name
16039     @enDesc:
16040     An <XA::encoding> pseudo-attribute value does not match
16041     to the procduction rule <CODE::EncName>.
16042     @enMufDef:
16043     Encoding name |%p (name => {<Q::xp|name>});| is not allowed
16044     @ecore:hasParameter: xp|error-token
16045     @ecore:hasParameter:
16046     @@@: xp|parent
16047     @@enDesc: The document node.
16048     @ecore:hasParameter:
16049     @@@: xp|name
16050     @@enDesc:
16051     The <XA::encoding> value.
16052    
16053     WFErrDef:
16054     @QName: xp|wf-malformed-xml-standalone
16055     @enDesc:
16056     An <XA::standalone> pseudo-attribute value is neither <XML::yes>
16057     or <XML::no>.
16058     @enMufDef:
16059     |standalone| pseudo-attribute value |%p (name => {<Q::xp|name>});|
16060     is not allowed
16061     @ecore:hasParameter: xp|error-token
16062     @ecore:hasParameter:
16063     @@@: xp|parent
16064     @@enDesc: The document node.
16065     @ecore:hasParameter:
16066     @@@: xp|name
16067     @@enDesc:
16068     The <XA::standalone> value.
16069    
16070     WFErrDef:
16071     @QName: xp|wf-legal-literal-character
16072     @enDesc:
16073     Each character in XML entity must match to the production
16074     rule <CODE::Char - RestrictedChar>.
16075     @enMufDef:
16076     Character %character-code-point
16077     (v => {<Q::xp|character-number>}); is not allowed
16078     @ecore:hasParameter:
16079     @@@: xp|character-number
16080     @@enDesc:
16081     The code position of the character being referred.
16082    
16083     WFErrDef:
16084 wakaba 1.26 @QName: xp|wf-invalid-character-in-node-name
16085     @c:errorType:
16086     @@@: wf-invalid-character-in-node-name
16087     @@ContentType: DISCore|String
16088     @enDesc:
16089     If a name contains a character that is not a name character
16090     in the XML version in use, or if the first character of a name
16091     is not a name start character in the XML version in use.
16092    
16093     {NOTE::
16094     When an invalid character is encountered in an entity
16095     where a <CODE::Name> is expected, what type of error
16096     is issued is implementation dependent: <Q::xp|wf-syntax-error>,
16097     <Q::xp|wf-pi-target-is-xml> or other error might be reported.
16098     }
16099    
16100     {NOTE::
16101     This error type is defined in DOM Level 3 Core and Load and Save
16102     modules and redefined herein for the purpose of XML parser.
16103     }
16104     @enMufDef:
16105     Character %character-code-point
16106     (v => {<Q::xp|character-number>}); is not allowed in name
16107     @ecore:hasParameter: xp|error-token
16108     @ecore:hasParameter:
16109     @@@: xp|character-number
16110     @@enDesc:
16111     The code position of the character being referred.
16112     @ecore:hasParameter:
16113     @@@: infoset|version
16114     @@enDesc:
16115     The version of XML in use.
16116    
16117     WFErrDef:
16118 wakaba 1.25 @QName: xp|wf-pes-in-internal-subset
16119     @enDesc:
16120     In the internal subset of the DTD, parameter entity references
16121     <kwd:MUST-NOT> occur within markup declarations.
16122     @enMufDef:
16123     Parameter entity reference |%percent;%param (name => {<Q::xp|name>});;|
16124     cannot occur within a markup declaration
16125     @ecore:hasParameter: xp|error-token
16126     @ecore:hasParameter:
16127     @@@: xp|name
16128     @@enDesc:
16129     The name of the parameter entity.
16130    
16131     WFErrDef:
16132 wakaba 1.3 @QName: xp|wf-element-type-match
16133 wakaba 1.1 @enDesc:
16134 wakaba 1.3 The <CODE::Name> in an element's end-tag must match the element type
16135     in the start-tag.
16136     @enMufDef:
16137     End-tag |</%p (name => {<Q::xp|actual-element-type>});>| does
16138     not match to start-tag |<%p (name => {<Q::xp|expected-element-type>});>|
16139     @ecore:hasParameter: xp|error-token
16140     @ecore:hasParameter:
16141     @@@: xp|node
16142     @@enDesc:
16143     The current opening element node.
16144     @ecore:hasParameter:
16145     @@@: xp|expected-element-type
16146     @@enDesc:
16147     The element type name of the current element.
16148     @ecore:hasParameter:
16149     @@@: xp|actual-element-type
16150     @@enDesc:
16151     The <CODE::Name> occurs in the end-tag.
16152    
16153     WFErrDef:
16154     @QName: xp|wf-unique-att-spec
16155     @enDesc:
16156     An attribute name <kwd:MUST-NOT> appear more than once in
16157     the same start-tag or empty-element tag.
16158 wakaba 1.1 @enMufDef:
16159 wakaba 1.3 Attribute |%p (name => {<Q::xp|name>});| is specified more
16160     than once in the same tag
16161     @ecore:hasParameter: xp|error-token
16162     @ecore:hasParameter:
16163     @@@: xp|name
16164     @@enDesc:
16165     The name of the attribute.
16166 wakaba 1.18
16167     WFErrDef:
16168     @QName: xp|wf-no-external-entity-references
16169     @enDesc:
16170     Attribute values <kwd:MUST-NOT> contain direct or indirect
16171     entity references to external entities.
16172     @enMufDef:
16173     External entity |%p (name => {<Q::xp|name>});| is referenced
16174     in an attribute value literal
16175     @ecore:hasParameter: xp|error-token
16176     @ecore:hasParameter:
16177     @@@: xp|name
16178     @@enDesc:
16179     The name of the entity.
16180    
16181     WFErrDef:
16182     @QName: xp|wf-no-lt-in-attribute-values
16183     @enDesc:
16184     The replacement text of any entity referred to directly or indirectly
16185     in an attribute value literal <kwd:MUST-NOT> contain a
16186     <CHAR::LESS-THAN SIGN>.
16187     @enMufDef:
16188     Entity replacement text cannot contain a
16189     |LESS-THAN SIGN| since it is referenced from an attribute
16190     value literal
16191     @ecore:hasParameter: xp|error-token
16192 wakaba 1.3
16193 wakaba 1.25 WarnDef:
16194     @QName: xp|warning-attribute-definition-ignored
16195     @enDesc:
16196     An attribute definition is ignored because the same attribute
16197     is declared before.
16198     @enMufDef:
16199     Attribute definition for |%p (name => {<Q::xp|name>});| is ignored
16200     @ecore:hasParameter: xp|error-token
16201     @ecore:hasParameter:
16202     @@@: xp|name
16203     @@enDesc:
16204     The name of the attribute.
16205    
16206 wakaba 1.3 WFErrDef:
16207     @QName: xp|wf-legal-character
16208     @enDesc:
16209     Characters referred to using character references <kwd:MUST>
16210     match the production for <CODE::Char>.
16211     @enMufDef:
16212     Reference to character %character-code-point
16213     (v => {<Q::xp|character-number>}); is not allowed
16214     @ecore:hasParameter: xp|error-token
16215     @ecore:hasParameter:
16216     @@@: xp|character-number
16217     @@enDesc:
16218     The code position of the character being referred.
16219     @ecore:hasParameter:
16220     @@@: xp|parent
16221     @@enDesc:
16222     The parent node in which the character reference has
16223     occurred, if available.
16224 wakaba 1.19
16225     WFErrDef:
16226     @QName: xp|wf-entity-declared
16227     @enDesc:
16228     {P:: In a document
16229    
16230     - without any DTD,
16231    
16232     - with only an internal DTD subset that contains no parameter
16233     entity references, or
16234    
16235     - with <XML::standalone="yes">,
16236    
16237     for an entity reference that does not occur within the external
16238     subset or a parameter entity, the <CODE::Name> given in the
16239     entity reference <kwd:MUST> match the <CODE::Name> does not
16240     occur within the external subset or a parameter entity,
16241     except that five predefined character entities need not
16242     be declared. The declaration of a general entity <kwd:MUST>
16243     precede any reference to it which appears in a default value
16244     in an attribute list declaration.
16245     @enMufDef:
16246     Entity |%p (name => {<Q::xp|name>});| must be declared
16247     in the internal subset
16248 wakaba 1.23 @ecore:hasParameter: xp|error-token
16249     @ecore:hasParameter:
16250     @@@: xp|name
16251     @@enDesc:
16252     The name of the entity.
16253    
16254     WFErrDef:
16255     @QName: xp|wf-parsed-entity
16256     @enDesc:
16257     An entity reference <kwd:MUST-NOT> contain the name of an
16258     unparsed entity.
16259     @enMufDef:
16260     Entity |%p (name => {<Q::xp|name>});| is an unparsed entity
16261     @ecore:hasParameter: xp|error-token
16262     @ecore:hasParameter:
16263     @@@: xp|name
16264     @@enDesc:
16265     The name of the entity.
16266    
16267     WFErrDef:
16268     @QName: xp|wf-no-recursion
16269     @enDesc:
16270     A parsed entity <kwd:MUST-NOT> contain a recursive reference
16271     to itself, either directly or indirectly.
16272     @enMufDef:
16273     Entity |%p (name => {<Q::xp|name>});| is recursively referenced
16274 wakaba 1.19 @ecore:hasParameter: xp|error-token
16275     @ecore:hasParameter:
16276     @@@: xp|name
16277     @@enDesc:
16278     The name of the entity.
16279 wakaba 1.16
16280     FatalErrDef:
16281     @QName: xp|fatal-xml11-end-of-line-in-xml-declaration
16282     @enDesc:
16283     An end-of-line character <CODE::U+0085> or <CODE::U+2028> is appeared
16284     within an XML declaration or text declaration.
16285     @enMufDef:
16286     End-of-line character %character-code-point
16287     (v => {<Q::xp|character-number>}); cannot be used within the
16288     XML or text declaration
16289     @ecore:hasParameter:
16290     @@@: xp|character-number
16291     @@enDesc:
16292     The code position of the end-of-line character.
16293 wakaba 1.24
16294     ErrDef:
16295     @QName: xp|error-internal-predefined-entity
16296     @enDesc:
16297     A general entity declaration whose <CODE::Name> equals to one
16298     of predefined entities <kwd:MUST> declare it as an internal entity.
16299     @enMufDef:
16300     Entity |%p (name => {<Q::xp|name>});| must be declared as an
16301     internal entity
16302     @ecore:hasParameter: xp|error-token
16303     @ecore:hasParameter:
16304     @@@: xp|name
16305     @@enDesc:
16306     The name of the entity.
16307    
16308     ErrDef:
16309     @QName: xp|error-malformed-predefined-entity
16310     @enDesc:
16311     A general entity declaration whose <CODE::Name> equals to one
16312     of predefined entities <kwd:MUST> declare it as a data
16313     character for the entity.
16314     @enMufDef:
16315     Entity declaration for |%p (name => {<Q::xp|name>});|
16316     (replacement text |%p (name => {<Q::xp|replacement-text>});|) is malformed
16317     @ecore:hasParameter: xp|error-token
16318     @ecore:hasParameter:
16319     @@@: xp|name
16320     @@enDesc:
16321     The name of the entity.
16322     @ecore:hasParameter:
16323     @@@: xp|replacement-text
16324     @@enDesc:
16325     The replacement text of the entity declaration.
16326    
16327     WarnDef:
16328     @QName: xp|warning-entity-declaration-ignored
16329     @enDesc:
16330     An entity declaration is ignored because the same entity
16331     is declared before.
16332     @enMufDef:
16333     Entity declaration for |%p (name => {<Q::xp|name>});| is ignored
16334     @ecore:hasParameter: xp|error-token
16335     @ecore:hasParameter:
16336     @@@: xp|name
16337     @@enDesc:
16338     The name of the entity.
16339    
16340     VCErrDef:
16341     @QName: xp|vc-unique-notation-name
16342     @enDesc:
16343     A <CODE::Name> <kwd:MUST-NOT> be declared in more than
16344     one notation declaration.
16345     @enMufDef:
16346     Notation |%p (name => {<Q::xp|name>});| is already declared
16347     @ecore:hasParameter: xp|error-token
16348     @ecore:hasParameter:
16349     @@@: xp|name
16350     @@enDesc:
16351     The name of the notation.
16352 wakaba 1.25
16353     WarnDef:
16354     @QName: xp|warning-entity-declaration-not-processed
16355     @enDesc:
16356     An entity declaration is not processed because there
16357     is a reference to parameter entity before the declaration
16358     and the entity is not read.
16359     @enMufDef:
16360     Entity declaration for |%p (name => {<Q::xp|name>});| is not processed
16361     @ecore:hasParameter: xp|error-token
16362     @ecore:hasParameter:
16363     @@@: xp|name
16364     @@enDesc:
16365     The name of the entity.
16366    
16367     WarnDef:
16368     @QName: xp|warning-attribute-definition-not-processed
16369     @enDesc:
16370     An attribute definition is not processed because there
16371     is a reference to parameter entity before the declaration
16372     and the entity is not read.
16373     @enMufDef:
16374     Attribute definition for |%p (name => {<Q::xp|name>});| is not processed
16375     @ecore:hasParameter: xp|error-token
16376     @ecore:hasParameter:
16377     @@@: xp|name
16378     @@enDesc:
16379     The name of the attribute.
16380 wakaba 1.26
16381 wakaba 1.37 FatalErrDef:
16382     @QName: xp|fatal-illegal-byte-sequence
16383     @enDesc:
16384     An XML entity is determined to be in a certain encoding but
16385     contains byte sequences that are not legal in that encoding.
16386     @enMufDef:
16387     Illegal byte sequence
16388     @enImplNote: dump
16389     @ecore:hasParameter: xp|byte-sequence
16390     @ecore:hasParameter: xp|code-state
16391    
16392     XWParam:
16393     @QName: xp|byte-sequence
16394     @enDesc:
16395     A reference to the byte string that contains an error.
16396    
16397     XWParam:
16398     @QName: xp|code-state
16399     @enDesc:
16400     A string that identifies the state defined in the coded character set
16401     in which an error is encoutnered.
16402    
16403     WarnDef:
16404     @QName: xp|warning-unassigned-code-point
16405     @enDesc:
16406     If the entity contains an unassigned code point.
16407     @enMufDef:
16408     Unassigned code point found
16409     @enImplNote: dump
16410     @ecore:hasParameter: xp|byte-sequence
16411    
16412     FatalErrDef:
16413     @QName: xp|fatal-unprocessable-encoding
16414     @enDesc:
16415     When an XML processor encounters an entity with an encoding
16416     that is unable to process.
16417     @enMufDef:
16418     Encoding <%p (name => {<Q::xp|charset-uri>});>
16419     %p (name => {<Q::xp|encoding>}, prefix => {(}, suffix => {) });is
16420     not supported
16421     @ecore:hasParameter: xp|encoding
16422     @ecore:hasParameter: xp|charset-uri
16423    
16424     XWParam:
16425     @QName: xp|encoding
16426     @enDesc:
16427     The XML name of the encoding.
16428     @multipleProperties: DISCore|Single
16429     @dataType: DISCore|String
16430     @DISCore:resourceType: DISSource|ResourceProperty
16431    
16432     XWParam:
16433     @QName: xp|charset-uri
16434     @enDesc:
16435     The URI that identifies the encoding.
16436    
16437     FatalErrDef:
16438     @QName: xp|fatal-utf-16-no-bom
16439     @enDesc:
16440     If the encoding of an entity is UTF-16 but it does not
16441     contains <CHAR::BOM>.
16442     @enMufDef:
16443     The entity contains no BOM
16444    
16445     FatalErrDef:
16446     @QName: xp|fatal-encoding-mismatch
16447     @enDesc:
16448     If an entity including an encoding declaration
16449     in an encoding other than that named in the declaration.
16450     @enMufDef:
16451     The entity is labeled as <%p (name => {<Q::xp|charset-uri>});>
16452     %p (name => {<Q::xp|encoding>}, prefix => {(}, suffix => {) });but
16453     it is wrong
16454     @ecore:hasParameter: xp|encoding
16455     @ecore:hasParameter: xp|charset-uri
16456    
16457     WarnDef:
16458     @QName: xp|warn-unknown-decode-error
16459     @enDesc:
16460     Unknown message from the decoder.
16461     @enMufDef:
16462     Encoding decoder error: <%p (name => {<Q::xp|error-type>});>
16463     @ecore:hasParameter: xp|error-type
16464     @ecore:hasParameter: xp|error-param
16465    
16466     XWParam:
16467     @QName: xp|error-type
16468     @enDesc:
16469     A DOM URI that identifies the error type.
16470    
16471     XWParam:
16472     @QName: xp|error-param
16473     @enDesc:
16474     A <Q::xp|error-type>-dependent set of error descriptions.
16475    
16476 wakaba 1.26 NSFatalErrDef:
16477     @QName: xp|nswf-legal-ncname
16478     @enDesc:
16479     <CODE::Name>s other than element type names and attribute names
16480     <kwd:MUST> be <CODE::NCName>s.
16481     @enMufDef:
16482     <CODE::Name> |%p (name => {<Q::xp|name>});| is not an <CODE::NCName>
16483     @ecore:hasParameter: xp|error-token
16484     @ecore:hasParameter:
16485     @@@: xp|name
16486     @@enDesc:
16487     The name.
16488     @ecore:hasParameter:
16489     @@@: infoset|version
16490     @@enDesc:
16491     The version of XML in use.
16492    
16493     NSFatalErrDef:
16494     @QName: xp|nswf-legal-qname
16495     @enDesc:
16496     An element type name or an attribute name <kwd:MUST> be a
16497     <CODE::QName>.
16498     @enMufDef:
16499     <CODE::Name> |%p (name => {<Q::xp|name>});| is not a <CODE::QName>
16500     @ecore:hasParameter: xp|error-token
16501     @ecore:hasParameter:
16502     @@@: xp|name
16503     @@enDesc:
16504     The name.
16505     @ecore:hasParameter:
16506     @@@: infoset|version
16507     @@enDesc:
16508     The version of XML in use.
16509    
16510     NSCErrDef:
16511     @QName: xp|nsc-reserved-prefix-xml
16512     @enDesc:
16513     The prefix <XML::xml> <kwd:MUST-NOT> be undeclared or bound
16514     to any namespace name other than <URI::http://www.w3.org/XML/1998/namespace>.
16515     @enMufDef:
16516     Namespace prefix |xml| cannot be bound to namespace
16517     name |%p (name => {<Q::infoset|namespaceName>});|
16518     @ecore:hasParameter: xp|error-token
16519     @ecore:hasParameter:
16520     @@@: infoset|prefix
16521     @@enDesc:
16522     The namespace prefix.
16523     @ecore:hasParameter:
16524     @@@: infoset|namespaceName
16525     @@enDesc:
16526     The namespace name bound to or an empty string for undeclaring.
16527    
16528     NSCErrDef:
16529     @QName: xp|nsc-reserved-namespace-name-xml
16530     @enDesc:
16531     Namespace prefixes other than <XML::xml> <kwd:MUST-NOT> be bound
16532     to the namespace name <URI::http://www.w3.org/XML/1998/namespace>.
16533     @enMufDef:
16534     Namespace prefix |%p (name => {<Q::infoset|prefix>});| cannot be
16535     bound to namespace name |http://www.w3.org/XML/1998/namespace|
16536     @enImplNote:
16537     The XMLNames spec does not prohibit the URI bound to
16538     the default namespace (!)
16539     @ecore:hasParameter: xp|error-token
16540     @ecore:hasParameter:
16541     @@@: infoset|prefix
16542     @@enDesc:
16543     The namespace prefix or <DOM::null> for default namespace.
16544     @ecore:hasParameter:
16545     @@@: infoset|namespaceName
16546     @@enDesc:
16547     The namespace name bound to.
16548    
16549     NSCErrDef:
16550     @QName: xp|nsc-reserved-prefix-xmlns
16551     @enDesc:
16552     The prefix <XML::xmlns> <kwd:MUST-NOT> be declared or undeclared.
16553     @enMufDef:
16554     Namespace prefix |xmlns| cannot be declared or undeclared
16555     @ecore:hasParameter: xp|error-token
16556     @ecore:hasParameter:
16557     @@@: infoset|prefix
16558     @@enDesc:
16559     The namespace prefix.
16560     @ecore:hasParameter:
16561     @@@: infoset|namespaceName
16562     @@enDesc:
16563     The namespace name bound to or an empty string for undeclaring.
16564    
16565     NSCErrDef:
16566     @QName: xp|nsc-reserved-namespace-name-xmlns
16567     @enDesc:
16568     Namespace prefixes <kwd:MUST-NOT> be bound
16569     to the namespace name <URI::http://www.w3.org/2000/xmlns/>.
16570     @enMufDef:
16571     Namespace prefix |%p (name => {<Q::infoset|prefix>});| cannot be
16572     bound to namespace name |http://www.w3.org/2000/xmlns/|
16573     @enImplNote:
16574     The XMLNames spec does not prohibit the URI bound to
16575     the default namespace (!)
16576     @ecore:hasParameter: xp|error-token
16577     @ecore:hasParameter:
16578     @@@: infoset|prefix
16579     @@enDesc:
16580     The namespace prefix or <DOM::null> for default namespace.
16581     @ecore:hasParameter:
16582     @@@: infoset|namespaceName
16583     @@enDesc:
16584     The namespace name bound to.
16585    
16586     NSCErrDef:
16587     @QName: xp|nsc-prefix-declared
16588     @enDesc:
16589     A namespace prefix other than <XML::xml> or <XML::xmlns>
16590     <kwd:MUST> have been declared in a namespace declaration
16591     attribute in either the start or empty element tag of the
16592     element where the prefix is used or in an ancestor
16593     element. Furthermore, the attribute value in the innermost
16594     such declaration <kwd:MUST-NOT> be an empty string.
16595     @enMufDef:
16596     Namespace prefix |%p (name => {<Q::infoset|prefix>});| in
16597     qualified name |%p (name => {<Q::xp|name>});| is not declared
16598     @ecore:hasParameter: xp|error-token
16599     @ecore:hasParameter:
16600     @@@: infoset|prefix
16601     @@enDesc:
16602     The namespace prefix.
16603     @ecore:hasParameter:
16604     @@@: xp|name
16605     @@enDesc:
16606     The qualified name.
16607    
16608     NSFatalErrDef:
16609     @QName: xp|nswf-empty-namespace-name
16610     @enDesc:
16611     If the XML version of the document is 1.0 and the
16612     normalized value of the prefixed namespace declaration attribute is empty.
16613     @enMufDef:
16614     Namespace |%p (name => {<Q::infoset|prefix>});| cannot be
16615     undeclared in XML 1.0
16616     @ecore:hasParameter: xp|error-token
16617     @ecore:hasParameter:
16618     @@@: infoset|prefix
16619     @@enDesc:
16620     The namespace prefix.
16621     @ecore:hasParameter:
16622     @@@: infoset|namespaceName
16623     @@enDesc:
16624     An empty string.
16625    
16626     NSFatalErrDef:
16627     @QName: xp|nswf-unique-att-spec-expanded-name
16628     @enDesc:
16629     No element may have two attributes that have qualified name
16630     with the same local part and with namespace prefixes
16631     that have been bound to namespace names that are identical.
16632     @enMufDef:
16633     Attribute |%p (name => {<Q::infoset|localName>});| in
16634     namespace |%p (name => {<Q::infoset|namespaceName>});| is
16635     attached to the same element more than once (as
16636     |%p (name => {<Q::xp|name>});| and
16637     |%p (name => {<Q::xp|another-attribute-name>});|)
16638     @enImplNote:
16639     The XMLNames spec doesn't mention default attributes
16640     for this constraint...
16641     @ecore:hasParameter: xp|error-token
16642     @ecore:hasParameter:
16643     @@@: infoset|localName
16644     @@enDesc:
16645     The local part of the attribute.
16646     @ecore:hasParameter:
16647     @@@: infoset|namespaceName
16648     @@enDesc:
16649     The namespace URI of the attribute.
16650     @ecore:hasParameter:
16651     @@@: xp|name
16652     @@enDesc:
16653     The name, i.e. a qualified name consist of <Q::infoset:localName>
16654     and <Q::infoset:namespaceName> parameter values.
16655     @ecore:hasParameter:
16656     @@@: xp|another-attribute-name
16657     @@enDesc:
16658     Another attribute qualified name expanded to the same expanded name
16659     as <Q::xp|name>.
16660    
16661     XWParam:
16662     @QName: xp|another-attribute-name
16663 wakaba 1.24
16664     XWParam:
16665     @QName: xp|replacement-text
16666     @enDesc:
16667     The replacement text.
16668 wakaba 1.1
16669 wakaba 1.3 XWParam:
16670 wakaba 1.1 @QName: xp|error-token
16671     @enDesc:
16672     The token where the parser found an error.
16673    
16674 wakaba 1.3 XWParam:
16675     @QName: xp|name
16676     @enDesc:
16677     A name.
16678    
16679     XWParam:
16680     @QName: xp|parent
16681     @enDesc:
16682     The parent node in which the error occurs.
16683    
16684     XWParam:
16685     @QName: xp|node
16686     @enDesc:
16687     The current node.
16688    
16689     XWParam:
16690     @QName: xp|actual-element-type
16691     @enDesc:
16692     The actual element type name occured in the source.
16693    
16694     XWParam:
16695     @QName: xp|expected-element-type
16696 wakaba 1.1 @enDesc:
16697 wakaba 1.3 The element type name expected.
16698    
16699     XWParam:
16700     @QName: xp|character-number
16701     @enDesc:
16702     The character code position.
16703    
16704     ElementTypeBinding:
16705     @Name: XWParam
16706     @ElementType:
16707     dis:ResourceDef
16708     @ShadowContent:
16709     @@For: =ManakaiDOM|all
16710     @@rdf:type: ecore|Parameter
16711 wakaba 1.1
16712     ElementTypeBinding:
16713     @Name:enMufDef
16714     @ElementType:
16715     ecore:defaultMessage
16716     @ShadowContent:
16717     @@lang:en
16718     @@ContentType:
16719     lang:muf
16720    
16721     ResourceDef:
16722     @QName: DOMImpl
16723     @AliasFor: DOMCore|DOMImplementation
16724     @For: ManakaiDOM|DOM
16725    
16726 wakaba 1.27 ResourceDef:
16727     @QName: LSInput
16728     @AliasFor: DOMLS|LSInput
16729     @For: ManakaiDOM|DOM
16730    
16731     ResourceDef:
16732     @QName: LSParser
16733     @AliasFor: DOMLS|LSParser
16734     @For: ManakaiDOM|DOM
16735    
16736 wakaba 1.1 ElementTypeBinding:
16737     @Name: Attr
16738     @ElementType:
16739     dis:ResourceDef
16740     @ShadowContent:
16741     @@rdf:type: DISLang|Attribute
16742     @@ForCheck: !=ManakaiDOM|ManakaiDOM
16743    
16744     ElementTypeBinding:
16745     @Name: Get
16746     @ElementType:
16747     dis:ResourceDef
16748     @ShadowContent:
16749     @@rdf:type: DISLang|AttributeGet
16750    
16751     ElementTypeBinding:
16752     @Name: Set
16753     @ElementType:
16754     dis:ResourceDef
16755     @ShadowContent:
16756     @@rdf:type: DISLang|AttributeSet
16757    
16758     ElementTypeBinding:
16759     @Name: enDesc
16760     @ElementType:
16761     dis:Description
16762     @ShadowContent:
16763     @@lang:en
16764    
16765     ElementTypeBinding:
16766     @Name: Method
16767     @ElementType:
16768     dis:ResourceDef
16769     @ShadowContent:
16770     @@rdf:type: DISLang|Method
16771     @@For: !=ManakaiDOM|ManakaiDOM
16772    
16773     ElementTypeBinding:
16774     @Name: Return
16775     @ElementType:
16776     dis:ResourceDef
16777     @ShadowContent:
16778     @@rdf:type: DISLang|MethodReturn
16779    
16780     ElementTypeBinding:
16781     @Name: Param
16782     @ElementType:
16783     dis:ResourceDef
16784     @ShadowContent:
16785     @@rdf:type: DISLang|MethodParameter
16786    
16787     ElementTypeBinding:
16788     @Name: PerlDef
16789     @ElementType:
16790     dis:Def
16791     @ShadowContent:
16792     @@ContentType: lang|Perl
16793    
16794     ElementTypeBinding:
16795 wakaba 1.27 @Name: PerlDefC
16796     @ElementType:
16797     dis:Def
16798     @ShadowContent:
16799     @@ContentType: lang|Perl
16800    
16801     ElementTypeBinding:
16802 wakaba 1.1 @Name: PropDef
16803     @ElementType:
16804     dis:ResourceDef
16805     @ShadowContent:
16806     @@rdf:type: rdf|Property
16807    
16808     ClsDef:
16809     @ClsQName: ManakaiXMLParserExceptionFormatter
16810    
16811     @ClsISA: ecore|MUErrorFormatter||ManakaiDOM|Perl
16812    
16813     @RuleDef:
16814     @@Name: xp-error-token-type
16815     @@enDesc:
16816     The type of the token the parser is encountered.
16817    
16818     @@Method:
16819     @@@Name: after
16820     @@@Param:
16821     @@@@Name: name
16822     @@@@Type: DOMString
16823     @@@@enDesc: The name of the method.
16824     @@@Param:
16825     @@@@Name: p
16826     @@@@Type: DISPerl|HASH
16827     @@@@enDesc: The set of the parameters to the method.
16828     @@@Param:
16829     @@@@Name: o
16830     @@@@Type: DISPerl|HASH
16831     @@@@enDesc: The option value.
16832     @@@Return:
16833     @@@@PerlDef:
16834     $p->{-result} = $o->{<H::xp|error-token>}->{type}
16835     if defined $o->{<H::xp|error-token>}->{type};
16836    
16837     @RuleDef:
16838     @@Name: xp-error-token-value
16839     @@enDesc:
16840     The value of the token the parser is encountered, if any.
16841    
16842     @@Method:
16843     @@@Name: after
16844     @@@Param:
16845     @@@@Name: name
16846     @@@@Type: DOMString
16847     @@@@enDesc: The name of the method.
16848     @@@Param:
16849     @@@@Name: p
16850     @@@@Type: DISPerl|HASH
16851     @@@@enDesc: The set of the parameters to the method.
16852     @@@Param:
16853     @@@@Name: o
16854     @@@@Type: DISPerl|HASH
16855     @@@@enDesc: The option value.
16856     @@@Return:
16857     @@@@PerlDef:
16858     $p->{-result} = $o->{<H::xp|error-token>}->{value}
16859     if defined $o->{<H::xp|error-token>}->{value};
16860    
16861     @RuleDef:
16862     @@Name: xp-error-lines
16863     @@enDesc:
16864     A copy of fragment of the source text that contains the line
16865     where the error occurred, if available.
16866    
16867     @@Method:
16868     @@@Name: after
16869     @@@Param:
16870     @@@@Name: name
16871     @@@@Type: DOMString
16872     @@@@enDesc: The name of the method.
16873     @@@Param:
16874     @@@@Name: p
16875     @@@@Type: DISPerl|HASH
16876     @@@@enDesc: The set of the parameters to the method.
16877     @@@Param:
16878     @@@@Name: o
16879     @@@@Type: DISPerl|HASH
16880     @@@@enDesc: The option value.
16881     @@@Return:
16882     @@@@PerlDef:
16883     my $pos = $o-><AG::DOMCore|DOMError.location>
16884     -><AG::DOMCore|DOMLocator.utf32Offset>;
16885 wakaba 1.27 my $src = $o->{<H::ecore|object>}->{entity}->[-1]->{reptxt};
16886     if (defined $src and $pos > -1) {
16887 wakaba 1.1 my $start = $pos;
16888     $start = rindex ($$src, "\x0A", $start - 1) for 0..2;
16889     $start++;
16890     my $end = $pos;
16891     $end = index ($$src, "\x0A", $end + 1) for 0..2;
16892     $end = length $$src if $end < 0;
16893     $p->{-result} = substr $$src, $start, $end - $start;
16894     }
16895 wakaba 1.3
16896     @RuleDef:
16897     @@Name: character-code-point
16898     @@enDesc:
16899     The character code position, in <CODE::U+<VAR::HHHH>> notation.
16900    
16901     @@Method:
16902     @@@Name: after
16903     @@@Param:
16904     @@@@Name: name
16905     @@@@Type: DOMString
16906     @@@@enDesc: The name of the method.
16907     @@@Param:
16908     @@@@Name: p
16909     @@@@Type: DISPerl|HASH
16910     @@@@enDesc: The set of the parameters to the method.
16911     @@@Param:
16912     @@@@Name: o
16913     @@@@Type: DISPerl|HASH
16914     @@@@enDesc: The option value.
16915     @@@RuleParam:
16916     @@@@Name: v
16917     @@@@Type: DISPerl|Number
16918     @@@@enDesc:
16919     The name of the error parameter that contains the character code.
16920     @@@Return:
16921     @@@@PerlDef:
16922     $p->{-result} = sprintf 'U+%04X', $o->{$p->{v}};
16923 wakaba 1.1 ##XMLParserExceptionFormatter
16924 wakaba 1.27
16925     ElementTypeBinding:
16926     @Name: CParam
16927     @ElementType:
16928     dis:ResourceDef
16929     @ShadowContent:
16930     @@rdf:type:
16931     @@@@: c|DOMConfigurationParameter
16932     @@@For: ManakaiDOM|DOM
16933     @@rdf:type:
16934 wakaba 1.33 @@@@: DISSource|ResourceProperty
16935 wakaba 1.27 @@@For: =ManakaiDOM|all
16936     @@For: ManakaiDOM|DOM3
16937     @@For: =ManakaiDOM|all
16938 wakaba 1.33 @@subsetOf:
16939     @@@@: c|anyDOMConfigurationParameter
16940     @@@For: =ManakaiDOM|all
16941 wakaba 1.34 @@multipleProperties:
16942     @@@@: DISCore|Single
16943     @@@For: =ManakaiDOM|all
16944 wakaba 1.27
16945     ElementTypeBinding:
16946     @Name: CParamApp
16947     @ElementType:
16948     dis:ResourceDef
16949     @ShadowContent:
16950     @@rdf:type:
16951     @@@@: c|DOMConfigurationParameterApplication
16952     @@@For: ManakaiDOM|DOM
16953     @@For: ManakaiDOM|DOM3
16954 wakaba 1.30
16955 wakaba 1.34 ElementTypeBinding:
16956     @Name: boolCParam
16957     @ElementType:
16958     dis:ResourceDef
16959     @ShadowContent:
16960     @@DISCore:resourceType:
16961     @@@@: c|DOMConfigurationParameter
16962     @@@For: ManakaiDOM|DOM
16963     @@DISCore:resourceType:
16964     @@@@: DISSource|ResourceProperty
16965     @@@For: =ManakaiDOM|all
16966     @@For: ManakaiDOM|DOM3
16967     @@For: =ManakaiDOM|all
16968     @@Type: idl|boolean||ManakaiDOM|all
16969     @@subsetOf:
16970     @@@@: c|anyDOMConfigurationParameter
16971     @@@For: =ManakaiDOM|all
16972     @@multipleProperties:
16973     @@@@: DISCore|Single
16974     @@@For: =ManakaiDOM|all
16975     @@dataType:
16976     @@@@: DISCore|Boolean
16977     @@@For: =ManakaiDOM|all
16978    
16979 wakaba 1.30 CParamApp:
16980     @QName: xml-id
16981     @c:domConfigurationParameter: cfg|xml-id
16982     @c:targetType: xp|ManakaiXMLParser
16983 wakaba 1.34 @TrueCase:
16984     @@c:isSupported: 1
16985     @FalseCase:
16986     @@c:isSupported: 1
16987 wakaba 1.27
16988     CParamApp:
16989     @QName: error-handler
16990     @c:domConfigurationParameter: c|error-handler
16991     @c:targetType: xp|ManakaiXMLParser
16992 wakaba 1.34
16993     boolCParam:
16994     @QName: cfg|entity-replacement-tree
16995     @DOMLS:lsKey:
16996     @@@: erep
16997     @@For: =ManakaiDOM|all
16998     @Type: idl|boolean||ManakaiDOM|all
16999     @c:targetType: xp|ManakaiXMLParser
17000     @IsSupportRequired: 1
17001     @c:isSupported: 1
17002     @TrueCase:
17003     @@c:isSupported: 1
17004     @@enDesc:
17005     The parser <kwd:MUST> cnstruct the replacement subtree of
17006 wakaba 1.35 a general parsed <IF::tx|Entity> node if the replacement text
17007 wakaba 1.34 for the node is available.
17008    
17009     If this value is set to the parameter, then a fatal error
17010     might be reported even if the entire document is well-formed
17011     in case a general parsed entity has replacement text that is
17012     not well-formed when evaluated as if it has been referenced
17013     in the content of an element, except that undeclared namespace prefixes
17014     do not result in namespace well-formedness error.
17015     @FalseCase:
17016     @@IsDefault: 1
17017     @@c:isSupported: 1
17018     @@IsSupportRequired: 1
17019     @@enDesc:
17020 wakaba 1.35 The parser don't have to construct <IF::tx|Entity> replacement
17021 wakaba 1.34 subtrees.
17022    
17023     @Test:
17024     @@QName: cfg.entity-replacement-tree.test
17025     @@PerlDef:
17026     my $xp;
17027     __CODE{createParserForTest:: $xp => $xp}__;
17028     my $cfg = $xp-><AG::LSInput.domConfig>;
17029    
17030     my $pname = <Q::cfg|entity-replacement-tree>;
17031    
17032     $test->id ('default.false');
17033     $test->assert_false ($cfg-><M::c|DOMConfiguration.getParameter> ($pname));
17034    
17035     $test->id ('false.to.true');
17036     $cfg-><M::c|DOMConfiguration.setParameter> ($pname => true);
17037     $test->assert_false ($cfg-><M::c|DOMConfiguration.getParameter> ($pname));
17038    
17039     $test->id ('true.to.false');
17040     $cfg-><M::c|DOMConfiguration.setParameter> ($pname => false);
17041     $test->assert_false ($cfg-><M::c|DOMConfiguration.getParameter> ($pname));
17042    
17043     $test->id ('reset');
17044     $cfg-><M::c|DOMConfiguration.setParameter> ($pname => true);
17045     $cfg-><M::c|DOMConfiguration.setParameter> ($pname => null);
17046     $test->assert_false ($cfg-><M::c|DOMConfiguration.getParameter> ($pname));
17047 wakaba 1.27
17048     CParam:
17049     @QName: xp|ls-input-to-input-file
17050     @DOMLS:lsKey:
17051     @@@: i2i
17052     @@For: =ManakaiDOM|all
17053     @Type: ManakaiDOMLSInputToInputFile
17054     @c:targetType: xp|ManakaiXMLParser
17055     @IsSupportRequired: 1
17056     @c:isSupported: 1
17057     @enDesc:
17058     An <IF::LSInput> to Perl filehandle converter.
17059    
17060     @Method:
17061     @@rdf:type: c|DOMConfigurationParameterDefaultGetter
17062     @@Param:
17063     @@@Name: name
17064     @@@Type: DOMString
17065     @@@dis:actualType: c|DOMConfigurationParameterName
17066     @@@enDesc: The parameter name.
17067     @@Return:
17068     @@@Type: ManakaiDOMLSInputToInputFile
17069     @@@enDesc:
17070     The default resolver.
17071     @@@PerlDefC:
17072 wakaba 1.37 # resolveLSInput
17073 wakaba 1.27 $r = sub {
17074 wakaba 1.37 my ($self, $impl, $input, $parser, $errorHandler) = @_;
17075 wakaba 1.27 ## As defined in DOM Level 3 LS |LSInput| interface
17076    
17077     my $r = {};
17078    
17079     __DEEP{
17080    
17081     FH: {
17082     ## 1. |characterStream|
17083     my $v = $input-><AG::LSInput.characterStream>;
17084     if (defined $v) {
17085     $r->{filehandle} = $v;
17086     last FH;
17087     }
17088    
17089     ## 2. |byteStream|
17090     $v = $input-><AG::LSInput.byteStream>;
17091     if (defined $v) {
17092 wakaba 1.37 require Message::Charset::Encode;
17093     my $mceimpl = $impl-><M::f|GetFeature.getFeature>
17094     (<Q::fe|MCEncode>, '1.0');
17095     my $encode = $input-><AG::LSInput.encoding>;
17096     my $encode_uri = defined $encode
17097     ? $mceimpl-><M::mce|MCEncodeImplementation
17098     .getURIFromCharsetName>
17099     (<Q::cs|xmlName>, $encode)
17100     : <Q::xml-auto-charset:>;
17101     $r->{filehandle} = $mceimpl-><M::mce|MCEncodeImplementation
17102     .createMCDecodeHandle>
17103     ($encode_uri, $v, sub {
17104     my ($self, $fh, $type, %opt) = @_;
17105     my $continue = true;
17106     if ($type eq <Q::cs|illegal-octets-error>) {
17107     $continue = __c|ERROR{xp|fatal-illegal-byte-sequence::
17108     xp|byte-sequence => {$opt{octets}},
17109     ecore|object => {$parser},
17110     }__;
17111     } elsif ($type eq <Q::cs|unassigned-code-point-error>) {
17112     $continue = __c|ERROR{xp|warning-unassigned-code-point::
17113     xp|byte-sequence => {$opt{octets}},
17114     ecore|object => {$parser},
17115     }__;
17116     $opt{octets} = \"\x{FFFD}";
17117     } elsif ($type eq <Q::cs|invalid-state-error>) {
17118     $continue = __c|ERROR{xp|fatal-illegal-byte-sequence::
17119     xp|code-state => {$opt{state}},
17120     ecore|object => {$parser},
17121     }__;
17122     } elsif ($type eq <Q::cs|charset-not-supported-error>) {
17123     $continue = __c|ERROR{xp|fatal-unprocessable-encoding::
17124     xp|encoding => {$encode},
17125     xp|charset-uri => {$opt{charset_uri}},
17126     ecore|object => {$parser},
17127     }__;
17128     } elsif ($type eq <Q::cs|no-bom-error>) {
17129     if ($opt{charset_uri} eq <Q::cs|XML.utf-16>) {
17130     $continue = __c|ERROR{xp|fatal-utf-16-no-bom::
17131     ecore|object => {$parser},
17132     }__;
17133     } else {
17134     $continue = __c|ERROR{xp|fatal-illegal-byte-sequence::
17135     xp|code-state => 'bom',
17136     ecore|object => {$parser},
17137     }__;
17138     }
17139     } elsif ($type eq <Q::cs|charset-name-mismatch-error>) {
17140     $continue = __c|ERROR{xp|fatal-encoding-mismatch::
17141     xp|encoding => {$encode},
17142     xp|charset-uri => {$opt{charset_uri}},
17143     ecore|object => {$parser},
17144     }__;
17145     } else {
17146     $continue = __c|ERROR{xp|warn-unknown-decode-error::
17147     xp|error-type => {$type},
17148     xp|error-param => {\%opt},
17149     ecore|object => {$parser},
17150     }__;
17151     }
17152     unless ($continue) {
17153     __EXCEPTION{DOMLS|PARSE_ERR::
17154     ecore|object => {$parser},
17155     }__;
17156     }
17157     });
17158     $r->{input_encoding}
17159     = $r->{filehandle}-><AG::mce|MCDecodeHandle.inputEncoding>
17160     if defined $r->{filehandle};
17161     last FH;
17162 wakaba 1.27 }
17163    
17164     ## 3. |stringData|
17165     $v = $input-><AG::LSInput.stringData>;
17166     if (defined $v) {
17167     require IO::String;
17168     $r->{filehandle} = IO::String->new ($v);
17169     last FH;
17170     }
17171    
17172     ## 4. |systemId|
17173     ## TODO:
17174     ## resolve relative URI
17175     ## open
17176     ## set document_uri
17177    
17178     ## 5. |publicId|
17179     ## The default resolver does not support only-|publicId| input.
17180    
17181     return null;
17182     } # FH
17183    
17184     DURI: {
17185     last DURI if defined $r->{document_uri};
17186    
17187     my $v = $input-><AG::LSInput.systemId>;
17188     if (defined $v) {
17189 wakaba 1.29 $r->{base_uri} = $input-><AG::LSInput.baseURI>
17190     unless defined $r->{base_uri};
17191     if (defined $r->{base_uri}) {
17192 wakaba 1.41 $r->{document_uri} = $impl->create_uri_reference (\$v)
17193 wakaba 1.29 -><M::urigen|URIReference.getAbsoluteReference>
17194     ($r->{base_uri})
17195     -><AG::urigen|URIReference.uriReference>;
17196     } else {
17197     $r->{document_uri} = $v;
17198     }
17199 wakaba 1.27 last DURI;
17200     }
17201    
17202     ## TODO: pubid -> pubid URN -> document_uri
17203     } # DURI
17204    
17205     BURI: {
17206     last BURI if defined $r->{base_uri};
17207    
17208     my $v = $input-><AG::LSInput.baseURI>;
17209     if (defined $v) {
17210     $r->{base_uri} = $v;
17211     last BURI;
17212     }
17213    
17214     if (defined $r->{document_uri}) {
17215     $r->{base_uri} = $r->{document_uri};
17216     }
17217     } # BURI
17218    
17219 wakaba 1.37 $r->{input_encoding} = $input-><AG::LSInput.encoding>
17220     unless defined $r->{input_encoding};
17221    
17222 wakaba 1.27 }__;
17223    
17224     ## ISSUE: Is |certifiedText| required by parsers?
17225    
17226     return $r;
17227     };
17228     @Method:
17229     @@rdf:type: c|DOMConfigurationParameterSetter
17230     @@Param:
17231     @@@Name: name
17232     @@@Type: DOMString
17233     @@@dis:actualType: c|DOMConfigurationParameterName
17234     @@@enDesc: The parameter name.
17235     @@Param:
17236     @@@Name: value
17237     @@@Type: DOMMain|DOMUserData
17238     @@@dis:actualType: ManakaiDOMLSInputToInputFile
17239     @@@enDesc: The new value.
17240     @@Return:
17241     @@@Type: idl|void||ManakaiDOM|all
17242     @@@PerlDefC:
17243     $self->[1]->{<H::xp|ls-input-to-input-file>} = $value;
17244     @@enImplNote:
17245     Implied input processor converts non-blessed code references
17246     into a <Class::ManakaiDOMLSInputToInputFile> object.
17247     @Method:
17248     @@rdf:type: c|DOMConfigurationParameterChecker
17249     @@Param:
17250     @@@Name: name
17251     @@@Type: DOMString
17252     @@@dis:actualType: c|DOMConfigurationParameterName
17253     @@@enDesc: The parameter name.
17254     @@Param:
17255     @@@Name: value
17256     @@@Type: DOMMain|DOMUserData
17257     #@@@dis:actualType: ManakaiDOMLSInputToInputFile
17258     @@@enDesc: The new value.
17259     @@Return:
17260     @@@Type: idl|boolean||ManakaiDOM|all
17261     @@@PerlDefC:
17262     $r = UNIVERSAL::isa ($value, 'CODE') or
17263     UNIVERSAL::isa ($value, <ClassName::ManakaiDOMLSInputToInputFile>);
17264    
17265     @@Test:
17266     @@@QName: cp.ls-input-to-input-file.test
17267     @@@PerlDefC:
17268     my $xp;
17269     __CODE{createParserForTest:: $xp => $xp}__;
17270     my $cfg = $xp-><AG::LSInput.domConfig>;
17271    
17272     my $cp = <Q::xp|ls-input-to-input-file>;
17273    
17274     $test->id ('default');
17275     my $default = $cfg-><M::c|DOMConfiguration.getParameter> ($cp);
17276     $test->assert_isa ($default,
17277     <ClassName::ManakaiDOMLSInputToInputFile>);
17278    
17279     $test->id ('set');
17280     my $sub1 = sub { };
17281     $cfg-><M::c|DOMConfiguration.setParameter> ($cp => $sub1);
17282     my $sub2 = $cfg-><M::c|DOMConfiguration.getParameter> ($cp);
17283     $test->assert_isa ($sub2, <ClassName::ManakaiDOMLSInputToInputFile>);
17284     $test->assert_equals ($sub2, $sub1);
17285    
17286     $test->id ('reset');
17287     $cfg-><M::c|DOMConfiguration.setParameter> ($cp => null);
17288     my $sub3 = $cfg-><M::c|DOMConfiguration.getParameter> ($cp);
17289     $test->assert_isa ($sub3, <ClassName::ManakaiDOMLSInputToInputFile>);
17290     $test->assert_equals ($sub3, $default);
17291 wakaba 1.29
17292     @@Test:
17293     @@@QName: cp.ls-input-to-input-file.default.test
17294     @@@PerlDefC:
17295     my $xp;
17296     __CODE{createParserForTest:: $xp => $xp}__;
17297     my $cfg = $xp-><AG::LSInput.domConfig>;
17298     my $cp = <Q::xp|ls-input-to-input-file>;
17299     my $default = $cfg-><M::c|DOMConfiguration.getParameter> ($cp);
17300    
17301     my $err = sub {}; # dummy error handler
17302    
17303     my $cs = \*STDOUT; # dummy input
17304    
17305     $test->id ('cs.sysid');
17306     my $r1 = $default->resolve_ls_input ({
17307     character_stream => $cs,
17308     system_id => q<http://example.com/sysid>,
17309     }, $err);
17310     $test->assert_equals
17311     ($r1->document_uri, q<http://example.com/sysid>);
17312     $test->assert_equals
17313     ($r1->base_uri, q<http://example.com/sysid>);
17314    
17315     $test->id ('cs.baseuri.sysid');
17316     my $r1 = $default->resolve_ls_input ({
17317     character_stream => $cs,
17318     system_id => q<sysid>,
17319     base_uri => q<http://example.com/>,
17320     }, $err);
17321     $test->assert_equals
17322     ($r1->document_uri, q<http://example.com/sysid>);
17323     $test->assert_equals
17324     ($r1->base_uri, q<http://example.com/>);
17325 wakaba 1.27 ##ls-input-to-input-file
17326    
17327     ClsDef:
17328     @ClsQName: ManakaiDOMLSInputToInputFile
17329     @enDesc:
17330     An <Class::ManakaiDOMLSInputToInputFile> object is used to covert
17331     a <IF::LSInput> object into a Perl filehandle.
17332    
17333     {ISSUE::
17334     In which module this class should be placed?
17335    
17336     Better interface name?
17337     }
17338    
17339     @enDesc:
17340     @@ddid: perl
17341     @@ForCheck: ManakaiDOM|ManakaiDOM
17342     @@@:
17343     For Perl binding, any parameter that accepts
17344     a <Class::ManakaiDOMLSInputToInputFile> would also accept a Perl code
17345     reference (subroutine reference). The code reference
17346     will be blessed as a <Class::ManakaiDOMLSInputToInputFile> whose
17347     <M::ManakaiDOMLSInputToInputFile.resolveLSInput> method invokes the code.
17348    
17349     @ResourceDef:
17350     @@rdf:type: DISLang|InputProcessor
17351     @@rdf:type: DISLang|OutputProcessor
17352     @@PerlDef:
17353     $INPUT = bless $INPUT, <ClassName::ManakaiDOMLSInputToInputFile>
17354     if ref $INPUT eq 'CODE';
17355    
17356     @Method:
17357     @@Name: resolveLSInput
17358     @@enDesc:
17359     Converts a <IF::LSInput> into a Perl filehandle.
17360     @@Param:
17361 wakaba 1.37 @@@Name: impl
17362     @@@Type: f|MinimumImplementation
17363     @@@enDesc:
17364     The implementation object.
17365     @@Param:
17366 wakaba 1.27 @@@Name: input
17367     @@@Type: LSInput
17368     @@@enDesc:
17369     The input.
17370     @@Param:
17371 wakaba 1.37 @@@Name: parser
17372     @@@Type: LSParser
17373     @@@enDesc:
17374     The parser.
17375     @@Param:
17376 wakaba 1.27 @@@Name: errorHandler
17377     @@@Type: c|DOMErrorHandler
17378     @@@enDesc:
17379     An error handler. If the method encounters an error
17380     or warning, it <kwd:MAY> notify it to application
17381     via this handler.
17382     @@Return:
17383     @@@Type: ManakaiDOMInputFile
17384     @@@enDesc:
17385     A <Class::ManakaiDOMInputFile> object created from <P::input>.
17386     @@@nullCase:
17387     @@@@enDesc:
17388     If the method was unable to resolve the <P::input>.
17389    
17390     {ISSUE::
17391     Should we allow the method to throw exceptions?
17392     }
17393     @@@PerlDef:
17394     __DEEP{
17395 wakaba 1.37 $r = $self->($self, $impl, $input, $parser, $errorHandler);
17396 wakaba 1.27 }__;
17397     @@@enImplNote:
17398     Notet that the input / output processor for <CODE::$input>
17399     and return value might or might not be inserted in
17400     the <Perl::$self> code.
17401     ##LSInputToInputFile
17402    
17403     ClsDef:
17404     @ClsQName: ManakaiDOMInputFile
17405     @enDesc:
17406     A set of information on the input, including filehandle.
17407    
17408     @enDesc:
17409     @@ddid: perl
17410     @@ForCheck: ManakaiDOM|ManakaiDOM
17411     @@@:
17412     For Perl binding, any parameter that accepts
17413     a <Class::ManakaiDOMInputFile> would also accept a Perl hash reference.
17414     If a hash reference is given to parameter that expects
17415     a <Class::ManakaiDOMInputFile> object, then it
17416     bless the hash with the class.
17417    
17418     Each attributes defined
17419     in the class is associated to the hash value with the
17420     key equals to the attribut name. Each method defined in
17421     the class will invoke the code reference retrieved
17422     from the hash by the key equals to the method name.
17423    
17424     If there is no value in the hash for an attribute,
17425     then its value is <DOM::null>.
17426    
17427     @ResourceDef:
17428     @@rdf:type: DISLang|InputProcessor
17429     @@rdf:type: DISLang|OutputProcessor
17430     @@PerlDef:
17431     $INPUT = bless $INPUT, <ClassName::ManakaiDOMInputFile>
17432     if ref $INPUT eq 'HASH';
17433    
17434     @Attr:
17435     @@Name: filehandle
17436     @@Type: DISPerl|filehandle||ManakaiDOM|all
17437     @@enDesc:
17438     The input filehandle.
17439    
17440     It <kwd:MUST> be an <Perl::open>ed (and not <Perl::close>d)
17441     filehandle. Note that
17442     it does not have to be associated with an actual file
17443     in the local file system.
17444    
17445     It <kwd:MUST> return a character (rather than byte)
17446     by <Perl::getc>.
17447     @@Get:
17448     @@@PerlDef: $r = $self->{filehandle};
17449     @@Set:
17450     @@@PerlDef: $self->{filehandle} = $given;
17451    
17452     @Attr:
17453     @@Name: baseURI
17454     @@enDesc:
17455     The base URI of the input.
17456    
17457     It <kwd:MUST> be an absolute DOM URI or <DOM::null>.
17458     Otherwise, the result is undefined.
17459     @@Type: DOMString
17460     @@nullCase:
17461     @@@enDesc:
17462     If the base URI is not available.
17463     @@Get:
17464     @@@PerlDef: $r = $self->{base_uri};
17465     @@Set:
17466     @@@PerlDef: $self->{base_uri} = $given;
17467    
17468     @Attr:
17469     @@Name: documentURI
17470     @@enDesc:
17471     The URI of the document.
17472    
17473     It <kwd:MUST> be an absolute DOM URI or <DOM::null>.
17474     Otherwise, the result is undefined.
17475     @@Type: DOMString
17476     @@nullCase:
17477     @@@enDesc:
17478     If the document URI is not available.
17479     @@Get:
17480     @@@PerlDef: $r = $self->{document_uri};
17481     @@Set:
17482     @@@PerlDef: $self->{document_uri} = $given;
17483 wakaba 1.37
17484     @Attr:
17485     @@Name: inputEncoding
17486     @@enDesc:
17487     The input encoding name.
17488     @@Type: DOMString
17489     @@nullCase:
17490     @@@enDesc:
17491     If the input encoding name is not available.
17492     @@Get:
17493     @@@PerlDef: $r = $self->{input_encoding};
17494     @@Set:
17495     @@@PerlDef: $self->{input_encoding} = $given;
17496 wakaba 1.27
17497     @Method:
17498     @@Name: close
17499     @@enDesc:
17500     Closes the file.
17501    
17502     Since when the Perl's destructor is invoked is unreliable,
17503     this method is explicitly called when the file is no longer
17504     in use.
17505    
17506     If the <Class::ManakaiDOMInputFile> is given as a hash
17507     reference and whose value for <CODE::close> is not defined,
17508     then the statement <Perl::close $filehandle> is done
17509     (where <Perl::$filehandle> is the <A::ManakaiDOMInputFile.filehandle>
17510     value).
17511     @@Return:
17512     @@@PerlDef:
17513     __DEEP{
17514     if ($self->{close}) {
17515     $self->{close}->($self);
17516     } else {
17517 wakaba 1.38 $self->{filehandle}->close;
17518 wakaba 1.27 }
17519     }__;
17520     ##ManakaiDOMInputFile
17521    
17522    
17523    

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24