/[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.43 - (hide annotations) (download)
Sun Dec 3 05:40:35 2006 UTC (17 years, 11 months ago) by wakaba
Branch: MAIN
CVS Tags: manakai-200612
Changes since 1.42: +4 -4 lines
++ manakai/lib/Message/Util/DIS/ChangeLog	3 Dec 2006 05:40:22 -0000
2006-12-03  Wakaba  <wakaba@suika.fam.cx>

	* Perl.dis: Support for obsolete |role|s is removed.

++ manakai/lib/Message/DOM/ChangeLog	3 Dec 2006 05:39:22 -0000
2006-12-03  Wakaba  <wakaba@suika.fam.cx>

	* DOMFeature.dis, TreeCore.dis: Unused |role|s are removed.

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.43 $Date: 2006/12/02 12:46:23 $
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 wakaba 1.43 @mg:
77     http://suika.fam.cx/~wakaba/archive/2005/manakai/Util/Grove/
78 wakaba 1.1 @rdf:
79     http://www.w3.org/1999/02/22-rdf-syntax-ns#
80     @rdfs:
81     http://www.w3.org/2000/01/rdf-schema#
82     @t:
83     http://suika.fam.cx/~wakaba/archive/2004/dom/tree#
84 wakaba 1.35 @tc:
85     http://suika.fam.cx/~wakaba/archive/2005/manakai/DOM/TreeCore/
86     @td:
87     http://suika.fam.cx/~wakaba/archive/2005/manakai/DOM/Document/
88     @te:
89     http://suika.fam.cx/~wakaba/archive/2005/manakai/DOM/Element/
90 wakaba 1.5 @test:
91     http://suika.fam.cx/~wakaba/archive/2004/dis/Test#
92 wakaba 1.35 @tx:
93     http://suika.fam.cx/~wakaba/archive/2005/manakai/DOM/XML/
94 wakaba 1.29 @urigen:
95     http://suika.fam.cx/~wakaba/archive/2005/manakai/URI/Generic/
96 wakaba 1.8 @x:
97     http://suika.fam.cx/~wakaba/archive/2004/dom/xml#
98 wakaba 1.1 @xml:
99     http://www.w3.org/XML/1998/namespace
100 wakaba 1.37 @xml-auto-charset:
101     http://suika.fam.cx/www/2006/03/xml-entity/
102 wakaba 1.9 @xml-dtd:
103     http://www.w3.org/TR/REC-xml
104 wakaba 1.1 @xmlns:
105     http://www.w3.org/2000/xmlns/
106     @xp:
107     http://suika.fam.cx/~wakaba/archive/2004/dom/xml-parser#
108    
109     ## -- Features
110    
111     ElementTypeBinding:
112     @Name: FeatureDef
113     @ElementType:
114     dis:ResourceDef
115     @ShadowContent:
116     @@rdf:type: f|Feature
117     @@For: =ManakaiDOM|all
118    
119     ElementTypeBinding:
120     @Name: FeatureVerDef
121     @ElementType:
122     dis:ResourceDef
123     @ShadowContent:
124     @@rdf:type: f|Feature
125    
126     ElementTypeBinding:
127     @Name: featureQName
128     @ElementType:
129     f:name
130     @ShadowContent:
131     @@ContentType: DISCore|QName
132    
133     ResourceDef:
134     @QName: DOMString
135     @AliasFor: DOMMain|DOMString
136     @For: ManakaiDOM|DOM
137    
138     ResourceDef:
139     @QName: Node
140 wakaba 1.35 @AliasFor: tc|Node
141 wakaba 1.1 @For: ManakaiDOM|DOM
142    
143     ResourceDef:
144     @QName: Element
145 wakaba 1.35 @AliasFor: te|Element
146     @For: ManakaiDOM|DOM
147    
148     ResourceDef:
149     @QName: Attr
150     @AliasFor: te|Attr
151 wakaba 1.1 @For: ManakaiDOM|DOM
152    
153     ResourceDef:
154     @QName: Document
155 wakaba 1.35 @AliasFor: td|Document
156 wakaba 1.1 @For: ManakaiDOM|DOM
157    
158 wakaba 1.6 ResourceDef:
159     @QName: DocumentXDoctype
160     @AliasFor: d|DocumentXDoctype
161     @For: ManakaiDOM|DOM
162    
163 wakaba 1.8 ResourceDef:
164     @QName: DTDef
165     @AliasFor: d|DocumentTypeDefinition
166     @For: ManakaiDOM|DOM
167    
168     ResourceDef:
169     @QName: ETDef
170     @AliasFor: d|ElementTypeDefinition
171     @For: ManakaiDOM|DOM
172    
173     ResourceDef:
174     @QName: ATDef
175     @AliasFor: d|AttributeDefinition
176     @For: ManakaiDOM|DOM
177    
178 wakaba 1.35 ResourceDef:
179     @QName: GE
180     @AliasFor: tx|Entity
181     @For: ManakaiDOM|DOM
182    
183     ResourceDef:
184     @QName: GERef
185     @AliasFor: tx|EntityReference
186     @For: ManakaiDOM|DOM
187    
188 wakaba 1.1 ElementTypeBinding:
189     @Name: ClsDef
190     @ElementType:
191     dis:ResourceDef
192     @ShadowContent:
193     @@rdf:type:
194     @@@@: dis|MultipleResource
195     @@@ForCheck: !ManakaiDOM|ForIF !ManakaiDOM|ForClass
196     @@resourceFor:
197     @@@@: ManakaiDOM|ForClass
198     @@@ForCheck: ManakaiDOM|ManakaiDOM !=ManakaiDOM|ManakaiDOM
199     @@For: ManakaiDOM|DOM3
200     @@For: =ManakaiDOM|ManakaiDOM
201    
202     @@rdf:type:
203     @@@@: DISLang|Class
204     @@@ForCheck: ManakaiDOM|ForClass
205    
206     ElementTypeBinding:
207     @Name: ClsQName
208     @ElementType:
209     dis:QName
210     @ShadowContent:
211     @@ForCheck: ManakaiDOM|ForClass
212    
213     ElementTypeBinding:
214     @Name: ClsISA
215     @ElementType:
216     dis:ISA
217     @ShadowContent:
218     @@ForCheck: ManakaiDOM|ForClass
219    
220     ElementTypeBinding:
221     @Name: nullCase
222     @ElementType:
223     dis:ResourceDef
224     @ShadowContent:
225     @@rdf:type: ManakaiDOM|InCase
226     @@Value:
227     @@@is-null:1
228    
229 wakaba 1.27 ElementTypeBinding:
230     @Name: TrueCase
231     @ElementType:
232     dis:ResourceDef
233     @ShadowContent:
234     @@rdf:type:
235     ManakaiDOM:InCase
236     @@Value:
237     @@@@: 1
238     @@@ContentType: DISCore|Boolean
239     @@Type: idl|boolean||ManakaiDOM|all
240    
241     ElementTypeBinding:
242     @Name: FalseCase
243     @ElementType:
244     dis:ResourceDef
245     @ShadowContent:
246     @@rdf:type:
247     ManakaiDOM:InCase
248     @@Value:
249     @@@@: 0
250     @@@ContentType: DISCore|Boolean
251     @@Type: idl|boolean||ManakaiDOM|all
252    
253 wakaba 1.1 ResourceDef:
254     @QName: LSParser
255     @AliasFor: DOMLS|LSParser
256     @For: ManakaiDOM|DOM3
257    
258     ClsDef:
259     @ClsQName: ManakaiXMLParser
260    
261     @Implement: DOMLS|LSParser
262    
263 wakaba 1.28 @f:implements: DOMLS|LSFeature30
264     @f:implements: DOMLS|ParseString10
265     @enImplNote:
266     @@ddid: dtdfeature
267     @@@:
268     {TODO::
269     Once DTD validation is implemented, add <Q::f:implements>
270     for XML-DTD-feature.
271     }
272 wakaba 1.1
273 wakaba 1.11 @DISLang:role: gls|ParserRole
274 wakaba 1.1
275 wakaba 1.3 @enDesc:
276     Note that the <Class::ManakaiXMLParser> reports any XML errors
277     (syntax errors and / or well-formedness constraint errors)
278     via the <IF::DOMCore:error-handler> registered to
279     the <A::DOMLS:LSParser.domConfig> object. Each error has
280     its <A::DOMCore:DOMError.severity>, either <C::DOMCore:SEVERITY_ERROR>
281     or <C::DOMCore:SEVERITY_FATAL_ERROR>. However, their semantics
282     are slight different from the ones of <QUOTE::error> and
283     <QUOTE::fatal error> in XML; in this implemenetation,
284     <C::DOMCore:SEVERITY_ERROR> implies that the parsing process
285     can effectively be continued to detect more errors while
286     <C::DOMCore:SEVERITY_FATAL_ERROR> implies that the error
287     is serious so that the result document tree and any errors
288     might be far from the ones obtained when the error would not
289     be found.
290 wakaba 1.28
291     @Test:
292     @@QName: GLSImpl.createGLSParser.LS.test
293     @@enDesc:
294     Since there is at least one implementation of the feature (i.e.
295     this class), the <M::gls|GLSImplementation.createGLSParser>
296     must not throw an exception.
297     @@PerlDef:
298     my $impl;
299     __CODE{DOMLS|createImplForTest:: $impl => $impl}__;
300    
301     my $p = $impl-><M::gls|GLSImplementation.createGLSParser>
302     ({LS => '3.0'});
303    
304     $test->assert_isa ($p, <IFName::LSParser>);
305     @Test:
306     @@QName: GLSImpl.createGLSParser.ParseXMLString.test
307     @@enDesc:
308     Since there is at least one implementation of the feature (i.e.
309     this class), the <M::gls|GLSImplementation.createGLSParser>
310     must not throw an exception.
311     @@PerlDef:
312     my $impl;
313     __CODE{DOMLS|createImplForTest:: $impl => $impl}__;
314    
315     my $p = $impl-><M::gls|GLSImplementation.createGLSParser>
316     ({<Q::fe|ParseXMLString> => '1.0'});
317    
318     $test->assert_not_null ($p);
319     @Test:
320     @@QName: GLSImpl.createGLSParser.LS.ParseXMLString.test
321     @@enDesc:
322     Since there is at least one implementation of the feature (i.e.
323     this class), the <M::gls|GLSImplementation.createGLSParser>
324     must not throw an exception.
325     @@PerlDef:
326     my $impl;
327     __CODE{DOMLS|createImplForTest:: $impl => $impl}__;
328    
329     my $p = $impl-><M::gls|GLSImplementation.createGLSParser>
330     ({LS => '3.0', <Q::fe|ParseXMLString> => '1.0'});
331    
332     $test->assert_isa ($p, <IFName::LSParser>);
333    
334     @Test:
335     @@QName: DOMImplLS.createLSParser.1.test
336     @@enDesc:
337     Since there is at least one implementation of the feature (i.e.
338     this class), the <M::gls|GLSImplementation.createGLSParser>
339     must not throw an exception.
340     @@PerlDef:
341     my $impl;
342     __CODE{DOMLS|createImplForTest:: $impl => $impl}__;
343    
344     my $p = $impl-><M::DOMLS|DOMImplementationLS.createLSParser>
345     (<C::DOMLS|DOMImplementationLS.MODE_SYNCHRONOUS>);
346     $test->assert_isa ($p, <IFName::LSParser>);
347     @enImplNote:
348     @@ddid: lsparsertext
349     @@@:
350     Future version should add test:
351     @@QName: DOMImplLS.createLSParser.2.test
352     @@enDesc:
353     Since there is at least one implementation of the feature (i.e.
354     this class), the <M::gls|GLSImplementation.createGLSParser>
355     must not throw an exception.
356     @@PerlDef:
357     my $impl;
358     __CODE{DOMLS|createImplForTest:: $impl => $impl}__;
359    
360     my $p = $impl-><M::DOMLS|DOMImplementationLS.createLSParser>
361     (<C::DOMLS|DOMImplementationLS.MODE_SYNCHRONOUS>,
362     <Q::xml-dtd:>);
363     $test->assert_isa ($p, <IFName::LSParser>);
364 wakaba 1.3
365 wakaba 1.27 @Test:
366     @@QName: Perl.open.utf8.strref.1.test
367     @@enDesc:
368     Does PerlIO works as intended?
369     @@PerlDef:
370     my $s = qq<\x{3001}\x0A\x{10001}>;
371     #open my $a, '<'.':utf8', \$s;
372     require IO::String;
373     my $a = IO::String->new ($s);
374     $test->assert_num_equals
375     (actual_value => ord getc $a,
376     expected_value => 0x3001);
377     $test->assert_num_equals
378     (actual_value => ord getc $a,
379     expected_value => 0x000A);
380     $test->assert_num_equals
381     (actual_value => ord getc $a,
382     expected_value => 0x10001);
383     $a->ungetc (0x10001);
384     $test->assert_num_equals
385     (actual_value => ord getc $a,
386     expected_value => 0x10001);
387     $test->assert_null (getc $a);
388     close $a;
389     @Test:
390     @@QName: Perl.open.8859.strref.2.test
391     @@enDesc:
392     Does PerlIO works as intended?
393     @@PerlDef:
394     my $s = qq<\x{0080}\x0A\x{00A9}>;
395     #open my $a, '<', \$s;
396     require IO::String;
397     my $a = IO::String->new ($s);
398     $test->assert_num_equals
399     (actual_value => ord getc $a,
400     expected_value => 0x0080);
401     $test->assert_num_equals
402     (actual_value => ord getc $a,
403     expected_value => 0x000A);
404     $test->assert_num_equals
405     (actual_value => ord getc $a,
406     expected_value => 0x00A9);
407     $a->ungetc (0x00A9);
408     $test->assert_num_equals
409     (actual_value => ord getc $a,
410     expected_value => 0x00A9);
411     $test->assert_null (getc $a);
412     close $a;
413    
414 wakaba 1.1 @Attr:
415     @@Name: domConfig
416     @@enDesc:
417     The configuration of the parser.
418    
419     @@Get:
420     @@@Type: DOMCore|DOMConfiguration
421     @@@enDesc: The DOM configuration object.
422     @@@PerlDef:
423     __CODE{DOMCore|getConfigObject::
424     $target => $self,
425     $targetHash => $self,
426 wakaba 1.27 $targetType => {<ClassName::xp|ManakaiXMLParser>},
427 wakaba 1.1 $result => $r,
428     }__;
429    
430 wakaba 1.27 @Attr:
431     @@ForCheck: ManakaiDOM|ForClass
432     @@Name: async
433     @@enDesc:
434     Whether the parser is asynchronous or not.
435     @@Type: idl|boolean||ManakaiDOM|all
436     @@Get:
437     @@@FalseCase:
438     @@@@enDesc:
439     The parser does not in asynchronous mode.
440     @@@PerlDef: \
441     @@Test:
442     @@@QName: XMLParser.async.test
443     @@@PerlDef:
444     my $xp;
445     __CODE{createParserForTest:: $xp => $xp}__;
446    
447     $test->assert_false ($xp-><AG::DOMLS|LSParser.async>);
448    
449     @Attr:
450     @@ForCheck: ManakaiDOM|ForClass
451     @@Name: busy
452     @@enDesc:
453     Whether the parser is currently busy loading a document or not.
454     @@Type: idl|boolean||ManakaiDOM|all
455     @@Get:
456     @@@TrueCase:
457     @@@@enDesc:
458     The parser is currently busy.
459     @@@FalseCase:
460     @@@@enDesc:
461     The parser is not busy.
462     @@@PerlDef:
463     $r = $self->{<H::DOMLS|busy>};
464    
465     @enImplNote:
466     @@ddid: abort
467     @@@:
468     {ISSUE::
469     LSParser.abort:
470    
471     Is it required to support even in synchronous mode?
472     }
473    
474     {TODO::
475     LSParser.filter
476     }
477    
478     @ResourceDef:
479     @@QName: createParserForTest
480     @@ForCheck: ManakaiDOM|ForClass
481     @@rdf:type: DISPerl|BlockCode
482     @@PerlDef:
483     require Message::DOM::GenericLS;
484     $xp = <Class::ManakaiXMLParser>
485 wakaba 1.40 ->new (<Class::c|ManakaiDOMImplementation>->_new, '');
486 wakaba 1.27
487 wakaba 1.1 @Method:
488     @@ManakaiDOM:isForInternal:1
489     @@ForCheck: ManakaiDOM|ForClass
490     @@Operator: DISPerl|NewMethod
491     @@enDesc:
492     Creates a new instance of the object.
493     @@Param:
494     @@@Name: impl
495 wakaba 1.11 @@@Type: gls|GLSImplementation
496 wakaba 1.1 @@@enDesc:
497     The implementation from which the parser is created.
498     @@Param:
499     @@@Name: features
500     @@@Type: DOMString
501     @@@dis:actualType: f|FeaturesString
502     @@@enDesc:
503     The set of features requested for the parser.
504     @@Return:
505     @@@Type: DOMMain|DOMObject
506     @@@dis:actualType: LSParser
507     @@@enDesc:
508     The newly created parser.
509     @@@PerlDef:
510     $r = bless {
511 wakaba 1.35 <H::f|implementation> => $impl,
512 wakaba 1.1 }, $self;
513    
514     @Method:
515 wakaba 1.27 @@Name: parseURI
516     @@enDesc:
517     Parses an XML document identified by a DOM URI.
518 wakaba 1.1
519 wakaba 1.27 It is equivalent to <M::.parse> method with its <P::input>
520     parameter set to a <IF::LSInput> object whose
521     <A::LSInput.systemId> set to <P::uri>.
522 wakaba 1.1 @@Param:
523 wakaba 1.27 @@@Name: uri
524 wakaba 1.1 @@@Type: DOMString
525 wakaba 1.27 @@@enDesc:
526     The DOM URI of the XML document to be read.
527 wakaba 1.1 @@Return:
528     @@@Type: Document
529 wakaba 1.27 @@@enDesc:
530     The newly created and populated <IF::Document> node.
531     @@@dx:raises:
532     @@@@@: ManakaiDOMLS|MDOMLS_BUSY
533     @@@@enDesc:
534     If <A::LSParser.busy> is <DOM::true>.
535     @@@dx:raises:
536     @@@@@: DOMLS|PARSE_ERR
537     @@@@enDesc:
538     If the <IF::LSParser> was unable to load the document.
539     @@@PerlDef:
540     __DEEP{
541     $r = $self-><M::LSParser.parse> ({system_id => $uri});
542     }__;
543    
544     @Method:
545     @@Name: parse
546     @@enDesc:
547     Parses an XML document from a resource identified
548     by a <IF::LSInput>.
549     @@Param:
550     @@@Name: input
551     @@@Type: LSInput
552     @@@enDesc:
553     The <IF::LSInput> from which the source of the document
554     is to be read.
555     @@Return:
556     @@@Type: Document
557     @@@enDesc:
558     The newly created and populated <IF::Document> node.
559     @@@dx:raises:
560     @@@@@: ManakaiDOMLS|MDOMLS_BUSY
561     @@@@enDesc:
562     If the <A::LSParser.busy> is <DOM::true>.
563     @@@dx:raises:
564     @@@@@: DOMLS|PARSE_ERR
565     @@@@enDesc:
566     If the <IF::LSParser> was unable to load the document.
567 wakaba 1.1 @@@PerlDef:
568 wakaba 1.27 if ($self->{<H::DOMLS|busy>}) {
569     __EXCEPTION{ManakaiDOMLS|MDOMLS_BUSY}__;
570     }
571     local $self->{<H::DOMLS|busy>} = true;
572    
573     my $in;
574     __DEEP{
575     $self->{parser_cfg} = $self-><AG::LSParser.domConfig>;
576     ## Parser's |domConfig| object.
577     $self->{in_in} = $self->{parser_cfg}
578     -><M::c|DOMConfiguration.getParameter>
579     (<Q::xp|ls-input-to-input-file>);
580     $in = $self->{in_in}-><M::ManakaiDOMLSInputToInputFile.resolveLSInput>
581 wakaba 1.37 ($self->{<H::f|implementation>}, $input,
582     $self,
583 wakaba 1.27 $self->{parser_cfg}
584     -><M::c|DOMConfiguration.getParameter>
585     ('error-handler'));
586     }__;
587     unless (defined $in) {
588     __c|ERROR{DOMLS|no-input-specified::
589     MDOMX:param-name => 'input',
590     }__;
591     __CODE{ParseError}__;
592     }
593    
594     require IO::Handle;
595 wakaba 1.1
596     $self->{char} = [];
597     $self->{token} = [];
598 wakaba 1.6 $self->{entity} = [{
599 wakaba 1.27 fh => $in-><AG::ManakaiDOMInputFile.filehandle>,
600     base_uri => $in-><AG::ManakaiDOMInputFile.baseURI>,
601     doc_uri => $in-><AG::ManakaiDOMInputFile.documentURI>,
602 wakaba 1.37 in_enc => $in-><AG::ManakaiDOMInputFile.inputEncoding>,
603 wakaba 1.6 line => 1,
604     column => 1,
605     pos => 0,
606 wakaba 1.27 close_file => sub { $in-><M::ManakaiDOMInputFile.close> },
607     reptxt => \'',
608     is_external_entity => true,
609 wakaba 1.6 }];
610 wakaba 1.27 ## Entity stack.
611 wakaba 1.14 $self->{location} = $self->{entity}->[-1];
612 wakaba 1.27 ## Parsing location object as required by DPG.
613     ## It must always be equal to |{entity}->[-1]|.
614 wakaba 1.6 $self->{entity_char} = [];
615 wakaba 1.27 ## Stack for |{char}| stacks analog to |{entity}| stack.
616 wakaba 1.6 $self->{entity_token} = [];
617 wakaba 1.27 ## Stack for |{token}| stacks analog to |{entity}| stack.
618 wakaba 1.3 $self->{xml_version} = '1.0';
619 wakaba 1.27 ## Document XML version: either |1.0| or |1.1|.
620 wakaba 1.3 $self->{standalone} = false;
621 wakaba 1.27 ## True iff |standalone=yes| is explicitly specified.
622 wakaba 1.19 $self->{has_xref} = false;
623 wakaba 1.27 ## There is an unread external entity.
624     $self->{dont_process} = false;
625     ## So, don't process |ENTITY| and |ATTLIST| declarations.
626 wakaba 1.11 $self->{general_entity} = {
627     lt => {is_predefined => true},
628     gt => {is_predefined => true},
629     amp => {is_predefined => true},
630     quot => {is_predefined => true},
631     apos => {is_predefined => true},
632     };
633 wakaba 1.27 ## Declared general entities.
634 wakaba 1.6 $self->{param_entity} = {};
635 wakaba 1.27 ## Declared parameter entities.
636 wakaba 1.9 $self->{attr} = {};
637     # $self->{attr}->{$element_type_name}->{$attr_name} = $attr_def
638 wakaba 1.27 ## Declared attributes.
639 wakaba 1.1
640     __DEEP{
641 wakaba 1.35 $r = $self->{<H::f|implementation>}-><M::DOMImpl.createDocument>;
642 wakaba 1.11 $self->{doc} = $r;
643 wakaba 1.27 ## |Document| object.
644     CORE::delete $self->{docx};
645     ## |DocumentXDoctype| object (if necessary).
646 wakaba 1.21 $self->{doc_cfg} = $r-><AG::Document.domConfig>;
647 wakaba 1.27 ## |Document|'s configuration.
648 wakaba 1.11 CORE::delete $self->{dtdef};
649 wakaba 1.27 ## |DocumentTypeDefinition| object (if created).
650 wakaba 1.17 CORE::delete $self->{dtdecl};
651 wakaba 1.27 ## |DocumentTypeDeclaration| object (if created).
652 wakaba 1.21
653     $r-><AS::Document.strictErrorChecking> (false);
654     ## NOTE: Any checks such as |Name| validity done by
655     ## methods on DOM nodes are disabled. It might result
656     ## in creating an ill-formed DOM tree when parser
657     ## errors are traped by |error-handler|.
658     $self->{doc_cfg}-><M::c|DOMConfiguration.setParameter>
659     (<Q::cfg|clone-entity-reference-subtree> => true);
660     ## NOTE: Turn this configuration parameter on makes
661     ## entity reference subtrees in attribute default values
662     ## cloned as is into default attribute node subtrees.
663 wakaba 1.26 $self->{doc_cfg}-><M::c|DOMConfiguration.setParameter>
664 wakaba 1.36 (<Q::cfg|dtd-default-attribute> => false);
665 wakaba 1.26 ## NOTE: Don't create DTD default attributes by
666     ## |createElementNS| method.
667     $self->{doc_cfg}-><M::c|DOMConfiguration.setParameter>
668 wakaba 1.30 (<Q::cfg|xml-id> => $self->{parser_cfg}
669     -><M::c|DOMConfiguration.getParameter>
670     (<Q::cfg|xml-id>));
671     $self->{doc_cfg}-><M::c|DOMConfiguration.setParameter>
672 wakaba 1.26 ('error-handler' => sub {
673     my (undef, $err) = @_;
674     return ($err-><AG::c|DOMError.severity> !=
675     <C::c|DOMError.SEVERITY_FATAL_ERROR>);
676     })
677     unless $Message::DOM::XMLParser::DEBUG;
678 wakaba 1.29 ## NOTE: The default error handler in manakai |warn|s error
679 wakaba 1.26 ## description.
680 wakaba 1.11
681 wakaba 1.29 ## Document entity's URI and base URI
682     $r-><AS::Document.documentURI> ($self->{entity}->[0]->{doc_uri});
683     $r-><AS::Document.manakaiEntityBaseURI>
684     ($self->{entity}->[0]->{base_uri});
685    
686 wakaba 1.37 ## Encoding name
687     $r-><AS::Document.inputEncoding> ($self->{entity}->[0]->{in_enc});
688    
689 wakaba 1.11 ## Document entity -> |Document| node
690     $self->_parse_DocumentEntity;
691    
692 wakaba 1.27 for (@{$self->{entity}}) {
693     $_->{close_file}->();
694     ## NOTE: There should be only the document entity.
695     }
696    
697 wakaba 1.11 ## Replacement tree for general |Entity| nodes
698 wakaba 1.34 if ($self->{parser_cfg}-><M::c|DOMConfiguration.getParameter>
699     (<Q::cfg|entity-replacement-tree>)) {
700     my @ent = values %{$self->{general_entity}};
701     for my $ent (@ent) {
702     if (exists $ent->{has_replacement_text}) {
703 wakaba 1.11 my $ent_name = $ent->{name};
704     $self->{entity} = [<Code::getCopyOfEntityState::
705     $entity_type = 'general_entity',
706     $entity_name = $ent_name>];
707 wakaba 1.14 $self->{location} = $self->{entity}->[-1];
708 wakaba 1.11 $self->{token} = [];
709     $self->{char} = [];
710 wakaba 1.23 local $ent->{is_opened} = true;
711 wakaba 1.11 ## TODO: External entity support
712 wakaba 1.35 $ent->{node}-><M::Node.manakaiSetReadOnly> (false, true);
713 wakaba 1.11 $self->_parse_InternalGeneralParsedEntity ($ent->{node});
714 wakaba 1.35 $ent->{node}-><AS::GE.hasReplacementTree> (true);
715     $ent->{node}-><M::Node.manakaiSetReadOnly> (true, true);
716 wakaba 1.27 $self->{entity}->[-1]->{close_file}->();
717 wakaba 1.35 ## ISSUE: Should errors detected by this phase result
718     ## in |DOMLS:PARSE_ERR| exception thrown?
719     }
720 wakaba 1.34 }
721     } # cfg|entity-replacement-tree
722 wakaba 1.11
723 wakaba 1.21 ## Turns flags to their default value
724     $self->{doc_cfg}-><M::c|DOMConfiguration.setParameter>
725     (<Q::cfg|clone-entity-reference-subtree> => null);
726 wakaba 1.26 $self->{doc_cfg}-><M::c|DOMConfiguration.setParameter>
727 wakaba 1.36 (<Q::cfg|dtd-default-attribute> => null);
728 wakaba 1.26 $self->{doc_cfg}-><M::c|DOMConfiguration.setParameter>
729 wakaba 1.30 (<Q::cfg|xml-id> => null);
730     $self->{doc_cfg}-><M::c|DOMConfiguration.setParameter>
731 wakaba 1.26 ('error-handler' => null);
732 wakaba 1.11 $r-><AS::Document.strictErrorChecking> (true);
733 wakaba 1.1 }__;
734    
735     @Method:
736     @@Name: shiftChar
737     @@ManakaiDOM:isForInternal:1
738     @@ForCheck: ManakaiDOM|ForClass
739     @@enDesc:
740     Returns the next character.
741     @@Return:
742     @@@Type: idl|long||ManakaiDOM|all
743     @@@enDesc:
744     The code position number of the next character, if any,
745 wakaba 1.6 or <CODE::-1>.
746 wakaba 1.1 @@@PerlDef:
747     if (@{$self->{char}}) {
748     $r = shift @{$self->{char}};
749     } else {
750 wakaba 1.6 GETCHAR: {
751 wakaba 1.27 no warnings 'closed'; # getc() on closed filehandle warning
752     my $ent = $self->{entity}->[-1];
753 wakaba 1.32 my $char = $ent->{fh}->getc;
754 wakaba 1.6
755 wakaba 1.7 if (defined $char and length $char) {
756 wakaba 1.27 $ent->{pos}++;
757 wakaba 1.6 $r = ord $char;
758     if ($r == 0x000A) {
759 wakaba 1.27 $ent->{line}++;
760     $ent->{column} = 1;
761 wakaba 1.6 } elsif ($r == 0x000D) {
762 wakaba 1.32 my $next_char = $ent->{fh}->getc;
763 wakaba 1.6 if ($next_char eq "\x0A") {
764 wakaba 1.27 if ($ent->{is_external_entity}) {
765     $ent->{pos}++;
766     $ent->{line}++;
767     $ent->{column} = 1;
768     $r = 0x000A; # ^ U+000D U+000A -> U+000A ^
769     } else { # Internal entity
770     $ent->{column}++;
771     ## Line number will be increased by next |shiftChar|.
772     $ent->{fh}->ungetc (0x000A);
773     #$r = 0x000D; # ^ U+000D U+000A -> U+000D ^ U+000A
774     # no change
775     }
776 wakaba 1.6 } elsif ($next_char eq "\x85") {
777     if ($self->{xml_version} eq '1.1') {
778 wakaba 1.27 if ($ent->{is_external_entity}) {
779     if ($ent->{no_xml11_eol}) {
780     my $location = {
781     utf32_offset => $ent->{pos} - 1,
782     line_number => $ent->{line},
783     column_number => $ent->{column},
784     };
785     my $continue = __c|ERROR{
786     xp|fatal-xml11-end-of-line-in-xml-declaration::
787     c|location => {$location},
788     xp|character-number => {$r},
789     }__;
790     unless ($continue) {
791     __CODE{ParseError}__;
792     }
793     } # no_xml11_eol
794     $ent->{pos}++;
795     $ent->{line}++;
796     $ent->{column} = 1;
797     $r = 0x000A; # ^ U+000D U+0085 -> U+000A ^
798     } else { # internal entity
799     $ent->{column}++;
800     ## Line number will be increased by next |shiftChar|.
801     $ent->{fh}->ungetc (0x0085);
802     #$r = 0x000D; # ^ U+000D U+0085 -> U+000D ^ U+0085
803     # no change
804     }
805     } else { # XML 1.0
806 wakaba 1.16 ## |no_xml11_eol| will be tested later.
807 wakaba 1.27 $ent->{column}++;
808     ## Line number will be increased by next |shiftChar|.
809     $ent->{fh}->ungetc (0x0085);
810     $r = 0x000A if $ent->{is_external_entity};
811     # external: ^ U+000D U+0085 -> U+000A ^ U+0085
812     # internal: ^ U+000D U+0085 -> U+000D ^ U+0085 (as is)
813 wakaba 1.6 }
814 wakaba 1.27 } else { # neither U+000A nor U+0085
815     $ent->{line}++;
816     $ent->{column} = 1;
817     $ent->{fh}->ungetc (ord $next_char);
818     $r = 0x000A if $ent->{is_external_entity};
819     # external: ^ U+000D _ -> U+000A ^ _
820     # internal: ^ U+000D _ -> U+000D ^ _ (as is)
821 wakaba 1.6 }
822 wakaba 1.27 } elsif ($r == 0x0085 or $r == 0x2028) {
823     if ($ent->{no_xml11_eol}) {
824     my $location = {
825     utf32_offset => $ent->{pos} - 1,
826     line_number => $ent->{line},
827     column_number => $ent->{column},
828     };
829     my $continue = __c|ERROR{
830     xp|fatal-xml11-end-of-line-in-xml-declaration::
831     c|location => {$location},
832     xp|character-number => {$r},
833     }__;
834     unless ($continue) {
835     __CODE{ParseError}__;
836     }
837     } # no_xml11_eol
838     $r = 0x000A if $self->{xml_version} eq '1.1' and
839     $ent->{is_external_entity};
840     ## Even in XML 1.0 it increases the line number.
841     $ent->{line}++;
842     $ent->{column} = 1;
843 wakaba 1.6 } elsif (
844     not ((0x0020 <= $r and $r <= 0x007E) or
845     (0x00A0 <= $r and $r <= 0xD7FF) or
846     (0xE000 <= $r and $r <= 0xFFFD) or
847     (0x10000 <= $r and $r <= 0x10FFFF)) and
848 wakaba 1.27 $r != 0x0009 and
849     not (($self->{xml_version} eq '1.0' or
850     not $ent->{is_external_entity}) and
851     (0x007F <= $r and $r <= 0x009F)) and
852     not ($self->{xml_version} eq '1.1' and
853     not $ent->{is_external_entity} and
854     0x0001 <= $r and $r <= 0x001F)
855 wakaba 1.6 ) {
856     my $location = {
857 wakaba 1.27 utf32_offset => $ent->{pos} - 1,
858     line_number => $ent->{line},
859     column_number => $ent->{column},
860 wakaba 1.6 };
861 wakaba 1.27 my $continue = __c|ERROR{xp|wf-legal-literal-character::
862     c|location => {$location},
863 wakaba 1.6 xp|character-number => {$r},
864     }__;
865     unless ($continue) {
866 wakaba 1.27 __CODE{ParseError}__;
867 wakaba 1.3 }
868 wakaba 1.27 $ent->{column}++;
869     } else { # XML |Char|
870     $ent->{column}++;
871 wakaba 1.3 }
872     } else {
873 wakaba 1.6 $r = -1;
874 wakaba 1.3 }
875 wakaba 1.6 } # GETCHAR
876 wakaba 1.1 }
877    
878     @Method:
879     @@ManakaiDOM:isForInternal: 1
880     @@Operator: ManakaiDOM|MUErrorHandler
881     @@enDesc:
882     When a <IF::ecore|ErrorInterface||ManakaiDOM|Perl> is <Perl::report>ed,
883     then this method is invoked.
884    
885     The method calls the <cfg::DOMCore|error-handler> if the error is of
886     <IF::DOMCore|DOMError>. Otherwise, the error is re-thrown so that
887     corresponding <Perl::catch> clause, if any, can catch the error.
888     @@Param:
889     @@@Name: err
890     @@@Type: ecore|ErrorInterface||ManakaiDOM|Perl
891     @@@enDesc:
892     The reported error object.
893     @@Return:
894     @@@Type: DISPerl|Any
895     @@@enDesc:
896     If the <P::err> is a <IF::DOMCore|DOMError>, then the return value
897     of the error handler.
898    
899     {NOTE:: If the error is thrown, the method never returns.
900     }
901     @@@nullCase:
902     @@@@enDesc:
903     No error handler.
904     @@@PerlDef:
905     if ($err->isa (<IFName::DOMCore|DOMError||ManakaiDOM|ManakaiDOM>)) {
906     __DEEP{
907     A: {
908     my $cfg = $self-><AG::LSParser.domConfig>;
909     my $h = $cfg-><M::DOMCore|DOMConfiguration.getParameter>
910     ('error-handler');
911     $r = $h-><M::DOMCore|DOMErrorHandler.handleError> ($err);
912     } # A
913     }__;
914     } else {
915     $err-><M::ecore|ErrorInterface||ManakaiDOM|Perl.throw>;
916     }
917    
918     @DISPerl:dpgDef:
919    
920     /*
921     XML Document Entity
922    
923     document := prolog element *Misc
924     - *Char RestrictedChar *Char ;; [1]
925     */
926 wakaba 1.11 rule DocumentEntity : standalone {
927 wakaba 1.1 /*
928     prolog := XMLDecl? *Misc [doctypedecl *Misc] ;; [22]
929     */
930 wakaba 1.16 ?lexmode DocumentStart;
931 wakaba 1.11
932     my $doc;
933     lang:Perl {
934     $doc = $self->{doc};
935     }
936 wakaba 1.1
937 wakaba 1.3 ~? (XDO) {
938 wakaba 1.16 ?lexmode XMLDeclarationOrPI;
939     lang:Perl {
940     $self->{entity}->[-1]->{no_xml11_eol} = true;
941     }
942     ~ (S) { // XML declaration
943     &_XMLDeclaration_ ($doc => $doc);
944     ~ (PIC2) {
945     ?lexmode DocumentProlog;
946     } else {
947     ?lexmode DocumentProlog;
948     }
949     } (NameChar) { // Processing instruction whose target begins with |xml|
950     my $target_token;
951     lang:Perl ($v => $token.value) {
952     $target_token = $token;
953     $target_token->{value} = 'xml'.$target_token->{value};
954     $self->{entity}->[-1]->{no_xml11_eol} = false;
955     }
956     ?lexmode PINmtoken;
957     ~? (Nmtoken) {
958     lang:Perl ($v => $token.value) {
959     $target_token->{value} .= $v;
960     }
961     ?lexmode PIName;
962     }
963     lang:Perl {
964     $target_token->{type} = 'Name';
965     $target_token->{location_d} += 3; # 'xml'
966     unshift @{$self->{token}}, $token;
967     $token = $target_token;
968     }
969     &_ProcessingInstruction_ ($doc => $doc, $parent => $doc);
970     ~ (PIC) {
971     ?lexmode DocumentProlog;
972     } else {
973     ?lexmode DocumentProlog;
974     }
975 wakaba 1.3 } else {
976 wakaba 1.16 lang:Perl {
977     $self->{entity}->[-1]->{no_xml11_eol} = false;
978     }
979 wakaba 1.3 }
980     } else {
981     ?lexmode 'DocumentProlog';
982     }
983 wakaba 1.1
984     // *Misc
985 wakaba 1.2 ~* (CDO) {
986 wakaba 1.1 &_CommentDeclaration_ ($doc => $doc, $parent => $doc);
987    
988     ~ (MDC) {
989     ?lexmode DocumentProlog;
990     } else {
991     ?lexmode DocumentProlog;
992     }
993     } (PIO) {
994     &_ProcessingInstruction_ ($doc => $doc, $parent => $doc);
995    
996     ~ (PIC) {
997     ?lexmode 'DocumentProlog';
998     } else {
999     ?lexmode DocumentProlog;
1000     }
1001     } (S) {
1002     //
1003     }
1004    
1005     // doctypedecl
1006     ~? (MDO) {
1007     &_DocumentTypeDeclaration_ ($doc => $doc);
1008    
1009 wakaba 1.3 ~ (MDC) {
1010     ?lexmode DocumentMisc;
1011     } else {
1012     ?lexmode DocumentMisc;
1013     }
1014     } else {
1015     ?lexmode DocumentMisc;
1016 wakaba 1.1 }
1017 wakaba 1.25
1018     lang:Perl {
1019     $self->{doc}-><AS::Document.allDeclarationsProcessed> (true)
1020     unless $self->{dont_process};
1021     }
1022 wakaba 1.1
1023     // *Misc
1024 wakaba 1.2 ~* (CDO) {
1025 wakaba 1.1 &_CommentDeclaration_ ($doc => $doc, $parent => $doc);
1026    
1027     ~ (MDC) {
1028     ?lexmode DocumentMisc;
1029     } else {
1030     ?lexmode DocumentMisc;
1031     }
1032     } (PIO) {
1033     &_ProcessingInstruction_ ($doc => $doc, $parent => $doc);
1034    
1035     ~ (PIC) {
1036     ?lexmode 'DocumentMisc';
1037     } else {
1038     ?lexmode DocumentMisc;
1039     }
1040     } (S) {
1041     //
1042     }
1043    
1044     // Document element
1045     ~ (STAGO) {
1046     &Element_ ($doc => $doc, $parent => $doc)
1047     : unshift-current-token;
1048     ~ (TAGC) {
1049     ?lexmode DocumentEnd;
1050     } else {
1051     ?lexmode DocumentEnd;
1052     }
1053     } else {
1054     ?lexmode 'DocumentEnd';
1055     }
1056    
1057     // *Misc
1058 wakaba 1.2 ~* (CDO) {
1059 wakaba 1.1 &_CommentDeclaration_ ($doc => $doc, $parent => $doc);
1060    
1061     ~ (MDC) {
1062     ?lexmode DocumentEnd;
1063     } else {
1064     ?lexmode DocumentEnd;
1065     }
1066     } (PIO) {
1067     &_ProcessingInstruction_ ($doc => $doc, $parent => $doc);
1068     ~ (PIC) {
1069     ?lexmode 'DocumentEnd';
1070     } else {
1071     ?lexmode DocumentEnd;
1072     }
1073     } (S) {
1074     //
1075     }
1076    
1077     ~ (#EOF) { }
1078     } // DocumentEntity
1079 wakaba 1.11
1080     /*
1081     Internal General Parsed Entity
1082    
1083     An internal general parsed entity is well-formed if its
1084     replacement text matches the production labeled |content|.
1085     */
1086     rule InternalGeneralParsedEntity ($ent) : standalone {
1087     ?lexmode ElementContent;
1088    
1089     my $ns;
1090     lang:Perl {
1091     $ns = {
1092     xml => <Q::xml:>,
1093     xmlns => <Q::xmlns:>,
1094     };
1095     }
1096    
1097     &content ($parent => $ent, $ns => $ns);
1098    
1099     ~ (#EOF) { }
1100     } // InternalGeneralParsedEntity
1101    
1102 wakaba 1.1 /*
1103     XML Declaration
1104    
1105     XMLDecl := '<?xml' VersionInfo
1106     [EncodingDecl]
1107     [SDDecl]
1108     [S] '?>' ;; [23]
1109    
1110     NOTE: XML declaration is optional in XML 1.0
1111     while it is required in XML 1.1.
1112     */
1113 wakaba 1.16 rule _XMLDeclaration_ {
1114     // ~ (XDO) { }
1115 wakaba 1.3 ?lexmode XMLDeclaration;
1116 wakaba 1.16 //lang:Perl {
1117     // $self->{entity}->[-1]->{no_xml11_eol} = true;
1118     //}
1119     //~ (S) { }
1120 wakaba 1.3
1121     ~ (Name == 'version') {
1122     ~? (S) { }
1123     ~ (VI) { }
1124     ~? (S) { }
1125 wakaba 1.1
1126 wakaba 1.3 my $ver;
1127     my $bad_token;
1128    
1129     ~ (LIT) {
1130     ?lexmode AttributeValueLiteral;
1131    
1132     ~ (STRING) {
1133     lang:Perl ($version => $token.value) {
1134     $ver = $version;
1135     $bad_token = $token;
1136     }
1137     }
1138    
1139     ~ (LIT) {
1140     ?lexmode XMLDeclaration;
1141     }
1142     } (LITA) {
1143     ?lexmode AttributeValueLiteralA;
1144    
1145     ~ (STRING) {
1146     lang:Perl ($version => $token.value) {
1147     $ver = $version;
1148     $bad_token = $token;
1149     }
1150     }
1151    
1152     ~ (LITA) {
1153     ?lexmode XMLDeclaration;
1154     }
1155     }
1156    
1157     lang:Perl : has-error {
1158     unless ($ver eq '1.0' or $ver eq '1.1') {
1159     my $location;
1160     __CODE{xp|get-location-from-token::
1161     $token => {$bad_token},
1162     $result => {$location},
1163     }__;
1164     my $continue = __DOMCore:ERROR{xp|wf-unsupported-xml-version::
1165     DOMCore|location => {$location},
1166 wakaba 1.16 xp|parent => {$self->{doc}},
1167 wakaba 1.3 infoset|version => {$ver},
1168     xp|error-token => {$bad_token},
1169     }__;
1170     unless ($continue) {
1171 wakaba 1.27 __CODE{ParseError}__;
1172 wakaba 1.3 }
1173     }
1174 wakaba 1.16 $self->{doc}-><AS::Document.xmlVersion> ($ver);
1175 wakaba 1.3 $self->{xml_version} = $ver;
1176     }
1177    
1178     ~? (S) { }
1179 wakaba 1.1 }
1180    
1181 wakaba 1.3 ~? (Name == 'encoding') {
1182     ~? (S) { }
1183     ~ (VI) { }
1184     ~? (S) { }
1185    
1186     my $ver;
1187     my $bad_token;
1188    
1189     ~ (LIT) {
1190     ?lexmode AttributeValueLiteral;
1191    
1192     ~ (STRING) {
1193     lang:Perl ($version => $token.value) {
1194     $ver = $version;
1195     $bad_token = $token;
1196     }
1197     }
1198    
1199     ~ (LIT) {
1200     ?lexmode XMLDeclaration;
1201     }
1202     } (LITA) {
1203     ?lexmode AttributeValueLiteralA;
1204    
1205     ~ (STRING) {
1206     lang:Perl ($version => $token.value) {
1207     $ver = $version;
1208     $bad_token = $token;
1209     }
1210     }
1211    
1212     ~ (LITA) {
1213     ?lexmode XMLDeclaration;
1214     }
1215     }
1216    
1217     lang:Perl : has-error {
1218     unless ($ver =~ /\A[A-Za-z][A-Za-z0-9._-]*\z/) {
1219     my $location;
1220     __CODE{xp|get-location-from-token::
1221     $token => {$bad_token},
1222     $result => {$location},
1223     }__;
1224     my $continue = __DOMCore:ERROR{xp|wf-malformed-enc-name::
1225     DOMCore|location => {$location},
1226 wakaba 1.16 xp|parent => {$self->{doc}},
1227 wakaba 1.3 xp|name => {$ver},
1228     xp|error-token => {$bad_token},
1229     }__;
1230     unless ($continue) {
1231 wakaba 1.27 __CODE{ParseError}__;
1232 wakaba 1.3 }
1233     }
1234 wakaba 1.16 $self->{doc}-><AS::Document.xmlEncoding> ($ver);
1235 wakaba 1.3 }
1236    
1237     ~? (S) { }
1238 wakaba 1.1 }
1239 wakaba 1.3
1240     ~? (Name == 'standalone') {
1241     ~? (S) { }
1242     ~ (VI) { }
1243     ~? (S) { }
1244    
1245     my $ver;
1246     my $bad_token;
1247    
1248     ~ (LIT) {
1249     ?lexmode AttributeValueLiteral;
1250    
1251     ~ (STRING) {
1252     lang:Perl ($version => $token.value) {
1253     $ver = $version;
1254     $bad_token = $token;
1255     }
1256     }
1257    
1258     ~ (LIT) {
1259     ?lexmode XMLDeclaration;
1260     }
1261     } (LITA) {
1262     ?lexmode AttributeValueLiteralA;
1263    
1264     ~ (STRING) {
1265     lang:Perl ($version => $token.value) {
1266     $ver = $version;
1267     $bad_token = $token;
1268     }
1269     }
1270 wakaba 1.1
1271 wakaba 1.3 ~ (LITA) {
1272     ?lexmode XMLDeclaration;
1273     }
1274     }
1275    
1276     lang:Perl : has-error {
1277     unless ($ver eq 'yes' or $ver eq 'no') {
1278     my $location;
1279     __CODE{xp|get-location-from-token::
1280     $token => {$bad_token},
1281     $result => {$location},
1282     }__;
1283     my $continue = __DOMCore:ERROR{xp|wf-malformed-xml-standalone::
1284     DOMCore|location => {$location},
1285 wakaba 1.16 xp|parent => {$self->{doc}},
1286 wakaba 1.3 xp|name => {$ver},
1287     xp|error-token => {$bad_token},
1288     }__;
1289     unless ($continue) {
1290 wakaba 1.27 __CODE{ParseError}__;
1291 wakaba 1.3 }
1292     }
1293 wakaba 1.13 if ($ver eq 'yes') {
1294 wakaba 1.16 $self->{doc}-><AS::Document.xmlStandalone> (true);
1295 wakaba 1.13 $self->{standalone} = true;
1296     }
1297 wakaba 1.3 }
1298    
1299     ~? (S) { }
1300     }
1301    
1302 wakaba 1.16 ~ (PIC1) {
1303     lang:Perl {
1304     $self->{entity}->[-1]->{no_xml11_eol} = false;
1305     }
1306     } else {
1307     lang:Perl {
1308     $self->{entity}->[-1]->{no_xml11_eol} = false;
1309     }
1310     }
1311    
1312     // ~ (PIC2) { }
1313 wakaba 1.3 } // _XMLDeclaration_
1314 wakaba 1.1
1315     /*
1316     Comment Declaration
1317    
1318     Comment := '<!--' *(Char - '-' / '-' (Char - '-'))
1319     '-->' ;; [15]
1320 wakaba 1.4 */
1321 wakaba 1.1 rule _CommentDeclaration_ ($doc, $parent) {
1322     ?lexmode 'CommentDeclaration';
1323    
1324     ~? (STRING) {
1325     lang:Perl ($data => $token.value) {
1326     my $com = $doc-><M::Document.createComment> ($data);
1327     $parent-><M::Node.appendChild> ($com);
1328     }
1329     } else {
1330     lang:Perl {
1331     my $com = $doc-><M::Document.createComment> ('');
1332     $parent-><M::Node.appendChild> ($com);
1333     }
1334     }
1335    
1336     ~ (COM) {
1337     ?lexmode MarkupDeclaration;
1338     } else {
1339     ?lexmode MarkupDeclaration;
1340     }
1341    
1342     // ~ (MDC) { }
1343 wakaba 1.4 } // _CommentDeclaration
1344 wakaba 1.15
1345     rule _CommentDeclarationDTD {
1346     ?lexmode CommentDeclaration;
1347 wakaba 1.4
1348     ~? (STRING) {
1349     //
1350     }
1351    
1352     ~ (COM) {
1353     ?lexmode MarkupDeclaration;
1354     } else {
1355     ?lexmode MarkupDeclaration;
1356     }
1357    
1358     ~ (MDC) {
1359     ?lexmode DTD;
1360     } else {
1361     ?lexmode DTD;
1362     }
1363     } // _CommentDeclarationDTD
1364    
1365 wakaba 1.1 /*
1366     Processing Instruction
1367    
1368     PI := '<?' PITarget [S *Char - *Char '?>' *Char]
1369     '?>' ;; [16]
1370     */
1371     rule _ProcessingInstruction_ ($doc, $parent) {
1372     ?lexmode 'PIName';
1373    
1374     my $pi;
1375    
1376     ~ (Name) {
1377 wakaba 1.3 lang:Perl ($name => $token.value) : has-error {
1378 wakaba 1.1 if (lc $name eq 'xml') {
1379 wakaba 1.3 my $location;
1380     __CODE{xp|get-location-from-token::
1381     $token => {$token},
1382     $result => {$location},
1383     }__;
1384     my $continue = __DOMCore:ERROR{xp|wf-pi-target-is-xml::
1385     xp|name => {$name},
1386     DOMCore|location => {$location},
1387     xp|parent => {$parent},
1388     }__;
1389     unless ($continue) {
1390 wakaba 1.27 __CODE{ParseError}__;
1391 wakaba 1.3 }
1392 wakaba 1.1 }
1393 wakaba 1.26 __CODE{checkNCName:: $name => $name}__;
1394    
1395 wakaba 1.1 $pi = $doc-><M::Document.createProcessingInstruction>
1396     ($name);
1397     }
1398 wakaba 1.14 } else {
1399     lang:Perl {
1400     $pi = $doc-><M::Document.createProcessingInstruction> ('#INVALID');
1401     }
1402 wakaba 1.1 }
1403    
1404 wakaba 1.14 ~? (S) {
1405 wakaba 1.1 ?lexmode 'PIData';
1406    
1407     my $tdata;
1408    
1409     ~? (DATA) {
1410     lang:Perl ($data => $token.value) {
1411     $tdata = $data;
1412     }
1413     } else {
1414     lang:Perl {
1415     $tdata = '';
1416     }
1417     }
1418    
1419     lang:Perl {
1420     $pi-><AS::Node.nodeValue> ($tdata);
1421     }
1422     }
1423    
1424     lang:Perl {
1425     $parent-><M::Node.appendChild> ($pi);
1426     }
1427    
1428     // ~ (PIC) { }
1429     } // _ProcessingInstruction_
1430 wakaba 1.4
1431 wakaba 1.6 /*
1432     Processing instruction in DTD
1433     */
1434     rule _ProcessingInstructionDTD ($doc, $doctype) {
1435 wakaba 1.4 ?lexmode 'PIName';
1436 wakaba 1.6
1437     my $pi;
1438 wakaba 1.4
1439     ~ (Name) {
1440 wakaba 1.6 lang:Perl ($name => $token.value) : has-error {
1441     if (lc $name eq 'xml') {
1442     my $location;
1443     __CODE{xp|get-location-from-token::
1444     $token => {$token},
1445     $result => {$location},
1446     }__;
1447     my $continue = __DOMCore:ERROR{xp|wf-pi-target-is-xml::
1448     xp|name => {$name},
1449     DOMCore|location => {$location},
1450     xp|parent => {$doctype},
1451     }__;
1452     unless ($continue) {
1453 wakaba 1.27 __CODE{ParseError}__;
1454 wakaba 1.6 }
1455     }
1456 wakaba 1.26 __CODE{checkNCName:: $name => $name}__;
1457    
1458 wakaba 1.6 $pi = $doc-><M::Document.createProcessingInstruction>
1459     ($name);
1460 wakaba 1.35 $pi-><AS::tx|ProcessingInstruction.manakaiBaseURI>
1461 wakaba 1.29 ($self->{location}->{base_uri});
1462 wakaba 1.6 }
1463 wakaba 1.14 } else {
1464     lang:Perl {
1465     $pi = $doc-><M::Document.createProcessingInstruction> ('#INVALID');
1466     }
1467 wakaba 1.4 }
1468    
1469 wakaba 1.14 ~? (S) {
1470 wakaba 1.4 ?lexmode 'PIData';
1471    
1472 wakaba 1.6 my $tdata;
1473    
1474 wakaba 1.4 ~? (DATA) {
1475 wakaba 1.6 lang:Perl ($data => $token.value) {
1476     $tdata = $data;
1477     }
1478     } else {
1479     lang:Perl {
1480     $tdata = '';
1481     }
1482     }
1483    
1484     lang:Perl {
1485     $pi-><AS::Node.nodeValue> ($tdata);
1486 wakaba 1.4 }
1487     }
1488    
1489 wakaba 1.6 lang:Perl {
1490     $doctype-><M::Node.appendChild> ($pi);
1491     }
1492    
1493 wakaba 1.4 ~ (PIC) {
1494     ?lexmode DTD;
1495     } else {
1496     ?lexmode DTD;
1497     }
1498     } // _ProcessingInstructionDTD
1499 wakaba 1.1
1500     /*
1501     Element content parsing mode
1502    
1503     element := EmptyElemTag /
1504     STag content ETag ;; [39]
1505     content := (CharData / element / Reference / CDSect /
1506     PI / Comment) ;; [43]
1507     */
1508 wakaba 1.6 rule Element_ ($doc, $parent, $ns) : standalone {
1509 wakaba 1.1 ?lexmode 'ElementContent';
1510    
1511     my $node; // Current "parent" node
1512     my $nodes; // Node stack (w/o $current_node)
1513     my $type; // Current "parent" element type QName
1514     my $types; // Element type stack (w/o $current_type)
1515 wakaba 1.6 //my $ns; // Current in-scope namespace bindings
1516 wakaba 1.1 my $nses; // Namespace binding stack (w/o $current_ns)
1517    
1518     lang:Perl {
1519     $node = $parent;
1520     $nodes = [];
1521     $type = '';
1522     $types = [];
1523 wakaba 1.6 $ns ||= {
1524 wakaba 1.1 xml => <Q::xml:>,
1525     xmlns => <Q::xmlns:>,
1526     };
1527     $nses = [];
1528     }
1529    
1530     ~* : name => CONTENT
1531     (CharData) {
1532     // Character data
1533     lang:Perl ($data => $token.value) {
1534 wakaba 1.31 $node-><M::Node.manakaiAppendText> (\($data));
1535 wakaba 1.1 }
1536     } (STAGO) {
1537     // Start tag or empty element tag
1538    
1539     ?lexmode 'StartTag';
1540    
1541     ~ (Name) {
1542     my $attrs;
1543 wakaba 1.26 lang:Perl ($name => $token.value) : has-error {
1544     __CODE{checkQName:: $name => $name}__;
1545 wakaba 1.1 push @{$types}, $type;
1546     $type = $name;
1547     $attrs = {};
1548     }
1549    
1550     ~? (S) {
1551     &AttributeSpecificationList
1552     ($doc => $doc, $attrs => $attrs);
1553     }
1554    
1555     my $el;
1556 wakaba 1.9
1557     /*
1558     Note that this implementation does not perform
1559     attribute value tokenization (but does white space
1560     normalization common to attribute types) and
1561     construct the tree as is. DOM Level 3 Core spec
1562     is unclear on this point. With tokenization,
1563     entity references cannot be preserved.
1564    
1565     The manakai Node.nodeValue and Attr.value attributes
1566     do tokenization according to attribute types.
1567     */
1568    
1569     /*
1570     ISSUE: Should |xml:id| attribute be typed?
1571     */
1572 wakaba 1.1
1573     lang:Perl {
1574     push @{$nses}, $ns;
1575     $ns = {%$ns};
1576 wakaba 1.26
1577     ## Default attributes
1578     DA: for my $atqname (%{$self->{attr}->{$type}}) {
1579     next DA unless $self->{attr}->{$type}->{$atqname};
1580     next DA if exists $attrs->{$atqname}; # specified
1581     my $dtype = $self->{attr}->{$type}->{$atqname}
1582     -><AG::ATDef.defaultType>;
1583     next DA unless $dtype == <C::ATDef.EXPLICIT_DEFAULT> or
1584     $dtype == <C::ATDef.FIXED_DEFAULT>;
1585     $attrs->{$atqname} = {is_default => true, nodes => []};
1586     for (@{$self->{attr}->{$type}->{$atqname}
1587     -><AG::Node.childNodes>}) {
1588     push @{$attrs->{$atqname}->{nodes}},
1589     $_-><M::Node.cloneNode> (true);
1590     }
1591     }
1592 wakaba 1.1
1593     my %gattr;
1594     my %lattr;
1595     for my $atqname (keys %$attrs) {
1596     my ($pfx, $lname) = split /:/, $atqname;
1597 wakaba 1.9 $attrs->{$atqname}->{def} = $self->{attr}->{$type}->{$atqname};
1598 wakaba 1.1 if (defined $lname) { ## Global attribute
1599     if ($pfx eq 'xmlns') {
1600 wakaba 1.26 my $nsuri = $attrs->{$atqname}->{is_default}
1601     ? $attrs->{$atqname}->{def}-><AG::Node.nodeValue>
1602     : $attrs->{$atqname}->{value};
1603     if (not $attrs->{$atqname}->{is_default} and
1604     $attrs->{$atqname}->{def}) {
1605 wakaba 1.9 my $dt = $attrs->{$atqname}->{def}-><AG::ATDef.declaredType>;
1606     if ({
1607     <C::ATDef.ID_ATTR> => true,
1608     <C::ATDef.IDREF_ATTR> => true,
1609     <C::ATDef.IDREFS_ATTR> => true,
1610     <C::ATDef.ENTITY_ATTR> => true,
1611     <C::ATDef.ENTITIES_ATTR> => true,
1612     <C::ATDef.NMTOKEN_ATTR> => true,
1613     <C::ATDef.NMTOKENS_ATTR> => true,
1614     <C::ATDef.NOTATION_ATTR> => true,
1615     <C::ATDef.ENUMERATION_ATTR> => true,
1616     }->{$dt}) {
1617     ## Tokenization (XML 1 3.3.3)
1618 wakaba 1.26 for ($nsuri) {
1619 wakaba 1.9 s/^\x20+//;
1620     s/\x20+\z//;
1621     s/\x20+/ /g;
1622     }
1623     }
1624     }
1625 wakaba 1.26 if ($lname eq 'xml' and
1626     $nsuri ne <Q::xml:>) {
1627     my $location;
1628     __CODE{xp|get-location-from-token::
1629     $token => $token,
1630     $result => $location,
1631     }__;
1632     my $continue = __c|ERROR{xp|nsc-reserved-prefix-xml::
1633     c|location => {$location},
1634     xp|token => {$token},
1635     infoset|prefix => {$lname},
1636     infoset|namespaceName => {$nsuri},
1637     }__;
1638     unless ($continue) {
1639 wakaba 1.27 __CODE{ParseError}__;
1640 wakaba 1.26 }
1641     } elsif ($lname eq 'xmlns') {
1642     my $location;
1643     __CODE{xp|get-location-from-token::
1644     $token => $token,
1645     $result => $location,
1646     }__;
1647     my $continue = __c|ERROR{xp|nsc-reserved-prefix-xmlns::
1648     c|location => {$location},
1649     xp|token => {$token},
1650     infoset|prefix => {$lname},
1651     infoset|namespaceName => {$nsuri},
1652     }__;
1653     unless ($continue) {
1654 wakaba 1.27 __CODE{ParseError}__;
1655 wakaba 1.26 }
1656     }
1657     if ($nsuri eq '') {
1658     if ($self->{xml_version} eq '1.0') {
1659     my $location;
1660     __CODE{xp|get-location-from-token::
1661     $token => $token,
1662     $result => $location,
1663     }__;
1664     my $continue = __c|ERROR{xp|nswf-empty-namespace-name::
1665     c|location => {$location},
1666     xp|token => {$token},
1667     infoset|namespaceName => {$nsuri},
1668     infoset|prefix => {$lname},
1669     }__;
1670     unless ($continue) {
1671 wakaba 1.27 __CODE{ParseError}__;
1672 wakaba 1.26 }
1673     }
1674     } elsif ($nsuri eq <Q::xml:> and
1675     $lname ne 'xml') {
1676     my $location;
1677     __CODE{xp|get-location-from-token::
1678     $token => $token,
1679     $result => $location,
1680     }__;
1681     my $continue = __c|ERROR{
1682     xp|nsc-reserved-namespace-name-xml::
1683     c|location => {$location},
1684     xp|token => {$token},
1685     infoset|prefix => {$lname},
1686     infoset|namespaceName => {$nsuri},
1687     }__;
1688     unless ($continue) {
1689 wakaba 1.27 __CODE{ParseError}__;
1690 wakaba 1.26 }
1691     } elsif ($nsuri eq <Q::xmlns:>) {
1692     my $location;
1693     __CODE{xp|get-location-from-token::
1694     $token => $token,
1695     $result => $location,
1696     }__;
1697     my $continue = __c|ERROR{
1698     xp|nsc-reserved-namespace-name-xmlns::
1699     c|location => {$location},
1700     xp|token => {$token},
1701     infoset|prefix => {$lname},
1702     infoset|namespaceName => {$nsuri},
1703     }__;
1704     unless ($continue) {
1705 wakaba 1.27 __CODE{ParseError}__;
1706 wakaba 1.26 }
1707     }
1708     $ns->{$lname} = $nsuri;
1709 wakaba 1.1 delete $ns->{$lname} unless length $ns->{$lname};
1710     }
1711     $gattr{$pfx}->{$lname} = $attrs->{$atqname};
1712     } else { ## Local attribute
1713     if ($pfx eq 'xmlns') {
1714 wakaba 1.26 $ns->{''} = $attrs->{xmlns}->{is_default}
1715     ? $attrs->{xmlns}->{def}-><AG::Node.nodeValue>
1716     : $attrs->{xmlns}->{value};
1717     if (not $attrs->{$atqname}->{is_default} and
1718     $attrs->{$atqname}->{def}) {
1719 wakaba 1.9 my $dt = $attrs->{$atqname}->{def}-><AG::ATDef.declaredType>;
1720     if ({
1721     <C::ATDef.ID_ATTR> => true,
1722     <C::ATDef.IDREF_ATTR> => true,
1723     <C::ATDef.IDREFS_ATTR> => true,
1724     <C::ATDef.ENTITY_ATTR> => true,
1725     <C::ATDef.ENTITIES_ATTR> => true,
1726     <C::ATDef.NMTOKEN_ATTR> => true,
1727     <C::ATDef.NMTOKENS_ATTR> => true,
1728     <C::ATDef.NOTATION_ATTR> => true,
1729     <C::ATDef.ENUMERATION_ATTR> => true,
1730     }->{$dt}) {
1731     ## Tokenization (XML 1 3.3.3)
1732     for ($ns->{''}) {
1733     s/^\x20+//;
1734     s/\x20+\z//;
1735     s/\x20+/ /g;
1736     }
1737     }
1738     }
1739 wakaba 1.26 unless ($ns->{''}) {
1740     delete $ns->{''};
1741     } elsif ($ns->{''} eq <Q::xml:>) {
1742     my $location;
1743     __CODE{xp|get-location-from-token::
1744     $token => $token,
1745     $result => $location,
1746     }__;
1747     my $continue = __c|ERROR{
1748     xp|nsc-reserved-namespace-name-xml::
1749     c|location => {$location},
1750     xp|token => {$token},
1751     infoset|prefix => {null},
1752     infoset|namespaceName => {<Q::xml:>},
1753     }__;
1754     unless ($continue) {
1755 wakaba 1.27 __CODE{ParseError}__;
1756 wakaba 1.26 }
1757     } elsif ($ns->{''} eq <Q::xmlns:>) {
1758     my $location;
1759     __CODE{xp|get-location-from-token::
1760     $token => $token,
1761     $result => $location,
1762     }__;
1763     my $continue = __c|ERROR{
1764     xp|nsc-reserved-namespace-name-xmlns::
1765     c|location => {$location},
1766     xp|token => {$token},
1767     infoset|prefix => {null},
1768     infoset|namespaceName => {<Q::xmlns:>},
1769     }__;
1770     unless ($continue) {
1771 wakaba 1.27 __CODE{ParseError}__;
1772 wakaba 1.26 }
1773     }
1774 wakaba 1.1 } else {
1775     $lattr{$pfx} = $attrs->{$atqname};
1776     }
1777     }
1778     }
1779    
1780     my ($pfx, $lname) = split /:/, $type;
1781     my $nsuri;
1782     if (defined $lname) { ## Prefixed namespace
1783     if (defined $ns->{$pfx}) {
1784     $nsuri = $ns->{$pfx};
1785     } else {
1786 wakaba 1.26 my $location;
1787     __CODE{xp|get-location-from-token::
1788     $token => $token,
1789     $result => $location,
1790     }__;
1791     my $continue = __c|ERROR{xp|nsc-prefix-declared::
1792     c|location => {$location},
1793     xp|token => {$token},
1794     infoset|prefix => {$pfx},
1795     xp|name => {$type},
1796     }__;
1797     unless ($continue) {
1798 wakaba 1.27 __CODE{ParseError}__;
1799 wakaba 1.26 }
1800 wakaba 1.1 }
1801     } else { ## Default namespace
1802     $nsuri = $ns->{''};
1803     }
1804    
1805     $el = $doc-><M::Document.createElementNS>
1806     ($nsuri, $type);
1807    
1808     if ($attrs->{xmlns}) {
1809     my $attr = $doc-><M::Document.createAttributeNS>
1810     (<Q::xmlns:>, 'xmlns');
1811     for (@{$attrs->{xmlns}->{nodes}}) {
1812 wakaba 1.31 if ($_-><AG::Node.nodeType> == <C::Node.TEXT_NODE>) {
1813     $attr-><M::Node.manakaiAppendText>
1814     (\($_-><AG::Node.textContent>));
1815     } else {
1816     $attr-><M::Node.appendChild> ($_);
1817     }
1818 wakaba 1.1 }
1819 wakaba 1.9 if ($attrs->{xmlns}->{def}) {
1820 wakaba 1.35 $attr-><AS::Attr.manakaiAttributeType>
1821     ($attrs->{xmlns}->{def}-><AG::ATDef.declaredType>);
1822 wakaba 1.9 }
1823 wakaba 1.1 $el-><M::Element.setAttributeNodeNS> ($attr);
1824 wakaba 1.35 $attr-><AS::Attr.specified> (false)
1825 wakaba 1.26 if $attrs->{xmlns}->{is_default};
1826 wakaba 1.1 }
1827    
1828     for my $lname (keys %lattr) {
1829     my $attr = $doc-><M::Document.createAttributeNS>
1830     (null, $lname);
1831     for (@{$lattr{$lname}->{nodes}}) {
1832 wakaba 1.31 if ($_-><AG::Node.nodeType> == <C::Node.TEXT_NODE>) {
1833     $attr-><M::Node.manakaiAppendText>
1834     (\($_-><AG::Node.textContent>));
1835     } else {
1836     $attr-><M::Node.appendChild> ($_);
1837     }
1838 wakaba 1.1 }
1839 wakaba 1.9 if ($attrs->{$lname}->{def}) {
1840 wakaba 1.35 $attr-><AS::Attr.manakaiAttributeType>
1841     ($attrs->{$lname}->{def}-><AG::ATDef.declaredType>);
1842 wakaba 1.9 }
1843 wakaba 1.1 $el-><M::Element.setAttributeNodeNS> ($attr);
1844 wakaba 1.35 $attr-><AS::Attr.specified> (false)
1845 wakaba 1.26 if $attrs->{$lname}->{is_default};
1846 wakaba 1.1 }
1847    
1848     for my $pfx (keys %gattr) {
1849 wakaba 1.26 LN: for my $lname (keys %{$gattr{$pfx}}) {
1850     my $name = $pfx.':'.$lname;
1851     unless (defined $ns->{$pfx}) {
1852     my $location;
1853     __CODE{xp|get-location-from-token::
1854     $token => $token,
1855     $result => $location,
1856     }__;
1857     my $continue = __c|ERROR{xp|nsc-prefix-declared::
1858     c|location => {$location},
1859     xp|token => {$token},
1860     xp|name => {$name},
1861     infoset|prefix => {$pfx},
1862     }__;
1863     unless ($continue) {
1864 wakaba 1.27 __CODE{ParseError}__;
1865 wakaba 1.26 }
1866     }
1867     my $attr = $el-><M::Element.getAttributeNodeNS>
1868     ($ns->{$pfx}, $lname);
1869     if ($attr) {
1870     my $another_name = $attr-><AG::Node.nodeName>;
1871     if ($name ne $another_name) {
1872     my $location;
1873     __CODE{xp|get-location-from-token::
1874     $token => $token,
1875     $result => $location,
1876     }__;
1877     my $continue = __c|ERROR{
1878     xp|nswf-unique-att-spec-expanded-name::
1879     c|location => {$location},
1880     xp|token => {$token},
1881     xp|another-attribute-name => {$another_name},
1882     xp|name => {$name},
1883     infoset|namespaceName => {$ns->{$pfx}},
1884     infoset|localName => {$lname},
1885     }__;
1886     unless ($continue) {
1887 wakaba 1.27 __CODE{ParseError}__;
1888 wakaba 1.26 }
1889 wakaba 1.35 unless ($attr-><AG::Attr.specified>) {
1890 wakaba 1.26 ## It is a default attribute
1891     $attr = $doc-><M::Document.createAttributeNS>
1892     ($ns->{$pfx}, $name);
1893     } else {
1894     ## It is a specified attribute
1895     next LN;
1896     }
1897     } else { ## There is default attribute
1898     $attr = $doc-><M::Document.createAttributeNS>
1899     ($ns->{$pfx}, $name);
1900     }
1901     } else {
1902     $attr = $doc-><M::Document.createAttributeNS>
1903     ($ns->{$pfx}, $name);
1904     }
1905 wakaba 1.1 for (@{$gattr{$pfx}->{$lname}->{nodes}}) {
1906 wakaba 1.31 if ($_-><AG::Node.nodeType> == <C::Node.TEXT_NODE>) {
1907     $attr-><M::Node.manakaiAppendText>
1908     (\($_-><AG::Node.textContent>));
1909     } else {
1910     $attr-><M::Node.appendChild> ($_);
1911     }
1912 wakaba 1.1 }
1913 wakaba 1.26 if ($gattr{$pfx}->{$lname}->{def}) {
1914 wakaba 1.35 $attr-><AS::Attr.manakaiAttributeType>
1915     ($gattr{$pfx}->{$lname}->{def}
1916     -><AG::ATDef.declaredType>);
1917 wakaba 1.9 }
1918 wakaba 1.1 $el-><M::Element.setAttributeNodeNS> ($attr);
1919 wakaba 1.35 $attr-><AS::Attr.specified> (false)
1920 wakaba 1.26 if $gattr{$pfx}->{$lname}->{is_default};
1921     } # PFX
1922 wakaba 1.1 }
1923    
1924     $node-><M::Node.appendChild> ($el);
1925     }
1926    
1927     ~ (TAGC) {
1928     lang:Perl {
1929     push @{$nodes}, $node;
1930     $node = $el;
1931     }
1932     ?lexmode ElementContent;
1933 wakaba 1.6 } (NESTC) {
1934     my $is_docel;
1935 wakaba 1.1 lang:Perl {
1936     $ns = pop @{$nses};
1937     $type = pop @{$types};
1938 wakaba 1.6 $is_docel = (@{$types} == 0);
1939     }
1940    
1941     if-true ($is_docel) {
1942     return;
1943     }
1944    
1945     ~ (TAGC) {
1946     ?lexmode ElementContent;
1947     } else {
1948     ?lexmode ElementContent;
1949 wakaba 1.1 }
1950     } else {
1951     ?lexmode ElementContent;
1952     }
1953     } else {
1954     ?lexmode ElementContent;
1955     }
1956    
1957     } (ETAGO) {
1958     // End tag
1959    
1960     ?lexmode 'EndTag';
1961    
1962     my $is_docel;
1963    
1964     ~ (Name) {
1965 wakaba 1.26 // No NCName & QName check (it must match to start-tag)
1966 wakaba 1.3 lang:Perl ($name => $token.value) : has-error {
1967 wakaba 1.1 if ($name eq $type) {
1968     $type = pop @{$types};
1969     if ($type eq '') {
1970     $is_docel = true;
1971     }
1972     $node = pop @{$nodes};
1973     $ns = pop @{$nses};
1974     } else {
1975 wakaba 1.3 my $location;
1976     __CODE{xp|get-location-from-token::
1977     $token => $token,
1978     $result => $location,
1979     }__;
1980     my $continue = __DOMCore:ERROR{xp|wf-element-type-match::
1981     DOMCore:location => {$location},
1982     xp|token => {$token},
1983     xp|expected-element-type => {$type},
1984     xp|actual-element-type => {$name},
1985     xp|node => {$node},
1986     }__;
1987     unless ($continue) {
1988 wakaba 1.27 __CODE{ParseError}__;
1989 wakaba 1.3 }
1990 wakaba 1.1 }
1991     }
1992     }
1993    
1994     ~? (S) { }
1995    
1996     if-true ($is_docel) {
1997 wakaba 1.3 lang:Perl : has-error {
1998 wakaba 1.1 if (@{$types}) {
1999 wakaba 1.3 my $location;
2000     __CODE{xp|get-location-from-token::
2001     $token => $token,
2002     $result => $location,
2003     }__;
2004     for my $type (reverse @{$types}) {
2005     my $continue = __DOMCore:ERROR{xp|wf-no-end-tag::
2006     DOMCore:location => {$location},
2007     xp|token => {$token},
2008     xp|expected-element-type => {$type},
2009     xp|node => {$node},
2010     }__;
2011     unless ($continue) {
2012 wakaba 1.27 __CODE{ParseError}__;
2013 wakaba 1.3 }
2014     $node = shift @{$nodes};
2015     }
2016 wakaba 1.1 }
2017     }
2018     return;
2019     }
2020    
2021     ~ (TAGC) {
2022     ?lexmode ElementContent;
2023     } else {
2024     ?lexmode 'ElementContent';
2025     }
2026    
2027     } (HCRO) {
2028     &_HexadecimalCharacterReference_
2029     ($doc => $doc, $parent => $node);
2030    
2031     ~ (REFC) {
2032     ?lexmode 'ElementContent';
2033     } else {
2034     ?lexmode ElementContent;
2035     }
2036     } (CRO) {
2037     &_NumericCharacterReference_
2038     ($doc => $doc, $parent => $node);
2039    
2040     ~ (REFC) {
2041     ?lexmode 'ElementContent';
2042     } else {
2043     ?lexmode ElementContent;
2044     }
2045     } (ERO) {
2046 wakaba 1.6 &_GeneralEntityReferenceEC
2047     ($doc => $doc, $parent => $node, $ns => $ns);
2048 wakaba 1.1 } (CDO) {
2049     &_CommentDeclaration_ ($doc => $doc, $parent => $node);
2050    
2051     ~ (MDC) {
2052     ?lexmode ElementContent;
2053     } else {
2054     ?lexmode ElementContent;
2055     }
2056     } (CDSO) {
2057     &_CDATASection_ ($doc => $doc, $parent => $node);
2058    
2059     ~ (MSE) {
2060     ?lexmode 'ElementContent';
2061     } else {
2062     ?lexmode ElementContent;
2063     }
2064     } (PIO) {
2065     &_ProcessingInstruction_ ($doc => $doc, $parent => $node);
2066    
2067     ~ (PIC) {
2068     ?lexmode 'ElementContent';
2069     } else {
2070     ?lexmode ElementContent;
2071     }
2072     }
2073 wakaba 1.3
2074     ~ (#NONE) { }
2075 wakaba 1.1 } // Element_
2076 wakaba 1.11
2077     /*
2078     content := [CharData]
2079     *((element / Reference / CDSect / PI / Comment) [CharData])
2080     */
2081     rule content ($parent, $ns) {
2082     // ?lexmode ElementContent;
2083    
2084     my $doc;
2085     lang:Perl {
2086     $doc = $self->{doc};
2087     }
2088    
2089     ~* (CharData) {
2090     lang:Perl ($data => $token.value) {
2091 wakaba 1.31 $parent-><M::Node.manakaiAppendText> (\($data));
2092 wakaba 1.11 }
2093     } (STAGO) {
2094     &Element_ ($doc => $doc, $parent => $parent, $ns => $ns)
2095     : unshift-current-token;
2096     ~ (TAGC) {
2097     ?lexmode ElementContent;
2098     } else {
2099     ?lexmode ElementContent;
2100     }
2101     } (HCRO) {
2102 wakaba 1.31 &_HexadecimalCharacterReference_ ($parent => $parent);
2103 wakaba 1.11
2104     ~ (REFC) {
2105     ?lexmode 'ElementContent';
2106     } else {
2107     ?lexmode ElementContent;
2108     }
2109     } (CRO) {
2110 wakaba 1.31 &_NumericCharacterReference_ ($parent => $parent);
2111 wakaba 1.11
2112     ~ (REFC) {
2113     ?lexmode 'ElementContent';
2114     } else {
2115     ?lexmode ElementContent;
2116     }
2117     } (ERO) {
2118     &_GeneralEntityReferenceEC
2119     ($doc => $doc, $parent => $parent, $ns => $ns);
2120     } (CDO) {
2121     &_CommentDeclaration_ ($doc => $doc, $parent => $parent);
2122    
2123     ~ (MDC) {
2124     ?lexmode ElementContent;
2125     } else {
2126     ?lexmode ElementContent;
2127     }
2128     } (CDSO) {
2129     &_CDATASection_ ($doc => $doc, $parent => $parent);
2130    
2131     ~ (MSE) {
2132     ?lexmode 'ElementContent';
2133     } else {
2134     ?lexmode ElementContent;
2135     }
2136     } (PIO) {
2137     &_ProcessingInstruction_ ($doc => $doc, $parent => $parent);
2138    
2139     ~ (PIC) {
2140     ?lexmode 'ElementContent';
2141     } else {
2142     ?lexmode ElementContent;
2143     }
2144     }
2145     } // content
2146 wakaba 1.1
2147     rule AttributeSpecificationList ($doc, $attrs)
2148     : standalone
2149     {
2150     ?lexmode 'StartTag';
2151    
2152     my $i;
2153     lang:Perl {
2154     $i = 0;
2155     }
2156    
2157     ~* (Name) {
2158     my $atqname;
2159 wakaba 1.26 lang:Perl ($name => $token.value) : has-error {
2160     __CODE{checkQName:: $name => $name}__;
2161 wakaba 1.1 $atqname = $name;
2162     }
2163    
2164     my $vals;
2165 wakaba 1.18 lang:Perl : has-error {
2166 wakaba 1.1 if ($attrs->{$atqname}) {
2167 wakaba 1.3 my $location;
2168     __CODE{xp|get-location-from-token::
2169     $token => $token,
2170     $result => $location,
2171     }__;
2172     my $continue = __DOMCore:ERROR{xp|wf-unique-att-spec::
2173     DOMCore:location => {$location},
2174     xp|token => {$token},
2175     xp|name => {$atqname},
2176     }__;
2177     unless ($continue) {
2178 wakaba 1.27 __CODE{ParseError}__;
2179 wakaba 1.3 }
2180 wakaba 1.1 }
2181    
2182     $vals = $attrs->{$atqname} = {
2183     nodes => [],
2184     value => '',
2185     index => $i++,
2186     };
2187     }
2188 wakaba 1.3
2189     ~? (S) { }
2190     ~ (VI) { }
2191     ~? (S) { }
2192 wakaba 1.1
2193     ~ (LIT) {
2194     &_AttributeValueSpecification_
2195     ($doc => $doc, $vals => $vals);
2196    
2197     ~ (LIT) {
2198     ?lexmode StartTag;
2199     } else {
2200     ?lexmode StartTag;
2201     }
2202     } (LITA) {
2203     &_AttributeValueSpecificationA_
2204     ($doc => $doc, $vals => $vals);
2205    
2206     ~ (LITA) {
2207     ?lexmode StartTag;
2208     } else {
2209     ?lexmode StartTag;
2210     }
2211     }
2212     } (S) : separator : terminator? { }
2213     } // AttributeSpecificationList
2214    
2215     rule _AttributeValueSpecification_ ($doc, $vals) {
2216     // ~ (LIT) { }
2217     ?lexmode 'AttributeValueLiteral';
2218    
2219     ~* (STRING) {
2220     lang:Perl ($value => $token.value) {
2221     $value =~ s/[\x09\x0A\x0D]/ /g;
2222     my $text = $doc-><M::Document.createTextNode> ($value);
2223     push @{$vals->{nodes}}, $text;
2224     $vals->{value} .= $value;
2225     }
2226     } (HCRO) {
2227     &_HexadecimalCharacterReferenceV_
2228     ($doc => $doc, $vals => $vals);
2229    
2230     ~ (REFC) {
2231     ?lexmode AttributeValueLiteral;
2232     } else {
2233     ?lexmode AttributeValueLiteral;
2234     }
2235     } (CRO) {
2236     &_NumericCharacterReferenceV_
2237     ($doc => $doc, $vals => $vals);
2238    
2239     ~ (REFC) {
2240     ?lexmode AttributeValueLiteral;
2241     } else {
2242     ?lexmode AttributeValueLiteral;
2243     }
2244     } (ERO) {
2245     // TODO: Attribute value normalization
2246     &_GeneralEntityReferenceV_
2247     ($doc => $doc, $vals => $vals);
2248    
2249     ~ (REFC) {
2250     ?lexmode AttributeValueLiteral;
2251     } else {
2252     ?lexmode AttributeValueLiteral;
2253     }
2254     }
2255    
2256     // ~ (LIT) { } (LITA) { }
2257     } // _AttributeValueSpecification_
2258    
2259     rule _AttributeValueSpecificationA_ ($doc, $vals) {
2260     // ~ (LITA) { }
2261     ?lexmode 'AttributeValueLiteralA';
2262    
2263     ~* (STRING) {
2264     lang:Perl ($value => $token.value) {
2265     $value =~ s/[\x09\x0A\x0D]/ /g;
2266     my $text = $doc-><M::Document.createTextNode> ($value);
2267     push @{$vals->{nodes}}, $text;
2268     $vals->{value} .= $value;
2269     }
2270     } (HCRO) {
2271     &_HexadecimalCharacterReferenceV_
2272     ($doc => $doc, $vals => $vals);
2273    
2274     ~ (REFC) {
2275     ?lexmode AttributeValueLiteralA;
2276     } else {
2277     ?lexmode AttributeValueLiteralA;
2278     }
2279     } (CRO) {
2280     &_NumericCharacterReferenceV_
2281     ($doc => $doc, $vals => $vals);
2282    
2283     ~ (REFC) {
2284     ?lexmode AttributeValueLiteralA;
2285     } else {
2286     ?lexmode AttributeValueLiteralA;
2287     }
2288     } (ERO) {
2289     // TODO: Attribute value normalization
2290     &_GeneralEntityReferenceV_
2291     ($doc => $doc, $vals => $vals);
2292    
2293     ~ (REFC) {
2294     ?lexmode AttributeValueLiteralA;
2295     } else {
2296     ?lexmode AttributeValueLiteralA;
2297     }
2298     }
2299    
2300     // ~ (LITA) { }
2301     } // _AttributeValueSpecificationA_
2302    
2303     /*
2304 wakaba 1.11 Parsing replacement text of an entity referenced in
2305     an attribute value specification.
2306     */
2307     rule AttributeValueLiteralE_ ($parent, $vals)
2308     : recursive
2309     {
2310     // ?lexmode AttributeValueLiteralE;
2311    
2312     ~* (STRING) {
2313     lang:Perl ($value => $token.value) {
2314     $value =~ s/[\x09\x0A\x0D]/ /g;
2315 wakaba 1.31 $parent-><M::Node.manakaiAppendText> (\($value));
2316 wakaba 1.11 $vals->{value} .= $value;
2317     }
2318     } (HCRO) {
2319     &_HexadecimalCharacterReferenceAE_
2320     ($parent => $parent, $vals => $vals);
2321    
2322     ~ (REFC) {
2323     ?lexmode AttributeValueLiteralE;
2324     } else {
2325     ?lexmode AttributeValueLiteralE;
2326     }
2327     } (CRO) {
2328     &_NumericCharacterReferenceAE_
2329     ($parent => $parent, $vals => $vals);
2330    
2331     ~ (REFC) {
2332     ?lexmode AttributeValueLiteralE;
2333     } else {
2334     ?lexmode AttributeValueLiteralE;
2335     }
2336     } (ERO) {
2337     &_GeneralEntityReferenceAE_ ($parent => $parent, $vals => $vals);
2338    
2339     ~ (REFC) {
2340     ?lexmode AttributeValueLiteralE;
2341     } else {
2342     ?lexmode AttributeValueLiteralE;
2343     }
2344 wakaba 1.18 } (#INVALID == '<') {
2345     lang:Perl : has-error {
2346     my $location;
2347     __CODE{xp|get-location-from-token::
2348     $token => $token,
2349     $result => $location,
2350     }__;
2351     my $continue = __DOMCore:ERROR{xp|wf-no-lt-in-attribute-values::
2352     c|location => {$location},
2353     xp|token => {$token},
2354     }__;
2355     unless ($continue) {
2356 wakaba 1.27 __CODE{ParseError}__;
2357 wakaba 1.18 }
2358    
2359 wakaba 1.31 $parent-><M::Node.manakaiAppendText> ('<');
2360 wakaba 1.18 $vals->{value} .= '<';
2361     }
2362 wakaba 1.11 }
2363    
2364     // ~ (#EOF) { }
2365     } // AttributeValueLiteralE_
2366    
2367     /*
2368 wakaba 1.1 CDATA Section Content Parsing Mode
2369     */
2370     rule _CDATASection_ ($doc, $parent) {
2371     ?lexmode 'CDATASectionContent';
2372    
2373     my $cdata;
2374    
2375 wakaba 1.2 ~? (CData) {
2376 wakaba 1.1 lang:Perl ($data => $token.value) {
2377     $cdata = $data;
2378     }
2379     } else {
2380     lang:Perl {
2381     $cdata = '';
2382     }
2383     }
2384    
2385     lang:Perl {
2386     my $cdsect = $doc-><M::Document.createCDATASection>
2387     ($cdata);
2388     $parent-><M::Node.appendChild> ($cdsect);
2389     }
2390    
2391     // ~ (MSE) { }
2392     } // _CDATASection_
2393    
2394 wakaba 1.31 rule _NumericCharacterReference_ ($parent) {
2395 wakaba 1.1 ?lexmode 'NumericCharacterReference';
2396    
2397     ~ (NUMBER) {
2398 wakaba 1.3 lang:Perl ($num => $token.value) : has-error {
2399     $num += 0;
2400     unless (
2401     ($self->{xml_version} eq '1.0' and
2402     ((0x0020 <= $num and $num <= 0xD7FF) or
2403     (0xE000 <= $num and $num <= 0xFFFD) or
2404     (0x10000 <= $num and $num <= 0x10FFFF) or
2405     $num == 0x9 or $num == 0xA or $num == 0xD)) or
2406     ($self->{xml_version} eq '1.1' and
2407     ((0x0001 <= $num and $num <= 0xD7FF) or
2408     (0xE000 <= $num and $num <= 0xFFFD) or
2409     (0x10000 <= $num and $num <= 0x10FFFF)))
2410     ) {
2411     my $location;
2412     __CODE{xp|get-location-from-token::
2413     $token => $token,
2414     $result => $location,
2415     }__;
2416     my $continue = __DOMCore:ERROR{xp|wf-legal-character::
2417     DOMCore:location => {$location},
2418     xp|token => {$token},
2419     xp|character-number => {$num},
2420     xp|parent => {$parent},
2421     }__;
2422     unless ($continue) {
2423 wakaba 1.27 __CODE{ParseError}__;
2424 wakaba 1.3 }
2425     }
2426 wakaba 1.31 $parent-><M::Node.manakaiAppendText> (chr $num);
2427 wakaba 1.1 }
2428     }
2429    
2430     // ~ (REFC) { }
2431     } // _NumericCharacterReference_
2432    
2433     rule _NumericCharacterReferenceV_ ($doc, $vals) {
2434     ?lexmode 'NumericCharacterReference';
2435    
2436     ~ (NUMBER) {
2437 wakaba 1.3 lang:Perl ($num => $token.value) : has-error {
2438     $num += 0;
2439     unless (
2440     ($self->{xml_version} eq '1.0' and
2441     ((0x0020 <= $num and $num <= 0xD7FF) or
2442     (0xE000 <= $num and $num <= 0xFFFD) or
2443     (0x10000 <= $num and $num <= 0x10FFFF) or
2444     $num == 0x9 or $num == 0xA or $num == 0xD)) or
2445     ($self->{xml_version} eq '1.1' and
2446     ((0x0001 <= $num and $num <= 0xD7FF) or
2447     (0xE000 <= $num and $num <= 0xFFFD) or
2448     (0x10000 <= $num and $num <= 0x10FFFF)))
2449     ) {
2450     my $location;
2451     __CODE{xp|get-location-from-token::
2452     $token => $token,
2453     $result => $location,
2454     }__;
2455     my $continue = __DOMCore:ERROR{xp|wf-legal-character::
2456     DOMCore:location => {$location},
2457     xp|token => {$token},
2458     xp|character-number => {$num},
2459     }__;
2460     unless ($continue) {
2461 wakaba 1.27 __CODE{ParseError}__;
2462 wakaba 1.3 }
2463     }
2464 wakaba 1.1 my $ncr = $doc-><M::Document.createTextNode>
2465 wakaba 1.9 (my $char = chr $num);
2466 wakaba 1.1 push @{$vals->{nodes}}, $ncr;
2467     $vals->{value} .= $char;
2468     }
2469     }
2470    
2471     // ~ (REFC) { }
2472     } // _NumericCharacterReferenceV_
2473    
2474 wakaba 1.11 /*
2475     Numeric character reference in the replacement text
2476     of the entity referenced in an attribute value specification
2477     */
2478     rule _NumericCharacterReferenceAE_ ($parent, $vals)
2479     {
2480     ?lexmode NumericCharacterReference;
2481    
2482     ~ (NUMBER) {
2483     lang:Perl ($num => $token.value) : has-error {
2484     $num += 0;
2485     unless (
2486     ($self->{xml_version} eq '1.0' and
2487     ((0x0020 <= $num and $num <= 0xD7FF) or
2488     (0xE000 <= $num and $num <= 0xFFFD) or
2489     (0x10000 <= $num and $num <= 0x10FFFF) or
2490     $num == 0x9 or $num == 0xA or $num == 0xD)) or
2491     ($self->{xml_version} eq '1.1' and
2492     ((0x0001 <= $num and $num <= 0xD7FF) or
2493     (0xE000 <= $num and $num <= 0xFFFD) or
2494     (0x10000 <= $num and $num <= 0x10FFFF)))
2495     ) {
2496     my $location;
2497     __CODE{xp|get-location-from-token::
2498     $token => $token,
2499     $result => $location,
2500     }__;
2501     my $continue = __DOMCore:ERROR{xp|wf-legal-character::
2502     DOMCore:location => {$location},
2503     xp|token => {$token},
2504     xp|character-number => {$num},
2505     }__;
2506     unless ($continue) {
2507 wakaba 1.27 __CODE{ParseError}__;
2508 wakaba 1.11 }
2509     }
2510 wakaba 1.31 my $char = chr $num;
2511     $parent-><M::Node.manakaiAppendText> (\$char);
2512 wakaba 1.11 $vals->{value} .= $char;
2513     }
2514     }
2515    
2516     // ~ (REFC) { }
2517     } // _NumericCharacterReferenceAE_
2518    
2519     rule _NumericCharacterReferenceEV_ ($vals)
2520     {
2521     ?lexmode 'NumericCharacterReference';
2522    
2523     ~ (NUMBER) {
2524     lang:Perl ($num => $token.value) : has-error {
2525     $num += 0;
2526     unless (
2527     ($self->{xml_version} eq '1.0' and
2528     ((0x0020 <= $num and $num <= 0xD7FF) or
2529     (0xE000 <= $num and $num <= 0xFFFD) or
2530     (0x10000 <= $num and $num <= 0x10FFFF) or
2531     $num == 0x9 or $num == 0xA or $num == 0xD)) or
2532     ($self->{xml_version} eq '1.1' and
2533     ((0x0001 <= $num and $num <= 0xD7FF) or
2534     (0xE000 <= $num and $num <= 0xFFFD) or
2535     (0x10000 <= $num and $num <= 0x10FFFF)))
2536     ) {
2537     my $location;
2538     __CODE{xp|get-location-from-token::
2539     $token => $token,
2540     $result => $location,
2541     }__;
2542     my $continue = __DOMCore:ERROR{xp|wf-legal-character::
2543     DOMCore:location => {$location},
2544     xp|token => {$token},
2545     xp|character-number => {$num},
2546     }__;
2547     unless ($continue) {
2548 wakaba 1.27 __CODE{ParseError}__;
2549 wakaba 1.11 }
2550     }
2551     push @{$vals}, chr $num;
2552     }
2553     }
2554    
2555     // ~ (REFC) { }
2556     } // _NumericCharacterReferenceEV_
2557    
2558 wakaba 1.31 rule _HexadecimalCharacterReference_ ($parent) {
2559 wakaba 1.1 ?lexmode 'HexadecimalCharacterReference';
2560    
2561     ~ (Hex) {
2562 wakaba 1.9 lang:Perl ($v => $token.value) : has-error {
2563     my $num = hex $v;
2564 wakaba 1.3 unless (
2565     ($self->{xml_version} eq '1.0' and
2566     ((0x0020 <= $num and $num <= 0xD7FF) or
2567     (0xE000 <= $num and $num <= 0xFFFD) or
2568     (0x10000 <= $num and $num <= 0x10FFFF) or
2569     $num == 0x9 or $num == 0xA or $num == 0xD)) or
2570     ($self->{xml_version} eq '1.1' and
2571     ((0x0001 <= $num and $num <= 0xD7FF) or
2572     (0xE000 <= $num and $num <= 0xFFFD) or
2573     (0x10000 <= $num and $num <= 0x10FFFF)))
2574     ) {
2575     my $location;
2576     __CODE{xp|get-location-from-token::
2577     $token => $token,
2578     $result => $location,
2579     }__;
2580     my $continue = __DOMCore:ERROR{xp|wf-legal-character::
2581     DOMCore:location => {$location},
2582     xp|token => {$token},
2583     xp|character-number => {$num},
2584     xp|parent => {$parent},
2585     }__;
2586     unless ($continue) {
2587 wakaba 1.27 __CODE{ParseError}__;
2588 wakaba 1.3 }
2589     }
2590 wakaba 1.31 $parent-><M::Node.manakaiAppendText> (chr $num);
2591 wakaba 1.1 }
2592     }
2593    
2594     // ~ (REFC) { }
2595     } // _HexadecimalCharacterReference_
2596    
2597 wakaba 1.3 rule _HexadecimalCharacterReferenceV_ ($doc, $vals) {
2598 wakaba 1.1 ?lexmode 'HexadecimalCharacterReference';
2599    
2600     ~ (Hex) {
2601 wakaba 1.9 lang:Perl ($v => $token.value) : has-error {
2602     my $num = hex $v;
2603 wakaba 1.3 unless (
2604     ($self->{xml_version} eq '1.0' and
2605     ((0x0020 <= $num and $num <= 0xD7FF) or
2606     (0xE000 <= $num and $num <= 0xFFFD) or
2607     (0x10000 <= $num and $num <= 0x10FFFF) or
2608     $num == 0x9 or $num == 0xA or $num == 0xD)) or
2609     ($self->{xml_version} eq '1.1' and
2610     ((0x0001 <= $num and $num <= 0xD7FF) or
2611     (0xE000 <= $num and $num <= 0xFFFD) or
2612     (0x10000 <= $num and $num <= 0x10FFFF)))
2613     ) {
2614     my $location;
2615     __CODE{xp|get-location-from-token::
2616     $token => $token,
2617     $result => $location,
2618     }__;
2619     my $continue = __DOMCore:ERROR{xp|wf-legal-character::
2620     DOMCore:location => {$location},
2621     xp|token => {$token},
2622     xp|character-number => {$num},
2623     }__;
2624     unless ($continue) {
2625 wakaba 1.27 __CODE{ParseError}__;
2626 wakaba 1.3 }
2627     }
2628 wakaba 1.1 my $ncr = $doc-><M::Document.createTextNode>
2629 wakaba 1.9 (my $char = chr $num);
2630 wakaba 1.1 push @{$vals->{nodes}}, $ncr;
2631     $vals->{value} .= $char;
2632     }
2633     }
2634    
2635     // ~ (REFC) { }
2636 wakaba 1.11 } // _HexadecimalCharacterReferenceV_
2637    
2638     /*
2639     Hexadecimal character reference in the replacement text
2640     of the entity referenced in an attribute value literal
2641     */
2642     rule _HexadecimalCharacterReferenceAE_ ($parent, $vals)
2643     {
2644     ?lexmode HexadecimalCharacterReference;
2645    
2646     ~ (Hex) {
2647     lang:Perl ($v => $token.value) : has-error {
2648     my $num = hex $v;
2649     unless (
2650     ($self->{xml_version} eq '1.0' and
2651     ((0x0020 <= $num and $num <= 0xD7FF) or
2652     (0xE000 <= $num and $num <= 0xFFFD) or
2653     (0x10000 <= $num and $num <= 0x10FFFF) or
2654     $num == 0x9 or $num == 0xA or $num == 0xD)) or
2655     ($self->{xml_version} eq '1.1' and
2656     ((0x0001 <= $num and $num <= 0xD7FF) or
2657     (0xE000 <= $num and $num <= 0xFFFD) or
2658     (0x10000 <= $num and $num <= 0x10FFFF)))
2659     ) {
2660     my $location;
2661     __CODE{xp|get-location-from-token::
2662     $token => $token,
2663     $result => $location,
2664     }__;
2665     my $continue = __DOMCore:ERROR{xp|wf-legal-character::
2666     DOMCore:location => {$location},
2667     xp|token => {$token},
2668     xp|character-number => {$num},
2669     }__;
2670     unless ($continue) {
2671 wakaba 1.27 __CODE{ParseError}__;
2672 wakaba 1.11 }
2673     }
2674 wakaba 1.31 my $char = chr $num;
2675     $parent-><M::Node.manakaiAppendText> (\$char);
2676 wakaba 1.11 $vals->{value} .= $char;
2677     }
2678     }
2679    
2680     // ~ (REFC) { }
2681     } // _HexadecimalCharacterReferenceAE_
2682    
2683     rule _HexadecimalCharacterReferenceEV_ ($vals) {
2684     ?lexmode HexadecimalCharacterReference;
2685    
2686     ~ (Hex) {
2687     lang:Perl ($v => $token.value) : has-error {
2688     my $num = hex $v;
2689     unless (
2690     ($self->{xml_version} eq '1.0' and
2691     ((0x0020 <= $num and $num <= 0xD7FF) or
2692     (0xE000 <= $num and $num <= 0xFFFD) or
2693     (0x10000 <= $num and $num <= 0x10FFFF) or
2694     $num == 0x9 or $num == 0xA or $num == 0xD)) or
2695     ($self->{xml_version} eq '1.1' and
2696     ((0x0001 <= $num and $num <= 0xD7FF) or
2697     (0xE000 <= $num and $num <= 0xFFFD) or
2698     (0x10000 <= $num and $num <= 0x10FFFF)))
2699     ) {
2700     my $location;
2701     __CODE{xp|get-location-from-token::
2702     $token => $token,
2703     $result => $location,
2704     }__;
2705     my $continue = __DOMCore:ERROR{xp|wf-legal-character::
2706     DOMCore:location => {$location},
2707     xp|token => {$token},
2708     xp|character-number => {$num},
2709     }__;
2710     unless ($continue) {
2711 wakaba 1.27 __CODE{ParseError}__;
2712 wakaba 1.11 }
2713     }
2714     push @{$vals}, chr $num;
2715     }
2716     }
2717    
2718     // ~ (REFC) { }
2719     } // _HexadecimalCharacterReferenceEV_
2720    
2721     /*
2722     General entity reference in element's content
2723     */
2724     rule _GeneralEntityReferenceEC ($doc, $parent, $ns)
2725     : recursive
2726     {
2727     ?lexmode 'EntityReference';
2728    
2729     ~ (Name == 'lt') {
2730     lang:Perl {
2731 wakaba 1.31 $parent-><M::Node.manakaiAppendText> ('<');
2732 wakaba 1.11 }
2733     } (Name == 'gt') {
2734     lang:Perl {
2735 wakaba 1.31 $parent-><M::Node.manakaiAppendText> ('>');
2736 wakaba 1.11 }
2737     } (Name == 'amp') {
2738     lang:Perl {
2739 wakaba 1.31 $parent-><M::Node.manakaiAppendText> ('&');
2740 wakaba 1.11 }
2741     } (Name == 'quot') {
2742     lang:Perl {
2743 wakaba 1.31 $parent-><M::Node.manakaiAppendText> ('"');
2744 wakaba 1.11 }
2745     } (Name == 'apos') {
2746     lang:Perl {
2747 wakaba 1.31 $parent-><M::Node.manakaiAppendText> ("'");
2748 wakaba 1.11 }
2749     } (Name) {
2750     my $er;
2751 wakaba 1.19 lang:Perl ($name => $token.value) : has-error {
2752 wakaba 1.26 __CODE{checkNCName:: $name => $name}__;
2753    
2754 wakaba 1.11 $er = $doc-><M::Document.createEntityReference>
2755     ($name);
2756 wakaba 1.35 $er-><M::Node.manakaiSetReadOnly> (false, true);
2757 wakaba 1.20 $er-><AS::Node.textContent> ('');
2758     ## NOTE: When document entity (and entities referenced directly
2759     ## or indirectly from it) is parsed, no general entity
2760     ## node have its replacement tree. During general
2761     ## entity node collection construction, however,
2762     ## some entity node has replacement tree.
2763 wakaba 1.11 $parent-><M::Node.appendChild> ($er);
2764 wakaba 1.19
2765     my $ent = $self->{general_entity}->{$name};
2766     if (not $ent) { # no entity declaration
2767     if ($self->{standalone} or not $self->{has_xref}) { # WFC error
2768     my $location;
2769     __CODE{xp|get-location-from-token::
2770     $token => {$token},
2771     $result => {$location},
2772     }__;
2773     my $continue = __DOMCore:ERROR{xp|wf-entity-declared::
2774     xp|error-token => {$token},
2775     c|location => {$location},
2776     xp|name => {$name},
2777     }__;
2778     unless ($continue) {
2779 wakaba 1.27 __CODE{ParseError}__;
2780 wakaba 1.19 }
2781     } # Otherwise VC error
2782 wakaba 1.23 push @{$self->{entity}}, <Code::getEmptyEntityState::
2783     $name = $name>;
2784 wakaba 1.35 $er-><AS::GERef.manakaiExpanded> (false);
2785 wakaba 1.19
2786     } else { # there IS entity declaration
2787     if (($self->{standalone} or not $self->{has_xref}) and
2788     $ent->{is_externally_declared} and
2789     not $self->{entity}->[-1]->{is_externally_declared}) {
2790     my $location;
2791     __CODE{xp|get-location-from-token::
2792     $token => {$token},
2793     $result => {$location},
2794     }__;
2795     my $continue = __DOMCore:ERROR{xp|wf-entity-declared::
2796     xp|error-token => {$token},
2797     c|location => {$location},
2798     xp|name => {$name},
2799     }__;
2800     unless ($continue) {
2801 wakaba 1.27 __CODE{ParseError}__;
2802 wakaba 1.19 }
2803     }
2804 wakaba 1.35 $er-><AS::GERef.manakaiExpanded>
2805 wakaba 1.19 ($ent->{has_replacement_text});
2806     push @{$self->{entity}}, <Code::getCopyOfEntityState::
2807 wakaba 1.11 $entity_type = 'general_entity',
2808     $entity_name = $name>;
2809 wakaba 1.23
2810     if (defined $ent->{notation}) {
2811     my $location;
2812     __CODE{xp|get-location-from-token::
2813     $token => {$token},
2814     $result => {$location},
2815     }__;
2816     my $continue = __c|ERROR{xp|wf-parsed-entity::
2817     xp|error-token => {$token},
2818     c|location => {$location},
2819     xp|name => {$name},
2820     }__;
2821     unless ($continue) {
2822 wakaba 1.27 __CODE{ParseError}__;
2823 wakaba 1.23 }
2824     } # if unparsed entity
2825    
2826     if ($ent->{is_opened}) {
2827     my $location;
2828     __CODE{xp|get-location-from-token::
2829     $token => {$token},
2830     $result => {$location},
2831     }__;
2832     my $continue = __c|ERROR{xp|wf-no-recursion::
2833     xp|error-token => {$token},
2834     c|location => {$location},
2835     xp|name => {$name},
2836     }__;
2837     unless ($continue) {
2838 wakaba 1.27 __CODE{ParseError}__;
2839 wakaba 1.23 }
2840 wakaba 1.27 open my $empty, '<', \'';
2841     $self->{entity}->[-1]->{fh} = $empty;
2842 wakaba 1.35 $er-><AS::GERef.manakaiExpanded> (false);
2843 wakaba 1.23 } # recursive
2844     $ent->{is_opened} = true;
2845     } # entity declared
2846 wakaba 1.14 $self->{location} = $self->{entity}->[-1];
2847 wakaba 1.11 push @{$self->{entity_token}}, $self->{token};
2848     $self->{token} = [];
2849     push @{$self->{entity_char}}, $self->{char};
2850     $self->{char} = [];
2851     }
2852    
2853     ?lexmode ElementContent;
2854     &content ($doc => $doc, $parent => $er, $ns => $ns);
2855     ~ (#EOF) { }
2856     lang:Perl {
2857 wakaba 1.23 $self->{general_entity}->{$self->{entity}->[-1]->{name}}
2858     ->{is_opened} = false
2859     if $self->{general_entity}->{$self->{entity}->[-1]->{name}};
2860 wakaba 1.11 $self->{token} = pop @{$self->{entity_token}};
2861     $self->{char} = pop @{$self->{entity_char}};
2862 wakaba 1.27 pop (@{$self->{entity}})->{close_file}->();
2863 wakaba 1.14 $self->{location} = $self->{entity}->[-1];
2864 wakaba 1.35
2865     $er-><M::Node.manakaiSetReadOnly> (true, true);
2866 wakaba 1.11 }
2867    
2868     ?lexmode EntityReference;
2869     ?requires-next-token;
2870     }
2871    
2872     ~ (REFC) {
2873     ?lexmode ElementContent;
2874     } else {
2875     ?lexmode ElementContent;
2876     }
2877     } // _GeneralEntityReferenceEC
2878    
2879     /*
2880     General entity reference in an attribute value literal
2881     */
2882     rule _GeneralEntityReferenceV_ ($vals) {
2883     ?lexmode EntityReference;
2884    
2885     ~ (Name == 'lt') {
2886     lang:Perl {
2887     push @{$vals->{nodes}}, $self->{doc}-><M::Document.createTextNode>
2888     ('<');
2889     $vals->{value} .= '<';
2890     }
2891     } (Name == 'gt') {
2892     lang:Perl {
2893     push @{$vals->{nodes}}, $self->{doc}-><M::Document.createTextNode>
2894     ('>');
2895     $vals->{value} .= '>';
2896     }
2897     } (Name == 'amp') {
2898     lang:Perl {
2899     push @{$vals->{nodes}}, $self->{doc}-><M::Document.createTextNode>
2900     ('&');
2901     $vals->{value} .= '&';
2902     }
2903     } (Name == 'quot') {
2904     lang:Perl {
2905     push @{$vals->{nodes}}, $self->{doc}-><M::Document.createTextNode>
2906     ('"');
2907     $vals->{value} .= '"';
2908     }
2909     } (Name == 'apos') {
2910     lang:Perl {
2911     push @{$vals->{nodes}}, $self->{doc}-><M::Document.createTextNode>
2912     ("'");
2913     $vals->{value} .= "'";
2914     }
2915     } (Name) {
2916     my $er;
2917 wakaba 1.18 lang:Perl ($name => $token.value) : has-error {
2918 wakaba 1.26 __CODE{checkNCName:: $name => $name}__;
2919 wakaba 1.18
2920 wakaba 1.11 $er = $self->{doc}-><M::Document.createEntityReference> ($name);
2921 wakaba 1.35 $er-><M::Node.manakaiSetReadOnly> (false, true);
2922 wakaba 1.20 $er-><AS::Node.textContent> ('');
2923     ## NOTE: When document entity (and entities referenced directly
2924     ## or indirectly from it) is parsed, no general entity
2925     ## node have its replacement tree. During general
2926     ## entity node collection construction, however,
2927     ## some entity node has replacement tree.
2928 wakaba 1.19 my $ent = $self->{general_entity}->{$name};
2929 wakaba 1.20 if (not $ent) { # no entity declaration
2930     if ($self->{standalone} or not $self->{has_xref}) { # WFC error
2931     my $location;
2932     __CODE{xp|get-location-from-token::
2933     $token => {$token},
2934     $result => {$location},
2935     }__;
2936     my $continue = __DOMCore:ERROR{xp|wf-entity-declared::
2937     xp|error-token => {$token},
2938     c|location => {$location},
2939     xp|name => {$name},
2940     }__;
2941     unless ($continue) {
2942 wakaba 1.27 __CODE{ParseError}__;
2943 wakaba 1.20 }
2944     } # Otherwise VC error
2945 wakaba 1.23 push @{$self->{entity}}, <Code::getEmptyEntityState::
2946     $name = $name>;
2947 wakaba 1.35 $er-><AS::GERef.manakaiExpanded> (false);
2948 wakaba 1.20
2949     } else { # there IS entity declaration
2950     if (($self->{standalone} or not $self->{has_xref}) and
2951     $ent->{is_externally_declared} and
2952     not $self->{entity}->[-1]->{is_externally_declared}) {
2953     my $location;
2954     __CODE{xp|get-location-from-token::
2955     $token => {$token},
2956     $result => {$location},
2957     }__;
2958     my $continue = __DOMCore:ERROR{xp|wf-entity-declared::
2959     xp|error-token => {$token},
2960     c|location => {$location},
2961     xp|name => {$name},
2962     }__;
2963     unless ($continue) {
2964 wakaba 1.27 __CODE{ParseError}__;
2965 wakaba 1.20 }
2966     }
2967    
2968     if ($ent->{is_external_entity}) {
2969     my $location;
2970     __CODE{xp|get-location-from-token::
2971     $token => {$token},
2972     $result => {$location},
2973     }__;
2974     my $continue = __c|ERROR{xp|wf-no-external-entity-references::
2975     xp|error-token => {$token},
2976     c|location => {$location},
2977     xp|name => {$name},
2978     }__;
2979     unless ($continue) {
2980 wakaba 1.27 __CODE{ParseError}__;
2981 wakaba 1.20 }
2982 wakaba 1.23 ## NOTE: |xp:wf-parsed-entity| is not checked
2983 wakaba 1.20 } # if external entity
2984    
2985 wakaba 1.35 $er-><AS::GERef.manakaiExpanded>
2986 wakaba 1.19 ($ent->{has_replacement_text});
2987 wakaba 1.20 push @{$self->{entity}}, <Code::getCopyOfEntityState::
2988 wakaba 1.11 $entity_type = 'general_entity',
2989     $entity_name = $name>;
2990 wakaba 1.23
2991     if ($ent->{is_opened}) {
2992     my $location;
2993     __CODE{xp|get-location-from-token::
2994     $token => {$token},
2995     $result => {$location},
2996     }__;
2997     my $continue = __c|ERROR{xp|wf-no-recursion::
2998     xp|error-token => {$token},
2999     c|location => {$location},
3000     xp|name => {$name},
3001     }__;
3002     unless ($continue) {
3003 wakaba 1.27 __CODE{ParseError}__;
3004 wakaba 1.23 }
3005 wakaba 1.27 open my $empty, '<', \'';
3006     $self->{entity}->[-1]->{fh} = $empty;
3007 wakaba 1.35 $er-><AS::GERef.manakaiExpanded> (false);
3008 wakaba 1.23 } # recursive
3009     $ent->{is_opened} = true;
3010 wakaba 1.20 }
3011     push @{$vals->{nodes}}, $er;
3012 wakaba 1.14 $self->{location} = $self->{entity}->[-1];
3013 wakaba 1.11 push @{$self->{entity_token}}, $self->{token};
3014     $self->{token} = [];
3015     push @{$self->{entity_char}}, $self->{char};
3016     $self->{char} = [];
3017     }
3018    
3019     ?lexmode AttributeValueLiteralE;
3020     &AttributeValueLiteralE_ ($parent => $er, $vals => $vals);
3021     ~ (#EOF) { }
3022     lang:Perl {
3023 wakaba 1.23 $self->{general_entity}->{$self->{entity}->[-1]->{name}}
3024     ->{is_opened} = false
3025     if $self->{general_entity}->{$self->{entity}->[-1]->{name}};
3026 wakaba 1.11 $self->{token} = pop @{$self->{entity_token}};
3027     $self->{char} = pop @{$self->{entity_char}};
3028 wakaba 1.27 pop (@{$self->{entity}})->{close_file}->();
3029 wakaba 1.14 $self->{location} = $self->{entity}->[-1];
3030 wakaba 1.35
3031     $er-><M::Node.manakaiSetReadOnly> (true, true);
3032 wakaba 1.11 }
3033    
3034     ?lexmode EntityReference;
3035     ?requires-next-token;
3036     }
3037    
3038     // ~ (REFC) { }
3039     } // _GeneralEntityReferenceV_
3040 wakaba 1.1
3041 wakaba 1.6 /*
3042 wakaba 1.11 General entity reference in the replacement text
3043     of the entity referenced in an attribute value literal
3044 wakaba 1.6 */
3045 wakaba 1.11 rule _GeneralEntityReferenceAE_ ($parent, $vals)
3046 wakaba 1.6 {
3047 wakaba 1.11 ?lexmode EntityReference;
3048 wakaba 1.1
3049 wakaba 1.11 ~ (Name == 'lt') {
3050     lang:Perl {
3051 wakaba 1.31 $parent-><M::Node.manakaiAppendText> ('<');
3052 wakaba 1.11 $vals->{value} .= '<';
3053     }
3054     } (Name == 'gt') {
3055     lang:Perl {
3056 wakaba 1.31 $parent-><M::Node.manakaiAppendText> ('>');
3057 wakaba 1.11 $vals->{value} .= '>';
3058     }
3059     } (Name == 'amp') {
3060     lang:Perl {
3061 wakaba 1.31 $parent-><M::Node.manakaiAppendText> ('&');
3062 wakaba 1.11 $vals->{value} .= '&';
3063     }
3064     } (Name == 'quot') {
3065     lang:Perl {
3066 wakaba 1.31 $parent-><M::Node.manakaiAppendText> ('"');
3067 wakaba 1.11 $vals->{value} .= '"';
3068     }
3069     } (Name == 'apos') {
3070     lang:Perl {
3071 wakaba 1.31 $parent-><M::Node.manakaiAppendText> ("'");
3072 wakaba 1.11 $vals->{value} .= "'";
3073     }
3074     } (Name) {
3075 wakaba 1.6 my $er;
3076 wakaba 1.26 lang:Perl ($name => $token.value) : has-error {
3077     __CODE{checkNCName:: $name => $name}__;
3078 wakaba 1.18
3079 wakaba 1.11 $er = $self->{doc}-><M::Document.createEntityReference> ($name);
3080 wakaba 1.35 $er-><M::Node.manakaiSetReadOnly> (false, true);
3081 wakaba 1.20 $er-><AS::Node.textContent> ('');
3082     ## NOTE: When document entity (and entities referenced directly
3083     ## or indirectly from it) is parsed, no general entity
3084     ## node have its replacement tree. During general
3085     ## entity node collection construction, however,
3086     ## some entity node has replacement tree.
3087 wakaba 1.19 my $ent = $self->{general_entity}->{$name};
3088 wakaba 1.22 if (not $ent) { # no entity declaration
3089     if ($self->{standalone} or not $self->{has_xref}) { # WFC error
3090     my $location;
3091     __CODE{xp|get-location-from-token::
3092     $token => {$token},
3093     $result => {$location},
3094     }__;
3095     my $continue = __DOMCore:ERROR{xp|wf-entity-declared::
3096     xp|error-token => {$token},
3097     c|location => {$location},
3098     xp|name => {$name},
3099     }__;
3100     unless ($continue) {
3101 wakaba 1.27 __CODE{ParseError}__;
3102 wakaba 1.22 }
3103     } # Otherwise VC error
3104 wakaba 1.23 push @{$self->{entity}}, <Code::getEmptyEntityState::
3105     $name = $name>;
3106 wakaba 1.35 $er-><AS::GERef.manakaiExpanded> (false);
3107 wakaba 1.22
3108     } else { # there IS entity declaration
3109     if (($self->{standalone} or not $self->{has_xref}) and
3110     $ent->{is_externally_declared} and
3111     not $self->{entity}->[-1]->{is_externally_declared}) {
3112     my $location;
3113     __CODE{xp|get-location-from-token::
3114     $token => {$token},
3115     $result => {$location},
3116     }__;
3117     my $continue = __DOMCore:ERROR{xp|wf-entity-declared::
3118     xp|error-token => {$token},
3119     c|location => {$location},
3120     xp|name => {$name},
3121     }__;
3122     unless ($continue) {
3123 wakaba 1.27 __CODE{ParseError}__;
3124 wakaba 1.22 }
3125     }
3126    
3127     if ($ent->{is_external_entity}) {
3128     my $location;
3129     __CODE{xp|get-location-from-token::
3130     $token => {$token},
3131     $result => {$location},
3132     }__;
3133     my $continue = __c|ERROR{xp|wf-no-external-entity-references::
3134     xp|error-token => {$token},
3135     c|location => {$location},
3136     xp|name => {$name},
3137     }__;
3138     unless ($continue) {
3139 wakaba 1.27 __CODE{ParseError}__;
3140 wakaba 1.22 }
3141 wakaba 1.23 ## NOTE: |xp:wf-parsed-entity| is not checked
3142 wakaba 1.22 } # if external entity
3143    
3144 wakaba 1.35 $er-><AS::GERef.manakaiExpanded>
3145 wakaba 1.19 ($ent->{has_replacement_text});
3146 wakaba 1.22 push @{$self->{entity}}, <Code::getCopyOfEntityState::
3147 wakaba 1.6 $entity_type = 'general_entity',
3148     $entity_name = $name>;
3149 wakaba 1.23
3150     if ($ent->{is_opened}) {
3151     my $location;
3152     __CODE{xp|get-location-from-token::
3153     $token => {$token},
3154     $result => {$location},
3155     }__;
3156     my $continue = __c|ERROR{xp|wf-no-recursion::
3157     xp|error-token => {$token},
3158     c|location => {$location},
3159     xp|name => {$name},
3160     }__;
3161     unless ($continue) {
3162 wakaba 1.27 __CODE{ParseError}__;
3163 wakaba 1.23 }
3164 wakaba 1.27 open my $empty, '<', \'';
3165     $self->{entity}->[-1]->{fh} = $empty;
3166 wakaba 1.35 $er-><AS::GERef.manakaiExpanded> (false);
3167 wakaba 1.23 } # recursive
3168     $ent->{is_opened} = true;
3169 wakaba 1.22 }
3170     $parent-><M::Node.appendChild> ($er);
3171 wakaba 1.14 $self->{location} = $self->{entity}->[-1];
3172 wakaba 1.6 push @{$self->{entity_token}}, $self->{token};
3173     $self->{token} = [];
3174     push @{$self->{entity_char}}, $self->{char};
3175     $self->{char} = [];
3176     }
3177    
3178 wakaba 1.11 ?lexmode AttributeValueLiteralE;
3179     &AttributeValueLiteralE_ ($parent => $er, $vals => $vals);
3180 wakaba 1.6 ~ (#EOF) { }
3181     lang:Perl {
3182 wakaba 1.23 $self->{general_entity}->{$self->{entity}->[-1]->{name}}
3183     ->{is_opened} = false
3184     if $self->{general_entity}->{$self->{entity}->[-1]->{name}};
3185 wakaba 1.6 $self->{token} = pop @{$self->{entity_token}};
3186     $self->{char} = pop @{$self->{entity_char}};
3187 wakaba 1.27 pop (@{$self->{entity}})->{close_file}->();
3188 wakaba 1.14 $self->{location} = $self->{entity}->[-1];
3189 wakaba 1.35
3190     $er-><M::Node.manakaiSetReadOnly> (true, true);
3191 wakaba 1.6 }
3192    
3193     ?lexmode EntityReference;
3194     ?requires-next-token;
3195 wakaba 1.1 }
3196    
3197     // ~ (REFC) { }
3198 wakaba 1.11 } // _GeneralEntityReferenceAE_
3199 wakaba 1.6
3200     /*
3201 wakaba 1.24 General Entity Reference in Literal Entity Value in Entity Declaration
3202 wakaba 1.6 */
3203 wakaba 1.11 rule _GeneralEntityReferenceEV_ ($vals) {
3204 wakaba 1.6 ?lexmode 'EntityReference';
3205    
3206     ~ (Name) {
3207     lang:Perl ($name => $token.value) {
3208 wakaba 1.26 __CODE{checkNCName:: $name => $name}__;
3209 wakaba 1.6 push @$vals, $name;
3210     }
3211 wakaba 1.24 /*
3212     WFCs such as Entity Declared are not checked
3213     <http://www.w3.org/TR/xml11/#bypass>
3214    
3215     Note that violation to the Parsed Entity WFC is an error
3216     rather than fatal error here.
3217     */
3218 wakaba 1.6 }
3219 wakaba 1.11
3220     // No expansion
3221 wakaba 1.6
3222     // ~ (REFC) { }
3223     } // _GeneralEntityReferenceEV_
3224 wakaba 1.1
3225     /*
3226 wakaba 1.4 Document Type Declaration
3227 wakaba 1.1 */
3228 wakaba 1.4 rule _DocumentTypeDeclaration_ ($doc) {
3229     ?lexmode MarkupDeclaration;
3230    
3231     ~ (Name == 'DOCTYPE') { }
3232    
3233     ~ (S) { }
3234    
3235     // Document type name
3236 wakaba 1.6 my $name;
3237 wakaba 1.4 ~ (Name) {
3238 wakaba 1.6 lang:Perl ($v => $token.value) {
3239 wakaba 1.26 __CODE{checkQName:: $name => $v}__;
3240 wakaba 1.6 $name = $v;
3241     }
3242     }
3243 wakaba 1.17
3244     my $node;
3245     my $decl;
3246 wakaba 1.6 lang:Perl {
3247 wakaba 1.11 $self->{docx} = $self->{doc}
3248     -><M::Node.getFeature> (<Q::fe:XDoctype>, '3.0');
3249     $node = $self->{docx}-><M::DocumentXDoctype.createDocumentTypeDefinition>
3250     ($name);
3251 wakaba 1.17 $decl = $self->{dtdecl} = $node-><M::Node.getFeature>
3252     (<Q::fe:XDoctypeDeclaration>, '3.0');
3253 wakaba 1.4 }
3254    
3255 wakaba 1.25 my $has_extid;
3256 wakaba 1.4 ~? (S) {
3257     ~? (Name == 'PUBLIC') {
3258     ~ (S) { }
3259    
3260 wakaba 1.17 &PubidLiteral ($decl => $decl);
3261 wakaba 1.4
3262     ~ (S) { }
3263    
3264 wakaba 1.17 &SystemLiteral ($decl => $decl);
3265 wakaba 1.4
3266     ~? (S) { }
3267 wakaba 1.19
3268     lang:Perl {
3269     $self->{has_xref} = true;
3270 wakaba 1.25 $has_extid = true;
3271 wakaba 1.19 }
3272 wakaba 1.4 } (Name == 'SYSTEM') {
3273     ~ (S) { }
3274    
3275 wakaba 1.17 &SystemLiteral ($decl => $decl);
3276 wakaba 1.4
3277     ~? (S) { }
3278 wakaba 1.19
3279     lang:Perl {
3280     $self->{has_xref} = true;
3281 wakaba 1.25 $has_extid = true;
3282 wakaba 1.19 }
3283 wakaba 1.4 }
3284     }
3285 wakaba 1.17
3286 wakaba 1.11 lang:Perl {
3287     $self->{dtdef} = $node;
3288 wakaba 1.21 $self->{doc}-><M::Node.appendChild> ($node);
3289     $self->{doc_cfg}-><M::c|DOMConfiguration.setParameter>
3290     ('schema-type' => <Q::xml-dtd:>);
3291     ## ISSUE: Should default schema language information be
3292     ## preserved by some other flag?
3293 wakaba 1.11 }
3294    
3295 wakaba 1.4 ~? (DSO) {
3296 wakaba 1.6 &InternalSubset ($doc => $doc, $doctype => $node);
3297 wakaba 1.4
3298     ~ (DSC) {
3299     ?lexmode MarkupDeclaration;
3300     } else {
3301     ?lexmode MarkupDeclaration;
3302     }
3303    
3304     ~? (S) { }
3305     }
3306    
3307 wakaba 1.25 // TODO: Read and process external subset if any.
3308     lang:Perl {
3309     $self->{dont_process} = true if $has_extid;
3310 wakaba 1.35 $node-><M::Node.manakaiSetReadOnly> (true, true);
3311 wakaba 1.25 }
3312    
3313 wakaba 1.4 // ~ (MDC) { }
3314     } // _DocumentTypeDeclaration_
3315    
3316 wakaba 1.17 /*
3317     Public Identifier Literal
3318     */
3319     rule PubidLiteral ($decl) {
3320     my $pubid;
3321     my $pubid_token;
3322 wakaba 1.4 ~ (LIT) {
3323     ?lexmode SystemLiteral;
3324    
3325     ~? (STRING) {
3326 wakaba 1.17 lang:Perl ($v => $token.value) {
3327     $pubid = $v;
3328     $pubid_token = $token;
3329     }
3330 wakaba 1.4 }
3331    
3332     ~ (LIT) {
3333     ?lexmode MarkupDeclaration;
3334     } else {
3335     ?lexmode MarkupDeclaration;
3336     }
3337     } (LITA) {
3338     ?lexmode SystemLiteralA;
3339    
3340     ~? (STRING) {
3341 wakaba 1.17 lang:Perl ($v => $token.value) {
3342     $pubid = $v;
3343     $pubid_token = $token;
3344     }
3345 wakaba 1.4 }
3346    
3347     ~ (LITA) {
3348     ?lexmode MarkupDeclaration;
3349     } else {
3350     ?lexmode MarkupDeclaration;
3351     }
3352     }
3353 wakaba 1.17
3354     if-true ($pubid_token) {
3355     lang:Perl : has-error {
3356     if ($pubid =~ m{[^\x20\x0D\x0Aa-zA-Z0-9'()+,./:=?;!*#\@\$_%-]}s) {
3357     my $location;
3358     __CODE{xp|get-location-from-token::
3359     $token => {$pubid_token},
3360     $result => {$location},
3361     }__;
3362     ## Should this be other (new) error type?
3363     my $continue = __DOMCore:ERROR{xp|wf-syntax-error::
3364     xp|error-token => {$token},
3365     c|location => {$location},
3366     }__;
3367     unless ($continue) {
3368 wakaba 1.27 __CODE{ParseError}__;
3369 wakaba 1.17 }
3370     }
3371    
3372     ## NOTE: U+0009 is syntactically illegal.
3373 wakaba 1.23 $pubid =~ s/[\x09\x0A\x0D\x20]+/\x20/gs;
3374 wakaba 1.17 $pubid =~ s/\A\x20//s;
3375     $pubid =~ s/\x20\z//s;
3376     ## NOTE: Bare attribute name is written.
3377     $decl->public_id ($pubid);
3378     }
3379     }
3380 wakaba 1.4 } // PubidLiteral
3381    
3382 wakaba 1.17 /*
3383     System Identifier Literal
3384     */
3385     rule SystemLiteral ($decl) {
3386 wakaba 1.4 ~ (LIT) {
3387     ?lexmode SystemLiteral;
3388 wakaba 1.17 &_SystemLiteral ($decl => $decl);
3389 wakaba 1.4 } (LITA) {
3390     ?lexmode SystemLiteralA;
3391 wakaba 1.17 &_SystemLiteral ($decl => $decl);
3392 wakaba 1.4 }
3393     } // SystemLiteral
3394    
3395 wakaba 1.17 /*
3396     System Identifier Literal Content
3397 wakaba 1.29
3398     Used in document type declaration, entity declaration,
3399     and notation declaration.
3400 wakaba 1.17 */
3401     rule _SystemLiteral ($decl) {
3402     // LIT or LITA
3403    
3404 wakaba 1.4 ~? (STRING) {
3405 wakaba 1.17 lang:Perl ($v => $token.value) {
3406 wakaba 1.35 $decl-><AS::GE.systemId> ($v);
3407     $decl-><AS::GE.manakaiDeclarationBaseURI>
3408 wakaba 1.29 ($self->{location}->{base_uri});
3409 wakaba 1.17 }
3410 wakaba 1.4 }
3411    
3412     ~ (LIT) {
3413     ?lexmode MarkupDeclaration;
3414     } (LITA) {
3415     ?lexmode MarkupDeclaration;
3416     } else {
3417     ?lexmode MarkupDeclaration;
3418     }
3419     } // _SystemLiteral
3420    
3421     /*
3422     DTD Internal Subset
3423    
3424     intSubset := *(markupdecl / DeclSep) ;; [28b]
3425     */
3426 wakaba 1.6 rule InternalSubset ($doc, $doctype) {
3427 wakaba 1.4 ?lexmode DTD;
3428    
3429     ~* (MDO) {
3430     ?lexmode MarkupDeclaration;
3431    
3432     ~ (Name == 'ELEMENT') {
3433     &_ElementDeclaration ($doc => $doc);
3434     } (Name == 'ATTLIST') {
3435 wakaba 1.8 &_AttlistDeclaration ($doc => $doc, $doctype => $doctype);
3436 wakaba 1.4 } (Name == 'ENTITY') {
3437     &_EntityDeclaration ($doc => $doc);
3438     } (Name == 'NOTATION') {
3439     &_NotationDeclaration ($doc => $doc);
3440     }
3441     } (S) {
3442     //
3443     } (CDO) {
3444     &_CommentDeclarationDTD ($doc => $doc);
3445     } (PIO) {
3446 wakaba 1.6 &_ProcessingInstructionDTD ($doc => $doc, $doctype => $doctype);
3447 wakaba 1.4 } (PERO) {
3448     ?lexmode EntityReference;
3449    
3450 wakaba 1.19 lang:Perl {
3451     $self->{has_xref} = true;
3452 wakaba 1.25 $self->{dont_process} = true;
3453 wakaba 1.19 }
3454    
3455 wakaba 1.4 ~ (Name) {
3456 wakaba 1.26 // TODO: __CODE{checkNCName:: $name => $name}__;
3457 wakaba 1.4
3458     }
3459    
3460     ~ (REFC) {
3461     ?lexmode DTD;
3462     } else {
3463     ?lexmode DTD;
3464     }
3465     }
3466     } // InternalSubset
3467    
3468     rule _ElementDeclaration ($doc) {
3469     // ~ (MDO) { }
3470     // ?lexmode MarkupDeclaration
3471     // ~ (Name == 'Element') { }
3472    
3473     ~ (S) { }
3474    
3475     ~ (Name) {
3476 wakaba 1.26 // TODO: __CODE{checkQName:: $name => $name}__;
3477 wakaba 1.4
3478     }
3479    
3480     ?lexmode ElementDeclaration;
3481    
3482     ~ (S) { }
3483    
3484     // contentspec
3485     ~ (MGO) {
3486     &_ContentModel ($doc => $doc);
3487     } (Name == 'EMPTY') {
3488    
3489     } (Name == 'ANY') {
3490    
3491     }
3492    
3493     ~? (S) { }
3494    
3495     ~ (MDC) {
3496     ?lexmode DTD;
3497     } else {
3498     ?lexmode DTD;
3499     }
3500     } // _ElementDeclaration
3501    
3502     rule _ContentModel ($doc) {
3503     // ~ (MGO) { }
3504    
3505     ~? (S) { }
3506    
3507     ~ (Name) {
3508     // Element content model
3509     &_ModelGroup ($doc => $doc)
3510     : unshift-current-token;
3511    
3512     ~? (OPT) {
3513    
3514     } (REP) {
3515    
3516     } (PLUS) {
3517    
3518     }
3519    
3520     } (MDO) {
3521     &_ModelGroup ($doc => $doc)
3522     : unshift-current-token;
3523    
3524     ~? (OPT) {
3525    
3526     } (REP) {
3527    
3528     } (PLUS) {
3529    
3530     }
3531    
3532     } (PCDATA) {
3533     // Mixed content declaration
3534     ~? (S) { }
3535    
3536     ~* (OR) {
3537     ~? (S) { }
3538    
3539     ~ (Name) {
3540 wakaba 1.26 // TODO: Name & QName check
3541 wakaba 1.4
3542     }
3543    
3544     ~? (S) { }
3545     }
3546    
3547     ~ (MGC) { }
3548    
3549     ~? (REP) {
3550    
3551     } else {
3552     // TODO: error if |Name|
3553     }
3554    
3555    
3556     }
3557     } // _ContentModel
3558    
3559     rule _ModelGroup ($doc)
3560     : standalone
3561     : recursive
3562     {
3563     // ~ (MGO) { }
3564     // ~? (S) { }
3565    
3566     &ContentParticle ($doc => $doc);
3567    
3568     ~? (S) { }
3569    
3570     ~? (OR) {
3571     ~? (S) { }
3572    
3573     &ContentParticle ($doc => $doc);
3574    
3575     ~? (S) { }
3576    
3577     ~* (OR) {
3578     ~? (S) { }
3579    
3580     &ContentParticle ($doc => $doc);
3581    
3582     ~? (S) { }
3583     }
3584    
3585     } (SEQ) {
3586     ~? (S) { }
3587    
3588     &ContentParticle ($doc => $doc);
3589    
3590     ~? (S) { }
3591    
3592     ~* (SEQ) {
3593     ~? (S) { }
3594    
3595     &ContentParticle ($doc => $doc);
3596    
3597     ~? (S) { }
3598     }
3599    
3600     }
3601    
3602     ~ (MGC) { }
3603     } // _ModelGroup
3604    
3605     rule ContentParticle ($doc) {
3606     ~ (Name) {
3607 wakaba 1.26 // TODO: Name & QName check
3608 wakaba 1.4
3609     } (MGO) {
3610     ~? (S) { }
3611    
3612     &_ModelGroup ($doc => $doc);
3613     }
3614    
3615     ~? (OPT) {
3616    
3617     } (REP) {
3618    
3619     } (PLUS) {
3620    
3621     }
3622     } // ContentParticle
3623    
3624 wakaba 1.8 /*
3625     Attribute list declaration
3626     */
3627     rule _AttlistDeclaration ($doc, $doctype) {
3628 wakaba 1.4 // ~ (MDO) { }
3629     // ~ (Name == 'ATTLIST') { }
3630    
3631     ?lexmode AttlistDeclaration;
3632    
3633     ~ (S) { }
3634    
3635 wakaba 1.8 my $name;
3636 wakaba 1.4 ~ (Name) {
3637 wakaba 1.8 lang:Perl ($v => $token.value) {
3638 wakaba 1.26 __CODE{checkQName:: $name => $v}__;
3639 wakaba 1.8 $name = $v;
3640     }
3641     } else {
3642     lang:Perl { $name = '#ILLEGAL' }
3643     }
3644 wakaba 1.4
3645 wakaba 1.8 my $docxd;
3646     my $et;
3647     lang:Perl {
3648     $et = $doctype-><M::DTDef.getElementTypeDefinitionNode> ($name);
3649     unless ($et) {
3650 wakaba 1.11 $docxd = $doc-><M::Node.getFeature> (<Q::fe:XDoctype>, '3.0');
3651 wakaba 1.8 $et = $docxd-><M::DocumentXDoctype.createElementTypeDefinition>
3652     ($name);
3653     $doctype-><M::DTDef.setElementTypeDefinitionNode> ($et)
3654     unless $name eq '#ILLEGAL';
3655     }
3656 wakaba 1.4 }
3657    
3658     ~? (S) { }
3659    
3660     ~* (Name) {
3661 wakaba 1.8 my $at;
3662 wakaba 1.25 lang:Perl ($v => $token.value) : has-error {
3663 wakaba 1.26 __CODE{checkQName:: $name => $v}__;
3664 wakaba 1.8 $docxd ||= $doc-><M::Node.getFeature>
3665 wakaba 1.11 (<Q::fe:XDoctype>, '3.0');
3666 wakaba 1.8 $at = $docxd-><M::DocumentXDoctype.createAttributeDefinition> ($v);
3667 wakaba 1.25 if (exists $et-><AG::ETDef.attributeDefinitions>->{$v}) {
3668     my $location;
3669     __CODE{xp|get-location-from-token::
3670     $token => {$token},
3671     $result => {$location},
3672     }__;
3673     my $continue = __c|ERROR{xp|warning-attribute-definition-ignored::
3674     xp|error-token => {$token},
3675     c|location => {$location},
3676     xp|name => {$v},
3677     }__;
3678     unless ($continue) {
3679 wakaba 1.27 __CODE{ParseError}__;
3680 wakaba 1.25 }
3681     } elsif ($self->{dont_process} and not $self->{standalone}) {
3682     my $location;
3683     __CODE{xp|get-location-from-token::
3684     $token => {$token},
3685     $result => {$location},
3686     }__;
3687     my $continue = __c|ERROR{
3688     xp|warning-attribute-definition-not-processed::
3689     xp|error-token => {$token},
3690     c|location => {$location},
3691     xp|name => {$v},
3692     }__;
3693     unless ($continue) {
3694 wakaba 1.27 __CODE{ParseError}__;
3695 wakaba 1.25 }
3696     } else {
3697 wakaba 1.9 $et-><M::ETDef.setAttributeDefinitionNode> ($at);
3698     $self->{attr}->{$name}->{$v} = $at;
3699     }
3700 wakaba 1.8 }
3701 wakaba 1.4
3702     ~ (S) { }
3703    
3704     // AttType
3705     ~ (Name == 'NOTATION') {
3706     ~ (S) { }
3707    
3708 wakaba 1.8 my $kwd;
3709     lang:Perl {
3710     $at-><AS::ATDef.declaredType> (<C::ATDef.NOTATION_ATTR>);
3711     $kwd = $at-><AG::ATDef.allowedTokens>;
3712     }
3713    
3714 wakaba 1.4 ~ (EGO) {
3715     ~? (S) { }
3716    
3717 wakaba 1.8 ~+ (Name) {
3718 wakaba 1.26 lang:Perl ($v => $token.value) : has-error {
3719     __CODE{checkNCName:: $name => $v}__;
3720 wakaba 1.8 push @$kwd, $v;
3721     }
3722 wakaba 1.4
3723     ~? (S) { }
3724     } (OR) : separator {
3725     ~? (S) { }
3726     }
3727    
3728     ~ (EGC) { }
3729     }
3730 wakaba 1.8
3731 wakaba 1.4 } (Name) {
3732 wakaba 1.8 my $type;
3733     lang:Perl ($v => $token.value) : has-error {
3734     my $map = {
3735     CDATA => <C::ATDef.CDATA_ATTR>,
3736     ID => <C::ATDef.ID_ATTR>,
3737     IDREF => <C::ATDef.IDREF_ATTR>,
3738     IDREFS => <C::ATDef.IDREFS_ATTR>,
3739     ENTITY => <C::ATDef.ENTITY_ATTR>,
3740     ENTITIES => <C::ATDef.ENTITIES_ATTR>,
3741     NMTOKEN => <C::ATDef.NMTOKEN_ATTR>,
3742     NMTOKENS => <C::ATDef.NMTOKENS_ATTR>,
3743     };
3744     if ($map->{$v}) {
3745     $at-><AS::ATDef.declaredType> ($map->{$v});
3746     } else {
3747     ## TODO: Exception
3748     }
3749     }
3750 wakaba 1.4
3751     } (EGO) {
3752     ?lexmode Enumeration;
3753    
3754     ~? (S) { }
3755    
3756 wakaba 1.8 my $kwd;
3757     lang:Perl {
3758     $at-><AS::ATDef.declaredType> (<C::ATDef.ENUMERATION_ATTR>);
3759     $kwd = $at-><AG::ATDef.allowedTokens>;
3760     }
3761    
3762     ~+ (Nmtoken) {
3763     lang:Perl ($v => $token.value) {
3764     push @$kwd, $v;
3765     }
3766 wakaba 1.4
3767     ~? (S) { }
3768     } (OR) : separator {
3769     ~? (S) { }
3770     }
3771    
3772     ~ (EGC) {
3773     ?lexmode AttlistDeclaration;
3774     } else {
3775     ?lexmode AttlistDeclaration;
3776     }
3777    
3778     }
3779    
3780     ~ (S) { }
3781    
3782     // DefaultDecl
3783     ~ (RNI) {
3784     ~ (Name == 'REQUIRED') {
3785 wakaba 1.8 lang:Perl {
3786     $at-><AS::ATDef.defaultType> (<C::ATDef.REQUIRED_DEFAULT>);
3787     }
3788 wakaba 1.4 } (Name == 'IMPLIED') {
3789 wakaba 1.8 lang:Perl {
3790     $at-><AS::ATDef.defaultType> (<C::ATDef.IMPLIED_DEFAULT>);
3791     }
3792 wakaba 1.4 } (Name == 'FIXED') {
3793     ~ (S) { }
3794 wakaba 1.8
3795     lang:Perl {
3796     $at-><AS::ATDef.defaultType> (<C::ATDef.FIXED_DEFAULT>);
3797     }
3798 wakaba 1.4
3799     ~ (LIT) {
3800     my $vals;
3801     lang:Perl {
3802 wakaba 1.8 $vals = {nodes => [], value => ''};
3803 wakaba 1.4 }
3804    
3805     &_AttributeValueSpecification_ ($doc => $doc, $vals => $vals);
3806    
3807 wakaba 1.8 lang:Perl {
3808     for (@{$vals->{nodes}}) {
3809     $at-><M::Node.appendChild> ($_);
3810     }
3811     }
3812    
3813 wakaba 1.4 ~ (LIT) {
3814     ?lexmode AttlistDeclaration;
3815     } else {
3816     ?lexmode AttlistDeclaration;
3817     }
3818     } (LITA) {
3819     my $vals;
3820     lang:Perl {
3821 wakaba 1.8 $vals = {nodes => [], value => ''};
3822 wakaba 1.4 }
3823    
3824     &_AttributeValueSpecificationA_ ($doc => $doc, $vals => $vals);
3825    
3826 wakaba 1.8 lang:Perl {
3827     for (@{$vals->{nodes}}) {
3828     $at-><M::Node.appendChild> ($_);
3829     }
3830     }
3831    
3832     ~ (LITA) {
3833 wakaba 1.4 ?lexmode AttlistDeclaration;
3834     } else {
3835     ?lexmode AttlistDeclaration;
3836     }
3837     }
3838     }
3839    
3840     } (LIT) {
3841     my $vals;
3842     lang:Perl {
3843 wakaba 1.8 $at-><AS::ATDef.defaultType> (<C::ATDef.EXPLICIT_DEFAULT>);
3844     $vals = {nodes => [], value => ''};
3845 wakaba 1.4 }
3846    
3847     &_AttributeValueSpecification_ ($doc => $doc, $vals => $vals);
3848    
3849 wakaba 1.8 lang:Perl {
3850     for (@{$vals->{nodes}}) {
3851     $at-><M::Node.appendChild> ($_);
3852     }
3853     }
3854    
3855 wakaba 1.4 ~ (LIT) {
3856     ?lexmode AttlistDeclaration;
3857     } else {
3858     ?lexmode AttlistDeclaration;
3859     }
3860     } (LITA) {
3861     my $vals;
3862     lang:Perl {
3863 wakaba 1.8 $at-><AS::ATDef.defaultType> (<C::ATDef.EXPLICIT_DEFAULT>);
3864     $vals = {nodes => [], value => ''};
3865 wakaba 1.4 }
3866    
3867     &_AttributeValueSpecificationA_ ($doc => $doc, $vals => $vals);
3868    
3869 wakaba 1.8 lang:Perl {
3870     for (@{$vals->{nodes}}) {
3871     $at-><M::Node.appendChild> ($_);
3872     }
3873     }
3874    
3875 wakaba 1.4 ~ (LITA) {
3876     ?lexmode AttlistDeclaration;
3877     } else {
3878     ?lexmode AttlistDeclaration;
3879     }
3880     }
3881    
3882     } (S) : separator : terminator? {
3883     //
3884     }
3885    
3886     ~ (MDC) {
3887     ?lexmode DTD;
3888     } else {
3889     ?lexmode DTD;
3890     }
3891     } // _AttlistDeclaration
3892    
3893 wakaba 1.11 /*
3894 wakaba 1.26 Entity Declaration
3895 wakaba 1.11 */
3896 wakaba 1.4 rule _EntityDeclaration ($doc) {
3897     // ~ (MDO) { }
3898     // ~ (Name == ENTITY) { }
3899    
3900     ~ (S) { }
3901    
3902 wakaba 1.23 my $is_param_entity;
3903 wakaba 1.6 my $decl;
3904 wakaba 1.27 lang:Perl {
3905     $decl = {
3906     name => '#ILLEGAL',
3907     reptxt => \'',
3908     is_external_entity => false,
3909     document_uri => $self->{location}->{document_uri},
3910     base_uri => $self->{location}->{base_uri},
3911     };
3912     }
3913 wakaba 1.6
3914 wakaba 1.4 ~? (PERO) {
3915     ~ (S) { }
3916 wakaba 1.6 lang:Perl {
3917 wakaba 1.23 $is_param_entity = $decl->{is_param_entity} = true;
3918 wakaba 1.6 }
3919 wakaba 1.4 }
3920    
3921 wakaba 1.19 /*
3922     TODO: Set |$decl->{is_externally_declared}| flag
3923     and |Entity.isExternallyDeclared| attribute
3924     for entity declarations in external subset or
3925     in parameter entity.
3926     */
3927    
3928 wakaba 1.4 ~ (Name) {
3929 wakaba 1.6 lang:Perl ($v => $token.value) {
3930 wakaba 1.26 __CODE{checkNCName:: $name => $v}__;
3931 wakaba 1.6 $decl->{name} = $v;
3932     }
3933 wakaba 1.4 }
3934    
3935 wakaba 1.18 my $node;
3936 wakaba 1.11 lang:Perl {
3937 wakaba 1.18 $node =
3938 wakaba 1.11 $decl->{node} = $self->{docx}-><M::DocumentXDoctype.createGeneralEntity>
3939     ($decl->{name});
3940     ## TODO: Parameter entity...
3941     }
3942    
3943 wakaba 1.4 ~ (S) { }
3944    
3945     ~ (LIT) {
3946 wakaba 1.6 &_EntityValue ($doc => $doc, $decl => $decl);
3947 wakaba 1.4 } (LITA) {
3948 wakaba 1.6 &_EntityValueA ($doc => $doc, $decl => $decl);
3949 wakaba 1.4 } (Name == 'PUBLIC') {
3950     ~ (S) { }
3951    
3952 wakaba 1.18 &PubidLiteral ($decl => $node);
3953 wakaba 1.4
3954     ~ (S) { }
3955    
3956 wakaba 1.18 &SystemLiteral ($decl => $node);
3957    
3958     lang:Perl {
3959     $decl->{is_external_entity} = true;
3960     }
3961 wakaba 1.4 } (Name == 'SYSTEM') {
3962     ~ (S) { }
3963    
3964 wakaba 1.18 &SystemLiteral ($decl => $node);
3965    
3966     lang:Perl {
3967     $decl->{is_external_entity} = true;
3968     }
3969 wakaba 1.4 }
3970    
3971     ~? (S) {
3972     ~? (Name == 'NDATA') {
3973 wakaba 1.23 if-true ($is_param_entity) {
3974     lang:Perl : has-error {
3975     my $location;
3976     __CODE{xp|get-location-from-token::
3977     $token => {$token},
3978     $result => {$location},
3979     }__;
3980     my $continue = __DOMCore:ERROR{xp|wf-syntax-error::
3981     xp|error-token => {$token},
3982     c|location => {$location},
3983     }__;
3984     unless ($continue) {
3985 wakaba 1.27 __CODE{ParseError}__;
3986 wakaba 1.23 }
3987     }
3988     }
3989 wakaba 1.4
3990     ~ (S) { }
3991    
3992     ~ (Name) {
3993 wakaba 1.26 lang:Perl ($v => $token.value) : has-error {
3994     __CODE{checkNCName:: $name => $v}__;
3995 wakaba 1.6 $decl->{notation} = $v;
3996 wakaba 1.35 $decl->{node}-><AG::GE.notationName> ($v);
3997 wakaba 1.6 }
3998 wakaba 1.4 }
3999    
4000     ~? (S) { }
4001     }
4002     }
4003    
4004 wakaba 1.24 lang:Perl : has-error {
4005 wakaba 1.6 if ($self->{$decl->{is_param_entity} ? 'param_entity' : 'general_entity'}
4006     ->{$decl->{name}}) {
4007 wakaba 1.24 ## Predefined entity
4008     if (not $decl->{is_param_entity} and
4009     {lt => true, gt => true, amp => true,
4010     quot => true, apos => true}->{$decl->{name}}) {
4011     if ($decl->{is_external_entity}) {
4012     my $location;
4013     __CODE{xp|get-location-from-token::
4014     $token => {$token},
4015     $result => {$location},
4016     }__;
4017     my $continue = __c|ERROR{xp|error-internal-predefined-entity::
4018     xp|error-token => {$token},
4019     c|location => {$location},
4020     xp|name => {$decl->{name}},
4021     }__;
4022     unless ($continue) {
4023 wakaba 1.27 __CODE{ParseError}__;
4024 wakaba 1.24 }
4025     } elsif (
4026     not ({gt => true, apos => true, quot => true}->{$decl->{name}} and
4027     ${$decl->{reptxt}} eq {
4028     gt => '>', apos => "'", quot => '"',
4029     }->{$decl->{name}}) and
4030     not (${$decl->{reptxt}} =~ /\A&#0*@{[{
4031     lt => '60', gt => '62', amp => '38',
4032     apos => '39', quot => '34',
4033     }->{$decl->{name}}]};\z/) and
4034     not (${$decl->{reptxt}} =~ /\A&#x0*(?:(?i)@{[{
4035     lt => '3C', gt => '3E', amp => '26',
4036     apos => '27', quot => '22',
4037     }->{$decl->{name}}]});\z/)
4038     ) {
4039     ## NOTE: See "SuikaWiki - Predefined Entities"
4040     ## "http://suika.fam.cx/gate/2005/sw/%E5%AE%9A%E7%BE%A9%E6%B8%88%E5%AE%9F%E4%BD%93".
4041     my $location;
4042     __CODE{xp|get-location-from-token::
4043     $token => {$token},
4044     $result => {$location},
4045     }__;
4046     my $continue = __c|ERROR{xp|error-malformed-predefined-entity::
4047     xp|error-token => {$token},
4048     c|location => {$location},
4049     xp|name => {$decl->{name}},
4050     xp|replacement-text => {${$decl->{reptxt}}},
4051     }__;
4052     unless ($continue) {
4053 wakaba 1.27 __CODE{ParseError}__;
4054 wakaba 1.24 }
4055     }
4056 wakaba 1.43 $self->{dtdecl}->{<H::mg|node>}->{{
4057 wakaba 1.25 lt => <H::d|hasLtDeclaration>,
4058     gt => <H::d|hasGtDeclaration>,
4059     amp => <H::d|hasAmpDeclaration>,
4060     apos => <H::d|hasAposDeclaration>,
4061     quot => <H::d|hasQuotDeclaration>,
4062     }->{$decl->{name}}} = true;
4063 wakaba 1.24 } else { ## Dupulicating declaration
4064     my $location;
4065     __CODE{xp|get-location-from-token::
4066     $token => {$token},
4067     $result => {$location},
4068     }__;
4069     my $continue = __c|ERROR{xp|warning-entity-declaration-ignored::
4070     xp|error-token => {$token},
4071     c|location => {$location},
4072     xp|name => {$decl->{name}},
4073     }__;
4074     unless ($continue) {
4075 wakaba 1.27 __CODE{ParseError}__;
4076 wakaba 1.24 }
4077     }
4078 wakaba 1.25 } elsif ($self->{dont_process} and not $self->{standalone}) {
4079     ## TODO: |standalone| and parameter entities??
4080     my $location;
4081     __CODE{xp|get-location-from-token::
4082     $token => {$token},
4083     $result => {$location},
4084     }__;
4085     my $continue = __c|ERROR{xp|warning-entity-declaration-not-processed::
4086     xp|error-token => {$token},
4087     c|location => {$location},
4088     xp|name => {$decl->{name}},
4089     }__;
4090     unless ($continue) {
4091 wakaba 1.27 __CODE{ParseError}__;
4092 wakaba 1.25 }
4093 wakaba 1.6 } else {
4094     $self->{$decl->{is_param_entity} ? 'param_entity' : 'general_entity'}
4095     ->{$decl->{name}} = $decl;
4096 wakaba 1.11 $self->{dtdef}-><M::DTDef.setGeneralEntityNode> ($decl->{node})
4097     unless $decl->{is_param_entity};
4098 wakaba 1.6 }
4099     }
4100    
4101 wakaba 1.4 ~ (MDC) {
4102     ?lexmode DTD;
4103     } else {
4104     ?lexmode DTD;
4105     }
4106     } // _EntityDeclaration
4107    
4108 wakaba 1.26 /*
4109     Notation Declaration
4110     */
4111     rule _NotationDeclaration {
4112 wakaba 1.4 // ~ (MDO) { }
4113     // ~ (Name == NOTATION) { }
4114    
4115     ~ (S) { }
4116    
4117 wakaba 1.26 my $name;
4118 wakaba 1.4 ~ (Name) {
4119 wakaba 1.26 lang:Perl ($v => $token.value) : has-error {
4120     __CODE{checkNCName:: $name => $v}__;
4121     $name = $v;
4122     }
4123     } else {
4124     lang:Perl {
4125     $name = '#INVALID';
4126     }
4127     }
4128 wakaba 1.4
4129     ~ (S) { }
4130    
4131 wakaba 1.17 lang:Perl {
4132 wakaba 1.26 $decl = $self->{docx}-><M::DocumentXDoctype.createNotation> ($name);
4133 wakaba 1.17 }
4134    
4135 wakaba 1.4 ~ (Name == 'PUBLIC') {
4136     ~ (S) { }
4137    
4138 wakaba 1.17 &PubidLiteral ($decl => $decl);
4139 wakaba 1.4
4140     ~? (S) {
4141     ~? (LIT) {
4142     ?lexmode SystemLiteral;
4143 wakaba 1.17 &_SystemLiteral ($decl => $decl);
4144 wakaba 1.4
4145     ~? (S) { }
4146     } (LITA) {
4147     ?lexmode SystemLiteralA;
4148 wakaba 1.17 &_SystemLiteral ($decl => $decl);
4149 wakaba 1.4
4150     ~? (S) { }
4151     }
4152     }
4153     } (Name == 'SYSTEM') {
4154     ~ (S) { }
4155    
4156 wakaba 1.17 &SystemLiteral ($decl => $decl);
4157 wakaba 1.4
4158     ~? (S) { }
4159     }
4160    
4161 wakaba 1.26 lang:Perl : has-error {
4162     if ($self->{dtdef}-><M::DTDef.getNotationNode> ($name)) {
4163     ## Dupulication
4164     my $location;
4165     __CODE{xp|get-location-from-token::
4166     $token => {$token},
4167     $result => {$location},
4168     }__;
4169     my $continue = __c|ERROR{xp|vc-unique-notation-name::
4170     xp|error-token => {$token},
4171     c|location => {$location},
4172     xp|name => {$name},
4173     }__;
4174     unless ($continue) {
4175 wakaba 1.27 __CODE{ParseError}__;
4176 wakaba 1.26 }
4177     } else {
4178     $self->{dtdef}-><M::DTDef.setNotationNode> ($decl);
4179     }
4180     }
4181    
4182 wakaba 1.4 ~ (MDC) {
4183     ?lexmode DTD;
4184     } else {
4185     ?lexmode DTD;
4186     }
4187     } // _NotationDeclaration
4188    
4189 wakaba 1.11 rule _EntityValue ($decl) {
4190 wakaba 1.4 ?lexmode EntityValue;
4191    
4192     my $vals;
4193 wakaba 1.6 my $reptxt;
4194 wakaba 1.4 lang:Perl {
4195     $vals = [];
4196 wakaba 1.6 $reptxt = '';
4197 wakaba 1.4 }
4198    
4199     ~* (STRING) {
4200 wakaba 1.6 lang:Perl ($v => $token.value) {
4201     $reptxt .= $v;
4202     }
4203 wakaba 1.4 } (PERO) {
4204 wakaba 1.25 ?lexmode EntityReference;
4205 wakaba 1.19
4206     lang:Perl {
4207     $self->{has_xref} = true;
4208 wakaba 1.25 $self->{dont_process} = true;
4209 wakaba 1.19 }
4210 wakaba 1.6
4211     // TODO: Expand or wferror if internal subset
4212 wakaba 1.4
4213     ~ (Name) {
4214    
4215 wakaba 1.25 // Note that external subset and parameter entities are not supported
4216     lang:Perl ($name => $token.value) : has-error {
4217 wakaba 1.26 __CODE{checkNCName:: $name => $name}__;
4218 wakaba 1.25 my $location;
4219     __CODE{xp|get-location-from-token::
4220     $token => {$token},
4221     $result => {$location},
4222     }__;
4223     my $continue = __c|ERROR{xp|wf-pes-in-internal-subset::
4224     xp|error-token => {$token},
4225     c|location => {$location},
4226     xp|name => {$name},
4227     }__;
4228     unless ($continue) {
4229 wakaba 1.27 __CODE{ParseError}__;
4230 wakaba 1.25 }
4231     }
4232 wakaba 1.4 }
4233    
4234     ~ (REFC) {
4235     ?lexmode EntityValue;
4236     } else {
4237     ?lexmode EntityValue;
4238     }
4239     } (HCRO) {
4240 wakaba 1.11 &_HexadecimalCharacterReferenceEV_ ($vals => $vals);
4241 wakaba 1.4
4242 wakaba 1.6 lang:Perl {
4243 wakaba 1.11 $reptxt .= $vals->[-1];
4244 wakaba 1.6 }
4245    
4246 wakaba 1.4 ~ (REFC) {
4247     ?lexmode EntityValue;
4248     } else {
4249     ?lexmode EntityValue;
4250     }
4251     } (CRO) {
4252 wakaba 1.11 &_NumericCharacterReferenceEV_ ($vals => $vals);
4253 wakaba 1.6
4254     lang:Perl {
4255 wakaba 1.11 $reptxt .= $vals->[-1];
4256 wakaba 1.6 }
4257 wakaba 1.4
4258     ~ (REFC) {
4259     ?lexmode EntityValue;
4260     } else {
4261     ?lexmode EntityValue;
4262     }
4263     } (ERO) {
4264 wakaba 1.11 &_GeneralEntityReferenceEV_ ($vals => $vals);
4265 wakaba 1.4
4266 wakaba 1.6 lang:Perl {
4267 wakaba 1.11 $reptxt .= '&' . $vals->[-1] . ';';
4268 wakaba 1.6 }
4269    
4270 wakaba 1.4 ~ (REFC) {
4271     ?lexmode EntityValue;
4272     } else {
4273     ?lexmode EntityValue;
4274     }
4275     }
4276    
4277     ~ (LIT) {
4278     ?lexmode MarkupDeclaration;
4279     } (LITA) {
4280     ?lexmode MarkupDeclaration;
4281     } else {
4282     ?lexmode MarkupDeclaration;
4283     }
4284 wakaba 1.6
4285     lang:Perl {
4286     $decl->{reptxt} = \$reptxt;
4287 wakaba 1.19 $decl->{has_replacement_text} = true;
4288 wakaba 1.6 }
4289 wakaba 1.4 } // _EntityValue
4290    
4291 wakaba 1.11 rule _EntityValueA ($decl) {
4292 wakaba 1.4 ?lexmode EntityValueA;
4293    
4294     my $vals;
4295 wakaba 1.6 my $reptxt;
4296 wakaba 1.4 lang:Perl {
4297     $vals = [];
4298 wakaba 1.6 $reptxt = '';
4299 wakaba 1.4 }
4300    
4301     ~* (STRING) {
4302 wakaba 1.6 lang:Perl ($v => $token.value) {
4303     $reptxt .= $v;
4304     }
4305 wakaba 1.4 } (PERO) {
4306 wakaba 1.25 ?lexmode EntityReference;
4307 wakaba 1.4
4308 wakaba 1.19 lang:Perl {
4309     $self->{has_xref} = true;
4310 wakaba 1.25 $self->{dont_process} = true;
4311 wakaba 1.19 }
4312    
4313 wakaba 1.6 // TODO: implement this
4314 wakaba 1.4 ~ (Name) {
4315    
4316 wakaba 1.25 // Note that external subset and parameter entities are not supported
4317     lang:Perl ($name => $token.value) : has-error {
4318 wakaba 1.26 __CODE{checkNCName:: $name => $name}__;
4319 wakaba 1.25 my $location;
4320     __CODE{xp|get-location-from-token::
4321     $token => {$token},
4322     $result => {$location},
4323     }__;
4324     my $continue = __c|ERROR{xp|wf-pes-in-internal-subset::
4325     xp|error-token => {$token},
4326     c|location => {$location},
4327     xp|name => {$name},
4328     }__;
4329     unless ($continue) {
4330 wakaba 1.27 __CODE{ParseError}__;
4331 wakaba 1.25 }
4332     }
4333 wakaba 1.4 }
4334    
4335     ~ (REFC) {
4336     ?lexmode EntityValueA;
4337     } else {
4338     ?lexmode EntityValueA;
4339     }
4340     } (HCRO) {
4341 wakaba 1.11 &_HexadecimalCharacterReferenceEV_ ($vals => $vals);
4342 wakaba 1.4
4343 wakaba 1.6 lang:Perl {
4344 wakaba 1.11 $reptxt .= $vals->[-1];
4345 wakaba 1.6 }
4346    
4347    
4348 wakaba 1.4 ~ (REFC) {
4349     ?lexmode EntityValueA;
4350     } else {
4351     ?lexmode EntityValueA;
4352     }
4353     } (CRO) {
4354 wakaba 1.11 &_NumericCharacterReferenceEV_ ($vals => $vals);
4355 wakaba 1.4
4356 wakaba 1.6 lang:Perl {
4357 wakaba 1.11 $reptxt .= $vals->[-1];
4358 wakaba 1.6 }
4359    
4360 wakaba 1.4 ~ (REFC) {
4361     ?lexmode EntityValueA;
4362     } else {
4363     ?lexmode EntityValueA;
4364     }
4365     } (ERO) {
4366 wakaba 1.11 &_GeneralEntityReferenceEV_ ($vals => $vals);
4367 wakaba 1.4
4368 wakaba 1.6 lang:Perl {
4369 wakaba 1.11 $reptxt .= '&' . $vals->[-1] . ';';
4370 wakaba 1.6 }
4371    
4372 wakaba 1.4 ~ (REFC) {
4373     ?lexmode EntityValueA;
4374     } else {
4375     ?lexmode EntityValueA;
4376     }
4377     }
4378    
4379     ~ (LITA) {
4380     ?lexmode MarkupDeclaration;
4381     } else {
4382     ?lexmode MarkupDeclaration;
4383     }
4384 wakaba 1.6
4385     lang:Perl {
4386     $decl->{reptxt} = \$reptxt;
4387 wakaba 1.19 $decl->{has_replacement_text} = true;
4388 wakaba 1.6 }
4389 wakaba 1.4 } // _EntityValueA
4390    
4391    
4392     /*
4393     XML Name
4394     */
4395     lexmode NameChar {
4396     $NameStartChar10 := [
4397     '_' ':'
4398     // Letter
4399     // BaseChar
4400     U+0041..U+005A U+0061..U+007A U+00C0..U+00D6
4401     U+00D8..U+00F6 U+00F8..U+00FF U+0100..U+0131
4402     U+0134..U+013E U+0141..U+0148 U+014A..U+017E
4403     U+0180..U+01C3 U+01CD..U+01F0 U+01F4..U+01F5
4404     U+01FA..U+0217 U+0250..U+02A8 U+02BB..U+02C1
4405     U+0386 U+0388..U+038A U+038C U+038E..U+03A1
4406     U+03A3..U+03CE U+03D0..U+03D6 U+03DA U+03DC
4407     U+03DE U+03E0 U+03E2..U+03F3 U+0401..U+040C
4408     U+040E..U+044F U+0451..U+045C U+045E..U+0481
4409     U+0490..U+04C4 U+04C7..U+04C8 U+04CB..U+04CC
4410     U+04D0..U+04EB U+04EE..U+04F5 U+04F8..U+04F9
4411     U+0531..U+0556 U+0559 U+0561..U+0586
4412     U+05D0..U+05EA U+05F0..U+05F2 U+0621..U+063A
4413     U+0641..U+064A U+0671..U+06B7 U+06BA..U+06BE
4414     U+06C0..U+06CE U+06D0..U+06D3 U+06D5
4415     U+06E5..U+06E6 U+0905..U+0939 U+093D
4416     U+0958..U+0961 U+0985..U+098C U+098F..U+0990
4417     U+0993..U+09A8 U+09AA..U+09B0 U+09B2
4418     U+09B6..U+09B9 U+09DC..U+09DD U+09DF..U+09E1
4419     U+09F0..U+09F1 U+0A05..U+0A0A U+0A0F..U+0A10
4420     U+0A13..U+0A28 U+0A2A..U+0A30 U+0A32..U+0A33
4421     U+0A35..U+0A36 U+0A38..U+0A39 U+0A59..U+0A5C
4422     U+0A5E U+0A72..U+0A74 U+0A85..U+0A8B U+0A8D
4423     U+0A8F..U+0A91 U+0A93..U+0AA8 U+0AAA..U+0AB0
4424     U+0AB2..U+0AB3 U+0AB5..U+0AB9 U+0ABD U+0AE0
4425     U+0B05..U+0B0C U+0B0F..U+0B10 U+0B13..U+0B28
4426     U+0B2A..U+0B30 U+0B32..U+0B33 U+0B36..U+0B39
4427     U+0B3D U+0B5C..U+0B5D U+0B5F..U+0B61
4428     U+0B85..U+0B8A U+0B8E..U+0B90 U+0B92..U+0B95
4429     U+0B99..U+0B9A U+0B9C U+0B9E..U+0B9F
4430     U+0BA3..U+0BA4 U+0BA8..U+0BAA U+0BAE..U+0BB5
4431     U+0BB7..U+0BB9 U+0C05..U+0C0C U+0C0E..U+0C10
4432     U+0C12..U+0C28 U+0C2A..U+0C33 U+0C35..U+0C39
4433     U+0C60..U+0C61 U+0C85..U+0C8C U+0C8E..U+0C90
4434     U+0C92..U+0CA8 U+0CAA..U+0CB3 U+0CB5..U+0CB9
4435     U+0CDE U+0CE0..U+0CE1 U+0D05..U+0D0C
4436     U+0D0E..U+0D10 U+0D12..U+0D28 U+0D2A..U+0D39
4437     U+0D60..U+0D61 U+0E01..U+0E2E U+0E30
4438     U+0E32..U+0E33 U+0E40..U+0E45 U+0E81..U+0E82
4439     U+0E84 U+0E87..U+0E88 U+0E8A U+0E8D
4440     U+0E94..U+0E97 U+0E99..U+0E9F U+0EA1..U+0EA3
4441     U+0EA5 U+0EA7 U+0EAA..U+0EAB U+0EAD..U+0EAE
4442     U+0EB0 U+0EB2..U+0EB3 U+0EBD U+0EC0..U+0EC4
4443     U+0F40..U+0F47 U+0F49..U+0F69 U+10A0..U+10C5
4444     U+10D0..U+10F6 U+1100 U+1102..U+1103
4445     U+1105..U+1107 U+1109 U+110B..U+110C
4446     U+110E..U+1112 U+113C U+113E U+1140 U+114C
4447     U+114E U+1150 U+1154..U+1155 U+1159
4448     U+115F..U+1161 U+1163 U+1165 U+1167 U+1169
4449     U+116D..U+116E U+1172..U+1173 U+1175 U+119E
4450     U+11A8 U+11AB U+11AE..U+11AF U+11B7..U+11B8
4451     U+11BA U+11BC..U+11C2 U+11EB U+11F0 U+11F9
4452     U+1E00..U+1E9B U+1EA0..U+1EF9 U+1F00..U+1F15
4453     U+1F18..U+1F1D U+1F20..U+1F45 U+1F48..U+1F4D
4454     U+1F50..U+1F57 U+1F59 U+1F5B U+1F5D
4455     U+1F5F..U+1F7D U+1F80..U+1FB4 U+1FB6..U+1FBC
4456     U+1FBE U+1FC2..U+1FC4 U+1FC6..U+1FCC
4457     U+1FD0..U+1FD3 U+1FD6..U+1FDB U+1FE0..U+1FEC
4458     U+1FF2..U+1FF4 U+1FF6..U+1FFC U+2126
4459     U+212A..U+212B U+212E U+2180..U+2182
4460     U+3041..U+3094 U+30A1..U+30FA U+3105..U+312C
4461     U+AC00..U+D7A3
4462     // Ideographic
4463     U+4E00..U+9FA5 U+3007 U+3021..U+3029
4464     ];
4465     $NameChar10 := [
4466     '.' '-' '_' ':'
4467     // Letter
4468     // BaseChar
4469     U+0041..U+005A U+0061..U+007A U+00C0..U+00D6
4470     U+00D8..U+00F6 U+00F8..U+00FF U+0100..U+0131
4471     U+0134..U+013E U+0141..U+0148 U+014A..U+017E
4472     U+0180..U+01C3 U+01CD..U+01F0 U+01F4..U+01F5
4473     U+01FA..U+0217 U+0250..U+02A8 U+02BB..U+02C1
4474     U+0386 U+0388..U+038A U+038C U+038E..U+03A1
4475     U+03A3..U+03CE U+03D0..U+03D6 U+03DA U+03DC
4476     U+03DE U+03E0 U+03E2..U+03F3 U+0401..U+040C
4477     U+040E..U+044F U+0451..U+045C U+045E..U+0481
4478     U+0490..U+04C4 U+04C7..U+04C8 U+04CB..U+04CC
4479     U+04D0..U+04EB U+04EE..U+04F5 U+04F8..U+04F9
4480     U+0531..U+0556 U+0559 U+0561..U+0586
4481     U+05D0..U+05EA U+05F0..U+05F2 U+0621..U+063A
4482     U+0641..U+064A U+0671..U+06B7 U+06BA..U+06BE
4483     U+06C0..U+06CE U+06D0..U+06D3 U+06D5
4484     U+06E5..U+06E6 U+0905..U+0939 U+093D
4485     U+0958..U+0961 U+0985..U+098C U+098F..U+0990
4486     U+0993..U+09A8 U+09AA..U+09B0 U+09B2
4487     U+09B6..U+09B9 U+09DC..U+09DD U+09DF..U+09E1
4488     U+09F0..U+09F1 U+0A05..U+0A0A U+0A0F..U+0A10
4489     U+0A13..U+0A28 U+0A2A..U+0A30 U+0A32..U+0A33
4490     U+0A35..U+0A36 U+0A38..U+0A39 U+0A59..U+0A5C
4491     U+0A5E U+0A72..U+0A74 U+0A85..U+0A8B U+0A8D
4492     U+0A8F..U+0A91 U+0A93..U+0AA8 U+0AAA..U+0AB0
4493     U+0AB2..U+0AB3 U+0AB5..U+0AB9 U+0ABD U+0AE0
4494     U+0B05..U+0B0C U+0B0F..U+0B10 U+0B13..U+0B28
4495     U+0B2A..U+0B30 U+0B32..U+0B33 U+0B36..U+0B39
4496     U+0B3D U+0B5C..U+0B5D U+0B5F..U+0B61
4497     U+0B85..U+0B8A U+0B8E..U+0B90 U+0B92..U+0B95
4498     U+0B99..U+0B9A U+0B9C U+0B9E..U+0B9F
4499     U+0BA3..U+0BA4 U+0BA8..U+0BAA U+0BAE..U+0BB5
4500     U+0BB7..U+0BB9 U+0C05..U+0C0C U+0C0E..U+0C10
4501     U+0C12..U+0C28 U+0C2A..U+0C33 U+0C35..U+0C39
4502     U+0C60..U+0C61 U+0C85..U+0C8C U+0C8E..U+0C90
4503     U+0C92..U+0CA8 U+0CAA..U+0CB3 U+0CB5..U+0CB9
4504     U+0CDE U+0CE0..U+0CE1 U+0D05..U+0D0C
4505     U+0D0E..U+0D10 U+0D12..U+0D28 U+0D2A..U+0D39
4506     U+0D60..U+0D61 U+0E01..U+0E2E U+0E30
4507     U+0E32..U+0E33 U+0E40..U+0E45 U+0E81..U+0E82
4508     U+0E84 U+0E87..U+0E88 U+0E8A U+0E8D
4509     U+0E94..U+0E97 U+0E99..U+0E9F U+0EA1..U+0EA3
4510     U+0EA5 U+0EA7 U+0EAA..U+0EAB U+0EAD..U+0EAE
4511     U+0EB0 U+0EB2..U+0EB3 U+0EBD U+0EC0..U+0EC4
4512     U+0F40..U+0F47 U+0F49..U+0F69 U+10A0..U+10C5
4513     U+10D0..U+10F6 U+1100 U+1102..U+1103
4514     U+1105..U+1107 U+1109 U+110B..U+110C
4515     U+110E..U+1112 U+113C U+113E U+1140 U+114C
4516     U+114E U+1150 U+1154..U+1155 U+1159
4517     U+115F..U+1161 U+1163 U+1165 U+1167 U+1169
4518     U+116D..U+116E U+1172..U+1173 U+1175 U+119E
4519     U+11A8 U+11AB U+11AE..U+11AF U+11B7..U+11B8
4520     U+11BA U+11BC..U+11C2 U+11EB U+11F0 U+11F9
4521     U+1E00..U+1E9B U+1EA0..U+1EF9 U+1F00..U+1F15
4522     U+1F18..U+1F1D U+1F20..U+1F45 U+1F48..U+1F4D
4523     U+1F50..U+1F57 U+1F59 U+1F5B U+1F5D
4524     U+1F5F..U+1F7D U+1F80..U+1FB4 U+1FB6..U+1FBC
4525     U+1FBE U+1FC2..U+1FC4 U+1FC6..U+1FCC
4526     U+1FD0..U+1FD3 U+1FD6..U+1FDB U+1FE0..U+1FEC
4527     U+1FF2..U+1FF4 U+1FF6..U+1FFC U+2126
4528     U+212A..U+212B U+212E U+2180..U+2182
4529     U+3041..U+3094 U+30A1..U+30FA U+3105..U+312C
4530     U+AC00..U+D7A3
4531     // Ideographic
4532     U+4E00..U+9FA5 U+3007 U+3021..U+3029
4533     // Digit
4534     U+0030..U+0039 U+0660..U+0669 U+06F0..U+06F9
4535     U+0966..U+096F U+09E6..U+09EF U+0A66..U+0A6F
4536     U+0AE6..U+0AEF U+0B66..U+0B6F U+0BE7..U+0BEF
4537     U+0C66..U+0C6F U+0CE6..U+0CEF U+0D66..U+0D6F
4538     U+0E50..U+0E59 U+0ED0..U+0ED9 U+0F20..U+0F29
4539     // CombiningChar
4540     U+0300..U+0345 U+0360..U+0361 U+0483..U+0486
4541     U+0591..U+05A1 U+05A3..U+05B9 U+05BB..U+05BD
4542     U+05BF U+05C1..U+05C2 U+05C4 U+064B..U+0652
4543     U+0670 U+06D6..U+06DC U+06DD..U+06DF
4544     U+06E0..U+06E4 U+06E7..U+06E8 U+06EA..U+06ED
4545     U+0901..U+0903 U+093C U+093E..U+094C U+094D
4546     U+0951..U+0954 U+0962..U+0963 U+0981..U+0983
4547     U+09BC U+09BE U+09BF U+09C0..U+09C4
4548     U+09C7..U+09C8 U+09CB..U+09CD U+09D7
4549     U+09E2..U+09E3 U+0A02 U+0A3C U+0A3E U+0A3F
4550     U+0A40..U+0A42 U+0A47..U+0A48 U+0A4B..U+0A4D
4551     U+0A70..U+0A71 U+0A81..U+0A83 U+0ABC
4552     U+0ABE..U+0AC5 U+0AC7..U+0AC9 U+0ACB..U+0ACD
4553     U+0B01..U+0B03 U+0B3C U+0B3E..U+0B43
4554     U+0B47..U+0B48 U+0B4B..U+0B4D U+0B56..U+0B57
4555     U+0B82..U+0B83 U+0BBE..U+0BC2 U+0BC6..U+0BC8
4556     U+0BCA..U+0BCD U+0BD7 U+0C01..U+0C03
4557     U+0C3E..U+0C44 U+0C46..U+0C48 U+0C4A..U+0C4D
4558     U+0C55..U+0C56 U+0C82..U+0C83 U+0CBE..U+0CC4
4559     U+0CC6..U+0CC8 U+0CCA..U+0CCD U+0CD5..U+0CD6
4560     U+0D02..U+0D03 U+0D3E..U+0D43 U+0D46..U+0D48
4561     U+0D4A..U+0D4D U+0D57 U+0E31 U+0E34..U+0E3A
4562     U+0E47..U+0E4E U+0EB1 U+0EB4..U+0EB9
4563     U+0EBB..U+0EBC U+0EC8..U+0ECD U+0F18..U+0F19
4564     U+0F35 U+0F37 U+0F39 U+0F3E U+0F3F
4565     U+0F71..U+0F84 U+0F86..U+0F8B U+0F90..U+0F95
4566     U+0F97 U+0F99..U+0FAD U+0FB1..U+0FB7 U+0FB9
4567     U+20D0..U+20DC U+20E1 U+302A..U+302F U+3099
4568     U+309A
4569     // Extender
4570     U+00B7 U+02D0 U+02D1 U+0387 U+0640 U+0E46
4571     U+0EC6 U+3005 U+3031..U+3035 U+309D..U+309E
4572     U+30FC..U+30FE
4573     ];
4574 wakaba 1.1
4575     $NameStartChar11 := [
4576     ':' '_'
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     'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm'
4580     'n' 'o' 'p' 'q' 'r' 's' 't' 'u' 'v' 'w' 'x' 'y' 'z'
4581     U+00C0..U+00D6 U+00D8..U+00F6 U+00F8..U+02FF
4582     U+0370..U+037D U+037F..U+1FFF U+200C..U+200D
4583     U+2070..U+218F U+2C00..U+2FEF U+3001..U+D7FF
4584     U+F900..U+FDCF U+FDF0..U+FFFD U+10000..U+EFFFF
4585     ];
4586     $NameChar11 := [
4587     '-' '.' '0' '1' '2' '3' '4' '5' '6' '7' '8' '9'
4588     U+00B7 U+0300..U+036F U+203F..U+2040
4589     // NameStartChar
4590     ':' '_'
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     'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm'
4594     'n' 'o' 'p' 'q' 'r' 's' 't' 'u' 'v' 'w' 'x' 'y' 'z'
4595     U+00C0..U+00D6 U+00D8..U+00F6 U+00F8..U+02FF
4596     U+0370..U+037D U+037F..U+1FFF U+200C..U+200D
4597     U+2070..U+218F U+2C00..U+2FEF U+3001..U+D7FF
4598     U+F900..U+FDCF U+FDF0..U+FFFD U+10000..U+EFFFF
4599     ];
4600 wakaba 1.4 } // NameChar
4601    
4602     lexmode Name
4603     : extends => 'NameChar'
4604     {
4605 wakaba 1.1 Name : value := $NameStartChar11 $NameChar11*;
4606     } // Name
4607 wakaba 1.4
4608     lexmode Nmtoken
4609     : extends => 'NameChar'
4610     {
4611     Nmtoken : value := $NameChar11*;
4612     } // Nmtoken
4613 wakaba 1.1
4614     /*
4615 wakaba 1.14 S
4616 wakaba 1.1 */
4617     lexmode S {
4618 wakaba 1.14 $s := [U+0009 U+000A U+000D U+0020];
4619     S := $s+;
4620 wakaba 1.1 } // S
4621    
4622     /*
4623     Document end scanning mode
4624     */
4625     lexmode DocumentEnd
4626     : standalone
4627     : extends => 'S'
4628     {
4629     /*
4630     Processing instruction
4631     */
4632     PIO := ['<'] ['?'];
4633    
4634     /*
4635     Comment declaration
4636     */
4637     CDO := ['<'] ['!'] ['-'] ['-'];
4638     } // DocumentEnd
4639    
4640     /*
4641     Document misc scanning mode
4642    
4643     This mode scans |Misc| constructions as well
4644     as document element's start tag.
4645     */
4646     lexmode DocumentMisc
4647     : standalone
4648     : extends => 'DocumentEnd'
4649     {
4650     /*
4651     Document element start tag
4652     */
4653     STAGO := ['<'];
4654     } // DocumentMisc
4655    
4656     /*
4657     Document prolog scanning mode
4658     */
4659     lexmode DocumentProlog
4660     : standalone
4661     : extends => 'DocumentMisc'
4662     {
4663     /*
4664     |DOCTYPE| declaration
4665     */
4666     MDO := ['<'] ['!'];
4667     } // DocumentProlog
4668 wakaba 1.16
4669 wakaba 1.1 /*
4670 wakaba 1.16 Document Start Scanning Mode
4671 wakaba 1.1 */
4672     lexmode DocumentStart
4673     : standalone
4674     : extends => 'DocumentProlog'
4675     {
4676     /*
4677     XML declaration
4678     */
4679 wakaba 1.16 XDO := ['<'] ['?'] ['x'] ['m'] ['l'];
4680 wakaba 1.1 } // DocumentStart
4681    
4682     /*
4683     Comment declaration scanning mode
4684     */
4685     lexmode CommentDeclaration
4686     : standalone
4687     {
4688     /*
4689     Comment close
4690     */
4691     COM := ['-'] ['-'];
4692    
4693     /*
4694     Comment data
4695     */
4696 wakaba 1.15 ?default-token STRING : value;
4697 wakaba 1.1 } // CommentDeclaration
4698    
4699     /*
4700     Processing instruction name and |S| scanning mode
4701     */
4702     lexmode PIName
4703     : standalone
4704     : extends => 'Name'
4705     : extends => 'S'
4706     {
4707     /*
4708     Processing instruction close
4709     */
4710     PIC := ['?'] ['>'];
4711     } // PIName
4712    
4713     /*
4714 wakaba 1.16 Processing instruction name and |S| scanning mode
4715     */
4716     lexmode PINmtoken
4717     : standalone
4718     : extends => 'Nmtoken'
4719     : extends => 'S'
4720     {
4721     /*
4722     Processing instruction close
4723     */
4724     PIC := ['?'] ['>'];
4725     } // PINmtoken
4726    
4727     /*
4728 wakaba 1.1 Processing instruction data scanning mode
4729     */
4730     lexmode PIData
4731     : standalone
4732     {
4733     /*
4734     Processing instruction close
4735     */
4736     PIC := ['?'] ['>'];
4737    
4738     /*
4739     Processing instruction target data
4740     */
4741 wakaba 1.2 ?default-token DATA : value;
4742 wakaba 1.1 } // PIData
4743    
4744     /*
4745     Content of element scanning mode
4746     */
4747     lexmode ElementContent
4748     : standalone
4749     {
4750     /*
4751     Start tag open
4752     */
4753     STAGO := ['<'];
4754    
4755     /*
4756     End tag open
4757     */
4758     ETAGO := ['<'] ['/'];
4759    
4760     /*
4761     Hexadecimal character reference open
4762     */
4763     HCRO := ['&'] ['#'] ['x'];
4764    
4765     /*
4766     Numeric character reference open
4767     */
4768     CRO := ['&'] ['#'];
4769    
4770     /*
4771     General entity reference open
4772     */
4773     ERO := ['&'];
4774    
4775     /*
4776     Comment declaration open
4777     */
4778     CDO := ['<'] ['!'] ['-'] ['-'];
4779    
4780     /*
4781     CDATA section open
4782     */
4783     CDSO := ['<'] ['!'] ['[']
4784     ['C'] ['D'] ['A'] ['T'] ['A'] ['['];
4785    
4786     /*
4787     Processing instruction open
4788     */
4789     PIO := ['<'] ['?'];
4790 wakaba 1.2
4791     /*
4792     Markup section end
4793     */
4794     MSE := [']'] [']'] ['>'];
4795    
4796     /*
4797     Character data
4798     */
4799     /*
4800     Character data and/or |MSE|
4801     */
4802     ?default-token CharData : value;
4803 wakaba 1.1 } // ElementContent
4804    
4805     /*
4806     CDATA section content scanning mode
4807     */
4808     lexmode CDATASectionContent
4809     : standalone
4810     {
4811     /*
4812     Markup section end
4813     */
4814     MSE := [']'] [']'] ['>'];
4815    
4816     /*
4817     Character data
4818 wakaba 1.2 */
4819     ?default-token CData : value;
4820 wakaba 1.1 } // CDATASectionContent
4821    
4822     lexmode EntityReference
4823     : standalone
4824     : extends => 'Name'
4825     {
4826     /*
4827     Reference close
4828     */
4829     REFC := [';'];
4830     } // EntityReference
4831    
4832     lexmode NumericCharacterReference
4833     : standalone
4834     {
4835     /*
4836     Decimal number
4837     */
4838     $digit := ['0' '1' '2' '3' '4' '5' '6' '7' '8' '9'];
4839     NUMBER : value := $digit+;
4840    
4841     /*
4842     Reference close
4843     */
4844     REFC := [';'];
4845     } // NumericCharacterReference
4846    
4847     lexmode HexadecimalCharacterReference
4848     : standalone
4849     {
4850     /*
4851     Hexadecimal number
4852     */
4853     $hexdigit := ['0' '1' '2' '3' '4' '5' '6' '7' '8' '9'
4854     'A' 'B' 'C' 'D' 'E' 'F'
4855     'a' 'b' 'c' 'd' 'e' 'f'];
4856     Hex : value := $hexdigit+;
4857    
4858     /*
4859     Reference close
4860     */
4861     REFC := [';'];
4862     } // HexadecimalCharacterReference
4863    
4864 wakaba 1.16 /*
4865     The XML Declaration and Text Declaration Scanning Mode
4866     */
4867 wakaba 1.3 lexmode XMLDeclaration
4868     : standalone
4869     : extends => 'Name'
4870     : extends => 'S'
4871     {
4872    
4873     /*
4874     Value indicator
4875     */
4876     VI := ['='];
4877    
4878     /*
4879     Literal open
4880     */
4881     LIT := ['"'];
4882     LITA := [U+0027];
4883    
4884     /*
4885     Processing instruction close
4886 wakaba 1.16
4887     The |PIC|, i.e. |?>|, is split into two tokens |PIC1| and |PIC2|
4888     in this scanning mode to set |no_xml11_eol| flag in the
4889     |_XMLDeclaration_| |rule|.
4890 wakaba 1.3 */
4891 wakaba 1.16 PIC1 := ['?'];
4892     PIC2 := ['>'];
4893 wakaba 1.3 } // XMLDeclaration
4894 wakaba 1.16
4895     /*
4896     The XML Declaration or Processing Instruction Scanning Mode
4897    
4898     '<?xml' S ...
4899     (DocumentStart) (XMLDeclarationOrPI) (XMLDeclaration)
4900     '<?xml' '1' S ...
4901     (DocumentStart) (XMLDeclarationOrPI) (PINmtoken)(PIName) (PITarget)
4902     '<?xml' '-' 'stylesheet' S ...
4903     (DocumentStart) (XMLDeclarationOrPI) (PINmtoken) (PIName) (PITarget)
4904     */
4905     lexmode XMLDeclarationOrPI
4906     : standalone
4907     : extends => 'NameChar'
4908     : extends => 'S'
4909     {
4910     NameChar : value := $NameChar11;
4911     } // XMLDeclarationOrPI
4912 wakaba 1.3
4913 wakaba 1.1 lexmode StartTag
4914     : standalone
4915     : extends => 'Name'
4916     : extends => 'S'
4917     {
4918    
4919     /*
4920     Value indicator
4921     */
4922     VI := ['='];
4923    
4924     /*
4925     Literal open
4926     */
4927     LIT := ['"'];
4928     LITA := [U+0027];
4929    
4930     /*
4931     Tag close
4932     */
4933     TAGC := ['>'];
4934    
4935     /*
4936 wakaba 1.6 Null end-tag enabled start-tag close
4937 wakaba 1.1 */
4938 wakaba 1.6 NESTC := ['/'];
4939 wakaba 1.1 } // StartTag
4940    
4941     lexmode EndTag
4942     : standalone
4943     : extends => 'Name'
4944     : extends => 'S'
4945     {
4946     /*
4947     Tag close
4948     */
4949     TAGC := ['>'];
4950     } // EndTag
4951    
4952     lexmode AttributeValueLiteral_ {
4953     ERO := ['&'];
4954     CRO := ['&'] ['#'];
4955     HCRO := ['&'] ['#'] ['x'];
4956     } // AttributeValueLiteral_
4957    
4958     lexmode AttributeValueLiteral
4959     : standalone
4960     : extends => 'AttributeValueLiteral_'
4961     {
4962     LIT := ['"'];
4963 wakaba 1.3 STRING : value := [^'"' '&' '<']+;
4964 wakaba 1.1 } // AttributeValueLiteral
4965    
4966     lexmode AttributeValueLiteralA
4967     : standalone
4968     : extends => 'AttributeValueLiteral_'
4969     {
4970 wakaba 1.4 LITA := [U+0027];
4971 wakaba 1.3 STRING : value := [^U+0027 '&' '<']+;
4972 wakaba 1.1 } // AttributeValueLiteralA
4973 wakaba 1.11
4974     lexmode AttributeValueLiteralE
4975     : standalone
4976     : extends => 'AttributeValueLiteral_'
4977     {
4978     STRING : value := [^'&' '<']+;
4979     } // AttributeValueLiteralE
4980 wakaba 1.4
4981     lexmode EntityValue_ {
4982     PERO := ['%'];
4983     ERO := ['&'];
4984     CRO := ['&'] ['#'];
4985     HCRO := ['&'] ['#'] ['x'];
4986     } // EntityValue_
4987    
4988     lexmode EntityValue
4989     : standalone
4990     : extends => 'EntityValue_'
4991     {
4992     LIT := ['"'];
4993     STRING : value := [^'"' '&' '%']+;
4994     } // EntityValue
4995    
4996     lexmode EntityValueA
4997     : standalone
4998     : extends => 'EntityValue_'
4999     {
5000     LITA := [U+0027];
5001     STRING : value := [^U+0027 '&' '%']+;
5002     } // EntityValueA
5003    
5004     lexmode SystemLiteral
5005     : standalone
5006     {
5007     LIT := ['"'];
5008     ?default-token STRING : value;
5009     } // SystemLiteral
5010    
5011     lexmode SystemLiteralA
5012     : standalone
5013     {
5014     LITA := [U+0027];
5015     ?default-token STRING : value;
5016     } // SystemLiteralA
5017    
5018     lexmode DTD
5019     : standalone
5020     : extends => 'S'
5021     {
5022     /*
5023     Markup declaration open
5024     */
5025     MDO := ['<'] ['!'];
5026    
5027     /*
5028     Comment declaration open
5029     */
5030     CDO := ['<'] ['!'] ['-'] ['-'];
5031    
5032     /*
5033     Processing instruction open
5034     */
5035     PIO := ['<'] ['?'];
5036    
5037     /*
5038     Parameter entity reference open
5039     */
5040     PERO := ['%'];
5041    
5042     /*
5043     Declaration subset close
5044     */
5045     DSC := [']'];
5046    
5047     /*
5048     Contition section open
5049     */
5050     CSO := ['<'] ['!'] ['['];
5051     } // DTD
5052    
5053     /*
5054     Markup declaration scanning mode
5055    
5056     This mode is used to recognize |MDC| that terminates
5057     a comment declaration as well as the base |lexmode|
5058     for e.g. document type declaration scanning mode.
5059     */
5060     lexmode MarkupDeclaration
5061     : standalone
5062     : extends => 'Name'
5063     : extends => 'S'
5064     {
5065     /*
5066     Markup declaration close
5067     */
5068     MDC := ['>'];
5069    
5070     /*
5071     Literal open
5072     */
5073     LIT := ['"'];
5074    
5075     /*
5076     Alternative literal open
5077     */
5078     LITA := [U+0027];
5079    
5080     /*
5081     Parameter entity reference open
5082     */
5083     PERO := ['%'];
5084    
5085     /*
5086     Declaration subset open
5087     */
5088     DSO := ['['];
5089     } // MarkupDeclaration
5090    
5091     lexmode ElementDeclaration
5092     : standalone
5093     : extends => 'MarkupDeclaration'
5094     {
5095     /*
5096     Model group open
5097     */
5098     MGO := ['('];
5099    
5100     /*
5101     Model group close
5102     */
5103     MGC := [')'];
5104    
5105     /*
5106     Reserved name indicator
5107     */
5108     RNI := ['#'];
5109    
5110     /*
5111     Occurence indicators
5112     */
5113     OPT := ['?'];
5114     REP := ['*'];
5115     PLUS := ['+'];
5116    
5117     /*
5118     Connectors
5119     */
5120     OR := ['|'];
5121     SEQ := [','];
5122     } // ElementDeclaration
5123    
5124     lexmode AttlistDeclaration
5125     : standalone
5126     : extends => 'MarkupDeclaration'
5127     {
5128     /*
5129     Enumeration group open
5130     */
5131     EGO := ['('];
5132    
5133     /*
5134     Enumeration group close
5135     */
5136     EGC := [')'];
5137    
5138     /*
5139     Enumeration choice delimiter
5140     */
5141     OR := ['|'];
5142    
5143     /*
5144     Reserved name indicator
5145     */
5146     RNI := ['#'];
5147     } // AttlistDeclaration
5148    
5149     lexmode Enumeration
5150     : standalone
5151     : extends => 'Nmtoken'
5152     : extends => 'S'
5153     {
5154     /*
5155     Enumeration group close
5156     */
5157     EGC := [')'];
5158    
5159     /*
5160     Enumeration choice delimiter
5161     */
5162     OR := ['|'];
5163     } // Enumeration
5164    
5165 wakaba 1.1
5166     token-error default : default {
5167     lang:Perl {
5168 wakaba 1.3 my $location;
5169     __CODE{xp|get-location-from-token::
5170     $token => {$token},
5171     $result => {$location},
5172     }__;
5173     my $continue = __DOMCore:ERROR{xp|wf-syntax-error::
5174 wakaba 1.1 xp|error-token => {$token},
5175     DOMCore|location => {$location},
5176     }__;
5177     unless ($continue) {
5178 wakaba 1.27 __CODE{ParseError}__;
5179 wakaba 1.1 }
5180     }
5181     } // default
5182 wakaba 1.5
5183 wakaba 1.26 @ResourceDef:
5184     @@ForCheck: ManakaiDOM|ForClass
5185 wakaba 1.27 @@QName: ParseError
5186     @@rdf:type: DISPerl|BlockCode
5187     @@PerlDef:
5188     __DEEP{
5189     for (@{$self->{entity}}) {
5190     $_->{close_file}->();
5191     }
5192     }__;
5193     __EXCEPTION{DOMLS|PARSE_ERR}__;
5194    
5195     @ResourceDef:
5196     @@ForCheck: ManakaiDOM|ForClass
5197 wakaba 1.26 @@QName: checkNCName
5198     @@rdf:type: DISPerl|BlockCode
5199     @@PerlDef:
5200     if (($self->{xml_version} eq '1.0' and
5201     not <Code::DOMMain|testXML10Name:: $INPUT = $name>) or
5202     ($self->{xml_version} eq '1.1' and
5203     not <Code::DOMMain|testXML11Name:: $INPUT = $name>)) {
5204     my $__location;
5205     __CODE{xp|get-location-from-token::
5206     $token => {$token},
5207     $result => {$__location},
5208     }__;
5209     my $__continue = __c|ERROR{xp|wf-invalid-character-in-node-name::
5210     xp|error-token => {$token},
5211     c|location => {$__location},
5212     xp|name => {$name},
5213     infoset|version => {$self->{xml_version}},
5214     }__;
5215     unless ($__continue) {
5216 wakaba 1.27 __CODE{ParseError}__;
5217 wakaba 1.26 }
5218     } elsif (index ($name, ':') > -1) {
5219     my $__location;
5220     __CODE{xp|get-location-from-token::
5221     $token => {$token},
5222     $result => {$__location},
5223     }__;
5224     my $__continue = __c|ERROR{xp|nswf-legal-ncname::
5225     xp|error-token => {$token},
5226     c|location => {$__location},
5227     xp|name => {$name},
5228     infoset|version => {$self->{xml_version}},
5229     }__;
5230     unless ($__continue) {
5231 wakaba 1.27 __CODE{ParseError}__;
5232 wakaba 1.26 }
5233     }
5234    
5235     @ResourceDef:
5236     @@ForCheck: ManakaiDOM|ForClass
5237     @@QName: checkQName
5238     @@rdf:type: DISPerl|BlockCode
5239     @@PerlDef:
5240     if (($self->{xml_version} eq '1.0' and
5241     not <Code::DOMMain|testXML10Name:: $INPUT = $name>) or
5242     ($self->{xml_version} eq '1.1' and
5243     not <Code::DOMMain|testXML11Name:: $INPUT = $name>)) {
5244     my $__location;
5245     __CODE{xp|get-location-from-token::
5246     $token => {$token},
5247     $result => {$__location},
5248     }__;
5249     my $__continue = __c|ERROR{xp|wf-invalid-character-in-node-name::
5250     xp|error-token => {$token},
5251     c|location => {$__location},
5252     xp|name => {$name},
5253     infoset|version => {$self->{xml_version}},
5254     }__;
5255     unless ($__continue) {
5256 wakaba 1.27 __CODE{ParseError}__;
5257 wakaba 1.26 }
5258     } elsif (($self->{xml_version} eq '1.0' and
5259     not <Code::DOMMain|testXML10QName:: $INPUT = $name>) or
5260     ($self->{xml_version} eq '1.1' and
5261     not <Code::DOMMain|testXML11QName:: $INPUT = $name>)) {
5262     my $__location;
5263     __CODE{xp|get-location-from-token::
5264     $token => {$token},
5265     $result => {$__location},
5266     }__;
5267     my $__continue = __c|ERROR{xp|nswf-legal-qname::
5268     xp|error-token => {$token},
5269     c|location => {$__location},
5270     xp|name => {$name},
5271     infoset|version => {$self->{xml_version}},
5272     }__;
5273     unless ($__continue) {
5274 wakaba 1.27 __CODE{ParseError}__;
5275 wakaba 1.26 }
5276     }
5277    
5278    
5279 wakaba 1.5 @XMLTests:
5280     @@XMLTest:
5281 wakaba 1.15 @@@QName: xp.char.xml10.test
5282     @@@DEnt:
5283     @@@@test:value:
5284     <?xml version="1.0"?>
5285     <p>$u0009$u000A$u000D$u0020$uD7FF$uE000$uFFFD$U00010000$U0010FFFF</p>
5286     @@@test:domTree:
5287     document {
5288     xml-version: '1.0';
5289     element {
5290     text-content: U+0009 U+000A U+000A U+0020 U+D7FF
5291     U+E000 U+FFFD U+10000 U+10FFFF;
5292     }
5293     }
5294     @@XMLTest:
5295     @@@QName: xp.char.xml11.test
5296     @@@DEnt:
5297     @@@@test:value:
5298     <?xml version="1.1"?>
5299     <p>$u0009$u000A$u000D$u0020$uD7FF$uE000$uFFFD$U00010000$U0010FFFF</p>
5300     @@@test:domTree:
5301     document {
5302     xml-version: '1.1';
5303     element {
5304     text-content: U+0009 U+000A U+000A U+0020 U+D7FF
5305     U+E000 U+FFFD U+10000 U+10FFFF;
5306     }
5307     }
5308     @@XMLTest:
5309     @@@QName: xp.char.xml10.c0.test
5310     @@@DEnt:
5311     @@@@test:value:
5312     <?xml version="1.0"?>
5313     <p>$u0000$u0001$u0002$u0003$u0004$u0005$u0006$u0007$u0008$u000B$
5314     $u000C$u000E$u000F$u0010$u0011$u0012$u0013$u0014$u0015$u0016$
5315     $u0017$u0018$u0019$u001A$u001B$u001C$u001D$u001E$u001F</p>
5316     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 4); } /* U+0000 */
5317     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 5); } /* U+0001 */
5318     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 6); } /* U+0002 */
5319     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 7); } /* U+0003 */
5320     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 8); } /* U+0004 */
5321     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 9); } /* U+0005 */
5322     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 10); } /* U+0006 */
5323     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 11); } /* U+0007 */
5324     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 12); } /* U+0008 */
5325     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 13); } /* U+000B */
5326     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 14); } /* U+000C */
5327     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 15); } /* U+000E */
5328     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 16); } /* U+000F */
5329     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 17); } /* U+0010 */
5330     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 18); } /* U+0011 */
5331     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 19); } /* U+0012 */
5332     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 20); } /* U+0013 */
5333     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 21); } /* U+0014 */
5334     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 22); } /* U+0015 */
5335     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 23); } /* U+0016 */
5336     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 24); } /* U+0017 */
5337     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 25); } /* U+0018 */
5338     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 26); } /* U+0019 */
5339     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 27); } /* U+001A */
5340     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 28); } /* U+001B */
5341     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 29); } /* U+001C */
5342     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 30); } /* U+001D */
5343     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 31); } /* U+001E */
5344     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 32); } /* U+001F */
5345     @@XMLTest:
5346     @@@QName: xp.char.xml11.c0.test
5347     @@@DEnt:
5348     @@@@test:value:
5349     <?xml version="1.1"?>
5350     <p>$u0000$u0001$u0002$u0003$u0004$u0005$u0006$u0007$u0008$u000B$
5351     $u000C$u000E$u000F$u0010$u0011$u0012$u0013$u0014$u0015$u0016$
5352     $u0017$u0018$u0019$u001A$u001B$u001C$u001D$u001E$u001F</p>
5353     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 4); } /* U+0000 */
5354     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 5); } /* U+0001 */
5355     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 6); } /* U+0002 */
5356     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 7); } /* U+0003 */
5357     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 8); } /* U+0004 */
5358     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 9); } /* U+0005 */
5359     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 10); } /* U+0006 */
5360     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 11); } /* U+0007 */
5361     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 12); } /* U+0008 */
5362     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 13); } /* U+000B */
5363     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 14); } /* U+000C */
5364     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 15); } /* U+000E */
5365     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 16); } /* U+000F */
5366     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 17); } /* U+0010 */
5367     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 18); } /* U+0011 */
5368     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 19); } /* U+0012 */
5369     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 20); } /* U+0013 */
5370     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 21); } /* U+0014 */
5371     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 22); } /* U+0015 */
5372     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 23); } /* U+0016 */
5373     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 24); } /* U+0017 */
5374     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 25); } /* U+0018 */
5375     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 26); } /* U+0019 */
5376     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 27); } /* U+001A */
5377     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 28); } /* U+001B */
5378     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 29); } /* U+001C */
5379     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 30); } /* U+001D */
5380     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 31); } /* U+001E */
5381     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 32); } /* U+001F */
5382     @@XMLTest:
5383     @@@QName: xp.char.xml10.c1.test
5384     @@@DEnt:
5385     @@@@test:value:
5386     <?xml version="1.0"?>
5387     <p>$u007F$u0080$u0081$u0082$u0083$u0084$u0086$u0087$u0088$
5388     $u0089$u008A$u008B$u008C$
5389     $u008D$u008E$u008F$u0090$u0091$u0092$u0093$u0094$u0095$u0096$
5390     $u0097$u0098$u0099$u009A$u009B$u009C$u009D$u009E$u009F$u0085</p>
5391     @@@test:domTree:
5392     document {
5393     xml-version: '1.0';
5394     element {
5395     text-content: U+007F U+0080 U+0081 U+0082 U+0083 U+0084 U+0086
5396     U+0087 U+0088 U+0089 U+008A U+008B U+008C U+008D
5397     U+008E U+008F U+0090 U+0091 U+0092 U+0093 U+0094
5398     U+0095 U+0096 U+0097 U+0098 U+0099 U+009A U+009B
5399     U+009C U+009D U+009E U+009F U+0085;
5400     }
5401     }
5402     @@XMLTest:
5403     @@@QName: xp.char.xml11.c1.test
5404     @@@DEnt:
5405     @@@@test:value:
5406     <?xml version="1.1"?>
5407     <p>$u007F$u0080$u0081$u0082$u0083$u0084$u0086$u0087$u0088$
5408     $u0089$u008A$u008B$u008C$
5409     $u008D$u008E$u008F$u0090$u0091$u0092$u0093$u0094$u0095$u0096$
5410     $u0097$u0098$u0099$u009A$u009B$u009C$u009D$u009E$u009F$u0085</p>
5411     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 4); } /* U+007F */
5412     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 5); } /* U+0080 */
5413     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 6); } /* U+0081 */
5414     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 7); } /* U+0082 */
5415     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 8); } /* U+0083 */
5416     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 9); } /* U+0084 */
5417     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 10); } /* U+0086 */
5418     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 11); } /* U+0087 */
5419     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 12); } /* U+0088 */
5420     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 13); } /* U+0089 */
5421     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 14); } /* U+008A */
5422     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 15); } /* U+008B */
5423     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 16); } /* U+008C */
5424     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 17); } /* U+008D */
5425     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 18); } /* U+008E */
5426     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 19); } /* U+008F */
5427     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 20); } /* U+0090 */
5428     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 21); } /* U+0091 */
5429     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 22); } /* U+0092 */
5430     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 23); } /* U+0093 */
5431     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 24); } /* U+0094 */
5432     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 25); } /* U+0095 */
5433     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 26); } /* U+0096 */
5434     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 27); } /* U+0097 */
5435     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 28); } /* U+0098 */
5436     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 29); } /* U+0099 */
5437     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 30); } /* U+009A */
5438     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 31); } /* U+009B */
5439     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 32); } /* U+009C */
5440     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 33); } /* U+009D */
5441     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 34); } /* U+009E */
5442     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 35); } /* U+009F */
5443    
5444     @@XMLTest:
5445 wakaba 1.27 @@@QName: xp.c0.internal.entity.xml11.1.test
5446     @@@DEnt:
5447     @@@@test:value:
5448     <?xml version="1.1"?>
5449     <!DOCTYPE a [
5450     <!ENTITY e "&#x01;&#x02;&#x03;&#x04;&#x05;&#x06;&#x07;$
5451     &#x08;&#x09;&#x0A;&#x0B;&#x0C;&#x0D;&#x0E;&#x0F;$
5452     &#x10;&#x11;&#x12;&#x13;&#x14;&#x15;&#x16;&#x17;$
5453     &#x18;&#x19;&#x1A;&#x1B;&#x1C;&#x1D;&#x1E;&#x1F;">
5454     ]><a/>
5455 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
5456 wakaba 1.27 @@@test:domTree:
5457     document {
5458     document-type {
5459     general-entity {
5460     node-name: 'e';
5461     text-content: U+0001 U+0002 U+0003 U+0004 U+0005
5462     U+0006 U+0007 U+0008 U+0009 U+000A U+000B
5463     U+000C U+000D U+000E U+000F
5464     U+0010 U+0011 U+0012 U+0013 U+0014 U+0015
5465     U+0016 U+0017 U+0018 U+0019 U+001A U+001B
5466     U+001C U+001D U+001E U+001F;
5467     }
5468     }
5469     element { }
5470     }
5471     @@XMLTest:
5472     @@@QName: xp.c1.internal.entity.xml11.1.test
5473     @@@DEnt:
5474     @@@@test:value:
5475     <?xml version="1.1"?>
5476     <!DOCTYPE a [
5477     <!ENTITY e "&#x80;&#x81;&#x82;&#x83;&#x84;&#x85;&#x86;&#x87;$
5478     &#x88;&#x89;&#x8A;&#x8B;&#x8C;&#x8D;&#x8E;&#x8F;$
5479     &#x90;&#x91;&#x92;&#x93;&#x94;&#x95;&#x96;&#x97;$
5480     &#x98;&#x99;&#x9A;&#x9B;&#x9C;&#x9D;&#x9E;&#x9F;&#x7F;">
5481     ]><a/>
5482 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
5483 wakaba 1.27 @@@test:domTree:
5484     document {
5485     document-type {
5486     general-entity {
5487     node-name: 'e';
5488     text-content: U+0080 U+0081 U+0082 U+0083 U+0084 U+0085
5489     U+0086 U+0087 U+0088 U+0089 U+008A U+008B
5490     U+008C U+008D U+008E U+008F
5491     U+0090 U+0091 U+0092 U+0093 U+0094 U+0095
5492     U+0096 U+0097 U+0098 U+0099 U+009A U+009B
5493     U+009C U+009D U+009E U+009F U+007F;
5494     }
5495     }
5496     element { }
5497     }
5498    
5499     @@XMLTest:
5500 wakaba 1.12 @@@QName: xp.syntax.empty.test
5501     @@@DEnt:
5502     @@@@test:value: \
5503     @@@c:erred:
5504     <[[xp:wf-syntax-error]]> { (1, 1); }
5505     @@XMLTest:
5506     @@@QName: xp.syntax.space.test
5507     @@@DEnt:
5508 wakaba 1.13 @@@@test:value: \
5509 wakaba 1.12 @@@c:erred:
5510     <[[xp:wf-syntax-error]]> { (1, 4); }
5511     @@XMLTest:
5512     @@@QName: xp.syntax.newlines.test
5513     @@@DEnt:
5514     @@@@test:value:
5515     \
5516     \
5517     \
5518     @@@c:erred:
5519     <[[xp:wf-syntax-error]]> { (3, 1); }
5520    
5521     @@XMLTest:
5522 wakaba 1.6 @@@QName: xp.only.docel.test
5523 wakaba 1.5 @@@DEnt:
5524     @@@@test:value:
5525     <p></p>
5526     @@@test:domTree:
5527     document {
5528     xml-version: '1.0';
5529 wakaba 1.6 xml-encoding: null;
5530     xml-standalone: false;
5531     element {
5532     namespace-uri: null;
5533     prefix: null;
5534     local-name: 'p';
5535     text-content: '';
5536     }
5537     }
5538     @@XMLTest:
5539     @@@QName: xp.only.docel.emptyelemtag.test
5540     @@@DEnt:
5541     @@@@test:value:
5542     <p/>
5543     @@@test:domTree:
5544     document {
5545     xml-version: '1.0';
5546     xml-encoding: null;
5547     xml-standalone: false;
5548 wakaba 1.5 element {
5549     namespace-uri: null;
5550     prefix: null;
5551     local-name: 'p';
5552     text-content: '';
5553     }
5554     }
5555 wakaba 1.15 @@XMLTest:
5556     @@@QName: xp.root.s.1.test
5557     @@@DEnt:
5558     @@@@test:value:
5559     <?xml version="1.0"?>$u0020$u000D$u000A$u0009
5560     <p></p>
5561     @@@test:domTree:
5562     document {
5563     element { }
5564     }
5565    
5566     @@XMLTest:
5567     @@@QName: xp.Name.1.test
5568     @@@DEnt:
5569     @@@@test:value: <name/>
5570     @@@test:domTree:
5571     document {
5572     element {
5573     node-name: 'name';
5574     }
5575     }
5576     @@XMLTest:
5577     @@@QName: xp.Name.2.test
5578     @@@DEnt:
5579     @@@@test:value: <name0/>
5580     @@@test:domTree:
5581     document {
5582     element {
5583     node-name: 'name0';
5584     }
5585     }
5586     @@enImplNote:
5587     @@@ddid: xml11name
5588     @@@@:
5589     {TODO:: XML 1.1 Name tests required
5590     }
5591    
5592     @@XMLTest:
5593     @@@QName: xp.content.mse.1.test
5594     @@@DEnt:
5595     @@@@test:value:
5596     <p>]]></p>
5597     @@@c:erred:
5598     <[[xp|wf-syntax-error]]> { (1, 4)..(1, 6); }
5599     @@XMLTest:
5600     @@@QName: xp.content.mse.2.test
5601     @@@DEnt:
5602     @@@@test:value:
5603     <p>aaa]]>bbb</p>
5604     @@@c:erred:
5605     <[[xp|wf-syntax-error]]> { (1, 7)..(1, 9); }
5606    
5607     @@XMLTest:
5608     @@@QName: xp.root.comment.1.test
5609     @@@DEnt:
5610     @@@@test:value:
5611     <!--comment data-->
5612     <p/>
5613     @@@test:domTree:
5614     document {
5615     comment {
5616     data: 'comment data';
5617     }
5618     element { }
5619     }
5620     @@XMLTest:
5621     @@@QName: xp.root.comment.2.test
5622     @@@DEnt:
5623     @@@@test:value:
5624     <!---->
5625     <p/>
5626     @@@test:domTree:
5627     document {
5628     comment {
5629     data: '';
5630     }
5631     element { }
5632     }
5633     @@XMLTest:
5634     @@@QName: xp.root.after.pi.comment.1.test
5635     @@@DEnt:
5636     @@@@test:value:
5637     <?pi?>
5638     <!--comment data-->
5639     <p/>
5640     @@@test:domTree:
5641     document {
5642     pi { }
5643     comment {
5644     data: 'comment data';
5645     }
5646     element { }
5647     }
5648     @@XMLTest:
5649     @@@QName: xp.root.after.pi.comment.2.test
5650     @@@DEnt:
5651     @@@@test:value:
5652     <?pi?>
5653     <!---->
5654     <p/>
5655     @@@test:domTree:
5656     document {
5657     pi { }
5658     comment {
5659     data: '';
5660     }
5661     element { }
5662     }
5663     @@XMLTest:
5664     @@@QName: xp.root.after.element.comment.1.test
5665     @@@DEnt:
5666     @@@@test:value:
5667     <p/>
5668     <!--comment data-->
5669     @@@test:domTree:
5670     document {
5671     element { }
5672     comment {
5673     data: 'comment data';
5674     }
5675     }
5676     @@XMLTest:
5677     @@@QName: xp.root.after.element.comment.2.test
5678     @@@DEnt:
5679     @@@@test:value:
5680     <p/>
5681     <!---->
5682     @@@test:domTree:
5683     document {
5684     element { }
5685     comment {
5686     data: '';
5687     }
5688     }
5689     @@XMLTest:
5690     @@@QName: xp.doctype.intsubset.comment.1.test
5691     @@@DEnt:
5692     @@@@test:value:
5693     <!DOCTYPE a [
5694     <!--comment data-->
5695     ]>
5696     <p/>
5697     @@@test:domTree:
5698     document {
5699     document-type { }
5700     element { }
5701     }
5702     @@XMLTest:
5703     @@@QName: xp.doctype.intsubset.comment.2.test
5704     @@@DEnt:
5705     @@@@test:value:
5706     <!DOCTYPE a [
5707     <!---->
5708     ]>
5709     <p/>
5710     @@@test:domTree:
5711     document {
5712     document-type { }
5713     element { }
5714     }
5715     @@XMLTest:
5716     @@@QName: xp.doctype.intsubset.comment.3.test
5717     @@@DEnt:
5718     @@@@test:value:
5719     <!DOCTYPE a [
5720     <?pi?>
5721     <!---->
5722     ]>
5723     <p/>
5724     @@@test:domTree:
5725     document {
5726     document-type {
5727     pi { }
5728     }
5729     element { }
5730     }
5731     @@XMLTest:
5732     @@@QName: xp.content.comment.1.test
5733     @@@DEnt:
5734     @@@@test:value:
5735     <p><!--comment data--></p>
5736     @@@test:domTree:
5737     document {
5738     element {
5739     comment {
5740     data: 'comment data';
5741     }
5742     }
5743     }
5744     @@XMLTest:
5745     @@@QName: xp.content.comment.2.test
5746     @@@DEnt:
5747     @@@@test:value:
5748     <p><!----></p>
5749     @@@test:domTree:
5750     document {
5751     element {
5752     comment {
5753     data: '';
5754     }
5755     }
5756     }
5757     @@XMLTest:
5758     @@@QName: xp.content.comment.3.test
5759     @@@DEnt:
5760     @@@@test:value:
5761     <p>aaaaa<!---->bbbbb</p>
5762     @@@test:domTree:
5763     document {
5764     element {
5765     text {
5766     data: 'aaaaa';
5767     }
5768     comment {
5769     data: '';
5770     }
5771     text {
5772     data: 'bbbbb';
5773     }
5774     }
5775     }
5776     @@XMLTest:
5777     @@@QName: xp.content.comment.--.1.test
5778     @@@DEnt:
5779     @@@@test:value:
5780     <p><!--data--data--></p>
5781     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 12)..(1, 17); }
5782     @@XMLTest:
5783     @@@QName: xp.content.comment.---gt.test
5784     @@@DEnt:
5785     @@@@test:value:
5786     <p><!--data---></p>
5787     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 12)..(1, 15); }
5788 wakaba 1.13
5789     @@XMLTest:
5790     @@@QName: xp.xmldecl.version.1.0.test
5791     @@@DEnt:
5792     @@@@test:value:
5793     <?xml version="1.0"?>
5794     <p></p>
5795     @@@test:domTree:
5796     document {
5797     xml-version: '1.0';
5798     xml-encoding: null;
5799     xml-standalone: false;
5800     element { }
5801     }
5802     @@XMLTest:
5803     @@@QName: xp.xmldecl.version.1.0.lita.test
5804     @@@DEnt:
5805     @@@@test:value:
5806     <?xml version='1.0'?>
5807     <p></p>
5808     @@@test:domTree:
5809     document {
5810     xml-version: '1.0';
5811     xml-encoding: null;
5812     xml-standalone: false;
5813     element { }
5814     }
5815     @@XMLTest:
5816     @@@QName: xp.xmldecl.version.1.0.s.test
5817     @@@DEnt:
5818     @@@@test:value:
5819     <?xml version = "1.0" ?>
5820     <p></p>
5821     @@@test:domTree:
5822     document {
5823     xml-version: '1.0';
5824     xml-encoding: null;
5825     xml-standalone: false;
5826     element { }
5827     }
5828     @@XMLTest:
5829     @@@QName: xp.xmldecl.version.1.1.test
5830     @@@DEnt:
5831     @@@@test:value:
5832     <?xml version="1.1"?>
5833     <p></p>
5834     @@@test:domTree:
5835     document {
5836     xml-version: '1.1';
5837     xml-encoding: null;
5838     xml-standalone: false;
5839     element { }
5840     }
5841    
5842     @@XMLTest:
5843     @@@QName: xp.xmldecl.version.1.0.encoding.usascii.test
5844     @@@DEnt:
5845     @@@@test:value:
5846     <?xml version="1.0" encoding="US-ascii"?>
5847     <p></p>
5848     @@@test:domTree:
5849     document {
5850     xml-version: '1.0';
5851     xml-encoding: 'US-ascii';
5852     xml-standalone: false;
5853     element { }
5854     }
5855     @@XMLTest:
5856     @@@QName: xp.xmldecl.version.1.0.encoding.usascii.lita.test
5857     @@@DEnt:
5858     @@@@test:value:
5859     <?xml version="1.0" encoding='US-ascii'?>
5860     <p></p>
5861     @@@test:domTree:
5862     document {
5863     xml-version: '1.0';
5864     xml-encoding: 'US-ascii';
5865     xml-standalone: false;
5866     element { }
5867     }
5868     @@XMLTest:
5869     @@@QName: xp.xmldecl.version.1.0.encoding.usascii.s.test
5870     @@@DEnt:
5871     @@@@test:value:
5872     <?xml version="1.0" encoding = "US-ascii" ?>
5873     <p></p>
5874     @@@test:domTree:
5875     document {
5876     xml-version: '1.0';
5877     xml-encoding: 'US-ascii';
5878     xml-standalone: false;
5879     element { }
5880     }
5881    
5882     @@XMLTest:
5883     @@@QName: xp.xmldecl.version.1.0.encoding.usascii.standalone.yes.test
5884     @@@DEnt:
5885     @@@@test:value:
5886     <?xml version="1.0" encoding="us-ascii" standalone="yes"?>
5887     <p></p>
5888     @@@test:domTree:
5889     document {
5890     xml-version: '1.0';
5891     xml-encoding: 'us-ascii';
5892     xml-standalone: true;
5893     element { }
5894     }
5895     @@XMLTest:
5896     @@@QName: xp.xmldecl.version.1.0.encoding.usascii.standalone.no.test
5897     @@@DEnt:
5898     @@@@test:value:
5899     <?xml version="1.0" encoding="us-ascii" standalone="no"?>
5900     <p></p>
5901     @@@test:domTree:
5902     document {
5903     xml-version: '1.0';
5904     xml-encoding: 'us-ascii';
5905     xml-standalone: false;
5906     element { }
5907     }
5908     @@XMLTest:
5909     @@@QName: xp.xmldecl.version.1.0.encoding.usascii.standalone.yes.lita.test
5910     @@@DEnt:
5911     @@@@test:value:
5912     <?xml version="1.0" encoding="us-ascii" standalone='yes'?>
5913     <p></p>
5914     @@@test:domTree:
5915     document {
5916     xml-version: '1.0';
5917     xml-encoding: 'us-ascii';
5918     xml-standalone: true;
5919     element { }
5920     }
5921     @@XMLTest:
5922     @@@QName: xp.xmldecl.version.1.0.encoding.usascii.standalone.yes.s.test
5923     @@@DEnt:
5924     @@@@test:value:
5925     <?xml version="1.0" encoding="us-ascii" standalone = "yes" ?>
5926     <p></p>
5927     @@@test:domTree:
5928     document {
5929     xml-version: '1.0';
5930     xml-encoding: 'us-ascii';
5931     xml-standalone: true;
5932     element { }
5933     }
5934 wakaba 1.14 @@XMLTest:
5935     @@@QName: xp.xmldecl.no.encoding.but.standalone.attr.test
5936     @@@DEnt:
5937     @@@@test:value:
5938     <?xml version="1.0" standalone="yes"?>
5939     <p></p>
5940     @@@test:domTree:
5941     document {
5942     xml-version: '1.0';
5943     xml-encoding: null;
5944     xml-standalone: true;
5945     element { }
5946     }
5947     @@XMLTest:
5948     @@@QName: xp.xmldecl.encoding.encname.test
5949     @@@DEnt:
5950     @@@@test:value:
5951     <?xml version="1.0" encoding="a-._01-"?>
5952     <p></p>
5953     @@@test:domTree:
5954     document {
5955     xml-version: '1.0';
5956     xml-encoding: 'a-._01-';
5957     xml-standalone: false;
5958     element { }
5959     }
5960    
5961     @@XMLTest:
5962     @@@QName: xp.xmldecl.no.s.no.attr.test
5963     @@@DEnt:
5964     @@@@test:value:
5965     <?xml?>
5966     <p></p>
5967     @@@c:erred:
5968 wakaba 1.16 <[[xp:wf-syntax-error]]> { (1, 1)..(1, 7); }
5969 wakaba 1.14 @@XMLTest:
5970     @@@QName: xp.xmldecl.s.no.attr.test
5971     @@@DEnt:
5972     @@@@test:value:
5973     <?xml ?>
5974     <p></p>
5975     @@@c:erred:
5976     <[[xp:wf-syntax-error]]> { (1, 8)..(1, 9); }
5977     @@XMLTest:
5978     @@@QName: xp.xmldecl.unknown.attr.test
5979     @@@DEnt:
5980     @@@@test:value:
5981     <?xml unknown="value"?>
5982     <p></p>
5983     @@@c:erred:
5984     <[[xp:wf-syntax-error]]> { (1, 8)..(1, 22); }
5985     @@XMLTest:
5986     @@@QName: xp.xmldecl.version.unknown.attr.test
5987     @@@DEnt:
5988     @@@@test:value:
5989     <?xml version="1.0" unknown="value"?>
5990     <p></p>
5991     @@@c:erred:
5992     <[[xp:wf-syntax-error]]> { (1, 21)..(1, 35); }
5993     @@XMLTest:
5994     @@@QName: xp.xmldecl.version.encoding.unknown.attr.test
5995     @@@DEnt:
5996     @@@@test:value:
5997     <?xml version="1.0" encoding="us-ascii" unknown="value"?>
5998     <p></p>
5999     @@@c:erred:
6000     <[[xp:wf-syntax-error]]> { (1, 41)..(1, 55); }
6001     @@XMLTest:
6002     @@@QName: xp.xmldecl.version.encoding.standalone.unknown.attr.test
6003     @@@DEnt:
6004     @@@@test:value:
6005     <?xml version="1.0" encoding="us-ascii" standalone="yes"
6006     unknown="value"?>
6007     <p></p>
6008     @@@c:erred:
6009     <[[xp:wf-syntax-error]]> { (2, 1)..(2, 15); }
6010     @@XMLTest:
6011     @@@QName: xp.xmldecl.no.version.but.encoding.attr.test
6012     @@@DEnt:
6013     @@@@test:value:
6014     <?xml encoding="us-ascii"?>
6015     <p></p>
6016     @@@c:erred:
6017     <[[xp:wf-syntax-error]]> { (1, 7)..(1, 25); }
6018     @@XMLTest:
6019     @@@QName: xp.xmldecl.no.version.but.standalone.attr.test
6020     @@@DEnt:
6021     @@@@test:value:
6022     <?xml standalone="yes"?>
6023     <p></p>
6024     @@@c:erred:
6025     <[[xp:wf-syntax-error]]> { (1, 7)..(1, 24); }
6026     @@XMLTest:
6027     @@@QName: xp.xmldecl.version.unsupported.test
6028     @@@DEnt:
6029     @@@@test:value:
6030     <?xml version="1.2"?>
6031     <p></p>
6032     @@@c:erred:
6033     <[[xp:wf-unsupported-xml-version]]> { (1, 7)..(1, 19); }
6034     @@XMLTest:
6035     @@@QName: xp.xmldecl.version.unsupported.2.test
6036     @@@DEnt:
6037     @@@@test:value:
6038     <?xml version=" 1.0 "?>
6039     <p></p>
6040     @@@c:erred:
6041     <[[xp:wf-unsupported-xml-version]]> { (1, 7)..(1, 21); }
6042     @@XMLTest:
6043     @@@QName: xp.xmldecl.version.unsupported.3.test
6044     @@@DEnt:
6045     @@@@test:value:
6046     <?xml version="01.00"?>
6047     <p></p>
6048     @@@c:erred:
6049     <[[xp:wf-unsupported-xml-version]]> { (1, 7)..(1, 21); }
6050     @@XMLTest:
6051     @@@QName: xp.xmldecl.encoding.malformed.1.test
6052     @@@DEnt:
6053     @@@@test:value:
6054     <?xml version="1.0" encoding="0088"?>
6055     <p></p>
6056     @@@c:erred:
6057     <[[xp:wf-malformed-enc-name]]> { (1, 21)..(1, 35); }
6058     @@XMLTest:
6059     @@@QName: xp.xmldecl.encoding.malformed.2.test
6060     @@@DEnt:
6061     @@@@test:value:
6062     <?xml version="1.0" encoding="D.V.D!"?>
6063     <p></p>
6064     @@@c:erred:
6065     <[[xp:wf-malformed-enc-name]]> { (1, 21)..(1, 38); }
6066     @@XMLTest:
6067     @@@QName: xp.xmldecl.standalone.malformed.1.test
6068     @@@DEnt:
6069     @@@@test:value:
6070     <?xml version="1.0" standalone="true"?>
6071     <p></p>
6072     @@@c:erred:
6073     <[[xp:wf-malformed-xml-standalone]]> { (1, 21)..(1, 38); }
6074     @@XMLTest:
6075     @@@QName: xp.xmldecl.standalone.malformed.2.test
6076     @@@DEnt:
6077     @@@@test:value:
6078     <?xml version="1.0" standalone="YES"?>
6079     <p></p>
6080     @@@c:erred:
6081     <[[xp:wf-malformed-xml-standalone]]> { (1, 21)..(1, 37); }
6082     @@XMLTest:
6083     @@@QName: xp.xmldecl.standalone.malformed.3.test
6084     @@@DEnt:
6085     @@@@test:value:
6086     <?xml version="1.0" standalone="no "?>
6087     <p></p>
6088     @@@c:erred:
6089     <[[xp:wf-malformed-xml-standalone]]> { (1, 21)..(1, 38); }
6090 wakaba 1.6
6091     @@XMLTest:
6092 wakaba 1.14 @@@QName: xp.no-xmldecl.xml...-pi.test
6093     @@@DEnt:
6094     @@@@test:value:
6095     <?xmldeclaration?>
6096     <a></a>
6097     @@@test:domTree:
6098     document {
6099     pi {
6100     node-name: 'xmldeclaration';
6101     node-value: '';
6102     }
6103     element { }
6104     }
6105     @@XMLTest:
6106     @@@QName: xp.no-xmldecl.xml...-pi.after.document.element.test
6107     @@@DEnt:
6108     @@@@test:value:
6109     <a></a>
6110     <?xmldeclaration?>
6111     @@@test:domTree:
6112     document {
6113     element { }
6114     pi {
6115     node-name: 'xmldeclaration';
6116     node-value: '';
6117     }
6118     }
6119     @@XMLTest:
6120     @@@QName: xp.no-xmldecl.xml...-pi.in.document.element.test
6121     @@@DEnt:
6122     @@@@test:value:
6123     <a>
6124     <?xmldeclaration?>
6125     </a>
6126     @@@test:domTree:
6127     document {
6128     element {
6129     text { }
6130     pi {
6131     node-name: 'xmldeclaration';
6132     node-value: '';
6133     }
6134     text { }
6135     }
6136     }
6137     @@XMLTest:
6138     @@@QName: xp.no-xmldecl.xml...-pi.in.doctype.test
6139     @@@DEnt:
6140     @@@@test:value:
6141     <!DOCTYPE a [
6142     <?xmldeclaration?>
6143     ]>
6144     <a></a>
6145     @@@test:domTree:
6146     document {
6147     document-type {
6148     pi {
6149     node-name: 'xmldeclaration';
6150     node-value: '';
6151     }
6152     }
6153     element { }
6154     }
6155    
6156     @@XMLTest:
6157     @@@QName: xp.XMLdecl.test
6158     @@@DEnt:
6159     @@@@test:value:
6160     <?XML version="1.0"?>
6161     <p></p>
6162     @@@c:erred:
6163     <[[xp:wf-pi-target-is-xml]]> { (1, 1)..(1, 5); }
6164     @@XMLTest:
6165     @@@QName: xp.Xmldecl.test
6166     @@@DEnt:
6167     @@@@test:value:
6168     <?Xml version="1.0"?>
6169     <p></p>
6170     @@@c:erred:
6171     <[[xp:wf-pi-target-is-xml]]> { (1, 1)..(1, 5); }
6172     @@XMLTest:
6173     @@@QName: xp.xmldecl.after.document.element.empty.test
6174     @@@DEnt:
6175     @@@@test:value:
6176     <p></p>
6177     <?xml?>
6178     @@@c:erred:
6179     <[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); }
6180     @@XMLTest:
6181     @@@QName: xp.xmldecl.after.document.element.test
6182     @@@DEnt:
6183     @@@@test:value:
6184     <p></p>
6185     <?xml version="1.0"?>
6186     @@@c:erred:
6187     <[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); }
6188     @@XMLTest:
6189     @@@QName: xp.xmldecl.in.element.empty.test
6190     @@@DEnt:
6191     @@@@test:value:
6192     <p>
6193     <?xml?>
6194     </p>
6195     @@@c:erred:
6196     <[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); }
6197     @@XMLTest:
6198     @@@QName: xp.xmldecl.in.element.test
6199     @@@DEnt:
6200     @@@@test:value:
6201     <p>
6202     <?xml version="1.0"?>
6203     </p>
6204     @@@c:erred:
6205     <[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); }
6206     @@XMLTest:
6207     @@@QName: xp.xmldecl.after.comment.test
6208     @@@DEnt:
6209     @@@@test:value:
6210     <!---->
6211     <?xml version="1.0"?>
6212     <p></p>
6213     @@@c:erred:
6214     <[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); }
6215     @@XMLTest:
6216     @@@QName: xp.xmldecl.after.comment.empty.test
6217     @@@DEnt:
6218     @@@@test:value:
6219     <!---->
6220     <?xml?>
6221     <p></p>
6222     @@@c:erred:
6223     <[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); }
6224     @@XMLTest:
6225     @@@QName: xp.xmldecl.after.pi.test
6226     @@@DEnt:
6227     @@@@test:value:
6228     <?xml-declaration?>
6229     <?xml version="1.0"?>
6230     <p></p>
6231     @@@c:erred:
6232     <[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); }
6233     @@XMLTest:
6234     @@@QName: xp.xmldecl.after.pi.empty.test
6235     @@@DEnt:
6236     @@@@test:value:
6237     <?xml-declaration?>
6238     <?xml?>
6239     <p></p>
6240     @@@c:erred:
6241     <[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); }
6242     @@XMLTest:
6243 wakaba 1.16 @@@QName: xp.xmldecl.after.pi.2.test
6244     @@@DEnt:
6245     @@@@test:value:
6246     <?declaration?>
6247     <?xml version="1.0"?>
6248     <p></p>
6249     @@@c:erred:
6250     <[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); }
6251     @@XMLTest:
6252     @@@QName: xp.xmldecl.after.pi.empty.2.test
6253     @@@DEnt:
6254     @@@@test:value:
6255     <?declaration?>
6256     <?xml?>
6257     <p></p>
6258     @@@c:erred:
6259     <[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); }
6260     @@XMLTest:
6261 wakaba 1.14 @@@QName: xp.xmldecl.after.doctype.test
6262     @@@DEnt:
6263     @@@@test:value:
6264     <!DOCTYPE a>
6265     <?xml version="1.0"?>
6266     <p></p>
6267     @@@c:erred:
6268     <[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); }
6269     @@XMLTest:
6270     @@@QName: xp.xmldecl.after.doctype.empty.test
6271     @@@DEnt:
6272     @@@@test:value:
6273     <!DOCTYPE a>
6274     <?xml?>
6275     <p></p>
6276     @@@c:erred:
6277     <[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); }
6278     @@XMLTest:
6279     @@@QName: xp.xmldecl.in.doctype.test
6280     @@@DEnt:
6281     @@@@test:value:
6282     <!DOCTYPE a [
6283     <?xml version="1.0"?>
6284     ]>
6285     <p></p>
6286     @@@c:erred:
6287     <[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); }
6288     @@XMLTest:
6289     @@@QName: xp.xmldecl.in.doctype.empty.test
6290     @@@DEnt:
6291     @@@@test:value:
6292     <!DOCTYPE a [
6293     <?xml?>
6294     ]>
6295     <p></p>
6296     @@@c:erred:
6297     <[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); }
6298    
6299     @@XMLTest:
6300     @@@QName: xp.pi.before.element.empty.test
6301     @@@DEnt:
6302     @@@@test:value:
6303     <?target?>
6304     <a></a>
6305     @@@test:domTree:
6306     document {
6307     pi {
6308     node-name: 'target';
6309     node-value: '';
6310     }
6311     element { }
6312     }
6313     @@XMLTest:
6314     @@@QName: xp.pi.before.element.s.test
6315     @@@DEnt:
6316     @@@@test:value:
6317     <?target ?>
6318     <a></a>
6319     @@@test:domTree:
6320     document {
6321     pi {
6322     node-name: 'target';
6323     node-value: '';
6324     }
6325     element { }
6326     }
6327     @@XMLTest:
6328     @@@QName: xp.pi.before.element.string.test
6329     @@@DEnt:
6330     @@@@test:value:
6331     <?target string?>
6332     <a></a>
6333     @@@test:domTree:
6334     document {
6335     pi {
6336     node-name: 'target';
6337     node-value: 'string';
6338     }
6339     element { }
6340     }
6341     @@XMLTest:
6342     @@@QName: xp.pi.before.element.string.s.test
6343     @@@DEnt:
6344     @@@@test:value:
6345     <?target string ?>
6346     <a></a>
6347     @@@test:domTree:
6348     document {
6349     pi {
6350     node-name: 'target';
6351     node-value: 'string ';
6352     }
6353     element { }
6354     }
6355     @@XMLTest:
6356     @@@QName: xp.pi.before.element.gt.test
6357     @@@DEnt:
6358     @@@@test:value:
6359     <?target string>string?>
6360     <a></a>
6361     @@@test:domTree:
6362     document {
6363     pi {
6364     node-name: 'target';
6365     node-value: 'string>string';
6366     }
6367     element { }
6368     }
6369     @@XMLTest:
6370     @@@QName: xp.pi.doctype.empty.test
6371     @@@DEnt:
6372     @@@@test:value:
6373     <!DOCTYPE a [
6374     <?target?>
6375     ]>
6376     <a></a>
6377     @@@test:domTree:
6378     document {
6379     document-type {
6380     pi {
6381     node-name: 'target';
6382     node-value: '';
6383     }
6384     }
6385     element { }
6386     }
6387    
6388     @@XMLTest:
6389     @@@QName: xp.pi.no.target.test
6390     @@@DEnt:
6391     @@@@test:value:
6392     <??>
6393     <p></p>
6394     @@@c:erred:
6395     <[[xp:wf-syntax-error]]> { (1, 3)..(1, 4); }
6396     @@XMLTest:
6397     @@@QName: xp.pi.no.target.2.test
6398     @@@DEnt:
6399     @@@@test:value:
6400     <? ?>
6401     <p></p>
6402     @@@c:erred:
6403     <[[xp:wf-syntax-error]]> { (1, 3)..(1, 4); }
6404     @@XMLTest:
6405     @@@QName: xp.pi.bad.target.1.test
6406     @@@DEnt:
6407     @@@@test:value:
6408     <?target! ?>
6409     <p></p>
6410     @@@c:erred:
6411     <[[xp:wf-syntax-error]]> { (1, 9)..(1, 9); }
6412     @@XMLTest:
6413     @@@QName: xp.pi.bad.target.2.test
6414     @@@DEnt:
6415     @@@@test:value:
6416     <?0target ?>
6417     <p></p>
6418     @@@c:erred:
6419     <[[xp:wf-syntax-error]]> { (1, 3)..(1, 3); }
6420    
6421     @@XMLTest:
6422 wakaba 1.15 @@@QName: xp.cdatasection.empty.1.test
6423     @@@DEnt:
6424     @@@@test:value:
6425     <p><![CDATA[]]></p>
6426     @@@test:domTree:
6427     document {
6428     element {
6429     cdata-section {
6430     data: '';
6431     }
6432     }
6433     }
6434     @@XMLTest:
6435     @@@QName: xp.cdatasection.empty.2.test
6436     @@@DEnt:
6437     @@@@test:value:
6438     <p>aa<![CDATA[]]>bb</p>
6439     @@@test:domTree:
6440     document {
6441     element {
6442     text { data: 'aa'; }
6443     cdata-section {
6444     data: '';
6445     }
6446     text { data: 'bb'; }
6447     }
6448     }
6449     @@XMLTest:
6450     @@@QName: xp.cdatasection.1.test
6451     @@@DEnt:
6452     @@@@test:value:
6453     <p><![CDATA[abcdefg]]></p>
6454     @@@test:domTree:
6455     document {
6456     element {
6457     cdata-section {
6458     data: 'abcdefg';
6459     }
6460     }
6461     }
6462     @@XMLTest:
6463     @@@QName: xp.cdatasection.2.test
6464     @@@DEnt:
6465     @@@@test:value:
6466     <p>aa<![CDATA[abcdefg]]>bb</p>
6467     @@@test:domTree:
6468     document {
6469     element {
6470     text { data: 'aa'; }
6471     cdata-section {
6472     data: 'abcdefg';
6473     }
6474     text { data: 'bb'; }
6475     }
6476     }
6477     @@XMLTest:
6478     @@@QName: xp.cdatasection.ref.1.test
6479     @@@DEnt:
6480     @@@@test:value:
6481     <p><![CDATA[a&amp;&#x32;&#32;%abc;&def;]]&gt;b]]></p>
6482     @@@test:domTree:
6483     document {
6484     element {
6485     cdata-section {
6486     data: 'a&amp;&#x32;&#32;%abc;&def;]]&gt;b';
6487     }
6488     }
6489     }
6490     @@XMLTest:
6491     @@@QName: xp.cdatasection.in.general.entity.test
6492     @@@DEnt:
6493     @@@@test:value:
6494     <!DOCTYPE p [
6495     <!ENTITY cdata "<![CDATA[text]]>">
6496     ]>
6497     <p>&cdata;</p>
6498 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
6499 wakaba 1.15 @@@test:domTree:
6500     document {
6501     document-type {
6502     general-entity {
6503     node-name: 'cdata';
6504     cdata-section {
6505     data: 'text';
6506     }
6507     }
6508     }
6509     element {
6510     general-entity-reference {
6511 wakaba 1.23 node-name: 'cdata';
6512 wakaba 1.34 manakai-expanded: true;
6513 wakaba 1.15 cdata-section {
6514     data: 'text';
6515     }
6516     }
6517     }
6518     }
6519     @@XMLTest:
6520     @@@QName: xp.cdatasection.no.mse.test
6521     @@@DEnt:
6522     @@@@test:value:
6523     <p><![CDATA[text</p>
6524     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 21); }
6525     @@XMLTest:
6526     @@@QName: xp.cdatasection.nest.test
6527     @@@DEnt:
6528     @@@@test:value:
6529     <p><![CDATA[text01<![CDATA[txt2]]>text3]]></p>
6530     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 40)..(1, 42); }
6531    
6532     @@XMLTest:
6533 wakaba 1.6 @@@QName: xp.doctype.empty.test
6534     @@@DEnt:
6535     @@@@test:value:
6536     <!DOCTYPE a>
6537     <a></a>
6538     @@@test:domTree:
6539     document {
6540     xml-version: '1.0';
6541     xml-encoding: null;
6542     xml-standalone: false;
6543     document-type {
6544     node-name: 'a';
6545 wakaba 1.17 public-id: null;
6546     system-id: null;
6547 wakaba 1.6 }
6548     element {
6549     namespace-uri: null;
6550     prefix: null;
6551     local-name: 'a';
6552     text-content: '';
6553     }
6554     }
6555 wakaba 1.15 @@XMLTest:
6556     @@@QName: xp.doctype.empty.after.document.element.test
6557     @@@DEnt:
6558     @@@@test:value:
6559     <a></a>
6560     <!DOCTYPE a>
6561     @@@c:erred: <[[xp|wf-syntax-error]]> { (2, 1)..(2, 12); }
6562     @@XMLTest:
6563     @@@QName: xp.doctype.empty.in.element.test
6564     @@@DEnt:
6565     @@@@test:value:
6566     <a>
6567     <!DOCTYPE a>
6568     </a>
6569     @@@c:erred: <[[xp|wf-syntax-error]]> { (2, 1)..(2, 12); }
6570     @@XMLTest:
6571     @@@QName: xp.doctype.empty.dup.test
6572     @@@DEnt:
6573     @@@@test:value:
6574     <!DOCTYPE a>
6575     <!DOCTYPE a>
6576     <a></a>
6577     @@@c:erred: <[[xp|wf-syntax-error]]> { (2, 1)..(2, 12); }
6578     @@XMLTest:
6579     @@@QName: xp.doctype.empty.in.intsubset.test
6580     @@@DEnt:
6581     @@@@test:value:
6582     <!DOCTYPE a [
6583     <!DOCTYPE a>
6584     ]>
6585     <a></a>
6586     @@@c:erred: <[[xp|wf-syntax-error]]> { (2, 1)..(2, 12); }
6587 wakaba 1.16 @@XMLTest:
6588     @@@QName: xp.doctype.no.s.no.name.test
6589     @@@DEnt:
6590     @@@@test:value:
6591     <!DOCTYPE>
6592     <a></a>
6593     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 10); }
6594     @@XMLTest:
6595     @@@QName: xp.doctype.no.name.test
6596     @@@DEnt:
6597     @@@@test:value:
6598     <!DOCTYPE >
6599     <a></a>
6600     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 11); }
6601     @@XMLTest:
6602     @@@QName: xp.doctype.name.s.test
6603     @@@DEnt:
6604     @@@@test:value:
6605     <!DOCTYPE aa >
6606     <aa></aa>
6607     @@@test:domTree:
6608     document {
6609     document-type {
6610     node-name: 'aa';
6611 wakaba 1.17 public-id: null;
6612     system-id: null;
6613 wakaba 1.16 }
6614     element { }
6615     }
6616     @@XMLTest:
6617     @@@QName: xp.doctype.no.mdc.test
6618     @@@DEnt:
6619     @@@@test:value:
6620     <!DOCTYPE aa
6621     <aa></aa>
6622     @@@c:erred: <[[xp|wf-syntax-error]]> { (2, 1); }
6623 wakaba 1.6
6624     @@XMLTest:
6625 wakaba 1.16 @@@QName: xp.doctype.intsubset.empty.1.test
6626 wakaba 1.6 @@@DEnt:
6627     @@@@test:value:
6628 wakaba 1.16 <!DOCTYPE a []>
6629 wakaba 1.6 <a></a>
6630     @@@test:domTree:
6631     document {
6632     xml-version: '1.0';
6633     xml-encoding: null;
6634     xml-standalone: false;
6635     document-type {
6636     node-name: 'a';
6637 wakaba 1.17 public-id: null;
6638     system-id: null;
6639 wakaba 1.6 }
6640     element {
6641     namespace-uri: null;
6642     prefix: null;
6643     local-name: 'a';
6644     text-content: '';
6645     }
6646     }
6647     @@XMLTest:
6648 wakaba 1.16 @@@QName: xp.doctype.intsubset.empty.2.test
6649 wakaba 1.6 @@@DEnt:
6650     @@@@test:value:
6651     <!DOCTYPE a [
6652 wakaba 1.16
6653 wakaba 1.6 ]>
6654     <a></a>
6655     @@@test:domTree:
6656     document {
6657     xml-version: '1.0';
6658     xml-encoding: null;
6659     xml-standalone: false;
6660     document-type {
6661     node-name: 'a';
6662 wakaba 1.17 public-id: null;
6663     system-id: null;
6664 wakaba 1.6 }
6665     element {
6666     namespace-uri: null;
6667     prefix: null;
6668     local-name: 'a';
6669     text-content: '';
6670     }
6671     }
6672     @@XMLTest:
6673 wakaba 1.16 @@@QName: xp.doctype.intsubset.empty.3.test
6674 wakaba 1.6 @@@DEnt:
6675     @@@@test:value:
6676 wakaba 1.16 <!DOCTYPE a[]>
6677 wakaba 1.6 <a></a>
6678     @@@test:domTree:
6679     document {
6680     document-type {
6681     node-name: 'a';
6682 wakaba 1.17 public-id: null;
6683     system-id: null;
6684 wakaba 1.6 }
6685 wakaba 1.16 element { }
6686     }
6687     @@XMLTest:
6688     @@@QName: xp.doctype.intsubset.empty.4.test
6689     @@@DEnt:
6690     @@@@test:value:
6691     <!DOCTYPE a[] >
6692     <a></a>
6693     @@@test:domTree:
6694     document {
6695     document-type {
6696     node-name: 'a';
6697 wakaba 1.17 public-id: null;
6698     system-id: null;
6699 wakaba 1.6 }
6700 wakaba 1.16 element { }
6701 wakaba 1.6 }
6702     @@XMLTest:
6703 wakaba 1.16 @@@QName: xp.doctype.intsubset.no.dsc.1.test
6704     @@@DEnt:
6705     @@@@test:value:
6706     <!DOCTYPE a [>
6707     <a></a>
6708     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 14); }
6709     @@XMLTest:
6710     @@@QName: xp.doctype.intsubset.no.dsc.2.test
6711 wakaba 1.6 @@@DEnt:
6712     @@@@test:value:
6713     <!DOCTYPE a [
6714     <a></a>
6715 wakaba 1.16 @@@c:erred: <[[xp|wf-syntax-error]]> { (2, 1); }
6716     @@XMLTest:
6717     @@@QName: xp.doctype.intsubset.no.dsc.3.test
6718     @@@DEnt:
6719     @@@@test:value:
6720     <!DOCTYPE a [
6721     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 14); }
6722     @@XMLTest:
6723     @@@QName: xp.doctype.intsubset.no.mdc.1.test
6724     @@@DEnt:
6725     @@@@test:value:
6726     <!DOCTYPE a []
6727     <a/>
6728     @@@c:erred: <[[xp|wf-syntax-error]]> { (2, 1); }
6729     @@XMLTest:
6730     @@@QName: xp.doctype.intsubset.no.mdc.2.test
6731     @@@DEnt:
6732     @@@@test:value:
6733     <!DOCTYPE a []]>
6734     <a/>
6735     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 15); }
6736 wakaba 1.17 @@XMLTest:
6737     @@@QName: xp.doctype.pubid.sysid.1.test
6738     @@@DEnt:
6739     @@@@test:value:
6740     <!DOCTYPE a PUBLIC "pubid" "sysid">
6741     <a/>
6742     @@@test:domTree:
6743     document {
6744     document-type {
6745     node-name: 'a';
6746     public-id: 'pubid';
6747     system-id: 'sysid';
6748     }
6749     element { }
6750     }
6751     @@XMLTest:
6752     @@@QName: xp.doctype.pubid.sysid.2.test
6753     @@@DEnt:
6754     @@@@test:value:
6755     <!DOCTYPE a PUBLIC 'pubid' "sysid">
6756     <a/>
6757     @@@test:domTree:
6758     document {
6759     document-type {
6760     node-name: 'a';
6761     public-id: 'pubid';
6762     system-id: 'sysid';
6763     }
6764     element { }
6765     }
6766     @@XMLTest:
6767     @@@QName: xp.doctype.pubid.sysid.3.test
6768     @@@DEnt:
6769     @@@@test:value:
6770     <!DOCTYPE a PUBLIC "pubid" 'sysid'>
6771     <a/>
6772     @@@test:domTree:
6773     document {
6774     document-type {
6775     node-name: 'a';
6776     public-id: 'pubid';
6777     system-id: 'sysid';
6778     }
6779     element { }
6780     }
6781     @@XMLTest:
6782     @@@QName: xp.doctype.pubid.sysid.4.test
6783     @@@DEnt:
6784     @@@@test:value:
6785     <!DOCTYPE a PUBLIC 'pubid' 'sysid'>
6786     <a/>
6787     @@@test:domTree:
6788     document {
6789     document-type {
6790     node-name: 'a';
6791     public-id: 'pubid';
6792     system-id: 'sysid';
6793     }
6794     element { }
6795     }
6796     @@XMLTest:
6797     @@@QName: xp.doctype.pubid.sysid.5.test
6798     @@@DEnt:
6799     @@@@test:value:
6800     <!DOCTYPE a PUBLIC "pubid" "sysid" >
6801     <a/>
6802     @@@test:domTree:
6803     document {
6804     document-type {
6805     node-name: 'a';
6806     public-id: 'pubid';
6807     system-id: 'sysid';
6808     }
6809     element { }
6810     }
6811     @@XMLTest:
6812     @@@QName: xp.doctype.pubid.sysid.6.test
6813     @@@DEnt:
6814     @@@@test:value:
6815     <!DOCTYPE a PUBLIC 'pubid' 'sysid' >
6816     <a/>
6817     @@@test:domTree:
6818     document {
6819     document-type {
6820     node-name: 'a';
6821     public-id: 'pubid';
6822     system-id: 'sysid';
6823     }
6824     element { }
6825     }
6826     @@XMLTest:
6827     @@@QName: xp.doctype.pubid.sysid.intsubset.1.test
6828     @@@DEnt:
6829     @@@@test:value:
6830     <!DOCTYPE a PUBLIC "pubid" "sysid"[]>
6831     <a/>
6832     @@@test:domTree:
6833     document {
6834     document-type {
6835     node-name: 'a';
6836     public-id: 'pubid';
6837     system-id: 'sysid';
6838     }
6839     element { }
6840     }
6841     @@XMLTest:
6842     @@@QName: xp.doctype.pubid.sysid.intsubset.2.test
6843     @@@DEnt:
6844     @@@@test:value:
6845     <!DOCTYPE a PUBLIC "pubid" "sysid" []>
6846     <a/>
6847     @@@test:domTree:
6848     document {
6849     document-type {
6850     node-name: 'a';
6851     public-id: 'pubid';
6852     system-id: 'sysid';
6853     }
6854     element { }
6855     }
6856     @@XMLTest:
6857     @@@QName: xp.doctype.pubid.sysid.intsubset.3.test
6858     @@@DEnt:
6859     @@@@test:value:
6860     <!DOCTYPE a PUBLIC 'pubid' 'sysid'[]>
6861     <a/>
6862     @@@test:domTree:
6863     document {
6864     document-type {
6865     node-name: 'a';
6866     public-id: 'pubid';
6867     system-id: 'sysid';
6868     }
6869     element { }
6870     }
6871     @@XMLTest:
6872     @@@QName: xp.doctype.pubid.sysid.intsubset.4.test
6873     @@@DEnt:
6874     @@@@test:value:
6875     <!DOCTYPE a PUBLIC 'pubid' 'sysid' []>
6876     <a/>
6877     @@@test:domTree:
6878     document {
6879     document-type {
6880     node-name: 'a';
6881     public-id: 'pubid';
6882     system-id: 'sysid';
6883     }
6884     element { }
6885     }
6886     @@XMLTest:
6887     @@@QName: xp.doctype.sysid.1.test
6888     @@@DEnt:
6889     @@@@test:value:
6890     <!DOCTYPE a SYSTEM "sysid">
6891     <a/>
6892     @@@test:domTree:
6893     document {
6894     document-type {
6895     node-name: 'a';
6896     public-id: null;
6897     system-id: 'sysid';
6898     }
6899     element { }
6900     }
6901     @@XMLTest:
6902     @@@QName: xp.doctype.sysid.2.test
6903     @@@DEnt:
6904     @@@@test:value:
6905     <!DOCTYPE a SYSTEM 'sysid'>
6906     <a/>
6907     @@@test:domTree:
6908     document {
6909     document-type {
6910     node-name: 'a';
6911     public-id: null;
6912     system-id: 'sysid';
6913     }
6914     element { }
6915     }
6916     @@XMLTest:
6917     @@@QName: xp.doctype.sysid.3.test
6918     @@@DEnt:
6919     @@@@test:value:
6920     <!DOCTYPE a SYSTEM "sysid" >
6921     <a/>
6922     @@@test:domTree:
6923     document {
6924     document-type {
6925     node-name: 'a';
6926     public-id: null;
6927     system-id: 'sysid';
6928     }
6929     element { }
6930     }
6931     @@XMLTest:
6932     @@@QName: xp.doctype.sysid.4.test
6933     @@@DEnt:
6934     @@@@test:value:
6935     <!DOCTYPE a SYSTEM 'sysid' >
6936     <a/>
6937     @@@test:domTree:
6938     document {
6939     document-type {
6940     node-name: 'a';
6941     public-id: null;
6942     system-id: 'sysid';
6943     }
6944     element { }
6945     }
6946     @@XMLTest:
6947     @@@QName: xp.doctype.sysid.intsubset.1.test
6948     @@@DEnt:
6949     @@@@test:value:
6950     <!DOCTYPE a SYSTEM "sysid"[]>
6951     <a/>
6952     @@@test:domTree:
6953     document {
6954     document-type {
6955     node-name: 'a';
6956     public-id: null;
6957     system-id: 'sysid';
6958     }
6959     element { }
6960     }
6961     @@XMLTest:
6962     @@@QName: xp.doctype.sysid.intsubset.2.test
6963     @@@DEnt:
6964     @@@@test:value:
6965     <!DOCTYPE a SYSTEM "sysid" []>
6966     <a/>
6967     @@@test:domTree:
6968     document {
6969     document-type {
6970     node-name: 'a';
6971     public-id: null;
6972     system-id: 'sysid';
6973     }
6974     element { }
6975     }
6976     @@XMLTest:
6977     @@@QName: xp.doctype.sysid.intsubset.3.test
6978     @@@DEnt:
6979     @@@@test:value:
6980     <!DOCTYPE a SYSTEM 'sysid'[]>
6981     <a/>
6982     @@@test:domTree:
6983     document {
6984     document-type {
6985     node-name: 'a';
6986     public-id: null;
6987     system-id: 'sysid';
6988     }
6989     element { }
6990     }
6991     @@XMLTest:
6992     @@@QName: xp.doctype.sysid.intsubset.4.test
6993     @@@DEnt:
6994     @@@@test:value:
6995     <!DOCTYPE a SYSTEM 'sysid' []>
6996     <a/>
6997     @@@test:domTree:
6998     document {
6999     document-type {
7000     node-name: 'a';
7001     public-id: null;
7002     system-id: 'sysid';
7003     }
7004     element { }
7005     }
7006     @@XMLTest:
7007     @@@QName: xp.doctype.public.stago.test
7008     @@@DEnt:
7009     @@@@test:value:
7010     <!DOCTYPE a PUBLIC<a/>
7011     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 19); }
7012     @@XMLTest:
7013     @@@QName: xp.doctype.public.mdc.test
7014     @@@DEnt:
7015     @@@@test:value:
7016     <!DOCTYPE a PUBLIC>
7017     <a/>
7018     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 19); }
7019     @@XMLTest:
7020     @@@QName: xp.doctype.public.s.stago.test
7021     @@@DEnt:
7022     @@@@test:value:
7023     <!DOCTYPE a PUBLIC <a/>
7024     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 20); }
7025     @@XMLTest:
7026     @@@QName: xp.doctype.public.s.mdc.test
7027     @@@DEnt:
7028     @@@@test:value:
7029     <!DOCTYPE a PUBLIC >
7030     <a/>
7031     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 20); }
7032     @@XMLTest:
7033     @@@QName: xp.doctype.public.lit.test
7034     @@@DEnt:
7035     @@@@test:value:
7036     <!DOCTYPE a PUBLIC"p" "s">
7037     <a/>
7038     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 19); }
7039     @@XMLTest:
7040     @@@QName: xp.doctype.public.lita.test
7041     @@@DEnt:
7042     @@@@test:value:
7043     <!DOCTYPE a PUBLIC'p' "s">
7044     <a/>
7045     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 19); }
7046     @@XMLTest:
7047     @@@QName: xp.doctype.pubid.lit.lita.unmatched.1.test
7048     @@@DEnt:
7049     @@@@test:value:
7050     <!DOCTYPE a PUBLIC "p' "s">
7051     <a/>
7052     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 25); }
7053     @@XMLTest:
7054     @@@QName: xp.doctype.pubid.lit.lita.unmatched.2.test
7055     @@@DEnt:
7056     @@@@test:value:
7057     <!DOCTYPE a PUBLIC "p' 's'><a/>
7058     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 32); }
7059     @@XMLTest:
7060     @@@QName: xp.doctype.pubid.lita.lit.unmatched.1.test
7061     @@@DEnt:
7062     @@@@test:value:
7063     <!DOCTYPE a PUBLIC 'p" "s"><a/>
7064     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 32); }
7065     @@XMLTest:
7066     @@@QName: xp.doctype.pubid.lita.lit.unmatched.2.test
7067     @@@DEnt:
7068     @@@@test:value:
7069     <!DOCTYPE a PUBLIC 'p" 's'>
7070     <a/>
7071     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 21)..(1, 25); }
7072     @@XMLTest:
7073     @@@QName: xp.doctype.public.s.lit.mdc.test
7074     @@@DEnt:
7075     @@@@test:value:
7076     <!DOCTYPE a PUBLIC "><a/>
7077     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 26); }
7078     @@XMLTest:
7079     @@@QName: xp.doctype.public.s.lita.mdc.test
7080     @@@DEnt:
7081     @@@@test:value:
7082     <!DOCTYPE a PUBLIC '><a/>
7083     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 26); }
7084     @@XMLTest:
7085     @@@QName: xp.doctype.public.lit.pubid.lit.mdc.test
7086     @@@DEnt:
7087     @@@@test:value:
7088     <!DOCTYPE a PUBLIC "p">
7089     <a/>
7090     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 23); }
7091     @@XMLTest:
7092     @@@QName: xp.doctype.public.lita.pubid.lita.mdc.test
7093     @@@DEnt:
7094     @@@@test:value:
7095     <!DOCTYPE a PUBLIC 'p'>
7096     <a/>
7097     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 23); }
7098     @@XMLTest:
7099     @@@QName: xp.doctype.public.lit.pubid.lit.s.mdc.test
7100     @@@DEnt:
7101     @@@@test:value:
7102     <!DOCTYPE a PUBLIC "p" >
7103     <a/>
7104     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 24); }
7105     @@XMLTest:
7106     @@@QName: xp.doctype.public.lita.pubid.lita.s.mdc.test
7107     @@@DEnt:
7108     @@@@test:value:
7109     <!DOCTYPE a PUBLIC 'p' >
7110     <a/>
7111     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 24); }
7112     @@XMLTest:
7113     @@@QName: xp.doctype.public.lit.pubid.lit.s.lit.mdc.test
7114     @@@DEnt:
7115     @@@@test:value:
7116     <!DOCTYPE a PUBLIC "p" "><a/>
7117     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 30); }
7118     @@XMLTest:
7119     @@@QName: xp.doctype.public.lit.pubid.lit.s.lita.mdc.test
7120     @@@DEnt:
7121     @@@@test:value:
7122     <!DOCTYPE a PUBLIC "p" '><a/>
7123     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 30); }
7124     @@XMLTest:
7125     @@@QName: xp.doctype.public.lita.pubid.lita.s.lit.mdc.test
7126     @@@DEnt:
7127     @@@@test:value:
7128     <!DOCTYPE a PUBLIC 'p' "><a/>
7129     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 30); }
7130     @@XMLTest:
7131     @@@QName: xp.doctype.public.lita.pubid.lita.s.lita.mdc.test
7132     @@@DEnt:
7133     @@@@test:value:
7134     <!DOCTYPE a PUBLIC 'p' '><a/>
7135     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 30); }
7136     @@XMLTest:
7137     @@@QName: xp.doctype.public.lit.pubid.lit.lit.lita.unmatched.mdc.test
7138     @@@DEnt:
7139     @@@@test:value:
7140     <!DOCTYPE a PUBLIC "p" "s'><a/>
7141     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 32); }
7142     @@XMLTest:
7143     @@@QName: xp.doctype.public.lita.pubid.lita.lita.lit.unmatched.mdc.test
7144     @@@DEnt:
7145     @@@@test:value:
7146     <!DOCTYPE a PUBLIC 'p' 's"><a/>
7147     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 32); }
7148     @@XMLTest:
7149     @@@QName: xp.doctype.pubid.sysid.stago.1.test
7150     @@@DEnt:
7151     @@@@test:value:
7152     <!DOCTYPE a PUBLIC "p" "s"<a/>
7153     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 27); }
7154     @@XMLTest:
7155     @@@QName: xp.doctype.pubid.sysid.stago.2.test
7156     @@@DEnt:
7157     @@@@test:value:
7158     <!DOCTYPE a PUBLIC "p" 's'<a/>
7159     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 27); }
7160     @@XMLTest:
7161     @@@QName: xp.doctype.pubid.sysid.stago.s.1.test
7162     @@@DEnt:
7163     @@@@test:value:
7164     <!DOCTYPE a PUBLIC "p" "s" <a/>
7165     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 28); }
7166     @@XMLTest:
7167     @@@QName: xp.doctype.pubid.sysid.stago.s.2.test
7168     @@@DEnt:
7169     @@@@test:value:
7170     <!DOCTYPE a PUBLIC "p" 's' <a/>
7171     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 28); }
7172 wakaba 1.16
7173     @@XMLTest:
7174     @@@QName: xp.endofline.1.0.crlf.test
7175     @@@DEnt:
7176     @@@@test:value:
7177     <?xml version="1.0"?>
7178     <p>aaa$u000D$u000Abbb</p>
7179 wakaba 1.6 @@@test:domTree:
7180     document {
7181     xml-version: '1.0';
7182 wakaba 1.16 element {
7183     text-content: 'aaa' U+000A 'bbb';
7184 wakaba 1.6 }
7185 wakaba 1.16 }
7186     @@XMLTest:
7187     @@@QName: xp.endofline.1.1.crlf.test
7188     @@@DEnt:
7189     @@@@test:value:
7190     <?xml version="1.1"?>
7191     <p>aaa$u000D$u000Abbb</p>
7192     @@@test:domTree:
7193     document {
7194     xml-version: '1.1';
7195 wakaba 1.6 element {
7196 wakaba 1.16 text-content: 'aaa' U+000A 'bbb';
7197 wakaba 1.6 }
7198     }
7199     @@XMLTest:
7200 wakaba 1.16 @@@QName: xp.endofline.1.0.crnl.test
7201 wakaba 1.6 @@@DEnt:
7202     @@@@test:value:
7203 wakaba 1.16 <?xml version="1.0"?>
7204     <p>aaa$u000D$u0085bbb</p>
7205 wakaba 1.6 @@@test:domTree:
7206     document {
7207     xml-version: '1.0';
7208 wakaba 1.16 element {
7209     text-content: 'aaa' U+000A U+0085 'bbb';
7210 wakaba 1.6 }
7211 wakaba 1.16 }
7212     @@XMLTest:
7213     @@@QName: xp.endofline.1.1.crnl.test
7214     @@@DEnt:
7215     @@@@test:value:
7216     <?xml version="1.1"?>
7217     <p>aaa$u000D$u0085bbb</p>
7218     @@@test:domTree:
7219     document {
7220     xml-version: '1.1';
7221 wakaba 1.6 element {
7222 wakaba 1.16 text-content: 'aaa' U+000A 'bbb';
7223 wakaba 1.6 }
7224     }
7225     @@XMLTest:
7226 wakaba 1.16 @@@QName: xp.endofline.1.0.nl.test
7227 wakaba 1.6 @@@DEnt:
7228     @@@@test:value:
7229 wakaba 1.16 <?xml version="1.0"?>
7230     <p>aaa$u0085bbb</p>
7231 wakaba 1.6 @@@test:domTree:
7232     document {
7233     xml-version: '1.0';
7234     element {
7235 wakaba 1.16 text-content: 'aaa' U+0085 'bbb';
7236 wakaba 1.6 }
7237     }
7238     @@XMLTest:
7239 wakaba 1.16 @@@QName: xp.endofline.1.1.nl.test
7240 wakaba 1.6 @@@DEnt:
7241     @@@@test:value:
7242 wakaba 1.16 <?xml version="1.1"?>
7243     <p>aaa$u0085bbb</p>
7244     @@@test:domTree:
7245     document {
7246     xml-version: '1.1';
7247     element {
7248     text-content: 'aaa' U+000A 'bbb';
7249     }
7250     }
7251     @@XMLTest:
7252     @@@QName: xp.endofline.1.0.ls.test
7253     @@@DEnt:
7254     @@@@test:value:
7255     <?xml version="1.0"?>
7256     <p>aaa$u2028bbb</p>
7257     @@@test:domTree:
7258     document {
7259     xml-version: '1.0';
7260     element {
7261     text-content: 'aaa' U+2028 'bbb';
7262     }
7263     }
7264     @@XMLTest:
7265     @@@QName: xp.endofline.1.1.ls.test
7266     @@@DEnt:
7267     @@@@test:value:
7268     <?xml version="1.1"?>
7269     <p>aaa$u2028bbb</p>
7270     @@@test:domTree:
7271     document {
7272     xml-version: '1.1';
7273     element {
7274     text-content: 'aaa' U+000A 'bbb';
7275     }
7276     }
7277     @@XMLTest:
7278     @@@QName: xp.endofline.1.0.cr.test
7279     @@@DEnt:
7280     @@@@test:value:
7281     <?xml version="1.0"?>
7282     <p>aaa$u000Dbbb</p>
7283     @@@test:domTree:
7284     document {
7285     xml-version: '1.0';
7286     element {
7287     text-content: 'aaa' U+000A 'bbb';
7288     }
7289     }
7290     @@XMLTest:
7291     @@@QName: xp.endofline.1.1.cr.test
7292     @@@DEnt:
7293     @@@@test:value:
7294     <?xml version="1.1"?>
7295     <p>aaa$u000Dbbb</p>
7296     @@@test:domTree:
7297     document {
7298     xml-version: '1.1';
7299     element {
7300     text-content: 'aaa' U+000A 'bbb';
7301     }
7302     }
7303     @@XMLTest:
7304     @@@QName: xp.endofline.1.0.lf.test
7305     @@@DEnt:
7306     @@@@test:value:
7307     <?xml version="1.0"?>
7308     <p>aaa$u000Abbb</p>
7309     @@@test:domTree:
7310     document {
7311     xml-version: '1.0';
7312     element {
7313     text-content: 'aaa' U+000A 'bbb';
7314     }
7315     }
7316     @@XMLTest:
7317     @@@QName: xp.endofline.1.1.lf.test
7318     @@@DEnt:
7319     @@@@test:value:
7320     <?xml version="1.1"?>
7321     <p>aaa$u000Abbb</p>
7322     @@@test:domTree:
7323     document {
7324     xml-version: '1.1';
7325     element {
7326     text-content: 'aaa' U+000A 'bbb';
7327     }
7328     }
7329     @@XMLTest:
7330     @@@QName: xp.xml10.endofline.nl.in.xmldecl.1.test
7331     @@@DEnt:
7332     @@@@test:value:
7333     <?xml$u0085version="1.0"?>
7334     <p/>
7335     @@@c:erred:
7336     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 6)..(2, 0); }
7337     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7338     @@XMLTest:
7339     @@@QName: xp.xml11.endofline.nl.in.xmldecl.1.test
7340     @@@DEnt:
7341     @@@@test:value:
7342     <?xml$u0085version="1.1"?>
7343     (err)<p/>
7344     @@@c:erred:
7345     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 6)..(2, 0); }
7346     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7347     @@XMLTest:
7348     @@@QName: xp.xml10.endofline.crnl.in.xmldecl.1.test
7349     @@@DEnt:
7350     @@@@test:value:
7351     <?xml$u000D$u0085version="1.0"?>
7352     <p/>
7353     @@@c:erred:
7354     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 6)..(2, 0); }
7355     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7356     @@XMLTest:
7357     @@@QName: xp.xml11.endofline.crnl.in.xmldecl.1.test
7358     @@@DEnt:
7359     @@@@test:value:
7360     <?xml$u000D$u0085version="1.1"?>
7361     (err)<p/>
7362     @@@c:erred:
7363     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 6)..(2, 0); }
7364     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7365     @@XMLTest:
7366     @@@QName: xp.xml10.endofline.ls.in.xmldecl.1.test
7367     @@@DEnt:
7368     @@@@test:value:
7369     <?xml$u2028version="1.0"?>
7370     <p/>
7371     @@@c:erred:
7372     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 6)..(2, 0); }
7373     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7374     @@XMLTest:
7375     @@@QName: xp.xml11.endofline.ls.in.xmldecl.1.test
7376     @@@DEnt:
7377     @@@@test:value:
7378     <?xml$u2028version="1.1"?>
7379     (err)<p/>
7380     @@@c:erred:
7381     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 6)..(2, 0); }
7382     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7383     @@XMLTest:
7384     @@@QName: xp.xml10.endofline.nl.in.xmldecl.2.test
7385     @@@DEnt:
7386     @@@@test:value:
7387     <?xml version="1.0"$u0085?>
7388     <p/>
7389     @@@c:erred:
7390     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 20)..(2, 0); }
7391     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7392     @@XMLTest:
7393     @@@QName: xp.xml11.endofline.nl.in.xmldecl.2.test
7394     @@@DEnt:
7395     @@@@test:value:
7396     <?xml version="1.1"$u0085?>
7397     (err)<p/>
7398     @@@c:erred:
7399     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 20)..(2, 0); }
7400     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7401     @@XMLTest:
7402     @@@QName: xp.xml10.endofline.crnl.in.xmldecl.2.test
7403     @@@DEnt:
7404     @@@@test:value:
7405     <?xml version="1.0"$u000D$u0085?>
7406     <p/>
7407     @@@c:erred:
7408     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 20)..(2, 0); }
7409     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7410     @@XMLTest:
7411     @@@QName: xp.xml11.endofline.crnl.in.xmldecl.2.test
7412     @@@DEnt:
7413     @@@@test:value:
7414     <?xml version="1.1"$u000D$u0085?>
7415     (err)<p/>
7416     @@@c:erred:
7417     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 20)..(2, 0); }
7418     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7419     @@XMLTest:
7420     @@@QName: xp.xml10.endofline.ls.in.xmldecl.2.test
7421     @@@DEnt:
7422     @@@@test:value:
7423     <?xml version="1.0"$u2028?>
7424     <p/>
7425     @@@c:erred:
7426     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 20)..(2, 0); }
7427     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7428     @@XMLTest:
7429     @@@QName: xp.xml11.endofline.ls.in.xmldecl.2.test
7430     @@@DEnt:
7431     @@@@test:value:
7432     <?xml version="1.1"$u2028?>
7433     (err)<p/>
7434     @@@c:erred:
7435     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 20)..(2, 0); }
7436     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7437     @@XMLTest:
7438     @@@QName: xp.xml10.endofline.nl.in.xmldecl.3.test
7439     @@@DEnt:
7440     @@@@test:value:
7441     <?xml $u0085version="1.0"?>
7442     <p/>
7443     @@@c:erred:
7444     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 7)..(2, 0); }
7445     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7446     @@XMLTest:
7447     @@@QName: xp.xml11.endofline.nl.in.xmldecl.3.test
7448     @@@DEnt:
7449     @@@@test:value:
7450     <?xml $u0085version="1.1"?>
7451     (err)<p/>
7452     @@@c:erred:
7453     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 7)..(2, 0); }
7454     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7455     @@XMLTest:
7456     @@@QName: xp.xml10.endofline.crnl.in.xmldecl.3.test
7457     @@@DEnt:
7458     @@@@test:value:
7459     <?xml $u000D$u0085version="1.0"?>
7460     <p/>
7461     @@@c:erred:
7462     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 7)..(2, 0); }
7463     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7464     @@XMLTest:
7465     @@@QName: xp.xml11.endofline.crnl.in.xmldecl.3.test
7466     @@@DEnt:
7467     @@@@test:value:
7468     <?xml $u000D$u0085version="1.1"?>
7469     (err)<p/>
7470     @@@c:erred:
7471     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 7)..(2, 0); }
7472     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7473     @@XMLTest:
7474     @@@QName: xp.xml10.endofline.ls.in.xmldecl.3.test
7475     @@@DEnt:
7476     @@@@test:value:
7477     <?xml $u2028version="1.0"?>
7478     <p/>
7479     @@@c:erred:
7480     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 7)..(2, 0); }
7481     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7482     @@XMLTest:
7483     @@@QName: xp.xml11.endofline.ls.in.xmldecl.3.test
7484     @@@DEnt:
7485     @@@@test:value:
7486     <?xml $u2028version="1.1"?>
7487     (err)<p/>
7488     @@@c:erred:
7489     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 7)..(2, 0); }
7490     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7491     @@XMLTest:
7492     @@@QName: xp.xml10implied.endofline.nl.in.pi.1.test
7493     @@@DEnt:
7494     @@@@test:value:
7495     <?xml-$u0085?>
7496     <p/>
7497     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 7)..(2, 0); }
7498     @@XMLTest:
7499     @@@QName: xp.xml10.endofline.nl.in.pi.1.test
7500     @@@DEnt:
7501     @@@@test:value:
7502     <?xml version="1.0"?>
7503     <?xml-$u0085?>
7504     <p/>
7505     @@@c:erred: <[[xp|wf-syntax-error]]> { (2, 7)..(3, 0); }
7506     @@XMLTest:
7507     @@@QName: xp.xml11.endofline.nl.in.pi.1.test
7508     @@@DEnt:
7509     @@@@test:value:
7510     <?xml version="1.1"?>
7511     <?xml-$u0085?>
7512     <p/>
7513     @@@test:domTree:
7514     document {
7515     xml-version: '1.1';
7516     pi {
7517     node-name: 'xml-';
7518     node-value: '';
7519     }
7520     element { }
7521     }
7522     @@XMLTest:
7523     @@@QName: xp.xml10implied.endofline.crnl.in.pi.1.test
7524     @@@DEnt:
7525     @@@@test:value:
7526     <?xml-$u000D$u0085?>
7527     <p/>
7528     @@@test:domTree:
7529     document {
7530     xml-version: '1.0';
7531     pi {
7532     node-name: 'xml-';
7533     node-value: U+0085;
7534     }
7535     element { }
7536     }
7537     @@XMLTest:
7538     @@@QName: xp.xml10.endofline.crnl.in.pi.1.test
7539     @@@DEnt:
7540     @@@@test:value:
7541     <?xml version="1.0"?>
7542     <?xml-$u000D$u0085?>
7543     <p/>
7544     @@@test:domTree:
7545     document {
7546     xml-version: '1.0';
7547     pi {
7548     node-name: 'xml-';
7549     node-value: U+0085;
7550     }
7551     element { }
7552     }
7553     @@XMLTest:
7554     @@@QName: xp.xml11.endofline.crnl.in.pi.1.test
7555     @@@DEnt:
7556     @@@@test:value:
7557     <?xml version="1.1"?>
7558     <?xml-$u000D$u0085?>
7559     <p/>
7560     @@@test:domTree:
7561     document {
7562     xml-version: '1.1';
7563     pi {
7564     node-name: 'xml-';
7565     node-value: '';
7566     }
7567     element { }
7568     }
7569     @@XMLTest:
7570     @@@QName: xp.xml10implied.endofline.ls.in.pi.1.test
7571     @@@DEnt:
7572     @@@@test:value:
7573     <?xml-$u2028?>
7574     <p/>
7575     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 7)..(2, 0); }
7576     @@XMLTest:
7577     @@@QName: xp.xml10.endofline.ls.in.pi.1.test
7578     @@@DEnt:
7579     @@@@test:value:
7580     <?xml version="1.0"?>
7581     <?xml-$u2028?>
7582     <p/>
7583     @@@c:erred: <[[xp|wf-syntax-error]]> { (2, 7)..(3, 0); }
7584     @@XMLTest:
7585     @@@QName: xp.xml11.endofline.ls.in.pi.1.test
7586     @@@DEnt:
7587     @@@@test:value:
7588     <?xml version="1.1"?>
7589     <?xml-$u2028?>
7590     <p/>
7591     @@@test:domTree:
7592     document {
7593     xml-version: '1.1';
7594     pi {
7595     node-name: 'xml-';
7596     node-value: '';
7597     }
7598     element { }
7599     }
7600 wakaba 1.27
7601     @@XMLTest:
7602     @@@QName: xp.xml10.endofline.internal.1.test
7603     @@@DEnt:
7604     @@@@test:value:
7605     <?xml version="1.0"?>
7606     <!DOCTYPE a [
7607     <!ENTITY e "&#x000D; &#x000A; &#x0085; &#x000D;&#x000A; $
7608     &#x000D;&#x0085; &#x2028;">
7609     ]><a>&e;</a>
7610 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
7611 wakaba 1.27 @@@test:domTree:
7612     document {
7613     xml-version: '1.0';
7614     document-type {
7615     general-entity {
7616     node-name: 'e';
7617     text-content: U+000D ' ' U+000A ' ' U+0085 ' '
7618     U+000D U+000A ' ' U+000D U+0085 ' ' U+2028;
7619     }
7620     }
7621     element {
7622     text-content: U+000D ' ' U+000A ' ' U+0085 ' '
7623     U+000D U+000A ' ' U+000D U+0085 ' ' U+2028;
7624     }
7625     }
7626     @@XMLTest:
7627     @@@QName: xp.xml11.endofline.internal.1.test
7628     @@@DEnt:
7629     @@@@test:value:
7630     <?xml version="1.1"?>
7631     <!DOCTYPE a [
7632     <!ENTITY e "&#x000D; &#x000A; &#x0085; &#x000D;&#x000A; $
7633     &#x000D;&#x0085; &#x2028;">
7634     ]><a>&e;</a>
7635 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
7636 wakaba 1.27 @@@test:domTree:
7637     document {
7638     xml-version: '1.1';
7639     document-type {
7640     general-entity {
7641     node-name: 'e';
7642     text-content: U+000D ' ' U+000A ' ' U+0085 ' '
7643     U+000D U+000A ' ' U+000D U+0085 ' ' U+2028;
7644     }
7645     }
7646     element {
7647     text-content: U+000D ' ' U+000A ' ' U+0085 ' '
7648     U+000D U+000A ' ' U+000D U+0085 ' ' U+2028;
7649     }
7650     }
7651    
7652 wakaba 1.16 @@XMLTest:
7653     @@@QName: xp.noxmldecl.pi.pi.test
7654     @@@DEnt:
7655     @@@@test:value:
7656     <?noxml 1?><?noxml 2?><p/>
7657     @@@test:domTree:
7658     document {
7659     xml-version: '1.0';
7660     pi {
7661     node-name: 'noxml';
7662     node-value: '1';
7663     }
7664     pi {
7665     node-name: 'noxml';
7666     node-value: '2';
7667     }
7668     element { }
7669     }
7670     @@XMLTest:
7671     @@@QName: xp.noxmldecl.pi.pi.2.test
7672     @@@DEnt:
7673     @@@@test:value:
7674     <?xmlno 1?><?xmlno 2?><p/>
7675     @@@test:domTree:
7676     document {
7677     xml-version: '1.0';
7678     pi {
7679     node-name: 'xmlno';
7680     node-value: '1';
7681     }
7682     pi {
7683     node-name: 'xmlno';
7684     node-value: '2';
7685     }
7686     element { }
7687     }
7688     @@XMLTest:
7689     @@@QName: xp.noxmldecl.pi.pi.3.test
7690     @@@DEnt:
7691     @@@@test:value:
7692     <?xmln 1?><?xmln 2?><p/>
7693     @@@test:domTree:
7694     document {
7695     xml-version: '1.0';
7696     pi {
7697     node-name: 'xmln';
7698     node-value: '1';
7699     }
7700     pi {
7701     node-name: 'xmln';
7702     node-value: '2';
7703     }
7704     element { }
7705     }
7706     @@XMLTest:
7707     @@@QName: xp.noxml.s.nl.test
7708     @@@DEnt:
7709     @@@@test:value:
7710     $u0085<p/>
7711     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 1)..(2, 0); }
7712     @@XMLTest:
7713     @@@QName: xp.noxml.s.crnl.test
7714     @@@DEnt:
7715     @@@@test:value:
7716     $u000D$u0085<p/>
7717     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 1)..(2, 0); }
7718     @@XMLTest:
7719     @@@QName: xp.noxml.s.ls.test
7720     @@@DEnt:
7721     @@@@test:value:
7722     $u2028<p/>
7723     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 1)..(2, 0); }
7724     @@XMLTest:
7725     @@@QName: xp.xml10.decl.s.nl.test
7726     @@@DEnt:
7727     @@@@test:value:
7728     <?xml version="1.0"?>$u0085<p/>
7729     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 22)..(2, 0); }
7730     @@XMLTest:
7731     @@@QName: xp.xml10.decl.s.crnl.test
7732     @@@DEnt:
7733     @@@@test:value:
7734     <?xml version="1.0"?>$u000D$u0085<p/>
7735     @@@c:erred: <[[xp|wf-syntax-error]]> { (2, 0)..(3, 0); }
7736     @@XMLTest:
7737     @@@QName: xp.xml10.decl.s.ls.test
7738     @@@DEnt:
7739     @@@@test:value:
7740     <?xml version="1.0"?>$u2028<p/>
7741     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 22)..(2, 0); }
7742     @@XMLTest:
7743     @@@QName: xp.xml11.decl.s.nl.test
7744     @@@DEnt:
7745     @@@@test:value:
7746     <?xml version="1.1"?>$u0085<p/>
7747     @@@test:domTree:
7748     document {
7749     xml-version: '1.1';
7750     element { }
7751     }
7752     @@XMLTest:
7753     @@@QName: xp.xml11.decl.s.crnl.test
7754     @@@DEnt:
7755     @@@@test:value:
7756     <?xml version="1.1"?>$u000D$u0085<p/>
7757     @@@test:domTree:
7758     document {
7759     xml-version: '1.1';
7760     element { }
7761     }
7762     @@XMLTest:
7763     @@@QName: xp.xml11.decl.s.ls.test
7764     @@@DEnt:
7765     @@@@test:value:
7766     <?xml version="1.1"?>$u2028<p/>
7767     @@@test:domTree:
7768     document {
7769     xml-version: '1.1';
7770     element { }
7771     }
7772    
7773     @@XMLTest:
7774 wakaba 1.18 @@@QName: xp.element.type.match.1.test
7775     @@@DEnt:
7776     @@@@test:value:
7777     <p></pa>(err)
7778     @@@c:erred: <[[xp|wf-element-type-match]]> { (1, 4)..(1, 8); }
7779     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7780     @@XMLTest:
7781     @@@QName: xp.element.type.match.2.test
7782     @@@DEnt:
7783     @@@@test:value:
7784     <p><pa></pa></pa>(err)
7785     @@@c:erred: <[[xp|wf-element-type-match]]> { (1, 13)..(1, 17); }
7786     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7787     @@XMLTest:
7788     @@@QName: xp.element.type.match.3.test
7789     @@@DEnt:
7790     @@@@test:value:
7791     <p><pa></p></p>(err)
7792     @@@c:erred: <[[xp|wf-element-type-match]]> { (1, 8)..(1, 11); }
7793     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7794     @@XMLTest:
7795     @@@QName: xp.element.type.match.4.test
7796     @@@DEnt:
7797     @@@@test:value:
7798     <a:p xmlns:a="about:1"></p>(err)
7799     @@@c:erred: <[[xp|wf-element-type-match]]> { (1, 24)..(1, 27); }
7800     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7801     @@XMLTest:
7802     @@@QName: xp.element.type.match.5.test
7803     @@@DEnt:
7804     @@@@test:value:
7805     <a:p xmlns:a="about:1" xmlns:b="about:1"></b:p>(err)
7806     @@@c:erred: <[[xp|wf-element-type-match]]> { (1, 42)..(1, 47); }
7807     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7808    
7809     @@XMLTest:
7810     @@@QName: xp.stag.stago.name.etago.test
7811     @@@DEnt:
7812     @@@@test:value:
7813     <a</a>
7814     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 3); }
7815     @@XMLTest:
7816     @@@QName: xp.stag.stago.name.s.etago.test
7817     @@@DEnt:
7818     @@@@test:value:
7819     <a </a>
7820     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 4); }
7821     @@XMLTest:
7822     @@@QName: xp.stag.stago.name.s.attr.etago.test
7823     @@@DEnt:
7824     @@@@test:value:
7825     <a a="b"</a>
7826     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 9); }
7827     @@XMLTest:
7828     @@@QName: xp.stag.stago.name.s.attr.s.attr.etago.test
7829     @@@DEnt:
7830     @@@@test:value:
7831     <a a="b" c="d"</a>
7832     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 15); }
7833     @@XMLTest:
7834     @@@QName: xp.stag.stago.name.s.attr.s.etago.test
7835     @@@DEnt:
7836     @@@@test:value:
7837     <a a="b" </a>
7838     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 10); }
7839     @@XMLTest:
7840     @@@QName: xp.stag.etag.1.test
7841 wakaba 1.16 @@@DEnt:
7842     @@@@test:value:
7843 wakaba 1.18 <root><a></a></root>
7844 wakaba 1.16 @@@test:domTree:
7845     document {
7846 wakaba 1.18 element {
7847     element {
7848     node-name: 'a';
7849 wakaba 1.16 }
7850     }
7851 wakaba 1.18 }
7852     @@XMLTest:
7853     @@@QName: xp.stag.etag.2.test
7854     @@@DEnt:
7855     @@@@test:value:
7856     <root><ab></ab></root>
7857     @@@test:domTree:
7858     document {
7859 wakaba 1.16 element {
7860 wakaba 1.18 element {
7861     node-name: 'ab';
7862     }
7863 wakaba 1.16 }
7864 wakaba 1.18 }
7865 wakaba 1.16 @@XMLTest:
7866 wakaba 1.18 @@@QName: xp.stag.etag.s.1.test
7867 wakaba 1.16 @@@DEnt:
7868     @@@@test:value:
7869 wakaba 1.18 <root><a ></a ></root>
7870 wakaba 1.16 @@@test:domTree:
7871     document {
7872 wakaba 1.18 element {
7873     element {
7874     node-name: 'a';
7875 wakaba 1.16 }
7876     }
7877 wakaba 1.18 }
7878     @@XMLTest:
7879     @@@QName: xp.etag.1.test
7880     @@@DEnt:
7881     @@@@test:value:
7882     <root><a/></root>
7883     @@@test:domTree:
7884     document {
7885 wakaba 1.16 element {
7886 wakaba 1.18 element {
7887     node-name: 'a';
7888     }
7889 wakaba 1.16 }
7890 wakaba 1.18 }
7891 wakaba 1.16 @@XMLTest:
7892 wakaba 1.18 @@@QName: xp.etag.2.test
7893 wakaba 1.16 @@@DEnt:
7894     @@@@test:value:
7895 wakaba 1.18 <root><a /></root>
7896 wakaba 1.16 @@@test:domTree:
7897     document {
7898     element {
7899 wakaba 1.18 element {
7900     node-name: 'a';
7901     }
7902 wakaba 1.16 }
7903 wakaba 1.18 }
7904 wakaba 1.16 @@XMLTest:
7905 wakaba 1.18 @@@QName: xp.stag.etag.attr.1.test
7906 wakaba 1.16 @@@DEnt:
7907     @@@@test:value:
7908 wakaba 1.18 <root><a at="v"></a></root>
7909 wakaba 1.16 @@@test:domTree:
7910     document {
7911 wakaba 1.18 element {
7912     element {
7913     node-name: 'a';
7914     attribute {
7915     node-name: 'at';
7916     value: 'v';
7917     }
7918 wakaba 1.16 }
7919     }
7920 wakaba 1.18 }
7921     @@XMLTest:
7922     @@@QName: xp.stag.etag.attr.2.test
7923     @@@DEnt:
7924     @@@@test:value:
7925     <root><a at="v" ></a></root>
7926     @@@test:domTree:
7927     document {
7928 wakaba 1.16 element {
7929 wakaba 1.18 element {
7930     node-name: 'a';
7931     attribute {
7932     node-name: 'at';
7933     value: 'v';
7934 wakaba 1.16 }
7935     }
7936     }
7937 wakaba 1.18 }
7938 wakaba 1.16 @@XMLTest:
7939 wakaba 1.18 @@@QName: xp.stag.etag.attr.3.test
7940 wakaba 1.16 @@@DEnt:
7941     @@@@test:value:
7942 wakaba 1.18 <root><a at ="v"></a></root>
7943 wakaba 1.16 @@@test:domTree:
7944     document {
7945 wakaba 1.18 element {
7946     element {
7947     node-name: 'a';
7948     attribute {
7949     node-name: 'at';
7950     value: 'v';
7951     }
7952 wakaba 1.16 }
7953     }
7954 wakaba 1.18 }
7955     @@XMLTest:
7956     @@@QName: xp.stag.etag.attr.4.test
7957     @@@DEnt:
7958     @@@@test:value:
7959     <root><a at= "v"></a></root>
7960     @@@test:domTree:
7961     document {
7962 wakaba 1.16 element {
7963 wakaba 1.18 element {
7964     node-name: 'a';
7965     attribute {
7966     node-name: 'at';
7967     value: 'v';
7968 wakaba 1.16 }
7969     }
7970 wakaba 1.18 }
7971     }
7972     @@XMLTest:
7973     @@@QName: xp.stag.etag.attr.5.test
7974     @@@DEnt:
7975     @@@@test:value:
7976     <root><a at='v'></a></root>
7977     @@@test:domTree:
7978     document {
7979     element {
7980     element {
7981     node-name: 'a';
7982     attribute {
7983     node-name: 'at';
7984     value: 'v';
7985 wakaba 1.16 }
7986     }
7987     }
7988 wakaba 1.18 }
7989 wakaba 1.16 @@XMLTest:
7990 wakaba 1.18 @@@QName: xp.stag.etag.attr.6.test
7991 wakaba 1.16 @@@DEnt:
7992     @@@@test:value:
7993 wakaba 1.18 <root><a at= 'v' ></a></root>
7994 wakaba 1.6 @@@test:domTree:
7995     document {
7996 wakaba 1.18 element {
7997     element {
7998     node-name: 'a';
7999     attribute {
8000     node-name: 'at';
8001     value: 'v';
8002     }
8003 wakaba 1.11 }
8004 wakaba 1.6 }
8005 wakaba 1.18 }
8006     @@XMLTest:
8007     @@@QName: xp.stag.etag.attr.attr.1.test
8008     @@@DEnt:
8009     @@@@test:value:
8010     <root><a at="v" tr="w"></a></root>
8011     @@@test:domTree:
8012     document {
8013 wakaba 1.6 element {
8014 wakaba 1.18 element {
8015     node-name: 'a';
8016     attribute {
8017     node-name: 'at';
8018     value: 'v';
8019 wakaba 1.6 }
8020 wakaba 1.18 attribute {
8021     node-name: 'tr';
8022     value: 'w';
8023 wakaba 1.6 }
8024     }
8025     }
8026 wakaba 1.18 }
8027 wakaba 1.6 @@XMLTest:
8028 wakaba 1.18 @@@QName: xp.stag.etag.attr.attr.2.test
8029 wakaba 1.6 @@@DEnt:
8030     @@@@test:value:
8031 wakaba 1.18 <root><a tr="w" at="v"></a></root>
8032 wakaba 1.6 @@@test:domTree:
8033     document {
8034 wakaba 1.18 element {
8035     element {
8036     node-name: 'a';
8037     attribute {
8038     node-name: 'at';
8039     value: 'v';
8040     }
8041     attribute {
8042     node-name: 'tr';
8043     value: 'w';
8044 wakaba 1.11 }
8045     }
8046 wakaba 1.6 }
8047 wakaba 1.18 }
8048     @@XMLTest:
8049     @@@QName: xp.stag.etag.attr.no.s.attr.test
8050     @@@DEnt:
8051     @@@@test:value:
8052     <root><a at="v"tr="w"></a></root>
8053     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 16)..(1, 17); }
8054     @@XMLTest:
8055     @@@QName: xp.etag.attr.1.test
8056     @@@DEnt:
8057     @@@@test:value:
8058     <root><a at="v" tr="w"></a b="c"></root>
8059     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 28); }
8060     @@XMLTest:
8061     @@@QName: xp.etag.no.etagc.1.test
8062     @@@DEnt:
8063     @@@@test:value:
8064     <root><a at="v" tr="w"></a</root>
8065     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 27)..(1, 28); }
8066     @@XMLTest:
8067     @@@QName: xp.etag.no.etagc.2.test
8068     @@@DEnt:
8069     @@@@test:value:
8070     <root><a at="v" tr="w"></a </root>
8071     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 29)..(1, 30); }
8072     @@XMLTest:
8073     @@@QName: xp.mtag.attr.1.test
8074     @@@DEnt:
8075     @@@@test:value:
8076     <root><a b="c"/></root>
8077     @@@test:domTree:
8078     document {
8079 wakaba 1.6 element {
8080 wakaba 1.18 element {
8081     node-name: 'a';
8082     attribute {
8083     node-name: 'b';
8084     value: 'c';
8085 wakaba 1.6 }
8086     }
8087 wakaba 1.8 }
8088 wakaba 1.18 }
8089 wakaba 1.11 @@XMLTest:
8090 wakaba 1.18 @@@QName: xp.mtag.attr.2.test
8091 wakaba 1.11 @@@DEnt:
8092     @@@@test:value:
8093 wakaba 1.18 <root><a b="c" /></root>
8094 wakaba 1.11 @@@test:domTree:
8095     document {
8096 wakaba 1.18 element {
8097     element {
8098     node-name: 'a';
8099     attribute {
8100     node-name: 'b';
8101     value: 'c';
8102     }
8103 wakaba 1.11 }
8104     }
8105 wakaba 1.18 }
8106 wakaba 1.11 @@XMLTest:
8107 wakaba 1.18 @@@QName: xp.mtag.attr.3.test
8108 wakaba 1.11 @@@DEnt:
8109     @@@@test:value:
8110 wakaba 1.18 <root><a b='c'/></root>
8111 wakaba 1.11 @@@test:domTree:
8112     document {
8113     element {
8114 wakaba 1.18 element {
8115     node-name: 'a';
8116     attribute {
8117     node-name: 'b';
8118     value: 'c';
8119     }
8120     }
8121 wakaba 1.11 }
8122 wakaba 1.18 }
8123 wakaba 1.11 @@XMLTest:
8124 wakaba 1.18 @@@QName: xp.mtag.attr.4.test
8125 wakaba 1.11 @@@DEnt:
8126     @@@@test:value:
8127 wakaba 1.18 <root><a b="c" d="e"/></root>
8128 wakaba 1.11 @@@test:domTree:
8129     document {
8130     element {
8131 wakaba 1.18 element {
8132     node-name: 'a';
8133     attribute {
8134     node-name: 'b';
8135     value: 'c';
8136     }
8137     attribute {
8138     node-name: 'd';
8139     value: 'e';
8140     }
8141 wakaba 1.11 }
8142     }
8143 wakaba 1.18 }
8144    
8145     @@XMLTest:
8146     @@@QName: xp.attvalue.lt.1.test
8147     @@@DEnt:
8148     @@@@test:value:
8149     <a b="aa<dd"/>
8150     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 9); }
8151     @@XMLTest:
8152     @@@QName: xp.attvalue.lt.2.test
8153     @@@DEnt:
8154     @@@@test:value:
8155     <a b='aa<dd'/>
8156     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 9); }
8157     @@XMLTest:
8158     @@@QName: xp.attvalue.amp.1.test
8159     @@@DEnt:
8160     @@@@test:value:
8161     <a b="aa& dd"/>
8162     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 9)..(1, 12); }
8163     @@XMLTest:
8164     @@@QName: xp.attvalue.amp.2.test
8165     @@@DEnt:
8166     @@@@test:value:
8167     <a b='aa& dd'/>
8168     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 9)..(1, 12); }
8169     @@XMLTest:
8170     @@@QName: xp.attvalue.amp.3.test
8171     @@@DEnt:
8172     @@@@test:value:
8173     <a b="aa&# dd"/>
8174     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 9)..(1, 13); }
8175     @@XMLTest:
8176     @@@QName: xp.attvalue.amp.4.test
8177     @@@DEnt:
8178     @@@@test:value:
8179     <a b="aa&#x dd"/>
8180     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 9)..(1, 14); }
8181    
8182     @@XMLTest:
8183     @@@QName: xp.unique.att.spec.1.test
8184     @@@DEnt:
8185     @@@@test:value:
8186     <a b="c" b="d"/>
8187     @@@c:erred: <[[xp|wf-unique-att-spec]]> { (1, 4)..(1, 14); }
8188     @@XMLTest:
8189     @@@QName: xp.unique.att.spec.2.test
8190     @@@DEnt:
8191     @@@@test:value:
8192     <a d:b="c" d:b="d" xmlns:d="about:2"/>
8193     @@@c:erred: <[[xp|wf-unique-att-spec]]> { (1, 4)..(1, 18); }
8194    
8195     @@XMLTest:
8196     @@@QName: xp.no.external.entity.references.1.test
8197     @@@DEnt:
8198     @@@@test:value:
8199     <!DOCTYPE a [
8200     <!ENTITY ent SYSTEM "something">
8201     ]>
8202     <a b="c&ent;"/>
8203     @@@c:erred: <[[xp|wf-no-external-entity-references]]> { (4, 8)..(4, 12); }
8204     @@XMLTest:
8205     @@@QName: xp.no.external.entity.references.2.test
8206     @@@DEnt:
8207     @@@@test:value:
8208     <!DOCTYPE a [
8209     <!NOTATION n SYSTEM "notation">
8210     <!ENTITY ent SYSTEM "something" NDATA n>
8211     ]>
8212     <a b="c&ent;"/>
8213     @@@c:erred: <[[xp|wf-no-external-entity-references]]> { (5, 8)..(5, 12); }
8214     @@XMLTest:
8215     @@@QName: xp.no.external.entity.references.3.test
8216     @@@DEnt:
8217     @@@@test:value:
8218     <!DOCTYPE a [
8219     <!ENTITY ent SYSTEM "something">
8220     <!ENTITY ent2 "ddd&ent;">
8221     ]>
8222     <a b="c&ent2;"/>
8223     @@@c:erred: <[[xp|wf-no-external-entity-references]]> { (1, 4)..(1, 8); }
8224     @@XMLTest:
8225     @@@QName: xp.no.external.entity.references.4.test
8226     @@@DEnt:
8227     @@@@test:value:
8228     <!DOCTYPE a [
8229     <!NOTATION n SYSTEM "notation">
8230     <!ENTITY ent SYSTEM "something" NDATA n>
8231     <!ENTITY ent2 "ddd&ent;">
8232     ]>
8233     <a b="c&ent2;"/>
8234 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
8235 wakaba 1.18 @@@c:erred: <[[xp|wf-no-external-entity-references]]> { (1, 4)..(1, 8); }
8236 wakaba 1.23 @@@c:erred: <[[xp|wf-parsed-entity]]> { }
8237 wakaba 1.18 @@XMLTest:
8238     @@@QName: xp.no.lt.in.attr.value.1.test
8239     @@@DEnt:
8240     @@@@test:value:
8241     <!DOCTYPE a [
8242     <!ENTITY ent "aa<bb">
8243     ]>
8244     <a b="c&ent;"/>
8245 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
8246 wakaba 1.18 @@@c:erred: <[[xp|wf-no-lt-in-attribute-values]]> { (1, 3); }
8247 wakaba 1.20 @@@c:erred:
8248     @@@@@: <[[xp|wf-syntax-error]]> { (1, 3)..(1, 6); }
8249     @@@@enImplNote: When entity node is created.
8250 wakaba 1.18 @@XMLTest:
8251 wakaba 1.34 @@@QName: xp.no.lt.in.attr.value.1.2.test
8252     @@@DEnt:
8253     @@@@test:value:
8254     <!DOCTYPE a [
8255     <!ENTITY ent "aa<bb">
8256     ]>
8257     <a b="c&ent;"/>
8258     @@@cfg:entity-replacement-tree: 0
8259     @@@c:erred: <[[xp|wf-no-lt-in-attribute-values]]> { (1, 3); }
8260     @@XMLTest:
8261 wakaba 1.18 @@@QName: xp.no.lt.in.attr.value.2.test
8262     @@@DEnt:
8263     @@@@test:value:
8264     <!DOCTYPE a [
8265     <!ENTITY ent "aa<bb">
8266     <!ENTITY ent2 "ccc&ent;">
8267     ]>
8268     <a b="c&ent2;"/>
8269 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
8270 wakaba 1.18 @@@c:erred: <[[xp|wf-no-lt-in-attribute-values]]> { (1, 3); }
8271 wakaba 1.20 @@@c:erred:
8272     @@@@@: <[[xp|wf-syntax-error]]> { (1, 3)..(1, 6); }
8273     @@@@enImplNote: When entity node is created.
8274 wakaba 1.18 @@XMLTest:
8275     @@@QName: xp.no.lt.in.attr.value.3.test
8276     @@@DEnt:
8277     @@@@test:value:
8278     <!DOCTYPE a [
8279     <!ENTITY ent "aa&#x3C;bb">
8280     ]>
8281     <a b="c&ent;"/>
8282 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
8283 wakaba 1.18 @@@c:erred: <[[xp|wf-no-lt-in-attribute-values]]> { (1, 3); }
8284 wakaba 1.20 @@@c:erred:
8285     @@@@@: <[[xp|wf-syntax-error]]> { (1, 3)..(1, 6); }
8286     @@@@enImplNote: When entity node is created.
8287 wakaba 1.18 @@XMLTest:
8288     @@@QName: xp.no.lt.in.attr.value.4.test
8289     @@@DEnt:
8290     @@@@test:value:
8291     <!DOCTYPE a [
8292     <!ENTITY ent "aa&#x3C;bb">
8293     <!ENTITY ent2 "ccc&ent;">
8294     ]>
8295     <a b="c&ent2;"/>
8296 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
8297 wakaba 1.18 @@@c:erred: <[[xp|wf-no-lt-in-attribute-values]]> { (1, 3); }
8298 wakaba 1.20 @@@c:erred:
8299     @@@@@: <[[xp|wf-syntax-error]]> { (1, 3)..(1, 6); }
8300     @@@@enImplNote: When entity node is created.
8301 wakaba 1.11 @@XMLTest:
8302 wakaba 1.18 @@@QName: xp.ger.lt.in.attr.value.1.test
8303 wakaba 1.11 @@@DEnt:
8304     @@@@test:value:
8305     <!DOCTYPE a [
8306 wakaba 1.18 <!ENTITY ent "aa&lt;bb">
8307 wakaba 1.11 ]>
8308 wakaba 1.18 <a b="c&ent;"/>
8309 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
8310 wakaba 1.11 @@@test:domTree:
8311     document {
8312     document-type {
8313     general-entity {
8314     node-name: 'ent';
8315 wakaba 1.18 text-content: 'aa<bb';
8316 wakaba 1.11 }
8317     }
8318     element {
8319 wakaba 1.18 attribute {
8320     node-name: 'b';
8321     text { data: 'c'; }
8322     general-entity-reference {
8323 wakaba 1.34 manakai-expanded: true;
8324 wakaba 1.18 node-name: 'ent';
8325     text-content: 'aa<bb';
8326     }
8327     }
8328 wakaba 1.11 }
8329     }
8330     @@XMLTest:
8331 wakaba 1.18 @@@QName: xp.ger.lt.in.attr.value.2.test
8332 wakaba 1.11 @@@DEnt:
8333     @@@@test:value:
8334     <!DOCTYPE a [
8335 wakaba 1.18 <!ENTITY ent "aa&lt;bb">
8336     <!ENTITY ent2 "ccc&ent;">
8337 wakaba 1.11 ]>
8338 wakaba 1.18 <a b="c&ent2;"/>
8339 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
8340 wakaba 1.11 @@@test:domTree:
8341     document {
8342     document-type {
8343     general-entity {
8344 wakaba 1.18 node-name: 'ent';
8345     text-content: 'aa<bb';
8346     }
8347     general-entity {
8348     node-name: 'ent2';
8349     text { data: 'ccc'; }
8350     general-entity-reference {
8351     node-name: 'ent';
8352     text-content: 'aa<bb';
8353 wakaba 1.34 manakai-expanded: true;
8354 wakaba 1.18 }
8355 wakaba 1.11 }
8356     }
8357     element {
8358 wakaba 1.18 attribute {
8359     node-name: 'b';
8360     text { data: 'c'; }
8361     general-entity-reference {
8362     node-name: 'ent2';
8363     text { data: 'ccc'; }
8364     general-entity-reference {
8365     node-name: 'ent';
8366     text-content: 'aa<bb';
8367 wakaba 1.34 manakai-expanded: true;
8368 wakaba 1.18 }
8369 wakaba 1.34 manakai-expanded: true;
8370 wakaba 1.18 }
8371     }
8372 wakaba 1.11 }
8373     }
8374    
8375 wakaba 1.8 @@XMLTest:
8376 wakaba 1.18 @@@QName: xp.doctype.intsubset.pi.test
8377 wakaba 1.8 @@@DEnt:
8378     @@@@test:value:
8379     <!DOCTYPE a [
8380 wakaba 1.18 <?pi data ?>
8381 wakaba 1.8 ]>
8382     <a></a>
8383     @@@test:domTree:
8384     document {
8385     xml-version: '1.0';
8386     xml-encoding: null;
8387     xml-standalone: false;
8388     document-type {
8389     node-name: 'a';
8390 wakaba 1.18 pi {
8391     target: 'pi';
8392     data: 'data ';
8393 wakaba 1.8 }
8394     }
8395     element {
8396     namespace-uri: null;
8397 wakaba 1.18 prefix: null;
8398 wakaba 1.8 local-name: 'a';
8399 wakaba 1.18 text-content: '';
8400 wakaba 1.8 }
8401     }
8402 wakaba 1.18 @@@enImplNote:
8403     A DOM PI node in doctype node is a manakai extension.
8404    
8405    
8406 wakaba 1.8 @@XMLTest:
8407 wakaba 1.18 @@@QName: xp.doctype.intsubset.entity.general.internal.test
8408 wakaba 1.8 @@@DEnt:
8409     @@@@test:value:
8410     <!DOCTYPE a [
8411 wakaba 1.18 <!ENTITY entity "entity value">
8412 wakaba 1.8 ]>
8413     <a></a>
8414 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
8415 wakaba 1.8 @@@test:domTree:
8416     document {
8417     xml-version: '1.0';
8418     xml-encoding: null;
8419     xml-standalone: false;
8420     document-type {
8421     node-name: 'a';
8422 wakaba 1.18 general-entity {
8423     node-name: 'entity';
8424     text-content: 'entity value';
8425     has-replacement-tree: true;
8426 wakaba 1.8 }
8427     }
8428     element {
8429     namespace-uri: null;
8430 wakaba 1.18 prefix: null;
8431 wakaba 1.8 local-name: 'a';
8432 wakaba 1.18 text-content: '';
8433 wakaba 1.8 }
8434     }
8435     @@XMLTest:
8436 wakaba 1.18 @@@QName: xp.doctype.intsubset.entity.parameter.internal.test
8437 wakaba 1.8 @@@DEnt:
8438     @@@@test:value:
8439     <!DOCTYPE a [
8440 wakaba 1.18 <!ENTITY % entity "entity value">
8441 wakaba 1.8 ]>
8442     <a></a>
8443     @@@test:domTree:
8444     document {
8445     xml-version: '1.0';
8446     xml-encoding: null;
8447     xml-standalone: false;
8448     document-type {
8449     node-name: 'a';
8450     }
8451     element {
8452     namespace-uri: null;
8453 wakaba 1.18 prefix: null;
8454 wakaba 1.8 local-name: 'a';
8455 wakaba 1.18 text-content: '';
8456 wakaba 1.8 }
8457     }
8458 wakaba 1.18
8459 wakaba 1.8 @@XMLTest:
8460 wakaba 1.18 @@@QName: xp.doctype.internal.entity.root.element.text.only.test
8461 wakaba 1.8 @@@DEnt:
8462     @@@@test:value:
8463     <!DOCTYPE a [
8464 wakaba 1.18 <!ENTITY entity "entity value">
8465 wakaba 1.8 ]>
8466 wakaba 1.18 <a>&entity;</a>
8467 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
8468 wakaba 1.8 @@@test:domTree:
8469     document {
8470     xml-version: '1.0';
8471     xml-encoding: null;
8472     xml-standalone: false;
8473     document-type {
8474     node-name: 'a';
8475 wakaba 1.18 general-entity {
8476     node-name: 'entity';
8477     text-content: 'entity value';
8478     has-replacement-tree: true;
8479 wakaba 1.8 }
8480     }
8481     element {
8482     namespace-uri: null;
8483 wakaba 1.18 prefix: null;
8484 wakaba 1.8 local-name: 'a';
8485 wakaba 1.18 general-entity-reference {
8486     node-name: 'entity';
8487     text {
8488     data: 'entity value';
8489     }
8490 wakaba 1.34 manakai-expanded: true;
8491 wakaba 1.10 }
8492 wakaba 1.9 }
8493     }
8494     @@XMLTest:
8495 wakaba 1.18 @@@QName: xp.doctype.internal.entity.root.element.text.mult.test
8496 wakaba 1.9 @@@DEnt:
8497     @@@@test:value:
8498     <!DOCTYPE a [
8499 wakaba 1.18 <!ENTITY entity "entity value">
8500 wakaba 1.9 ]>
8501 wakaba 1.18 <a>&entity; and &entity;</a>
8502 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
8503 wakaba 1.9 @@@test:domTree:
8504     document {
8505     xml-version: '1.0';
8506     xml-encoding: null;
8507     xml-standalone: false;
8508     document-type {
8509     node-name: 'a';
8510 wakaba 1.18 general-entity {
8511     node-name: 'entity';
8512     text-content: 'entity value';
8513     has-replacement-tree: true;
8514 wakaba 1.9 }
8515     }
8516     element {
8517     namespace-uri: null;
8518 wakaba 1.18 prefix: null;
8519 wakaba 1.9 local-name: 'a';
8520 wakaba 1.18 general-entity-reference {
8521     node-name: 'entity';
8522     text {
8523     data: 'entity value';
8524     }
8525 wakaba 1.34 manakai-expanded: true;
8526 wakaba 1.18 }
8527     text { data: ' and '; }
8528     general-entity-reference {
8529     node-name: 'entity';
8530     text {
8531     data: 'entity value';
8532     }
8533 wakaba 1.34 manakai-expanded: true;
8534 wakaba 1.10 }
8535 wakaba 1.9 }
8536     }
8537     @@XMLTest:
8538 wakaba 1.18 @@@QName: xp.doctype.internal.entity.root.element.text.element.test
8539 wakaba 1.9 @@@DEnt:
8540     @@@@test:value:
8541     <!DOCTYPE a [
8542 wakaba 1.18 <!ENTITY entity "entity <p>value</p> with <e>element</e> ">
8543 wakaba 1.9 ]>
8544 wakaba 1.18 <a>&entity;</a>
8545 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
8546 wakaba 1.18 @@@test:domTree:
8547     document {
8548     xml-version: '1.0';
8549     xml-encoding: null;
8550     xml-standalone: false;
8551     document-type {
8552     node-name: 'a';
8553     general-entity {
8554     node-name: 'entity';
8555     has-replacement-tree: true;
8556     text { data: 'entity '; }
8557     element {
8558     node-name: 'p';
8559     text-content: 'value';
8560     }
8561     text { data: ' with '; }
8562     element {
8563     node-name: 'e';
8564     text-content: 'element';
8565     }
8566 wakaba 1.20 text { data: ' '; }
8567 wakaba 1.18 }
8568     }
8569     element {
8570     namespace-uri: null;
8571     prefix: null;
8572     local-name: 'a';
8573     general-entity-reference {
8574     node-name: 'entity';
8575 wakaba 1.34 manakai-expanded: true;
8576 wakaba 1.18 text {
8577     data: 'entity ';
8578     }
8579     element {
8580     namespace-uri: null;
8581     prefix: null;
8582     local-name: 'p';
8583     text {
8584     data: 'value';
8585     }
8586     }
8587     text {
8588     data: ' with ';
8589     }
8590     element {
8591     namespace-uri: null;
8592     prefix: null;
8593     local-name: 'e';
8594     text {
8595     data: 'element';
8596     }
8597     }
8598     text {
8599     data: ' ';
8600     }
8601     }
8602     }
8603     }
8604     @@XMLTest:
8605     @@@QName: xp.doctype.internal.entity.root.element.text.in.ent.test
8606     @@@DEnt:
8607     @@@@test:value:
8608     <!DOCTYPE a [
8609     <!ENTITY entity1 "entity value">
8610     <!ENTITY entity2 "e&entity1;n">
8611     ]>
8612     <a>&entity2;</a>
8613 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
8614 wakaba 1.18 @@@test:domTree:
8615     document {
8616     xml-version: '1.0';
8617     xml-encoding: null;
8618     xml-standalone: false;
8619     document-type {
8620     node-name: 'a';
8621     general-entity {
8622     node-name: 'entity1';
8623     text-content: 'entity value';
8624     }
8625     general-entity {
8626     node-name: 'entity2';
8627     text { data: 'e'; }
8628     general-entity-reference {
8629     node-name: 'entity1';
8630     text-content: 'entity value';
8631 wakaba 1.34 manakai-expanded: true;
8632 wakaba 1.18 }
8633     text { data: 'n'; }
8634     }
8635     }
8636     element {
8637     namespace-uri: null;
8638     prefix: null;
8639     local-name: 'a';
8640     general-entity-reference {
8641     node-name: 'entity2';
8642     text { data: 'e'; }
8643 wakaba 1.34 manakai-expanded: true;
8644 wakaba 1.18 general-entity-reference {
8645     node-name: 'entity1';
8646     text {
8647     data: 'entity value';
8648     }
8649 wakaba 1.34 manakai-expanded: true;
8650 wakaba 1.18 }
8651     text { data: 'n'; }
8652     }
8653     }
8654     }
8655    
8656     @@XMLTest:
8657     @@@QName: xp.doctype.entity.value.charref.test
8658     @@@DEnt:
8659     @@@@test:value:
8660     <!DOCTYPE a [
8661     <!ENTITY entity1 "entity &#x21;value&#35;">
8662     <!ENTITY entity2 '&#x21;value&#35;'>
8663     ]>
8664     <a></a>
8665 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
8666 wakaba 1.18 @@@test:domTree:
8667     document {
8668     document-type {
8669     general-entity {
8670     node-name: 'entity1';
8671     text-content: 'entity !value#';
8672     has-replacement-tree: true;
8673     }
8674     general-entity {
8675     node-name: 'entity2';
8676     text-content: '!value#';
8677     has-replacement-tree: true;
8678     }
8679     }
8680     element { }
8681     }
8682    
8683     @@XMLTest:
8684     @@@QName: xp.predefined.in.content.test
8685     @@@DEnt:
8686     @@@@test:value:
8687     <a>_&lt;_&gt;_&quot;_&apos;_&amp;_</a>
8688     @@@test:domTree:
8689     document {
8690     element {
8691     text-content: '_<_>_"_' U+0027 '_&_';
8692     }
8693     }
8694     @@XMLTest:
8695     @@@QName: xp.predefined.in.attr.test
8696     @@@DEnt:
8697     @@@@test:value:
8698     <a at="_&lt;_&gt;_&quot;_&apos;_&amp;_"></a>
8699     @@@test:domTree:
8700     document {
8701     element {
8702     attribute {
8703     node-name: 'at';
8704     text-content: '_<_>_"_' U+0027 '_&_';
8705     }
8706     }
8707     }
8708     @@XMLTest:
8709     @@@QName: xp.predefined.in.content.in.entity.test
8710     @@@DEnt:
8711     @@@@test:value:
8712     <!DOCTYPE a [
8713     <!ENTITY ent "_&lt;_&gt;_&quot;_&apos;_&amp;_">
8714     ]>
8715     <a>&ent;</a>
8716 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
8717 wakaba 1.18 @@@test:domTree:
8718     document {
8719     document-type {
8720     general-entity {
8721     node-name: 'ent';
8722     text-content: '_<_>_"_' U+0027 '_&_';
8723     }
8724     }
8725     element {
8726     text-content: '_<_>_"_' U+0027 '_&_';
8727     }
8728     }
8729     @@XMLTest:
8730     @@@QName: xp.predefined.decl.ignore.test
8731     @@@DEnt:
8732     @@@@test:value:
8733     <!DOCTYPE a [
8734     <!ENTITY lt "&#x26;#x3C;">
8735     <!ENTITY gt "&#x3E;">
8736     <!ENTITY amp "&#x26;#x26;">
8737     <!ENTITY quot "&#x22;">
8738     <!ENTITY apos "&#x27;">
8739     <!ENTITY other "other">
8740     ]>
8741     <a>_&lt;_&gt;_&quot;_&apos;_&amp;_&other;_</a>
8742 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
8743 wakaba 1.18 @@@test:domTree:
8744     document {
8745     document-type {
8746     general-entity {
8747     node-name: 'other';
8748     text-content: 'other';
8749     }
8750     }
8751     element {
8752     text-content: '_<_>_"_' U+0027 '_&_other_';
8753     }
8754     }
8755    
8756     @@XMLTest:
8757     @@@QName: xp.doctype.internal.attr.empty.test
8758     @@@DEnt:
8759     @@@@test:value:
8760     <!DOCTYPE a [
8761     <!ATTLIST a>
8762     ]>
8763     <a></a>
8764     @@@test:domTree:
8765     document {
8766     xml-version: '1.0';
8767     xml-encoding: null;
8768     xml-standalone: false;
8769     document-type {
8770     node-name: 'a';
8771     element-type-definition {
8772     node-name: 'a';
8773     }
8774     }
8775     element {
8776     namespace-uri: null;
8777     local-name: 'a';
8778     }
8779     }
8780     @@XMLTest:
8781     @@@QName: xp.doctype.internal.attr.cdata.implied.test
8782     @@@DEnt:
8783     @@@@test:value:
8784     <!DOCTYPE a [
8785     <!ATTLIST a
8786     at CDATA #IMPLIED
8787     >
8788     ]>
8789     <a></a>
8790 wakaba 1.9 @@@test:domTree:
8791     document {
8792     xml-version: '1.0';
8793     xml-encoding: null;
8794     xml-standalone: false;
8795     document-type {
8796     node-name: 'a';
8797     element-type-definition {
8798     node-name: 'a';
8799     attribute-definition {
8800     node-name: 'at';
8801 wakaba 1.18 declared-type: const (CDATA_ATTR);
8802 wakaba 1.9 allowed-tokens: DOMStringList ();
8803 wakaba 1.18 default-type: const (IMPLIED_DEFAULT);
8804     text-content: '';
8805 wakaba 1.9 }
8806     }
8807     }
8808     element {
8809     namespace-uri: null;
8810     local-name: 'a';
8811 wakaba 1.18 }
8812     }
8813     @@XMLTest:
8814     @@@QName: xp.doctype.internal.attr.types.implied.test
8815     @@@DEnt:
8816     @@@@test:value:
8817     <!DOCTYPE a [
8818     <!ATTLIST a
8819     at1 ID #IMPLIED
8820     at2 IDREF #IMPLIED
8821     at3 IDREFS #IMPLIED
8822     at4 ENTITY #IMPLIED
8823     at5 ENTITIES #IMPLIED
8824     at6 NMTOKEN #IMPLIED
8825     at7 NMTOKENS #IMPLIED
8826     at8 NOTATION (n1 | n2|n3) #IMPLIED
8827     at9 (e1| e2| e3 ) #IMPLIED
8828     >
8829     ]>
8830     <a></a>
8831     @@@test:domTree:
8832     document {
8833     xml-version: '1.0';
8834     xml-encoding: null;
8835     xml-standalone: false;
8836     document-type {
8837     node-name: 'a';
8838     element-type-definition {
8839     node-name: 'a';
8840     attribute-definition {
8841     node-name: 'at1';
8842     declared-type: const (ID_ATTR);
8843     allowed-tokens: DOMStringList ();
8844     default-type: const (IMPLIED_DEFAULT);
8845     text-content: '';
8846     }
8847     attribute-definition {
8848     node-name: 'at2';
8849     declared-type: const (IDREF_ATTR);
8850     allowed-tokens: DOMStringList ();
8851     default-type: const (IMPLIED_DEFAULT);
8852     text-content: '';
8853     }
8854     attribute-definition {
8855     node-name: 'at3';
8856     declared-type: const (IDREFS_ATTR);
8857     allowed-tokens: DOMStringList ();
8858     default-type: const (IMPLIED_DEFAULT);
8859     text-content: '';
8860     }
8861     attribute-definition {
8862     node-name: 'at4';
8863     declared-type: const (ENTITY_ATTR);
8864     allowed-tokens: DOMStringList ();
8865     default-type: const (IMPLIED_DEFAULT);
8866     text-content: '';
8867     }
8868     attribute-definition {
8869     node-name: 'at5';
8870     declared-type: const (ENTITIES_ATTR);
8871     allowed-tokens: DOMStringList ();
8872     default-type: const (IMPLIED_DEFAULT);
8873     text-content: '';
8874     }
8875     attribute-definition {
8876     node-name: 'at6';
8877     declared-type: const (NMTOKEN_ATTR);
8878     allowed-tokens: DOMStringList ();
8879     default-type: const (IMPLIED_DEFAULT);
8880     text-content: '';
8881     }
8882     attribute-definition {
8883     node-name: 'at7';
8884     declared-type: const (NMTOKENS_ATTR);
8885     allowed-tokens: DOMStringList ();
8886     default-type: const (IMPLIED_DEFAULT);
8887     text-content: '';
8888     }
8889     attribute-definition {
8890     node-name: 'at8';
8891     declared-type: const (NOTATION_ATTR);
8892     allowed-tokens: DOMStringList ('n1', 'n2', 'n3');
8893     default-type: const (IMPLIED_DEFAULT);
8894     text-content: '';
8895     }
8896     attribute-definition {
8897     node-name: 'at9';
8898     declared-type: const (ENUMERATION_ATTR);
8899     allowed-tokens: DOMStringList ('e1', 'e2', 'e3');
8900     default-type: const (IMPLIED_DEFAULT);
8901     text-content: '';
8902     }
8903     }
8904     }
8905     element {
8906     namespace-uri: null;
8907     local-name: 'a';
8908     }
8909     }
8910     @@XMLTest:
8911     @@@QName: xp.doctype.internal.attr.cdata.defaults.test
8912     @@@DEnt:
8913     @@@@test:value:
8914     <!DOCTYPE a [
8915     <!ATTLIST a
8916     at1 CDATA #IMPLIED
8917     at2 CDATA #REQUIRED
8918     at3 CDATA #FIXED "value3"
8919     at4 CDATA "value4"
8920     at5 CDATA #FIXED 'value5'
8921     at6 CDATA 'value6'
8922     >
8923     ]>
8924     <a></a>
8925     @@@test:domTree:
8926     document {
8927     xml-version: '1.0';
8928     xml-encoding: null;
8929     xml-standalone: false;
8930     document-type {
8931     node-name: 'a';
8932     element-type-definition {
8933     node-name: 'a';
8934     attribute-definition {
8935     node-name: 'at1';
8936     declared-type: const (CDATA_ATTR);
8937     allowed-tokens: DOMStringList ();
8938     default-type: const (IMPLIED_DEFAULT);
8939     text-content: '';
8940     }
8941     attribute-definition {
8942     node-name: 'at2';
8943     declared-type: const (CDATA_ATTR);
8944     allowed-tokens: DOMStringList ();
8945     default-type: const (REQUIRED_DEFAULT);
8946     text-content: '';
8947     }
8948     attribute-definition {
8949     node-name: 'at3';
8950     declared-type: const (CDATA_ATTR);
8951     allowed-tokens: DOMStringList ();
8952     default-type: const (FIXED_DEFAULT);
8953     text-content: 'value3';
8954     }
8955     attribute-definition {
8956     node-name: 'at4';
8957     declared-type: const (CDATA_ATTR);
8958     allowed-tokens: DOMStringList ();
8959     default-type: const (EXPLICIT_DEFAULT);
8960     text-content: 'value4';
8961     }
8962     attribute-definition {
8963     node-name: 'at5';
8964     declared-type: const (CDATA_ATTR);
8965     allowed-tokens: DOMStringList ();
8966     default-type: const (FIXED_DEFAULT);
8967     text-content: 'value5';
8968     }
8969     attribute-definition {
8970     node-name: 'at6';
8971     declared-type: const (CDATA_ATTR);
8972     allowed-tokens: DOMStringList ();
8973     default-type: const (EXPLICIT_DEFAULT);
8974     text-content: 'value6';
8975     }
8976     }
8977     }
8978     element {
8979     namespace-uri: null;
8980     local-name: 'a';
8981     attribute {
8982     node-name: 'at3';
8983     text-content: 'value3';
8984     specified: false;
8985     }
8986     attribute {
8987     node-name: 'at4';
8988     text-content: 'value4';
8989     specified: false;
8990     }
8991     attribute {
8992     node-name: 'at5';
8993     text-content: 'value5';
8994     specified: false;
8995     }
8996     attribute {
8997     node-name: 'at6';
8998     text-content: 'value6';
8999     specified: false;
9000     }
9001     }
9002     }
9003    
9004     @@XMLTest:
9005     @@@QName: xp.doctype.internal.attr.cdata.default.normalize.test
9006     @@@DEnt:
9007     @@@@test:value:
9008     <!DOCTYPE a [
9009     <!ATTLIST a
9010     at CDATA " default &#x0A;value "
9011     >
9012     ]>
9013     <a></a>
9014     @@@test:domTree:
9015     document {
9016     xml-version: '1.0';
9017     xml-encoding: null;
9018     xml-standalone: false;
9019     document-type {
9020     node-name: 'a';
9021     element-type-definition {
9022     node-name: 'a';
9023     attribute-definition {
9024     node-name: 'at';
9025     declared-type: const (CDATA_ATTR);
9026     allowed-tokens: DOMStringList ();
9027     default-type: const (EXPLICIT_DEFAULT);
9028     text-content: ' default ' U+000A 'value ';
9029     }
9030     }
9031     }
9032     element {
9033     namespace-uri: null;
9034     local-name: 'a';
9035     attribute {
9036     node-name: 'at';
9037     text-content: ' default ' U+000A 'value ';
9038     specified: false;
9039     }
9040     }
9041     }
9042     @@XMLTest:
9043     @@@QName: xp.doctype.internal.attr.nmtoken.default.normalize.test
9044     @@@DEnt:
9045     @@@@test:value:
9046     <!DOCTYPE a [
9047     <!ATTLIST a
9048     at NMTOKEN " default &#x0A;value "
9049     >
9050     ]>
9051     <a></a>
9052     @@@test:domTree:
9053     document {
9054     xml-version: '1.0';
9055     xml-encoding: null;
9056     xml-standalone: false;
9057     document-type {
9058     node-name: 'a';
9059     element-type-definition {
9060     node-name: 'a';
9061     attribute-definition {
9062     node-name: 'at';
9063     declared-type: const (NMTOKEN_ATTR);
9064     allowed-tokens: DOMStringList ();
9065     default-type: const (EXPLICIT_DEFAULT);
9066     text-content: ' default ' U+000A 'value ';
9067     }
9068     }
9069     }
9070     element {
9071     namespace-uri: null;
9072     local-name: 'a';
9073     attribute {
9074     node-name: 'at';
9075     text-content: ' default ' U+000A 'value ';
9076     specified: false;
9077     }
9078     }
9079     }
9080    
9081     @@XMLTest:
9082     @@@QName: xp.doctype.attrtype.no-value.test
9083     @@@DEnt:
9084     @@@@test:value:
9085     <!DOCTYPE a>
9086     <a at=" at value "></a>
9087     @@@test:domTree:
9088     document {
9089     xml-version: '1.0';
9090     xml-encoding: null;
9091     xml-standalone: false;
9092     document-type { }
9093     element {
9094     namespace-uri: null;
9095     local-name: 'a';
9096     attribute {
9097     namespace-uri: null;
9098     local-name: 'at';
9099     value: ' at value ';
9100     text {
9101     data: ' at value ';
9102     }
9103     schema-type-info: TypeInfo (null, null);
9104     specified: true;
9105     }
9106     }
9107     }
9108     @@XMLTest:
9109     @@@QName: xp.doctype.attrtype.cdata.test
9110     @@@DEnt:
9111     @@@@test:value:
9112     <!DOCTYPE a [
9113     <!ATTLIST a
9114     at CDATA #IMPLIED
9115     >
9116     ]>
9117     <a at=" at value "></a>
9118     @@@test:domTree:
9119     document {
9120     xml-version: '1.0';
9121     xml-encoding: null;
9122     xml-standalone: false;
9123     document-type { }
9124     element {
9125     namespace-uri: null;
9126     local-name: 'a';
9127     attribute {
9128     namespace-uri: null;
9129     local-name: 'at';
9130     value: ' at value ';
9131     text {
9132     data: ' at value ';
9133     }
9134     schema-type-info:
9135     TypeInfo ('http://www.w3.org/TR/REC-xml', 'CDATA');
9136     specified: true;
9137     }
9138     }
9139     }
9140     @@XMLTest:
9141     @@@QName: xp.doctype.attrtype.nmtoken.test
9142     @@@DEnt:
9143     @@@@test:value:
9144     <!DOCTYPE a [
9145     <!ATTLIST a
9146     at NMTOKEN #IMPLIED
9147     >
9148     ]>
9149     <a at=" at value "></a>
9150     @@@test:domTree:
9151     document {
9152     xml-version: '1.0';
9153     xml-encoding: null;
9154     xml-standalone: false;
9155     document-type { }
9156     element {
9157     namespace-uri: null;
9158     local-name: 'a';
9159     attribute {
9160     namespace-uri: null;
9161     local-name: 'at';
9162     value: 'at value';
9163     text {
9164     data: ' at value ';
9165     }
9166     schema-type-info:
9167     TypeInfo ('http://www.w3.org/TR/REC-xml', 'NMTOKEN');
9168     specified: true;
9169     }
9170     }
9171     }
9172    
9173     @@XMLTest:
9174     @@@QName: xp.doctype.attr.normalization.1.test
9175     @@@DEnt:
9176     @@@@test:value:
9177     <a at=" at &#xA;value "></a>
9178     @@@test:domTree:
9179     document {
9180     element {
9181     attribute {
9182     node-name: 'at';
9183     value: ' at ' U+000A 'value ';
9184     schema-type-info: TypeInfo (null, null);
9185     specified: true;
9186     }
9187     }
9188     }
9189     @@XMLTest:
9190     @@@QName: xp.doctype.attr.normalization.2.test
9191     @@@DEnt:
9192     @@@@test:value:
9193     <a at=" at &#xD;value "></a>
9194     @@@test:domTree:
9195     document {
9196     element {
9197     attribute {
9198     value: ' at ' U+000D 'value ';
9199     schema-type-info: TypeInfo (null, null);
9200     specified: true;
9201     }
9202     }
9203     }
9204     @@XMLTest:
9205     @@@QName: xp.doctype.attr.normalization.3.test
9206     @@@DEnt:
9207     @@@@test:value:
9208     <a at=" at &#x9;value "></a>
9209     @@@test:domTree:
9210     document {
9211     element {
9212     attribute {
9213     node-name: 'at';
9214     value: ' at ' U+0009 'value ';
9215     schema-type-info: TypeInfo (null, null);
9216     specified: true;
9217     }
9218     }
9219     }
9220    
9221     @@XMLTest:
9222     @@@QName: xp.doctype.attr.specified.1.test
9223     @@@DEnt:
9224     @@@@test:value:
9225     <!DOCTYPE a [
9226     <!ATTLIST a
9227     at CDATA "default"
9228     >
9229     ]>
9230     <a></a>
9231     @@@test:domTree:
9232     document {
9233     document-type { }
9234     element {
9235     attribute {
9236     node-name: 'at';
9237     value: 'default';
9238     specified: false;
9239     }
9240     }
9241     }
9242     @@XMLTest:
9243     @@@QName: xp.doctype.attr.specified.2.test
9244     @@@DEnt:
9245     @@@@test:value:
9246     <!DOCTYPE a [
9247     <!ATTLIST a
9248     at CDATA "default"
9249     >
9250     ]>
9251     <a at2="specified"></a>
9252     @@@test:domTree:
9253     document {
9254     document-type { }
9255     element {
9256     attribute {
9257     node-name: 'at';
9258     value: 'default';
9259     specified: false;
9260     }
9261     attribute {
9262     node-name: 'at2';
9263     value: 'specified';
9264     specified: true;
9265     }
9266     }
9267     }
9268     @@XMLTest:
9269     @@@QName: xp.doctype.attr.specified.3.test
9270     @@@DEnt:
9271     @@@@test:value:
9272     <!DOCTYPE a [
9273     <!ATTLIST a
9274     at CDATA "default"
9275     >
9276     ]>
9277     <a at="specified"></a>
9278     @@@test:domTree:
9279     document {
9280     document-type { }
9281     element {
9282     attribute {
9283     node-name: 'at';
9284     value: 'specified';
9285     specified: true;
9286     }
9287     }
9288     }
9289    
9290     @@XMLTest:
9291     @@@QName: xp.attr.literal.charref.test
9292     @@@DEnt:
9293     @@@@test:value:
9294     <a at1 = "value&#33;_&#x25;value"
9295     at2 = 'value&#x25;_&#33;value'></a>
9296     @@@test:domTree:
9297     document {
9298     element {
9299     attribute {
9300     node-name: 'at1';
9301     text-content: 'value!_%value';
9302     }
9303     attribute {
9304     node-name: 'at2';
9305     text-content: 'value%_!value';
9306     }
9307     }
9308     }
9309     @@XMLTest:
9310     @@@QName: xp.attr.literal.entref.test
9311     @@@DEnt:
9312     @@@@test:value:
9313     <!DOCTYPE a [
9314     <!ENTITY ent "entity&#x26;#33;_&#x26;#x29;value">
9315     ]>
9316     <a at1 = "value&ent;value"
9317     at2 = 'value&ent;value'></a>
9318 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
9319 wakaba 1.18 @@@test:domTree:
9320     document {
9321     document-type {
9322     general-entity {
9323     node-name: 'ent';
9324     text-content: 'entity!_)value';
9325     }
9326     }
9327     element {
9328     attribute {
9329     node-name: 'at1';
9330     text-content: 'valueentity!_)valuevalue';
9331     }
9332     attribute {
9333     node-name: 'at2';
9334     text-content: 'valueentity!_)valuevalue';
9335     }
9336     }
9337     }
9338     @@XMLTest:
9339     @@@QName: xp.attr.literal.entref.nest.test
9340     @@@DEnt:
9341     @@@@test:value:
9342     <!DOCTYPE a [
9343     <!ENTITY ent1 "entity&#x26;#33;_&#x26;#x29;value">
9344     <!ENTITY ent2 "@&ent1;@">
9345     ]>
9346     <a at1 = "value&ent2;value"
9347     at2 = 'value&ent2;value'></a>
9348 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
9349 wakaba 1.18 @@@test:domTree:
9350     document {
9351     document-type {
9352     general-entity {
9353     node-name: 'ent1';
9354     text-content: 'entity!_)value';
9355     }
9356     general-entity {
9357     node-name: 'ent2';
9358     text-content: '@entity!_)value@';
9359     }
9360     }
9361     element {
9362     attribute {
9363     node-name: 'at1';
9364     text-content: 'value@entity!_)value@value';
9365     }
9366     attribute {
9367     node-name: 'at2';
9368     text-content: 'value@entity!_)value@value';
9369     }
9370     }
9371     }
9372    
9373     @@XMLTest:
9374     @@@QName: xp.element.content.ncr.1.test
9375     @@@DEnt:
9376     @@@@test:value:
9377     <e>&#33;</e>
9378     @@@test:domTree:
9379     document {
9380     element {
9381     text-content: '!';
9382     }
9383     }
9384     @@XMLTest:
9385     @@@QName: xp.element.content.ncr.2.test
9386     @@@DEnt:
9387     @@@@test:value:
9388     <e>aaaa&#33;bbbb</e>
9389     @@@test:domTree:
9390     document {
9391     element {
9392     text-content: 'aaaa!bbbb';
9393 wakaba 1.31 text {
9394     text-content: 'aaaa!bbbb';
9395     }
9396 wakaba 1.18 }
9397     }
9398     @@XMLTest:
9399     @@@QName: xp.attrval.ncr.1.test
9400     @@@DEnt:
9401     @@@@test:value:
9402     <e a="&#33;"/>
9403     @@@test:domTree:
9404     document {
9405     element {
9406     attribute {
9407     node-name: 'a';
9408     text-content: '!';
9409     }
9410     }
9411     }
9412     @@XMLTest:
9413     @@@QName: xp.attrval.ncr.2.test
9414     @@@DEnt:
9415     @@@@test:value:
9416     <e a="aaaaa&#33;bbbbb"/>
9417     @@@test:domTree:
9418     document {
9419     element {
9420     attribute {
9421     node-name: 'a';
9422     text-content: 'aaaaa!bbbbb';
9423 wakaba 1.31 text {
9424     text-content: 'aaaaa!bbbbb';
9425     }
9426 wakaba 1.18 }
9427     }
9428     }
9429     @@XMLTest:
9430     @@@QName: xp.attrval.ncr.3.test
9431     @@@DEnt:
9432     @@@@test:value:
9433     <e a='&#33;'/>
9434     @@@test:domTree:
9435     document {
9436     element {
9437     attribute {
9438     node-name: 'a';
9439     text-content: '!';
9440     }
9441     }
9442     }
9443     @@XMLTest:
9444     @@@QName: xp.attrval.ncr.4.test
9445     @@@DEnt:
9446     @@@@test:value:
9447     <e a='aaaaa&#33;bbbbb'/>
9448     @@@test:domTree:
9449     document {
9450     element {
9451     attribute {
9452     node-name: 'a';
9453     text-content: 'aaaaa!bbbbb';
9454     }
9455     }
9456     }
9457     @@XMLTest:
9458     @@@QName: xp.entval.ncr.1.test
9459     @@@DEnt:
9460     @@@@test:value:
9461     <!DOCTYPE e [
9462     <!ENTITY ent "&#33;">
9463     ]>
9464     <e/>
9465 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
9466 wakaba 1.18 @@@test:domTree:
9467     document {
9468     document-type {
9469     general-entity {
9470     node-name: 'ent';
9471     text-content: '!';
9472     }
9473     }
9474     element { }
9475     }
9476     @@XMLTest:
9477     @@@QName: xp.entval.ncr.2.test
9478     @@@DEnt:
9479     @@@@test:value:
9480     <!DOCTYPE e [
9481     <!ENTITY ent "aaaaa&#33;bbbbb">
9482     ]>
9483     <e/>
9484 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
9485 wakaba 1.18 @@@test:domTree:
9486     document {
9487     document-type {
9488     general-entity {
9489     node-name: 'ent';
9490     text-content: 'aaaaa!bbbbb';
9491     }
9492     }
9493     element { }
9494     }
9495     @@XMLTest:
9496     @@@QName: xp.element.content.reptxt.ncr.1.test
9497     @@@DEnt:
9498     @@@@test:value:
9499     <!DOCTYPE e [
9500     <!ENTITY ent "&#38;#33;">
9501     ]>
9502     <e>&ent;</e>
9503     @@@test:domTree:
9504     document {
9505     document-type { }
9506     element {
9507     general-entity-reference {
9508     node-name: 'ent';
9509     text-content: '!';
9510 wakaba 1.34 manakai-expanded: true;
9511 wakaba 1.18 }
9512     }
9513     }
9514     @@XMLTest:
9515     @@@QName: xp.element.content.reptxt.ncr.2.test
9516     @@@DEnt:
9517     @@@@test:value:
9518     <!DOCTYPE e [
9519     <!ENTITY ent "aaaaa&#38;#33;bbbbb">
9520     ]>
9521     <e>&ent;</e>
9522     @@@test:domTree:
9523     document {
9524     document-type { }
9525     element {
9526     general-entity-reference {
9527     node-name: 'ent';
9528     text-content: 'aaaaa!bbbbb';
9529 wakaba 1.34 manakai-expanded: true;
9530 wakaba 1.18 }
9531     }
9532     }
9533     @@XMLTest:
9534     @@@QName: xp.element.content.reptxt.reptxt.ncr.1.test
9535     @@@DEnt:
9536     @@@@test:value:
9537     <!DOCTYPE e [
9538     <!ENTITY ent "&#38;#33;">
9539     <!ENTITY ent2 "&ent;">
9540     ]>
9541     <e>&ent2;</e>
9542     @@@test:domTree:
9543     document {
9544     document-type { }
9545     element {
9546     general-entity-reference {
9547     node-name: 'ent2';
9548     general-entity-reference {
9549     node-name: 'ent';
9550     text-content: '!';
9551 wakaba 1.34 manakai-expanded: true;
9552 wakaba 1.18 }
9553 wakaba 1.34 manakai-expanded: true;
9554 wakaba 1.18 }
9555     }
9556     }
9557     @@XMLTest:
9558     @@@QName: xp.element.content.reptxt.reptxt.ncr.2.test
9559     @@@DEnt:
9560     @@@@test:value:
9561     <!DOCTYPE e [
9562     <!ENTITY ent "aa&#38;#33;bb">
9563     <!ENTITY ent2 "&ent;">
9564     ]>
9565     <e>&ent2;</e>
9566     @@@test:domTree:
9567     document {
9568     document-type { }
9569     element {
9570     general-entity-reference {
9571     node-name: 'ent2';
9572     general-entity-reference {
9573     node-name: 'ent';
9574     text-content: 'aa!bb';
9575 wakaba 1.34 manakai-expanded: true;
9576 wakaba 1.31 text {
9577     text-content: 'aa!bb';
9578     }
9579 wakaba 1.18 }
9580 wakaba 1.34 manakai-expanded: true;
9581 wakaba 1.18 }
9582     }
9583     }
9584     @@XMLTest:
9585     @@@QName: xp.attval.reptxt.ncr.1.test
9586     @@@DEnt:
9587     @@@@test:value:
9588     <!DOCTYPE e [
9589     <!ENTITY ent "&#38;#33;">
9590     ]>
9591     <e a="&ent;"/>
9592     @@@test:domTree:
9593     document {
9594     document-type { }
9595     element {
9596     attribute {
9597     node-name: 'a';
9598     general-entity-reference {
9599     node-name: 'ent';
9600     text-content: '!';
9601 wakaba 1.34 manakai-expanded: true;
9602 wakaba 1.18 }
9603     }
9604     }
9605     }
9606     @@XMLTest:
9607     @@@QName: xp.attval.reptxt.ncr.2.test
9608     @@@DEnt:
9609     @@@@test:value:
9610     <!DOCTYPE e [
9611     <!ENTITY ent "aaaaa&#38;#33;bbbbb">
9612     ]>
9613     <e a="&ent;"/>
9614     @@@test:domTree:
9615     document {
9616     document-type { }
9617     element {
9618     attribute {
9619     node-name: 'a';
9620     general-entity-reference {
9621     node-name: 'ent';
9622     text-content: 'aaaaa!bbbbb';
9623 wakaba 1.34 manakai-expanded: true;
9624 wakaba 1.31 text {
9625     text-content: 'aaaaa!bbbbb';
9626     }
9627 wakaba 1.18 }
9628     }
9629     }
9630     }
9631     @@XMLTest:
9632     @@@QName: xp.attval.reptxt.reptxt.ncr.1.test
9633     @@@DEnt:
9634     @@@@test:value:
9635     <!DOCTYPE e [
9636     <!ENTITY ent "&#38;#33;">
9637     <!ENTITY ent2 "&ent;">
9638     ]>
9639     <e a="&ent2;"/>
9640     @@@test:domTree:
9641     document {
9642     document-type { }
9643     element {
9644     attribute {
9645     node-name: 'a';
9646     general-entity-reference {
9647     node-name: 'ent2';
9648 wakaba 1.34 manakai-expanded: true;
9649 wakaba 1.18 general-entity-reference {
9650     node-name: 'ent';
9651     text-content: '!';
9652 wakaba 1.34 manakai-expanded: true;
9653 wakaba 1.18 }
9654     }
9655     }
9656     }
9657     }
9658     @@XMLTest:
9659     @@@QName: xp.attval.reptxt.reptxt.ncr.2.test
9660     @@@DEnt:
9661     @@@@test:value:
9662     <!DOCTYPE e [
9663     <!ENTITY ent "aa&#38;#33;bb">
9664     <!ENTITY ent2 "&ent;">
9665     ]>
9666     <e a="&ent2;"/>
9667     @@@test:domTree:
9668     document {
9669     document-type { }
9670     element {
9671     attribute {
9672     node-name: 'a';
9673     general-entity-reference {
9674     node-name: 'ent2';
9675 wakaba 1.34 manakai-expanded: true;
9676 wakaba 1.18 general-entity-reference {
9677     node-name: 'ent';
9678     text-content: 'aa!bb';
9679 wakaba 1.34 manakai-expanded: true;
9680 wakaba 1.18 }
9681     }
9682     }
9683     }
9684     }
9685    
9686     @@XMLTest:
9687     @@@QName: xp.element.content.hcr.1.test
9688     @@@DEnt:
9689     @@@@test:value:
9690     <e>&#x21;</e>
9691     @@@test:domTree:
9692     document {
9693     element {
9694     text-content: '!';
9695     }
9696     }
9697     @@XMLTest:
9698     @@@QName: xp.element.content.hcr.2.test
9699     @@@DEnt:
9700     @@@@test:value:
9701     <e>aaaa&#x21;bbbb</e>
9702     @@@test:domTree:
9703     document {
9704     element {
9705     text-content: 'aaaa!bbbb';
9706 wakaba 1.31 text {
9707     text-content: 'aaaa!bbbb';
9708     }
9709 wakaba 1.18 }
9710     }
9711     @@XMLTest:
9712     @@@QName: xp.attrval.hcr.1.test
9713     @@@DEnt:
9714     @@@@test:value:
9715     <e a="&#x21;"/>
9716     @@@test:domTree:
9717     document {
9718     element {
9719     attribute {
9720     node-name: 'a';
9721     text-content: '!';
9722     }
9723     }
9724     }
9725     @@XMLTest:
9726     @@@QName: xp.attrval.hcr.2.test
9727     @@@DEnt:
9728     @@@@test:value:
9729     <e a="aaaaa&#x21;bbbbb"/>
9730     @@@test:domTree:
9731     document {
9732     element {
9733     attribute {
9734     node-name: 'a';
9735     text-content: 'aaaaa!bbbbb';
9736 wakaba 1.31 text {
9737     text-content: 'aaaaa!bbbbb';
9738     }
9739 wakaba 1.18 }
9740     }
9741     }
9742     @@XMLTest:
9743     @@@QName: xp.attrval.hcr.3.test
9744     @@@DEnt:
9745     @@@@test:value:
9746     <e a='&#x21;'/>
9747     @@@test:domTree:
9748     document {
9749     element {
9750     attribute {
9751     node-name: 'a';
9752     text-content: '!';
9753     }
9754     }
9755     }
9756     @@XMLTest:
9757     @@@QName: xp.attrval.hcr.4.test
9758     @@@DEnt:
9759     @@@@test:value:
9760     <e a='aaaaa&#x21;bbbbb'/>
9761     @@@test:domTree:
9762     document {
9763     element {
9764     attribute {
9765     node-name: 'a';
9766     text-content: 'aaaaa!bbbbb';
9767     }
9768     }
9769     }
9770     @@XMLTest:
9771     @@@QName: xp.entval.hcr.1.test
9772     @@@DEnt:
9773     @@@@test:value:
9774     <!DOCTYPE e [
9775     <!ENTITY ent "&#x21;">
9776     ]>
9777     <e/>
9778 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
9779 wakaba 1.18 @@@test:domTree:
9780     document {
9781     document-type {
9782     general-entity {
9783     node-name: 'ent';
9784     text-content: '!';
9785 wakaba 1.10 }
9786 wakaba 1.9 }
9787 wakaba 1.18 element { }
9788 wakaba 1.9 }
9789     @@XMLTest:
9790 wakaba 1.18 @@@QName: xp.entval.hcr.2.test
9791 wakaba 1.9 @@@DEnt:
9792     @@@@test:value:
9793 wakaba 1.18 <!DOCTYPE e [
9794     <!ENTITY ent "aaaaa&#x21;bbbbb">
9795     ]>
9796     <e/>
9797 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
9798 wakaba 1.9 @@@test:domTree:
9799     document {
9800 wakaba 1.18 document-type {
9801     general-entity {
9802     node-name: 'ent';
9803     text-content: 'aaaaa!bbbbb';
9804 wakaba 1.31 text {
9805     text-content: 'aaaaa!bbbbb';
9806     }
9807 wakaba 1.9 }
9808     }
9809 wakaba 1.18 element { }
9810 wakaba 1.9 }
9811     @@XMLTest:
9812 wakaba 1.18 @@@QName: xp.element.content.reptxt.hcr.1.test
9813 wakaba 1.9 @@@DEnt:
9814     @@@@test:value:
9815 wakaba 1.18 <!DOCTYPE e [
9816     <!ENTITY ent "&#38;#x21;">
9817 wakaba 1.9 ]>
9818 wakaba 1.18 <e>&ent;</e>
9819 wakaba 1.9 @@@test:domTree:
9820     document {
9821     document-type { }
9822     element {
9823 wakaba 1.18 general-entity-reference {
9824     node-name: 'ent';
9825     text-content: '!';
9826 wakaba 1.34 manakai-expanded: true;
9827 wakaba 1.9 }
9828     }
9829     }
9830     @@XMLTest:
9831 wakaba 1.18 @@@QName: xp.element.content.reptxt.hcr.2.test
9832 wakaba 1.9 @@@DEnt:
9833     @@@@test:value:
9834 wakaba 1.18 <!DOCTYPE e [
9835     <!ENTITY ent "aaaaa&#38;#x21;bbbbb">
9836 wakaba 1.9 ]>
9837 wakaba 1.18 <e>&ent;</e>
9838 wakaba 1.9 @@@test:domTree:
9839     document {
9840     document-type { }
9841     element {
9842 wakaba 1.18 general-entity-reference {
9843     node-name: 'ent';
9844     text-content: 'aaaaa!bbbbb';
9845 wakaba 1.34 manakai-expanded: true;
9846 wakaba 1.9 }
9847     }
9848     }
9849     @@XMLTest:
9850 wakaba 1.18 @@@QName: xp.element.content.reptxt.reptxt.hcr.1.test
9851 wakaba 1.9 @@@DEnt:
9852     @@@@test:value:
9853 wakaba 1.18 <!DOCTYPE e [
9854     <!ENTITY ent "&#38;#x21;">
9855     <!ENTITY ent2 "&ent;">
9856     ]>
9857     <e>&ent2;</e>
9858 wakaba 1.9 @@@test:domTree:
9859     document {
9860 wakaba 1.18 document-type { }
9861 wakaba 1.9 element {
9862 wakaba 1.18 general-entity-reference {
9863     node-name: 'ent2';
9864 wakaba 1.34 manakai-expanded: true;
9865 wakaba 1.18 general-entity-reference {
9866     node-name: 'ent';
9867     text-content: '!';
9868 wakaba 1.34 manakai-expanded: true;
9869 wakaba 1.18 }
9870 wakaba 1.9 }
9871     }
9872     }
9873     @@XMLTest:
9874 wakaba 1.18 @@@QName: xp.element.content.reptxt.reptxt.hcr.2.test
9875 wakaba 1.9 @@@DEnt:
9876     @@@@test:value:
9877 wakaba 1.18 <!DOCTYPE e [
9878     <!ENTITY ent "aa&#38;#x21;bb">
9879     <!ENTITY ent2 "&ent;">
9880     ]>
9881     <e>&ent2;</e>
9882 wakaba 1.9 @@@test:domTree:
9883     document {
9884 wakaba 1.18 document-type { }
9885 wakaba 1.9 element {
9886 wakaba 1.18 general-entity-reference {
9887     node-name: 'ent2';
9888 wakaba 1.34 manakai-expanded: true;
9889 wakaba 1.18 general-entity-reference {
9890     node-name: 'ent';
9891 wakaba 1.34 manakai-expanded: true;
9892 wakaba 1.18 text-content: 'aa!bb';
9893     }
9894 wakaba 1.9 }
9895     }
9896     }
9897     @@XMLTest:
9898 wakaba 1.18 @@@QName: xp.attval.reptxt.hcr.1.test
9899 wakaba 1.9 @@@DEnt:
9900     @@@@test:value:
9901 wakaba 1.18 <!DOCTYPE e [
9902     <!ENTITY ent "&#38;#x21;">
9903     ]>
9904     <e a="&ent;"/>
9905 wakaba 1.9 @@@test:domTree:
9906     document {
9907 wakaba 1.18 document-type { }
9908 wakaba 1.9 element {
9909     attribute {
9910 wakaba 1.18 node-name: 'a';
9911     general-entity-reference {
9912     node-name: 'ent';
9913 wakaba 1.34 manakai-expanded: true;
9914 wakaba 1.18 text-content: '!';
9915     }
9916 wakaba 1.10 }
9917     }
9918     }
9919     @@XMLTest:
9920 wakaba 1.18 @@@QName: xp.attval.reptxt.hcr.2.test
9921 wakaba 1.10 @@@DEnt:
9922     @@@@test:value:
9923 wakaba 1.18 <!DOCTYPE e [
9924     <!ENTITY ent "aaaaa&#38;#x21;bbbbb">
9925 wakaba 1.10 ]>
9926 wakaba 1.18 <e a="&ent;"/>
9927 wakaba 1.10 @@@test:domTree:
9928     document {
9929     document-type { }
9930     element {
9931     attribute {
9932 wakaba 1.18 node-name: 'a';
9933     general-entity-reference {
9934     node-name: 'ent';
9935 wakaba 1.34 manakai-expanded: true;
9936 wakaba 1.18 text-content: 'aaaaa!bbbbb';
9937 wakaba 1.31 text {
9938     text-content: 'aaaaa!bbbbb';
9939     }
9940 wakaba 1.18 }
9941 wakaba 1.10 }
9942     }
9943     }
9944     @@XMLTest:
9945 wakaba 1.18 @@@QName: xp.attval.reptxt.reptxt.hcr.1.test
9946 wakaba 1.10 @@@DEnt:
9947     @@@@test:value:
9948 wakaba 1.18 <!DOCTYPE e [
9949     <!ENTITY ent "&#38;#x21;">
9950     <!ENTITY ent2 "&ent;">
9951 wakaba 1.10 ]>
9952 wakaba 1.18 <e a="&ent2;"/>
9953 wakaba 1.10 @@@test:domTree:
9954     document {
9955     document-type { }
9956     element {
9957     attribute {
9958 wakaba 1.18 node-name: 'a';
9959     general-entity-reference {
9960     node-name: 'ent2';
9961 wakaba 1.34 manakai-expanded: true;
9962 wakaba 1.18 general-entity-reference {
9963     node-name: 'ent';
9964 wakaba 1.34 manakai-expanded: true;
9965 wakaba 1.18 text-content: '!';
9966     }
9967     }
9968 wakaba 1.10 }
9969     }
9970     }
9971     @@XMLTest:
9972 wakaba 1.18 @@@QName: xp.attval.reptxt.reptxt.hcr.2.test
9973 wakaba 1.10 @@@DEnt:
9974     @@@@test:value:
9975 wakaba 1.18 <!DOCTYPE e [
9976     <!ENTITY ent "aa&#38;#x21;bb">
9977     <!ENTITY ent2 "&ent;">
9978 wakaba 1.10 ]>
9979 wakaba 1.18 <e a="&ent2;"/>
9980 wakaba 1.10 @@@test:domTree:
9981     document {
9982     document-type { }
9983     element {
9984     attribute {
9985 wakaba 1.18 node-name: 'a';
9986     general-entity-reference {
9987     node-name: 'ent2';
9988 wakaba 1.34 manakai-expanded: true;
9989 wakaba 1.18 general-entity-reference {
9990     node-name: 'ent';
9991 wakaba 1.34 manakai-expanded: true;
9992 wakaba 1.18 text-content: 'aa!bb';
9993     }
9994     }
9995 wakaba 1.11 }
9996     }
9997     }
9998    
9999     @@XMLTest:
10000 wakaba 1.18 @@@QName: xp.element.content.ncr.legal.char.1.0.1.test
10001     @@@DEnt:
10002     @@@@test:value:
10003     <?xml version="1.0"?>
10004     <e>&#0;</e>
10005     @@@c:erred: <[[xp|wf-legal-character]]> { (2, 4)..(2, 7); }
10006     @@XMLTest:
10007     @@@QName: xp.element.content.ncr.legal.char.1.1.1.test
10008     @@@DEnt:
10009     @@@@test:value:
10010     <?xml version="1.1"?>
10011     <e>&#0;</e>
10012     @@@c:erred: <[[xp|wf-legal-character]]> { (2, 4)..(2, 7); }
10013     @@XMLTest:
10014     @@@QName: xp.element.content.ncr.legal.char.1.0.2.test
10015     @@@DEnt:
10016     @@@@test:value:
10017     <?xml version="1.0"?>
10018     <e>&#1;</e>
10019     @@@c:erred: <[[xp|wf-legal-character]]> { (2, 4)..(2, 7); }
10020     @@XMLTest:
10021     @@@QName: xp.element.content.ncr.legal.char.1.1.2.test
10022 wakaba 1.11 @@@DEnt:
10023     @@@@test:value:
10024 wakaba 1.18 <?xml version="1.1"?>
10025     <e>&#1;</e>
10026 wakaba 1.11 @@@test:domTree:
10027     document {
10028 wakaba 1.18 xml-version: '1.1';
10029 wakaba 1.11 element {
10030 wakaba 1.18 text-content: U+0001;
10031 wakaba 1.11 }
10032     }
10033     @@XMLTest:
10034 wakaba 1.18 @@@QName: xp.element.content.hcr.legal.char.1.0.1.test
10035     @@@DEnt:
10036     @@@@test:value:
10037     <?xml version="1.0"?>
10038     <e>&#x0;</e>
10039     @@@c:erred: <[[xp|wf-legal-character]]> { (2, 4)..(2, 8); }
10040     @@XMLTest:
10041     @@@QName: xp.element.content.hcr.legal.char.1.1.1.test
10042     @@@DEnt:
10043     @@@@test:value:
10044     <?xml version="1.1"?>
10045     <e>&#x0;</e>
10046     @@@c:erred: <[[xp|wf-legal-character]]> { (2, 4)..(2, 8); }
10047     @@XMLTest:
10048     @@@QName: xp.element.content.hcr.legal.char.1.0.2.test
10049 wakaba 1.11 @@@DEnt:
10050     @@@@test:value:
10051 wakaba 1.18 <?xml version="1.0"?>
10052     <e>&#x1;</e>
10053     @@@c:erred: <[[xp|wf-legal-character]]> { (2, 4)..(2, 8); }
10054 wakaba 1.11 @@XMLTest:
10055 wakaba 1.18 @@@QName: xp.element.content.hcr.legal.char.1.1.2.test
10056 wakaba 1.11 @@@DEnt:
10057     @@@@test:value:
10058 wakaba 1.18 <?xml version="1.1"?>
10059     <e>&#x1;</e>
10060 wakaba 1.11 @@@test:domTree:
10061     document {
10062 wakaba 1.18 xml-version: '1.1';
10063 wakaba 1.11 element {
10064 wakaba 1.18 text-content: U+0001;
10065 wakaba 1.6 }
10066     }
10067    
10068 wakaba 1.19 @@XMLTest:
10069     @@@QName: xp.element.content.ger.entity.declared.nodtd.1.test
10070     @@@DEnt:
10071     @@@@test:value:
10072     <p>&entity;</p>
10073     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 4)..(1, 11); }
10074     @@XMLTest:
10075     @@@QName: xp.element.content.ger.entity.declared.nodtd.2.test
10076     @@@DEnt:
10077     @@@@test:value:
10078     <?xml version="1.0" standalone="yes"?>
10079     <p>&entity;</p>
10080     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 4)..(2, 11); }
10081     @@XMLTest:
10082     @@@QName: xp.element.content.ger.entity.declared.nodtd.3.test
10083     @@@DEnt:
10084     @@@@test:value:
10085     <?xml version="1.0" standalone="no"?>
10086     <p>&entity;</p>
10087     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 4)..(2, 11); }
10088     @@XMLTest:
10089     @@@QName: xp.element.content.ger.entity.declared.nodtd.-1.test
10090     @@@DEnt:
10091     @@@@test:value:
10092     <p>&lt;&gt;&amp;&quot;&apos;</p>
10093     @@@test:domTree:
10094     document {
10095     element {
10096     text-content: '<>&"' U+0027;
10097     }
10098     }
10099     @@XMLTest:
10100     @@@QName: xp.element.content.ger.entity.declared.nopref.1.test
10101     @@@DEnt:
10102     @@@@test:value:
10103     <!DOCTYPE p []>
10104     <p>&entity;</p>
10105     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 4)..(2, 11); }
10106     @@XMLTest:
10107     @@@QName: xp.element.content.ger.entity.declared.nopref.2.test
10108     @@@DEnt:
10109     @@@@test:value:
10110     <!DOCTYPE p [
10111     <!ENTITY other "aa">
10112     <!ENTITY % another "aa">
10113     ]>
10114     <p>&entity;</p>
10115     @@@c:erred: <[[xp|wf-entity-declared]]> { (5, 4)..(5, 11); }
10116     @@XMLTest:
10117     @@@QName: xp.element.content.ger.entity.declared.nopref.3.test
10118     @@@DEnt:
10119     @@@@test:value:
10120     <?xml version="1.0" standalone="yes"?>
10121     <!DOCTYPE p []>
10122     <p>&entity;</p>
10123     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 4)..(3, 11); }
10124     @@XMLTest:
10125     @@@QName: xp.element.content.ger.entity.declared.nopref.4.test
10126     @@@DEnt:
10127     @@@@test:value:
10128     <?xml version="1.0" standalone="no"?>
10129     <!DOCTYPE p []>
10130     <p>&entity;</p>
10131     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 4)..(3, 11); }
10132     @@XMLTest:
10133     @@@QName: xp.element.content.ger.entity.declared.nopref.5.test
10134     @@@DEnt:
10135     @@@@test:value:
10136     <?xml version="1.0" standalone="yes"?>
10137     <!DOCTYPE p [
10138     <!ENTITY other "aa">
10139     <!ENTITY % another "aa">
10140     ]>
10141     <p>&entity;</p>
10142     @@@c:erred: <[[xp|wf-entity-declared]]> { (6, 4)..(6, 11); }
10143     @@XMLTest:
10144     @@@QName: xp.element.content.ger.entity.declared.nopref.6.test
10145     @@@DEnt:
10146     @@@@test:value:
10147     <?xml version="1.0" standalone="no"?>
10148     <!DOCTYPE p [
10149     <!ENTITY other "aa">
10150     <!ENTITY % another "aa">
10151     ]>
10152     <p>&entity;</p>
10153     @@@c:erred: <[[xp|wf-entity-declared]]> { (6, 4)..(6, 11); }
10154     @@XMLTest:
10155     @@@QName: xp.element.content.ger.entity.declared.nopref.-1.test
10156     @@@DEnt:
10157     @@@@test:value:
10158     <!DOCTYPE p [
10159     <!ENTITY entity "value">
10160     ]>
10161     <p>&entity;</p>
10162 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
10163 wakaba 1.19 @@@test:domTree:
10164     document {
10165     document-type {
10166     general-entity {
10167     node-name: 'entity';
10168     text-content: 'value';
10169     }
10170     }
10171     element {
10172 wakaba 1.20 general-entity-reference {
10173 wakaba 1.19 node-name: 'entity';
10174 wakaba 1.34 manakai-expanded: true;
10175 wakaba 1.19 text-content: 'value';
10176     }
10177     }
10178     }
10179     @@XMLTest:
10180     @@@QName: xp.element.content.ger.entity.declared.nopref.-2.test
10181     @@@DEnt:
10182     @@@@test:value:
10183     <!DOCTYPE p [
10184     <!ENTITY entity "value">
10185     <!ENTITY another SYSTEM "another">
10186     ]>
10187     <p>&entity;</p>
10188 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
10189 wakaba 1.19 @@@test:domTree:
10190     document {
10191     document-type {
10192     general-entity {
10193     node-name: 'entity';
10194     text-content: 'value';
10195     }
10196 wakaba 1.20 general-entity {
10197     node-name: 'another';
10198     public-id: null;
10199     system-id: 'another';
10200     }
10201 wakaba 1.19 }
10202     element {
10203 wakaba 1.20 general-entity-reference {
10204 wakaba 1.19 node-name: 'entity';
10205 wakaba 1.34 manakai-expanded: true;
10206 wakaba 1.19 text-content: 'value';
10207     }
10208     }
10209     }
10210     @@XMLTest:
10211     @@@QName: xp.element.content.ger.entity.declared.standalone.1.test
10212     @@@DEnt:
10213     @@@@test:value:
10214     <?xml version="1.0" standalone="yes"?>
10215     <p>&entity;</p>
10216     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 4)..(2, 11); }
10217     @@XMLTest:
10218     @@@QName: xp.element.content.ger.entity.declared.standalone.2.test
10219     @@@DEnt:
10220     @@@@test:value:
10221     <?xml version="1.0" standalone="yes"?>
10222     <!DOCTYPE p []>
10223     <p>&entity;</p>
10224     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 4)..(3, 11); }
10225     @@XMLTest:
10226     @@@QName: xp.element.content.ger.entity.declared.standalone.3.test
10227     @@@DEnt:
10228     @@@@test:value:
10229     <?xml version="1.0" standalone="yes"?>
10230     <!DOCTYPE p [
10231     <!ENTITY % para "<!-- -->">
10232     %para;
10233     ]>
10234     <p>&entity;</p>
10235     @@@c:erred: <[[xp|wf-entity-declared]]> { (6, 4)..(6, 11); }
10236     @@XMLTest:
10237     @@@QName: xp.element.content.ger.entity.declared.standalone.-1.test
10238     @@@DEnt:
10239     @@@@test:value:
10240     <?xml version="1.0" standalone="no"?>
10241     <!DOCTYPE p [
10242     <!ENTITY % para "<!-- -->">
10243     %para;
10244     ]>
10245     <p>&entity;</p>
10246     @@@test:domTree:
10247     document {
10248     document-type { }
10249     element {
10250     general-entity-reference {
10251 wakaba 1.34 manakai-expanded: false;
10252 wakaba 1.19 }
10253     }
10254     }
10255     @@XMLTest:
10256     @@@QName: xp.element.content.ger.entity.declared.standalone.-2.test
10257     @@@DEnt:
10258     @@@@test:value:
10259     <!DOCTYPE p [
10260     <!ENTITY % para "<!-- -->">
10261     %para;
10262     ]>
10263     <p>&entity;</p>
10264     @@@test:domTree:
10265     document {
10266     document-type { }
10267     element {
10268     general-entity-reference {
10269 wakaba 1.34 manakai-expanded: false;
10270 wakaba 1.19 }
10271     }
10272     }
10273     @@XMLTest:
10274     @@@QName: xp.element.content.ger.entity.declared.standalone.4.test
10275     @@@DEnt:
10276     @@@@test:value:
10277     <?xml version="1.0" standalone="yes"?>
10278     <!DOCTYPE p [
10279     <!ENTITY % para SYSTEM "para">
10280     %para;
10281     ]>
10282     <p>&entity;</p>
10283     @@@c:erred: <[[xp|wf-entity-declared]]> { (6, 4)..(6, 11); }
10284     @@XMLTest:
10285     @@@QName: xp.element.content.ger.entity.declared.standalone.-3.test
10286     @@@DEnt:
10287     @@@@test:value:
10288     <?xml version="1.0" standalone="no"?>
10289     <!DOCTYPE p [
10290     <!ENTITY % para SYSTEM "para">
10291     %para;
10292     ]>
10293     <p>&entity;</p>
10294     @@@test:domTree:
10295     document {
10296     document-type { }
10297     element {
10298     general-entity-reference {
10299 wakaba 1.34 manakai-expanded: false;
10300 wakaba 1.19 }
10301     }
10302     }
10303     @@XMLTest:
10304     @@@QName: xp.element.content.ger.entity.declared.standalone.-4.test
10305     @@@DEnt:
10306     @@@@test:value:
10307     <!DOCTYPE p [
10308     <!ENTITY % para SYSTEM "para">
10309     %para;
10310     ]>
10311     <p>&entity;</p>
10312     @@@test:domTree:
10313     document {
10314     document-type { }
10315     element {
10316     general-entity-reference {
10317 wakaba 1.34 manakai-expanded: false;
10318 wakaba 1.19 }
10319     }
10320     }
10321     @@XMLTest:
10322     @@@QName: xp.element.content.ger.entity.declared.standalone.5.test
10323     @@@DEnt:
10324     @@@@test:value:
10325     <?xml version="1.0" standalone="yes"?>
10326     <!DOCTYPE p SYSTEM "dtd">
10327     <p>&entity;</p>
10328     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 4)..(3, 11); }
10329     @@XMLTest:
10330     @@@QName: xp.element.content.ger.entity.declared.standalone.-5.test
10331     @@@DEnt:
10332     @@@@test:value:
10333     <?xml version="1.0" standalone="no"?>
10334     <!DOCTYPE p SYSTEM "dtd">
10335     <p>&entity;</p>
10336     @@@test:domTree:
10337     document {
10338     document-type { }
10339     element {
10340     general-entity-reference {
10341 wakaba 1.34 manakai-expanded: false;
10342 wakaba 1.19 }
10343     }
10344     }
10345     @@XMLTest:
10346     @@@QName: xp.element.content.ger.entity.declared.standalone.-6.test
10347     @@@DEnt:
10348     @@@@test:value:
10349     <!DOCTYPE p SYSTEM "dtd">
10350     <p>&entity;</p>
10351     @@@test:domTree:
10352     document {
10353     document-type { }
10354     element {
10355     general-entity-reference {
10356 wakaba 1.34 manakai-expanded: false;
10357 wakaba 1.19 }
10358     }
10359     }
10360    
10361 wakaba 1.20 @@XMLTest:
10362     @@@QName: xp.reptxt.element.content.ger.entity.declared.nopref.1.test
10363     @@@DEnt:
10364     @@@@test:value:
10365     <!DOCTYPE p [
10366     <!ENTITY c "&entity;">
10367     ]>
10368     <p>&c;</p>
10369     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
10370     @@XMLTest:
10371     @@@QName: xp.reptxt.element.content.ger.entity.declared.nopref.2.test
10372     @@@DEnt:
10373     @@@@test:value:
10374     <!DOCTYPE p [
10375     <!ENTITY other "aa">
10376     <!ENTITY % another "aa">
10377     <!ENTITY c "&entity;">
10378     ]>
10379     <p>&c;</p>
10380     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
10381     @@XMLTest:
10382     @@@QName: xp.reptxt.element.content.ger.entity.declared.nopref.3.test
10383     @@@DEnt:
10384     @@@@test:value:
10385     <?xml version="1.0" standalone="yes"?>
10386     <!DOCTYPE p [
10387     <!ENTITY c "&entity;">
10388     ]>
10389     <p>&c;</p>
10390     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
10391     @@XMLTest:
10392     @@@QName: xp.reptxt.element.content.ger.entity.declared.nopref.4.test
10393     @@@DEnt:
10394     @@@@test:value:
10395     <?xml version="1.0" standalone="no"?>
10396     <!DOCTYPE p [
10397     <!ENTITY c "&entity;">
10398     ]>
10399     <p>&c;</p>
10400     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
10401     @@XMLTest:
10402     @@@QName: xp.reptxt.element.content.ger.entity.declared.nopref.5.test
10403     @@@DEnt:
10404     @@@@test:value:
10405     <?xml version="1.0" standalone="yes"?>
10406     <!DOCTYPE p [
10407     <!ENTITY other "aa">
10408     <!ENTITY % another "aa">
10409     <!ENTITY c "&entity;">
10410     ]>
10411     <p>&c;</p>
10412     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
10413     @@XMLTest:
10414     @@@QName: xp.reptxt.element.content.ger.entity.declared.nopref.6.test
10415     @@@DEnt:
10416     @@@@test:value:
10417     <?xml version="1.0" standalone="no"?>
10418     <!DOCTYPE p [
10419     <!ENTITY other "aa">
10420     <!ENTITY % another "aa">
10421     <!ENTITY c "&entity;">
10422     ]>
10423     <p>&c;</p>
10424     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
10425     @@XMLTest:
10426     @@@QName: xp.reptxt.element.content.ger.entity.declared.nopref.-1.test
10427     @@@DEnt:
10428     @@@@test:value:
10429     <!DOCTYPE p [
10430     <!ENTITY entity "value">
10431     <!ENTITY c "&entity;">
10432     ]>
10433     <p>&c;</p>
10434 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
10435 wakaba 1.20 @@@test:domTree:
10436     document {
10437     document-type {
10438     general-entity {
10439     node-name: 'entity';
10440     text-content: 'value';
10441     }
10442     general-entity {
10443     node-name: 'c';
10444     general-entity-reference {
10445     node-name: 'entity';
10446     text-content: 'value';
10447     }
10448     }
10449     }
10450     element {
10451     general-entity-reference {
10452     node-name: 'c';
10453     general-entity-reference {
10454     node-name: 'entity';
10455     text-content: 'value';
10456     }
10457     }
10458     }
10459     }
10460     @@XMLTest:
10461     @@@QName: xp.reptxt.element.content.ger.entity.declared.nopref.-2.test
10462     @@@DEnt:
10463     @@@@test:value:
10464     <!DOCTYPE p [
10465     <!ENTITY entity "value">
10466     <!ENTITY another SYSTEM "another">
10467     <!ENTITY c "&entity;">
10468     ]>
10469     <p>&c;</p>
10470 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
10471 wakaba 1.20 @@@test:domTree:
10472     document {
10473     document-type {
10474     general-entity {
10475     node-name: 'entity';
10476     text-content: 'value';
10477     }
10478     general-entity {
10479     node-name: 'c';
10480     general-entity-reference {
10481     node-name: 'entity';
10482 wakaba 1.34 manakai-expanded: true;
10483 wakaba 1.20 text-content: 'value';
10484     }
10485     }
10486     general-entity {
10487     node-name: 'another';
10488     public-id: null;
10489     system-id: 'another';
10490     has-replacement-tree: false;
10491     }
10492     }
10493     element {
10494     general-entity-reference {
10495     node-name: 'c';
10496 wakaba 1.34 manakai-expanded: true;
10497 wakaba 1.20 general-entity-reference {
10498     node-name: 'entity';
10499 wakaba 1.34 manakai-expanded: true;
10500 wakaba 1.20 text-content: 'value';
10501     }
10502     }
10503     }
10504     }
10505     @@XMLTest:
10506     @@@QName: xp.reptxt.element.content.ger.entity.declared.standalone.2.test
10507     @@@DEnt:
10508     @@@@test:value:
10509     <?xml version="1.0" standalone="yes"?>
10510     <!DOCTYPE p [
10511     <!ENTITY c "&entity;">
10512     ]>
10513     <p>&c;</p>
10514     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
10515     @@XMLTest:
10516     @@@QName: xp.reptxt.element.content.ger.entity.declared.standalone.3.test
10517     @@@DEnt:
10518     @@@@test:value:
10519     <?xml version="1.0" standalone="yes"?>
10520     <!DOCTYPE p [
10521     <!ENTITY % para "<!-- -->">
10522     %para;
10523     <!ENTITY c "&entity;">
10524     ]>
10525     <p>&c;</p>
10526     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
10527     @@XMLTest:
10528     @@@QName: xp.reptxt.element.content.ger.entity.declared.standalone.-1.test
10529     @@@DEnt:
10530     @@@@test:value:
10531     <?xml version="1.0" standalone="no"?>
10532     <!DOCTYPE p [
10533     <!ENTITY c "&entity;">
10534     <!ENTITY % para "<!-- -->">
10535     %para;
10536     ]>
10537     <p>&c;</p>
10538 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
10539 wakaba 1.20 @@@test:domTree:
10540     document {
10541     document-type {
10542     general-entity {
10543     node-name: 'c';
10544     general-entity-reference {
10545     node-name: 'entity';
10546 wakaba 1.34 manakai-expanded: false;
10547 wakaba 1.20 }
10548     }
10549     }
10550     element {
10551     general-entity-reference {
10552     node-name: 'c';
10553     general-entity-reference {
10554     node-name: 'entity';
10555 wakaba 1.34 manakai-expanded: false;
10556 wakaba 1.20 }
10557     }
10558     }
10559     }
10560     @@XMLTest:
10561     @@@QName:
10562     xp.reptxt.element.content.ger.entity.declared.standalone.-1.2.test
10563     @@@DEnt:
10564     @@@@test:value:
10565     <?xml version="1.0" standalone="no"?>
10566     <!DOCTYPE p [
10567     <!ENTITY % para "<!-- -->">
10568     %para;
10569     <!ENTITY c "&entity;">
10570     ]>
10571     <p>&c;</p>
10572     @@@test:domTree:
10573     document {
10574     document-type { }
10575     element {
10576     general-entity-reference {
10577     node-name: 'c';
10578 wakaba 1.34 manakai-expanded: false;
10579 wakaba 1.20 }
10580     }
10581     }
10582     @@XMLTest:
10583     @@@QName: xp.reptxt.element.content.ger.entity.declared.standalone.-2.test
10584     @@@DEnt:
10585     @@@@test:value:
10586     <!DOCTYPE p [
10587     <!ENTITY c "&entity;">
10588     <!ENTITY % para "<!-- -->">
10589     %para;
10590     ]>
10591     <p>&c;</p>
10592     @@@test:domTree:
10593     document {
10594     document-type { }
10595     element {
10596     general-entity-reference {
10597     node-name: 'c';
10598 wakaba 1.34 manakai-expanded: true;
10599 wakaba 1.20 general-entity-reference {
10600     node-name: 'entity';
10601 wakaba 1.34 manakai-expanded: false;
10602 wakaba 1.20 }
10603     }
10604     }
10605     }
10606     @@XMLTest:
10607     @@@QName:
10608     xp.reptxt.element.content.ger.entity.declared.standalone.-2.2.test
10609     @@@DEnt:
10610     @@@@test:value:
10611     <!DOCTYPE p [
10612     <!ENTITY % para "<!-- -->">
10613     %para;
10614     <!ENTITY c "&entity;">
10615     ]>
10616     <p>&c;</p>
10617     @@@test:domTree:
10618     document {
10619     document-type { }
10620     element {
10621     general-entity-reference {
10622     node-name: 'c';
10623 wakaba 1.34 manakai-expanded: false;
10624 wakaba 1.20 }
10625     }
10626     }
10627     @@XMLTest:
10628     @@@QName: xp.reptxt.element.content.ger.entity.declared.standalone.4.test
10629     @@@DEnt:
10630     @@@@test:value:
10631     <?xml version="1.0" standalone="yes"?>
10632     <!DOCTYPE p [
10633     <!ENTITY % para SYSTEM "para">
10634     %para;
10635     <!ENTITY c "&entity;">
10636     ]>
10637     <p>&c;</p>
10638     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
10639     @@XMLTest:
10640     @@@QName: xp.reptxt.element.content.ger.entity.declared.standalone.-3.test
10641     @@@DEnt:
10642     @@@@test:value:
10643     <?xml version="1.0" standalone="no"?>
10644     <!DOCTYPE p [
10645     <!ENTITY c "&entity;">
10646     <!ENTITY % para SYSTEM "para">
10647     %para;
10648     ]>
10649     <p>&c;</p>
10650     @@@test:domTree:
10651     document {
10652     document-type { }
10653     element {
10654     general-entity-reference {
10655     node-name: 'c';
10656 wakaba 1.34 manakai-expanded: true;
10657 wakaba 1.20 general-entity-reference {
10658     node-name: 'entity';
10659 wakaba 1.34 manakai-expanded: false;
10660 wakaba 1.20 }
10661     }
10662     }
10663     }
10664     @@XMLTest:
10665     @@@QName:
10666     xp.reptxt.element.content.ger.entity.declared.standalone.-3.2.test
10667     @@@DEnt:
10668     @@@@test:value:
10669     <?xml version="1.0" standalone="no"?>
10670     <!DOCTYPE p [
10671     <!ENTITY % para SYSTEM "para">
10672     %para;
10673     <!ENTITY c "&entity;">
10674     ]>
10675     <p>&c;</p>
10676     @@@test:domTree:
10677     document {
10678     document-type { }
10679     element {
10680     general-entity-reference {
10681     node-name: 'c';
10682 wakaba 1.34 manakai-expanded: false;
10683 wakaba 1.20 }
10684     }
10685     }
10686     @@XMLTest:
10687     @@@QName: xp.reptxt.element.content.ger.entity.declared.standalone.-4.test
10688     @@@DEnt:
10689     @@@@test:value:
10690     <!DOCTYPE p [
10691     <!ENTITY c "&entity;">
10692     <!ENTITY % para SYSTEM "para">
10693     %para;
10694     ]>
10695     <p>&c;</p>
10696     @@@test:domTree:
10697     document {
10698     document-type { }
10699     element {
10700     general-entity-reference {
10701     node-name: 'c';
10702 wakaba 1.34 manakai-expanded: true;
10703 wakaba 1.20 general-entity-reference {
10704     node-name: 'entity';
10705 wakaba 1.34 manakai-expanded: false;
10706 wakaba 1.20 }
10707     }
10708     }
10709     }
10710     @@XMLTest:
10711     @@@QName:
10712     xp.reptxt.element.content.ger.entity.declared.standalone.-4.2.test
10713     @@@DEnt:
10714     @@@@test:value:
10715     <!DOCTYPE p [
10716     <!ENTITY % para SYSTEM "para">
10717     %para;
10718     <!ENTITY c "&entity;">
10719     ]>
10720     <p>&c;</p>
10721     @@@test:domTree:
10722     document {
10723     document-type { }
10724     element {
10725     general-entity-reference {
10726     node-name: 'c';
10727 wakaba 1.34 manakai-expanded: false;
10728 wakaba 1.20 }
10729     }
10730     }
10731     @@XMLTest:
10732     @@@QName: xp.reptxt.element.content.ger.entity.declared.standalone.5.test
10733     @@@DEnt:
10734     @@@@test:value:
10735     <?xml version="1.0" standalone="yes"?>
10736     <!DOCTYPE p SYSTEM "dtd" [
10737     <!ENTITY c "&entity;">
10738     ]>
10739     <p>&c;</p>
10740     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
10741     @@XMLTest:
10742     @@@QName: xp.reptxt.element.content.ger.entity.declared.standalone.-5.test
10743     @@@DEnt:
10744     @@@@test:value:
10745     <?xml version="1.0" standalone="no"?>
10746     <!DOCTYPE p SYSTEM "dtd" [
10747     <!ENTITY c "&entity;">
10748     ]>
10749     <p>&c;</p>
10750     @@@test:domTree:
10751     document {
10752     document-type { }
10753     element {
10754     general-entity-reference {
10755     node-name: 'c';
10756 wakaba 1.34 manakai-expanded: true;
10757 wakaba 1.20 general-entity-reference {
10758     node-name: 'entity';
10759 wakaba 1.34 manakai-expanded: false;
10760 wakaba 1.20 }
10761     }
10762     }
10763     }
10764     @@XMLTest:
10765     @@@QName: xp.reptxt.element.content.ger.entity.declared.standalone.-6.test
10766     @@@DEnt:
10767     @@@@test:value:
10768     <!DOCTYPE p SYSTEM "dtd" [<!ENTITY c "&entity;">]>
10769     <p>&c;</p>
10770     @@@test:domTree:
10771     document {
10772     document-type { }
10773     element {
10774     general-entity-reference {
10775     node-name: 'c';
10776 wakaba 1.34 manakai-expanded: true;
10777 wakaba 1.20 general-entity-reference {
10778     node-name: 'entity';
10779 wakaba 1.34 manakai-expanded: false;
10780 wakaba 1.20 }
10781     }
10782     }
10783     }
10784    
10785     @@XMLTest:
10786     @@@QName: xp.attval.ger.entity.declared.nodtd.1.test
10787     @@@DEnt:
10788     @@@@test:value:
10789     <p a="&entity;"/>
10790     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 7)..(1, 14); }
10791     @@XMLTest:
10792     @@@QName: xp.attval.ger.entity.declared.nodtd.2.test
10793     @@@DEnt:
10794     @@@@test:value:
10795     <?xml version="1.0" standalone="yes"?>
10796     <p a="&entity;"/>
10797     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 7)..(2, 14); }
10798     @@XMLTest:
10799     @@@QName: xp.attval.ger.entity.declared.nodtd.3.test
10800     @@@DEnt:
10801     @@@@test:value:
10802     <?xml version="1.0" standalone="no"?>
10803     <p a="&entity;"/>
10804     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 7)..(2, 14); }
10805     @@XMLTest:
10806     @@@QName: xp.attval.ger.entity.declared.nodtd.-1.test
10807     @@@DEnt:
10808     @@@@test:value:
10809     <p a="&lt;&gt;&amp;&quot;&apos;"/>
10810     @@@test:domTree:
10811     document {
10812     element {
10813     attribute {
10814     node-name: 'a';
10815     text-content: '<>&"' U+0027;
10816     }
10817     }
10818     }
10819     @@XMLTest:
10820     @@@QName: xp.attval.ger.entity.declared.nopref.1.test
10821     @@@DEnt:
10822     @@@@test:value:
10823     <!DOCTYPE p []>
10824     <p a="&entity;"/>
10825     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 7)..(2, 14); }
10826     @@XMLTest:
10827     @@@QName: xp.attval.ger.entity.declared.nopref.2.test
10828     @@@DEnt:
10829     @@@@test:value:
10830     <!DOCTYPE p [
10831     <!ENTITY other "aa">
10832     <!ENTITY % another "aa">
10833     ]>
10834     <p a="&entity;"/>
10835     @@@c:erred: <[[xp|wf-entity-declared]]> { (5, 7)..(5, 14); }
10836     @@XMLTest:
10837     @@@QName: xp.attval.ger.entity.declared.nopref.3.test
10838     @@@DEnt:
10839     @@@@test:value:
10840     <?xml version="1.0" standalone="yes"?>
10841     <!DOCTYPE p []>
10842     <p a="&entity;"/>
10843     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 7)..(3, 14); }
10844     @@XMLTest:
10845     @@@QName: xp.attval.ger.entity.declared.nopref.4.test
10846     @@@DEnt:
10847     @@@@test:value:
10848     <?xml version="1.0" standalone="no"?>
10849     <!DOCTYPE p []>
10850     <p a="&entity;"/>
10851     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 7)..(3, 14); }
10852     @@XMLTest:
10853     @@@QName: xp.attval.ger.entity.declared.nopref.5.test
10854     @@@DEnt:
10855     @@@@test:value:
10856     <?xml version="1.0" standalone="yes"?>
10857     <!DOCTYPE p [
10858     <!ENTITY other "aa">
10859     <!ENTITY % another "aa">
10860     ]>
10861     <p a="&entity;"/>
10862     @@@c:erred: <[[xp|wf-entity-declared]]> { (6, 7)..(6, 14); }
10863     @@XMLTest:
10864     @@@QName: xp.attval.ger.entity.declared.nopref.6.test
10865     @@@DEnt:
10866     @@@@test:value:
10867     <?xml version="1.0" standalone="no"?>
10868     <!DOCTYPE p [
10869     <!ENTITY other "aa">
10870     <!ENTITY % another "aa">
10871     ]>
10872     <p a="&entity;"/>
10873     @@@c:erred: <[[xp|wf-entity-declared]]> { (6, 7)..(6, 14); }
10874     @@XMLTest:
10875     @@@QName: xp.attval.ger.entity.declared.nopref.-1.test
10876     @@@DEnt:
10877     @@@@test:value:
10878     <!DOCTYPE p [
10879     <!ENTITY entity "value">
10880     ]>
10881     <p a="&entity;"/>
10882 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
10883 wakaba 1.20 @@@test:domTree:
10884     document {
10885     document-type {
10886     general-entity {
10887     node-name: 'entity';
10888     text-content: 'value';
10889     }
10890     }
10891     element {
10892     attribute {
10893     node-name: 'a';
10894     general-entity-reference {
10895     node-name: 'entity';
10896 wakaba 1.34 manakai-expanded: true;
10897 wakaba 1.20 text-content: 'value';
10898     }
10899     }
10900     }
10901     }
10902     @@XMLTest:
10903     @@@QName: xp.attval.ger.entity.declared.nopref.-2.test
10904     @@@DEnt:
10905     @@@@test:value:
10906     <!DOCTYPE p [
10907     <!ENTITY entity "value">
10908     <!ENTITY another SYSTEM "another">
10909     ]>
10910     <p a="&entity;"/>
10911 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
10912 wakaba 1.20 @@@test:domTree:
10913     document {
10914     document-type {
10915     general-entity {
10916     node-name: 'entity';
10917     text-content: 'value';
10918     has-replacement-tree: true;
10919     }
10920     general-entity {
10921     node-name: 'another';
10922     public-id: null;
10923     system-id: 'another';
10924     has-replacement-tree: false;
10925     }
10926     }
10927     element {
10928     attribute {
10929     node-name: 'a';
10930     general-entity-reference {
10931     node-name: 'entity';
10932 wakaba 1.34 manakai-expanded: true;
10933 wakaba 1.20 text-content: 'value';
10934     }
10935     }
10936     }
10937     }
10938     @@XMLTest:
10939     @@@QName: xp.attval.ger.entity.declared.standalone.1.test
10940     @@@DEnt:
10941     @@@@test:value:
10942     <?xml version="1.0" standalone="yes"?>
10943     <p a="&entity;"/>
10944     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 7)..(2, 14); }
10945     @@XMLTest:
10946     @@@QName: xp.attval.ger.entity.declared.standalone.2.test
10947     @@@DEnt:
10948     @@@@test:value:
10949     <?xml version="1.0" standalone="yes"?>
10950     <!DOCTYPE p []>
10951     <p a="&entity;"/>
10952     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 7)..(3, 14); }
10953     @@XMLTest:
10954     @@@QName: xp.attval.ger.entity.declared.standalone.3.test
10955     @@@DEnt:
10956     @@@@test:value:
10957     <?xml version="1.0" standalone="yes"?>
10958     <!DOCTYPE p [
10959     <!ENTITY % para "<!-- -->">
10960     %para;
10961     ]>
10962     <p a="&entity;"/>
10963     @@@c:erred: <[[xp|wf-entity-declared]]> { (6, 7)..(6, 14); }
10964     @@XMLTest:
10965     @@@QName: xp.attval.ger.entity.declared.standalone.-1.test
10966     @@@DEnt:
10967     @@@@test:value:
10968     <?xml version="1.0" standalone="no"?>
10969     <!DOCTYPE p [
10970     <!ENTITY % para "<!-- -->">
10971     %para;
10972     ]>
10973     <p a="&entity;"/>
10974     @@@test:domTree:
10975     document {
10976     document-type { }
10977     element {
10978     attribute {
10979     node-name: 'a';
10980     general-entity-reference {
10981 wakaba 1.34 manakai-expanded: false;
10982 wakaba 1.20 }
10983     }
10984     }
10985     }
10986     @@XMLTest:
10987     @@@QName: xp.attval.ger.entity.declared.standalone.-2.test
10988     @@@DEnt:
10989     @@@@test:value:
10990     <!DOCTYPE p [
10991     <!ENTITY % para "<!-- -->">
10992     %para;
10993     ]>
10994     <p a="&entity;"/>
10995     @@@test:domTree:
10996     document {
10997     document-type { }
10998     element {
10999     attribute {
11000     node-name: 'a';
11001     general-entity-reference {
11002 wakaba 1.34 manakai-expanded: false;
11003 wakaba 1.20 }
11004     }
11005     }
11006     }
11007     @@XMLTest:
11008     @@@QName: xp.attval.ger.entity.declared.standalone.4.test
11009     @@@DEnt:
11010     @@@@test:value:
11011     <?xml version="1.0" standalone="yes"?>
11012     <!DOCTYPE p [
11013     <!ENTITY % para SYSTEM "para">
11014     %para;
11015     ]>
11016     <p a="&entity;"/>
11017     @@@c:erred: <[[xp|wf-entity-declared]]> { (6, 7)..(6, 14); }
11018     @@XMLTest:
11019     @@@QName: xp.attval.ger.entity.declared.standalone.-3.test
11020     @@@DEnt:
11021     @@@@test:value:
11022     <?xml version="1.0" standalone="no"?>
11023     <!DOCTYPE p [
11024     <!ENTITY % para SYSTEM "para">
11025     %para;
11026     ]>
11027     <p a="&entity;"/>
11028     @@@test:domTree:
11029     document {
11030     document-type { }
11031     element {
11032     attribute {
11033     node-name: 'a';
11034     general-entity-reference {
11035 wakaba 1.34 manakai-expanded: false;
11036 wakaba 1.20 }
11037     }
11038     }
11039     }
11040     @@XMLTest:
11041     @@@QName: xp.attval.ger.entity.declared.standalone.-4.test
11042     @@@DEnt:
11043     @@@@test:value:
11044     <!DOCTYPE p [
11045     <!ENTITY % para SYSTEM "para">
11046     %para;
11047     ]>
11048     <p a="&entity;"/>
11049     @@@test:domTree:
11050     document {
11051     document-type { }
11052     element {
11053     attribute {
11054     node-name: 'a';
11055     general-entity-reference {
11056 wakaba 1.34 manakai-expanded: false;
11057 wakaba 1.20 }
11058     }
11059     }
11060     }
11061     @@XMLTest:
11062     @@@QName: xp.attval.ger.entity.declared.standalone.5.test
11063     @@@DEnt:
11064     @@@@test:value:
11065     <?xml version="1.0" standalone="yes"?>
11066     <!DOCTYPE p SYSTEM "dtd">
11067     <p a="&entity;"/>
11068     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 7)..(3, 14); }
11069     @@XMLTest:
11070     @@@QName: xp.attval.ger.entity.declared.standalone.-5.test
11071     @@@DEnt:
11072     @@@@test:value:
11073     <?xml version="1.0" standalone="no"?>
11074     <!DOCTYPE p SYSTEM "dtd">
11075     <p a="&entity;"/>
11076     @@@test:domTree:
11077     document {
11078     document-type { }
11079     element {
11080     attribute {
11081     node-name: 'a';
11082     general-entity-reference {
11083 wakaba 1.34 manakai-expanded: false;
11084 wakaba 1.20 }
11085     }
11086     }
11087     }
11088     @@XMLTest:
11089     @@@QName: xp.attval.ger.entity.declared.standalone.-6.test
11090     @@@DEnt:
11091     @@@@test:value:
11092     <!DOCTYPE p SYSTEM "dtd">
11093     <p a="&entity;"/>
11094     @@@test:domTree:
11095     document {
11096     document-type { }
11097     element {
11098     attribute {
11099     node-name: 'a';
11100     general-entity-reference {
11101 wakaba 1.34 manakai-expanded: false;
11102 wakaba 1.20 }
11103     }
11104     }
11105     }
11106    
11107 wakaba 1.21 @@XMLTest:
11108 wakaba 1.22 @@@QName: xp.reptxt.attval.ger.entity.declared.nopref.1.test
11109 wakaba 1.21 @@@DEnt:
11110     @@@@test:value:
11111     <!DOCTYPE p [
11112 wakaba 1.22 <!ENTITY c "&entity;">
11113 wakaba 1.21 ]>
11114 wakaba 1.22 <p a="&c;"/>
11115     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11116 wakaba 1.21 @@XMLTest:
11117 wakaba 1.22 @@@QName: xp.reptxt.attval.ger.entity.declared.nopref.2.test
11118 wakaba 1.21 @@@DEnt:
11119     @@@@test:value:
11120     <!DOCTYPE p [
11121     <!ENTITY other "aa">
11122     <!ENTITY % another "aa">
11123 wakaba 1.22 <!ENTITY c "&entity;">
11124 wakaba 1.21 ]>
11125 wakaba 1.22 <p a="&c;"/>
11126     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11127 wakaba 1.21 @@XMLTest:
11128 wakaba 1.22 @@@QName: xp.reptxt.attval.ger.entity.declared.nopref.3.test
11129 wakaba 1.21 @@@DEnt:
11130     @@@@test:value:
11131     <?xml version="1.0" standalone="yes"?>
11132     <!DOCTYPE p [
11133 wakaba 1.22 <!ENTITY c "&entity;">
11134 wakaba 1.21 ]>
11135 wakaba 1.22 <p a="&c;"/>
11136     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11137 wakaba 1.21 @@XMLTest:
11138 wakaba 1.22 @@@QName: xp.reptxt.attval.ger.entity.declared.nopref.4.test
11139 wakaba 1.21 @@@DEnt:
11140     @@@@test:value:
11141     <?xml version="1.0" standalone="no"?>
11142     <!DOCTYPE p [
11143 wakaba 1.22 <!ENTITY c "&entity;">
11144 wakaba 1.21 ]>
11145 wakaba 1.22 <p a="&c;"/>
11146     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11147 wakaba 1.21 @@XMLTest:
11148 wakaba 1.22 @@@QName: xp.reptxt.attval.ger.entity.declared.nopref.5.test
11149 wakaba 1.21 @@@DEnt:
11150     @@@@test:value:
11151     <?xml version="1.0" standalone="yes"?>
11152     <!DOCTYPE p [
11153     <!ENTITY other "aa">
11154     <!ENTITY % another "aa">
11155 wakaba 1.22 <!ENTITY c "&entity;">
11156 wakaba 1.21 ]>
11157 wakaba 1.22 <p a="&c;"/>
11158     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11159 wakaba 1.21 @@XMLTest:
11160 wakaba 1.22 @@@QName: xp.reptxt.attval.ger.entity.declared.nopref.6.test
11161 wakaba 1.21 @@@DEnt:
11162     @@@@test:value:
11163     <?xml version="1.0" standalone="no"?>
11164     <!DOCTYPE p [
11165     <!ENTITY other "aa">
11166     <!ENTITY % another "aa">
11167 wakaba 1.22 <!ENTITY c "&entity;">
11168 wakaba 1.21 ]>
11169 wakaba 1.22 <p a="&c;"/>
11170     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11171 wakaba 1.21 @@XMLTest:
11172 wakaba 1.22 @@@QName: xp.reptxt.attval.ger.entity.declared.nopref.-1.test
11173 wakaba 1.21 @@@DEnt:
11174     @@@@test:value:
11175     <!DOCTYPE p [
11176     <!ENTITY entity "value">
11177 wakaba 1.22 <!ENTITY c "&entity;">
11178 wakaba 1.21 ]>
11179 wakaba 1.22 <p a="&c;"/>
11180 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
11181 wakaba 1.21 @@@test:domTree:
11182     document {
11183     document-type {
11184     general-entity {
11185     node-name: 'entity';
11186     text-content: 'value';
11187     }
11188 wakaba 1.22 general-entity {
11189     node-name: 'c';
11190     general-entity-reference {
11191     node-name: 'entity';
11192     text-content: 'value';
11193 wakaba 1.21 }
11194     }
11195     }
11196     element {
11197     attribute {
11198     node-name: 'a';
11199     general-entity-reference {
11200 wakaba 1.22 node-name: 'c';
11201     general-entity-reference {
11202     node-name: 'entity';
11203     text-content: 'value';
11204     }
11205 wakaba 1.21 }
11206     }
11207     }
11208     }
11209     @@XMLTest:
11210 wakaba 1.22 @@@QName: xp.reptxt.attval.ger.entity.declared.nopref.-2.test
11211 wakaba 1.21 @@@DEnt:
11212     @@@@test:value:
11213     <!DOCTYPE p [
11214     <!ENTITY entity "value">
11215     <!ENTITY another SYSTEM "another">
11216 wakaba 1.22 <!ENTITY c "&entity;">
11217 wakaba 1.21 ]>
11218 wakaba 1.22 <p a="&c;"/>
11219 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
11220 wakaba 1.21 @@@test:domTree:
11221     document {
11222     document-type {
11223     general-entity {
11224     node-name: 'entity';
11225     text-content: 'value';
11226 wakaba 1.22 }
11227     general-entity {
11228     node-name: 'c';
11229     general-entity-reference {
11230     node-name: 'entity';
11231     text-content: 'value';
11232     }
11233 wakaba 1.21 }
11234     general-entity {
11235     node-name: 'another';
11236     public-id: null;
11237     system-id: 'another';
11238     has-replacement-tree: false;
11239     }
11240     }
11241     element {
11242     attribute {
11243     node-name: 'a';
11244     general-entity-reference {
11245 wakaba 1.22 node-name: 'c';
11246     general-entity-reference {
11247     node-name: 'entity';
11248     text-content: 'value';
11249     }
11250 wakaba 1.21 }
11251     }
11252     }
11253     }
11254     @@XMLTest:
11255 wakaba 1.22 @@@QName: xp.reptxt.attval.ger.entity.declared.standalone.2.test
11256 wakaba 1.21 @@@DEnt:
11257     @@@@test:value:
11258     <?xml version="1.0" standalone="yes"?>
11259     <!DOCTYPE p [
11260 wakaba 1.22 <!ENTITY c "&entity;">
11261 wakaba 1.21 ]>
11262 wakaba 1.22 <p a="&c;"/>
11263     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11264 wakaba 1.21 @@XMLTest:
11265 wakaba 1.22 @@@QName: xp.reptxt.attval.ger.entity.declared.standalone.3.test
11266 wakaba 1.21 @@@DEnt:
11267     @@@@test:value:
11268     <?xml version="1.0" standalone="yes"?>
11269     <!DOCTYPE p [
11270     <!ENTITY % para "<!-- -->">
11271     %para;
11272 wakaba 1.22 <!ENTITY c "&entity;">
11273 wakaba 1.21 ]>
11274 wakaba 1.22 <p a="&c;"/>
11275     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11276 wakaba 1.21 @@XMLTest:
11277 wakaba 1.22 @@@QName: xp.reptxt.attval.ger.entity.declared.standalone.-1.test
11278 wakaba 1.21 @@@DEnt:
11279     @@@@test:value:
11280 wakaba 1.22 <?xml version="1.0" standalone="no"?>
11281 wakaba 1.21 <!DOCTYPE p [
11282 wakaba 1.22 <!ENTITY c "&entity;">
11283 wakaba 1.21 <!ENTITY % para "<!-- -->">
11284     %para;
11285     ]>
11286 wakaba 1.22 <p a="&c;"/>
11287 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
11288 wakaba 1.22 @@@test:domTree:
11289     document {
11290     document-type {
11291     general-entity {
11292     node-name: 'c';
11293     general-entity-reference {
11294     node-name: 'entity';
11295 wakaba 1.34 manakai-expanded: false;
11296 wakaba 1.22 }
11297     }
11298     }
11299     element {
11300     attribute {
11301     node-name: 'a';
11302     general-entity-reference {
11303     node-name: 'c';
11304     general-entity-reference {
11305     node-name: 'entity';
11306 wakaba 1.34 manakai-expanded: false;
11307 wakaba 1.22 }
11308     }
11309     }
11310     }
11311     }
11312 wakaba 1.21 @@XMLTest:
11313 wakaba 1.22 @@@QName:
11314     xp.reptxt.attval.ger.entity.declared.standalone.-1.2.test
11315 wakaba 1.21 @@@DEnt:
11316     @@@@test:value:
11317     <?xml version="1.0" standalone="no"?>
11318     <!DOCTYPE p [
11319     <!ENTITY % para "<!-- -->">
11320     %para;
11321 wakaba 1.22 <!ENTITY c "&entity;">
11322 wakaba 1.21 ]>
11323 wakaba 1.22 <p a="&c;"/>
11324     @@@test:domTree:
11325     document {
11326     document-type { }
11327     element {
11328     attribute {
11329     node-name: 'a';
11330     general-entity-reference {
11331     node-name: 'c';
11332 wakaba 1.34 manakai-expanded: false;
11333 wakaba 1.22 }
11334     }
11335     }
11336     }
11337 wakaba 1.21 @@XMLTest:
11338 wakaba 1.22 @@@QName: xp.reptxt.attval.ger.entity.declared.standalone.-2.test
11339 wakaba 1.21 @@@DEnt:
11340     @@@@test:value:
11341     <!DOCTYPE p [
11342 wakaba 1.22 <!ENTITY c "&entity;">
11343     <!ENTITY % para "<!-- -->">
11344     %para;
11345     ]>
11346     <p a="&c;"/>
11347     @@@test:domTree:
11348     document {
11349     document-type { }
11350     element {
11351     attribute {
11352     node-name: 'a';
11353     general-entity-reference {
11354     node-name: 'c';
11355 wakaba 1.34 manakai-expanded: true;
11356 wakaba 1.22 general-entity-reference {
11357     node-name: 'entity';
11358 wakaba 1.34 manakai-expanded: false;
11359 wakaba 1.22 }
11360     }
11361     }
11362     }
11363     }
11364     @@XMLTest:
11365     @@@QName:
11366     xp.reptxt.attval.ger.entity.declared.standalone.-2.2.test
11367     @@@DEnt:
11368     @@@@test:value:
11369     <!DOCTYPE p [
11370     <!ENTITY % para "<!-- -->">
11371     %para;
11372     <!ENTITY c "&entity;">
11373     ]>
11374     <p a="&c;"/>
11375     @@@test:domTree:
11376     document {
11377     document-type { }
11378     element {
11379     attribute {
11380     node-name: 'a';
11381     general-entity-reference {
11382     node-name: 'c';
11383 wakaba 1.34 manakai-expanded: false;
11384 wakaba 1.22 }
11385     }
11386     }
11387     }
11388     @@XMLTest:
11389     @@@QName: xp.reptxt.attval.ger.entity.declared.standalone.4.test
11390     @@@DEnt:
11391     @@@@test:value:
11392     <?xml version="1.0" standalone="yes"?>
11393     <!DOCTYPE p [
11394     <!ENTITY % para SYSTEM "para">
11395     %para;
11396     <!ENTITY c "&entity;">
11397     ]>
11398     <p a="&c;"/>
11399     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11400     @@XMLTest:
11401     @@@QName: xp.reptxt.attval.ger.entity.declared.standalone.-3.test
11402     @@@DEnt:
11403     @@@@test:value:
11404     <?xml version="1.0" standalone="no"?>
11405     <!DOCTYPE p [
11406     <!ENTITY c "&entity;">
11407     <!ENTITY % para SYSTEM "para">
11408     %para;
11409     ]>
11410     <p a="&c;"/>
11411     @@@test:domTree:
11412     document {
11413     document-type { }
11414     element {
11415     attribute {
11416     node-name: 'a';
11417     general-entity-reference {
11418     node-name: 'c';
11419 wakaba 1.34 manakai-expanded: true;
11420 wakaba 1.22 general-entity-reference {
11421     node-name: 'entity';
11422 wakaba 1.34 manakai-expanded: false;
11423 wakaba 1.22 }
11424     }
11425     }
11426     }
11427     }
11428     @@XMLTest:
11429     @@@QName:
11430     xp.reptxt.attval.ger.entity.declared.standalone.-3.2.test
11431     @@@DEnt:
11432     @@@@test:value:
11433     <?xml version="1.0" standalone="no"?>
11434     <!DOCTYPE p [
11435     <!ENTITY % para SYSTEM "para">
11436     %para;
11437     <!ENTITY c "&entity;">
11438     ]>
11439     <p a="&c;"/>
11440     @@@test:domTree:
11441     document {
11442     document-type { }
11443     element {
11444     attribute {
11445     node-name: 'a';
11446     general-entity-reference {
11447     node-name: 'c';
11448 wakaba 1.34 manakai-expanded: false;
11449 wakaba 1.22 }
11450     }
11451     }
11452     }
11453     @@XMLTest:
11454     @@@QName: xp.reptxt.attval.ger.entity.declared.standalone.-4.test
11455     @@@DEnt:
11456     @@@@test:value:
11457     <!DOCTYPE p [
11458     <!ENTITY c "&entity;">
11459     <!ENTITY % para SYSTEM "para">
11460     %para;
11461     ]>
11462     <p a="&c;"/>
11463     @@@test:domTree:
11464     document {
11465     document-type { }
11466     element {
11467     attribute {
11468     node-name: 'a';
11469     general-entity-reference {
11470     node-name: 'c';
11471 wakaba 1.34 manakai-expanded: true;
11472 wakaba 1.22 general-entity-reference {
11473     node-name: 'entity';
11474 wakaba 1.34 manakai-expanded: false;
11475 wakaba 1.22 }
11476     }
11477     }
11478     }
11479     }
11480     @@XMLTest:
11481     @@@QName:
11482     xp.reptxt.attval.ger.entity.declared.standalone.-4.2.test
11483     @@@DEnt:
11484     @@@@test:value:
11485     <!DOCTYPE p [
11486     <!ENTITY % para SYSTEM "para">
11487     %para;
11488     <!ENTITY c "&entity;">
11489     ]>
11490     <p a="&c;"/>
11491     @@@test:domTree:
11492     document {
11493     document-type { }
11494     element {
11495     attribute {
11496     node-name: 'a';
11497     general-entity-reference {
11498     node-name: 'c';
11499 wakaba 1.34 manakai-expanded: false;
11500 wakaba 1.22 }
11501     }
11502     }
11503     }
11504     @@XMLTest:
11505     @@@QName: xp.reptxt.attval.ger.entity.declared.standalone.5.test
11506     @@@DEnt:
11507     @@@@test:value:
11508     <?xml version="1.0" standalone="yes"?>
11509     <!DOCTYPE p SYSTEM "dtd" [
11510     <!ENTITY c "&entity;">
11511     ]>
11512     <p a="&c;"/>
11513     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11514     @@XMLTest:
11515     @@@QName: xp.reptxt.attval.ger.entity.declared.standalone.-5.test
11516     @@@DEnt:
11517     @@@@test:value:
11518     <?xml version="1.0" standalone="no"?>
11519     <!DOCTYPE p SYSTEM "dtd" [
11520     <!ENTITY c "&entity;">
11521     ]>
11522     <p a="&c;"/>
11523     @@@test:domTree:
11524     document {
11525     document-type { }
11526     element {
11527     attribute {
11528     node-name: 'a';
11529     general-entity-reference {
11530     node-name: 'c';
11531 wakaba 1.34 manakai-expanded: true;
11532 wakaba 1.22 general-entity-reference {
11533     node-name: 'entity';
11534 wakaba 1.34 manakai-expanded: false;
11535 wakaba 1.22 }
11536     }
11537     }
11538     }
11539     }
11540     @@XMLTest:
11541     @@@QName: xp.reptxt.attval.ger.entity.declared.standalone.-6.test
11542     @@@DEnt:
11543     @@@@test:value:
11544     <!DOCTYPE p SYSTEM "dtd" [<!ENTITY c "&entity;">]>
11545     <p a="&c;"/>
11546     @@@test:domTree:
11547     document {
11548     document-type { }
11549     element {
11550     attribute {
11551     node-name: 'a';
11552     general-entity-reference {
11553     node-name: 'c';
11554 wakaba 1.34 manakai-expanded: true;
11555 wakaba 1.22 general-entity-reference {
11556     node-name: 'entity';
11557 wakaba 1.34 manakai-expanded: false;
11558 wakaba 1.22 }
11559     }
11560     }
11561     }
11562     }
11563    
11564     @@XMLTest:
11565     @@@QName: xp.attlist.dup.entity.declared.1.test
11566     @@@DEnt:
11567     @@@@test:value:
11568     <!DOCTYPE p [
11569     <!ATTLIST p a CDATA "no-entity">
11570     <!ATTLIST p a CDATA "&entity;">
11571     ]>
11572     <p/>
11573     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 21)..(3, 29); }
11574     @@XMLTest:
11575     @@@QName: xp.attlist.dup.entity.declared.2.test
11576     @@@DEnt:
11577     @@@@test:value:
11578     <!DOCTYPE p [
11579     <!ATTLIST p a CDATA "no-entity"
11580     a CDATA "&entity;">
11581     ]>
11582     <p/>
11583     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 21)..(3, 29); }
11584     @@XMLTest:
11585     @@@QName: xp.attlist.unused.entity.declared.1.test
11586     @@@DEnt:
11587     @@@@test:value:
11588     <!DOCTYPE p [
11589     <!ATTLIST q a CDATA "&entity;">
11590     ]>
11591     <p/>
11592     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 21)..(2, 29); }
11593     @@XMLTest:
11594     @@@QName: xp.attlist.unused.entity.declared.2.test
11595     @@@DEnt:
11596     @@@@test:value:
11597     <!DOCTYPE p [
11598     <!ATTLIST p a CDATA "&entity;">
11599     ]>
11600     <p a="bb"/>
11601     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 21)..(2, 29); }
11602    
11603     @@XMLTest:
11604     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.nopref.1.test
11605     @@@DEnt:
11606     @@@@test:value:
11607     <!DOCTYPE p [
11608     <!ENTITY c "&entity;">
11609     <!ATTLIST p a CDATA "&c;">
11610     ]>
11611     <p/>
11612     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11613     @@XMLTest:
11614     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.nopref.2.test
11615     @@@DEnt:
11616     @@@@test:value:
11617     <!DOCTYPE p [
11618     <!ENTITY other "aa">
11619     <!ENTITY % another "aa">
11620     <!ENTITY c "&entity;">
11621     <!ATTLIST p a CDATA "&c;">
11622     ]>
11623     <p/>
11624     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11625     @@XMLTest:
11626     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.nopref.3.test
11627     @@@DEnt:
11628     @@@@test:value:
11629     <?xml version="1.0" standalone="yes"?>
11630     <!DOCTYPE p [
11631     <!ENTITY c "&entity;">
11632     <!ATTLIST p a CDATA "&c;">
11633     ]>
11634     <p/>
11635     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11636     @@XMLTest:
11637     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.nopref.4.test
11638     @@@DEnt:
11639     @@@@test:value:
11640     <?xml version="1.0" standalone="no"?>
11641     <!DOCTYPE p [
11642     <!ENTITY c "&entity;">
11643     <!ATTLIST p a CDATA "&c;">
11644     ]>
11645     <p/>
11646     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11647     @@XMLTest:
11648     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.nopref.5.test
11649     @@@DEnt:
11650     @@@@test:value:
11651     <?xml version="1.0" standalone="yes"?>
11652     <!DOCTYPE p [
11653     <!ENTITY other "aa">
11654     <!ENTITY % another "aa">
11655     <!ENTITY c "&entity;">
11656     <!ATTLIST p a CDATA "&c;">
11657     ]>
11658     <p/>
11659     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11660     @@XMLTest:
11661     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.nopref.6.test
11662     @@@DEnt:
11663     @@@@test:value:
11664     <?xml version="1.0" standalone="no"?>
11665     <!DOCTYPE p [
11666     <!ENTITY other "aa">
11667     <!ENTITY % another "aa">
11668     <!ENTITY c "&entity;">
11669     <!ATTLIST p a CDATA "&c;">
11670     ]>
11671     <p/>
11672     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11673     @@XMLTest:
11674     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.nopref.-1.test
11675     @@@DEnt:
11676     @@@@test:value:
11677     <!DOCTYPE p [
11678     <!ENTITY entity "value">
11679     <!ENTITY c "&entity;">
11680     <!ATTLIST p a CDATA "&c;">
11681     ]>
11682     <p/>
11683 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
11684 wakaba 1.22 @@@test:domTree:
11685     document {
11686     document-type {
11687     general-entity {
11688     node-name: 'entity';
11689     text-content: 'value';
11690     }
11691     general-entity {
11692     node-name: 'c';
11693     general-entity-reference {
11694     node-name: 'entity';
11695 wakaba 1.34 manakai-expanded: true;
11696 wakaba 1.22 text-content: 'value';
11697     }
11698     }
11699     element-type-definition {
11700     node-name: 'p';
11701     attribute-definition {
11702     node-name: 'a';
11703     general-entity-reference {
11704     node-name: 'c';
11705 wakaba 1.34 manakai-expanded: true;
11706 wakaba 1.22 general-entity-reference {
11707     node-name: 'entity';
11708 wakaba 1.34 manakai-expanded: true;
11709 wakaba 1.22 text-content: 'value';
11710     }
11711     }
11712     }
11713     }
11714     }
11715     element {
11716     attribute {
11717     node-name: 'a';
11718     specified: false;
11719     general-entity-reference {
11720     node-name: 'c';
11721     general-entity-reference {
11722     node-name: 'entity';
11723     text-content: 'value';
11724     }
11725     }
11726     }
11727     }
11728     }
11729     @@XMLTest:
11730     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.nopref.-2.test
11731     @@@DEnt:
11732     @@@@test:value:
11733     <!DOCTYPE p [
11734     <!ENTITY entity "value">
11735     <!ENTITY another SYSTEM "another">
11736     <!ENTITY c "&entity;">
11737     <!ATTLIST p a CDATA "&c;">
11738     ]>
11739     <p/>
11740 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
11741 wakaba 1.22 @@@test:domTree:
11742     document {
11743     document-type {
11744     general-entity {
11745     node-name: 'entity';
11746     text-content: 'value';
11747     }
11748     general-entity {
11749     node-name: 'c';
11750     general-entity-reference {
11751     node-name: 'entity';
11752     text-content: 'value';
11753     }
11754     }
11755     general-entity {
11756     node-name: 'another';
11757     public-id: null;
11758     system-id: 'another';
11759     has-replacement-tree: false;
11760     }
11761     element-type-definition {
11762     node-name: 'p';
11763     attribute-definition {
11764     node-name: 'a';
11765     general-entity-reference {
11766     node-name: 'c';
11767 wakaba 1.34 manakai-expanded: true;
11768 wakaba 1.22 general-entity-reference {
11769     node-name: 'entity';
11770 wakaba 1.34 manakai-expanded: true;
11771 wakaba 1.22 text-content: 'value';
11772     }
11773     }
11774     }
11775     }
11776     }
11777     element {
11778     attribute {
11779     node-name: 'a';
11780     specified: false;
11781     general-entity-reference {
11782     node-name: 'c';
11783     general-entity-reference {
11784     node-name: 'entity';
11785     text-content: 'value';
11786     }
11787     }
11788     }
11789     }
11790     }
11791     @@XMLTest:
11792     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.standalone.2.test
11793     @@@DEnt:
11794     @@@@test:value:
11795     <?xml version="1.0" standalone="yes"?>
11796     <!DOCTYPE p [
11797     <!ENTITY c "&entity;">
11798     <!ATTLIST p a CDATA "&c;">
11799     ]>
11800     <p/>
11801     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11802     @@XMLTest:
11803     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.standalone.3.test
11804     @@@DEnt:
11805     @@@@test:value:
11806     <?xml version="1.0" standalone="yes"?>
11807     <!DOCTYPE p [
11808     <!ENTITY % para "<!-- -->">
11809     %para;
11810     <!ENTITY c "&entity;">
11811     <!ATTLIST p a CDATA "&c;">
11812     ]>
11813     <p/>
11814     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11815     @@XMLTest:
11816     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.standalone.-1.test
11817     @@@DEnt:
11818     @@@@test:value:
11819     <?xml version="1.0" standalone="no"?>
11820     <!DOCTYPE p [
11821     <!ENTITY c "&entity;">
11822     <!ATTLIST p a CDATA "&c;">
11823     <!ENTITY % para "<!-- -->">
11824     %para;
11825     ]>
11826     <p/>
11827     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11828     @@XMLTest:
11829     @@@QName:
11830     xp.reptxt.attlist.attval.ger.entity.declared.standalone.-1.2.test
11831     @@@DEnt:
11832     @@@@test:value:
11833     <?xml version="1.0" standalone="no"?>
11834     <!DOCTYPE p [
11835     <!ENTITY % para "<!-- -->">
11836     %para;
11837     <!ENTITY c "&entity;">
11838     <!ATTLIST p a CDATA "&c;">
11839     ]>
11840     <p g="h"/>
11841     @@@test:domTree:
11842     document {
11843     document-type { }
11844     element {
11845     attribute {
11846     node-name: 'g';
11847     text-content: 'h';
11848     }
11849     }
11850     }
11851     @@XMLTest:
11852     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.standalone.-2.test
11853     @@@DEnt:
11854     @@@@test:value:
11855     <!DOCTYPE p [
11856     <!ENTITY c "&entity;">
11857     <!ATTLIST p a CDATA "&c;">
11858     <!ENTITY % para "<!-- -->">
11859     %para;
11860     ]>
11861     <p/>
11862     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11863     @@XMLTest:
11864     @@@QName:
11865     xp.reptxt.attlist.attval.ger.entity.declared.standalone.-2.2.test
11866     @@@DEnt:
11867     @@@@test:value:
11868     <!DOCTYPE p [
11869     <!ENTITY % para "<!-- -->">
11870     %para;
11871     <!ENTITY c "&entity;">
11872     <!ATTLIST p a CDATA "&c;">
11873     ]>
11874     <p g="h"/>
11875     @@@test:domTree:
11876     document {
11877     document-type { }
11878     element {
11879     attribute {
11880     node-name: 'g';
11881     text-content: 'h';
11882     }
11883     }
11884     }
11885     @@XMLTest:
11886     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.standalone.4.test
11887     @@@DEnt:
11888     @@@@test:value:
11889     <?xml version="1.0" standalone="yes"?>
11890     <!DOCTYPE p [
11891     <!ENTITY % para SYSTEM "para">
11892     %para;
11893     <!ENTITY c "&entity;">
11894     <!ATTLIST p a CDATA "&c;">
11895     ]>
11896     <p/>
11897     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11898     @@XMLTest:
11899     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.standalone.-3.test
11900     @@@DEnt:
11901     @@@@test:value:
11902     <?xml version="1.0" standalone="no"?>
11903     <!DOCTYPE p [
11904     <!ENTITY c "&entity;">
11905     <!ATTLIST p a CDATA "&c;">
11906     <!ENTITY % para SYSTEM "para">
11907     %para;
11908     ]>
11909     <p/>
11910     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11911     @@XMLTest:
11912     @@@QName:
11913     xp.reptxt.attlist.attval.ger.entity.declared.standalone.-3.2.test
11914     @@@DEnt:
11915     @@@@test:value:
11916     <?xml version="1.0" standalone="no"?>
11917     <!DOCTYPE p [
11918     <!ENTITY % para SYSTEM "para">
11919     %para;
11920     <!ENTITY c "&entity;">
11921     <!ATTLIST p a CDATA "&c;">
11922     ]>
11923     <p g="h"/>
11924     @@@test:domTree:
11925     document {
11926     document-type { }
11927     element {
11928     attribute {
11929     node-name: 'g';
11930     text-content: 'h';
11931     }
11932     }
11933     }
11934     @@XMLTest:
11935     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.standalone.-4.test
11936     @@@DEnt:
11937     @@@@test:value:
11938     <!DOCTYPE p [
11939     <!ENTITY c "&entity;">
11940     <!ATTLIST p a CDATA "&c;">
11941     <!ENTITY % para SYSTEM "para">
11942     %para;
11943     ]>
11944     <p/>
11945     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11946     @@XMLTest:
11947     @@@QName:
11948     xp.reptxt.attlist.attval.ger.entity.declared.standalone.-4.2.test
11949     @@@DEnt:
11950     @@@@test:value:
11951     <!DOCTYPE p [
11952     <!ENTITY % para SYSTEM "para">
11953     %para;
11954     <!ENTITY c "&entity;">
11955     <!ATTLIST p a CDATA "&c;">
11956     ]>
11957     <p g="h"/>
11958     @@@test:domTree:
11959     document {
11960     document-type { }
11961     element {
11962     attribute {
11963     node-name: 'g';
11964     text-content: 'h';
11965     }
11966     }
11967     }
11968     @@XMLTest:
11969     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.standalone.5.test
11970     @@@DEnt:
11971     @@@@test:value:
11972     <?xml version="1.0" standalone="yes"?>
11973     <!DOCTYPE p SYSTEM "dtd" [
11974     <!ENTITY c "&entity;">
11975     <!ATTLIST p a CDATA "&c;">
11976     ]>
11977     <p/>
11978     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11979     @@XMLTest:
11980     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.standalone.-5.test
11981     @@@DEnt:
11982     @@@@test:value:
11983     <?xml version="1.0" standalone="no"?>
11984     <!DOCTYPE p SYSTEM "dtd" [
11985     <!ENTITY c "&entity;">
11986     <!ATTLIST p a CDATA "&c;">
11987     ]>
11988     <p/>
11989     @@@test:domTree:
11990     document {
11991     document-type { }
11992     element {
11993     attribute {
11994     node-name: 'a';
11995     specified: false;
11996     general-entity-reference {
11997     node-name: 'c';
11998 wakaba 1.34 manakai-expanded: true;
11999 wakaba 1.22 general-entity-reference {
12000     node-name: 'entity';
12001 wakaba 1.34 manakai-expanded: false;
12002 wakaba 1.22 }
12003     }
12004     }
12005     }
12006     }
12007     @@XMLTest:
12008     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.standalone.-6.test
12009     @@@DEnt:
12010     @@@@test:value:
12011     <!DOCTYPE p SYSTEM "dtd" [<!ENTITY c "&entity;">
12012     <!ATTLIST p a CDATA "&c;">
12013     ]>
12014     <p/>
12015     @@@test:domTree:
12016     document {
12017     document-type { }
12018     element {
12019     attribute {
12020     node-name: 'a';
12021     specified: false;
12022     general-entity-reference {
12023     node-name: 'c';
12024 wakaba 1.34 manakai-expanded: true;
12025 wakaba 1.22 general-entity-reference {
12026     node-name: 'entity';
12027 wakaba 1.34 manakai-expanded: false;
12028 wakaba 1.22 }
12029     }
12030     }
12031     }
12032     }
12033    
12034     @@XMLTest:
12035     @@@QName: xp.attlist.attval.ger.entity.declared.nopref.1.test
12036     @@@DEnt:
12037     @@@@test:value:
12038     <!DOCTYPE p [
12039     <!ATTLIST p a CDATA "&entity;">
12040     ]>
12041     <p/>
12042     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 22)..(2, 29); }
12043     @@XMLTest:
12044     @@@QName: xp.attlist.attval.ger.entity.declared.nopref.2.test
12045     @@@DEnt:
12046     @@@@test:value:
12047     <!DOCTYPE p [
12048     <!ENTITY other "aa">
12049     <!ENTITY % another "aa">
12050     <!ATTLIST p a CDATA "&entity;">
12051     ]>
12052     <p/>
12053     @@@c:erred: <[[xp|wf-entity-declared]]> { (4, 22)..(4, 29); }
12054     @@XMLTest:
12055     @@@QName: xp.attlist.attval.ger.entity.declared.nopref.3.test
12056     @@@DEnt:
12057     @@@@test:value:
12058     <?xml version="1.0" standalone="yes"?>
12059     <!DOCTYPE p [
12060     <!ATTLIST p a CDATA "&entity;">
12061     ]>
12062     <p/>
12063     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 22)..(3, 29); }
12064     @@XMLTest:
12065     @@@QName: xp.attlist.attval.ger.entity.declared.nopref.4.test
12066     @@@DEnt:
12067     @@@@test:value:
12068     <?xml version="1.0" standalone="no"?>
12069     <!DOCTYPE p [
12070     <!ATTLIST p a CDATA "&entity;">
12071     ]>
12072     <p/>
12073     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 22)..(3, 29); }
12074     @@XMLTest:
12075     @@@QName: xp.attlist.attval.ger.entity.declared.nopref.5.test
12076     @@@DEnt:
12077     @@@@test:value:
12078     <?xml version="1.0" standalone="yes"?>
12079     <!DOCTYPE p [
12080     <!ENTITY other "aa">
12081     <!ENTITY % another "aa">
12082     <!ATTLIST p a CDATA "&entity;">
12083     ]>
12084     <p/>
12085     @@@c:erred: <[[xp|wf-entity-declared]]> { (5, 22)..(5, 29); }
12086     @@XMLTest:
12087     @@@QName: xp.attlist.attval.ger.entity.declared.nopref.6.test
12088     @@@DEnt:
12089     @@@@test:value:
12090     <?xml version="1.0" standalone="no"?>
12091     <!DOCTYPE p [
12092     <!ENTITY other "aa">
12093     <!ENTITY % another "aa">
12094     <!ATTLIST p a CDATA "&entity;">
12095     ]>
12096     <p/>
12097     @@@c:erred: <[[xp|wf-entity-declared]]> { (5, 22)..(5, 29); }
12098     @@XMLTest:
12099     @@@QName: xp.attlist.attval.ger.entity.declared.nopref.-1.test
12100     @@@DEnt:
12101     @@@@test:value:
12102     <!DOCTYPE p [
12103     <!ENTITY entity "value">
12104     <!ATTLIST p a CDATA "&entity;">
12105     ]>
12106     <p/>
12107 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
12108 wakaba 1.22 @@@test:domTree:
12109     document {
12110     document-type {
12111     general-entity {
12112     node-name: 'entity';
12113     text-content: 'value';
12114     }
12115     element-type-definition {
12116     node-name: 'p';
12117     attribute-definition {
12118     node-name: 'a';
12119     general-entity-reference {
12120     node-name: 'entity';
12121 wakaba 1.34 manakai-expanded: true;
12122 wakaba 1.22 text-content: 'value';
12123     }
12124     }
12125     }
12126     }
12127     element {
12128     attribute {
12129     node-name: 'a';
12130     specified: false;
12131     general-entity-reference {
12132     node-name: 'entity';
12133 wakaba 1.34 manakai-expanded: true;
12134 wakaba 1.22 text-content: 'value';
12135     }
12136     }
12137     }
12138     }
12139     @@XMLTest:
12140     @@@QName: xp.attlist.attval.ger.entity.declared.nopref.-1.2.test
12141     @@@DEnt:
12142     @@@@test:value:
12143     <!DOCTYPE p [
12144     <!ATTLIST p a CDATA "&entity;">
12145     <!ENTITY entity "value">
12146     ]>
12147     <p/>
12148     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 22)..(2, 29); }
12149     @@XMLTest:
12150     @@@QName: xp.attlist.attval.ger.entity.declared.nopref.-2.test
12151     @@@DEnt:
12152     @@@@test:value:
12153     <!DOCTYPE p [
12154     <!ENTITY entity "value">
12155     <!ENTITY another SYSTEM "another">
12156     <!ATTLIST p a CDATA "&entity;">
12157     ]>
12158     <p/>
12159 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
12160 wakaba 1.22 @@@test:domTree:
12161     document {
12162     document-type {
12163     element-type-definition {
12164     node-name: 'p';
12165     attribute-definition {
12166     node-name: 'a';
12167     general-entity-reference {
12168     node-name: 'entity';
12169 wakaba 1.34 manakai-expanded: true;
12170 wakaba 1.22 text-content: 'value';
12171     }
12172     }
12173     }
12174     general-entity {
12175     node-name: 'entity';
12176     text-content: 'value';
12177     has-replacement-tree: true;
12178     }
12179     general-entity {
12180     node-name: 'another';
12181     public-id: null;
12182     system-id: 'another';
12183     has-replacement-tree: false;
12184     }
12185     }
12186     element {
12187     attribute {
12188     node-name: 'a';
12189     specified: false;
12190     general-entity-reference {
12191     node-name: 'entity';
12192 wakaba 1.34 manakai-expanded: true;
12193 wakaba 1.22 text-content: 'value';
12194     }
12195     }
12196     }
12197     }
12198     @@XMLTest:
12199     @@@QName: xp.attlist.attval.ger.entity.declared.nopref.-2.2.test
12200     @@@DEnt:
12201     @@@@test:value:
12202     <!DOCTYPE p [
12203     <!ATTLIST p a CDATA "&entity;">
12204     <!ENTITY entity "value">
12205     <!ENTITY another SYSTEM "another">
12206     ]>
12207     <p/>
12208     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 22)..(2, 29); }
12209     @@XMLTest:
12210     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.2.test
12211     @@@DEnt:
12212     @@@@test:value:
12213     <?xml version="1.0" standalone="yes"?>
12214     <!DOCTYPE p [
12215     <!ATTLIST p a CDATA "&entity;">
12216     ]>
12217     <p/>
12218     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 22)..(3, 29); }
12219     @@XMLTest:
12220     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.3.test
12221     @@@DEnt:
12222     @@@@test:value:
12223     <?xml version="1.0" standalone="yes"?>
12224     <!DOCTYPE p [
12225     <!ATTLIST p a CDATA "&entity;">
12226     <!ENTITY % para "<!-- -->">
12227     %para;
12228     ]>
12229     <p/>
12230     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 22)..(3, 29); }
12231     @@XMLTest:
12232     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.3.2.test
12233     @@@DEnt:
12234     @@@@test:value:
12235     <?xml version="1.0" standalone="yes"?>
12236     <!DOCTYPE p [
12237     <!ENTITY % para "<!-- -->">
12238     %para;
12239     <!ATTLIST p a CDATA "&entity;">
12240     ]>
12241     <p/>
12242     @@@c:erred: <[[xp|wf-entity-declared]]> { (5, 22)..(5, 29); }
12243     @@@enImplNote:
12244     The <XML::ATTLIST> declaration is processed since
12245     it is a <XA::standalone> document.
12246     @@XMLTest:
12247     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.-1.test
12248     @@@DEnt:
12249     @@@@test:value:
12250     <?xml version="1.0" standalone="no"?>
12251     <!DOCTYPE p [
12252     <!ATTLIST p a CDATA "&entity;">
12253     <!ENTITY % para "<!-- -->">
12254     %para;
12255     ]>
12256     <p/>
12257     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 22)..(3, 29); }
12258     @@XMLTest:
12259     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.-1.2.test
12260     @@@DEnt:
12261     @@@@test:value:
12262     <?xml version="1.0" standalone="no"?>
12263     <!DOCTYPE p [
12264 wakaba 1.25 <!ATTLIST p b CDATA #IMPLIED>
12265 wakaba 1.21 <!ENTITY % para "<!-- -->">
12266     %para;
12267     <!ATTLIST p a CDATA "&entity;">
12268     ]>
12269     <p c="d"/>
12270 wakaba 1.25 @@@c:erred:
12271     <[[xp|warning-attribute-definition-not-processed]]> { (6, 13)..(6, 30); }
12272 wakaba 1.21 @@@test:domTree:
12273     document {
12274     document-type {
12275     element-type-definition {
12276 wakaba 1.25 node-name: 'p';
12277 wakaba 1.21 attribute-definition {
12278     node-name: 'b';
12279     }
12280     }
12281     }
12282     element {
12283     attribute {
12284     node-name: 'c';
12285     text-content: 'd';
12286     }
12287     }
12288     }
12289     @@@enImplNote:
12290     The second <XML::ATTLIST> declaration is read but not processed
12291     and its <XML::&entity;> general entity reference violates
12292     entity declared validty constraint rather than well-formedness
12293     constraint.
12294     @@XMLTest:
12295     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.-2.test
12296     @@@DEnt:
12297     @@@@test:value:
12298     <!DOCTYPE p [
12299     <!ATTLIST p a CDATA "&entity;">
12300     <!ENTITY % para "<!-- -->">
12301     %para;
12302     ]>
12303     <p/>
12304     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 22)..(2, 29); }
12305     @@XMLTest:
12306     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.-2.2.test
12307     @@@DEnt:
12308     @@@@test:value:
12309     <!DOCTYPE p [
12310 wakaba 1.25 <!ATTLIST p b CDATA #IMPLIED>
12311 wakaba 1.21 <!ENTITY % para "<!-- -->">
12312     %para;
12313     <!ATTLIST p a CDATA "&entity;">
12314     ]>
12315     <p c="d"/>
12316 wakaba 1.25 @@@c:erred:
12317     <[[xp|warning-attribute-definition-not-processed]]> { (5, 13)..(5, 30); }
12318 wakaba 1.21 @@@test:domTree:
12319     document {
12320     document-type {
12321     element-type-definition {
12322 wakaba 1.25 node-name: 'p';
12323 wakaba 1.21 attribute-definition {
12324     node-name: 'b';
12325     }
12326     }
12327     }
12328     element {
12329     attribute {
12330     node-name: 'c';
12331     text-content: 'd';
12332     }
12333     }
12334     }
12335     @@XMLTest:
12336     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.4.test
12337     @@@DEnt:
12338     @@@@test:value:
12339     <?xml version="1.0" standalone="yes"?>
12340     <!DOCTYPE p [
12341     <!ATTLIST p a CDATA "&entity;">
12342     <!ENTITY % para SYSTEM "p">
12343     %para;
12344     ]>
12345     <p/>
12346     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 22)..(3, 29); }
12347     @@XMLTest:
12348     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.4.2.test
12349     @@@DEnt:
12350     @@@@test:value:
12351     <?xml version="1.0" standalone="yes"?>
12352     <!DOCTYPE p [
12353     <!ENTITY % para SYSTEM "p">
12354     %para;
12355     <!ATTLIST p a CDATA "&entity;">
12356     ]>
12357     <p/>
12358     @@@c:erred: <[[xp|wf-entity-declared]]> { (5, 22)..(5, 29); }
12359     @@@enImplNote:
12360     The <XML::ATTLIST> declaration is processed since
12361     it is a <XA::standalone> document.
12362     @@XMLTest:
12363     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.-3.test
12364     @@@DEnt:
12365     @@@@test:value:
12366     <?xml version="1.0" standalone="no"?>
12367     <!DOCTYPE p [
12368     <!ATTLIST p a CDATA "&entity;">
12369     <!ENTITY % para SYSTEM "p">
12370     %para;
12371     ]>
12372     <p/>
12373     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 22)..(3, 29); }
12374     @@@enImplNote:
12375     Is this well-formed? It has a parameter entity reference,
12376     therefore, it does not violates Entity Declared WFC, isn't it?
12377    
12378     Note that Firefox 1.5 and Opera 9 TP1 reports that this document has a
12379     fatal error (also note that they does not support unexpanded).
12380    
12381     See also:
12382     <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>
12383     @@XMLTest:
12384     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.-3.2.test
12385     @@@DEnt:
12386     @@@@test:value:
12387     <?xml version="1.0" standalone="no"?>
12388     <!DOCTYPE p [
12389 wakaba 1.25 <!ATTLIST p b CDATA #IMPLIED>
12390 wakaba 1.21 <!ENTITY % para SYSTEM "p">
12391     %para;
12392     <!ATTLIST p a CDATA "&entity;">
12393     ]>
12394     <p c="d"/>
12395 wakaba 1.25 @@@c:erred:
12396     <[[xp|warning-attribute-definition-not-processed]]> { (6, 13)..(6, 30); }
12397 wakaba 1.21 @@@test:domTree:
12398     document {
12399     document-type {
12400     element-type-definition {
12401 wakaba 1.25 node-name: 'p';
12402 wakaba 1.21 attribute-definition {
12403     node-name: 'b';
12404     }
12405     }
12406     }
12407     element {
12408     attribute {
12409     node-name: 'c';
12410     text-content: 'd';
12411     }
12412     }
12413     }
12414     @@@enImplNote:
12415     The second <XML::ATTLIST> declaration is read but not processed
12416     and its <XML::&entity;> general entity reference violates
12417     entity declared validty constraint rather than well-formedness
12418     constraint.
12419     @@XMLTest:
12420     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.-4.test
12421     @@@DEnt:
12422     @@@@test:value:
12423     <!DOCTYPE p [
12424     <!ATTLIST p a CDATA "&entity;">
12425     <!ENTITY % para SYSTEM "p">
12426     %para;
12427     ]>
12428     <p/>
12429     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 22)..(2, 29); }
12430     @@XMLTest:
12431     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.-4.2.test
12432     @@@DEnt:
12433     @@@@test:value:
12434     <!DOCTYPE p [
12435 wakaba 1.25 <!ATTLIST p b CDATA #IMPLIED>
12436 wakaba 1.21 <!ENTITY % para SYSTEM "p">
12437     %para;
12438     <!ATTLIST p a CDATA "&entity;">
12439     ]>
12440     <p c="d"/>
12441 wakaba 1.25 @@@c:erred:
12442     <[[xp|warning-attribute-definition-not-processed]]> { (5, 13)..(5, 30); }
12443 wakaba 1.21 @@@test:domTree:
12444     document {
12445     document-type {
12446     element-type-definition {
12447 wakaba 1.25 node-name: 'p';
12448 wakaba 1.21 attribute-definition {
12449     node-name: 'b';
12450     }
12451     }
12452     }
12453     element {
12454     attribute {
12455     node-name: 'c';
12456     text-content: 'd';
12457     }
12458     }
12459     }
12460     @@XMLTest:
12461     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.5.test
12462     @@@DEnt:
12463     @@@@test:value:
12464     <?xml version="1.0" standalone="yes"?>
12465     <!DOCTYPE p SYSTEM "dtd" [
12466     <!ATTLIST p a CDATA "&entity;">
12467     ]>
12468     <p/>
12469     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 22)..(3, 29); }
12470     @@@enImplNote:
12471     This document has an error - result is implementation dependent.
12472     @@XMLTest:
12473     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.-5.test
12474     @@@DEnt:
12475     @@@@test:value:
12476     <?xml version="1.0" standalone="no"?>
12477     <!DOCTYPE p SYSTEM "dtd" [
12478     <!ATTLIST p a CDATA "&entity;">
12479     ]>
12480     <p/>
12481     @@@test:domTree:
12482     document {
12483     document-type {
12484     element-type-definition {
12485     node-name: 'p';
12486     attribute-definition {
12487     node-name: 'a';
12488     general-entity-reference {
12489     node-name: 'entity';
12490 wakaba 1.34 manakai-expanded: false;
12491 wakaba 1.21 }
12492     }
12493     }
12494     }
12495     element {
12496     attribute {
12497     node-name: 'a';
12498     specified: false;
12499     general-entity-reference {
12500     node-name: 'entity';
12501 wakaba 1.34 manakai-expanded: false;
12502 wakaba 1.21 }
12503     }
12504     }
12505     }
12506     @@@enImplNote:
12507     This document has an error - result is implementation dependent.
12508     @@XMLTest:
12509     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.-6.test
12510     @@@DEnt:
12511     @@@@test:value:
12512     <!DOCTYPE p SYSTEM "dtd" [
12513     <!ATTLIST p a CDATA "&entity;">
12514     ]>
12515     <p/>
12516     @@@test:domTree:
12517     document {
12518     document-type {
12519     element-type-definition {
12520     node-name: 'p';
12521     attribute-definition {
12522     node-name: 'a';
12523     general-entity-reference {
12524     node-name: 'entity';
12525 wakaba 1.34 manakai-expanded: false;
12526 wakaba 1.21 }
12527     }
12528     }
12529     }
12530     element {
12531     attribute {
12532     node-name: 'a';
12533     specified: false;
12534     general-entity-reference {
12535     node-name: 'entity';
12536 wakaba 1.34 manakai-expanded: false;
12537 wakaba 1.21 }
12538     }
12539     }
12540     }
12541     @@@enImplNote:
12542     This document has an error - result is implementation dependent.
12543    
12544 wakaba 1.19 @@enImplNote:
12545     {TODO:: Entity declared WFC for
12546 wakaba 1.20
12547     - General entity references in entity value??
12548 wakaba 1.19
12549     }
12550    
12551 wakaba 1.23 @@XMLTest:
12552     @@@QName: xp.element.content.parsed.entity.reference.test
12553     @@@DEnt:
12554     @@@@test:value:
12555     <!DOCTYPE p [
12556     <!NOTATION n SYSTEM "notation">
12557     <!ENTITY ext SYSTEM "system" NDATA n>
12558     ]>
12559     <p>&ext;</p>
12560     @@@c:erred: <[[xp|wf-parsed-entity]]> { (5, 4)..(5, 8); }
12561     @@XMLTest:
12562     @@@QName: xp.attval.parsed.entity.reference.test
12563     @@@DEnt:
12564     @@@@test:value:
12565     <!DOCTYPE p [
12566     <!NOTATION n SYSTEM "notation">
12567     <!ENTITY ext SYSTEM "system" NDATA n>
12568     ]>
12569     <p a="&ext;"/>
12570     # @@@c:erred: <[[xp|wf-parsed-entity]]> { (5, 7)..(5, 11); }
12571     @@@c:erred: <[[xp|wf-no-external-entity-references]]> { (5, 7)..(5, 11); }
12572     @@XMLTest:
12573     @@@QName: xp.element.content.reptxt.parsed.entity.reference.test
12574     @@@DEnt:
12575     @@@@test:value:
12576     <!DOCTYPE p [
12577     <!NOTATION n SYSTEM "notation">
12578     <!ENTITY ext SYSTEM "system" NDATA n>
12579     <!ENTITY c "&#x26;ext;">
12580     ]>
12581     <p>&c;</p>
12582     @@@c:erred: <[[xp|wf-parsed-entity]]> { (1, 1)..(1, 5); }
12583     @@XMLTest:
12584     @@@QName: xp.attval.reptxt.parsed.entity.reference.test
12585     @@@DEnt:
12586     @@@@test:value:
12587     <!DOCTYPE p [
12588     <!NOTATION n SYSTEM "notation">
12589     <!ENTITY ext SYSTEM "system" NDATA n>
12590     <!ENTITY c "&#x26;ext;">
12591     ]>
12592     <p a="&c;"/>
12593 wakaba 1.34 @@@cfg:entity-replacement-tree: 0
12594     @@@c:erred: <[[xp|wf-no-external-entity-references]]> { (1, 1)..(1, 5); }
12595     @@XMLTest:
12596     @@@QName: xp.attval.reptxt.parsed.entity.reference.2.test
12597     @@@DEnt:
12598     @@@@test:value:
12599     <!DOCTYPE p [
12600     <!NOTATION n SYSTEM "notation">
12601     <!ENTITY ext SYSTEM "system" NDATA n>
12602     <!ENTITY c "&#x26;ext;">
12603     ]>
12604     <p a="&c;"/>
12605     @@@cfg:entity-replacement-tree: 1
12606 wakaba 1.23 @@@c:erred: <[[xp|wf-no-external-entity-references]]> { (1, 1)..(1, 5); }
12607     @@@c:erred:
12608     @@@@@: <[[xp|wf-parsed-entity]]> { }
12609     @@@@enImplNote: During entity node construction.
12610     @@XMLTest:
12611     @@@QName: xp.element.content.entval.parsed.entity.reference.test
12612     @@@DEnt:
12613     @@@@test:value:
12614     <!DOCTYPE p [
12615     <!NOTATION n SYSTEM "notation">
12616     <!ENTITY ext SYSTEM "system" NDATA n>
12617     <!ENTITY c "&ext;">
12618     ]>
12619     <p>&c;</p>
12620     @@@c:erred: <[[xp|wf-parsed-entity]]> { }
12621     @@XMLTest:
12622     @@@QName: xp.attval.entval.parsed.entity.reference.test
12623     @@@DEnt:
12624     @@@@test:value:
12625     <!DOCTYPE p [
12626     <!NOTATION n SYSTEM "notation">
12627     <!ENTITY ext SYSTEM "system" NDATA n>
12628     <!ENTITY c "&ext;">
12629     ]>
12630     <p a="&c;"/>
12631 wakaba 1.34 @@@cfg:entity-replacement-tree: 0
12632     @@@c:erred: <[[xp|wf-no-external-entity-references]]> { }
12633     @@XMLTest:
12634     @@@QName: xp.attval.entval.parsed.entity.reference.2.test
12635     @@@DEnt:
12636     @@@@test:value:
12637     <!DOCTYPE p [
12638     <!NOTATION n SYSTEM "notation">
12639     <!ENTITY ext SYSTEM "system" NDATA n>
12640     <!ENTITY c "&ext;">
12641     ]>
12642     <p a="&c;"/>
12643     @@@cfg:entity-replacement-tree: 1
12644 wakaba 1.23 @@@c:erred: <[[xp|wf-no-external-entity-references]]> { }
12645     @@@c:erred: <[[xp|wf-parsed-entity]]> { }
12646    
12647     @@XMLTest:
12648     @@@QName: xp.element.content.no.recursion.direct.test
12649     @@@DEnt:
12650     @@@@test:value:
12651     <!DOCTYPE p [
12652     <!ENTITY c "&c;">
12653     ]>
12654     <p>&c;</p>
12655     @@@c:erred: <[[xp|wf-no-recursion]]> { (1, 1)..(1, 3); }
12656     @@XMLTest:
12657     @@@QName: xp.element.content.no.recursion.indirect.test
12658     @@@DEnt:
12659     @@@@test:value:
12660     <!DOCTYPE p [
12661     <!ENTITY d "&c;">
12662     <!ENTITY c "&d;">
12663     ]>
12664     <p>&c;</p>
12665     @@@c:erred: <[[xp|wf-no-recursion]]> { /* |d| */ (1, 1)..(1, 3); }
12666     @@XMLTest:
12667     @@@QName: xp.attval.no.recursion.direct.test
12668     @@@DEnt:
12669     @@@@test:value:
12670     <!DOCTYPE p [
12671     <!ENTITY c "&c;">
12672     ]>
12673     <p a="&c;"/>
12674     @@@c:erred: <[[xp|wf-no-recursion]]> { (1, 1)..(1, 3); }
12675     @@XMLTest:
12676     @@@QName: xp.attval.no.recursion.indirect.test
12677     @@@DEnt:
12678     @@@@test:value:
12679     <!DOCTYPE p [
12680     <!ENTITY d "&c;">
12681     <!ENTITY c "&d;">
12682     ]>
12683     <p a="&c;"/>
12684     @@@c:erred: <[[xp|wf-no-recursion]]> { /* |d| */ (1, 1)..(1, 3); }
12685     @@XMLTest:
12686     @@@QName: xp.reptxt.element.content.no.recursion.direct.test
12687     @@@DEnt:
12688     @@@@test:value:
12689     <!DOCTYPE p [
12690     <!ENTITY c "&c;">
12691     <!ENTITY e "&#x26;c;">
12692     ]>
12693     <p>&e;</p>
12694     @@@c:erred: <[[xp|wf-no-recursion]]> { /* |e| */ (1, 1)..(1, 3); }
12695     @@XMLTest:
12696     @@@QName: xp.reptxt.element.content.no.recursion.indirect.test
12697     @@@DEnt:
12698     @@@@test:value:
12699     <!DOCTYPE p [
12700     <!ENTITY d "&c;">
12701     <!ENTITY c "&d;">
12702     <!ENTITY e "&#x26;c;">
12703     ]>
12704     <p>&e;</p>
12705     @@@c:erred: <[[xp|wf-no-recursion]]> { /* |d| */ (1, 1)..(1, 3); }
12706     @@XMLTest:
12707     @@@QName: xp.reptxt.attval.no.recursion.direct.test
12708     @@@DEnt:
12709     @@@@test:value:
12710     <!DOCTYPE p [
12711     <!ENTITY c "&c;">
12712     <!ENTITY e "&#x26;c;">
12713     ]>
12714     <p a="&e;"/>
12715     @@@c:erred: <[[xp|wf-no-recursion]]> { /* |e| */ (1, 1)..(1, 3); }
12716     @@XMLTest:
12717     @@@QName: xp.reptxt.attval.no.recursion.indirect.test
12718     @@@DEnt:
12719     @@@@test:value:
12720     <!DOCTYPE p [
12721     <!ENTITY d "&c;">
12722     <!ENTITY c "&d;">
12723     <!ENTITY e "&#x26;c;">
12724     ]>
12725     <p a="&e;"/>
12726     @@@c:erred: <[[xp|wf-no-recursion]]> { /* |d| */ (1, 1)..(1, 3); }
12727    
12728     @@XMLTest:
12729     @@@QName: xp.ENTITY.system.ndata.name.test
12730     @@@DEnt:
12731     @@@@test:value:
12732     <!DOCTYPE a [
12733     <!NOTATION n SYSTEM "n">
12734     <!ENTITY % e SYSTEM "sys" NDATA n>
12735     ]><a/>
12736     @@@c:erred: <[[xp|wf-syntax-error]]> { (3, 26)..(3, 30); }
12737     @@XMLTest:
12738     @@@QName: xp.ENTITY.public.ndata.name.test
12739     @@@DEnt:
12740     @@@@test:value:
12741     <!DOCTYPE a [
12742     <!NOTATION n SYSTEM "n">
12743     <!ENTITY % e PUBLIC "pub" "sys" NDATA n>
12744     ]><a/>
12745     @@@c:erred: <[[xp|wf-syntax-error]]> { (3, 33)..(3, 37); }
12746     @@XMLTest:
12747     @@@QName: xp.ENTITY.public.ndata.name.-1.test
12748     @@@DEnt:
12749     @@@@test:value:
12750     <!DOCTYPE a [
12751     <!NOTATION n SYSTEM "n">
12752     <!ENTITY % e PUBLIC "pub" "sys" >
12753     ]><a/>
12754     @@@test:domTree:
12755     document { }
12756    
12757     @@XMLTest:
12758     @@@QName: xp.ENTITY.pubid.1.test
12759     @@@DEnt:
12760     @@@@test:value:
12761     <!DOCTYPE a [
12762     <!ENTITY e PUBLIC "p" "s">
12763     ]><a/>
12764     @@@test:domTree:
12765     document {
12766     document-type {
12767     general-entity {
12768     node-name: 'e';
12769     public-id: 'p';
12770     system-id: 's';
12771     }
12772     }
12773     element { }
12774     }
12775     @@XMLTest:
12776     @@@QName: xp.ENTITY.pubid.2.test
12777     @@@DEnt:
12778     @@@@test:value:
12779     <!DOCTYPE a [
12780     <!ENTITY e PUBLIC " p " "s">
12781     ]><a/>
12782     @@@test:domTree:
12783     document {
12784     document-type {
12785     general-entity {
12786     node-name: 'e';
12787     public-id: 'p';
12788     system-id: 's';
12789     }
12790     }
12791     element { }
12792     }
12793     @@XMLTest:
12794     @@@QName: xp.ENTITY.pubid.3.test
12795     @@@DEnt:
12796     @@@@test:value:
12797     <!DOCTYPE a [
12798     <!ENTITY e PUBLIC " p $u000Aq$u000A " "s">
12799     ]><a/>
12800     @@@test:domTree:
12801     document {
12802     document-type {
12803     general-entity {
12804     node-name: 'e';
12805     public-id: 'p q';
12806     system-id: 's';
12807     }
12808     }
12809     element { }
12810     }
12811     @@XMLTest:
12812     @@@QName: xp.ENTITY.pubid.4.test
12813     @@@DEnt:
12814     @@@@test:value:
12815     <!DOCTYPE a [
12816     <!ENTITY e PUBLIC " p $u000D$u000Aq" "s">
12817     ]><a/>
12818     @@@test:domTree:
12819     document {
12820     document-type {
12821     general-entity {
12822     node-name: 'e';
12823     public-id: 'p q';
12824     system-id: 's';
12825     }
12826     }
12827     element { }
12828     }
12829     @@XMLTest:
12830     @@@QName: xp.ENTITY.pubid.5.test
12831     @@@DEnt:
12832     @@@@test:value:
12833     <?xml version="1.1"?>
12834     <!DOCTYPE a [
12835 wakaba 1.27 <!ENTITY e PUBLIC " p $u000D$u0085q" "s">
12836 wakaba 1.23 ]><a/>
12837     @@@test:domTree:
12838     document {
12839     document-type {
12840     general-entity {
12841     node-name: 'e';
12842     public-id: 'p q';
12843     system-id: 's';
12844     }
12845     }
12846     element { }
12847     }
12848    
12849 wakaba 1.24 @@XMLTest:
12850     @@@QName: xp.ENTITY.ignored.test
12851     @@@DEnt:
12852     @@@@test:value:
12853     <!DOCTYPE a [
12854     <!ENTITY e "a">
12855     <!ENTITY e "b">
12856     ]><a/>
12857 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
12858 wakaba 1.24 @@@test:domTree:
12859     document {
12860     document-type {
12861     general-entity {
12862     node-name: 'e';
12863     text-content: 'a';
12864     }
12865     }
12866     element { }
12867     }
12868     @@@c:erred:
12869     <[[xp|warning-entity-declaration-ignored]]> { (3, 1)..(3, 15); }
12870     @@XMLTest:
12871     @@@QName: xp.ENTITY.ignored.2.test
12872     @@@DEnt:
12873     @@@@test:value:
12874     <!DOCTYPE a [
12875     <!ENTITY % e "a">
12876     <!ENTITY % e "b">
12877     ]><a/>
12878     @@@test:domTree:
12879     document { }
12880     @@@c:erred:
12881     <[[xp|warning-entity-declaration-ignored]]> { (3, 1)..(3, 17); }
12882    
12883     @@XMLTest:
12884     @@@QName: xp.ENTITY.predefined.1.test
12885     @@@DEnt:
12886     @@@@test:value:
12887     <!DOCTYPE a [
12888     <!ENTITY lt "&#38;#60;">
12889     <!ENTITY gt "&#62;">
12890     <!ENTITY amp "&#38;#38;">
12891     <!ENTITY apos "&#39;">
12892     <!ENTITY quot "&#34;">
12893     <!ENTITY e "f">
12894     ]><a>&lt;&gt;&amp;&apos;&quot;</a>
12895 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
12896 wakaba 1.24 @@@test:domTree:
12897     document {
12898     document-type {
12899     general-entity {
12900     node-name: 'e';
12901     text-content: 'f';
12902     }
12903     }
12904     element {
12905     text-content: '<>&' U+0027 '"';
12906     }
12907     }
12908     @@XMLTest:
12909     @@@QName: xp.ENTITY.predefined.2.test
12910     @@@DEnt:
12911     @@@@test:value:
12912     <!DOCTYPE a [
12913     <!ENTITY lt "&#38;#60;">
12914     <!ENTITY gt "&#x26;#62;">
12915     <!ENTITY amp "&#38;#38;">
12916     <!ENTITY apos "&#x26;#39;">
12917     <!ENTITY quot "&#x26;#34;">
12918     <!ENTITY e "f">
12919     ]><a>&lt;&gt;&amp;&apos;&quot;</a>
12920 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
12921 wakaba 1.24 @@@test:domTree:
12922     document {
12923     document-type {
12924     general-entity {
12925     node-name: 'e';
12926     text-content: 'f';
12927     }
12928     }
12929     element {
12930     text-content: '<>&' U+0027 '"';
12931     }
12932     }
12933     @@XMLTest:
12934     @@@QName: xp.ENTITY.predefined.3.test
12935     @@@DEnt:
12936     @@@@test:value:
12937     <!DOCTYPE a [
12938     <!ENTITY lt "&#60;">
12939     <!ENTITY gt "&#62;">
12940     <!ENTITY amp "&#38;">
12941     <!ENTITY apos "&#39;">
12942     <!ENTITY quot "&#34;">
12943     <!ENTITY e "f">
12944     ]><a>&lt;&gt;&amp;&apos;&quot;</a>
12945 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
12946 wakaba 1.24 @@@c:erred: <[[xp|error-malformed-predefined-entity]]> { (2, 1)..(2, 24); }
12947     @@@c:erred: <[[xp|error-malformed-predefined-entity]]> { (4, 1)..(4, 24); }
12948     @@@test:domTree:
12949     document {
12950     document-type {
12951     general-entity {
12952     node-name: 'e';
12953     text-content: 'f';
12954     }
12955     }
12956     element {
12957     text-content: '<>&' U+0027 '"';
12958     }
12959     }
12960     @@XMLTest:
12961     @@@QName: xp.ENTITY.predefined.4.test
12962     @@@DEnt:
12963     @@@@test:value:
12964     <!DOCTYPE a [
12965     <!ENTITY lt "1">
12966     <!ENTITY gt "2">
12967     <!ENTITY amp "3">
12968     <!ENTITY apos "4">
12969     <!ENTITY quot "5">
12970     <!ENTITY e "f">
12971     ]><a>&lt;&gt;&amp;&apos;&quot;</a>
12972 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
12973 wakaba 1.24 @@@c:erred: <[[xp|error-malformed-predefined-entity]]> { (2, 1)..(2, 24); }
12974     @@@c:erred: <[[xp|error-malformed-predefined-entity]]> { (3, 1)..(3, 24); }
12975     @@@c:erred: <[[xp|error-malformed-predefined-entity]]> { (4, 1)..(4, 24); }
12976     @@@c:erred: <[[xp|error-malformed-predefined-entity]]> { (5, 1)..(5, 24); }
12977     @@@c:erred: <[[xp|error-malformed-predefined-entity]]> { (6, 1)..(6, 24); }
12978     @@@test:domTree:
12979     document {
12980     document-type {
12981     general-entity {
12982     node-name: 'e';
12983     text-content: 'f';
12984     }
12985     }
12986     element {
12987     text-content: '<>&' U+0027 '"';
12988     }
12989     }
12990     @@XMLTest:
12991     @@@QName: xp.ENTITY.predefined.5.test
12992     @@@DEnt:
12993     @@@@test:value:
12994     <!DOCTYPE a [
12995     <!ENTITY lt SYSTEM "1">
12996     <!ENTITY gt SYSTEM "2">
12997     <!ENTITY amp SYSTEM "3">
12998     <!ENTITY apos SYSTEM "4">
12999     <!ENTITY quot SYSTEM "5">
13000     <!ENTITY e "f">
13001     ]><a>&lt;&gt;&amp;&apos;&quot;</a>
13002 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
13003 wakaba 1.24 @@@c:erred: <[[xp|error-internal-predefined-entity]]> { (2, 1)..(2, 27); }
13004     @@@c:erred: <[[xp|error-internal-predefined-entity]]> { (3, 1)..(3, 27); }
13005     @@@c:erred: <[[xp|error-internal-predefined-entity]]> { (4, 1)..(4, 27); }
13006     @@@c:erred: <[[xp|error-internal-predefined-entity]]> { (5, 1)..(5, 27); }
13007     @@@c:erred: <[[xp|error-internal-predefined-entity]]> { (6, 1)..(6, 27); }
13008     @@@test:domTree:
13009     document {
13010     document-type {
13011     general-entity {
13012     node-name: 'e';
13013     text-content: 'f';
13014     }
13015     }
13016     element {
13017     text-content: '<>&' U+0027 '"';
13018     }
13019     }
13020     @@XMLTest:
13021     @@@QName: xp.ENTITY.predefined.6.test
13022     @@@DEnt:
13023     @@@@test:value:
13024     <!DOCTYPE a [
13025     <!ENTITY % lt SYSTEM "1">
13026     <!ENTITY % gt SYSTEM "2">
13027     <!ENTITY % amp SYSTEM "3">
13028     <!ENTITY % apos SYSTEM "4">
13029     <!ENTITY % quot SYSTEM "5">
13030     <!ENTITY e "f">
13031     ]><a>&lt;&gt;&amp;&apos;&quot;</a>
13032 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
13033 wakaba 1.24 @@@test:domTree:
13034     document {
13035     document-type {
13036     general-entity {
13037     node-name: 'e';
13038     text-content: 'f';
13039     }
13040     }
13041     element {
13042     text-content: '<>&' U+0027 '"';
13043     }
13044     }
13045     @@XMLTest:
13046     @@@QName: xp.ENTITY.predefined.7.test
13047     @@@DEnt:
13048     @@@@test:value:
13049     <!DOCTYPE a [
13050     <!ENTITY lt "&#38;#x3C;">
13051     <!ENTITY gt "&#x3E;">
13052     <!ENTITY amp "&#38;#x26;">
13053     <!ENTITY apos "&#x27;">
13054     <!ENTITY quot "&#x22;">
13055     <!ENTITY e "f">
13056     ]><a>&lt;&gt;&amp;&apos;&quot;</a>
13057 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
13058 wakaba 1.24 @@@test:domTree:
13059     document {
13060     document-type {
13061     general-entity {
13062     node-name: 'e';
13063     text-content: 'f';
13064     }
13065     }
13066     element {
13067     text-content: '<>&' U+0027 '"';
13068     }
13069     }
13070     @@XMLTest:
13071     @@@QName: xp.ENTITY.predefined.8.test
13072     @@@DEnt:
13073     @@@@test:value:
13074     <!DOCTYPE a [
13075     <!ENTITY lt "&#38;#x3c;">
13076     <!ENTITY gt "&#x3e;">
13077     <!ENTITY amp "&#38;#x26;">
13078     <!ENTITY apos "&#x27;">
13079     <!ENTITY quot "&#x22;">
13080     <!ENTITY e "f">
13081     ]><a>&lt;&gt;&amp;&apos;&quot;</a>
13082 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
13083 wakaba 1.24 @@@test:domTree:
13084     document {
13085     document-type {
13086     general-entity {
13087     node-name: 'e';
13088     text-content: 'f';
13089     }
13090     }
13091     element {
13092     text-content: '<>&' U+0027 '"';
13093     }
13094     }
13095     @@XMLTest:
13096     @@@QName: xp.ENTITY.predefined.9.test
13097     @@@DEnt:
13098     @@@@test:value:
13099     <!DOCTYPE a [
13100     <!ENTITY lt "&#38;#x00003C;">
13101     <!ENTITY gt "&#x0003E;">
13102     <!ENTITY amp "&#38;#x026;">
13103     <!ENTITY apos "&#x000027;">
13104     <!ENTITY quot "&#x0022;">
13105     <!ENTITY e "f">
13106     ]><a>&lt;&gt;&amp;&apos;&quot;</a>
13107 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
13108 wakaba 1.24 @@@test:domTree:
13109     document {
13110     document-type {
13111     general-entity {
13112     node-name: 'e';
13113     text-content: 'f';
13114     }
13115     }
13116     element {
13117     text-content: '<>&' U+0027 '"';
13118     }
13119     }
13120     @@XMLTest:
13121     @@@QName: xp.ENTITY.predefined.10.test
13122     @@@DEnt:
13123     @@@@test:value:
13124     <!DOCTYPE a [
13125     <!ENTITY lt "&#38;#00060;">
13126     <!ENTITY gt "&#062;">
13127     <!ENTITY amp "&#38;#000038;">
13128     <!ENTITY apos "&#0000039;">
13129     <!ENTITY quot "&#0034;">
13130     <!ENTITY e "f">
13131     ]><a>&lt;&gt;&amp;&apos;&quot;</a>
13132 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
13133 wakaba 1.24 @@@test:domTree:
13134     document {
13135     document-type {
13136     general-entity {
13137     node-name: 'e';
13138     text-content: 'f';
13139     }
13140     }
13141     element {
13142     text-content: '<>&' U+0027 '"';
13143     }
13144     }
13145    
13146 wakaba 1.25 @@XMLTest:
13147     @@@QName: xp.processed.1.test
13148     @@@DEnt:
13149     @@@@test:value:
13150     <a/>
13151     @@@test:domTree:
13152     document {
13153     all-declarations-processed: true;
13154     element { }
13155     }
13156     @@XMLTest:
13157     @@@QName: xp.processed.2.test
13158     @@@DEnt:
13159     @@@@test:value:
13160     <!DOCTYPE a [
13161     <!ENTITY e "f">
13162     <!ATTLIST a b NMTOKEN " c ">
13163     ]><a>&e;</a>
13164     @@@test:domTree:
13165     document {
13166     document-type {
13167     general-entity {
13168     node-name: 'e';
13169     }
13170     element-type-definition {
13171     node-name: 'a';
13172     attribute-definition {
13173     node-name: 'b';
13174     }
13175     }
13176     }
13177     all-declarations-processed: true;
13178     element {
13179     attribute {
13180     node-name: 'b';
13181     node-value: 'c';
13182     }
13183     text-content: 'f';
13184     }
13185     }
13186     @@XMLTest:
13187     @@@QName: xp.processed.3.test
13188     @@@DEnt:
13189     @@@@test:value:
13190     <!DOCTYPE a [
13191     <!ENTITY % p SYSTEM "p">
13192     %p;
13193     <!ENTITY e "f">
13194     <!ATTLIST a b NMTOKEN " c ">
13195     ]><a d="e">&e;</a>
13196     @@@test:domTree:
13197     document {
13198     document-type { }
13199     all-declarations-processed: false;
13200     element {
13201     attribute {
13202     node-name: 'd';
13203     node-value: 'e';
13204     }
13205     general-entity-reference {
13206     node-name: 'e';
13207 wakaba 1.34 manakai-expanded: false;
13208 wakaba 1.25 }
13209     }
13210     }
13211     @@@c:erred:
13212     <[[xp|warning-entity-declaration-not-processed]]> { (4, 1)..(4, 20); }
13213     @@@c:erred:
13214     <[[xp|warning-attribute-definition-not-processed]]> { (5, 13)..(5, 31); }
13215     @@XMLTest:
13216     @@@QName: xp.processed.4.test
13217     @@@DEnt:
13218     @@@@test:value:
13219     <?xml version="1.1" standalone="yes"?>
13220     <!DOCTYPE a [
13221     <!ENTITY % p SYSTEM "p">
13222     %p;
13223     <!ENTITY e "f">
13224     <!ATTLIST a b NMTOKEN " c ">
13225     ]><a>&e;</a>
13226     @@@test:domTree:
13227     document {
13228     document-type {
13229     general-entity {
13230     node-name: 'e';
13231     }
13232     element-type-definition {
13233     node-name: 'a';
13234     attribute-definition {
13235     node-name: 'b';
13236     }
13237     }
13238     }
13239     all-declarations-processed: false;
13240     element {
13241     attribute {
13242     node-name: 'b';
13243     node-value: 'c';
13244     }
13245     text-content: 'f';
13246     }
13247     }
13248     @@XMLTest:
13249     @@@QName: xp.processed.5.test
13250     @@@DEnt:
13251     @@@@test:value:
13252     <!DOCTYPE a SYSTEM "p" [
13253     <!ENTITY e "f">
13254     <!ATTLIST a b NMTOKEN " c ">
13255     ]><a>&e;</a>
13256     @@@test:domTree:
13257     document {
13258     document-type {
13259     general-entity {
13260     node-name: 'e';
13261     }
13262     element-type-definition {
13263     node-name: 'a';
13264     attribute-definition {
13265     node-name: 'b';
13266     }
13267     }
13268     }
13269     all-declarations-processed: false;
13270     element {
13271     attribute {
13272     node-name: 'b';
13273     node-value: 'c';
13274     }
13275     text-content: 'f';
13276     }
13277     }
13278    
13279     @@XMLTest:
13280     @@@QName: xp.PEs.in.internal.subset.1.test
13281     @@@DEnt:
13282     @@@@test:value:
13283     <!DOCTYPE a [
13284     <!ENTITY % p " ">
13285 wakaba 1.26 <!ENTITY % q "%p;">
13286 wakaba 1.25 ]><a/>
13287     @@@c:erred: <[[xp|wf-pes-in-internal-subset]]> { (3, 15)..(3, 17); }
13288     @@XMLTest:
13289     @@@QName: xp.PEs.in.internal.subset.2.test
13290     @@@DEnt:
13291     @@@@test:value:
13292     <!DOCTYPE a [
13293     <!ENTITY % p " ">
13294 wakaba 1.26 <!ENTITY % q '%p;'>
13295 wakaba 1.25 ]><a/>
13296     @@@c:erred: <[[xp|wf-pes-in-internal-subset]]> { (3, 15)..(3, 17); }
13297    
13298 wakaba 1.26 @@XMLTest:
13299     @@@QName: xp.name.pitarget.content.1.0.2.test
13300     @@@DEnt:
13301     @@@@test:value:
13302     <?xml version="1.0"?>
13303     <p>
13304     <?$u3001$u3002?>
13305     </p>
13306     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]> { (3, 3)..(3, 4); }
13307     @@XMLTest:
13308     @@@QName: xp.name.pitarget.content.1.1.2.test
13309     @@@DEnt:
13310     @@@@test:value:
13311     <?xml version="1.1"?>
13312     <p>$
13313     <?$u3001$u3002?>$
13314     </p>
13315     @@@test:domTree:
13316     document {
13317     xml-version: '1.1';
13318     element {
13319     pi {
13320     node-name: U+3001 U+3002;
13321 wakaba 1.14 }
13322 wakaba 1.12 }
13323 wakaba 1.26 }
13324     @@XMLTest:
13325     @@@QName: xp.name.pitarget.content.1.0.3.test
13326     @@@DEnt:
13327     @@@@test:value:
13328     <?xml version="1.0"?>
13329     <p>
13330     <?$u3005b?>
13331     </p>
13332     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]> { (3, 3)..(3, 4); }
13333     @@XMLTest:
13334     @@@QName: xp.name.pitarget.content.1.1.3.test
13335     @@@DEnt:
13336     @@@@test:value:
13337     <?xml version="1.1"?>
13338     <p>$
13339     <?$u3005b?>$
13340     </p>
13341     @@@test:domTree:
13342     document {
13343     xml-version: '1.1';
13344     element {
13345     pi {
13346     node-name: U+3005 'b';
13347 wakaba 1.12 }
13348     }
13349 wakaba 1.26 }
13350     @@XMLTest:
13351     @@@QName: xp.name.pitarget.content.names.1.0.1.test
13352     @@@DEnt:
13353     @@@@test:value:
13354     <?xml version="1.0"?>
13355     <p>
13356     <?a:b?>
13357     </p>
13358     @@@c:erred: <[[xp|nswf-legal-ncname]]> { (3, 3)..(3, 5); }
13359     @@XMLTest:
13360     @@@QName: xp.name.pitarget.content.names.1.1.1.test
13361     @@@DEnt:
13362     @@@@test:value:
13363     <?xml version="1.1"?>
13364     <p>
13365     <?a:b?>
13366     </p>
13367     @@@c:erred: <[[xp|nswf-legal-ncname]]> { (3, 3)..(3, 5); }
13368     @@XMLTest:
13369     @@@QName: xp.name.pitarget.intsubset.1.0.2.test
13370     @@@DEnt:
13371     @@@@test:value:
13372     <?xml version="1.0"?>
13373     <!DOCTYPE p [
13374     <?$u3001$u3002?>
13375     ]><p/>
13376     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]> { (3, 3)..(3, 4); }
13377     @@XMLTest:
13378     @@@QName: xp.name.pitarget.intsubset.1.1.2.test
13379     @@@DEnt:
13380     @@@@test:value:
13381     <?xml version="1.1"?>
13382     <!DOCTYPE p [
13383     <?$u3001$u3002?>
13384     ]><p/>
13385     @@@test:domTree:
13386     document {
13387     xml-version: '1.1';
13388     document-type {
13389     pi {
13390     node-name: U+3001 U+3002;
13391     }
13392     }
13393     element { }
13394     }
13395     @@XMLTest:
13396     @@@QName: xp.name.pitarget.intsubset.1.0.3.test
13397     @@@DEnt:
13398     @@@@test:value:
13399     <?xml version="1.0"?>
13400     <!DOCTYPE p [
13401     <?$u3005b?>
13402     ]><p/>
13403     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]> { (3, 3)..(3, 4); }
13404     @@XMLTest:
13405     @@@QName: xp.name.pitarget.intsubset.1.1.3.test
13406     @@@DEnt:
13407     @@@@test:value:
13408     <?xml version="1.1"?>
13409     <!DOCTYPE p [
13410     <?$u3005b?>
13411     ]><p/>
13412     @@@test:domTree:
13413     document {
13414     xml-version: '1.1';
13415     document-type {
13416     pi {
13417     node-name: U+3005 'b';
13418     }
13419     }
13420     element { }
13421     }
13422     @@XMLTest:
13423     @@@QName: xp.name.pitarget.intsubset.names.1.0.1.test
13424     @@@DEnt:
13425     @@@@test:value:
13426     <?xml version="1.0"?>
13427     <!DOCTYPE p [
13428     <?a:b?>
13429     ]><p/>
13430     @@@c:erred: <[[xp|nswf-legal-ncname]]> { (3, 3)..(3, 5); }
13431     @@XMLTest:
13432     @@@QName: xp.name.pitarget.intsubset.names.1.1.1.test
13433     @@@DEnt:
13434     @@@@test:value:
13435     <?xml version="1.1"?>
13436     <!DOCTYPE p [
13437     <?a:b?>
13438     ]><p/>
13439     @@@c:erred: <[[xp|nswf-legal-ncname]]> { (3, 3)..(3, 5); }
13440     @@XMLTest:
13441     @@@QName: xp.name.doctypedecl.stag.etag.1.0.2.test
13442     @@@DEnt:
13443     @@@@test:value:
13444     <?xml version="1.0"?>
13445     <!DOCTYPE $u3001$u3002>
13446     <$u3001$u3002>
13447     </$u3001$u3002>
13448     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (2, 11)..(2, 12); }
13449     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (3, 2)..(3, 3); }
13450     # @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (4, 3)..(4, 4); }
13451     @@XMLTest:
13452     @@@QName: xp.name.doctypedecl.stag.etag.1.1.2.test
13453     @@@DEnt:
13454     @@@@test:value:
13455     <?xml version="1.1"?>
13456     <!DOCTYPE $u3001$u3002>
13457     <$u3001$u3002>
13458     </$u3001$u3002>
13459     @@@test:domTree:
13460     document {
13461     xml-version: '1.1';
13462     document-type {
13463     node-name: U+3001 U+3002;
13464     }
13465     element {
13466     node-name: U+3001 U+3002;
13467     }
13468     }
13469     @@XMLTest:
13470     @@@QName: xp.name.doctypedecl.stag.etag.1.0.3.test
13471     @@@DEnt:
13472     @@@@test:value:
13473     <?xml version="1.0"?>
13474     <!DOCTYPE $u3005b>
13475     <$u3005b>
13476     </$u3005b>
13477     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (2, 11)..(2, 12); }
13478     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (3, 2)..(3, 3); }
13479     # @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (4, 3)..(4, 4); }
13480     @@XMLTest:
13481     @@@QName: xp.name.doctype.decl.stag.etag.1.1.3.test
13482     @@@DEnt:
13483     @@@@test:value:
13484     <?xml version="1.1"?>
13485     <!DOCTYPE $u3005b>
13486     <$u3005b>
13487     </$u3005b>
13488     @@@test:domTree:
13489     document {
13490     xml-version: '1.1';
13491     document-type {
13492     node-name: U+3005 'b';
13493     }
13494     element {
13495     node-name: U+3005 'b';
13496     }
13497     }
13498     @@XMLTest:
13499     @@@QName: xp.name.doctypedecl.stag.etag.names.1.0.1.test
13500     @@@DEnt:
13501     @@@@test:value:
13502     <?xml version="1.0"?>
13503     <!DOCTYPE a:b>
13504     <a:b xmlns:a="http://a.example/">
13505     </a:b>
13506     @@@test:domTree:
13507     document {
13508     xml-version: '1.0';
13509     document-type {
13510     node-name: 'a:b';
13511     }
13512     element {
13513     prefix: 'a';
13514     local-name: 'b';
13515     namespace-uri: 'http://a.example/';
13516     attribute {
13517     namespace-uri: 'http://www.w3.org/2000/xmlns/';
13518     prefix: 'xmlns';
13519     local-name: 'a';
13520     value: 'http://a.example/';
13521     specified: true;
13522     }
13523     }
13524     }
13525     @@XMLTest:
13526     @@@QName: xp.name.doctypedecl.stag.etag.names.1.1.1.test
13527     @@@DEnt:
13528     @@@@test:value:
13529     <?xml version="1.1"?>
13530     <!DOCTYPE a:b>
13531     <a:b xmlns:a="http://a.example/">
13532     </a:b>
13533     @@@test:domTree:
13534     document {
13535     xml-version: '1.1';
13536     document-type {
13537     node-name: 'a:b';
13538     }
13539     element {
13540     prefix: 'a';
13541     local-name: 'b';
13542     namespace-uri: 'http://a.example/';
13543     attribute {
13544     namespace-uri: 'http://www.w3.org/2000/xmlns/';
13545     prefix: 'xmlns';
13546     local-name: 'a';
13547     specified: true;
13548     }
13549     }
13550     }
13551     @@XMLTest:
13552     @@@QName: xp.name.doctypedecl.stag.etag.names.1.0.2.test
13553     @@@DEnt:
13554     @@@@test:value:
13555     <?xml version="1.0"?>
13556     <!DOCTYPE :ab>
13557     <:ab>
13558     </:ab>
13559     @@@c:erred: <[[xp|nswf-legal-qname]]> { (2, 11)..(2, 13); }
13560     @@@c:erred: <[[xp|nswf-legal-qname]]> { (3, 2)..(3, 4); }
13561     @@@c:erred: <[[xp|nsc-prefix-declared]]> { /* prefix || */ }
13562     @@XMLTest:
13563     @@@QName: xp.name.doctypedecl.stag.etag.names.1.1.2.test
13564     @@@DEnt:
13565     @@@@test:value:
13566     <?xml version="1.1"?>
13567     <!DOCTYPE :ab>
13568     <:ab>
13569     </:ab>
13570     @@@c:erred: <[[xp|nswf-legal-qname]]> { (2, 11)..(2, 13); }
13571     @@@c:erred: <[[xp|nswf-legal-qname]]> { (3, 2)..(3, 4); }
13572     @@@c:erred: <[[xp|nsc-prefix-declared]]> { /* prefix || */ }
13573     @@XMLTest:
13574     @@@QName: xp.name.doctypedecl.stag.etag.names.1.0.3.test
13575     @@@DEnt:
13576     @@@@test:value:
13577     <?xml version="1.0"?>
13578     <!DOCTYPE a:$u3005>
13579     <a:$u3005 xmlns:a="http://a.example/">
13580     </a:$u3005>
13581     @@@c:erred: <[[xp|nswf-legal-qname]]> { (2, 11)..(2, 13); }
13582     @@@c:erred: <[[xp|nswf-legal-qname]]> { (3, 2)..(3, 4); }
13583     @@XMLTest:
13584     @@@QName: xp.name.doctypedecl.stag.etag.names.1.1.3.test
13585     @@@DEnt:
13586     @@@@test:value:
13587     <?xml version="1.1"?>
13588     <!DOCTYPE a:$u3005>
13589     <a:$u3005 xmlns:a="http://a.example/">
13590     </a:$u3005>
13591     @@@test:domTree:
13592     document {
13593     xml-version: '1.1';
13594     document-type {
13595     node-name: 'a:' U+3005;
13596     }
13597     element {
13598     prefix: 'a';
13599     local-name: U+3005;
13600     namespace-uri: 'http://a.example/';
13601     attribute {
13602     namespace-uri: 'http://www.w3.org/2000/xmlns/';
13603     prefix: 'xmlns';
13604     local-name: 'a';
13605     value: 'http://a.example/';
13606     specified: true;
13607     }
13608     }
13609     }
13610     @@XMLTest:
13611     @@@QName: xp.name.doctypedecl.stag.etag.names.1.0.4.test
13612     @@@DEnt:
13613     @@@@test:value:
13614     <?xml version="1.0"?>
13615     <!DOCTYPE a:b>
13616     <a:b>
13617     </a:b>
13618     @@@c:erred: <[[xp|nsc-prefix-declared]]> { (3, 1)..(3, 5); }
13619     @@XMLTest:
13620     @@@QName: xp.name.doctypedecl.stag.etag.names.1.1.4.test
13621     @@@DEnt:
13622     @@@@test:value:
13623     <?xml version="1.1"?>
13624     <!DOCTYPE a:b>
13625     <a:b>
13626     </a:b>
13627     @@@c:erred: <[[xp|nsc-prefix-declared]]> { (3, 1)..(3, 5); }
13628     @@XMLTest:
13629     @@@QName: xp.name.emptyelemtag.1.0.2.test
13630     @@@DEnt:
13631     @@@@test:value:
13632     <?xml version="1.0"?>
13633     <$u3001$u3002/>
13634     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (2, 2)..(2, 3); }
13635     @@XMLTest:
13636     @@@QName: xp.name.emptyelemtag.1.1.2.test
13637     @@@DEnt:
13638     @@@@test:value:
13639     <?xml version="1.1"?>
13640     <$u3001$u3002/>
13641     @@@test:domTree:
13642     document {
13643     xml-version: '1.1';
13644     element {
13645     node-name: U+3001 U+3002;
13646     }
13647     }
13648     @@XMLTest:
13649     @@@QName: xp.name.emptyelemtag.1.0.3.test
13650     @@@DEnt:
13651     @@@@test:value:
13652     <?xml version="1.0"?>
13653     <$u3005b/>
13654     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (2, 2)..(2, 3); }
13655     @@XMLTest:
13656     @@@QName: xp.name.emptyelemtag.1.1.3.test
13657     @@@DEnt:
13658     @@@@test:value:
13659     <?xml version="1.1"?>
13660     <$u3005b/>
13661     @@@test:domTree:
13662     document {
13663     xml-version: '1.1';
13664     element {
13665     node-name: U+3005 'b';
13666     }
13667     }
13668     @@XMLTest:
13669     @@@QName: xp.name.emptyelemtag.names.1.0.1.test
13670     @@@DEnt:
13671     @@@@test:value:
13672     <?xml version="1.0"?>
13673     <a:b/>
13674     @@@c:erred: <[[xp|nsc-prefix-declared]]>{ (2, 1)..(2, 6); }
13675     @@XMLTest:
13676     @@@QName: xp.name.emptyelemtag.names.1.1.1.test
13677     @@@DEnt:
13678     @@@@test:value:
13679     <?xml version="1.1"?>
13680     <a:b/>
13681     @@@c:erred: <[[xp|nsc-prefix-declared]]>{ (2, 1)..(2, 6); }
13682     @@XMLTest:
13683     @@@QName: xp.name.attr.1.0.2.test
13684     @@@DEnt:
13685     @@@@test:value:
13686     <?xml version="1.0"?>
13687     <a $u3001$u3002=""/>
13688     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (2, 4)..(2, 5); }
13689     @@XMLTest:
13690     @@@QName: xp.name.attr.1.1.2.test
13691     @@@DEnt:
13692     @@@@test:value:
13693     <?xml version="1.1"?>
13694     <a $u3001$u3002=""/>
13695     @@@test:domTree:
13696     document {
13697     xml-version: '1.1';
13698     element {
13699     attribute {
13700     node-name: U+3001 U+3002;
13701     }
13702     }
13703     }
13704     @@XMLTest:
13705     @@@QName: xp.name.attr.1.0.3.test
13706     @@@DEnt:
13707     @@@@test:value:
13708     <?xml version="1.0"?>
13709     <a $u3005b=""/>
13710     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (2, 4)..(2, 5); }
13711     @@XMLTest:
13712     @@@QName: xp.name.attr.1.1.3.test
13713     @@@DEnt:
13714     @@@@test:value:
13715     <?xml version="1.1"?>
13716     <a $u3005b=""/>
13717     @@@test:domTree:
13718     document {
13719     xml-version: '1.1';
13720     element {
13721     attribute {
13722     node-name: U+3005 'b';
13723     }
13724     }
13725     }
13726     @@XMLTest:
13727     @@@QName: xp.name.attr.names.1.0.1.test
13728     @@@DEnt:
13729     @@@@test:value:
13730     <?xml version="1.0"?>
13731     <a a:b=""/>
13732     @@@c:erred: <[[xp|nsc-prefix-declared]]>{ (2, 1)..(2, 11); }
13733     @@XMLTest:
13734     @@@QName: xp.name.attr.names.1.1.1.test
13735     @@@DEnt:
13736     @@@@test:value:
13737     <?xml version="1.1"?>
13738     <a a:b=""/>
13739     @@@c:erred: <[[xp|nsc-prefix-declared]]>{ (2, 1)..(2, 11); }
13740     @@XMLTest:
13741     @@@QName: xp.name.attr.names.1.0.2.test
13742     @@@DEnt:
13743     @@@@test:value:
13744     <?xml version="1.0"?>
13745     <a :ab=""/>
13746     @@@c:erred: <[[xp|nswf-legal-qname]]>{ (2, 4)..(2, 6); }
13747     @@@c:erred: <[[xp|nsc-prefix-declared]]> { }
13748     @@XMLTest:
13749     @@@QName: xp.name.attr.names.1.1.2.test
13750     @@@DEnt:
13751     @@@@test:value:
13752     <?xml version="1.1"?>
13753     <a :ab=""/>
13754     @@@c:erred: <[[xp|nswf-legal-qname]]>{ (2, 4)..(2, 6); }
13755     @@@c:erred: <[[xp|nsc-prefix-declared]]> { }
13756     @@XMLTest:
13757     @@@QName: xp.name.attlist.1.0.2.test
13758     @@@DEnt:
13759     @@@@test:value:
13760     <?xml version="1.0"?>
13761     <!DOCTYPE p [
13762     <!NOTATION $u3001$u3002 SYSTEM "n">
13763     <!ATTLIST $u3001$u3002
13764     $u3001$u3002
13765     NOTATION
13766     ($u3001$u3002)
13767     #IMPLIED>
13768     ]><p/>
13769     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (3, 12)..(3, 13); }
13770     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (4, 11)..(4, 12); }
13771     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (5, 1)..(5, 2); }
13772     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (7, 2)..(7, 3); }
13773     @@XMLTest:
13774     @@@QName: xp.name.attlist.1.1.2.test
13775     @@@DEnt:
13776     @@@@test:value:
13777     <?xml version="1.1"?>
13778     <!DOCTYPE p [
13779     <!NOTATION $u3001$u3002 SYSTEM "n">
13780     <!ATTLIST $u3001$u3002
13781     $u3001$u3002
13782     NOTATION
13783     ($u3001$u3002)
13784     #IMPLIED>
13785     ]><p/>
13786     @@@test:domTree:
13787     document {
13788     xml-version: '1.1';
13789     document-type {
13790     notation {
13791     node-name: U+3001 U+3002;
13792     }
13793     element-type-definition {
13794     node-name: U+3001 U+3002;
13795     attribute-definition {
13796     node-name: U+3001 U+3002;
13797     allowed-tokens: DOMStringList (U+3001 U+3002);
13798     }
13799     }
13800     }
13801     element { }
13802     }
13803     @@XMLTest:
13804     @@@QName: xp.name.attlist.1.0.3.test
13805     @@@DEnt:
13806     @@@@test:value:
13807     <?xml version="1.0"?>
13808     <!DOCTYPE p [
13809     <!NOTATION $u3005b SYSTEM "n">
13810     <!ATTLIST $u3005b
13811     $u3005b
13812     NOTATION
13813     ($u3005b)
13814     #IMPLIED>
13815     ]><p/>
13816     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (3, 12)..(3, 13); }
13817     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (4, 11)..(4, 12); }
13818     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (5, 1)..(5, 2); }
13819     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (7, 2)..(7, 3); }
13820     @@XMLTest:
13821     @@@QName: xp.name.attlist.1.1.3.test
13822     @@@DEnt:
13823     @@@@test:value:
13824     <?xml version="1.1"?>
13825     <!DOCTYPE p [
13826     <!NOTATION $u3005b SYSTEM "n">
13827     <!ATTLIST $u3005b
13828     $u3005b
13829     NOTATION
13830     ($u3005b)
13831     #IMPLIED>
13832     ]><p/>
13833     @@@test:domTree:
13834     document {
13835     xml-version: '1.1';
13836     document-type {
13837     notation {
13838     node-name: U+3005 'b';
13839     }
13840     element-type-definition {
13841     node-name: U+3005 'b';
13842     attribute-definition {
13843     node-name: U+3005 'b';
13844     allowed-tokens: DOMStringList (U+3005 'b');
13845     }
13846     }
13847     }
13848     element { }
13849     }
13850     @@XMLTest:
13851     @@@QName: xp.name.attlist.names.1.0.1.test
13852     @@@DEnt:
13853     @@@@test:value:
13854     <?xml version="1.0"?>
13855     <!DOCTYPE p [
13856     <!NOTATION a:b SYSTEM "n">
13857     <!ATTLIST a:b
13858     a:b
13859     NOTATION
13860     (a:b)
13861     #IMPLIED>
13862     ]><p/>
13863     @@@c:erred: <[[xp|nswf-legal-ncname]]>{ (3, 12)..(3, 14); }
13864     @@@c:erred: <[[xp|nswf-legal-ncname]]>{ (7, 2)..(7, 4); }
13865     @@XMLTest:
13866     @@@QName: xp.name.attlist.names.1.1.1.test
13867     @@@DEnt:
13868     @@@@test:value:
13869     <?xml version="1.1"?>
13870     <!DOCTYPE p [
13871     <!NOTATION a:b SYSTEM "n">
13872     <!ATTLIST a:b
13873     a:b
13874     NOTATION
13875     (a:b)
13876     #IMPLIED>
13877     ]><p/>
13878     @@@c:erred: <[[xp|nswf-legal-ncname]]>{ (3, 12)..(3, 14); }
13879     @@@c:erred: <[[xp|nswf-legal-ncname]]>{ (7, 2)..(7, 4); }
13880     @@XMLTest:
13881     @@@QName: xp.name.attlist.names.1.0.2.test
13882     @@@DEnt:
13883     @@@@test:value:
13884     <?xml version="1.0"?>
13885     <!DOCTYPE p [
13886     <!NOTATION :ab SYSTEM "n">
13887     <!ATTLIST :ab
13888     :ab
13889     NOTATION
13890     (:ab)
13891     #IMPLIED>
13892     ]><p/>
13893     @@@c:erred: <[[xp|nswf-legal-ncname]]>{ (3, 12)..(3, 14); }
13894     @@@c:erred: <[[xp|nswf-legal-qname]]>{ (4, 11)..(4, 13); }
13895     @@@c:erred: <[[xp|nswf-legal-qname]]>{ (5, 1)..(5, 3); }
13896     @@@c:erred: <[[xp|nswf-legal-ncname]]>{ (7, 2)..(7, 4); }
13897     @@XMLTest:
13898     @@@QName: xp.name.attlist.names.1.1.2.test
13899     @@@DEnt:
13900     @@@@test:value:
13901     <?xml version="1.1"?>
13902     <!DOCTYPE p [
13903     <!NOTATION :ab SYSTEM "n">
13904     <!ATTLIST :ab
13905     :ab
13906     NOTATION
13907     (:ab)
13908     #IMPLIED>
13909     ]><p/>
13910     @@@c:erred: <[[xp|nswf-legal-ncname]]>{ (3, 12)..(3, 14); }
13911     @@@c:erred: <[[xp|nswf-legal-qname]]>{ (4, 11)..(4, 13); }
13912     @@@c:erred: <[[xp|nswf-legal-qname]]>{ (5, 1)..(5, 3); }
13913     @@@c:erred: <[[xp|nswf-legal-ncname]]>{ (7, 2)..(7, 4); }
13914     @@XMLTest:
13915     @@@QName: xp.name.gent.1.0.2.test
13916     @@@DEnt:
13917     @@@@test:value:
13918     <?xml version="1.0"?>
13919     <!DOCTYPE p [
13920     <!ENTITY $u3001$u3002 "n">
13921     ]>
13922     <p a="&$u3001$u3002;">
13923     &$u3001$u3002;
13924     </p>
13925     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (3, 10)..(3, 11); }
13926     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (5, 8)..(5, 9); }
13927     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (6, 2)..(6, 3); }
13928     @@XMLTest:
13929     @@@QName: xp.name.ger.1.1.2.test
13930     @@@DEnt:
13931     @@@@test:value:
13932     <?xml version="1.1"?>
13933     <!DOCTYPE p [
13934     <!ENTITY $u3001$u3002 "n">
13935     ]>
13936     <p a="&$u3001$u3002;">$
13937     &$u3001$u3002;$
13938     </p>
13939     @@@test:domTree:
13940     document {
13941     xml-version: '1.1';
13942     document-type {
13943     general-entity {
13944     node-name: U+3001 U+3002;
13945     }
13946     }
13947     element {
13948     attribute {
13949     node-name: 'a';
13950     general-entity-reference {
13951     node-name: U+3001 U+3002;
13952     }
13953     }
13954     general-entity-reference {
13955     node-name: U+3001 U+3002;
13956     }
13957     }
13958     }
13959     @@XMLTest:
13960     @@@QName: xp.name.ger.1.0.3.test
13961     @@@DEnt:
13962     @@@@test:value:
13963     <?xml version="1.0"?>
13964     <!DOCTYPE p [
13965     <!ENTITY $u3005b "n">
13966     ]>
13967     <p a="&$u3005b;">
13968     &$u3005b;
13969     </p>
13970     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (3, 10)..(3, 11); }
13971     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (5, 8)..(5, 9); }
13972     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (6, 2)..(6, 3); }
13973     @@XMLTest:
13974     @@@QName: xp.name.ger.1.1.3.test
13975     @@@DEnt:
13976     @@@@test:value:
13977     <?xml version="1.1"?>
13978     <!DOCTYPE p [
13979     <!ENTITY $u3005b "n">
13980     ]>
13981     <p a="&$u3005b;">$
13982     &$u3005b;$
13983     </p>
13984     @@@test:domTree:
13985     document {
13986     xml-version: '1.1';
13987     document-type {
13988     general-entity {
13989     node-name: U+3005 'b';
13990     }
13991     }
13992     element {
13993     attribute {
13994     node-name: 'a';
13995     general-entity-reference {
13996     node-name: U+3005 'b';
13997     }
13998     }
13999     general-entity-reference {
14000     node-name: U+3005 'b';
14001     }
14002     }
14003     }
14004     @@XMLTest:
14005     @@@QName: xp.name.ger.names.1.0.1.test
14006     @@@DEnt:
14007     @@@@test:value:
14008     <?xml version="1.0"?>
14009     <!DOCTYPE p [
14010     <!ENTITY a:b "n">
14011     ]>
14012     <p a="&a:b;">
14013     &a:b;
14014     </p>
14015     @@@c:erred: <[[xp|nswf-legal-ncname]]>{ (3, 10)..(3, 12); }
14016     @@@c:erred: <[[xp|nswf-legal-ncname]]>{ (5, 8)..(5, 10); }
14017     @@@c:erred: <[[xp|nswf-legal-ncname]]>{ (6, 2)..(6, 4); }
14018     @@XMLTest:
14019     @@@QName: xp.name.ger.names.1.1.1.test
14020     @@@DEnt:
14021     @@@@test:value:
14022     <?xml version="1.1"?>
14023     <!DOCTYPE p [
14024     <!ENTITY a:b "n">
14025     ]>
14026     <p a="&a:b;">
14027     &a:b;
14028     </p>
14029     @@@c:erred: <[[xp|nswf-legal-ncname]]>{ (3, 10)..(3, 12); }
14030     @@@c:erred: <[[xp|nswf-legal-ncname]]>{ (5, 8)..(5, 10); }
14031     @@@c:erred: <[[xp|nswf-legal-ncname]]>{ (6, 2)..(6, 4); }
14032     @@XMLTest:
14033     @@@QName: xp.name.ndata.1.0.2.test
14034     @@@DEnt:
14035     @@@@test:value:
14036     <?xml version="1.0"?>
14037     <!DOCTYPE p [
14038     <!NOTATION $u3001$u3002 SYSTEM "n">
14039     <!ENTITY e SYSTEM "s" NDATA $u3001$u3002>
14040     ]><p/>
14041     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (3, 12)..(3, 13); }
14042     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (4, 29)..(4, 30); }
14043     @@XMLTest:
14044     @@@QName: xp.name.ndata.1.1.2.test
14045     @@@DEnt:
14046     @@@@test:value:
14047     <?xml version="1.1"?>
14048     <!DOCTYPE p [
14049     <!NOTATION $u3001$u3002 SYSTEM "n">
14050     <!ENTITY e SYSTEM "s" NDATA $u3001$u3002>
14051     ]><p/>
14052     @@@test:domTree:
14053     document {
14054     xml-version: '1.1';
14055     document-type {
14056     notation {
14057     node-name: U+3001 U+3002;
14058     }
14059     general-entity {
14060     node-name: 'e';
14061     notation-name: U+3001 U+3002;
14062     }
14063     }
14064     element { }
14065     }
14066     @@XMLTest:
14067     @@@QName: xp.name.ndata.1.0.3.test
14068     @@@DEnt:
14069     @@@@test:value:
14070     <?xml version="1.0"?>
14071     <!DOCTYPE p [
14072     <!NOTATION $u3005b SYSTEM "n">
14073     <!ENTITY e SYSTEM "s" NDATA $u3005b>
14074     ]><p/>
14075     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (3, 12)..(3, 13); }
14076     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (4, 29)..(4, 30); }
14077     @@XMLTest:
14078     @@@QName: xp.name.ndata.1.1.3.test
14079     @@@DEnt:
14080     @@@@test:value:
14081     <?xml version="1.1"?>
14082     <!DOCTYPE p [
14083     <!NOTATION $u3005b SYSTEM "n">
14084     <!ENTITY e SYSTEM "s" NDATA $u3005b>
14085     ]><p/>
14086     @@@test:domTree:
14087     document {
14088     xml-version: '1.1';
14089     document-type {
14090     notation {
14091     node-name: U+3005 'b';
14092     }
14093     general-entity {
14094     node-name: 'e';
14095     notation-name: U+3005 'b';
14096     }
14097     }
14098     element { }
14099     }
14100     @@XMLTest:
14101     @@@QName: xp.name.ndata.names.1.0.1.test
14102     @@@DEnt:
14103     @@@@test:value:
14104     <?xml version="1.0"?>
14105     <!DOCTYPE p [
14106     <!NOTATION a:b SYSTEM "n">
14107     <!ENTITY e SYSTEM "s" NDATA a:b>
14108     ]><p/>
14109     @@@c:erred: <[[xp|nswf-legal-ncname]]>{ (3, 12)..(3, 14); }
14110     @@@c:erred: <[[xp|nswf-legal-ncname]]>{ (4, 29)..(4, 31); }
14111     @@XMLTest:
14112     @@@QName: xp.name.ndata.names.1.1.1.test
14113     @@@DEnt:
14114     @@@@test:value:
14115     <?xml version="1.1"?>
14116     <!DOCTYPE p [
14117     <!NOTATION a:b SYSTEM "n">
14118     <!ENTITY e SYSTEM "s" NDATA a:b>
14119     ]><p/>
14120     @@@c:erred: <[[xp|nswf-legal-ncname]]>{ (3, 12)..(3, 14); }
14121     @@@c:erred: <[[xp|nswf-legal-ncname]]>{ (4, 29)..(4, 31); }
14122    
14123     @@enImplNote:
14124     @@@ddid: wf-invalid-character-in-node-name
14125     @@@@:
14126     {ISSUE::
14127     {P:: Tests required for:
14128    
14129     - <CODE::Name> in element type declaration
14130    
14131     - <CODE::Name> in model group
14132    
14133     - <CODE::Name> in parameter entity declaration
14134    
14135     - <CODE::Name> in parameter entity reference
14136    
14137     }
14138     }
14139    
14140     @@XMLTest:
14141     @@@QName: xp.NOTATION.1.test
14142     @@@DEnt:
14143     @@@@test:value:
14144     <!DOCTYPE p [
14145     <!NOTATION n SYSTEM "m">
14146     ]><p/>
14147     @@@test:domTree:
14148     document {
14149     document-type {
14150     notation {
14151     node-name: 'n';
14152     public-id: null;
14153     system-id: 'm';
14154     }
14155     }
14156     element { }
14157     }
14158     @@XMLTest:
14159     @@@QName: xp.NOTATION.2.test
14160     @@@DEnt:
14161     @@@@test:value:
14162     <!DOCTYPE p [
14163     <!NOTATION n PUBLIC "m">
14164     ]><p/>
14165     @@@test:domTree:
14166     document {
14167     document-type {
14168     notation {
14169     node-name: 'n';
14170     system-id: null;
14171     public-id: 'm';
14172     }
14173     }
14174     element { }
14175     }
14176     @@XMLTest:
14177     @@@QName: xp.NOTATION.3.test
14178     @@@DEnt:
14179     @@@@test:value:
14180     <!DOCTYPE p [
14181     <!NOTATION n PUBLIC "m" "l">
14182     ]><p/>
14183     @@@test:domTree:
14184     document {
14185     document-type {
14186     notation {
14187     node-name: 'n';
14188     public-id: 'm';
14189     system-id: 'l';
14190     }
14191     }
14192     element { }
14193     }
14194     @@XMLTest:
14195     @@@QName: xp.NOTATION.4.test
14196     @@@DEnt:
14197     @@@@test:value:
14198     <!DOCTYPE p [
14199     <!NOTATION n SYSTEM "m">
14200     <!NOTATION n SYSTEM "l">
14201     ]><p/>
14202     @@@c:erred: <[[xp|vc-unique-notation-name]]> { (3, 1)..(3, 24); }
14203     @@@test:domTree:
14204     document {
14205     document-type {
14206     notation {
14207     node-name: 'n';
14208     system-id: 'm';
14209     }
14210     }
14211     element { }
14212     }
14213    
14214     @@XMLTest:
14215     @@@QName: xp.names.1.test
14216     @@@DEnt:
14217     @@@@test:value:
14218     <p xmlns="http://1.example/" a="b"/>
14219     @@@test:domTree:
14220     document {
14221     element {
14222     prefix: null;
14223     local-name: 'p';
14224     namespace-uri: 'http://1.example/';
14225     attribute {
14226     prefix: null;
14227     local-name: 'xmlns';
14228     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14229     specified: true;
14230     }
14231     attribute {
14232     prefix: null;
14233     local-name: 'a';
14234     specified: true;
14235     }
14236     }
14237     }
14238     @@XMLTest:
14239     @@@QName: xp.names.2.test
14240     @@@DEnt:
14241     @@@@test:value:
14242     <p xmlns:a="http://1.example/" a="b" a:a="c"/>
14243     @@@test:domTree:
14244     document {
14245     element {
14246     prefix: null;
14247     local-name: 'p';
14248     namespace-uri: null;
14249     attribute {
14250     prefix: 'xmlns';
14251     local-name: 'a';
14252     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14253     specified: true;
14254     }
14255     attribute {
14256     prefix: null;
14257     local-name: 'a';
14258     specified: true;
14259     }
14260     attribute {
14261     prefix: 'a';
14262     local-name: 'a';
14263     namespace-uri: 'http://1.example/';
14264     specified: true;
14265     }
14266     }
14267     }
14268     @@XMLTest:
14269     @@@QName: xp.names.3.test
14270     @@@DEnt:
14271     @@@@test:value:
14272     <a:p xmlns:a="http://1.example/" a="b" a:a="c"/>
14273     @@@test:domTree:
14274     document {
14275     element {
14276     prefix: 'a';
14277     local-name: 'p';
14278     namespace-uri: 'http://1.example/';
14279     attribute {
14280     prefix: 'xmlns';
14281     local-name: 'a';
14282     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14283     specified: true;
14284     }
14285     attribute {
14286     prefix: null;
14287     local-name: 'a';
14288     specified: true;
14289     }
14290     attribute {
14291     prefix: 'a';
14292     local-name: 'a';
14293     namespace-uri: 'http://1.example/';
14294     specified: true;
14295     }
14296     }
14297     }
14298     @@XMLTest:
14299     @@@QName: xp.names.5.test
14300     @@@DEnt:
14301     @@@@test:value:
14302     <p xmlns:a="http://1.example/">$
14303     <a:q/>$
14304     </p>
14305     @@@test:domTree:
14306     document {
14307     element {
14308     prefix: null;
14309     local-name: 'p';
14310     namespace-uri: null;
14311     attribute {
14312     prefix: 'xmlns';
14313     local-name: 'a';
14314     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14315     specified: true;
14316     }
14317     element {
14318     prefix: 'a';
14319     local-name: 'q';
14320     namespace-uri: 'http://1.example/';
14321     }
14322     }
14323     }
14324     @@XMLTest:
14325     @@@QName: xp.names.6.test
14326     @@@DEnt:
14327     @@@@test:value:
14328     <p xmlns:a="http://1.example/">$
14329     <q a:b="c"/>$
14330     </p>
14331     @@@test:domTree:
14332     document {
14333     element {
14334     prefix: null;
14335     local-name: 'p';
14336     namespace-uri: null;
14337     attribute {
14338     prefix: 'xmlns';
14339     local-name: 'a';
14340     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14341     specified: true;
14342     }
14343     element {
14344     prefix: null;
14345     local-name: 'q';
14346     namespace-uri: null;
14347     attribute {
14348     prefix: 'a';
14349     local-name: 'b';
14350     namespace-uri: 'http://1.example/';
14351     specified: true;
14352     }
14353     }
14354     }
14355     }
14356     @@XMLTest:
14357     @@@QName: xp.names.7.test
14358     @@@DEnt:
14359     @@@@test:value:
14360     <p xmlns:a="http://1.example/">$
14361     <q a:b="c" xmlns:a="http://2.example/"/>$
14362     </p>
14363     @@@test:domTree:
14364     document {
14365     element {
14366     prefix: null;
14367     local-name: 'p';
14368     namespace-uri: null;
14369     attribute {
14370     prefix: 'xmlns';
14371     local-name: 'a';
14372     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14373     specified: true;
14374     }
14375     element {
14376     prefix: null;
14377     local-name: 'q';
14378     namespace-uri: null;
14379     attribute {
14380     prefix: 'a';
14381     local-name: 'b';
14382     namespace-uri: 'http://2.example/';
14383     specified: true;
14384     }
14385     attribute {
14386     prefix: 'xmlns';
14387     local-name: 'a';
14388     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14389     specified: true;
14390     }
14391     }
14392     }
14393     }
14394    
14395     @@XMLTest:
14396     @@@QName: xp.names.undeclare.1.test
14397     @@@DEnt:
14398     @@@@test:value:
14399     <p xmlns="http://1.example/">$
14400     <q xmlns="">$
14401     <r xmlns="http://2.example/"/>$
14402     </q>$
14403     </p>
14404     @@@test:domTree:
14405     document {
14406     element {
14407     prefix: null;
14408     local-name: 'p';
14409     namespace-uri: 'http://1.example/';
14410     attribute {
14411     prefix: null;
14412     local-name: 'xmlns';
14413     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14414     specified: true;
14415     }
14416     element {
14417     prefix: null;
14418     local-name: 'q';
14419     namespace-uri: null;
14420     attribute {
14421     prefix: null;
14422     local-name: 'xmlns';
14423     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14424     specified: true;
14425     }
14426     element {
14427     prefix: null;
14428     local-name: 'r';
14429     namespace-uri: 'http://2.example/';
14430     attribute {
14431     prefix: null;
14432     local-name: 'xmlns';
14433     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14434     specified: true;
14435     }
14436     }
14437     }
14438     }
14439     }
14440    
14441     @@XMLTest:
14442     @@@QName: xp.names.undeclare.1.0.1.test
14443     @@@DEnt:
14444     @@@@test:value:
14445     <?xml version="1.0"?>
14446     <a:p xmlns:a="http://1.example/">$
14447     <q xmlns:a="">$
14448     <a:r xmlns:a="http://2.example/"/>$
14449     </q>$
14450     </a:p>
14451     @@@c:erred: <[[xp|nswf-empty-namespace-name]]> { (2, 34)..(2, 47); }
14452     @@XMLTest:
14453     @@@QName: xp.names.undeclare.1.1.1.test
14454     @@@DEnt:
14455     @@@@test:value:
14456     <?xml version="1.1"?>
14457     <a:p xmlns:a="http://1.example/">$
14458     <q xmlns:a="">$
14459     <a:r xmlns:a="http://2.example/"/>$
14460     </q>$
14461     </a:p>
14462     @@@test:domTree:
14463     document {
14464     element {
14465     prefix: 'a';
14466     local-name: 'p';
14467     namespace-uri: 'http://1.example/';
14468     attribute {
14469     prefix: 'xmlns';
14470     local-name: 'a';
14471     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14472     specified: true;
14473     }
14474     element {
14475     prefix: null;
14476     local-name: 'q';
14477     namespace-uri: null;
14478     attribute {
14479     prefix: 'xmlns';
14480     local-name: 'a';
14481     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14482     specified: true;
14483     }
14484     element {
14485     prefix: 'a';
14486     local-name: 'r';
14487     namespace-uri: 'http://2.example/';
14488     attribute {
14489     prefix: 'xmlns';
14490     local-name: 'a';
14491     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14492     specified: true;
14493     }
14494     }
14495     }
14496     }
14497     }
14498     @@XMLTest:
14499     @@@QName: xp.names.undeclare.1.1.2.test
14500     @@@DEnt:
14501     @@@@test:value:
14502     <?xml version="1.1"?>
14503     <a:p xmlns:a="http://1.example/">$
14504     <q xmlns:a="">$
14505     <a:r/>$
14506     </q>$
14507     </a:p>
14508     @@@c:erred: <[[xp|nsc-prefix-declared]]> { (2, 48)..(2, 53); }
14509    
14510     @@XMLTest:
14511     @@@QName: xp.names.xml.prefix.1.test
14512     @@@DEnt:
14513     @@@@test:value:
14514     <a xmlns:xml="http://www.w3.org/XML/1998/namespace"/>
14515     @@@test:domTree:
14516     document {
14517     element {
14518     attribute {
14519     prefix: 'xmlns';
14520     local-name: 'xml';
14521     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14522     }
14523     }
14524     }
14525     @@XMLTest:
14526     @@@QName: xp.names.xml.prefix.2.test
14527     @@@DEnt:
14528     @@@@test:value:
14529     <a xmlns:xml="a"/>
14530     @@@c:erred: <[[xp|nsc-reserved-prefix-xml]]> { (1, 1)..(1, 18); }
14531     @@XMLTest:
14532     @@@QName: xp.names.xml.prefix.3.test
14533     @@@DEnt:
14534     @@@@test:value:
14535     <a xmlns:a="http://www.w3.org/XML/1998/namespace"
14536     />
14537     @@@c:erred: <[[xp|nsc-reserved-namespace-name-xml]]> { (1, 1)..(2, 2); }
14538     @@XMLTest:
14539     @@@QName: xp.names.xml.prefix.4.test
14540     @@@DEnt:
14541     @@@@test:value:
14542     <a xml:lang="ja"/>
14543     @@@test:domTree:
14544     document {
14545     element {
14546     attribute {
14547     prefix: 'xml';
14548     local-name: 'lang';
14549     namespace-uri: 'http://www.w3.org/XML/1998/namespace';
14550     }
14551     }
14552     }
14553    
14554     @@XMLTest:
14555     @@@QName: xp.names.prefix.declared.1.test
14556     @@@DEnt:
14557     @@@@test:value:
14558     <!DOCTYPE a [
14559     <!ATTLIST a
14560     b:c CDATA "d"
14561     >
14562     ]>
14563     <a/>
14564     @@@c:erred: <[[xp|nsc-prefix-declared]]> { (6, 1)..(6, 4); }
14565    
14566     @@XMLTest:
14567     @@@QName: xp.names.xmlns.reserved.1.test
14568     @@@DEnt:
14569     @@@@test:value:
14570     <a xmlns:xmlns="http://www.w3.org/2000/xmlns/"
14571     />
14572     @@@c:erred: <[[xp|nsc-reserved-prefix-xmlns]]> { (1, 1)..(2, 2); }
14573     @@@c:erred: <[[xp|nsc-reserved-namespace-name-xmlns]]> { (1, 1)..(2, 2); }
14574     @@XMLTest:
14575     @@@QName: xp.names.xmlns.reserved.2.test
14576     @@@DEnt:
14577     @@@@test:value:
14578     <a xmlns:xmlns="a"
14579     />
14580     @@@c:erred: <[[xp|nsc-reserved-prefix-xmlns]]> { (1, 1)..(2, 2); }
14581     @@XMLTest:
14582     @@@QName: xp.names.xmlns.reserved.3.test
14583     @@@DEnt:
14584     @@@@test:value:
14585     <a xmlns:a="http://www.w3.org/2000/xmlns/"
14586     />
14587     @@@c:erred: <[[xp|nsc-reserved-namespace-name-xmlns]]> { (1, 1)..(2, 2); }
14588    
14589     @@XMLTest:
14590     @@@QName: xp.names.default.1.test
14591     @@@DEnt:
14592     @@@@test:value:
14593     <!DOCTYPE a [
14594     <!ATTLIST a
14595     xmlns CDATA "http://1.example/">
14596     ]>
14597     <a/>
14598     @@@test:domTree:
14599     document {
14600     document-type {
14601     element-type-definition {
14602     node-name: 'a';
14603     attribute-definition {
14604     node-name: 'xmlns';
14605     node-value: 'http://1.example/';
14606     }
14607     }
14608     }
14609     element {
14610     prefix: null;
14611     local-name: 'a';
14612     namespace-uri: 'http://1.example/';
14613     attribute {
14614     prefix: null;
14615     local-name: 'xmlns';
14616     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14617     value: 'http://1.example/';
14618     specified: false;
14619     }
14620     }
14621     }
14622     @@XMLTest:
14623     @@@QName: xp.names.default.2.test
14624     @@@DEnt:
14625     @@@@test:value:
14626     <!DOCTYPE a [
14627     <!ATTLIST a
14628     xmlns CDATA "http://1.example/">
14629     ]>
14630     <a xmlns="http://2.example/"/>
14631     @@@test:domTree:
14632     document {
14633     document-type {
14634     element-type-definition {
14635     node-name: 'a';
14636     attribute-definition {
14637     node-name: 'xmlns';
14638     node-value: 'http://1.example/';
14639     }
14640     }
14641     }
14642     element {
14643     prefix: null;
14644     local-name: 'a';
14645     namespace-uri: 'http://2.example/';
14646     attribute {
14647     prefix: null;
14648     local-name: 'xmlns';
14649     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14650     value: 'http://2.example/';
14651     specified: true;
14652     }
14653     }
14654     }
14655     @@XMLTest:
14656     @@@QName: xp.names.default.3.test
14657     @@@DEnt:
14658     @@@@test:value:
14659     <!DOCTYPE b:a [
14660     <!ATTLIST b:a
14661     xmlns:b CDATA "http://1.example/">
14662     ]>
14663     <b:a/>
14664     @@@test:domTree:
14665     document {
14666     document-type {
14667     element-type-definition {
14668     node-name: 'b:a';
14669     attribute-definition {
14670     node-name: 'xmlns:b';
14671     node-value: 'http://1.example/';
14672     }
14673     }
14674     }
14675     element {
14676     prefix: 'b';
14677     local-name: 'a';
14678     namespace-uri: 'http://1.example/';
14679     attribute {
14680     prefix: 'xmlns';
14681     local-name: 'b';
14682     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14683     value: 'http://1.example/';
14684     specified: false;
14685     }
14686     }
14687     }
14688     @@XMLTest:
14689     @@@QName: xp.names.default.4.test
14690     @@@DEnt:
14691     @@@@test:value:
14692     <!DOCTYPE b:a [
14693     <!ATTLIST b:a
14694     xmlns:b CDATA "http://1.example/">
14695     ]>
14696     <b:a xmlns:b="http://2.example/"/>
14697     @@@test:domTree:
14698     document {
14699     document-type {
14700     element-type-definition {
14701     node-name: 'b:a';
14702     attribute-definition {
14703     node-name: 'xmlns:b';
14704     node-value: 'http://1.example/';
14705     }
14706     }
14707     }
14708     element {
14709     prefix: 'b';
14710     local-name: 'a';
14711     namespace-uri: 'http://2.example/';
14712     attribute {
14713     prefix: 'xmlns';
14714     local-name: 'b';
14715     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14716     value: 'http://2.example/';
14717     specified: true;
14718     }
14719     }
14720     }
14721     @@XMLTest:
14722     @@@QName: xp.names.default.5.test
14723     @@@DEnt:
14724     @@@@test:value:
14725     <!DOCTYPE a [
14726     <!ATTLIST a
14727     xmlns:b CDATA "http://1.example/"
14728     b:c CDATA "http://1.example/">
14729     ]>
14730     <a xmlns:b="http://2.example/"/>
14731     @@@test:domTree:
14732     document {
14733     document-type {
14734     element-type-definition {
14735     node-name: 'a';
14736     attribute-definition {
14737     node-name: 'xmlns:b';
14738     text-content: 'http://1.example/';
14739     }
14740     attribute-definition {
14741     node-name: 'b:c';
14742     text-content: 'http://1.example/';
14743     }
14744     }
14745     }
14746     element {
14747     prefix: null;
14748     local-name: 'a';
14749     namespace-uri: null;
14750     attribute {
14751     prefix: 'xmlns';
14752     local-name: 'b';
14753     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14754     value: 'http://2.example/';
14755     specified: true;
14756     }
14757     attribute {
14758     prefix: 'b';
14759     local-name: 'c';
14760     namespace-uri: 'http://2.example/';
14761     specified: false;
14762     }
14763     }
14764     }
14765    
14766     @@XMLTest:
14767     @@@QName: xp.names.unique.1.test
14768     @@@DEnt:
14769     @@@@test:value:
14770     <a
14771     xmlns:b="http://2.example/"
14772     xmlns:c="http://2.example/"
14773     b:d=""
14774     c:d=""
14775     />
14776     @@@c:erred: <[[xp|nswf-unique-att-spec-expanded-name]]> { (1, 1)..(6, 2); }
14777     @@XMLTest:
14778     @@@QName: xp.names.unique.2.test
14779     @@@DEnt:
14780     @@@@test:value:
14781     <!DOCTYPE a [
14782     <!ATTLIST a
14783     c:d CDATA ""
14784     >
14785     ]>
14786     <a
14787     xmlns:b="http://2.example/"
14788     xmlns:c="http://2.example/"
14789     b:d=""
14790     />
14791     @@@c:erred: <[[xp|nswf-unique-att-spec-expanded-name]]> { (6, 1)..(10, 2);}
14792     @@XMLTest:
14793     @@@QName: xp.names.unique.3.test
14794     @@@DEnt:
14795     @@@@test:value:
14796     <!DOCTYPE a [
14797     <!ATTLIST a
14798     c:d CDATA "value1"
14799     >
14800     ]>
14801     <a
14802     xmlns:c="http://2.example/"
14803     c:d="value2"
14804     />
14805     @@@test:domTree:
14806     document {
14807     document-type { }
14808     element {
14809     attribute {
14810     prefix: 'xmlns';
14811     local-name: 'c';
14812     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14813     specified: true;
14814     }
14815     attribute {
14816     prefix: 'c';
14817     local-name: 'd';
14818     namespace-uri: 'http://2.example/';
14819     value: 'value2';
14820     specified: true;
14821     }
14822     }
14823     }
14824    
14825     @@XMLTest:
14826     @@@QName: xp.names.normalize.1.test
14827     @@@DEnt:
14828     @@@@test:value:
14829     <!DOCTYPE a [
14830     <!ATTLIST a
14831     xmlns NMTOKEN #IMPLIED
14832     >
14833     ]>
14834     <a xmlns=" "/>
14835     @@@test:domTree:
14836     document {
14837     document-type { }
14838     element {
14839     namespace-uri: null;
14840     prefix: null;
14841     local-name: 'a';
14842     }
14843     }
14844     @@XMLTest:
14845     @@@QName: xp.names.normalize.2.test
14846     @@@DEnt:
14847     @@@@test:value:
14848     <!DOCTYPE a [
14849     <!ATTLIST a
14850     xmlns NMTOKEN #IMPLIED
14851     >
14852     ]>
14853     <a xmlns=" about:blank "/>
14854     @@@test:domTree:
14855     document {
14856     document-type { }
14857     element {
14858     namespace-uri: 'about:blank';
14859     prefix: null;
14860     local-name: 'a';
14861     }
14862     }
14863     @@XMLTest:
14864     @@@QName: xp.names.normalize.3.test
14865     @@@DEnt:
14866     @@@@test:value:
14867     <!DOCTYPE a:a [
14868     <!ATTLIST a:a
14869     xmlns:a NMTOKEN #IMPLIED
14870     >
14871     ]>
14872     <a:a xmlns:a=" about:blank "/>
14873     @@@test:domTree:
14874     document {
14875     document-type { }
14876     element {
14877     namespace-uri: 'about:blank';
14878     prefix: 'a';
14879     local-name: 'a';
14880     }
14881     }
14882    
14883 wakaba 1.29 @@XMLTest:
14884     @@@QName: xp.no.baseuri.test
14885     @@@DEnt:
14886     @@@@test:value:
14887     <p/>
14888     @@@test:domTree:
14889     document {
14890     document-uri: null;
14891     base-uri: null;
14892     element {
14893     node-name: 'p';
14894     base-uri: null;
14895     }
14896     }
14897     @@XMLTest:
14898     @@@QName: xp.docuri.no.baseuri.test
14899     @@@DEnt:
14900     @@@@test:uri:
14901     http://www.example.com/
14902     @@@@test:value:
14903     <p/>
14904     @@@test:domTree:
14905     document {
14906     document-uri: 'http://www.example.com/';
14907     base-uri: 'http://www.example.com/';
14908     element {
14909     node-name: 'p';
14910     base-uri: 'http://www.example.com/';
14911     }
14912     }
14913     @@XMLTest:
14914     @@@QName: xp.docuri.baseuri.test
14915     @@@DEnt:
14916     @@@@test:uri:
14917     http://www.example.com/
14918     @@@@test:baseURI:
14919     ftp://ftp.example.com/
14920     @@@@test:value:
14921     <p/>
14922     @@@test:domTree:
14923     document {
14924     document-uri: 'http://www.example.com/';
14925     base-uri: 'ftp://ftp.example.com/';
14926     element {
14927     node-name: 'p';
14928     base-uri: 'ftp://ftp.example.com/';
14929     }
14930     }
14931     @@XMLTest:
14932     @@@QName: xp.doctype.baseuri.test
14933     @@@DEnt:
14934     @@@@test:uri:
14935     http://www.example.com/
14936     @@@@test:baseURI:
14937     ftp://ftp.example.com/
14938     @@@@test:value:
14939     <!DOCTYPE p SYSTEM "sys">
14940     <p/>
14941     @@@test:domTree:
14942     document {
14943     document-uri: 'http://www.example.com/';
14944     base-uri: 'ftp://ftp.example.com/';
14945     document-type {
14946     system-id: 'sys';
14947     manakai-declaration-base-uri: 'ftp://ftp.example.com/';
14948     }
14949     element {
14950     node-name: 'p';
14951     base-uri: 'ftp://ftp.example.com/';
14952     }
14953     }
14954     @@XMLTest:
14955     @@@QName: xp.entdecl.baseuri.test
14956     @@@DEnt:
14957     @@@@test:uri:
14958     http://www.example.com/
14959     @@@@test:baseURI:
14960     ftp://ftp.example.com/
14961     @@@@test:value:
14962     <!DOCTYPE p [
14963     <!ENTITY ent SYSTEM "ent">
14964     ]>
14965     <p/>
14966     @@@test:domTree:
14967     document {
14968     document-uri: 'http://www.example.com/';
14969     base-uri: 'ftp://ftp.example.com/';
14970     document-type {
14971     general-entity {
14972     node-name: 'ent';
14973     manakai-declaration-base-uri: 'ftp://ftp.example.com/';
14974     }
14975     }
14976     element {
14977     node-name: 'p';
14978     base-uri: 'ftp://ftp.example.com/';
14979     }
14980     }
14981     @@XMLTest:
14982     @@@QName: xp.notdecl.baseuri.test
14983     @@@DEnt:
14984     @@@@test:uri:
14985     http://www.example.com/
14986     @@@@test:baseURI:
14987     ftp://ftp.example.com/
14988     @@@@test:value:
14989     <!DOCTYPE p [
14990     <!NOTATION not SYSTEM "not">
14991     ]>
14992     <p/>
14993     @@@test:domTree:
14994     document {
14995     document-uri: 'http://www.example.com/';
14996     base-uri: 'ftp://ftp.example.com/';
14997     document-type {
14998     notation {
14999     node-name: 'not';
15000     manakai-declaration-base-uri: 'ftp://ftp.example.com/';
15001     }
15002     }
15003     element {
15004     node-name: 'p';
15005     base-uri: 'ftp://ftp.example.com/';
15006     }
15007     }
15008     @@XMLTest:
15009     @@@QName: xp.doctype.intsubset.pi.baseuri.test
15010     @@@DEnt:
15011     @@@@test:uri:
15012     http://www.example.com/
15013     @@@@test:baseURI:
15014     ftp://ftp.example.com/
15015     @@@@test:value:
15016     <!DOCTYPE p [
15017     <?pi?>
15018     ]>
15019     <p/>
15020     @@@test:domTree:
15021     document {
15022     document-uri: 'http://www.example.com/';
15023     base-uri: 'ftp://ftp.example.com/';
15024     document-type {
15025     pi {
15026     node-name: 'pi';
15027     base-uri: 'ftp://ftp.example.com/';
15028     }
15029     }
15030     element {
15031     node-name: 'p';
15032     base-uri: 'ftp://ftp.example.com/';
15033     }
15034     }
15035    
15036 wakaba 1.30 @@XMLTest:
15037     @@@QName: xp.xmlid.attr.test
15038     @@@DEnt:
15039     @@@@test:value:
15040     <p xml:id="idv"/>
15041 wakaba 1.34 @@@cfg:xml-id: 1
15042 wakaba 1.30 @@@test:domTree:
15043     document {
15044     element {
15045     attribute {
15046     node-name: 'xml:id';
15047     value: 'idv';
15048     schema-type-info: TypeInfo ('http://www.w3.org/TR/REC-xml',
15049     'ID');
15050     specified: true;
15051     }
15052     }
15053     }
15054     @@XMLTest:
15055 wakaba 1.34 @@@QName: xp.xmlid.attr.disabled.test
15056     @@@DEnt:
15057     @@@@test:value:
15058     <p xml:id="idv"/>
15059     @@@cfg:xml-id: 0
15060     @@@test:domTree:
15061     document {
15062     element {
15063     attribute {
15064     node-name: 'xml:id';
15065     value: 'idv';
15066     schema-type-info: TypeInfo (null, null);
15067     specified: true;
15068     }
15069     }
15070     }
15071     @@XMLTest:
15072 wakaba 1.30 @@@QName: xp.xmlid.attr.norm.test
15073     @@@DEnt:
15074     @@@@test:value:
15075     <p xml:id=" $u000Aidv "/>
15076 wakaba 1.34 @@@cfg:xml-id: 1
15077 wakaba 1.30 @@@test:domTree:
15078     document {
15079     element {
15080     attribute {
15081     node-name: 'xml:id';
15082     value: 'idv';
15083     schema-type-info: TypeInfo ('http://www.w3.org/TR/REC-xml',
15084     'ID');
15085     specified: true;
15086     }
15087     }
15088     }
15089     @@XMLTest:
15090 wakaba 1.34 @@@QName: xp.xmlid.attr.norm.disabled.test
15091     @@@DEnt:
15092     @@@@test:value:
15093     <p xml:id=" $u000Aidv "/>
15094     @@@cfg:xml-id: 0
15095     @@@test:domTree:
15096     document {
15097     element {
15098     attribute {
15099     node-name: 'xml:id';
15100     value: ' idv ';
15101     schema-type-info: TypeInfo (null, null);
15102     specified: true;
15103     }
15104     }
15105     }
15106     @@XMLTest:
15107 wakaba 1.30 @@@QName: xp.xmlid.attrdef.test
15108     @@@DEnt:
15109     @@@@test:value:
15110     <!DOCTYPE p [
15111     <!ATTLIST p xml:id ID #IMPLIED>
15112     ]>
15113     <p/>
15114 wakaba 1.34 @@@cfg:xml-id: 1
15115     @@@test:domTree:
15116     document {
15117     document-type {
15118     element-type-definition {
15119     node-name: 'p';
15120     attribute-definition {
15121     node-name: 'xml:id';
15122     declared-type: const (ID_ATTR);
15123     default-type: const (IMPLIED_DEFAULT);
15124     }
15125     }
15126     }
15127     element { }
15128     }
15129     @@XMLTest:
15130     @@@QName: xp.xmlid.attrdef.disabled.test
15131     @@@DEnt:
15132     @@@@test:value:
15133     <!DOCTYPE p [
15134     <!ATTLIST p xml:id ID #IMPLIED>
15135     ]>
15136     <p/>
15137     @@@cfg:xml-id: 0
15138 wakaba 1.30 @@@test:domTree:
15139     document {
15140     document-type {
15141     element-type-definition {
15142     node-name: 'p';
15143     attribute-definition {
15144     node-name: 'xml:id';
15145     declared-type: const (ID_ATTR);
15146     default-type: const (IMPLIED_DEFAULT);
15147     }
15148     }
15149     }
15150     element { }
15151     }
15152     @@XMLTest:
15153     @@@QName: xp.xmlid.attrdef.defaultattr.test
15154     @@@DEnt:
15155     @@@@test:value:
15156     <!DOCTYPE p [
15157     <!ATTLIST p xml:id ID "idv"><!-- invalid -->
15158     ]>
15159     <p/>
15160 wakaba 1.34 @@@cfg:xml-id: 1
15161     @@@test:domTree:
15162     document {
15163     document-type {
15164     element-type-definition {
15165     node-name: 'p';
15166     attribute-definition {
15167     node-name: 'xml:id';
15168     declared-type: const (ID_ATTR);
15169     default-type: const (EXPLICIT_DEFAULT);
15170     node-value: 'idv';
15171     }
15172     }
15173     }
15174     element {
15175     attribute {
15176     node-name: 'xml:id';
15177     schema-type-info: TypeInfo ('http://www.w3.org/TR/REC-xml',
15178     'ID');
15179     value: 'idv';
15180     specified: false;
15181     }
15182     }
15183     }
15184     @@XMLTest:
15185     @@@QName: xp.xmlid.attrdef.defaultattr.disabled.test
15186     @@@DEnt:
15187     @@@@test:value:
15188     <!DOCTYPE p [
15189     <!ATTLIST p xml:id ID "idv"><!-- invalid -->
15190     ]>
15191     <p/>
15192     @@@cfg:xml-id: 0
15193 wakaba 1.30 @@@test:domTree:
15194     document {
15195     document-type {
15196     element-type-definition {
15197     node-name: 'p';
15198     attribute-definition {
15199     node-name: 'xml:id';
15200     declared-type: const (ID_ATTR);
15201     default-type: const (EXPLICIT_DEFAULT);
15202     node-value: 'idv';
15203     }
15204     }
15205     }
15206     element {
15207     attribute {
15208     node-name: 'xml:id';
15209     schema-type-info: TypeInfo ('http://www.w3.org/TR/REC-xml',
15210     'ID');
15211     value: 'idv';
15212     specified: false;
15213     }
15214     }
15215     }
15216    
15217 wakaba 1.34 @@XMLTest:
15218     @@@QName: xp.general.entity.unused.1.test
15219     @@@DEnt:
15220     @@@@test:value:
15221     <!DOCTYPE p [
15222     <!ENTITY mylt "<">
15223     ]>
15224     <p/>
15225     @@@cfg:entity-replacement-tree: 0
15226     @@@test:domTree:
15227     document {
15228     document-type {
15229     general-entity {
15230     node-name: 'mylt';
15231     }
15232     }
15233     element { }
15234     }
15235     @@XMLTest:
15236     @@@QName: xp.general.entity.unused.2.test
15237     @@@DEnt:
15238     @@@@test:value:
15239     <!DOCTYPE p [
15240     <!ENTITY mylt "<">
15241     ]>
15242     <p/>
15243     @@@cfg:entity-replacement-tree: 1
15244     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 1)..(1, 2); }
15245    
15246 wakaba 1.35 @@XMLTest:
15247     @@@QName: xp.dtdecl.readonly.test
15248     @@@DEnt:
15249     @@@@test:value:
15250     <!DOCTYPE p>
15251     <p/>
15252     @@@test:domTree:
15253     document {
15254     document-type {
15255     manakai-read-only: true;
15256     }
15257     element {
15258     manakai-read-only: false;
15259     }
15260     manakai-read-only: false;
15261     }
15262     @@XMLTest:
15263     @@@QName: xp.entity.decl.readonly.1.test
15264     @@@DEnt:
15265     @@@@test:value:
15266     <!DOCTYPE p [
15267     <!ENTITY ent "val">
15268     ]>
15269     <p/>
15270     @@@cfg:entity-replacement-tree: 1
15271     @@@test:domTree:
15272     document {
15273     document-type {
15274     general-entity {
15275     node-name: 'ent';
15276     manakai-read-only: true;
15277     has-replacement-tree: true;
15278     }
15279     manakai-read-only: true;
15280     }
15281     element {
15282     manakai-read-only: false;
15283     }
15284     manakai-read-only: false;
15285     }
15286     @@XMLTest:
15287     @@@QName: xp.entity.decl.readonly.2.test
15288     @@@DEnt:
15289     @@@@test:value:
15290     <!DOCTYPE p [
15291     <!ENTITY ent "val">
15292     ]>
15293     <p/>
15294     @@@test:domTree:
15295     document {
15296     document-type {
15297     general-entity {
15298     node-name: 'ent';
15299     manakai-read-only: true;
15300     }
15301     manakai-read-only: true;
15302     }
15303     element {
15304     manakai-read-only: false;
15305     }
15306     manakai-read-only: false;
15307     }
15308     @@XMLTest:
15309     @@@QName: xp.notation.decl.readonly.test
15310     @@@DEnt:
15311     @@@@test:value:
15312     <!DOCTYPE p [
15313     <!NOTATION ent SYSTEM "val">
15314     ]>
15315     <p/>
15316     @@@test:domTree:
15317     document {
15318     document-type {
15319     notation {
15320     node-name: 'ent';
15321     manakai-read-only: true;
15322     }
15323     manakai-read-only: true;
15324     }
15325     element {
15326     manakai-read-only: false;
15327     }
15328     manakai-read-only: false;
15329     }
15330     @@XMLTest:
15331     @@@QName: xp.dtd.pi.readonly.test
15332     @@@DEnt:
15333     @@@@test:value:
15334     <!DOCTYPE p [
15335     <?pi content?>
15336     ]>
15337     <p/>
15338     @@@test:domTree:
15339     document {
15340     document-type {
15341     pi {
15342     node-name: 'pi';
15343     manakai-read-only: true;
15344     }
15345     manakai-read-only: true;
15346     }
15347     element {
15348     manakai-read-only: false;
15349     }
15350     manakai-read-only: false;
15351     }
15352     @@XMLTest:
15353     @@@QName: xp.dtd.attlist.decl.readonly.test
15354     @@@DEnt:
15355     @@@@test:value:
15356     <!DOCTYPE p [
15357     <!ATTLIST p
15358     attr CDATA #IMPLIED
15359     >
15360     ]>
15361     <p/>
15362     @@@test:domTree:
15363     document {
15364     document-type {
15365     element-type-definition {
15366     node-name: 'p';
15367     attribute-definition {
15368     node-name: 'attr';
15369     manakai-read-only: true;
15370     }
15371     manakai-read-only: true;
15372     }
15373     manakai-read-only: true;
15374     }
15375     element {
15376     manakai-read-only: false;
15377     }
15378     manakai-read-only: false;
15379     }
15380     @@XMLTest:
15381     @@@QName: xp.general.entity.reference.readonly.1.test
15382     @@@DEnt:
15383     @@@@test:value:
15384     <!DOCTYPE p [
15385     <!ENTITY ent "val">
15386     ]>
15387     <p>&ent;</p>
15388     @@@test:domTree:
15389     document {
15390     document-type {
15391     general-entity {
15392     node-name: 'ent';
15393     manakai-read-only: true;
15394     }
15395     manakai-read-only: true;
15396     }
15397     element {
15398     general-entity-reference {
15399     text {
15400     manakai-read-only: true;
15401     }
15402     manakai-read-only: true;
15403     }
15404     manakai-read-only: false;
15405     }
15406     manakai-read-only: false;
15407     }
15408     @@XMLTest:
15409     @@@QName: xp.general.entity.reference.readonly.2.test
15410     @@@DEnt:
15411     @@@@test:value:
15412     <!DOCTYPE p [
15413     <!ENTITY ent "val">
15414     ]>
15415     <p attr="&ent;"/>
15416     @@@test:domTree:
15417     document {
15418     document-type {
15419     general-entity {
15420     node-name: 'ent';
15421     manakai-read-only: true;
15422     }
15423     manakai-read-only: true;
15424     }
15425     element {
15426     attribute {
15427     node-name: 'attr';
15428     general-entity-reference {
15429     text {
15430     manakai-read-only: true;
15431     }
15432     manakai-read-only: true;
15433     }
15434     manakai-read-only: false;
15435     }
15436     manakai-read-only: false;
15437     }
15438     manakai-read-only: false;
15439     }
15440     @@XMLTest:
15441     @@@QName: xp.general.entity.reference.readonly.3.test
15442     @@@DEnt:
15443     @@@@test:value:
15444     <!DOCTYPE p [
15445     <!ENTITY ent1 "val">
15446     <!ENTITY ent2 "&ent1;">
15447     ]>
15448     <p>&ent2;</p>
15449     @@@test:domTree:
15450     document {
15451     document-type {
15452     general-entity {
15453     node-name: 'ent1';
15454     manakai-read-only: true;
15455     }
15456     general-entity {
15457     node-name: 'ent2';
15458     manakai-read-only: true;
15459     }
15460     manakai-read-only: true;
15461     }
15462     element {
15463     general-entity-reference {
15464     general-entity-reference {
15465     text {
15466     manakai-read-only: true;
15467     }
15468     manakai-read-only: true;
15469     }
15470     manakai-read-only: true;
15471     }
15472     manakai-read-only: false;
15473     }
15474     manakai-read-only: false;
15475     }
15476    
15477 wakaba 1.26 @@PerlDef:
15478 wakaba 1.42 my $impl = $Message::DOM::ImplementationRegistry->get_dom_implementation ({
15479 wakaba 1.26 'Core' => '3.0',
15480     'XML' => '3.0',
15481     'XMLVersion' => ['1.0', '1.1'],
15482     });
15483    
15484     for my $test_data (@$TestData) {
15485 wakaba 1.34 my $parser = <Class::ManakaiXMLParser>->new ($impl);
15486    
15487 wakaba 1.26 $test->start_new_test ($test_data->{uri});
15488     my $doc_ent = $test_data->{entity}->{$test_data->{root_uri}};
15489     my $not_ok;
15490    
15491 wakaba 1.34 ## -- DOM Configuration Parameters
15492    
15493     my $pcfg = $parser->dom_config;
15494     for (keys %{$test_data->{dom_config}}) {
15495     $pcfg->set_parameter ($_ => $test_data->{dom_config}->{$_});
15496     }
15497    
15498     $pcfg->set_parameter ('error-handler' => sub ($$) {
15499 wakaba 1.26 my (undef, $err) = @_;
15500     my $err_type = $err->type;
15501     if ($test_data->{dom_error}->{$err_type}) {
15502     $test->assert_error_equals
15503     (actual_value => $err,
15504     expected_hash => shift @{$test_data->{dom_error}
15505     ->{$err_type}});
15506     } else { # Uncatched error
15507     warn $err;
15508     unless ($err->severity == <C::c|DOMError.SEVERITY_WARNING>) {
15509     $test->failure_comment ('Unexpected error |'.$err->type.'|');
15510     $not_ok = true;
15511     }
15512     }
15513     return true; # continue as far as possible
15514     });
15515    
15516 wakaba 1.34 ## -- Input Data
15517    
15518 wakaba 1.27 my $input = {string_data => \$doc_ent->{<Q::test:value>},
15519     system_id => $doc_ent->{<Q::test:uri>},
15520     base_uri => $doc_ent->{<Q::test:baseURI>}};
15521 wakaba 1.34
15522     ## -- Test and Result
15523    
15524 wakaba 1.26 if ($test_data->{dom_tree}) { # Successful test
15525 wakaba 1.31 my $doc;
15526 wakaba 1.26 try {
15527 wakaba 1.31 $doc = $parser->parse ($input);
15528 wakaba 1.26 $test->assert_dom_tree_equals
15529     (actual_value => $doc,
15530     expected_hash => $test_data->{dom_tree});
15531     for (values %{$test_data->{dom_error}||{}}) {
15532     if (@$_) {
15533     $test->failure_comment
15534     (@$_.' |DOMError|s of type |'.
15535     $_->[0]->{type}->{value}.'| are not reported');
15536     $not_ok = true;
15537     }
15538     }
15539     $not_ok ? $test->not_ok : $test->ok;
15540 wakaba 1.31 undef $doc;
15541 wakaba 1.26 } catch Message::Util::IF::DTException with {
15542 wakaba 1.31 require 'manakai/mndebug.pl';
15543     manakai::mndebug::dump ($doc);
15544 wakaba 1.26 } catch Message::DOM::IF::LSException with {
15545     # not_ok
15546     } otherwise {
15547     my $err = shift;
15548     warn $err;
15549     $test->not_ok;
15550     };
15551     } else {
15552 wakaba 1.31 my $doc;
15553 wakaba 1.26 try {
15554 wakaba 1.31 $doc = $parser->parse ($input);
15555 wakaba 1.26 } catch Message::Util::IF::DTException with {
15556 wakaba 1.31 require 'manakai/mndebug.pl';
15557     manakai::mndebug::dump ($doc);
15558 wakaba 1.26 } catch Message::DOM::IF::LSException with {
15559     #
15560     } otherwise {
15561     my $err = shift;
15562     warn $err;
15563     $test->not_ok;
15564     };
15565     for (values %{$test_data->{dom_error}||{}}) {
15566     if (@$_) {
15567     $test->failure_comment
15568     (@$_.' |DOMError|s of type |'.
15569     $_->[0]->{type}->{value}.'| are not reported');
15570     $not_ok = true;
15571     }
15572     }
15573     $not_ok ? $test->not_ok : $test->ok;
15574 wakaba 1.12 }
15575 wakaba 1.5 }
15576 wakaba 1.6
15577 wakaba 1.37 @XMLTests:
15578     @@QName: xp.byteStream.tests
15579    
15580     @@XMLTest:
15581     @@@QName: xp.labeled.utf-8.test
15582     @@@DEnt:
15583     @@@@xp:encoding: utf-8
15584     @@@@test:value:
15585     <p/>
15586     @@@test:domTree:
15587     document {
15588     input-encoding: 'utf-8';
15589     xml-encoding: null;
15590     element {
15591     node-name: 'p';
15592     }
15593     }
15594     @@XMLTest:
15595     @@@QName: xp.labeled.utf-16.be.test
15596     @@@DEnt:
15597     @@@@xp:encoding: utf-16
15598     @@@@test:value:
15599     $u00FE$u00FF$u0000<$u0000p$u0000/$u0000>
15600     @@@test:domTree:
15601     document {
15602     xml-encoding: null;
15603     input-encoding: 'utf-16';
15604     element {
15605     node-name: 'p';
15606     }
15607     }
15608     @@XMLTest:
15609     @@@QName: xp.labeled.utf-16.le.test
15610     @@@DEnt:
15611     @@@@xp:encoding: utf-16
15612     @@@@test:value:
15613     $u00FF$u00FE<$u0000p$u0000/$u0000>$u0000
15614     @@@test:domTree:
15615     document {
15616     xml-encoding: null;
15617     input-encoding: 'utf-16';
15618     element {
15619     node-name: 'p';
15620     }
15621     }
15622     @@XMLTest:
15623     @@@QName: xp.labeled.utf-16.nobom.test
15624     @@@DEnt:
15625     @@@@xp:encoding: utf-16
15626     @@@@test:value:
15627     <$u0000p$u0000/$u0000>$u0000
15628     @@@c:erred: <[[xp|fatal-utf-16-no-bom]]> {}
15629     @@XMLTest:
15630     @@@QName: xp.labeled.unknown.test
15631     @@@DEnt:
15632     @@@@xp:encoding: x-unknown-encoding-name
15633     @@@@test:value:
15634     <p/>
15635     @@@c:erred: <[[xp|fatal-unprocessable-encoding]]> {}
15636     @@XMLTest:
15637     @@@QName: xp.unlabeled.encdecl.unknown.test
15638     @@@DEnt:
15639     @@@@test:value:
15640     <?xml version="1.0" encoding="x-unknown-encoding-name"?>
15641     <p/>
15642     # @@@c:erred: <[[xp|fatal-unprocessable-encoding]]> {}
15643     @@@c:erred: <[[xp|fatal-encoding-mismatch]]> {}
15644     @@XMLTest:
15645     @@@QName: xp.labeled.utf-8.illegal.test
15646     @@@DEnt:
15647     @@@@xp:encoding: utf-8
15648     @@@@test:value:
15649     <p/$u00A0>
15650     @@@c:erred: <[[xp|fatal-illegal-byte-sequence]]> {}
15651     @@XMLTest:
15652     @@@QName: xp.unlabeled.encdecl.utf-8.illegal.test
15653     @@@DEnt:
15654     @@@@test:value:
15655     <?xml version="1.0" encoding="utf-8"?>
15656     <p/$u00A0>
15657     @@@c:erred: <[[xp|fatal-illegal-byte-sequence]]> {}
15658     @@XMLTest:
15659     @@@QName: xp.unlabeled.utf-8.illegal.test
15660     @@@DEnt:
15661     @@@@test:value:
15662     <p/$u00A0>
15663     @@@c:erred: <[[xp|fatal-illegal-byte-sequence]]> {}
15664     @@XMLTest:
15665     @@@QName: xp.mismatch.encdecl-as-utf-16.utf-8.test
15666     @@@DEnt:
15667     @@@@test:value:
15668     <?xml version="1.0" encoding="utf-16"?>
15669     <p/>
15670     @@@c:erred: <[[xp|fatal-encoding-mismatch]]> {}
15671     @@XMLTest:
15672     @@@QName: xp.mismatch.labeled-as-utf-16.utf-8.test
15673     @@@DEnt:
15674     @@@@xp:encoding: utf-16
15675     @@@@test:value:
15676     <p/>
15677     @@@c:erred: <[[xp|fatal-utf-16-no-bom]]> {}
15678     @@XMLTest:
15679     @@@QName: xp.labeled-as-utf-8.encdecl-utf-16.test
15680     @@@DEnt:
15681     @@@@xp:encoding: utf-8
15682     @@@@test:value:
15683     <?xml version="1.0" encoding="utf-16"?>
15684     <p/>
15685     @@@test:domTree:
15686     document {
15687     xml-encoding: 'utf-16';
15688     input-encoding: 'utf-8';
15689     element { }
15690     }
15691    
15692     @@PerlDef:
15693 wakaba 1.42 my $impl = $Message::DOM::ImplementationRegistry->get_dom_implementation ({
15694 wakaba 1.37 'Core' => '3.0',
15695     'XML' => '3.0',
15696     'XMLVersion' => ['1.0', '1.1'],
15697     });
15698    
15699     for my $test_data (@$TestData) {
15700     my $parser = <Class::ManakaiXMLParser>->new ($impl);
15701    
15702     $test->start_new_test ($test_data->{uri});
15703     my $doc_ent = $test_data->{entity}->{$test_data->{root_uri}};
15704     my $not_ok;
15705    
15706     ## -- DOM Configuration Parameters
15707    
15708     my $pcfg = $parser->dom_config;
15709     for (keys %{$test_data->{dom_config}}) {
15710     $pcfg->set_parameter ($_ => $test_data->{dom_config}->{$_});
15711     }
15712    
15713     $pcfg->set_parameter ('error-handler' => sub ($$) {
15714     my (undef, $err) = @_;
15715     my $err_type = $err->type;
15716     if ($test_data->{dom_error}->{$err_type}) {
15717     $test->assert_error_equals
15718     (actual_value => $err,
15719     expected_hash => shift @{$test_data->{dom_error}
15720     ->{$err_type}});
15721     } else { # Uncatched error
15722     warn $err;
15723     unless ($err->severity == <C::c|DOMError.SEVERITY_WARNING>) {
15724     $test->failure_comment ('Unexpected error |'.$err->type.'|');
15725     $not_ok = true;
15726     }
15727     }
15728     return false;
15729     });
15730    
15731     ## -- Input Data
15732    
15733     open my $byte, '<', \$doc_ent->{<Q::test|value>};
15734     my $input = {byte_stream => $byte,
15735     system_id => $doc_ent->{<Q::test:uri>},
15736     base_uri => $doc_ent->{<Q::test:baseURI>},
15737     encoding => $doc_ent->{<Q::xp|encoding>}};
15738    
15739     ## -- Test and Result
15740    
15741     if ($test_data->{dom_tree}) { # Successful test
15742     my $doc;
15743     try {
15744     $doc = $parser->parse ($input);
15745     $test->assert_dom_tree_equals
15746     (actual_value => $doc,
15747     expected_hash => $test_data->{dom_tree});
15748     for (values %{$test_data->{dom_error}||{}}) {
15749     if (@$_) {
15750     $test->failure_comment
15751     (@$_.' |DOMError|s of type |'.
15752     $_->[0]->{type}->{value}.'| are not reported');
15753     $not_ok = true;
15754     }
15755     }
15756     $not_ok ? $test->not_ok : $test->ok;
15757     undef $doc;
15758     } catch Message::Util::IF::DTException with {
15759     require 'manakai/mndebug.pl';
15760     manakai::mndebug::dump ($doc);
15761     } catch Message::DOM::IF::LSException with {
15762     # not_ok
15763     } otherwise {
15764     my $err = shift;
15765     warn $err;
15766     $test->not_ok;
15767     };
15768     } else {
15769     my $doc;
15770     try {
15771     $doc = $parser->parse ($input);
15772     } catch Message::Util::IF::DTException with {
15773     require 'manakai/mndebug.pl';
15774     manakai::mndebug::dump ($doc);
15775     } catch Message::DOM::IF::LSException with {
15776     #
15777     } otherwise {
15778     my $err = shift;
15779     warn $err;
15780     $test->not_ok;
15781     };
15782     for (values %{$test_data->{dom_error}||{}}) {
15783     if (@$_) {
15784     $test->failure_comment
15785     (@$_.' |DOMError|s of type |'.
15786     $_->[0]->{type}->{value}.'| are not reported');
15787     $not_ok = true;
15788     }
15789     }
15790     $not_ok ? $test->not_ok : $test->ok;
15791     }
15792     }
15793    
15794    
15795 wakaba 1.6 @ResourceDef:
15796 wakaba 1.19 @@QName: getEmptyEntityState
15797     @@rdf:type: DISPerl|InlineCode
15798     @@ForCheck: ManakaiDOM|ForClass
15799     @@PerlDef:
15800     {reptxt => \'', line => 1, column => 1, pos => 0,
15801 wakaba 1.27 is_externally_declared => true, name => $name,
15802     fh => do {
15803     open my $empty, '<', \'';
15804     $empty;
15805     },
15806     close_file => sub { }}
15807 wakaba 1.19
15808     @ResourceDef:
15809 wakaba 1.6 @@QName: getCopyOfEntityState
15810     @@rdf:type: DISPerl|InlineCode
15811     @@ForCheck: ManakaiDOM|ForClass
15812     @@PerlDef:
15813     {%{$self->{$entity_type}->{$entity_name}},
15814 wakaba 1.27 line => 1, column => 1, pos => 0,
15815     fh => do {
15816     require IO::String;
15817     IO::String->new
15818     (${$self->{$entity_type}->{$entity_name}->{reptxt}});
15819     ## TODO: External entities.
15820     },
15821     close_file => sub { }}
15822 wakaba 1.1 ##ManakaiXMLParser
15823 wakaba 1.5
15824     ElementTypeBinding:
15825 wakaba 1.27 @Name: Test
15826     @ElementType:
15827     dis:ResourceDef
15828     @ShadowContent:
15829     @@ForCheck: ManakaiDOM|ForClass
15830     @@rdf:type: test|StandaloneTest
15831    
15832     ElementTypeBinding:
15833 wakaba 1.5 @Name: XMLTests
15834     @ElementType:
15835     dis:ResourceDef
15836     @ShadowContent:
15837     @@ForCheck: ManakaiDOM|ForClass
15838     @@rdf:type: test|ParserTestSet
15839    
15840     ElementTypeBinding:
15841     @Name: XMLTest
15842     @ElementType:
15843     dis:ResourceDef
15844     @ShadowContent:
15845     @@ForCheck: ManakaiDOM|ForClass
15846     @@rdf:type: test|ParserTest
15847    
15848     ElementTypeBinding:
15849     @Name: DEnt
15850     @ElementType:
15851     dis:ResourceDef
15852     @ShadowContent:
15853     @@rdf:type: test|RootEntity
15854    
15855     ElementTypeBinding:
15856     @Name: Ent
15857     @ElementType:
15858     dis:ResourceDef
15859     @ShadowContent:
15860     @@rdf:type: test|Entity
15861 wakaba 1.1
15862 wakaba 1.3 ResourceDef:
15863     @QName: xp|get-location-from-token
15864     @rdf:type: DISPerl|BlockCode
15865     @enDesc:
15866     Creates a <IF::DOMCore:DOMLocator> object from a token.
15867     @PerlDef:
15868 wakaba 1.14 my $__d = $token->{type} ne '#EOF'
15869     ? $token->{location}->{char_d}
15870     : 0;
15871 wakaba 1.15 $__d -= $token->{location_d} if $token->{location_d};
15872 wakaba 1.3 $result = {
15873 wakaba 1.14 utf32_offset => $token->{location}->{pos} - $__d,
15874     line_number => $token->{location}->{line},
15875     column_number => $token->{location}->{column} - $__d,
15876 wakaba 1.3 };
15877 wakaba 1.14 $result->{utf32_offset} = 0 if $result->{utf32_offset} < 0;
15878     $result->{column_number} = 0 if $result->{column_number} < 0;
15879     ## 0 or 1, which should be?
15880 wakaba 1.3 @For: ManakaiDOM|ManakaiDOM3
15881 wakaba 1.1
15882     ElementTypeBinding:
15883     @Name: RuleDef
15884     @ElementType:
15885     dis:ResourceDef
15886     @ShadowContent:
15887     @@ForCheck: ManakaiDOM|ForClass
15888     @@rdf:type: Muf2003|RuleDefClass
15889    
15890     ElementTypeBinding:
15891     @Name: RuleParam
15892     @ElementType:
15893     dis:ResourceDef
15894     @ShadowContent:
15895     @@rdf:type: Muf2003|RuleParameter
15896    
15897     ElementTypeBinding:
15898     @Name: enImplNote
15899     @ElementType:
15900     dis:ImplNote
15901     @ShadowContent:
15902     @@lang:en
15903    
15904     ElementTypeBinding:
15905 wakaba 1.24 @Name: WFErrDef
15906 wakaba 1.1 @ElementType:
15907     dis:ResourceDef
15908     @ShadowContent:
15909     @@rdf:type: DOMCore|DOMErrorType
15910     @@For: ManakaiDOM|DOM3
15911     @@ecore:textFormatter: ManakaiXMLParserExceptionFormatter
15912 wakaba 1.24 @@c:severity: c|SEVERITY_FATAL_ERROR
15913 wakaba 1.1
15914 wakaba 1.3 ElementTypeBinding:
15915 wakaba 1.24 @Name: FatalErrDef
15916 wakaba 1.3 @ElementType:
15917     dis:ResourceDef
15918     @ShadowContent:
15919     @@rdf:type: DOMCore|DOMErrorType
15920     @@For: ManakaiDOM|DOM3
15921     @@ecore:textFormatter: ManakaiXMLParserExceptionFormatter
15922 wakaba 1.24 @@c:severity: c|SEVERITY_FATAL_ERROR
15923    
15924     ElementTypeBinding:
15925 wakaba 1.26 @Name: NSFatalErrDef
15926     @ElementType:
15927     dis:ResourceDef
15928     @ShadowContent:
15929     @@rdf:type: c|DOMErrorType
15930     @@For: ManakaiDOM|DOM3
15931     @@ecore:textFormatter: ManakaiXMLParserExceptionFormatter
15932     @@c:severity: c|SEVERITY_FATAL_ERROR
15933    
15934     ElementTypeBinding:
15935     @Name: NSCErrDef
15936     @ElementType:
15937     dis:ResourceDef
15938     @ShadowContent:
15939     @@rdf:type: c|DOMErrorType
15940     @@For: ManakaiDOM|DOM3
15941     @@ecore:textFormatter: ManakaiXMLParserExceptionFormatter
15942     @@c:severity: c|SEVERITY_FATAL_ERROR
15943    
15944     ElementTypeBinding:
15945 wakaba 1.24 @Name: VCErrDef
15946     @ElementType:
15947     dis:ResourceDef
15948     @ShadowContent:
15949     @@rdf:type: c|DOMErrorType
15950     @@For: ManakaiDOM|DOM3
15951     @@ecore:textFormatter: ManakaiXMLParserExceptionFormatter
15952     @@c:severity: c|SEVERITY_ERROR
15953    
15954     ElementTypeBinding:
15955     @Name: ErrDef
15956     @ElementType:
15957     dis:ResourceDef
15958     @ShadowContent:
15959     @@rdf:type: c|DOMErrorType
15960     @@For: ManakaiDOM|DOM3
15961     @@ecore:textFormatter: ManakaiXMLParserExceptionFormatter
15962     @@c:severity: c|SEVERITY_ERROR
15963 wakaba 1.3
15964 wakaba 1.16 ElementTypeBinding:
15965 wakaba 1.24 @Name: WarnDef
15966 wakaba 1.16 @ElementType:
15967     dis:ResourceDef
15968     @ShadowContent:
15969 wakaba 1.24 @@rdf:type: c|DOMErrorType
15970 wakaba 1.16 @@For: ManakaiDOM|DOM3
15971     @@ecore:textFormatter: ManakaiXMLParserExceptionFormatter
15972 wakaba 1.24 @@c:severity: c|SEVERITY_WARNING
15973 wakaba 1.16
15974 wakaba 1.3 WFErrDef:
15975     @QName: xp|wf-syntax-error
15976     @enDesc:
15977     The entity does not match to the production rule; it is not
15978     well-formed.
15979     @enMufDef:
15980     |%xp-error-token-type;|%xp-error-token-value
15981     (prefix => { (|}, suffix => {|)}); is not
15982     allowed%xp-error-lines (prefix => { (|}, suffix => {|)});
15983     @ecore:hasParameter:
15984     @@@: xp|error-token
15985     @@enDesc:
15986     The token that is not allowed.
15987    
15988     WFErrDef:
15989     @QName: xp|wf-pi-target-is-xml
15990     @enDesc:
15991     A processing instruction has its <CODE::PITarget> of
15992     <XML::xml> (in any case) which is not allowed.
15993     @enMufDef:
15994     Processing instruction target name cannot be |%p
15995     (name => {<Q::xp|name>});|
15996     @ecore:hasParameter:
15997     @@@: xp|error-token
15998     @@enDesc:
15999     The token that contains the name.
16000     @ecore:hasParameter:
16001     @@@: xp|name
16002     @@enDesc:
16003     A string that is specified as target name of the
16004     processing instruction.
16005     @ecore:hasParameter: xp|parent
16006    
16007     WFErrDef:
16008     @QName: xp|wf-no-end-tag
16009     @enDesc:
16010     An end-tag is not found.
16011     @enMufDef:
16012     End-tag |</%p (name => {<Q::xp|expected-element-type>});>| is required
16013     @ecore:hasParameter: xp|error-token
16014     @ecore:hasParameter:
16015     @@@: xp|node
16016     @@enDesc:
16017     The element node that is not closed.
16018     @ecore:hasParameter:
16019     @@@: xp|expected-element-type
16020     @@enDesc:
16021     The element type name of the element that is not closed.
16022    
16023     WFErrDef:
16024     @QName: xp|wf-unsupported-xml-version
16025     @enDesc:
16026     The XML version specified in the version declaration is not supported.
16027     @enMufDef:
16028     XML version |%p (name => {<Q::infoset|version>});| is not supported
16029     @ecore:hasParameter: xp|bad-token
16030     @ecore:hasParameter:
16031     @@@: xp|parent
16032     @@enDesc:
16033     The document node.
16034     @ecore:hasParameter:
16035     @@@: infoset|version
16036     @@enDesc:
16037     The specified XML version.
16038    
16039     WFErrDef:
16040     @QName: xp|wf-malformed-enc-name
16041     @enDesc:
16042     An <XA::encoding> pseudo-attribute value does not match
16043     to the procduction rule <CODE::EncName>.
16044     @enMufDef:
16045     Encoding name |%p (name => {<Q::xp|name>});| is not allowed
16046     @ecore:hasParameter: xp|error-token
16047     @ecore:hasParameter:
16048     @@@: xp|parent
16049     @@enDesc: The document node.
16050     @ecore:hasParameter:
16051     @@@: xp|name
16052     @@enDesc:
16053     The <XA::encoding> value.
16054    
16055     WFErrDef:
16056     @QName: xp|wf-malformed-xml-standalone
16057     @enDesc:
16058     An <XA::standalone> pseudo-attribute value is neither <XML::yes>
16059     or <XML::no>.
16060     @enMufDef:
16061     |standalone| pseudo-attribute value |%p (name => {<Q::xp|name>});|
16062     is not allowed
16063     @ecore:hasParameter: xp|error-token
16064     @ecore:hasParameter:
16065     @@@: xp|parent
16066     @@enDesc: The document node.
16067     @ecore:hasParameter:
16068     @@@: xp|name
16069     @@enDesc:
16070     The <XA::standalone> value.
16071    
16072     WFErrDef:
16073     @QName: xp|wf-legal-literal-character
16074     @enDesc:
16075     Each character in XML entity must match to the production
16076     rule <CODE::Char - RestrictedChar>.
16077     @enMufDef:
16078     Character %character-code-point
16079     (v => {<Q::xp|character-number>}); is not allowed
16080     @ecore:hasParameter:
16081     @@@: xp|character-number
16082     @@enDesc:
16083     The code position of the character being referred.
16084    
16085     WFErrDef:
16086 wakaba 1.26 @QName: xp|wf-invalid-character-in-node-name
16087     @c:errorType:
16088     @@@: wf-invalid-character-in-node-name
16089     @@ContentType: DISCore|String
16090     @enDesc:
16091     If a name contains a character that is not a name character
16092     in the XML version in use, or if the first character of a name
16093     is not a name start character in the XML version in use.
16094    
16095     {NOTE::
16096     When an invalid character is encountered in an entity
16097     where a <CODE::Name> is expected, what type of error
16098     is issued is implementation dependent: <Q::xp|wf-syntax-error>,
16099     <Q::xp|wf-pi-target-is-xml> or other error might be reported.
16100     }
16101    
16102     {NOTE::
16103     This error type is defined in DOM Level 3 Core and Load and Save
16104     modules and redefined herein for the purpose of XML parser.
16105     }
16106     @enMufDef:
16107     Character %character-code-point
16108     (v => {<Q::xp|character-number>}); is not allowed in name
16109     @ecore:hasParameter: xp|error-token
16110     @ecore:hasParameter:
16111     @@@: xp|character-number
16112     @@enDesc:
16113     The code position of the character being referred.
16114     @ecore:hasParameter:
16115     @@@: infoset|version
16116     @@enDesc:
16117     The version of XML in use.
16118    
16119     WFErrDef:
16120 wakaba 1.25 @QName: xp|wf-pes-in-internal-subset
16121     @enDesc:
16122     In the internal subset of the DTD, parameter entity references
16123     <kwd:MUST-NOT> occur within markup declarations.
16124     @enMufDef:
16125     Parameter entity reference |%percent;%param (name => {<Q::xp|name>});;|
16126     cannot occur within a markup declaration
16127     @ecore:hasParameter: xp|error-token
16128     @ecore:hasParameter:
16129     @@@: xp|name
16130     @@enDesc:
16131     The name of the parameter entity.
16132    
16133     WFErrDef:
16134 wakaba 1.3 @QName: xp|wf-element-type-match
16135 wakaba 1.1 @enDesc:
16136 wakaba 1.3 The <CODE::Name> in an element's end-tag must match the element type
16137     in the start-tag.
16138     @enMufDef:
16139     End-tag |</%p (name => {<Q::xp|actual-element-type>});>| does
16140     not match to start-tag |<%p (name => {<Q::xp|expected-element-type>});>|
16141     @ecore:hasParameter: xp|error-token
16142     @ecore:hasParameter:
16143     @@@: xp|node
16144     @@enDesc:
16145     The current opening element node.
16146     @ecore:hasParameter:
16147     @@@: xp|expected-element-type
16148     @@enDesc:
16149     The element type name of the current element.
16150     @ecore:hasParameter:
16151     @@@: xp|actual-element-type
16152     @@enDesc:
16153     The <CODE::Name> occurs in the end-tag.
16154    
16155     WFErrDef:
16156     @QName: xp|wf-unique-att-spec
16157     @enDesc:
16158     An attribute name <kwd:MUST-NOT> appear more than once in
16159     the same start-tag or empty-element tag.
16160 wakaba 1.1 @enMufDef:
16161 wakaba 1.3 Attribute |%p (name => {<Q::xp|name>});| is specified more
16162     than once in the same tag
16163     @ecore:hasParameter: xp|error-token
16164     @ecore:hasParameter:
16165     @@@: xp|name
16166     @@enDesc:
16167     The name of the attribute.
16168 wakaba 1.18
16169     WFErrDef:
16170     @QName: xp|wf-no-external-entity-references
16171     @enDesc:
16172     Attribute values <kwd:MUST-NOT> contain direct or indirect
16173     entity references to external entities.
16174     @enMufDef:
16175     External entity |%p (name => {<Q::xp|name>});| is referenced
16176     in an attribute value literal
16177     @ecore:hasParameter: xp|error-token
16178     @ecore:hasParameter:
16179     @@@: xp|name
16180     @@enDesc:
16181     The name of the entity.
16182    
16183     WFErrDef:
16184     @QName: xp|wf-no-lt-in-attribute-values
16185     @enDesc:
16186     The replacement text of any entity referred to directly or indirectly
16187     in an attribute value literal <kwd:MUST-NOT> contain a
16188     <CHAR::LESS-THAN SIGN>.
16189     @enMufDef:
16190     Entity replacement text cannot contain a
16191     |LESS-THAN SIGN| since it is referenced from an attribute
16192     value literal
16193     @ecore:hasParameter: xp|error-token
16194 wakaba 1.3
16195 wakaba 1.25 WarnDef:
16196     @QName: xp|warning-attribute-definition-ignored
16197     @enDesc:
16198     An attribute definition is ignored because the same attribute
16199     is declared before.
16200     @enMufDef:
16201     Attribute definition for |%p (name => {<Q::xp|name>});| is ignored
16202     @ecore:hasParameter: xp|error-token
16203     @ecore:hasParameter:
16204     @@@: xp|name
16205     @@enDesc:
16206     The name of the attribute.
16207    
16208 wakaba 1.3 WFErrDef:
16209     @QName: xp|wf-legal-character
16210     @enDesc:
16211     Characters referred to using character references <kwd:MUST>
16212     match the production for <CODE::Char>.
16213     @enMufDef:
16214     Reference to character %character-code-point
16215     (v => {<Q::xp|character-number>}); is not allowed
16216     @ecore:hasParameter: xp|error-token
16217     @ecore:hasParameter:
16218     @@@: xp|character-number
16219     @@enDesc:
16220     The code position of the character being referred.
16221     @ecore:hasParameter:
16222     @@@: xp|parent
16223     @@enDesc:
16224     The parent node in which the character reference has
16225     occurred, if available.
16226 wakaba 1.19
16227     WFErrDef:
16228     @QName: xp|wf-entity-declared
16229     @enDesc:
16230     {P:: In a document
16231    
16232     - without any DTD,
16233    
16234     - with only an internal DTD subset that contains no parameter
16235     entity references, or
16236    
16237     - with <XML::standalone="yes">,
16238    
16239     for an entity reference that does not occur within the external
16240     subset or a parameter entity, the <CODE::Name> given in the
16241     entity reference <kwd:MUST> match the <CODE::Name> does not
16242     occur within the external subset or a parameter entity,
16243     except that five predefined character entities need not
16244     be declared. The declaration of a general entity <kwd:MUST>
16245     precede any reference to it which appears in a default value
16246     in an attribute list declaration.
16247     @enMufDef:
16248     Entity |%p (name => {<Q::xp|name>});| must be declared
16249     in the internal subset
16250 wakaba 1.23 @ecore:hasParameter: xp|error-token
16251     @ecore:hasParameter:
16252     @@@: xp|name
16253     @@enDesc:
16254     The name of the entity.
16255    
16256     WFErrDef:
16257     @QName: xp|wf-parsed-entity
16258     @enDesc:
16259     An entity reference <kwd:MUST-NOT> contain the name of an
16260     unparsed entity.
16261     @enMufDef:
16262     Entity |%p (name => {<Q::xp|name>});| is an unparsed entity
16263     @ecore:hasParameter: xp|error-token
16264     @ecore:hasParameter:
16265     @@@: xp|name
16266     @@enDesc:
16267     The name of the entity.
16268    
16269     WFErrDef:
16270     @QName: xp|wf-no-recursion
16271     @enDesc:
16272     A parsed entity <kwd:MUST-NOT> contain a recursive reference
16273     to itself, either directly or indirectly.
16274     @enMufDef:
16275     Entity |%p (name => {<Q::xp|name>});| is recursively referenced
16276 wakaba 1.19 @ecore:hasParameter: xp|error-token
16277     @ecore:hasParameter:
16278     @@@: xp|name
16279     @@enDesc:
16280     The name of the entity.
16281 wakaba 1.16
16282     FatalErrDef:
16283     @QName: xp|fatal-xml11-end-of-line-in-xml-declaration
16284     @enDesc:
16285     An end-of-line character <CODE::U+0085> or <CODE::U+2028> is appeared
16286     within an XML declaration or text declaration.
16287     @enMufDef:
16288     End-of-line character %character-code-point
16289     (v => {<Q::xp|character-number>}); cannot be used within the
16290     XML or text declaration
16291     @ecore:hasParameter:
16292     @@@: xp|character-number
16293     @@enDesc:
16294     The code position of the end-of-line character.
16295 wakaba 1.24
16296     ErrDef:
16297     @QName: xp|error-internal-predefined-entity
16298     @enDesc:
16299     A general entity declaration whose <CODE::Name> equals to one
16300     of predefined entities <kwd:MUST> declare it as an internal entity.
16301     @enMufDef:
16302     Entity |%p (name => {<Q::xp|name>});| must be declared as an
16303     internal entity
16304     @ecore:hasParameter: xp|error-token
16305     @ecore:hasParameter:
16306     @@@: xp|name
16307     @@enDesc:
16308     The name of the entity.
16309    
16310     ErrDef:
16311     @QName: xp|error-malformed-predefined-entity
16312     @enDesc:
16313     A general entity declaration whose <CODE::Name> equals to one
16314     of predefined entities <kwd:MUST> declare it as a data
16315     character for the entity.
16316     @enMufDef:
16317     Entity declaration for |%p (name => {<Q::xp|name>});|
16318     (replacement text |%p (name => {<Q::xp|replacement-text>});|) is malformed
16319     @ecore:hasParameter: xp|error-token
16320     @ecore:hasParameter:
16321     @@@: xp|name
16322     @@enDesc:
16323     The name of the entity.
16324     @ecore:hasParameter:
16325     @@@: xp|replacement-text
16326     @@enDesc:
16327     The replacement text of the entity declaration.
16328    
16329     WarnDef:
16330     @QName: xp|warning-entity-declaration-ignored
16331     @enDesc:
16332     An entity declaration is ignored because the same entity
16333     is declared before.
16334     @enMufDef:
16335     Entity declaration for |%p (name => {<Q::xp|name>});| is ignored
16336     @ecore:hasParameter: xp|error-token
16337     @ecore:hasParameter:
16338     @@@: xp|name
16339     @@enDesc:
16340     The name of the entity.
16341    
16342     VCErrDef:
16343     @QName: xp|vc-unique-notation-name
16344     @enDesc:
16345     A <CODE::Name> <kwd:MUST-NOT> be declared in more than
16346     one notation declaration.
16347     @enMufDef:
16348     Notation |%p (name => {<Q::xp|name>});| is already declared
16349     @ecore:hasParameter: xp|error-token
16350     @ecore:hasParameter:
16351     @@@: xp|name
16352     @@enDesc:
16353     The name of the notation.
16354 wakaba 1.25
16355     WarnDef:
16356     @QName: xp|warning-entity-declaration-not-processed
16357     @enDesc:
16358     An entity declaration is not processed because there
16359     is a reference to parameter entity before the declaration
16360     and the entity is not read.
16361     @enMufDef:
16362     Entity declaration for |%p (name => {<Q::xp|name>});| is not processed
16363     @ecore:hasParameter: xp|error-token
16364     @ecore:hasParameter:
16365     @@@: xp|name
16366     @@enDesc:
16367     The name of the entity.
16368    
16369     WarnDef:
16370     @QName: xp|warning-attribute-definition-not-processed
16371     @enDesc:
16372     An attribute definition is not processed because there
16373     is a reference to parameter entity before the declaration
16374     and the entity is not read.
16375     @enMufDef:
16376     Attribute definition for |%p (name => {<Q::xp|name>});| is not processed
16377     @ecore:hasParameter: xp|error-token
16378     @ecore:hasParameter:
16379     @@@: xp|name
16380     @@enDesc:
16381     The name of the attribute.
16382 wakaba 1.26
16383 wakaba 1.37 FatalErrDef:
16384     @QName: xp|fatal-illegal-byte-sequence
16385     @enDesc:
16386     An XML entity is determined to be in a certain encoding but
16387     contains byte sequences that are not legal in that encoding.
16388     @enMufDef:
16389     Illegal byte sequence
16390     @enImplNote: dump
16391     @ecore:hasParameter: xp|byte-sequence
16392     @ecore:hasParameter: xp|code-state
16393    
16394     XWParam:
16395     @QName: xp|byte-sequence
16396     @enDesc:
16397     A reference to the byte string that contains an error.
16398    
16399     XWParam:
16400     @QName: xp|code-state
16401     @enDesc:
16402     A string that identifies the state defined in the coded character set
16403     in which an error is encoutnered.
16404    
16405     WarnDef:
16406     @QName: xp|warning-unassigned-code-point
16407     @enDesc:
16408     If the entity contains an unassigned code point.
16409     @enMufDef:
16410     Unassigned code point found
16411     @enImplNote: dump
16412     @ecore:hasParameter: xp|byte-sequence
16413    
16414     FatalErrDef:
16415     @QName: xp|fatal-unprocessable-encoding
16416     @enDesc:
16417     When an XML processor encounters an entity with an encoding
16418     that is unable to process.
16419     @enMufDef:
16420     Encoding <%p (name => {<Q::xp|charset-uri>});>
16421     %p (name => {<Q::xp|encoding>}, prefix => {(}, suffix => {) });is
16422     not supported
16423     @ecore:hasParameter: xp|encoding
16424     @ecore:hasParameter: xp|charset-uri
16425    
16426     XWParam:
16427     @QName: xp|encoding
16428     @enDesc:
16429     The XML name of the encoding.
16430     @multipleProperties: DISCore|Single
16431     @dataType: DISCore|String
16432     @DISCore:resourceType: DISSource|ResourceProperty
16433    
16434     XWParam:
16435     @QName: xp|charset-uri
16436     @enDesc:
16437     The URI that identifies the encoding.
16438    
16439     FatalErrDef:
16440     @QName: xp|fatal-utf-16-no-bom
16441     @enDesc:
16442     If the encoding of an entity is UTF-16 but it does not
16443     contains <CHAR::BOM>.
16444     @enMufDef:
16445     The entity contains no BOM
16446    
16447     FatalErrDef:
16448     @QName: xp|fatal-encoding-mismatch
16449     @enDesc:
16450     If an entity including an encoding declaration
16451     in an encoding other than that named in the declaration.
16452     @enMufDef:
16453     The entity is labeled as <%p (name => {<Q::xp|charset-uri>});>
16454     %p (name => {<Q::xp|encoding>}, prefix => {(}, suffix => {) });but
16455     it is wrong
16456     @ecore:hasParameter: xp|encoding
16457     @ecore:hasParameter: xp|charset-uri
16458    
16459     WarnDef:
16460     @QName: xp|warn-unknown-decode-error
16461     @enDesc:
16462     Unknown message from the decoder.
16463     @enMufDef:
16464     Encoding decoder error: <%p (name => {<Q::xp|error-type>});>
16465     @ecore:hasParameter: xp|error-type
16466     @ecore:hasParameter: xp|error-param
16467    
16468     XWParam:
16469     @QName: xp|error-type
16470     @enDesc:
16471     A DOM URI that identifies the error type.
16472    
16473     XWParam:
16474     @QName: xp|error-param
16475     @enDesc:
16476     A <Q::xp|error-type>-dependent set of error descriptions.
16477    
16478 wakaba 1.26 NSFatalErrDef:
16479     @QName: xp|nswf-legal-ncname
16480     @enDesc:
16481     <CODE::Name>s other than element type names and attribute names
16482     <kwd:MUST> be <CODE::NCName>s.
16483     @enMufDef:
16484     <CODE::Name> |%p (name => {<Q::xp|name>});| is not an <CODE::NCName>
16485     @ecore:hasParameter: xp|error-token
16486     @ecore:hasParameter:
16487     @@@: xp|name
16488     @@enDesc:
16489     The name.
16490     @ecore:hasParameter:
16491     @@@: infoset|version
16492     @@enDesc:
16493     The version of XML in use.
16494    
16495     NSFatalErrDef:
16496     @QName: xp|nswf-legal-qname
16497     @enDesc:
16498     An element type name or an attribute name <kwd:MUST> be a
16499     <CODE::QName>.
16500     @enMufDef:
16501     <CODE::Name> |%p (name => {<Q::xp|name>});| is not a <CODE::QName>
16502     @ecore:hasParameter: xp|error-token
16503     @ecore:hasParameter:
16504     @@@: xp|name
16505     @@enDesc:
16506     The name.
16507     @ecore:hasParameter:
16508     @@@: infoset|version
16509     @@enDesc:
16510     The version of XML in use.
16511    
16512     NSCErrDef:
16513     @QName: xp|nsc-reserved-prefix-xml
16514     @enDesc:
16515     The prefix <XML::xml> <kwd:MUST-NOT> be undeclared or bound
16516     to any namespace name other than <URI::http://www.w3.org/XML/1998/namespace>.
16517     @enMufDef:
16518     Namespace prefix |xml| cannot be bound to namespace
16519     name |%p (name => {<Q::infoset|namespaceName>});|
16520     @ecore:hasParameter: xp|error-token
16521     @ecore:hasParameter:
16522     @@@: infoset|prefix
16523     @@enDesc:
16524     The namespace prefix.
16525     @ecore:hasParameter:
16526     @@@: infoset|namespaceName
16527     @@enDesc:
16528     The namespace name bound to or an empty string for undeclaring.
16529    
16530     NSCErrDef:
16531     @QName: xp|nsc-reserved-namespace-name-xml
16532     @enDesc:
16533     Namespace prefixes other than <XML::xml> <kwd:MUST-NOT> be bound
16534     to the namespace name <URI::http://www.w3.org/XML/1998/namespace>.
16535     @enMufDef:
16536     Namespace prefix |%p (name => {<Q::infoset|prefix>});| cannot be
16537     bound to namespace name |http://www.w3.org/XML/1998/namespace|
16538     @enImplNote:
16539     The XMLNames spec does not prohibit the URI bound to
16540     the default namespace (!)
16541     @ecore:hasParameter: xp|error-token
16542     @ecore:hasParameter:
16543     @@@: infoset|prefix
16544     @@enDesc:
16545     The namespace prefix or <DOM::null> for default namespace.
16546     @ecore:hasParameter:
16547     @@@: infoset|namespaceName
16548     @@enDesc:
16549     The namespace name bound to.
16550    
16551     NSCErrDef:
16552     @QName: xp|nsc-reserved-prefix-xmlns
16553     @enDesc:
16554     The prefix <XML::xmlns> <kwd:MUST-NOT> be declared or undeclared.
16555     @enMufDef:
16556     Namespace prefix |xmlns| cannot be declared or undeclared
16557     @ecore:hasParameter: xp|error-token
16558     @ecore:hasParameter:
16559     @@@: infoset|prefix
16560     @@enDesc:
16561     The namespace prefix.
16562     @ecore:hasParameter:
16563     @@@: infoset|namespaceName
16564     @@enDesc:
16565     The namespace name bound to or an empty string for undeclaring.
16566    
16567     NSCErrDef:
16568     @QName: xp|nsc-reserved-namespace-name-xmlns
16569     @enDesc:
16570     Namespace prefixes <kwd:MUST-NOT> be bound
16571     to the namespace name <URI::http://www.w3.org/2000/xmlns/>.
16572     @enMufDef:
16573     Namespace prefix |%p (name => {<Q::infoset|prefix>});| cannot be
16574     bound to namespace name |http://www.w3.org/2000/xmlns/|
16575     @enImplNote:
16576     The XMLNames spec does not prohibit the URI bound to
16577     the default namespace (!)
16578     @ecore:hasParameter: xp|error-token
16579     @ecore:hasParameter:
16580     @@@: infoset|prefix
16581     @@enDesc:
16582     The namespace prefix or <DOM::null> for default namespace.
16583     @ecore:hasParameter:
16584     @@@: infoset|namespaceName
16585     @@enDesc:
16586     The namespace name bound to.
16587    
16588     NSCErrDef:
16589     @QName: xp|nsc-prefix-declared
16590     @enDesc:
16591     A namespace prefix other than <XML::xml> or <XML::xmlns>
16592     <kwd:MUST> have been declared in a namespace declaration
16593     attribute in either the start or empty element tag of the
16594     element where the prefix is used or in an ancestor
16595     element. Furthermore, the attribute value in the innermost
16596     such declaration <kwd:MUST-NOT> be an empty string.
16597     @enMufDef:
16598     Namespace prefix |%p (name => {<Q::infoset|prefix>});| in
16599     qualified name |%p (name => {<Q::xp|name>});| is not declared
16600     @ecore:hasParameter: xp|error-token
16601     @ecore:hasParameter:
16602     @@@: infoset|prefix
16603     @@enDesc:
16604     The namespace prefix.
16605     @ecore:hasParameter:
16606     @@@: xp|name
16607     @@enDesc:
16608     The qualified name.
16609    
16610     NSFatalErrDef:
16611     @QName: xp|nswf-empty-namespace-name
16612     @enDesc:
16613     If the XML version of the document is 1.0 and the
16614     normalized value of the prefixed namespace declaration attribute is empty.
16615     @enMufDef:
16616     Namespace |%p (name => {<Q::infoset|prefix>});| cannot be
16617     undeclared in XML 1.0
16618     @ecore:hasParameter: xp|error-token
16619     @ecore:hasParameter:
16620     @@@: infoset|prefix
16621     @@enDesc:
16622     The namespace prefix.
16623     @ecore:hasParameter:
16624     @@@: infoset|namespaceName
16625     @@enDesc:
16626     An empty string.
16627    
16628     NSFatalErrDef:
16629     @QName: xp|nswf-unique-att-spec-expanded-name
16630     @enDesc:
16631     No element may have two attributes that have qualified name
16632     with the same local part and with namespace prefixes
16633     that have been bound to namespace names that are identical.
16634     @enMufDef:
16635     Attribute |%p (name => {<Q::infoset|localName>});| in
16636     namespace |%p (name => {<Q::infoset|namespaceName>});| is
16637     attached to the same element more than once (as
16638     |%p (name => {<Q::xp|name>});| and
16639     |%p (name => {<Q::xp|another-attribute-name>});|)
16640     @enImplNote:
16641     The XMLNames spec doesn't mention default attributes
16642     for this constraint...
16643     @ecore:hasParameter: xp|error-token
16644     @ecore:hasParameter:
16645     @@@: infoset|localName
16646     @@enDesc:
16647     The local part of the attribute.
16648     @ecore:hasParameter:
16649     @@@: infoset|namespaceName
16650     @@enDesc:
16651     The namespace URI of the attribute.
16652     @ecore:hasParameter:
16653     @@@: xp|name
16654     @@enDesc:
16655     The name, i.e. a qualified name consist of <Q::infoset:localName>
16656     and <Q::infoset:namespaceName> parameter values.
16657     @ecore:hasParameter:
16658     @@@: xp|another-attribute-name
16659     @@enDesc:
16660     Another attribute qualified name expanded to the same expanded name
16661     as <Q::xp|name>.
16662    
16663     XWParam:
16664     @QName: xp|another-attribute-name
16665 wakaba 1.24
16666     XWParam:
16667     @QName: xp|replacement-text
16668     @enDesc:
16669     The replacement text.
16670 wakaba 1.1
16671 wakaba 1.3 XWParam:
16672 wakaba 1.1 @QName: xp|error-token
16673     @enDesc:
16674     The token where the parser found an error.
16675    
16676 wakaba 1.3 XWParam:
16677     @QName: xp|name
16678     @enDesc:
16679     A name.
16680    
16681     XWParam:
16682     @QName: xp|parent
16683     @enDesc:
16684     The parent node in which the error occurs.
16685    
16686     XWParam:
16687     @QName: xp|node
16688     @enDesc:
16689     The current node.
16690    
16691     XWParam:
16692     @QName: xp|actual-element-type
16693     @enDesc:
16694     The actual element type name occured in the source.
16695    
16696     XWParam:
16697     @QName: xp|expected-element-type
16698 wakaba 1.1 @enDesc:
16699 wakaba 1.3 The element type name expected.
16700    
16701     XWParam:
16702     @QName: xp|character-number
16703     @enDesc:
16704     The character code position.
16705    
16706     ElementTypeBinding:
16707     @Name: XWParam
16708     @ElementType:
16709     dis:ResourceDef
16710     @ShadowContent:
16711     @@For: =ManakaiDOM|all
16712     @@rdf:type: ecore|Parameter
16713 wakaba 1.1
16714     ElementTypeBinding:
16715     @Name:enMufDef
16716     @ElementType:
16717     ecore:defaultMessage
16718     @ShadowContent:
16719     @@lang:en
16720     @@ContentType:
16721     lang:muf
16722    
16723     ResourceDef:
16724     @QName: DOMImpl
16725     @AliasFor: DOMCore|DOMImplementation
16726     @For: ManakaiDOM|DOM
16727    
16728 wakaba 1.27 ResourceDef:
16729     @QName: LSInput
16730     @AliasFor: DOMLS|LSInput
16731     @For: ManakaiDOM|DOM
16732    
16733     ResourceDef:
16734     @QName: LSParser
16735     @AliasFor: DOMLS|LSParser
16736     @For: ManakaiDOM|DOM
16737    
16738 wakaba 1.1 ElementTypeBinding:
16739     @Name: Attr
16740     @ElementType:
16741     dis:ResourceDef
16742     @ShadowContent:
16743     @@rdf:type: DISLang|Attribute
16744     @@ForCheck: !=ManakaiDOM|ManakaiDOM
16745    
16746     ElementTypeBinding:
16747     @Name: Get
16748     @ElementType:
16749     dis:ResourceDef
16750     @ShadowContent:
16751     @@rdf:type: DISLang|AttributeGet
16752    
16753     ElementTypeBinding:
16754     @Name: Set
16755     @ElementType:
16756     dis:ResourceDef
16757     @ShadowContent:
16758     @@rdf:type: DISLang|AttributeSet
16759    
16760     ElementTypeBinding:
16761     @Name: enDesc
16762     @ElementType:
16763     dis:Description
16764     @ShadowContent:
16765     @@lang:en
16766    
16767     ElementTypeBinding:
16768     @Name: Method
16769     @ElementType:
16770     dis:ResourceDef
16771     @ShadowContent:
16772     @@rdf:type: DISLang|Method
16773     @@For: !=ManakaiDOM|ManakaiDOM
16774    
16775     ElementTypeBinding:
16776     @Name: Return
16777     @ElementType:
16778     dis:ResourceDef
16779     @ShadowContent:
16780     @@rdf:type: DISLang|MethodReturn
16781    
16782     ElementTypeBinding:
16783     @Name: Param
16784     @ElementType:
16785     dis:ResourceDef
16786     @ShadowContent:
16787     @@rdf:type: DISLang|MethodParameter
16788    
16789     ElementTypeBinding:
16790     @Name: PerlDef
16791     @ElementType:
16792     dis:Def
16793     @ShadowContent:
16794     @@ContentType: lang|Perl
16795    
16796     ElementTypeBinding:
16797 wakaba 1.27 @Name: PerlDefC
16798     @ElementType:
16799     dis:Def
16800     @ShadowContent:
16801     @@ContentType: lang|Perl
16802    
16803     ElementTypeBinding:
16804 wakaba 1.1 @Name: PropDef
16805     @ElementType:
16806     dis:ResourceDef
16807     @ShadowContent:
16808     @@rdf:type: rdf|Property
16809    
16810     ClsDef:
16811     @ClsQName: ManakaiXMLParserExceptionFormatter
16812    
16813     @ClsISA: ecore|MUErrorFormatter||ManakaiDOM|Perl
16814    
16815     @RuleDef:
16816     @@Name: xp-error-token-type
16817     @@enDesc:
16818     The type of the token the parser is encountered.
16819    
16820     @@Method:
16821     @@@Name: after
16822     @@@Param:
16823     @@@@Name: name
16824     @@@@Type: DOMString
16825     @@@@enDesc: The name of the method.
16826     @@@Param:
16827     @@@@Name: p
16828     @@@@Type: DISPerl|HASH
16829     @@@@enDesc: The set of the parameters to the method.
16830     @@@Param:
16831     @@@@Name: o
16832     @@@@Type: DISPerl|HASH
16833     @@@@enDesc: The option value.
16834     @@@Return:
16835     @@@@PerlDef:
16836     $p->{-result} = $o->{<H::xp|error-token>}->{type}
16837     if defined $o->{<H::xp|error-token>}->{type};
16838    
16839     @RuleDef:
16840     @@Name: xp-error-token-value
16841     @@enDesc:
16842     The value of the token the parser is encountered, if any.
16843    
16844     @@Method:
16845     @@@Name: after
16846     @@@Param:
16847     @@@@Name: name
16848     @@@@Type: DOMString
16849     @@@@enDesc: The name of the method.
16850     @@@Param:
16851     @@@@Name: p
16852     @@@@Type: DISPerl|HASH
16853     @@@@enDesc: The set of the parameters to the method.
16854     @@@Param:
16855     @@@@Name: o
16856     @@@@Type: DISPerl|HASH
16857     @@@@enDesc: The option value.
16858     @@@Return:
16859     @@@@PerlDef:
16860     $p->{-result} = $o->{<H::xp|error-token>}->{value}
16861     if defined $o->{<H::xp|error-token>}->{value};
16862    
16863     @RuleDef:
16864     @@Name: xp-error-lines
16865     @@enDesc:
16866     A copy of fragment of the source text that contains the line
16867     where the error occurred, if available.
16868    
16869     @@Method:
16870     @@@Name: after
16871     @@@Param:
16872     @@@@Name: name
16873     @@@@Type: DOMString
16874     @@@@enDesc: The name of the method.
16875     @@@Param:
16876     @@@@Name: p
16877     @@@@Type: DISPerl|HASH
16878     @@@@enDesc: The set of the parameters to the method.
16879     @@@Param:
16880     @@@@Name: o
16881     @@@@Type: DISPerl|HASH
16882     @@@@enDesc: The option value.
16883     @@@Return:
16884     @@@@PerlDef:
16885     my $pos = $o-><AG::DOMCore|DOMError.location>
16886     -><AG::DOMCore|DOMLocator.utf32Offset>;
16887 wakaba 1.27 my $src = $o->{<H::ecore|object>}->{entity}->[-1]->{reptxt};
16888     if (defined $src and $pos > -1) {
16889 wakaba 1.1 my $start = $pos;
16890     $start = rindex ($$src, "\x0A", $start - 1) for 0..2;
16891     $start++;
16892     my $end = $pos;
16893     $end = index ($$src, "\x0A", $end + 1) for 0..2;
16894     $end = length $$src if $end < 0;
16895     $p->{-result} = substr $$src, $start, $end - $start;
16896     }
16897 wakaba 1.3
16898     @RuleDef:
16899     @@Name: character-code-point
16900     @@enDesc:
16901     The character code position, in <CODE::U+<VAR::HHHH>> notation.
16902    
16903     @@Method:
16904     @@@Name: after
16905     @@@Param:
16906     @@@@Name: name
16907     @@@@Type: DOMString
16908     @@@@enDesc: The name of the method.
16909     @@@Param:
16910     @@@@Name: p
16911     @@@@Type: DISPerl|HASH
16912     @@@@enDesc: The set of the parameters to the method.
16913     @@@Param:
16914     @@@@Name: o
16915     @@@@Type: DISPerl|HASH
16916     @@@@enDesc: The option value.
16917     @@@RuleParam:
16918     @@@@Name: v
16919     @@@@Type: DISPerl|Number
16920     @@@@enDesc:
16921     The name of the error parameter that contains the character code.
16922     @@@Return:
16923     @@@@PerlDef:
16924     $p->{-result} = sprintf 'U+%04X', $o->{$p->{v}};
16925 wakaba 1.1 ##XMLParserExceptionFormatter
16926 wakaba 1.27
16927     ElementTypeBinding:
16928     @Name: CParam
16929     @ElementType:
16930     dis:ResourceDef
16931     @ShadowContent:
16932     @@rdf:type:
16933     @@@@: c|DOMConfigurationParameter
16934     @@@For: ManakaiDOM|DOM
16935     @@rdf:type:
16936 wakaba 1.33 @@@@: DISSource|ResourceProperty
16937 wakaba 1.27 @@@For: =ManakaiDOM|all
16938     @@For: ManakaiDOM|DOM3
16939     @@For: =ManakaiDOM|all
16940 wakaba 1.33 @@subsetOf:
16941     @@@@: c|anyDOMConfigurationParameter
16942     @@@For: =ManakaiDOM|all
16943 wakaba 1.34 @@multipleProperties:
16944     @@@@: DISCore|Single
16945     @@@For: =ManakaiDOM|all
16946 wakaba 1.27
16947     ElementTypeBinding:
16948     @Name: CParamApp
16949     @ElementType:
16950     dis:ResourceDef
16951     @ShadowContent:
16952     @@rdf:type:
16953     @@@@: c|DOMConfigurationParameterApplication
16954     @@@For: ManakaiDOM|DOM
16955     @@For: ManakaiDOM|DOM3
16956 wakaba 1.30
16957 wakaba 1.34 ElementTypeBinding:
16958     @Name: boolCParam
16959     @ElementType:
16960     dis:ResourceDef
16961     @ShadowContent:
16962     @@DISCore:resourceType:
16963     @@@@: c|DOMConfigurationParameter
16964     @@@For: ManakaiDOM|DOM
16965     @@DISCore:resourceType:
16966     @@@@: DISSource|ResourceProperty
16967     @@@For: =ManakaiDOM|all
16968     @@For: ManakaiDOM|DOM3
16969     @@For: =ManakaiDOM|all
16970     @@Type: idl|boolean||ManakaiDOM|all
16971     @@subsetOf:
16972     @@@@: c|anyDOMConfigurationParameter
16973     @@@For: =ManakaiDOM|all
16974     @@multipleProperties:
16975     @@@@: DISCore|Single
16976     @@@For: =ManakaiDOM|all
16977     @@dataType:
16978     @@@@: DISCore|Boolean
16979     @@@For: =ManakaiDOM|all
16980    
16981 wakaba 1.30 CParamApp:
16982     @QName: xml-id
16983     @c:domConfigurationParameter: cfg|xml-id
16984     @c:targetType: xp|ManakaiXMLParser
16985 wakaba 1.34 @TrueCase:
16986     @@c:isSupported: 1
16987     @FalseCase:
16988     @@c:isSupported: 1
16989 wakaba 1.27
16990     CParamApp:
16991     @QName: error-handler
16992     @c:domConfigurationParameter: c|error-handler
16993     @c:targetType: xp|ManakaiXMLParser
16994 wakaba 1.34
16995     boolCParam:
16996     @QName: cfg|entity-replacement-tree
16997     @DOMLS:lsKey:
16998     @@@: erep
16999     @@For: =ManakaiDOM|all
17000     @Type: idl|boolean||ManakaiDOM|all
17001     @c:targetType: xp|ManakaiXMLParser
17002     @IsSupportRequired: 1
17003     @c:isSupported: 1
17004     @TrueCase:
17005     @@c:isSupported: 1
17006     @@enDesc:
17007     The parser <kwd:MUST> cnstruct the replacement subtree of
17008 wakaba 1.35 a general parsed <IF::tx|Entity> node if the replacement text
17009 wakaba 1.34 for the node is available.
17010    
17011     If this value is set to the parameter, then a fatal error
17012     might be reported even if the entire document is well-formed
17013     in case a general parsed entity has replacement text that is
17014     not well-formed when evaluated as if it has been referenced
17015     in the content of an element, except that undeclared namespace prefixes
17016     do not result in namespace well-formedness error.
17017     @FalseCase:
17018     @@IsDefault: 1
17019     @@c:isSupported: 1
17020     @@IsSupportRequired: 1
17021     @@enDesc:
17022 wakaba 1.35 The parser don't have to construct <IF::tx|Entity> replacement
17023 wakaba 1.34 subtrees.
17024    
17025     @Test:
17026     @@QName: cfg.entity-replacement-tree.test
17027     @@PerlDef:
17028     my $xp;
17029     __CODE{createParserForTest:: $xp => $xp}__;
17030     my $cfg = $xp-><AG::LSInput.domConfig>;
17031    
17032     my $pname = <Q::cfg|entity-replacement-tree>;
17033    
17034     $test->id ('default.false');
17035     $test->assert_false ($cfg-><M::c|DOMConfiguration.getParameter> ($pname));
17036    
17037     $test->id ('false.to.true');
17038     $cfg-><M::c|DOMConfiguration.setParameter> ($pname => true);
17039     $test->assert_false ($cfg-><M::c|DOMConfiguration.getParameter> ($pname));
17040    
17041     $test->id ('true.to.false');
17042     $cfg-><M::c|DOMConfiguration.setParameter> ($pname => false);
17043     $test->assert_false ($cfg-><M::c|DOMConfiguration.getParameter> ($pname));
17044    
17045     $test->id ('reset');
17046     $cfg-><M::c|DOMConfiguration.setParameter> ($pname => true);
17047     $cfg-><M::c|DOMConfiguration.setParameter> ($pname => null);
17048     $test->assert_false ($cfg-><M::c|DOMConfiguration.getParameter> ($pname));
17049 wakaba 1.27
17050     CParam:
17051     @QName: xp|ls-input-to-input-file
17052     @DOMLS:lsKey:
17053     @@@: i2i
17054     @@For: =ManakaiDOM|all
17055     @Type: ManakaiDOMLSInputToInputFile
17056     @c:targetType: xp|ManakaiXMLParser
17057     @IsSupportRequired: 1
17058     @c:isSupported: 1
17059     @enDesc:
17060     An <IF::LSInput> to Perl filehandle converter.
17061    
17062     @Method:
17063     @@rdf:type: c|DOMConfigurationParameterDefaultGetter
17064     @@Param:
17065     @@@Name: name
17066     @@@Type: DOMString
17067     @@@dis:actualType: c|DOMConfigurationParameterName
17068     @@@enDesc: The parameter name.
17069     @@Return:
17070     @@@Type: ManakaiDOMLSInputToInputFile
17071     @@@enDesc:
17072     The default resolver.
17073     @@@PerlDefC:
17074 wakaba 1.37 # resolveLSInput
17075 wakaba 1.27 $r = sub {
17076 wakaba 1.37 my ($self, $impl, $input, $parser, $errorHandler) = @_;
17077 wakaba 1.27 ## As defined in DOM Level 3 LS |LSInput| interface
17078    
17079     my $r = {};
17080    
17081     __DEEP{
17082    
17083     FH: {
17084     ## 1. |characterStream|
17085     my $v = $input-><AG::LSInput.characterStream>;
17086     if (defined $v) {
17087     $r->{filehandle} = $v;
17088     last FH;
17089     }
17090    
17091     ## 2. |byteStream|
17092     $v = $input-><AG::LSInput.byteStream>;
17093     if (defined $v) {
17094 wakaba 1.37 require Message::Charset::Encode;
17095     my $mceimpl = $impl-><M::f|GetFeature.getFeature>
17096     (<Q::fe|MCEncode>, '1.0');
17097     my $encode = $input-><AG::LSInput.encoding>;
17098     my $encode_uri = defined $encode
17099     ? $mceimpl-><M::mce|MCEncodeImplementation
17100     .getURIFromCharsetName>
17101     (<Q::cs|xmlName>, $encode)
17102     : <Q::xml-auto-charset:>;
17103     $r->{filehandle} = $mceimpl-><M::mce|MCEncodeImplementation
17104     .createMCDecodeHandle>
17105     ($encode_uri, $v, sub {
17106     my ($self, $fh, $type, %opt) = @_;
17107     my $continue = true;
17108     if ($type eq <Q::cs|illegal-octets-error>) {
17109     $continue = __c|ERROR{xp|fatal-illegal-byte-sequence::
17110     xp|byte-sequence => {$opt{octets}},
17111     ecore|object => {$parser},
17112     }__;
17113     } elsif ($type eq <Q::cs|unassigned-code-point-error>) {
17114     $continue = __c|ERROR{xp|warning-unassigned-code-point::
17115     xp|byte-sequence => {$opt{octets}},
17116     ecore|object => {$parser},
17117     }__;
17118     $opt{octets} = \"\x{FFFD}";
17119     } elsif ($type eq <Q::cs|invalid-state-error>) {
17120     $continue = __c|ERROR{xp|fatal-illegal-byte-sequence::
17121     xp|code-state => {$opt{state}},
17122     ecore|object => {$parser},
17123     }__;
17124     } elsif ($type eq <Q::cs|charset-not-supported-error>) {
17125     $continue = __c|ERROR{xp|fatal-unprocessable-encoding::
17126     xp|encoding => {$encode},
17127     xp|charset-uri => {$opt{charset_uri}},
17128     ecore|object => {$parser},
17129     }__;
17130     } elsif ($type eq <Q::cs|no-bom-error>) {
17131     if ($opt{charset_uri} eq <Q::cs|XML.utf-16>) {
17132     $continue = __c|ERROR{xp|fatal-utf-16-no-bom::
17133     ecore|object => {$parser},
17134     }__;
17135     } else {
17136     $continue = __c|ERROR{xp|fatal-illegal-byte-sequence::
17137     xp|code-state => 'bom',
17138     ecore|object => {$parser},
17139     }__;
17140     }
17141     } elsif ($type eq <Q::cs|charset-name-mismatch-error>) {
17142     $continue = __c|ERROR{xp|fatal-encoding-mismatch::
17143     xp|encoding => {$encode},
17144     xp|charset-uri => {$opt{charset_uri}},
17145     ecore|object => {$parser},
17146     }__;
17147     } else {
17148     $continue = __c|ERROR{xp|warn-unknown-decode-error::
17149     xp|error-type => {$type},
17150     xp|error-param => {\%opt},
17151     ecore|object => {$parser},
17152     }__;
17153     }
17154     unless ($continue) {
17155     __EXCEPTION{DOMLS|PARSE_ERR::
17156     ecore|object => {$parser},
17157     }__;
17158     }
17159     });
17160     $r->{input_encoding}
17161     = $r->{filehandle}-><AG::mce|MCDecodeHandle.inputEncoding>
17162     if defined $r->{filehandle};
17163     last FH;
17164 wakaba 1.27 }
17165    
17166     ## 3. |stringData|
17167     $v = $input-><AG::LSInput.stringData>;
17168     if (defined $v) {
17169     require IO::String;
17170     $r->{filehandle} = IO::String->new ($v);
17171     last FH;
17172     }
17173    
17174     ## 4. |systemId|
17175     ## TODO:
17176     ## resolve relative URI
17177     ## open
17178     ## set document_uri
17179    
17180     ## 5. |publicId|
17181     ## The default resolver does not support only-|publicId| input.
17182    
17183     return null;
17184     } # FH
17185    
17186     DURI: {
17187     last DURI if defined $r->{document_uri};
17188    
17189     my $v = $input-><AG::LSInput.systemId>;
17190     if (defined $v) {
17191 wakaba 1.29 $r->{base_uri} = $input-><AG::LSInput.baseURI>
17192     unless defined $r->{base_uri};
17193     if (defined $r->{base_uri}) {
17194 wakaba 1.41 $r->{document_uri} = $impl->create_uri_reference (\$v)
17195 wakaba 1.29 -><M::urigen|URIReference.getAbsoluteReference>
17196     ($r->{base_uri})
17197     -><AG::urigen|URIReference.uriReference>;
17198     } else {
17199     $r->{document_uri} = $v;
17200     }
17201 wakaba 1.27 last DURI;
17202     }
17203    
17204     ## TODO: pubid -> pubid URN -> document_uri
17205     } # DURI
17206    
17207     BURI: {
17208     last BURI if defined $r->{base_uri};
17209    
17210     my $v = $input-><AG::LSInput.baseURI>;
17211     if (defined $v) {
17212     $r->{base_uri} = $v;
17213     last BURI;
17214     }
17215    
17216     if (defined $r->{document_uri}) {
17217     $r->{base_uri} = $r->{document_uri};
17218     }
17219     } # BURI
17220    
17221 wakaba 1.37 $r->{input_encoding} = $input-><AG::LSInput.encoding>
17222     unless defined $r->{input_encoding};
17223    
17224 wakaba 1.27 }__;
17225    
17226     ## ISSUE: Is |certifiedText| required by parsers?
17227    
17228     return $r;
17229     };
17230     @Method:
17231     @@rdf:type: c|DOMConfigurationParameterSetter
17232     @@Param:
17233     @@@Name: name
17234     @@@Type: DOMString
17235     @@@dis:actualType: c|DOMConfigurationParameterName
17236     @@@enDesc: The parameter name.
17237     @@Param:
17238     @@@Name: value
17239     @@@Type: DOMMain|DOMUserData
17240     @@@dis:actualType: ManakaiDOMLSInputToInputFile
17241     @@@enDesc: The new value.
17242     @@Return:
17243     @@@Type: idl|void||ManakaiDOM|all
17244     @@@PerlDefC:
17245     $self->[1]->{<H::xp|ls-input-to-input-file>} = $value;
17246     @@enImplNote:
17247     Implied input processor converts non-blessed code references
17248     into a <Class::ManakaiDOMLSInputToInputFile> object.
17249     @Method:
17250     @@rdf:type: c|DOMConfigurationParameterChecker
17251     @@Param:
17252     @@@Name: name
17253     @@@Type: DOMString
17254     @@@dis:actualType: c|DOMConfigurationParameterName
17255     @@@enDesc: The parameter name.
17256     @@Param:
17257     @@@Name: value
17258     @@@Type: DOMMain|DOMUserData
17259     #@@@dis:actualType: ManakaiDOMLSInputToInputFile
17260     @@@enDesc: The new value.
17261     @@Return:
17262     @@@Type: idl|boolean||ManakaiDOM|all
17263     @@@PerlDefC:
17264     $r = UNIVERSAL::isa ($value, 'CODE') or
17265     UNIVERSAL::isa ($value, <ClassName::ManakaiDOMLSInputToInputFile>);
17266    
17267     @@Test:
17268     @@@QName: cp.ls-input-to-input-file.test
17269     @@@PerlDefC:
17270     my $xp;
17271     __CODE{createParserForTest:: $xp => $xp}__;
17272     my $cfg = $xp-><AG::LSInput.domConfig>;
17273    
17274     my $cp = <Q::xp|ls-input-to-input-file>;
17275    
17276     $test->id ('default');
17277     my $default = $cfg-><M::c|DOMConfiguration.getParameter> ($cp);
17278     $test->assert_isa ($default,
17279     <ClassName::ManakaiDOMLSInputToInputFile>);
17280    
17281     $test->id ('set');
17282     my $sub1 = sub { };
17283     $cfg-><M::c|DOMConfiguration.setParameter> ($cp => $sub1);
17284     my $sub2 = $cfg-><M::c|DOMConfiguration.getParameter> ($cp);
17285     $test->assert_isa ($sub2, <ClassName::ManakaiDOMLSInputToInputFile>);
17286     $test->assert_equals ($sub2, $sub1);
17287    
17288     $test->id ('reset');
17289     $cfg-><M::c|DOMConfiguration.setParameter> ($cp => null);
17290     my $sub3 = $cfg-><M::c|DOMConfiguration.getParameter> ($cp);
17291     $test->assert_isa ($sub3, <ClassName::ManakaiDOMLSInputToInputFile>);
17292     $test->assert_equals ($sub3, $default);
17293 wakaba 1.29
17294     @@Test:
17295     @@@QName: cp.ls-input-to-input-file.default.test
17296     @@@PerlDefC:
17297     my $xp;
17298     __CODE{createParserForTest:: $xp => $xp}__;
17299     my $cfg = $xp-><AG::LSInput.domConfig>;
17300     my $cp = <Q::xp|ls-input-to-input-file>;
17301     my $default = $cfg-><M::c|DOMConfiguration.getParameter> ($cp);
17302    
17303     my $err = sub {}; # dummy error handler
17304    
17305     my $cs = \*STDOUT; # dummy input
17306    
17307     $test->id ('cs.sysid');
17308     my $r1 = $default->resolve_ls_input ({
17309     character_stream => $cs,
17310     system_id => q<http://example.com/sysid>,
17311     }, $err);
17312     $test->assert_equals
17313     ($r1->document_uri, q<http://example.com/sysid>);
17314     $test->assert_equals
17315     ($r1->base_uri, q<http://example.com/sysid>);
17316    
17317     $test->id ('cs.baseuri.sysid');
17318     my $r1 = $default->resolve_ls_input ({
17319     character_stream => $cs,
17320     system_id => q<sysid>,
17321     base_uri => q<http://example.com/>,
17322     }, $err);
17323     $test->assert_equals
17324     ($r1->document_uri, q<http://example.com/sysid>);
17325     $test->assert_equals
17326     ($r1->base_uri, q<http://example.com/>);
17327 wakaba 1.27 ##ls-input-to-input-file
17328    
17329     ClsDef:
17330     @ClsQName: ManakaiDOMLSInputToInputFile
17331     @enDesc:
17332     An <Class::ManakaiDOMLSInputToInputFile> object is used to covert
17333     a <IF::LSInput> object into a Perl filehandle.
17334    
17335     {ISSUE::
17336     In which module this class should be placed?
17337    
17338     Better interface name?
17339     }
17340    
17341     @enDesc:
17342     @@ddid: perl
17343     @@ForCheck: ManakaiDOM|ManakaiDOM
17344     @@@:
17345     For Perl binding, any parameter that accepts
17346     a <Class::ManakaiDOMLSInputToInputFile> would also accept a Perl code
17347     reference (subroutine reference). The code reference
17348     will be blessed as a <Class::ManakaiDOMLSInputToInputFile> whose
17349     <M::ManakaiDOMLSInputToInputFile.resolveLSInput> method invokes the code.
17350    
17351     @ResourceDef:
17352     @@rdf:type: DISLang|InputProcessor
17353     @@rdf:type: DISLang|OutputProcessor
17354     @@PerlDef:
17355     $INPUT = bless $INPUT, <ClassName::ManakaiDOMLSInputToInputFile>
17356     if ref $INPUT eq 'CODE';
17357    
17358     @Method:
17359     @@Name: resolveLSInput
17360     @@enDesc:
17361     Converts a <IF::LSInput> into a Perl filehandle.
17362     @@Param:
17363 wakaba 1.37 @@@Name: impl
17364     @@@Type: f|MinimumImplementation
17365     @@@enDesc:
17366     The implementation object.
17367     @@Param:
17368 wakaba 1.27 @@@Name: input
17369     @@@Type: LSInput
17370     @@@enDesc:
17371     The input.
17372     @@Param:
17373 wakaba 1.37 @@@Name: parser
17374     @@@Type: LSParser
17375     @@@enDesc:
17376     The parser.
17377     @@Param:
17378 wakaba 1.27 @@@Name: errorHandler
17379     @@@Type: c|DOMErrorHandler
17380     @@@enDesc:
17381     An error handler. If the method encounters an error
17382     or warning, it <kwd:MAY> notify it to application
17383     via this handler.
17384     @@Return:
17385     @@@Type: ManakaiDOMInputFile
17386     @@@enDesc:
17387     A <Class::ManakaiDOMInputFile> object created from <P::input>.
17388     @@@nullCase:
17389     @@@@enDesc:
17390     If the method was unable to resolve the <P::input>.
17391    
17392     {ISSUE::
17393     Should we allow the method to throw exceptions?
17394     }
17395     @@@PerlDef:
17396     __DEEP{
17397 wakaba 1.37 $r = $self->($self, $impl, $input, $parser, $errorHandler);
17398 wakaba 1.27 }__;
17399     @@@enImplNote:
17400     Notet that the input / output processor for <CODE::$input>
17401     and return value might or might not be inserted in
17402     the <Perl::$self> code.
17403     ##LSInputToInputFile
17404    
17405     ClsDef:
17406     @ClsQName: ManakaiDOMInputFile
17407     @enDesc:
17408     A set of information on the input, including filehandle.
17409    
17410     @enDesc:
17411     @@ddid: perl
17412     @@ForCheck: ManakaiDOM|ManakaiDOM
17413     @@@:
17414     For Perl binding, any parameter that accepts
17415     a <Class::ManakaiDOMInputFile> would also accept a Perl hash reference.
17416     If a hash reference is given to parameter that expects
17417     a <Class::ManakaiDOMInputFile> object, then it
17418     bless the hash with the class.
17419    
17420     Each attributes defined
17421     in the class is associated to the hash value with the
17422     key equals to the attribut name. Each method defined in
17423     the class will invoke the code reference retrieved
17424     from the hash by the key equals to the method name.
17425    
17426     If there is no value in the hash for an attribute,
17427     then its value is <DOM::null>.
17428    
17429     @ResourceDef:
17430     @@rdf:type: DISLang|InputProcessor
17431     @@rdf:type: DISLang|OutputProcessor
17432     @@PerlDef:
17433     $INPUT = bless $INPUT, <ClassName::ManakaiDOMInputFile>
17434     if ref $INPUT eq 'HASH';
17435    
17436     @Attr:
17437     @@Name: filehandle
17438     @@Type: DISPerl|filehandle||ManakaiDOM|all
17439     @@enDesc:
17440     The input filehandle.
17441    
17442     It <kwd:MUST> be an <Perl::open>ed (and not <Perl::close>d)
17443     filehandle. Note that
17444     it does not have to be associated with an actual file
17445     in the local file system.
17446    
17447     It <kwd:MUST> return a character (rather than byte)
17448     by <Perl::getc>.
17449     @@Get:
17450     @@@PerlDef: $r = $self->{filehandle};
17451     @@Set:
17452     @@@PerlDef: $self->{filehandle} = $given;
17453    
17454     @Attr:
17455     @@Name: baseURI
17456     @@enDesc:
17457     The base URI of the input.
17458    
17459     It <kwd:MUST> be an absolute DOM URI or <DOM::null>.
17460     Otherwise, the result is undefined.
17461     @@Type: DOMString
17462     @@nullCase:
17463     @@@enDesc:
17464     If the base URI is not available.
17465     @@Get:
17466     @@@PerlDef: $r = $self->{base_uri};
17467     @@Set:
17468     @@@PerlDef: $self->{base_uri} = $given;
17469    
17470     @Attr:
17471     @@Name: documentURI
17472     @@enDesc:
17473     The URI of the document.
17474    
17475     It <kwd:MUST> be an absolute DOM URI or <DOM::null>.
17476     Otherwise, the result is undefined.
17477     @@Type: DOMString
17478     @@nullCase:
17479     @@@enDesc:
17480     If the document URI is not available.
17481     @@Get:
17482     @@@PerlDef: $r = $self->{document_uri};
17483     @@Set:
17484     @@@PerlDef: $self->{document_uri} = $given;
17485 wakaba 1.37
17486     @Attr:
17487     @@Name: inputEncoding
17488     @@enDesc:
17489     The input encoding name.
17490     @@Type: DOMString
17491     @@nullCase:
17492     @@@enDesc:
17493     If the input encoding name is not available.
17494     @@Get:
17495     @@@PerlDef: $r = $self->{input_encoding};
17496     @@Set:
17497     @@@PerlDef: $self->{input_encoding} = $given;
17498 wakaba 1.27
17499     @Method:
17500     @@Name: close
17501     @@enDesc:
17502     Closes the file.
17503    
17504     Since when the Perl's destructor is invoked is unreliable,
17505     this method is explicitly called when the file is no longer
17506     in use.
17507    
17508     If the <Class::ManakaiDOMInputFile> is given as a hash
17509     reference and whose value for <CODE::close> is not defined,
17510     then the statement <Perl::close $filehandle> is done
17511     (where <Perl::$filehandle> is the <A::ManakaiDOMInputFile.filehandle>
17512     value).
17513     @@Return:
17514     @@@PerlDef:
17515     __DEEP{
17516     if ($self->{close}) {
17517     $self->{close}->($self);
17518     } else {
17519 wakaba 1.38 $self->{filehandle}->close;
17520 wakaba 1.27 }
17521     }__;
17522     ##ManakaiDOMInputFile
17523    
17524    
17525    

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24