/[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.36 - (hide annotations) (download)
Tue Apr 4 10:53:14 2006 UTC (18 years, 7 months ago) by wakaba
Branch: MAIN
Changes since 1.35: +3 -3 lines
++ manakai/lib/Message/Util/ChangeLog	4 Apr 2006 10:52:17 -0000
	* Grove.dis (collectGarbage): The gc algorithm has
	been changed (a variant of mark and sweep).

2006-04-04  Wakaba  <wakaba@suika.fam.cx>

++ manakai/lib/Message/DOM/ChangeLog	4 Apr 2006 10:51:03 -0000
	* XMLParser.dis: The |cfg:dtd-default-attributes| configuration
	parameter is changed to |cfg:dtd-default-attribute|.

2006-04-04  Wakaba  <wakaba@suika.fam.cx>

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.36 $Date: 2006/04/02 10:45:24 $
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.1
28     Namespace:
29 wakaba 1.8 @c:
30     http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#
31 wakaba 1.11 @cfg:
32     http://suika.fam.cx/www/2006/dom-config/
33 wakaba 1.6 @d:
34     http://suika.fam.cx/~wakaba/archive/2004/dom/xdt#
35 wakaba 1.1 @dis:
36     http://suika.fam.cx/~wakaba/archive/2004/8/18/lang#dis--
37 wakaba 1.5 @dtest:
38     http://suika.fam.cx/~wakaba/archive/2005/manakai/Util/DIS#Test/
39 wakaba 1.1 @dx:
40     http://suika.fam.cx/~wakaba/archive/2005/manakai/Util/Error/DOMException#
41     @ecore:
42     http://suika.fam.cx/~wakaba/archive/2005/manakai/Util/Error/Core/
43     @f:
44     http://suika.fam.cx/~wakaba/archive/2004/dom/feature#
45 wakaba 1.11 @fe:
46     http://suika.fam.cx/www/2006/feature/
47     @gls:
48     http://suika.fam.cx/~wakaba/archive/2004/dom/gls#
49 wakaba 1.1 @idl:
50     http://suika.fam.cx/~wakaba/archive/2004/dis/IDL#
51     @infoset:
52     http://www.w3.org/2001/04/infoset#
53     @lang:
54     http://suika.fam.cx/~wakaba/archive/2004/8/18/lang#
55     @license:
56     http://suika.fam.cx/~wakaba/archive/2004/8/18/license#
57     @LSEV:
58     http://www.w3.org/2002/DOMLS
59     @ManakaiDOM:
60     http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom#
61     @ManakaiDOMLS:
62     http://suika.fam.cx/~wakaba/archive/2004/mdom-ls#
63     @MDOM:
64     http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom#ManakaiDOM.
65     @MDOMX:
66     http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#
67 wakaba 1.11 @mn:
68     http://suika.fam.cx/~wakaba/archive/2005/manakai/Util/ManakaiNode#
69 wakaba 1.1 @rdf:
70     http://www.w3.org/1999/02/22-rdf-syntax-ns#
71     @rdfs:
72     http://www.w3.org/2000/01/rdf-schema#
73     @t:
74     http://suika.fam.cx/~wakaba/archive/2004/dom/tree#
75 wakaba 1.35 @tc:
76     http://suika.fam.cx/~wakaba/archive/2005/manakai/DOM/TreeCore/
77     @td:
78     http://suika.fam.cx/~wakaba/archive/2005/manakai/DOM/Document/
79     @te:
80     http://suika.fam.cx/~wakaba/archive/2005/manakai/DOM/Element/
81 wakaba 1.5 @test:
82     http://suika.fam.cx/~wakaba/archive/2004/dis/Test#
83 wakaba 1.35 @tx:
84     http://suika.fam.cx/~wakaba/archive/2005/manakai/DOM/XML/
85 wakaba 1.29 @urigen:
86     http://suika.fam.cx/~wakaba/archive/2005/manakai/URI/Generic/
87 wakaba 1.8 @x:
88     http://suika.fam.cx/~wakaba/archive/2004/dom/xml#
89 wakaba 1.1 @xml:
90     http://www.w3.org/XML/1998/namespace
91 wakaba 1.9 @xml-dtd:
92     http://www.w3.org/TR/REC-xml
93 wakaba 1.1 @xmlns:
94     http://www.w3.org/2000/xmlns/
95     @xp:
96     http://suika.fam.cx/~wakaba/archive/2004/dom/xml-parser#
97    
98     ## -- Features
99    
100     ElementTypeBinding:
101     @Name: FeatureDef
102     @ElementType:
103     dis:ResourceDef
104     @ShadowContent:
105     @@rdf:type: f|Feature
106     @@For: =ManakaiDOM|all
107    
108     ElementTypeBinding:
109     @Name: FeatureVerDef
110     @ElementType:
111     dis:ResourceDef
112     @ShadowContent:
113     @@rdf:type: f|Feature
114    
115     ElementTypeBinding:
116     @Name: featureQName
117     @ElementType:
118     f:name
119     @ShadowContent:
120     @@ContentType: DISCore|QName
121    
122     ResourceDef:
123     @QName: DOMString
124     @AliasFor: DOMMain|DOMString
125     @For: ManakaiDOM|DOM
126    
127     ResourceDef:
128     @QName: Node
129 wakaba 1.35 @AliasFor: tc|Node
130 wakaba 1.1 @For: ManakaiDOM|DOM
131    
132     ResourceDef:
133     @QName: Element
134 wakaba 1.35 @AliasFor: te|Element
135     @For: ManakaiDOM|DOM
136    
137     ResourceDef:
138     @QName: Attr
139     @AliasFor: te|Attr
140 wakaba 1.1 @For: ManakaiDOM|DOM
141    
142     ResourceDef:
143     @QName: Document
144 wakaba 1.35 @AliasFor: td|Document
145 wakaba 1.1 @For: ManakaiDOM|DOM
146    
147 wakaba 1.6 ResourceDef:
148     @QName: DocumentXDoctype
149     @AliasFor: d|DocumentXDoctype
150     @For: ManakaiDOM|DOM
151    
152 wakaba 1.8 ResourceDef:
153     @QName: DTDef
154     @AliasFor: d|DocumentTypeDefinition
155     @For: ManakaiDOM|DOM
156    
157     ResourceDef:
158     @QName: ETDef
159     @AliasFor: d|ElementTypeDefinition
160     @For: ManakaiDOM|DOM
161    
162     ResourceDef:
163     @QName: ATDef
164     @AliasFor: d|AttributeDefinition
165     @For: ManakaiDOM|DOM
166    
167 wakaba 1.35 ResourceDef:
168     @QName: GE
169     @AliasFor: tx|Entity
170     @For: ManakaiDOM|DOM
171    
172     ResourceDef:
173     @QName: GERef
174     @AliasFor: tx|EntityReference
175     @For: ManakaiDOM|DOM
176    
177 wakaba 1.1 ElementTypeBinding:
178     @Name: ClsDef
179     @ElementType:
180     dis:ResourceDef
181     @ShadowContent:
182     @@rdf:type:
183     @@@@: dis|MultipleResource
184     @@@ForCheck: !ManakaiDOM|ForIF !ManakaiDOM|ForClass
185     @@resourceFor:
186     @@@@: ManakaiDOM|ForClass
187     @@@ForCheck: ManakaiDOM|ManakaiDOM !=ManakaiDOM|ManakaiDOM
188     @@For: ManakaiDOM|DOM3
189     @@For: =ManakaiDOM|ManakaiDOM
190    
191     @@rdf:type:
192     @@@@: DISLang|Class
193     @@@ForCheck: ManakaiDOM|ForClass
194    
195     ElementTypeBinding:
196     @Name: ClsQName
197     @ElementType:
198     dis:QName
199     @ShadowContent:
200     @@ForCheck: ManakaiDOM|ForClass
201    
202     ElementTypeBinding:
203     @Name: ClsISA
204     @ElementType:
205     dis:ISA
206     @ShadowContent:
207     @@ForCheck: ManakaiDOM|ForClass
208    
209     ElementTypeBinding:
210     @Name: nullCase
211     @ElementType:
212     dis:ResourceDef
213     @ShadowContent:
214     @@rdf:type: ManakaiDOM|InCase
215     @@Value:
216     @@@is-null:1
217    
218 wakaba 1.27 ElementTypeBinding:
219     @Name: TrueCase
220     @ElementType:
221     dis:ResourceDef
222     @ShadowContent:
223     @@rdf:type:
224     ManakaiDOM:InCase
225     @@Value:
226     @@@@: 1
227     @@@ContentType: DISCore|Boolean
228     @@Type: idl|boolean||ManakaiDOM|all
229    
230     ElementTypeBinding:
231     @Name: FalseCase
232     @ElementType:
233     dis:ResourceDef
234     @ShadowContent:
235     @@rdf:type:
236     ManakaiDOM:InCase
237     @@Value:
238     @@@@: 0
239     @@@ContentType: DISCore|Boolean
240     @@Type: idl|boolean||ManakaiDOM|all
241    
242 wakaba 1.1 ResourceDef:
243     @QName: LSParser
244     @AliasFor: DOMLS|LSParser
245     @For: ManakaiDOM|DOM3
246    
247     ClsDef:
248     @ClsQName: ManakaiXMLParser
249    
250     @Implement: DOMLS|LSParser
251    
252 wakaba 1.28 @f:implements: DOMLS|LSFeature30
253     @f:implements: DOMLS|ParseString10
254     @enImplNote:
255     @@ddid: dtdfeature
256     @@@:
257     {TODO::
258     Once DTD validation is implemented, add <Q::f:implements>
259     for XML-DTD-feature.
260     }
261 wakaba 1.1
262 wakaba 1.11 @DISLang:role: gls|ParserRole
263 wakaba 1.1
264 wakaba 1.3 @enDesc:
265     Note that the <Class::ManakaiXMLParser> reports any XML errors
266     (syntax errors and / or well-formedness constraint errors)
267     via the <IF::DOMCore:error-handler> registered to
268     the <A::DOMLS:LSParser.domConfig> object. Each error has
269     its <A::DOMCore:DOMError.severity>, either <C::DOMCore:SEVERITY_ERROR>
270     or <C::DOMCore:SEVERITY_FATAL_ERROR>. However, their semantics
271     are slight different from the ones of <QUOTE::error> and
272     <QUOTE::fatal error> in XML; in this implemenetation,
273     <C::DOMCore:SEVERITY_ERROR> implies that the parsing process
274     can effectively be continued to detect more errors while
275     <C::DOMCore:SEVERITY_FATAL_ERROR> implies that the error
276     is serious so that the result document tree and any errors
277     might be far from the ones obtained when the error would not
278     be found.
279 wakaba 1.28
280     @Test:
281     @@QName: GLSImpl.createGLSParser.LS.test
282     @@enDesc:
283     Since there is at least one implementation of the feature (i.e.
284     this class), the <M::gls|GLSImplementation.createGLSParser>
285     must not throw an exception.
286     @@PerlDef:
287     my $impl;
288     __CODE{DOMLS|createImplForTest:: $impl => $impl}__;
289    
290     my $p = $impl-><M::gls|GLSImplementation.createGLSParser>
291     ({LS => '3.0'});
292    
293     $test->assert_isa ($p, <IFName::LSParser>);
294     @Test:
295     @@QName: GLSImpl.createGLSParser.ParseXMLString.test
296     @@enDesc:
297     Since there is at least one implementation of the feature (i.e.
298     this class), the <M::gls|GLSImplementation.createGLSParser>
299     must not throw an exception.
300     @@PerlDef:
301     my $impl;
302     __CODE{DOMLS|createImplForTest:: $impl => $impl}__;
303    
304     my $p = $impl-><M::gls|GLSImplementation.createGLSParser>
305     ({<Q::fe|ParseXMLString> => '1.0'});
306    
307     $test->assert_not_null ($p);
308     @Test:
309     @@QName: GLSImpl.createGLSParser.LS.ParseXMLString.test
310     @@enDesc:
311     Since there is at least one implementation of the feature (i.e.
312     this class), the <M::gls|GLSImplementation.createGLSParser>
313     must not throw an exception.
314     @@PerlDef:
315     my $impl;
316     __CODE{DOMLS|createImplForTest:: $impl => $impl}__;
317    
318     my $p = $impl-><M::gls|GLSImplementation.createGLSParser>
319     ({LS => '3.0', <Q::fe|ParseXMLString> => '1.0'});
320    
321     $test->assert_isa ($p, <IFName::LSParser>);
322    
323     @Test:
324     @@QName: DOMImplLS.createLSParser.1.test
325     @@enDesc:
326     Since there is at least one implementation of the feature (i.e.
327     this class), the <M::gls|GLSImplementation.createGLSParser>
328     must not throw an exception.
329     @@PerlDef:
330     my $impl;
331     __CODE{DOMLS|createImplForTest:: $impl => $impl}__;
332    
333     my $p = $impl-><M::DOMLS|DOMImplementationLS.createLSParser>
334     (<C::DOMLS|DOMImplementationLS.MODE_SYNCHRONOUS>);
335     $test->assert_isa ($p, <IFName::LSParser>);
336     @enImplNote:
337     @@ddid: lsparsertext
338     @@@:
339     Future version should add test:
340     @@QName: DOMImplLS.createLSParser.2.test
341     @@enDesc:
342     Since there is at least one implementation of the feature (i.e.
343     this class), the <M::gls|GLSImplementation.createGLSParser>
344     must not throw an exception.
345     @@PerlDef:
346     my $impl;
347     __CODE{DOMLS|createImplForTest:: $impl => $impl}__;
348    
349     my $p = $impl-><M::DOMLS|DOMImplementationLS.createLSParser>
350     (<C::DOMLS|DOMImplementationLS.MODE_SYNCHRONOUS>,
351     <Q::xml-dtd:>);
352     $test->assert_isa ($p, <IFName::LSParser>);
353 wakaba 1.3
354 wakaba 1.27 @Test:
355     @@QName: Perl.open.utf8.strref.1.test
356     @@enDesc:
357     Does PerlIO works as intended?
358     @@PerlDef:
359     my $s = qq<\x{3001}\x0A\x{10001}>;
360     #open my $a, '<'.':utf8', \$s;
361     require IO::String;
362     my $a = IO::String->new ($s);
363     $test->assert_num_equals
364     (actual_value => ord getc $a,
365     expected_value => 0x3001);
366     $test->assert_num_equals
367     (actual_value => ord getc $a,
368     expected_value => 0x000A);
369     $test->assert_num_equals
370     (actual_value => ord getc $a,
371     expected_value => 0x10001);
372     $a->ungetc (0x10001);
373     $test->assert_num_equals
374     (actual_value => ord getc $a,
375     expected_value => 0x10001);
376     $test->assert_null (getc $a);
377     close $a;
378     @Test:
379     @@QName: Perl.open.8859.strref.2.test
380     @@enDesc:
381     Does PerlIO works as intended?
382     @@PerlDef:
383     my $s = qq<\x{0080}\x0A\x{00A9}>;
384     #open my $a, '<', \$s;
385     require IO::String;
386     my $a = IO::String->new ($s);
387     $test->assert_num_equals
388     (actual_value => ord getc $a,
389     expected_value => 0x0080);
390     $test->assert_num_equals
391     (actual_value => ord getc $a,
392     expected_value => 0x000A);
393     $test->assert_num_equals
394     (actual_value => ord getc $a,
395     expected_value => 0x00A9);
396     $a->ungetc (0x00A9);
397     $test->assert_num_equals
398     (actual_value => ord getc $a,
399     expected_value => 0x00A9);
400     $test->assert_null (getc $a);
401     close $a;
402    
403 wakaba 1.1 @Attr:
404     @@Name: domConfig
405     @@enDesc:
406     The configuration of the parser.
407    
408     @@Get:
409     @@@Type: DOMCore|DOMConfiguration
410     @@@enDesc: The DOM configuration object.
411     @@@PerlDef:
412     __CODE{DOMCore|getConfigObject::
413     $target => $self,
414     $targetHash => $self,
415 wakaba 1.27 $targetType => {<ClassName::xp|ManakaiXMLParser>},
416 wakaba 1.1 $result => $r,
417     }__;
418    
419 wakaba 1.27 @Attr:
420     @@ForCheck: ManakaiDOM|ForClass
421     @@Name: async
422     @@enDesc:
423     Whether the parser is asynchronous or not.
424     @@Type: idl|boolean||ManakaiDOM|all
425     @@Get:
426     @@@FalseCase:
427     @@@@enDesc:
428     The parser does not in asynchronous mode.
429     @@@PerlDef: \
430     @@Test:
431     @@@QName: XMLParser.async.test
432     @@@PerlDef:
433     my $xp;
434     __CODE{createParserForTest:: $xp => $xp}__;
435    
436     $test->assert_false ($xp-><AG::DOMLS|LSParser.async>);
437    
438     @Attr:
439     @@ForCheck: ManakaiDOM|ForClass
440     @@Name: busy
441     @@enDesc:
442     Whether the parser is currently busy loading a document or not.
443     @@Type: idl|boolean||ManakaiDOM|all
444     @@Get:
445     @@@TrueCase:
446     @@@@enDesc:
447     The parser is currently busy.
448     @@@FalseCase:
449     @@@@enDesc:
450     The parser is not busy.
451     @@@PerlDef:
452     $r = $self->{<H::DOMLS|busy>};
453    
454     @enImplNote:
455     @@ddid: abort
456     @@@:
457     {ISSUE::
458     LSParser.abort:
459    
460     Is it required to support even in synchronous mode?
461     }
462    
463     {TODO::
464     LSParser.filter
465     }
466    
467     @ResourceDef:
468     @@QName: createParserForTest
469     @@ForCheck: ManakaiDOM|ForClass
470     @@rdf:type: DISPerl|BlockCode
471     @@PerlDef:
472     require Message::DOM::GenericLS;
473     $xp = <Class::ManakaiXMLParser>
474     ->new (<Class::gls|ManakaiGLSImplementation>->_new, '');
475    
476 wakaba 1.1 @Method:
477     @@ManakaiDOM:isForInternal:1
478     @@ForCheck: ManakaiDOM|ForClass
479     @@Operator: DISPerl|NewMethod
480     @@enDesc:
481     Creates a new instance of the object.
482     @@Param:
483     @@@Name: impl
484 wakaba 1.11 @@@Type: gls|GLSImplementation
485 wakaba 1.1 @@@enDesc:
486     The implementation from which the parser is created.
487     @@Param:
488     @@@Name: features
489     @@@Type: DOMString
490     @@@dis:actualType: f|FeaturesString
491     @@@enDesc:
492     The set of features requested for the parser.
493     @@Return:
494     @@@Type: DOMMain|DOMObject
495     @@@dis:actualType: LSParser
496     @@@enDesc:
497     The newly created parser.
498     @@@PerlDef:
499     $r = bless {
500 wakaba 1.35 <H::f|implementation> => $impl,
501 wakaba 1.1 }, $self;
502    
503     @Method:
504 wakaba 1.27 @@Name: parseURI
505     @@enDesc:
506     Parses an XML document identified by a DOM URI.
507 wakaba 1.1
508 wakaba 1.27 It is equivalent to <M::.parse> method with its <P::input>
509     parameter set to a <IF::LSInput> object whose
510     <A::LSInput.systemId> set to <P::uri>.
511 wakaba 1.1 @@Param:
512 wakaba 1.27 @@@Name: uri
513 wakaba 1.1 @@@Type: DOMString
514 wakaba 1.27 @@@enDesc:
515     The DOM URI of the XML document to be read.
516 wakaba 1.1 @@Return:
517     @@@Type: Document
518 wakaba 1.27 @@@enDesc:
519     The newly created and populated <IF::Document> node.
520     @@@dx:raises:
521     @@@@@: ManakaiDOMLS|MDOMLS_BUSY
522     @@@@enDesc:
523     If <A::LSParser.busy> is <DOM::true>.
524     @@@dx:raises:
525     @@@@@: DOMLS|PARSE_ERR
526     @@@@enDesc:
527     If the <IF::LSParser> was unable to load the document.
528     @@@PerlDef:
529     __DEEP{
530     $r = $self-><M::LSParser.parse> ({system_id => $uri});
531     }__;
532    
533     @Method:
534     @@Name: parse
535     @@enDesc:
536     Parses an XML document from a resource identified
537     by a <IF::LSInput>.
538     @@Param:
539     @@@Name: input
540     @@@Type: LSInput
541     @@@enDesc:
542     The <IF::LSInput> from which the source of the document
543     is to be read.
544     @@Return:
545     @@@Type: Document
546     @@@enDesc:
547     The newly created and populated <IF::Document> node.
548     @@@dx:raises:
549     @@@@@: ManakaiDOMLS|MDOMLS_BUSY
550     @@@@enDesc:
551     If the <A::LSParser.busy> is <DOM::true>.
552     @@@dx:raises:
553     @@@@@: DOMLS|PARSE_ERR
554     @@@@enDesc:
555     If the <IF::LSParser> was unable to load the document.
556 wakaba 1.1 @@@PerlDef:
557 wakaba 1.27 if ($self->{<H::DOMLS|busy>}) {
558     __EXCEPTION{ManakaiDOMLS|MDOMLS_BUSY}__;
559     }
560     local $self->{<H::DOMLS|busy>} = true;
561    
562     my $in;
563     __DEEP{
564     $self->{parser_cfg} = $self-><AG::LSParser.domConfig>;
565     ## Parser's |domConfig| object.
566     $self->{in_in} = $self->{parser_cfg}
567     -><M::c|DOMConfiguration.getParameter>
568     (<Q::xp|ls-input-to-input-file>);
569     $in = $self->{in_in}-><M::ManakaiDOMLSInputToInputFile.resolveLSInput>
570     ($input,
571     $self->{parser_cfg}
572     -><M::c|DOMConfiguration.getParameter>
573     ('error-handler'));
574     }__;
575     unless (defined $in) {
576     __c|ERROR{DOMLS|no-input-specified::
577     MDOMX:param-name => 'input',
578     }__;
579     __CODE{ParseError}__;
580     }
581    
582     require IO::Handle;
583 wakaba 1.1
584     $self->{char} = [];
585     $self->{token} = [];
586 wakaba 1.6 $self->{entity} = [{
587 wakaba 1.27 fh => $in-><AG::ManakaiDOMInputFile.filehandle>,
588     base_uri => $in-><AG::ManakaiDOMInputFile.baseURI>,
589     doc_uri => $in-><AG::ManakaiDOMInputFile.documentURI>,
590 wakaba 1.6 line => 1,
591     column => 1,
592     pos => 0,
593 wakaba 1.27 close_file => sub { $in-><M::ManakaiDOMInputFile.close> },
594     reptxt => \'',
595     is_external_entity => true,
596 wakaba 1.6 }];
597 wakaba 1.27 ## Entity stack.
598 wakaba 1.14 $self->{location} = $self->{entity}->[-1];
599 wakaba 1.27 ## Parsing location object as required by DPG.
600     ## It must always be equal to |{entity}->[-1]|.
601 wakaba 1.6 $self->{entity_char} = [];
602 wakaba 1.27 ## Stack for |{char}| stacks analog to |{entity}| stack.
603 wakaba 1.6 $self->{entity_token} = [];
604 wakaba 1.27 ## Stack for |{token}| stacks analog to |{entity}| stack.
605 wakaba 1.3 $self->{xml_version} = '1.0';
606 wakaba 1.27 ## Document XML version: either |1.0| or |1.1|.
607 wakaba 1.3 $self->{standalone} = false;
608 wakaba 1.27 ## True iff |standalone=yes| is explicitly specified.
609 wakaba 1.19 $self->{has_xref} = false;
610 wakaba 1.27 ## There is an unread external entity.
611     $self->{dont_process} = false;
612     ## So, don't process |ENTITY| and |ATTLIST| declarations.
613 wakaba 1.11 $self->{general_entity} = {
614     lt => {is_predefined => true},
615     gt => {is_predefined => true},
616     amp => {is_predefined => true},
617     quot => {is_predefined => true},
618     apos => {is_predefined => true},
619     };
620 wakaba 1.27 ## Declared general entities.
621 wakaba 1.6 $self->{param_entity} = {};
622 wakaba 1.27 ## Declared parameter entities.
623 wakaba 1.9 $self->{attr} = {};
624     # $self->{attr}->{$element_type_name}->{$attr_name} = $attr_def
625 wakaba 1.27 ## Declared attributes.
626 wakaba 1.1
627     __DEEP{
628 wakaba 1.35 $r = $self->{<H::f|implementation>}-><M::DOMImpl.createDocument>;
629 wakaba 1.11 $self->{doc} = $r;
630 wakaba 1.27 ## |Document| object.
631     CORE::delete $self->{docx};
632     ## |DocumentXDoctype| object (if necessary).
633 wakaba 1.21 $self->{doc_cfg} = $r-><AG::Document.domConfig>;
634 wakaba 1.27 ## |Document|'s configuration.
635 wakaba 1.11 CORE::delete $self->{dtdef};
636 wakaba 1.27 ## |DocumentTypeDefinition| object (if created).
637 wakaba 1.17 CORE::delete $self->{dtdecl};
638 wakaba 1.27 ## |DocumentTypeDeclaration| object (if created).
639 wakaba 1.21
640     $r-><AS::Document.strictErrorChecking> (false);
641     ## NOTE: Any checks such as |Name| validity done by
642     ## methods on DOM nodes are disabled. It might result
643     ## in creating an ill-formed DOM tree when parser
644     ## errors are traped by |error-handler|.
645     $self->{doc_cfg}-><M::c|DOMConfiguration.setParameter>
646     (<Q::cfg|clone-entity-reference-subtree> => true);
647     ## NOTE: Turn this configuration parameter on makes
648     ## entity reference subtrees in attribute default values
649     ## cloned as is into default attribute node subtrees.
650 wakaba 1.26 $self->{doc_cfg}-><M::c|DOMConfiguration.setParameter>
651 wakaba 1.36 (<Q::cfg|dtd-default-attribute> => false);
652 wakaba 1.26 ## NOTE: Don't create DTD default attributes by
653     ## |createElementNS| method.
654     $self->{doc_cfg}-><M::c|DOMConfiguration.setParameter>
655 wakaba 1.30 (<Q::cfg|xml-id> => $self->{parser_cfg}
656     -><M::c|DOMConfiguration.getParameter>
657     (<Q::cfg|xml-id>));
658     $self->{doc_cfg}-><M::c|DOMConfiguration.setParameter>
659 wakaba 1.26 ('error-handler' => sub {
660     my (undef, $err) = @_;
661     return ($err-><AG::c|DOMError.severity> !=
662     <C::c|DOMError.SEVERITY_FATAL_ERROR>);
663     })
664     unless $Message::DOM::XMLParser::DEBUG;
665 wakaba 1.29 ## NOTE: The default error handler in manakai |warn|s error
666 wakaba 1.26 ## description.
667 wakaba 1.11
668 wakaba 1.29 ## Document entity's URI and base URI
669     $r-><AS::Document.documentURI> ($self->{entity}->[0]->{doc_uri});
670     $r-><AS::Document.manakaiEntityBaseURI>
671     ($self->{entity}->[0]->{base_uri});
672    
673 wakaba 1.11 ## Document entity -> |Document| node
674     $self->_parse_DocumentEntity;
675    
676 wakaba 1.27 for (@{$self->{entity}}) {
677     $_->{close_file}->();
678     ## NOTE: There should be only the document entity.
679     }
680    
681 wakaba 1.11 ## Replacement tree for general |Entity| nodes
682 wakaba 1.34 if ($self->{parser_cfg}-><M::c|DOMConfiguration.getParameter>
683     (<Q::cfg|entity-replacement-tree>)) {
684     my @ent = values %{$self->{general_entity}};
685     for my $ent (@ent) {
686     if (exists $ent->{has_replacement_text}) {
687 wakaba 1.11 my $ent_name = $ent->{name};
688     $self->{entity} = [<Code::getCopyOfEntityState::
689     $entity_type = 'general_entity',
690     $entity_name = $ent_name>];
691 wakaba 1.14 $self->{location} = $self->{entity}->[-1];
692 wakaba 1.11 $self->{token} = [];
693     $self->{char} = [];
694 wakaba 1.23 local $ent->{is_opened} = true;
695 wakaba 1.11 ## TODO: External entity support
696 wakaba 1.35 $ent->{node}-><M::Node.manakaiSetReadOnly> (false, true);
697 wakaba 1.11 $self->_parse_InternalGeneralParsedEntity ($ent->{node});
698 wakaba 1.35 $ent->{node}-><AS::GE.hasReplacementTree> (true);
699     $ent->{node}-><M::Node.manakaiSetReadOnly> (true, true);
700 wakaba 1.27 $self->{entity}->[-1]->{close_file}->();
701 wakaba 1.35 ## ISSUE: Should errors detected by this phase result
702     ## in |DOMLS:PARSE_ERR| exception thrown?
703     }
704 wakaba 1.34 }
705     } # cfg|entity-replacement-tree
706 wakaba 1.11
707 wakaba 1.21 ## Turns flags to their default value
708     $self->{doc_cfg}-><M::c|DOMConfiguration.setParameter>
709     (<Q::cfg|clone-entity-reference-subtree> => null);
710 wakaba 1.26 $self->{doc_cfg}-><M::c|DOMConfiguration.setParameter>
711 wakaba 1.36 (<Q::cfg|dtd-default-attribute> => null);
712 wakaba 1.26 $self->{doc_cfg}-><M::c|DOMConfiguration.setParameter>
713 wakaba 1.30 (<Q::cfg|xml-id> => null);
714     $self->{doc_cfg}-><M::c|DOMConfiguration.setParameter>
715 wakaba 1.26 ('error-handler' => null);
716 wakaba 1.11 $r-><AS::Document.strictErrorChecking> (true);
717 wakaba 1.1 }__;
718    
719     @Method:
720     @@Name: shiftChar
721     @@ManakaiDOM:isForInternal:1
722     @@ForCheck: ManakaiDOM|ForClass
723     @@enDesc:
724     Returns the next character.
725     @@Return:
726     @@@Type: idl|long||ManakaiDOM|all
727     @@@enDesc:
728     The code position number of the next character, if any,
729 wakaba 1.6 or <CODE::-1>.
730 wakaba 1.1 @@@PerlDef:
731     if (@{$self->{char}}) {
732     $r = shift @{$self->{char}};
733     } else {
734 wakaba 1.6 GETCHAR: {
735 wakaba 1.27 no warnings 'closed'; # getc() on closed filehandle warning
736     my $ent = $self->{entity}->[-1];
737 wakaba 1.32 my $char = $ent->{fh}->getc;
738 wakaba 1.6
739 wakaba 1.7 if (defined $char and length $char) {
740 wakaba 1.27 $ent->{pos}++;
741 wakaba 1.6 $r = ord $char;
742     if ($r == 0x000A) {
743 wakaba 1.27 $ent->{line}++;
744     $ent->{column} = 1;
745 wakaba 1.6 } elsif ($r == 0x000D) {
746 wakaba 1.32 my $next_char = $ent->{fh}->getc;
747 wakaba 1.6 if ($next_char eq "\x0A") {
748 wakaba 1.27 if ($ent->{is_external_entity}) {
749     $ent->{pos}++;
750     $ent->{line}++;
751     $ent->{column} = 1;
752     $r = 0x000A; # ^ U+000D U+000A -> U+000A ^
753     } else { # Internal entity
754     $ent->{column}++;
755     ## Line number will be increased by next |shiftChar|.
756     $ent->{fh}->ungetc (0x000A);
757     #$r = 0x000D; # ^ U+000D U+000A -> U+000D ^ U+000A
758     # no change
759     }
760 wakaba 1.6 } elsif ($next_char eq "\x85") {
761     if ($self->{xml_version} eq '1.1') {
762 wakaba 1.27 if ($ent->{is_external_entity}) {
763     if ($ent->{no_xml11_eol}) {
764     my $location = {
765     utf32_offset => $ent->{pos} - 1,
766     line_number => $ent->{line},
767     column_number => $ent->{column},
768     };
769     my $continue = __c|ERROR{
770     xp|fatal-xml11-end-of-line-in-xml-declaration::
771     c|location => {$location},
772     xp|character-number => {$r},
773     }__;
774     unless ($continue) {
775     __CODE{ParseError}__;
776     }
777     } # no_xml11_eol
778     $ent->{pos}++;
779     $ent->{line}++;
780     $ent->{column} = 1;
781     $r = 0x000A; # ^ U+000D U+0085 -> U+000A ^
782     } else { # internal entity
783     $ent->{column}++;
784     ## Line number will be increased by next |shiftChar|.
785     $ent->{fh}->ungetc (0x0085);
786     #$r = 0x000D; # ^ U+000D U+0085 -> U+000D ^ U+0085
787     # no change
788     }
789     } else { # XML 1.0
790 wakaba 1.16 ## |no_xml11_eol| will be tested later.
791 wakaba 1.27 $ent->{column}++;
792     ## Line number will be increased by next |shiftChar|.
793     $ent->{fh}->ungetc (0x0085);
794     $r = 0x000A if $ent->{is_external_entity};
795     # external: ^ U+000D U+0085 -> U+000A ^ U+0085
796     # internal: ^ U+000D U+0085 -> U+000D ^ U+0085 (as is)
797 wakaba 1.6 }
798 wakaba 1.27 } else { # neither U+000A nor U+0085
799     $ent->{line}++;
800     $ent->{column} = 1;
801     $ent->{fh}->ungetc (ord $next_char);
802     $r = 0x000A if $ent->{is_external_entity};
803     # external: ^ U+000D _ -> U+000A ^ _
804     # internal: ^ U+000D _ -> U+000D ^ _ (as is)
805 wakaba 1.6 }
806 wakaba 1.27 } elsif ($r == 0x0085 or $r == 0x2028) {
807     if ($ent->{no_xml11_eol}) {
808     my $location = {
809     utf32_offset => $ent->{pos} - 1,
810     line_number => $ent->{line},
811     column_number => $ent->{column},
812     };
813     my $continue = __c|ERROR{
814     xp|fatal-xml11-end-of-line-in-xml-declaration::
815     c|location => {$location},
816     xp|character-number => {$r},
817     }__;
818     unless ($continue) {
819     __CODE{ParseError}__;
820     }
821     } # no_xml11_eol
822     $r = 0x000A if $self->{xml_version} eq '1.1' and
823     $ent->{is_external_entity};
824     ## Even in XML 1.0 it increases the line number.
825     $ent->{line}++;
826     $ent->{column} = 1;
827 wakaba 1.6 } elsif (
828     not ((0x0020 <= $r and $r <= 0x007E) or
829     (0x00A0 <= $r and $r <= 0xD7FF) or
830     (0xE000 <= $r and $r <= 0xFFFD) or
831     (0x10000 <= $r and $r <= 0x10FFFF)) and
832 wakaba 1.27 $r != 0x0009 and
833     not (($self->{xml_version} eq '1.0' or
834     not $ent->{is_external_entity}) and
835     (0x007F <= $r and $r <= 0x009F)) and
836     not ($self->{xml_version} eq '1.1' and
837     not $ent->{is_external_entity} and
838     0x0001 <= $r and $r <= 0x001F)
839 wakaba 1.6 ) {
840     my $location = {
841 wakaba 1.27 utf32_offset => $ent->{pos} - 1,
842     line_number => $ent->{line},
843     column_number => $ent->{column},
844 wakaba 1.6 };
845 wakaba 1.27 my $continue = __c|ERROR{xp|wf-legal-literal-character::
846     c|location => {$location},
847 wakaba 1.6 xp|character-number => {$r},
848     }__;
849     unless ($continue) {
850 wakaba 1.27 __CODE{ParseError}__;
851 wakaba 1.3 }
852 wakaba 1.27 $ent->{column}++;
853     } else { # XML |Char|
854     $ent->{column}++;
855 wakaba 1.3 }
856     } else {
857 wakaba 1.6 $r = -1;
858 wakaba 1.3 }
859 wakaba 1.6 } # GETCHAR
860 wakaba 1.1 }
861    
862     @Method:
863     @@ManakaiDOM:isForInternal: 1
864     @@Operator: ManakaiDOM|MUErrorHandler
865     @@enDesc:
866     When a <IF::ecore|ErrorInterface||ManakaiDOM|Perl> is <Perl::report>ed,
867     then this method is invoked.
868    
869     The method calls the <cfg::DOMCore|error-handler> if the error is of
870     <IF::DOMCore|DOMError>. Otherwise, the error is re-thrown so that
871     corresponding <Perl::catch> clause, if any, can catch the error.
872     @@Param:
873     @@@Name: err
874     @@@Type: ecore|ErrorInterface||ManakaiDOM|Perl
875     @@@enDesc:
876     The reported error object.
877     @@Return:
878     @@@Type: DISPerl|Any
879     @@@enDesc:
880     If the <P::err> is a <IF::DOMCore|DOMError>, then the return value
881     of the error handler.
882    
883     {NOTE:: If the error is thrown, the method never returns.
884     }
885     @@@nullCase:
886     @@@@enDesc:
887     No error handler.
888     @@@PerlDef:
889     if ($err->isa (<IFName::DOMCore|DOMError||ManakaiDOM|ManakaiDOM>)) {
890     __DEEP{
891     A: {
892     my $cfg = $self-><AG::LSParser.domConfig>;
893     my $h = $cfg-><M::DOMCore|DOMConfiguration.getParameter>
894     ('error-handler');
895     $r = $h-><M::DOMCore|DOMErrorHandler.handleError> ($err);
896     } # A
897     }__;
898     } else {
899     $err-><M::ecore|ErrorInterface||ManakaiDOM|Perl.throw>;
900     }
901    
902     @DISPerl:dpgDef:
903    
904     /*
905     XML Document Entity
906    
907     document := prolog element *Misc
908     - *Char RestrictedChar *Char ;; [1]
909     */
910 wakaba 1.11 rule DocumentEntity : standalone {
911 wakaba 1.1 /*
912     prolog := XMLDecl? *Misc [doctypedecl *Misc] ;; [22]
913     */
914 wakaba 1.16 ?lexmode DocumentStart;
915 wakaba 1.11
916     my $doc;
917     lang:Perl {
918     $doc = $self->{doc};
919     }
920 wakaba 1.1
921 wakaba 1.3 ~? (XDO) {
922 wakaba 1.16 ?lexmode XMLDeclarationOrPI;
923     lang:Perl {
924     $self->{entity}->[-1]->{no_xml11_eol} = true;
925     }
926     ~ (S) { // XML declaration
927     &_XMLDeclaration_ ($doc => $doc);
928     ~ (PIC2) {
929     ?lexmode DocumentProlog;
930     } else {
931     ?lexmode DocumentProlog;
932     }
933     } (NameChar) { // Processing instruction whose target begins with |xml|
934     my $target_token;
935     lang:Perl ($v => $token.value) {
936     $target_token = $token;
937     $target_token->{value} = 'xml'.$target_token->{value};
938     $self->{entity}->[-1]->{no_xml11_eol} = false;
939     }
940     ?lexmode PINmtoken;
941     ~? (Nmtoken) {
942     lang:Perl ($v => $token.value) {
943     $target_token->{value} .= $v;
944     }
945     ?lexmode PIName;
946     }
947     lang:Perl {
948     $target_token->{type} = 'Name';
949     $target_token->{location_d} += 3; # 'xml'
950     unshift @{$self->{token}}, $token;
951     $token = $target_token;
952     }
953     &_ProcessingInstruction_ ($doc => $doc, $parent => $doc);
954     ~ (PIC) {
955     ?lexmode DocumentProlog;
956     } else {
957     ?lexmode DocumentProlog;
958     }
959 wakaba 1.3 } else {
960 wakaba 1.16 lang:Perl {
961     $self->{entity}->[-1]->{no_xml11_eol} = false;
962     }
963 wakaba 1.3 }
964     } else {
965     ?lexmode 'DocumentProlog';
966     }
967 wakaba 1.1
968     // *Misc
969 wakaba 1.2 ~* (CDO) {
970 wakaba 1.1 &_CommentDeclaration_ ($doc => $doc, $parent => $doc);
971    
972     ~ (MDC) {
973     ?lexmode DocumentProlog;
974     } else {
975     ?lexmode DocumentProlog;
976     }
977     } (PIO) {
978     &_ProcessingInstruction_ ($doc => $doc, $parent => $doc);
979    
980     ~ (PIC) {
981     ?lexmode 'DocumentProlog';
982     } else {
983     ?lexmode DocumentProlog;
984     }
985     } (S) {
986     //
987     }
988    
989     // doctypedecl
990     ~? (MDO) {
991     &_DocumentTypeDeclaration_ ($doc => $doc);
992    
993 wakaba 1.3 ~ (MDC) {
994     ?lexmode DocumentMisc;
995     } else {
996     ?lexmode DocumentMisc;
997     }
998     } else {
999     ?lexmode DocumentMisc;
1000 wakaba 1.1 }
1001 wakaba 1.25
1002     lang:Perl {
1003     $self->{doc}-><AS::Document.allDeclarationsProcessed> (true)
1004     unless $self->{dont_process};
1005     }
1006 wakaba 1.1
1007     // *Misc
1008 wakaba 1.2 ~* (CDO) {
1009 wakaba 1.1 &_CommentDeclaration_ ($doc => $doc, $parent => $doc);
1010    
1011     ~ (MDC) {
1012     ?lexmode DocumentMisc;
1013     } else {
1014     ?lexmode DocumentMisc;
1015     }
1016     } (PIO) {
1017     &_ProcessingInstruction_ ($doc => $doc, $parent => $doc);
1018    
1019     ~ (PIC) {
1020     ?lexmode 'DocumentMisc';
1021     } else {
1022     ?lexmode DocumentMisc;
1023     }
1024     } (S) {
1025     //
1026     }
1027    
1028     // Document element
1029     ~ (STAGO) {
1030     &Element_ ($doc => $doc, $parent => $doc)
1031     : unshift-current-token;
1032     ~ (TAGC) {
1033     ?lexmode DocumentEnd;
1034     } else {
1035     ?lexmode DocumentEnd;
1036     }
1037     } else {
1038     ?lexmode 'DocumentEnd';
1039     }
1040    
1041     // *Misc
1042 wakaba 1.2 ~* (CDO) {
1043 wakaba 1.1 &_CommentDeclaration_ ($doc => $doc, $parent => $doc);
1044    
1045     ~ (MDC) {
1046     ?lexmode DocumentEnd;
1047     } else {
1048     ?lexmode DocumentEnd;
1049     }
1050     } (PIO) {
1051     &_ProcessingInstruction_ ($doc => $doc, $parent => $doc);
1052     ~ (PIC) {
1053     ?lexmode 'DocumentEnd';
1054     } else {
1055     ?lexmode DocumentEnd;
1056     }
1057     } (S) {
1058     //
1059     }
1060    
1061     ~ (#EOF) { }
1062     } // DocumentEntity
1063 wakaba 1.11
1064     /*
1065     Internal General Parsed Entity
1066    
1067     An internal general parsed entity is well-formed if its
1068     replacement text matches the production labeled |content|.
1069     */
1070     rule InternalGeneralParsedEntity ($ent) : standalone {
1071     ?lexmode ElementContent;
1072    
1073     my $ns;
1074     lang:Perl {
1075     $ns = {
1076     xml => <Q::xml:>,
1077     xmlns => <Q::xmlns:>,
1078     };
1079     }
1080    
1081     &content ($parent => $ent, $ns => $ns);
1082    
1083     ~ (#EOF) { }
1084     } // InternalGeneralParsedEntity
1085    
1086 wakaba 1.1 /*
1087     XML Declaration
1088    
1089     XMLDecl := '<?xml' VersionInfo
1090     [EncodingDecl]
1091     [SDDecl]
1092     [S] '?>' ;; [23]
1093    
1094     NOTE: XML declaration is optional in XML 1.0
1095     while it is required in XML 1.1.
1096     */
1097 wakaba 1.16 rule _XMLDeclaration_ {
1098     // ~ (XDO) { }
1099 wakaba 1.3 ?lexmode XMLDeclaration;
1100 wakaba 1.16 //lang:Perl {
1101     // $self->{entity}->[-1]->{no_xml11_eol} = true;
1102     //}
1103     //~ (S) { }
1104 wakaba 1.3
1105     ~ (Name == 'version') {
1106     ~? (S) { }
1107     ~ (VI) { }
1108     ~? (S) { }
1109 wakaba 1.1
1110 wakaba 1.3 my $ver;
1111     my $bad_token;
1112    
1113     ~ (LIT) {
1114     ?lexmode AttributeValueLiteral;
1115    
1116     ~ (STRING) {
1117     lang:Perl ($version => $token.value) {
1118     $ver = $version;
1119     $bad_token = $token;
1120     }
1121     }
1122    
1123     ~ (LIT) {
1124     ?lexmode XMLDeclaration;
1125     }
1126     } (LITA) {
1127     ?lexmode AttributeValueLiteralA;
1128    
1129     ~ (STRING) {
1130     lang:Perl ($version => $token.value) {
1131     $ver = $version;
1132     $bad_token = $token;
1133     }
1134     }
1135    
1136     ~ (LITA) {
1137     ?lexmode XMLDeclaration;
1138     }
1139     }
1140    
1141     lang:Perl : has-error {
1142     unless ($ver eq '1.0' or $ver eq '1.1') {
1143     my $location;
1144     __CODE{xp|get-location-from-token::
1145     $token => {$bad_token},
1146     $result => {$location},
1147     }__;
1148     my $continue = __DOMCore:ERROR{xp|wf-unsupported-xml-version::
1149     DOMCore|location => {$location},
1150 wakaba 1.16 xp|parent => {$self->{doc}},
1151 wakaba 1.3 infoset|version => {$ver},
1152     xp|error-token => {$bad_token},
1153     }__;
1154     unless ($continue) {
1155 wakaba 1.27 __CODE{ParseError}__;
1156 wakaba 1.3 }
1157     }
1158 wakaba 1.16 $self->{doc}-><AS::Document.xmlVersion> ($ver);
1159 wakaba 1.3 $self->{xml_version} = $ver;
1160     }
1161    
1162     ~? (S) { }
1163 wakaba 1.1 }
1164    
1165 wakaba 1.3 ~? (Name == 'encoding') {
1166     ~? (S) { }
1167     ~ (VI) { }
1168     ~? (S) { }
1169    
1170     my $ver;
1171     my $bad_token;
1172    
1173     ~ (LIT) {
1174     ?lexmode AttributeValueLiteral;
1175    
1176     ~ (STRING) {
1177     lang:Perl ($version => $token.value) {
1178     $ver = $version;
1179     $bad_token = $token;
1180     }
1181     }
1182    
1183     ~ (LIT) {
1184     ?lexmode XMLDeclaration;
1185     }
1186     } (LITA) {
1187     ?lexmode AttributeValueLiteralA;
1188    
1189     ~ (STRING) {
1190     lang:Perl ($version => $token.value) {
1191     $ver = $version;
1192     $bad_token = $token;
1193     }
1194     }
1195    
1196     ~ (LITA) {
1197     ?lexmode XMLDeclaration;
1198     }
1199     }
1200    
1201     lang:Perl : has-error {
1202     unless ($ver =~ /\A[A-Za-z][A-Za-z0-9._-]*\z/) {
1203     my $location;
1204     __CODE{xp|get-location-from-token::
1205     $token => {$bad_token},
1206     $result => {$location},
1207     }__;
1208     my $continue = __DOMCore:ERROR{xp|wf-malformed-enc-name::
1209     DOMCore|location => {$location},
1210 wakaba 1.16 xp|parent => {$self->{doc}},
1211 wakaba 1.3 xp|name => {$ver},
1212     xp|error-token => {$bad_token},
1213     }__;
1214     unless ($continue) {
1215 wakaba 1.27 __CODE{ParseError}__;
1216 wakaba 1.3 }
1217     }
1218 wakaba 1.16 $self->{doc}-><AS::Document.xmlEncoding> ($ver);
1219 wakaba 1.3 }
1220    
1221     ~? (S) { }
1222 wakaba 1.1 }
1223 wakaba 1.3
1224     ~? (Name == 'standalone') {
1225     ~? (S) { }
1226     ~ (VI) { }
1227     ~? (S) { }
1228    
1229     my $ver;
1230     my $bad_token;
1231    
1232     ~ (LIT) {
1233     ?lexmode AttributeValueLiteral;
1234    
1235     ~ (STRING) {
1236     lang:Perl ($version => $token.value) {
1237     $ver = $version;
1238     $bad_token = $token;
1239     }
1240     }
1241    
1242     ~ (LIT) {
1243     ?lexmode XMLDeclaration;
1244     }
1245     } (LITA) {
1246     ?lexmode AttributeValueLiteralA;
1247    
1248     ~ (STRING) {
1249     lang:Perl ($version => $token.value) {
1250     $ver = $version;
1251     $bad_token = $token;
1252     }
1253     }
1254 wakaba 1.1
1255 wakaba 1.3 ~ (LITA) {
1256     ?lexmode XMLDeclaration;
1257     }
1258     }
1259    
1260     lang:Perl : has-error {
1261     unless ($ver eq 'yes' or $ver eq 'no') {
1262     my $location;
1263     __CODE{xp|get-location-from-token::
1264     $token => {$bad_token},
1265     $result => {$location},
1266     }__;
1267     my $continue = __DOMCore:ERROR{xp|wf-malformed-xml-standalone::
1268     DOMCore|location => {$location},
1269 wakaba 1.16 xp|parent => {$self->{doc}},
1270 wakaba 1.3 xp|name => {$ver},
1271     xp|error-token => {$bad_token},
1272     }__;
1273     unless ($continue) {
1274 wakaba 1.27 __CODE{ParseError}__;
1275 wakaba 1.3 }
1276     }
1277 wakaba 1.13 if ($ver eq 'yes') {
1278 wakaba 1.16 $self->{doc}-><AS::Document.xmlStandalone> (true);
1279 wakaba 1.13 $self->{standalone} = true;
1280     }
1281 wakaba 1.3 }
1282    
1283     ~? (S) { }
1284     }
1285    
1286 wakaba 1.16 ~ (PIC1) {
1287     lang:Perl {
1288     $self->{entity}->[-1]->{no_xml11_eol} = false;
1289     }
1290     } else {
1291     lang:Perl {
1292     $self->{entity}->[-1]->{no_xml11_eol} = false;
1293     }
1294     }
1295    
1296     // ~ (PIC2) { }
1297 wakaba 1.3 } // _XMLDeclaration_
1298 wakaba 1.1
1299     /*
1300     Comment Declaration
1301    
1302     Comment := '<!--' *(Char - '-' / '-' (Char - '-'))
1303     '-->' ;; [15]
1304 wakaba 1.4 */
1305 wakaba 1.1 rule _CommentDeclaration_ ($doc, $parent) {
1306     ?lexmode 'CommentDeclaration';
1307    
1308     ~? (STRING) {
1309     lang:Perl ($data => $token.value) {
1310     my $com = $doc-><M::Document.createComment> ($data);
1311     $parent-><M::Node.appendChild> ($com);
1312     }
1313     } else {
1314     lang:Perl {
1315     my $com = $doc-><M::Document.createComment> ('');
1316     $parent-><M::Node.appendChild> ($com);
1317     }
1318     }
1319    
1320     ~ (COM) {
1321     ?lexmode MarkupDeclaration;
1322     } else {
1323     ?lexmode MarkupDeclaration;
1324     }
1325    
1326     // ~ (MDC) { }
1327 wakaba 1.4 } // _CommentDeclaration
1328 wakaba 1.15
1329     rule _CommentDeclarationDTD {
1330     ?lexmode CommentDeclaration;
1331 wakaba 1.4
1332     ~? (STRING) {
1333     //
1334     }
1335    
1336     ~ (COM) {
1337     ?lexmode MarkupDeclaration;
1338     } else {
1339     ?lexmode MarkupDeclaration;
1340     }
1341    
1342     ~ (MDC) {
1343     ?lexmode DTD;
1344     } else {
1345     ?lexmode DTD;
1346     }
1347     } // _CommentDeclarationDTD
1348    
1349 wakaba 1.1 /*
1350     Processing Instruction
1351    
1352     PI := '<?' PITarget [S *Char - *Char '?>' *Char]
1353     '?>' ;; [16]
1354     */
1355     rule _ProcessingInstruction_ ($doc, $parent) {
1356     ?lexmode 'PIName';
1357    
1358     my $pi;
1359    
1360     ~ (Name) {
1361 wakaba 1.3 lang:Perl ($name => $token.value) : has-error {
1362 wakaba 1.1 if (lc $name eq 'xml') {
1363 wakaba 1.3 my $location;
1364     __CODE{xp|get-location-from-token::
1365     $token => {$token},
1366     $result => {$location},
1367     }__;
1368     my $continue = __DOMCore:ERROR{xp|wf-pi-target-is-xml::
1369     xp|name => {$name},
1370     DOMCore|location => {$location},
1371     xp|parent => {$parent},
1372     }__;
1373     unless ($continue) {
1374 wakaba 1.27 __CODE{ParseError}__;
1375 wakaba 1.3 }
1376 wakaba 1.1 }
1377 wakaba 1.26 __CODE{checkNCName:: $name => $name}__;
1378    
1379 wakaba 1.1 $pi = $doc-><M::Document.createProcessingInstruction>
1380     ($name);
1381     }
1382 wakaba 1.14 } else {
1383     lang:Perl {
1384     $pi = $doc-><M::Document.createProcessingInstruction> ('#INVALID');
1385     }
1386 wakaba 1.1 }
1387    
1388 wakaba 1.14 ~? (S) {
1389 wakaba 1.1 ?lexmode 'PIData';
1390    
1391     my $tdata;
1392    
1393     ~? (DATA) {
1394     lang:Perl ($data => $token.value) {
1395     $tdata = $data;
1396     }
1397     } else {
1398     lang:Perl {
1399     $tdata = '';
1400     }
1401     }
1402    
1403     lang:Perl {
1404     $pi-><AS::Node.nodeValue> ($tdata);
1405     }
1406     }
1407    
1408     lang:Perl {
1409     $parent-><M::Node.appendChild> ($pi);
1410     }
1411    
1412     // ~ (PIC) { }
1413     } // _ProcessingInstruction_
1414 wakaba 1.4
1415 wakaba 1.6 /*
1416     Processing instruction in DTD
1417     */
1418     rule _ProcessingInstructionDTD ($doc, $doctype) {
1419 wakaba 1.4 ?lexmode 'PIName';
1420 wakaba 1.6
1421     my $pi;
1422 wakaba 1.4
1423     ~ (Name) {
1424 wakaba 1.6 lang:Perl ($name => $token.value) : has-error {
1425     if (lc $name eq 'xml') {
1426     my $location;
1427     __CODE{xp|get-location-from-token::
1428     $token => {$token},
1429     $result => {$location},
1430     }__;
1431     my $continue = __DOMCore:ERROR{xp|wf-pi-target-is-xml::
1432     xp|name => {$name},
1433     DOMCore|location => {$location},
1434     xp|parent => {$doctype},
1435     }__;
1436     unless ($continue) {
1437 wakaba 1.27 __CODE{ParseError}__;
1438 wakaba 1.6 }
1439     }
1440 wakaba 1.26 __CODE{checkNCName:: $name => $name}__;
1441    
1442 wakaba 1.6 $pi = $doc-><M::Document.createProcessingInstruction>
1443     ($name);
1444 wakaba 1.35 $pi-><AS::tx|ProcessingInstruction.manakaiBaseURI>
1445 wakaba 1.29 ($self->{location}->{base_uri});
1446 wakaba 1.6 }
1447 wakaba 1.14 } else {
1448     lang:Perl {
1449     $pi = $doc-><M::Document.createProcessingInstruction> ('#INVALID');
1450     }
1451 wakaba 1.4 }
1452    
1453 wakaba 1.14 ~? (S) {
1454 wakaba 1.4 ?lexmode 'PIData';
1455    
1456 wakaba 1.6 my $tdata;
1457    
1458 wakaba 1.4 ~? (DATA) {
1459 wakaba 1.6 lang:Perl ($data => $token.value) {
1460     $tdata = $data;
1461     }
1462     } else {
1463     lang:Perl {
1464     $tdata = '';
1465     }
1466     }
1467    
1468     lang:Perl {
1469     $pi-><AS::Node.nodeValue> ($tdata);
1470 wakaba 1.4 }
1471     }
1472    
1473 wakaba 1.6 lang:Perl {
1474     $doctype-><M::Node.appendChild> ($pi);
1475     }
1476    
1477 wakaba 1.4 ~ (PIC) {
1478     ?lexmode DTD;
1479     } else {
1480     ?lexmode DTD;
1481     }
1482     } // _ProcessingInstructionDTD
1483 wakaba 1.1
1484     /*
1485     Element content parsing mode
1486    
1487     element := EmptyElemTag /
1488     STag content ETag ;; [39]
1489     content := (CharData / element / Reference / CDSect /
1490     PI / Comment) ;; [43]
1491     */
1492 wakaba 1.6 rule Element_ ($doc, $parent, $ns) : standalone {
1493 wakaba 1.1 ?lexmode 'ElementContent';
1494    
1495     my $node; // Current "parent" node
1496     my $nodes; // Node stack (w/o $current_node)
1497     my $type; // Current "parent" element type QName
1498     my $types; // Element type stack (w/o $current_type)
1499 wakaba 1.6 //my $ns; // Current in-scope namespace bindings
1500 wakaba 1.1 my $nses; // Namespace binding stack (w/o $current_ns)
1501    
1502     lang:Perl {
1503     $node = $parent;
1504     $nodes = [];
1505     $type = '';
1506     $types = [];
1507 wakaba 1.6 $ns ||= {
1508 wakaba 1.1 xml => <Q::xml:>,
1509     xmlns => <Q::xmlns:>,
1510     };
1511     $nses = [];
1512     }
1513    
1514     ~* : name => CONTENT
1515     (CharData) {
1516     // Character data
1517     lang:Perl ($data => $token.value) {
1518 wakaba 1.31 $node-><M::Node.manakaiAppendText> (\($data));
1519 wakaba 1.1 }
1520     } (STAGO) {
1521     // Start tag or empty element tag
1522    
1523     ?lexmode 'StartTag';
1524    
1525     ~ (Name) {
1526     my $attrs;
1527 wakaba 1.26 lang:Perl ($name => $token.value) : has-error {
1528     __CODE{checkQName:: $name => $name}__;
1529 wakaba 1.1 push @{$types}, $type;
1530     $type = $name;
1531     $attrs = {};
1532     }
1533    
1534     ~? (S) {
1535     &AttributeSpecificationList
1536     ($doc => $doc, $attrs => $attrs);
1537     }
1538    
1539     my $el;
1540 wakaba 1.9
1541     /*
1542     Note that this implementation does not perform
1543     attribute value tokenization (but does white space
1544     normalization common to attribute types) and
1545     construct the tree as is. DOM Level 3 Core spec
1546     is unclear on this point. With tokenization,
1547     entity references cannot be preserved.
1548    
1549     The manakai Node.nodeValue and Attr.value attributes
1550     do tokenization according to attribute types.
1551     */
1552    
1553     /*
1554     ISSUE: Should |xml:id| attribute be typed?
1555     */
1556 wakaba 1.1
1557     lang:Perl {
1558     push @{$nses}, $ns;
1559     $ns = {%$ns};
1560 wakaba 1.26
1561     ## Default attributes
1562     DA: for my $atqname (%{$self->{attr}->{$type}}) {
1563     next DA unless $self->{attr}->{$type}->{$atqname};
1564     next DA if exists $attrs->{$atqname}; # specified
1565     my $dtype = $self->{attr}->{$type}->{$atqname}
1566     -><AG::ATDef.defaultType>;
1567     next DA unless $dtype == <C::ATDef.EXPLICIT_DEFAULT> or
1568     $dtype == <C::ATDef.FIXED_DEFAULT>;
1569     $attrs->{$atqname} = {is_default => true, nodes => []};
1570     for (@{$self->{attr}->{$type}->{$atqname}
1571     -><AG::Node.childNodes>}) {
1572     push @{$attrs->{$atqname}->{nodes}},
1573     $_-><M::Node.cloneNode> (true);
1574     }
1575     }
1576 wakaba 1.1
1577     my %gattr;
1578     my %lattr;
1579     for my $atqname (keys %$attrs) {
1580     my ($pfx, $lname) = split /:/, $atqname;
1581 wakaba 1.9 $attrs->{$atqname}->{def} = $self->{attr}->{$type}->{$atqname};
1582 wakaba 1.1 if (defined $lname) { ## Global attribute
1583     if ($pfx eq 'xmlns') {
1584 wakaba 1.26 my $nsuri = $attrs->{$atqname}->{is_default}
1585     ? $attrs->{$atqname}->{def}-><AG::Node.nodeValue>
1586     : $attrs->{$atqname}->{value};
1587     if (not $attrs->{$atqname}->{is_default} and
1588     $attrs->{$atqname}->{def}) {
1589 wakaba 1.9 my $dt = $attrs->{$atqname}->{def}-><AG::ATDef.declaredType>;
1590     if ({
1591     <C::ATDef.ID_ATTR> => true,
1592     <C::ATDef.IDREF_ATTR> => true,
1593     <C::ATDef.IDREFS_ATTR> => true,
1594     <C::ATDef.ENTITY_ATTR> => true,
1595     <C::ATDef.ENTITIES_ATTR> => true,
1596     <C::ATDef.NMTOKEN_ATTR> => true,
1597     <C::ATDef.NMTOKENS_ATTR> => true,
1598     <C::ATDef.NOTATION_ATTR> => true,
1599     <C::ATDef.ENUMERATION_ATTR> => true,
1600     }->{$dt}) {
1601     ## Tokenization (XML 1 3.3.3)
1602 wakaba 1.26 for ($nsuri) {
1603 wakaba 1.9 s/^\x20+//;
1604     s/\x20+\z//;
1605     s/\x20+/ /g;
1606     }
1607     }
1608     }
1609 wakaba 1.26 if ($lname eq 'xml' and
1610     $nsuri ne <Q::xml:>) {
1611     my $location;
1612     __CODE{xp|get-location-from-token::
1613     $token => $token,
1614     $result => $location,
1615     }__;
1616     my $continue = __c|ERROR{xp|nsc-reserved-prefix-xml::
1617     c|location => {$location},
1618     xp|token => {$token},
1619     infoset|prefix => {$lname},
1620     infoset|namespaceName => {$nsuri},
1621     }__;
1622     unless ($continue) {
1623 wakaba 1.27 __CODE{ParseError}__;
1624 wakaba 1.26 }
1625     } elsif ($lname eq 'xmlns') {
1626     my $location;
1627     __CODE{xp|get-location-from-token::
1628     $token => $token,
1629     $result => $location,
1630     }__;
1631     my $continue = __c|ERROR{xp|nsc-reserved-prefix-xmlns::
1632     c|location => {$location},
1633     xp|token => {$token},
1634     infoset|prefix => {$lname},
1635     infoset|namespaceName => {$nsuri},
1636     }__;
1637     unless ($continue) {
1638 wakaba 1.27 __CODE{ParseError}__;
1639 wakaba 1.26 }
1640     }
1641     if ($nsuri eq '') {
1642     if ($self->{xml_version} eq '1.0') {
1643     my $location;
1644     __CODE{xp|get-location-from-token::
1645     $token => $token,
1646     $result => $location,
1647     }__;
1648     my $continue = __c|ERROR{xp|nswf-empty-namespace-name::
1649     c|location => {$location},
1650     xp|token => {$token},
1651     infoset|namespaceName => {$nsuri},
1652     infoset|prefix => {$lname},
1653     }__;
1654     unless ($continue) {
1655 wakaba 1.27 __CODE{ParseError}__;
1656 wakaba 1.26 }
1657     }
1658     } elsif ($nsuri eq <Q::xml:> and
1659     $lname ne 'xml') {
1660     my $location;
1661     __CODE{xp|get-location-from-token::
1662     $token => $token,
1663     $result => $location,
1664     }__;
1665     my $continue = __c|ERROR{
1666     xp|nsc-reserved-namespace-name-xml::
1667     c|location => {$location},
1668     xp|token => {$token},
1669     infoset|prefix => {$lname},
1670     infoset|namespaceName => {$nsuri},
1671     }__;
1672     unless ($continue) {
1673 wakaba 1.27 __CODE{ParseError}__;
1674 wakaba 1.26 }
1675     } elsif ($nsuri eq <Q::xmlns:>) {
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-xmlns::
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     }
1692     $ns->{$lname} = $nsuri;
1693 wakaba 1.1 delete $ns->{$lname} unless length $ns->{$lname};
1694     }
1695     $gattr{$pfx}->{$lname} = $attrs->{$atqname};
1696     } else { ## Local attribute
1697     if ($pfx eq 'xmlns') {
1698 wakaba 1.26 $ns->{''} = $attrs->{xmlns}->{is_default}
1699     ? $attrs->{xmlns}->{def}-><AG::Node.nodeValue>
1700     : $attrs->{xmlns}->{value};
1701     if (not $attrs->{$atqname}->{is_default} and
1702     $attrs->{$atqname}->{def}) {
1703 wakaba 1.9 my $dt = $attrs->{$atqname}->{def}-><AG::ATDef.declaredType>;
1704     if ({
1705     <C::ATDef.ID_ATTR> => true,
1706     <C::ATDef.IDREF_ATTR> => true,
1707     <C::ATDef.IDREFS_ATTR> => true,
1708     <C::ATDef.ENTITY_ATTR> => true,
1709     <C::ATDef.ENTITIES_ATTR> => true,
1710     <C::ATDef.NMTOKEN_ATTR> => true,
1711     <C::ATDef.NMTOKENS_ATTR> => true,
1712     <C::ATDef.NOTATION_ATTR> => true,
1713     <C::ATDef.ENUMERATION_ATTR> => true,
1714     }->{$dt}) {
1715     ## Tokenization (XML 1 3.3.3)
1716     for ($ns->{''}) {
1717     s/^\x20+//;
1718     s/\x20+\z//;
1719     s/\x20+/ /g;
1720     }
1721     }
1722     }
1723 wakaba 1.26 unless ($ns->{''}) {
1724     delete $ns->{''};
1725     } elsif ($ns->{''} eq <Q::xml:>) {
1726     my $location;
1727     __CODE{xp|get-location-from-token::
1728     $token => $token,
1729     $result => $location,
1730     }__;
1731     my $continue = __c|ERROR{
1732     xp|nsc-reserved-namespace-name-xml::
1733     c|location => {$location},
1734     xp|token => {$token},
1735     infoset|prefix => {null},
1736     infoset|namespaceName => {<Q::xml:>},
1737     }__;
1738     unless ($continue) {
1739 wakaba 1.27 __CODE{ParseError}__;
1740 wakaba 1.26 }
1741     } elsif ($ns->{''} eq <Q::xmlns:>) {
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-xmlns::
1749     c|location => {$location},
1750     xp|token => {$token},
1751     infoset|prefix => {null},
1752     infoset|namespaceName => {<Q::xmlns:>},
1753     }__;
1754     unless ($continue) {
1755 wakaba 1.27 __CODE{ParseError}__;
1756 wakaba 1.26 }
1757     }
1758 wakaba 1.1 } else {
1759     $lattr{$pfx} = $attrs->{$atqname};
1760     }
1761     }
1762     }
1763    
1764     my ($pfx, $lname) = split /:/, $type;
1765     my $nsuri;
1766     if (defined $lname) { ## Prefixed namespace
1767     if (defined $ns->{$pfx}) {
1768     $nsuri = $ns->{$pfx};
1769     } else {
1770 wakaba 1.26 my $location;
1771     __CODE{xp|get-location-from-token::
1772     $token => $token,
1773     $result => $location,
1774     }__;
1775     my $continue = __c|ERROR{xp|nsc-prefix-declared::
1776     c|location => {$location},
1777     xp|token => {$token},
1778     infoset|prefix => {$pfx},
1779     xp|name => {$type},
1780     }__;
1781     unless ($continue) {
1782 wakaba 1.27 __CODE{ParseError}__;
1783 wakaba 1.26 }
1784 wakaba 1.1 }
1785     } else { ## Default namespace
1786     $nsuri = $ns->{''};
1787     }
1788    
1789     $el = $doc-><M::Document.createElementNS>
1790     ($nsuri, $type);
1791    
1792     if ($attrs->{xmlns}) {
1793     my $attr = $doc-><M::Document.createAttributeNS>
1794     (<Q::xmlns:>, 'xmlns');
1795     for (@{$attrs->{xmlns}->{nodes}}) {
1796 wakaba 1.31 if ($_-><AG::Node.nodeType> == <C::Node.TEXT_NODE>) {
1797     $attr-><M::Node.manakaiAppendText>
1798     (\($_-><AG::Node.textContent>));
1799     } else {
1800     $attr-><M::Node.appendChild> ($_);
1801     }
1802 wakaba 1.1 }
1803 wakaba 1.9 if ($attrs->{xmlns}->{def}) {
1804 wakaba 1.35 $attr-><AS::Attr.manakaiAttributeType>
1805     ($attrs->{xmlns}->{def}-><AG::ATDef.declaredType>);
1806 wakaba 1.9 }
1807 wakaba 1.1 $el-><M::Element.setAttributeNodeNS> ($attr);
1808 wakaba 1.35 $attr-><AS::Attr.specified> (false)
1809 wakaba 1.26 if $attrs->{xmlns}->{is_default};
1810 wakaba 1.1 }
1811    
1812     for my $lname (keys %lattr) {
1813     my $attr = $doc-><M::Document.createAttributeNS>
1814     (null, $lname);
1815     for (@{$lattr{$lname}->{nodes}}) {
1816 wakaba 1.31 if ($_-><AG::Node.nodeType> == <C::Node.TEXT_NODE>) {
1817     $attr-><M::Node.manakaiAppendText>
1818     (\($_-><AG::Node.textContent>));
1819     } else {
1820     $attr-><M::Node.appendChild> ($_);
1821     }
1822 wakaba 1.1 }
1823 wakaba 1.9 if ($attrs->{$lname}->{def}) {
1824 wakaba 1.35 $attr-><AS::Attr.manakaiAttributeType>
1825     ($attrs->{$lname}->{def}-><AG::ATDef.declaredType>);
1826 wakaba 1.9 }
1827 wakaba 1.1 $el-><M::Element.setAttributeNodeNS> ($attr);
1828 wakaba 1.35 $attr-><AS::Attr.specified> (false)
1829 wakaba 1.26 if $attrs->{$lname}->{is_default};
1830 wakaba 1.1 }
1831    
1832     for my $pfx (keys %gattr) {
1833 wakaba 1.26 LN: for my $lname (keys %{$gattr{$pfx}}) {
1834     my $name = $pfx.':'.$lname;
1835     unless (defined $ns->{$pfx}) {
1836     my $location;
1837     __CODE{xp|get-location-from-token::
1838     $token => $token,
1839     $result => $location,
1840     }__;
1841     my $continue = __c|ERROR{xp|nsc-prefix-declared::
1842     c|location => {$location},
1843     xp|token => {$token},
1844     xp|name => {$name},
1845     infoset|prefix => {$pfx},
1846     }__;
1847     unless ($continue) {
1848 wakaba 1.27 __CODE{ParseError}__;
1849 wakaba 1.26 }
1850     }
1851     my $attr = $el-><M::Element.getAttributeNodeNS>
1852     ($ns->{$pfx}, $lname);
1853     if ($attr) {
1854     my $another_name = $attr-><AG::Node.nodeName>;
1855     if ($name ne $another_name) {
1856     my $location;
1857     __CODE{xp|get-location-from-token::
1858     $token => $token,
1859     $result => $location,
1860     }__;
1861     my $continue = __c|ERROR{
1862     xp|nswf-unique-att-spec-expanded-name::
1863     c|location => {$location},
1864     xp|token => {$token},
1865     xp|another-attribute-name => {$another_name},
1866     xp|name => {$name},
1867     infoset|namespaceName => {$ns->{$pfx}},
1868     infoset|localName => {$lname},
1869     }__;
1870     unless ($continue) {
1871 wakaba 1.27 __CODE{ParseError}__;
1872 wakaba 1.26 }
1873 wakaba 1.35 unless ($attr-><AG::Attr.specified>) {
1874 wakaba 1.26 ## It is a default attribute
1875     $attr = $doc-><M::Document.createAttributeNS>
1876     ($ns->{$pfx}, $name);
1877     } else {
1878     ## It is a specified attribute
1879     next LN;
1880     }
1881     } else { ## There is default attribute
1882     $attr = $doc-><M::Document.createAttributeNS>
1883     ($ns->{$pfx}, $name);
1884     }
1885     } else {
1886     $attr = $doc-><M::Document.createAttributeNS>
1887     ($ns->{$pfx}, $name);
1888     }
1889 wakaba 1.1 for (@{$gattr{$pfx}->{$lname}->{nodes}}) {
1890 wakaba 1.31 if ($_-><AG::Node.nodeType> == <C::Node.TEXT_NODE>) {
1891     $attr-><M::Node.manakaiAppendText>
1892     (\($_-><AG::Node.textContent>));
1893     } else {
1894     $attr-><M::Node.appendChild> ($_);
1895     }
1896 wakaba 1.1 }
1897 wakaba 1.26 if ($gattr{$pfx}->{$lname}->{def}) {
1898 wakaba 1.35 $attr-><AS::Attr.manakaiAttributeType>
1899     ($gattr{$pfx}->{$lname}->{def}
1900     -><AG::ATDef.declaredType>);
1901 wakaba 1.9 }
1902 wakaba 1.1 $el-><M::Element.setAttributeNodeNS> ($attr);
1903 wakaba 1.35 $attr-><AS::Attr.specified> (false)
1904 wakaba 1.26 if $gattr{$pfx}->{$lname}->{is_default};
1905     } # PFX
1906 wakaba 1.1 }
1907    
1908     $node-><M::Node.appendChild> ($el);
1909     }
1910    
1911     ~ (TAGC) {
1912     lang:Perl {
1913     push @{$nodes}, $node;
1914     $node = $el;
1915     }
1916     ?lexmode ElementContent;
1917 wakaba 1.6 } (NESTC) {
1918     my $is_docel;
1919 wakaba 1.1 lang:Perl {
1920     $ns = pop @{$nses};
1921     $type = pop @{$types};
1922 wakaba 1.6 $is_docel = (@{$types} == 0);
1923     }
1924    
1925     if-true ($is_docel) {
1926     return;
1927     }
1928    
1929     ~ (TAGC) {
1930     ?lexmode ElementContent;
1931     } else {
1932     ?lexmode ElementContent;
1933 wakaba 1.1 }
1934     } else {
1935     ?lexmode ElementContent;
1936     }
1937     } else {
1938     ?lexmode ElementContent;
1939     }
1940    
1941     } (ETAGO) {
1942     // End tag
1943    
1944     ?lexmode 'EndTag';
1945    
1946     my $is_docel;
1947    
1948     ~ (Name) {
1949 wakaba 1.26 // No NCName & QName check (it must match to start-tag)
1950 wakaba 1.3 lang:Perl ($name => $token.value) : has-error {
1951 wakaba 1.1 if ($name eq $type) {
1952     $type = pop @{$types};
1953     if ($type eq '') {
1954     $is_docel = true;
1955     }
1956     $node = pop @{$nodes};
1957     $ns = pop @{$nses};
1958     } else {
1959 wakaba 1.3 my $location;
1960     __CODE{xp|get-location-from-token::
1961     $token => $token,
1962     $result => $location,
1963     }__;
1964     my $continue = __DOMCore:ERROR{xp|wf-element-type-match::
1965     DOMCore:location => {$location},
1966     xp|token => {$token},
1967     xp|expected-element-type => {$type},
1968     xp|actual-element-type => {$name},
1969     xp|node => {$node},
1970     }__;
1971     unless ($continue) {
1972 wakaba 1.27 __CODE{ParseError}__;
1973 wakaba 1.3 }
1974 wakaba 1.1 }
1975     }
1976     }
1977    
1978     ~? (S) { }
1979    
1980     if-true ($is_docel) {
1981 wakaba 1.3 lang:Perl : has-error {
1982 wakaba 1.1 if (@{$types}) {
1983 wakaba 1.3 my $location;
1984     __CODE{xp|get-location-from-token::
1985     $token => $token,
1986     $result => $location,
1987     }__;
1988     for my $type (reverse @{$types}) {
1989     my $continue = __DOMCore:ERROR{xp|wf-no-end-tag::
1990     DOMCore:location => {$location},
1991     xp|token => {$token},
1992     xp|expected-element-type => {$type},
1993     xp|node => {$node},
1994     }__;
1995     unless ($continue) {
1996 wakaba 1.27 __CODE{ParseError}__;
1997 wakaba 1.3 }
1998     $node = shift @{$nodes};
1999     }
2000 wakaba 1.1 }
2001     }
2002     return;
2003     }
2004    
2005     ~ (TAGC) {
2006     ?lexmode ElementContent;
2007     } else {
2008     ?lexmode 'ElementContent';
2009     }
2010    
2011     } (HCRO) {
2012     &_HexadecimalCharacterReference_
2013     ($doc => $doc, $parent => $node);
2014    
2015     ~ (REFC) {
2016     ?lexmode 'ElementContent';
2017     } else {
2018     ?lexmode ElementContent;
2019     }
2020     } (CRO) {
2021     &_NumericCharacterReference_
2022     ($doc => $doc, $parent => $node);
2023    
2024     ~ (REFC) {
2025     ?lexmode 'ElementContent';
2026     } else {
2027     ?lexmode ElementContent;
2028     }
2029     } (ERO) {
2030 wakaba 1.6 &_GeneralEntityReferenceEC
2031     ($doc => $doc, $parent => $node, $ns => $ns);
2032 wakaba 1.1 } (CDO) {
2033     &_CommentDeclaration_ ($doc => $doc, $parent => $node);
2034    
2035     ~ (MDC) {
2036     ?lexmode ElementContent;
2037     } else {
2038     ?lexmode ElementContent;
2039     }
2040     } (CDSO) {
2041     &_CDATASection_ ($doc => $doc, $parent => $node);
2042    
2043     ~ (MSE) {
2044     ?lexmode 'ElementContent';
2045     } else {
2046     ?lexmode ElementContent;
2047     }
2048     } (PIO) {
2049     &_ProcessingInstruction_ ($doc => $doc, $parent => $node);
2050    
2051     ~ (PIC) {
2052     ?lexmode 'ElementContent';
2053     } else {
2054     ?lexmode ElementContent;
2055     }
2056     }
2057 wakaba 1.3
2058     ~ (#NONE) { }
2059 wakaba 1.1 } // Element_
2060 wakaba 1.11
2061     /*
2062     content := [CharData]
2063     *((element / Reference / CDSect / PI / Comment) [CharData])
2064     */
2065     rule content ($parent, $ns) {
2066     // ?lexmode ElementContent;
2067    
2068     my $doc;
2069     lang:Perl {
2070     $doc = $self->{doc};
2071     }
2072    
2073     ~* (CharData) {
2074     lang:Perl ($data => $token.value) {
2075 wakaba 1.31 $parent-><M::Node.manakaiAppendText> (\($data));
2076 wakaba 1.11 }
2077     } (STAGO) {
2078     &Element_ ($doc => $doc, $parent => $parent, $ns => $ns)
2079     : unshift-current-token;
2080     ~ (TAGC) {
2081     ?lexmode ElementContent;
2082     } else {
2083     ?lexmode ElementContent;
2084     }
2085     } (HCRO) {
2086 wakaba 1.31 &_HexadecimalCharacterReference_ ($parent => $parent);
2087 wakaba 1.11
2088     ~ (REFC) {
2089     ?lexmode 'ElementContent';
2090     } else {
2091     ?lexmode ElementContent;
2092     }
2093     } (CRO) {
2094 wakaba 1.31 &_NumericCharacterReference_ ($parent => $parent);
2095 wakaba 1.11
2096     ~ (REFC) {
2097     ?lexmode 'ElementContent';
2098     } else {
2099     ?lexmode ElementContent;
2100     }
2101     } (ERO) {
2102     &_GeneralEntityReferenceEC
2103     ($doc => $doc, $parent => $parent, $ns => $ns);
2104     } (CDO) {
2105     &_CommentDeclaration_ ($doc => $doc, $parent => $parent);
2106    
2107     ~ (MDC) {
2108     ?lexmode ElementContent;
2109     } else {
2110     ?lexmode ElementContent;
2111     }
2112     } (CDSO) {
2113     &_CDATASection_ ($doc => $doc, $parent => $parent);
2114    
2115     ~ (MSE) {
2116     ?lexmode 'ElementContent';
2117     } else {
2118     ?lexmode ElementContent;
2119     }
2120     } (PIO) {
2121     &_ProcessingInstruction_ ($doc => $doc, $parent => $parent);
2122    
2123     ~ (PIC) {
2124     ?lexmode 'ElementContent';
2125     } else {
2126     ?lexmode ElementContent;
2127     }
2128     }
2129     } // content
2130 wakaba 1.1
2131     rule AttributeSpecificationList ($doc, $attrs)
2132     : standalone
2133     {
2134     ?lexmode 'StartTag';
2135    
2136     my $i;
2137     lang:Perl {
2138     $i = 0;
2139     }
2140    
2141     ~* (Name) {
2142     my $atqname;
2143 wakaba 1.26 lang:Perl ($name => $token.value) : has-error {
2144     __CODE{checkQName:: $name => $name}__;
2145 wakaba 1.1 $atqname = $name;
2146     }
2147    
2148     my $vals;
2149 wakaba 1.18 lang:Perl : has-error {
2150 wakaba 1.1 if ($attrs->{$atqname}) {
2151 wakaba 1.3 my $location;
2152     __CODE{xp|get-location-from-token::
2153     $token => $token,
2154     $result => $location,
2155     }__;
2156     my $continue = __DOMCore:ERROR{xp|wf-unique-att-spec::
2157     DOMCore:location => {$location},
2158     xp|token => {$token},
2159     xp|name => {$atqname},
2160     }__;
2161     unless ($continue) {
2162 wakaba 1.27 __CODE{ParseError}__;
2163 wakaba 1.3 }
2164 wakaba 1.1 }
2165    
2166     $vals = $attrs->{$atqname} = {
2167     nodes => [],
2168     value => '',
2169     index => $i++,
2170     };
2171     }
2172 wakaba 1.3
2173     ~? (S) { }
2174     ~ (VI) { }
2175     ~? (S) { }
2176 wakaba 1.1
2177     ~ (LIT) {
2178     &_AttributeValueSpecification_
2179     ($doc => $doc, $vals => $vals);
2180    
2181     ~ (LIT) {
2182     ?lexmode StartTag;
2183     } else {
2184     ?lexmode StartTag;
2185     }
2186     } (LITA) {
2187     &_AttributeValueSpecificationA_
2188     ($doc => $doc, $vals => $vals);
2189    
2190     ~ (LITA) {
2191     ?lexmode StartTag;
2192     } else {
2193     ?lexmode StartTag;
2194     }
2195     }
2196     } (S) : separator : terminator? { }
2197     } // AttributeSpecificationList
2198    
2199     rule _AttributeValueSpecification_ ($doc, $vals) {
2200     // ~ (LIT) { }
2201     ?lexmode 'AttributeValueLiteral';
2202    
2203     ~* (STRING) {
2204     lang:Perl ($value => $token.value) {
2205     $value =~ s/[\x09\x0A\x0D]/ /g;
2206     my $text = $doc-><M::Document.createTextNode> ($value);
2207     push @{$vals->{nodes}}, $text;
2208     $vals->{value} .= $value;
2209     }
2210     } (HCRO) {
2211     &_HexadecimalCharacterReferenceV_
2212     ($doc => $doc, $vals => $vals);
2213    
2214     ~ (REFC) {
2215     ?lexmode AttributeValueLiteral;
2216     } else {
2217     ?lexmode AttributeValueLiteral;
2218     }
2219     } (CRO) {
2220     &_NumericCharacterReferenceV_
2221     ($doc => $doc, $vals => $vals);
2222    
2223     ~ (REFC) {
2224     ?lexmode AttributeValueLiteral;
2225     } else {
2226     ?lexmode AttributeValueLiteral;
2227     }
2228     } (ERO) {
2229     // TODO: Attribute value normalization
2230     &_GeneralEntityReferenceV_
2231     ($doc => $doc, $vals => $vals);
2232    
2233     ~ (REFC) {
2234     ?lexmode AttributeValueLiteral;
2235     } else {
2236     ?lexmode AttributeValueLiteral;
2237     }
2238     }
2239    
2240     // ~ (LIT) { } (LITA) { }
2241     } // _AttributeValueSpecification_
2242    
2243     rule _AttributeValueSpecificationA_ ($doc, $vals) {
2244     // ~ (LITA) { }
2245     ?lexmode 'AttributeValueLiteralA';
2246    
2247     ~* (STRING) {
2248     lang:Perl ($value => $token.value) {
2249     $value =~ s/[\x09\x0A\x0D]/ /g;
2250     my $text = $doc-><M::Document.createTextNode> ($value);
2251     push @{$vals->{nodes}}, $text;
2252     $vals->{value} .= $value;
2253     }
2254     } (HCRO) {
2255     &_HexadecimalCharacterReferenceV_
2256     ($doc => $doc, $vals => $vals);
2257    
2258     ~ (REFC) {
2259     ?lexmode AttributeValueLiteralA;
2260     } else {
2261     ?lexmode AttributeValueLiteralA;
2262     }
2263     } (CRO) {
2264     &_NumericCharacterReferenceV_
2265     ($doc => $doc, $vals => $vals);
2266    
2267     ~ (REFC) {
2268     ?lexmode AttributeValueLiteralA;
2269     } else {
2270     ?lexmode AttributeValueLiteralA;
2271     }
2272     } (ERO) {
2273     // TODO: Attribute value normalization
2274     &_GeneralEntityReferenceV_
2275     ($doc => $doc, $vals => $vals);
2276    
2277     ~ (REFC) {
2278     ?lexmode AttributeValueLiteralA;
2279     } else {
2280     ?lexmode AttributeValueLiteralA;
2281     }
2282     }
2283    
2284     // ~ (LITA) { }
2285     } // _AttributeValueSpecificationA_
2286    
2287     /*
2288 wakaba 1.11 Parsing replacement text of an entity referenced in
2289     an attribute value specification.
2290     */
2291     rule AttributeValueLiteralE_ ($parent, $vals)
2292     : recursive
2293     {
2294     // ?lexmode AttributeValueLiteralE;
2295    
2296     ~* (STRING) {
2297     lang:Perl ($value => $token.value) {
2298     $value =~ s/[\x09\x0A\x0D]/ /g;
2299 wakaba 1.31 $parent-><M::Node.manakaiAppendText> (\($value));
2300 wakaba 1.11 $vals->{value} .= $value;
2301     }
2302     } (HCRO) {
2303     &_HexadecimalCharacterReferenceAE_
2304     ($parent => $parent, $vals => $vals);
2305    
2306     ~ (REFC) {
2307     ?lexmode AttributeValueLiteralE;
2308     } else {
2309     ?lexmode AttributeValueLiteralE;
2310     }
2311     } (CRO) {
2312     &_NumericCharacterReferenceAE_
2313     ($parent => $parent, $vals => $vals);
2314    
2315     ~ (REFC) {
2316     ?lexmode AttributeValueLiteralE;
2317     } else {
2318     ?lexmode AttributeValueLiteralE;
2319     }
2320     } (ERO) {
2321     &_GeneralEntityReferenceAE_ ($parent => $parent, $vals => $vals);
2322    
2323     ~ (REFC) {
2324     ?lexmode AttributeValueLiteralE;
2325     } else {
2326     ?lexmode AttributeValueLiteralE;
2327     }
2328 wakaba 1.18 } (#INVALID == '<') {
2329     lang:Perl : has-error {
2330     my $location;
2331     __CODE{xp|get-location-from-token::
2332     $token => $token,
2333     $result => $location,
2334     }__;
2335     my $continue = __DOMCore:ERROR{xp|wf-no-lt-in-attribute-values::
2336     c|location => {$location},
2337     xp|token => {$token},
2338     }__;
2339     unless ($continue) {
2340 wakaba 1.27 __CODE{ParseError}__;
2341 wakaba 1.18 }
2342    
2343 wakaba 1.31 $parent-><M::Node.manakaiAppendText> ('<');
2344 wakaba 1.18 $vals->{value} .= '<';
2345     }
2346 wakaba 1.11 }
2347    
2348     // ~ (#EOF) { }
2349     } // AttributeValueLiteralE_
2350    
2351     /*
2352 wakaba 1.1 CDATA Section Content Parsing Mode
2353     */
2354     rule _CDATASection_ ($doc, $parent) {
2355     ?lexmode 'CDATASectionContent';
2356    
2357     my $cdata;
2358    
2359 wakaba 1.2 ~? (CData) {
2360 wakaba 1.1 lang:Perl ($data => $token.value) {
2361     $cdata = $data;
2362     }
2363     } else {
2364     lang:Perl {
2365     $cdata = '';
2366     }
2367     }
2368    
2369     lang:Perl {
2370     my $cdsect = $doc-><M::Document.createCDATASection>
2371     ($cdata);
2372     $parent-><M::Node.appendChild> ($cdsect);
2373     }
2374    
2375     // ~ (MSE) { }
2376     } // _CDATASection_
2377    
2378 wakaba 1.31 rule _NumericCharacterReference_ ($parent) {
2379 wakaba 1.1 ?lexmode 'NumericCharacterReference';
2380    
2381     ~ (NUMBER) {
2382 wakaba 1.3 lang:Perl ($num => $token.value) : has-error {
2383     $num += 0;
2384     unless (
2385     ($self->{xml_version} eq '1.0' and
2386     ((0x0020 <= $num and $num <= 0xD7FF) or
2387     (0xE000 <= $num and $num <= 0xFFFD) or
2388     (0x10000 <= $num and $num <= 0x10FFFF) or
2389     $num == 0x9 or $num == 0xA or $num == 0xD)) or
2390     ($self->{xml_version} eq '1.1' and
2391     ((0x0001 <= $num and $num <= 0xD7FF) or
2392     (0xE000 <= $num and $num <= 0xFFFD) or
2393     (0x10000 <= $num and $num <= 0x10FFFF)))
2394     ) {
2395     my $location;
2396     __CODE{xp|get-location-from-token::
2397     $token => $token,
2398     $result => $location,
2399     }__;
2400     my $continue = __DOMCore:ERROR{xp|wf-legal-character::
2401     DOMCore:location => {$location},
2402     xp|token => {$token},
2403     xp|character-number => {$num},
2404     xp|parent => {$parent},
2405     }__;
2406     unless ($continue) {
2407 wakaba 1.27 __CODE{ParseError}__;
2408 wakaba 1.3 }
2409     }
2410 wakaba 1.31 $parent-><M::Node.manakaiAppendText> (chr $num);
2411 wakaba 1.1 }
2412     }
2413    
2414     // ~ (REFC) { }
2415     } // _NumericCharacterReference_
2416    
2417     rule _NumericCharacterReferenceV_ ($doc, $vals) {
2418     ?lexmode 'NumericCharacterReference';
2419    
2420     ~ (NUMBER) {
2421 wakaba 1.3 lang:Perl ($num => $token.value) : has-error {
2422     $num += 0;
2423     unless (
2424     ($self->{xml_version} eq '1.0' and
2425     ((0x0020 <= $num and $num <= 0xD7FF) or
2426     (0xE000 <= $num and $num <= 0xFFFD) or
2427     (0x10000 <= $num and $num <= 0x10FFFF) or
2428     $num == 0x9 or $num == 0xA or $num == 0xD)) or
2429     ($self->{xml_version} eq '1.1' and
2430     ((0x0001 <= $num and $num <= 0xD7FF) or
2431     (0xE000 <= $num and $num <= 0xFFFD) or
2432     (0x10000 <= $num and $num <= 0x10FFFF)))
2433     ) {
2434     my $location;
2435     __CODE{xp|get-location-from-token::
2436     $token => $token,
2437     $result => $location,
2438     }__;
2439     my $continue = __DOMCore:ERROR{xp|wf-legal-character::
2440     DOMCore:location => {$location},
2441     xp|token => {$token},
2442     xp|character-number => {$num},
2443     }__;
2444     unless ($continue) {
2445 wakaba 1.27 __CODE{ParseError}__;
2446 wakaba 1.3 }
2447     }
2448 wakaba 1.1 my $ncr = $doc-><M::Document.createTextNode>
2449 wakaba 1.9 (my $char = chr $num);
2450 wakaba 1.1 push @{$vals->{nodes}}, $ncr;
2451     $vals->{value} .= $char;
2452     }
2453     }
2454    
2455     // ~ (REFC) { }
2456     } // _NumericCharacterReferenceV_
2457    
2458 wakaba 1.11 /*
2459     Numeric character reference in the replacement text
2460     of the entity referenced in an attribute value specification
2461     */
2462     rule _NumericCharacterReferenceAE_ ($parent, $vals)
2463     {
2464     ?lexmode NumericCharacterReference;
2465    
2466     ~ (NUMBER) {
2467     lang:Perl ($num => $token.value) : has-error {
2468     $num += 0;
2469     unless (
2470     ($self->{xml_version} eq '1.0' and
2471     ((0x0020 <= $num and $num <= 0xD7FF) or
2472     (0xE000 <= $num and $num <= 0xFFFD) or
2473     (0x10000 <= $num and $num <= 0x10FFFF) or
2474     $num == 0x9 or $num == 0xA or $num == 0xD)) or
2475     ($self->{xml_version} eq '1.1' and
2476     ((0x0001 <= $num and $num <= 0xD7FF) or
2477     (0xE000 <= $num and $num <= 0xFFFD) or
2478     (0x10000 <= $num and $num <= 0x10FFFF)))
2479     ) {
2480     my $location;
2481     __CODE{xp|get-location-from-token::
2482     $token => $token,
2483     $result => $location,
2484     }__;
2485     my $continue = __DOMCore:ERROR{xp|wf-legal-character::
2486     DOMCore:location => {$location},
2487     xp|token => {$token},
2488     xp|character-number => {$num},
2489     }__;
2490     unless ($continue) {
2491 wakaba 1.27 __CODE{ParseError}__;
2492 wakaba 1.11 }
2493     }
2494 wakaba 1.31 my $char = chr $num;
2495     $parent-><M::Node.manakaiAppendText> (\$char);
2496 wakaba 1.11 $vals->{value} .= $char;
2497     }
2498     }
2499    
2500     // ~ (REFC) { }
2501     } // _NumericCharacterReferenceAE_
2502    
2503     rule _NumericCharacterReferenceEV_ ($vals)
2504     {
2505     ?lexmode 'NumericCharacterReference';
2506    
2507     ~ (NUMBER) {
2508     lang:Perl ($num => $token.value) : has-error {
2509     $num += 0;
2510     unless (
2511     ($self->{xml_version} eq '1.0' and
2512     ((0x0020 <= $num and $num <= 0xD7FF) or
2513     (0xE000 <= $num and $num <= 0xFFFD) or
2514     (0x10000 <= $num and $num <= 0x10FFFF) or
2515     $num == 0x9 or $num == 0xA or $num == 0xD)) or
2516     ($self->{xml_version} eq '1.1' and
2517     ((0x0001 <= $num and $num <= 0xD7FF) or
2518     (0xE000 <= $num and $num <= 0xFFFD) or
2519     (0x10000 <= $num and $num <= 0x10FFFF)))
2520     ) {
2521     my $location;
2522     __CODE{xp|get-location-from-token::
2523     $token => $token,
2524     $result => $location,
2525     }__;
2526     my $continue = __DOMCore:ERROR{xp|wf-legal-character::
2527     DOMCore:location => {$location},
2528     xp|token => {$token},
2529     xp|character-number => {$num},
2530     }__;
2531     unless ($continue) {
2532 wakaba 1.27 __CODE{ParseError}__;
2533 wakaba 1.11 }
2534     }
2535     push @{$vals}, chr $num;
2536     }
2537     }
2538    
2539     // ~ (REFC) { }
2540     } // _NumericCharacterReferenceEV_
2541    
2542 wakaba 1.31 rule _HexadecimalCharacterReference_ ($parent) {
2543 wakaba 1.1 ?lexmode 'HexadecimalCharacterReference';
2544    
2545     ~ (Hex) {
2546 wakaba 1.9 lang:Perl ($v => $token.value) : has-error {
2547     my $num = hex $v;
2548 wakaba 1.3 unless (
2549     ($self->{xml_version} eq '1.0' and
2550     ((0x0020 <= $num and $num <= 0xD7FF) or
2551     (0xE000 <= $num and $num <= 0xFFFD) or
2552     (0x10000 <= $num and $num <= 0x10FFFF) or
2553     $num == 0x9 or $num == 0xA or $num == 0xD)) or
2554     ($self->{xml_version} eq '1.1' and
2555     ((0x0001 <= $num and $num <= 0xD7FF) or
2556     (0xE000 <= $num and $num <= 0xFFFD) or
2557     (0x10000 <= $num and $num <= 0x10FFFF)))
2558     ) {
2559     my $location;
2560     __CODE{xp|get-location-from-token::
2561     $token => $token,
2562     $result => $location,
2563     }__;
2564     my $continue = __DOMCore:ERROR{xp|wf-legal-character::
2565     DOMCore:location => {$location},
2566     xp|token => {$token},
2567     xp|character-number => {$num},
2568     xp|parent => {$parent},
2569     }__;
2570     unless ($continue) {
2571 wakaba 1.27 __CODE{ParseError}__;
2572 wakaba 1.3 }
2573     }
2574 wakaba 1.31 $parent-><M::Node.manakaiAppendText> (chr $num);
2575 wakaba 1.1 }
2576     }
2577    
2578     // ~ (REFC) { }
2579     } // _HexadecimalCharacterReference_
2580    
2581 wakaba 1.3 rule _HexadecimalCharacterReferenceV_ ($doc, $vals) {
2582 wakaba 1.1 ?lexmode 'HexadecimalCharacterReference';
2583    
2584     ~ (Hex) {
2585 wakaba 1.9 lang:Perl ($v => $token.value) : has-error {
2586     my $num = hex $v;
2587 wakaba 1.3 unless (
2588     ($self->{xml_version} eq '1.0' and
2589     ((0x0020 <= $num and $num <= 0xD7FF) or
2590     (0xE000 <= $num and $num <= 0xFFFD) or
2591     (0x10000 <= $num and $num <= 0x10FFFF) or
2592     $num == 0x9 or $num == 0xA or $num == 0xD)) or
2593     ($self->{xml_version} eq '1.1' and
2594     ((0x0001 <= $num and $num <= 0xD7FF) or
2595     (0xE000 <= $num and $num <= 0xFFFD) or
2596     (0x10000 <= $num and $num <= 0x10FFFF)))
2597     ) {
2598     my $location;
2599     __CODE{xp|get-location-from-token::
2600     $token => $token,
2601     $result => $location,
2602     }__;
2603     my $continue = __DOMCore:ERROR{xp|wf-legal-character::
2604     DOMCore:location => {$location},
2605     xp|token => {$token},
2606     xp|character-number => {$num},
2607     }__;
2608     unless ($continue) {
2609 wakaba 1.27 __CODE{ParseError}__;
2610 wakaba 1.3 }
2611     }
2612 wakaba 1.1 my $ncr = $doc-><M::Document.createTextNode>
2613 wakaba 1.9 (my $char = chr $num);
2614 wakaba 1.1 push @{$vals->{nodes}}, $ncr;
2615     $vals->{value} .= $char;
2616     }
2617     }
2618    
2619     // ~ (REFC) { }
2620 wakaba 1.11 } // _HexadecimalCharacterReferenceV_
2621    
2622     /*
2623     Hexadecimal character reference in the replacement text
2624     of the entity referenced in an attribute value literal
2625     */
2626     rule _HexadecimalCharacterReferenceAE_ ($parent, $vals)
2627     {
2628     ?lexmode HexadecimalCharacterReference;
2629    
2630     ~ (Hex) {
2631     lang:Perl ($v => $token.value) : has-error {
2632     my $num = hex $v;
2633     unless (
2634     ($self->{xml_version} eq '1.0' and
2635     ((0x0020 <= $num and $num <= 0xD7FF) or
2636     (0xE000 <= $num and $num <= 0xFFFD) or
2637     (0x10000 <= $num and $num <= 0x10FFFF) or
2638     $num == 0x9 or $num == 0xA or $num == 0xD)) or
2639     ($self->{xml_version} eq '1.1' and
2640     ((0x0001 <= $num and $num <= 0xD7FF) or
2641     (0xE000 <= $num and $num <= 0xFFFD) or
2642     (0x10000 <= $num and $num <= 0x10FFFF)))
2643     ) {
2644     my $location;
2645     __CODE{xp|get-location-from-token::
2646     $token => $token,
2647     $result => $location,
2648     }__;
2649     my $continue = __DOMCore:ERROR{xp|wf-legal-character::
2650     DOMCore:location => {$location},
2651     xp|token => {$token},
2652     xp|character-number => {$num},
2653     }__;
2654     unless ($continue) {
2655 wakaba 1.27 __CODE{ParseError}__;
2656 wakaba 1.11 }
2657     }
2658 wakaba 1.31 my $char = chr $num;
2659     $parent-><M::Node.manakaiAppendText> (\$char);
2660 wakaba 1.11 $vals->{value} .= $char;
2661     }
2662     }
2663    
2664     // ~ (REFC) { }
2665     } // _HexadecimalCharacterReferenceAE_
2666    
2667     rule _HexadecimalCharacterReferenceEV_ ($vals) {
2668     ?lexmode HexadecimalCharacterReference;
2669    
2670     ~ (Hex) {
2671     lang:Perl ($v => $token.value) : has-error {
2672     my $num = hex $v;
2673     unless (
2674     ($self->{xml_version} eq '1.0' and
2675     ((0x0020 <= $num and $num <= 0xD7FF) or
2676     (0xE000 <= $num and $num <= 0xFFFD) or
2677     (0x10000 <= $num and $num <= 0x10FFFF) or
2678     $num == 0x9 or $num == 0xA or $num == 0xD)) or
2679     ($self->{xml_version} eq '1.1' and
2680     ((0x0001 <= $num and $num <= 0xD7FF) or
2681     (0xE000 <= $num and $num <= 0xFFFD) or
2682     (0x10000 <= $num and $num <= 0x10FFFF)))
2683     ) {
2684     my $location;
2685     __CODE{xp|get-location-from-token::
2686     $token => $token,
2687     $result => $location,
2688     }__;
2689     my $continue = __DOMCore:ERROR{xp|wf-legal-character::
2690     DOMCore:location => {$location},
2691     xp|token => {$token},
2692     xp|character-number => {$num},
2693     }__;
2694     unless ($continue) {
2695 wakaba 1.27 __CODE{ParseError}__;
2696 wakaba 1.11 }
2697     }
2698     push @{$vals}, chr $num;
2699     }
2700     }
2701    
2702     // ~ (REFC) { }
2703     } // _HexadecimalCharacterReferenceEV_
2704    
2705     /*
2706     General entity reference in element's content
2707     */
2708     rule _GeneralEntityReferenceEC ($doc, $parent, $ns)
2709     : recursive
2710     {
2711     ?lexmode 'EntityReference';
2712    
2713     ~ (Name == 'lt') {
2714     lang:Perl {
2715 wakaba 1.31 $parent-><M::Node.manakaiAppendText> ('<');
2716 wakaba 1.11 }
2717     } (Name == 'gt') {
2718     lang:Perl {
2719 wakaba 1.31 $parent-><M::Node.manakaiAppendText> ('>');
2720 wakaba 1.11 }
2721     } (Name == 'amp') {
2722     lang:Perl {
2723 wakaba 1.31 $parent-><M::Node.manakaiAppendText> ('&');
2724 wakaba 1.11 }
2725     } (Name == 'quot') {
2726     lang:Perl {
2727 wakaba 1.31 $parent-><M::Node.manakaiAppendText> ('"');
2728 wakaba 1.11 }
2729     } (Name == 'apos') {
2730     lang:Perl {
2731 wakaba 1.31 $parent-><M::Node.manakaiAppendText> ("'");
2732 wakaba 1.11 }
2733     } (Name) {
2734     my $er;
2735 wakaba 1.19 lang:Perl ($name => $token.value) : has-error {
2736 wakaba 1.26 __CODE{checkNCName:: $name => $name}__;
2737    
2738 wakaba 1.11 $er = $doc-><M::Document.createEntityReference>
2739     ($name);
2740 wakaba 1.35 $er-><M::Node.manakaiSetReadOnly> (false, true);
2741 wakaba 1.20 $er-><AS::Node.textContent> ('');
2742     ## NOTE: When document entity (and entities referenced directly
2743     ## or indirectly from it) is parsed, no general entity
2744     ## node have its replacement tree. During general
2745     ## entity node collection construction, however,
2746     ## some entity node has replacement tree.
2747 wakaba 1.11 $parent-><M::Node.appendChild> ($er);
2748 wakaba 1.19
2749     my $ent = $self->{general_entity}->{$name};
2750     if (not $ent) { # no entity declaration
2751     if ($self->{standalone} or not $self->{has_xref}) { # WFC error
2752     my $location;
2753     __CODE{xp|get-location-from-token::
2754     $token => {$token},
2755     $result => {$location},
2756     }__;
2757     my $continue = __DOMCore:ERROR{xp|wf-entity-declared::
2758     xp|error-token => {$token},
2759     c|location => {$location},
2760     xp|name => {$name},
2761     }__;
2762     unless ($continue) {
2763 wakaba 1.27 __CODE{ParseError}__;
2764 wakaba 1.19 }
2765     } # Otherwise VC error
2766 wakaba 1.23 push @{$self->{entity}}, <Code::getEmptyEntityState::
2767     $name = $name>;
2768 wakaba 1.35 $er-><AS::GERef.manakaiExpanded> (false);
2769 wakaba 1.19
2770     } else { # there IS entity declaration
2771     if (($self->{standalone} or not $self->{has_xref}) and
2772     $ent->{is_externally_declared} and
2773     not $self->{entity}->[-1]->{is_externally_declared}) {
2774     my $location;
2775     __CODE{xp|get-location-from-token::
2776     $token => {$token},
2777     $result => {$location},
2778     }__;
2779     my $continue = __DOMCore:ERROR{xp|wf-entity-declared::
2780     xp|error-token => {$token},
2781     c|location => {$location},
2782     xp|name => {$name},
2783     }__;
2784     unless ($continue) {
2785 wakaba 1.27 __CODE{ParseError}__;
2786 wakaba 1.19 }
2787     }
2788 wakaba 1.35 $er-><AS::GERef.manakaiExpanded>
2789 wakaba 1.19 ($ent->{has_replacement_text});
2790     push @{$self->{entity}}, <Code::getCopyOfEntityState::
2791 wakaba 1.11 $entity_type = 'general_entity',
2792     $entity_name = $name>;
2793 wakaba 1.23
2794     if (defined $ent->{notation}) {
2795     my $location;
2796     __CODE{xp|get-location-from-token::
2797     $token => {$token},
2798     $result => {$location},
2799     }__;
2800     my $continue = __c|ERROR{xp|wf-parsed-entity::
2801     xp|error-token => {$token},
2802     c|location => {$location},
2803     xp|name => {$name},
2804     }__;
2805     unless ($continue) {
2806 wakaba 1.27 __CODE{ParseError}__;
2807 wakaba 1.23 }
2808     } # if unparsed entity
2809    
2810     if ($ent->{is_opened}) {
2811     my $location;
2812     __CODE{xp|get-location-from-token::
2813     $token => {$token},
2814     $result => {$location},
2815     }__;
2816     my $continue = __c|ERROR{xp|wf-no-recursion::
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 wakaba 1.27 open my $empty, '<', \'';
2825     $self->{entity}->[-1]->{fh} = $empty;
2826 wakaba 1.35 $er-><AS::GERef.manakaiExpanded> (false);
2827 wakaba 1.23 } # recursive
2828     $ent->{is_opened} = true;
2829     } # entity declared
2830 wakaba 1.14 $self->{location} = $self->{entity}->[-1];
2831 wakaba 1.11 push @{$self->{entity_token}}, $self->{token};
2832     $self->{token} = [];
2833     push @{$self->{entity_char}}, $self->{char};
2834     $self->{char} = [];
2835     }
2836    
2837     ?lexmode ElementContent;
2838     &content ($doc => $doc, $parent => $er, $ns => $ns);
2839     ~ (#EOF) { }
2840     lang:Perl {
2841 wakaba 1.23 $self->{general_entity}->{$self->{entity}->[-1]->{name}}
2842     ->{is_opened} = false
2843     if $self->{general_entity}->{$self->{entity}->[-1]->{name}};
2844 wakaba 1.11 $self->{token} = pop @{$self->{entity_token}};
2845     $self->{char} = pop @{$self->{entity_char}};
2846 wakaba 1.27 pop (@{$self->{entity}})->{close_file}->();
2847 wakaba 1.14 $self->{location} = $self->{entity}->[-1];
2848 wakaba 1.35
2849     $er-><M::Node.manakaiSetReadOnly> (true, true);
2850 wakaba 1.11 }
2851    
2852     ?lexmode EntityReference;
2853     ?requires-next-token;
2854     }
2855    
2856     ~ (REFC) {
2857     ?lexmode ElementContent;
2858     } else {
2859     ?lexmode ElementContent;
2860     }
2861     } // _GeneralEntityReferenceEC
2862    
2863     /*
2864     General entity reference in an attribute value literal
2865     */
2866     rule _GeneralEntityReferenceV_ ($vals) {
2867     ?lexmode EntityReference;
2868    
2869     ~ (Name == 'lt') {
2870     lang:Perl {
2871     push @{$vals->{nodes}}, $self->{doc}-><M::Document.createTextNode>
2872     ('<');
2873     $vals->{value} .= '<';
2874     }
2875     } (Name == 'gt') {
2876     lang:Perl {
2877     push @{$vals->{nodes}}, $self->{doc}-><M::Document.createTextNode>
2878     ('>');
2879     $vals->{value} .= '>';
2880     }
2881     } (Name == 'amp') {
2882     lang:Perl {
2883     push @{$vals->{nodes}}, $self->{doc}-><M::Document.createTextNode>
2884     ('&');
2885     $vals->{value} .= '&';
2886     }
2887     } (Name == 'quot') {
2888     lang:Perl {
2889     push @{$vals->{nodes}}, $self->{doc}-><M::Document.createTextNode>
2890     ('"');
2891     $vals->{value} .= '"';
2892     }
2893     } (Name == 'apos') {
2894     lang:Perl {
2895     push @{$vals->{nodes}}, $self->{doc}-><M::Document.createTextNode>
2896     ("'");
2897     $vals->{value} .= "'";
2898     }
2899     } (Name) {
2900     my $er;
2901 wakaba 1.18 lang:Perl ($name => $token.value) : has-error {
2902 wakaba 1.26 __CODE{checkNCName:: $name => $name}__;
2903 wakaba 1.18
2904 wakaba 1.11 $er = $self->{doc}-><M::Document.createEntityReference> ($name);
2905 wakaba 1.35 $er-><M::Node.manakaiSetReadOnly> (false, true);
2906 wakaba 1.20 $er-><AS::Node.textContent> ('');
2907     ## NOTE: When document entity (and entities referenced directly
2908     ## or indirectly from it) is parsed, no general entity
2909     ## node have its replacement tree. During general
2910     ## entity node collection construction, however,
2911     ## some entity node has replacement tree.
2912 wakaba 1.19 my $ent = $self->{general_entity}->{$name};
2913 wakaba 1.20 if (not $ent) { # no entity declaration
2914     if ($self->{standalone} or not $self->{has_xref}) { # WFC error
2915     my $location;
2916     __CODE{xp|get-location-from-token::
2917     $token => {$token},
2918     $result => {$location},
2919     }__;
2920     my $continue = __DOMCore:ERROR{xp|wf-entity-declared::
2921     xp|error-token => {$token},
2922     c|location => {$location},
2923     xp|name => {$name},
2924     }__;
2925     unless ($continue) {
2926 wakaba 1.27 __CODE{ParseError}__;
2927 wakaba 1.20 }
2928     } # Otherwise VC error
2929 wakaba 1.23 push @{$self->{entity}}, <Code::getEmptyEntityState::
2930     $name = $name>;
2931 wakaba 1.35 $er-><AS::GERef.manakaiExpanded> (false);
2932 wakaba 1.20
2933     } else { # there IS entity declaration
2934     if (($self->{standalone} or not $self->{has_xref}) and
2935     $ent->{is_externally_declared} and
2936     not $self->{entity}->[-1]->{is_externally_declared}) {
2937     my $location;
2938     __CODE{xp|get-location-from-token::
2939     $token => {$token},
2940     $result => {$location},
2941     }__;
2942     my $continue = __DOMCore:ERROR{xp|wf-entity-declared::
2943     xp|error-token => {$token},
2944     c|location => {$location},
2945     xp|name => {$name},
2946     }__;
2947     unless ($continue) {
2948 wakaba 1.27 __CODE{ParseError}__;
2949 wakaba 1.20 }
2950     }
2951    
2952     if ($ent->{is_external_entity}) {
2953     my $location;
2954     __CODE{xp|get-location-from-token::
2955     $token => {$token},
2956     $result => {$location},
2957     }__;
2958     my $continue = __c|ERROR{xp|wf-no-external-entity-references::
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 wakaba 1.23 ## NOTE: |xp:wf-parsed-entity| is not checked
2967 wakaba 1.20 } # if external entity
2968    
2969 wakaba 1.35 $er-><AS::GERef.manakaiExpanded>
2970 wakaba 1.19 ($ent->{has_replacement_text});
2971 wakaba 1.20 push @{$self->{entity}}, <Code::getCopyOfEntityState::
2972 wakaba 1.11 $entity_type = 'general_entity',
2973     $entity_name = $name>;
2974 wakaba 1.23
2975     if ($ent->{is_opened}) {
2976     my $location;
2977     __CODE{xp|get-location-from-token::
2978     $token => {$token},
2979     $result => {$location},
2980     }__;
2981     my $continue = __c|ERROR{xp|wf-no-recursion::
2982     xp|error-token => {$token},
2983     c|location => {$location},
2984     xp|name => {$name},
2985     }__;
2986     unless ($continue) {
2987 wakaba 1.27 __CODE{ParseError}__;
2988 wakaba 1.23 }
2989 wakaba 1.27 open my $empty, '<', \'';
2990     $self->{entity}->[-1]->{fh} = $empty;
2991 wakaba 1.35 $er-><AS::GERef.manakaiExpanded> (false);
2992 wakaba 1.23 } # recursive
2993     $ent->{is_opened} = true;
2994 wakaba 1.20 }
2995     push @{$vals->{nodes}}, $er;
2996 wakaba 1.14 $self->{location} = $self->{entity}->[-1];
2997 wakaba 1.11 push @{$self->{entity_token}}, $self->{token};
2998     $self->{token} = [];
2999     push @{$self->{entity_char}}, $self->{char};
3000     $self->{char} = [];
3001     }
3002    
3003     ?lexmode AttributeValueLiteralE;
3004     &AttributeValueLiteralE_ ($parent => $er, $vals => $vals);
3005     ~ (#EOF) { }
3006     lang:Perl {
3007 wakaba 1.23 $self->{general_entity}->{$self->{entity}->[-1]->{name}}
3008     ->{is_opened} = false
3009     if $self->{general_entity}->{$self->{entity}->[-1]->{name}};
3010 wakaba 1.11 $self->{token} = pop @{$self->{entity_token}};
3011     $self->{char} = pop @{$self->{entity_char}};
3012 wakaba 1.27 pop (@{$self->{entity}})->{close_file}->();
3013 wakaba 1.14 $self->{location} = $self->{entity}->[-1];
3014 wakaba 1.35
3015     $er-><M::Node.manakaiSetReadOnly> (true, true);
3016 wakaba 1.11 }
3017    
3018     ?lexmode EntityReference;
3019     ?requires-next-token;
3020     }
3021    
3022     // ~ (REFC) { }
3023     } // _GeneralEntityReferenceV_
3024 wakaba 1.1
3025 wakaba 1.6 /*
3026 wakaba 1.11 General entity reference in the replacement text
3027     of the entity referenced in an attribute value literal
3028 wakaba 1.6 */
3029 wakaba 1.11 rule _GeneralEntityReferenceAE_ ($parent, $vals)
3030 wakaba 1.6 {
3031 wakaba 1.11 ?lexmode EntityReference;
3032 wakaba 1.1
3033 wakaba 1.11 ~ (Name == 'lt') {
3034     lang:Perl {
3035 wakaba 1.31 $parent-><M::Node.manakaiAppendText> ('<');
3036 wakaba 1.11 $vals->{value} .= '<';
3037     }
3038     } (Name == 'gt') {
3039     lang:Perl {
3040 wakaba 1.31 $parent-><M::Node.manakaiAppendText> ('>');
3041 wakaba 1.11 $vals->{value} .= '>';
3042     }
3043     } (Name == 'amp') {
3044     lang:Perl {
3045 wakaba 1.31 $parent-><M::Node.manakaiAppendText> ('&');
3046 wakaba 1.11 $vals->{value} .= '&';
3047     }
3048     } (Name == 'quot') {
3049     lang:Perl {
3050 wakaba 1.31 $parent-><M::Node.manakaiAppendText> ('"');
3051 wakaba 1.11 $vals->{value} .= '"';
3052     }
3053     } (Name == 'apos') {
3054     lang:Perl {
3055 wakaba 1.31 $parent-><M::Node.manakaiAppendText> ("'");
3056 wakaba 1.11 $vals->{value} .= "'";
3057     }
3058     } (Name) {
3059 wakaba 1.6 my $er;
3060 wakaba 1.26 lang:Perl ($name => $token.value) : has-error {
3061     __CODE{checkNCName:: $name => $name}__;
3062 wakaba 1.18
3063 wakaba 1.11 $er = $self->{doc}-><M::Document.createEntityReference> ($name);
3064 wakaba 1.35 $er-><M::Node.manakaiSetReadOnly> (false, true);
3065 wakaba 1.20 $er-><AS::Node.textContent> ('');
3066     ## NOTE: When document entity (and entities referenced directly
3067     ## or indirectly from it) is parsed, no general entity
3068     ## node have its replacement tree. During general
3069     ## entity node collection construction, however,
3070     ## some entity node has replacement tree.
3071 wakaba 1.19 my $ent = $self->{general_entity}->{$name};
3072 wakaba 1.22 if (not $ent) { # no entity declaration
3073     if ($self->{standalone} or not $self->{has_xref}) { # WFC error
3074     my $location;
3075     __CODE{xp|get-location-from-token::
3076     $token => {$token},
3077     $result => {$location},
3078     }__;
3079     my $continue = __DOMCore:ERROR{xp|wf-entity-declared::
3080     xp|error-token => {$token},
3081     c|location => {$location},
3082     xp|name => {$name},
3083     }__;
3084     unless ($continue) {
3085 wakaba 1.27 __CODE{ParseError}__;
3086 wakaba 1.22 }
3087     } # Otherwise VC error
3088 wakaba 1.23 push @{$self->{entity}}, <Code::getEmptyEntityState::
3089     $name = $name>;
3090 wakaba 1.35 $er-><AS::GERef.manakaiExpanded> (false);
3091 wakaba 1.22
3092     } else { # there IS entity declaration
3093     if (($self->{standalone} or not $self->{has_xref}) and
3094     $ent->{is_externally_declared} and
3095     not $self->{entity}->[-1]->{is_externally_declared}) {
3096     my $location;
3097     __CODE{xp|get-location-from-token::
3098     $token => {$token},
3099     $result => {$location},
3100     }__;
3101     my $continue = __DOMCore:ERROR{xp|wf-entity-declared::
3102     xp|error-token => {$token},
3103     c|location => {$location},
3104     xp|name => {$name},
3105     }__;
3106     unless ($continue) {
3107 wakaba 1.27 __CODE{ParseError}__;
3108 wakaba 1.22 }
3109     }
3110    
3111     if ($ent->{is_external_entity}) {
3112     my $location;
3113     __CODE{xp|get-location-from-token::
3114     $token => {$token},
3115     $result => {$location},
3116     }__;
3117     my $continue = __c|ERROR{xp|wf-no-external-entity-references::
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 wakaba 1.23 ## NOTE: |xp:wf-parsed-entity| is not checked
3126 wakaba 1.22 } # if external entity
3127    
3128 wakaba 1.35 $er-><AS::GERef.manakaiExpanded>
3129 wakaba 1.19 ($ent->{has_replacement_text});
3130 wakaba 1.22 push @{$self->{entity}}, <Code::getCopyOfEntityState::
3131 wakaba 1.6 $entity_type = 'general_entity',
3132     $entity_name = $name>;
3133 wakaba 1.23
3134     if ($ent->{is_opened}) {
3135     my $location;
3136     __CODE{xp|get-location-from-token::
3137     $token => {$token},
3138     $result => {$location},
3139     }__;
3140     my $continue = __c|ERROR{xp|wf-no-recursion::
3141     xp|error-token => {$token},
3142     c|location => {$location},
3143     xp|name => {$name},
3144     }__;
3145     unless ($continue) {
3146 wakaba 1.27 __CODE{ParseError}__;
3147 wakaba 1.23 }
3148 wakaba 1.27 open my $empty, '<', \'';
3149     $self->{entity}->[-1]->{fh} = $empty;
3150 wakaba 1.35 $er-><AS::GERef.manakaiExpanded> (false);
3151 wakaba 1.23 } # recursive
3152     $ent->{is_opened} = true;
3153 wakaba 1.22 }
3154     $parent-><M::Node.appendChild> ($er);
3155 wakaba 1.14 $self->{location} = $self->{entity}->[-1];
3156 wakaba 1.6 push @{$self->{entity_token}}, $self->{token};
3157     $self->{token} = [];
3158     push @{$self->{entity_char}}, $self->{char};
3159     $self->{char} = [];
3160     }
3161    
3162 wakaba 1.11 ?lexmode AttributeValueLiteralE;
3163     &AttributeValueLiteralE_ ($parent => $er, $vals => $vals);
3164 wakaba 1.6 ~ (#EOF) { }
3165     lang:Perl {
3166 wakaba 1.23 $self->{general_entity}->{$self->{entity}->[-1]->{name}}
3167     ->{is_opened} = false
3168     if $self->{general_entity}->{$self->{entity}->[-1]->{name}};
3169 wakaba 1.6 $self->{token} = pop @{$self->{entity_token}};
3170     $self->{char} = pop @{$self->{entity_char}};
3171 wakaba 1.27 pop (@{$self->{entity}})->{close_file}->();
3172 wakaba 1.14 $self->{location} = $self->{entity}->[-1];
3173 wakaba 1.35
3174     $er-><M::Node.manakaiSetReadOnly> (true, true);
3175 wakaba 1.6 }
3176    
3177     ?lexmode EntityReference;
3178     ?requires-next-token;
3179 wakaba 1.1 }
3180    
3181     // ~ (REFC) { }
3182 wakaba 1.11 } // _GeneralEntityReferenceAE_
3183 wakaba 1.6
3184     /*
3185 wakaba 1.24 General Entity Reference in Literal Entity Value in Entity Declaration
3186 wakaba 1.6 */
3187 wakaba 1.11 rule _GeneralEntityReferenceEV_ ($vals) {
3188 wakaba 1.6 ?lexmode 'EntityReference';
3189    
3190     ~ (Name) {
3191     lang:Perl ($name => $token.value) {
3192 wakaba 1.26 __CODE{checkNCName:: $name => $name}__;
3193 wakaba 1.6 push @$vals, $name;
3194     }
3195 wakaba 1.24 /*
3196     WFCs such as Entity Declared are not checked
3197     <http://www.w3.org/TR/xml11/#bypass>
3198    
3199     Note that violation to the Parsed Entity WFC is an error
3200     rather than fatal error here.
3201     */
3202 wakaba 1.6 }
3203 wakaba 1.11
3204     // No expansion
3205 wakaba 1.6
3206     // ~ (REFC) { }
3207     } // _GeneralEntityReferenceEV_
3208 wakaba 1.1
3209     /*
3210 wakaba 1.4 Document Type Declaration
3211 wakaba 1.1 */
3212 wakaba 1.4 rule _DocumentTypeDeclaration_ ($doc) {
3213     ?lexmode MarkupDeclaration;
3214    
3215     ~ (Name == 'DOCTYPE') { }
3216    
3217     ~ (S) { }
3218    
3219     // Document type name
3220 wakaba 1.6 my $name;
3221 wakaba 1.4 ~ (Name) {
3222 wakaba 1.6 lang:Perl ($v => $token.value) {
3223 wakaba 1.26 __CODE{checkQName:: $name => $v}__;
3224 wakaba 1.6 $name = $v;
3225     }
3226     }
3227 wakaba 1.17
3228     my $node;
3229     my $decl;
3230 wakaba 1.6 lang:Perl {
3231 wakaba 1.11 $self->{docx} = $self->{doc}
3232     -><M::Node.getFeature> (<Q::fe:XDoctype>, '3.0');
3233     $node = $self->{docx}-><M::DocumentXDoctype.createDocumentTypeDefinition>
3234     ($name);
3235 wakaba 1.17 $decl = $self->{dtdecl} = $node-><M::Node.getFeature>
3236     (<Q::fe:XDoctypeDeclaration>, '3.0');
3237 wakaba 1.4 }
3238    
3239 wakaba 1.25 my $has_extid;
3240 wakaba 1.4 ~? (S) {
3241     ~? (Name == 'PUBLIC') {
3242     ~ (S) { }
3243    
3244 wakaba 1.17 &PubidLiteral ($decl => $decl);
3245 wakaba 1.4
3246     ~ (S) { }
3247    
3248 wakaba 1.17 &SystemLiteral ($decl => $decl);
3249 wakaba 1.4
3250     ~? (S) { }
3251 wakaba 1.19
3252     lang:Perl {
3253     $self->{has_xref} = true;
3254 wakaba 1.25 $has_extid = true;
3255 wakaba 1.19 }
3256 wakaba 1.4 } (Name == 'SYSTEM') {
3257     ~ (S) { }
3258    
3259 wakaba 1.17 &SystemLiteral ($decl => $decl);
3260 wakaba 1.4
3261     ~? (S) { }
3262 wakaba 1.19
3263     lang:Perl {
3264     $self->{has_xref} = true;
3265 wakaba 1.25 $has_extid = true;
3266 wakaba 1.19 }
3267 wakaba 1.4 }
3268     }
3269 wakaba 1.17
3270 wakaba 1.11 lang:Perl {
3271     $self->{dtdef} = $node;
3272 wakaba 1.21 $self->{doc}-><M::Node.appendChild> ($node);
3273     $self->{doc_cfg}-><M::c|DOMConfiguration.setParameter>
3274     ('schema-type' => <Q::xml-dtd:>);
3275     ## ISSUE: Should default schema language information be
3276     ## preserved by some other flag?
3277 wakaba 1.11 }
3278    
3279 wakaba 1.4 ~? (DSO) {
3280 wakaba 1.6 &InternalSubset ($doc => $doc, $doctype => $node);
3281 wakaba 1.4
3282     ~ (DSC) {
3283     ?lexmode MarkupDeclaration;
3284     } else {
3285     ?lexmode MarkupDeclaration;
3286     }
3287    
3288     ~? (S) { }
3289     }
3290    
3291 wakaba 1.25 // TODO: Read and process external subset if any.
3292     lang:Perl {
3293     $self->{dont_process} = true if $has_extid;
3294 wakaba 1.35 $node-><M::Node.manakaiSetReadOnly> (true, true);
3295 wakaba 1.25 }
3296    
3297 wakaba 1.4 // ~ (MDC) { }
3298     } // _DocumentTypeDeclaration_
3299    
3300 wakaba 1.17 /*
3301     Public Identifier Literal
3302     */
3303     rule PubidLiteral ($decl) {
3304     my $pubid;
3305     my $pubid_token;
3306 wakaba 1.4 ~ (LIT) {
3307     ?lexmode SystemLiteral;
3308    
3309     ~? (STRING) {
3310 wakaba 1.17 lang:Perl ($v => $token.value) {
3311     $pubid = $v;
3312     $pubid_token = $token;
3313     }
3314 wakaba 1.4 }
3315    
3316     ~ (LIT) {
3317     ?lexmode MarkupDeclaration;
3318     } else {
3319     ?lexmode MarkupDeclaration;
3320     }
3321     } (LITA) {
3322     ?lexmode SystemLiteralA;
3323    
3324     ~? (STRING) {
3325 wakaba 1.17 lang:Perl ($v => $token.value) {
3326     $pubid = $v;
3327     $pubid_token = $token;
3328     }
3329 wakaba 1.4 }
3330    
3331     ~ (LITA) {
3332     ?lexmode MarkupDeclaration;
3333     } else {
3334     ?lexmode MarkupDeclaration;
3335     }
3336     }
3337 wakaba 1.17
3338     if-true ($pubid_token) {
3339     lang:Perl : has-error {
3340     if ($pubid =~ m{[^\x20\x0D\x0Aa-zA-Z0-9'()+,./:=?;!*#\@\$_%-]}s) {
3341     my $location;
3342     __CODE{xp|get-location-from-token::
3343     $token => {$pubid_token},
3344     $result => {$location},
3345     }__;
3346     ## Should this be other (new) error type?
3347     my $continue = __DOMCore:ERROR{xp|wf-syntax-error::
3348     xp|error-token => {$token},
3349     c|location => {$location},
3350     }__;
3351     unless ($continue) {
3352 wakaba 1.27 __CODE{ParseError}__;
3353 wakaba 1.17 }
3354     }
3355    
3356     ## NOTE: U+0009 is syntactically illegal.
3357 wakaba 1.23 $pubid =~ s/[\x09\x0A\x0D\x20]+/\x20/gs;
3358 wakaba 1.17 $pubid =~ s/\A\x20//s;
3359     $pubid =~ s/\x20\z//s;
3360     ## NOTE: Bare attribute name is written.
3361     $decl->public_id ($pubid);
3362     }
3363     }
3364 wakaba 1.4 } // PubidLiteral
3365    
3366 wakaba 1.17 /*
3367     System Identifier Literal
3368     */
3369     rule SystemLiteral ($decl) {
3370 wakaba 1.4 ~ (LIT) {
3371     ?lexmode SystemLiteral;
3372 wakaba 1.17 &_SystemLiteral ($decl => $decl);
3373 wakaba 1.4 } (LITA) {
3374     ?lexmode SystemLiteralA;
3375 wakaba 1.17 &_SystemLiteral ($decl => $decl);
3376 wakaba 1.4 }
3377     } // SystemLiteral
3378    
3379 wakaba 1.17 /*
3380     System Identifier Literal Content
3381 wakaba 1.29
3382     Used in document type declaration, entity declaration,
3383     and notation declaration.
3384 wakaba 1.17 */
3385     rule _SystemLiteral ($decl) {
3386     // LIT or LITA
3387    
3388 wakaba 1.4 ~? (STRING) {
3389 wakaba 1.17 lang:Perl ($v => $token.value) {
3390 wakaba 1.35 $decl-><AS::GE.systemId> ($v);
3391     $decl-><AS::GE.manakaiDeclarationBaseURI>
3392 wakaba 1.29 ($self->{location}->{base_uri});
3393 wakaba 1.17 }
3394 wakaba 1.4 }
3395    
3396     ~ (LIT) {
3397     ?lexmode MarkupDeclaration;
3398     } (LITA) {
3399     ?lexmode MarkupDeclaration;
3400     } else {
3401     ?lexmode MarkupDeclaration;
3402     }
3403     } // _SystemLiteral
3404    
3405     /*
3406     DTD Internal Subset
3407    
3408     intSubset := *(markupdecl / DeclSep) ;; [28b]
3409     */
3410 wakaba 1.6 rule InternalSubset ($doc, $doctype) {
3411 wakaba 1.4 ?lexmode DTD;
3412    
3413     ~* (MDO) {
3414     ?lexmode MarkupDeclaration;
3415    
3416     ~ (Name == 'ELEMENT') {
3417     &_ElementDeclaration ($doc => $doc);
3418     } (Name == 'ATTLIST') {
3419 wakaba 1.8 &_AttlistDeclaration ($doc => $doc, $doctype => $doctype);
3420 wakaba 1.4 } (Name == 'ENTITY') {
3421     &_EntityDeclaration ($doc => $doc);
3422     } (Name == 'NOTATION') {
3423     &_NotationDeclaration ($doc => $doc);
3424     }
3425     } (S) {
3426     //
3427     } (CDO) {
3428     &_CommentDeclarationDTD ($doc => $doc);
3429     } (PIO) {
3430 wakaba 1.6 &_ProcessingInstructionDTD ($doc => $doc, $doctype => $doctype);
3431 wakaba 1.4 } (PERO) {
3432     ?lexmode EntityReference;
3433    
3434 wakaba 1.19 lang:Perl {
3435     $self->{has_xref} = true;
3436 wakaba 1.25 $self->{dont_process} = true;
3437 wakaba 1.19 }
3438    
3439 wakaba 1.4 ~ (Name) {
3440 wakaba 1.26 // TODO: __CODE{checkNCName:: $name => $name}__;
3441 wakaba 1.4
3442     }
3443    
3444     ~ (REFC) {
3445     ?lexmode DTD;
3446     } else {
3447     ?lexmode DTD;
3448     }
3449     }
3450     } // InternalSubset
3451    
3452     rule _ElementDeclaration ($doc) {
3453     // ~ (MDO) { }
3454     // ?lexmode MarkupDeclaration
3455     // ~ (Name == 'Element') { }
3456    
3457     ~ (S) { }
3458    
3459     ~ (Name) {
3460 wakaba 1.26 // TODO: __CODE{checkQName:: $name => $name}__;
3461 wakaba 1.4
3462     }
3463    
3464     ?lexmode ElementDeclaration;
3465    
3466     ~ (S) { }
3467    
3468     // contentspec
3469     ~ (MGO) {
3470     &_ContentModel ($doc => $doc);
3471     } (Name == 'EMPTY') {
3472    
3473     } (Name == 'ANY') {
3474    
3475     }
3476    
3477     ~? (S) { }
3478    
3479     ~ (MDC) {
3480     ?lexmode DTD;
3481     } else {
3482     ?lexmode DTD;
3483     }
3484     } // _ElementDeclaration
3485    
3486     rule _ContentModel ($doc) {
3487     // ~ (MGO) { }
3488    
3489     ~? (S) { }
3490    
3491     ~ (Name) {
3492     // Element content model
3493     &_ModelGroup ($doc => $doc)
3494     : unshift-current-token;
3495    
3496     ~? (OPT) {
3497    
3498     } (REP) {
3499    
3500     } (PLUS) {
3501    
3502     }
3503    
3504     } (MDO) {
3505     &_ModelGroup ($doc => $doc)
3506     : unshift-current-token;
3507    
3508     ~? (OPT) {
3509    
3510     } (REP) {
3511    
3512     } (PLUS) {
3513    
3514     }
3515    
3516     } (PCDATA) {
3517     // Mixed content declaration
3518     ~? (S) { }
3519    
3520     ~* (OR) {
3521     ~? (S) { }
3522    
3523     ~ (Name) {
3524 wakaba 1.26 // TODO: Name & QName check
3525 wakaba 1.4
3526     }
3527    
3528     ~? (S) { }
3529     }
3530    
3531     ~ (MGC) { }
3532    
3533     ~? (REP) {
3534    
3535     } else {
3536     // TODO: error if |Name|
3537     }
3538    
3539    
3540     }
3541     } // _ContentModel
3542    
3543     rule _ModelGroup ($doc)
3544     : standalone
3545     : recursive
3546     {
3547     // ~ (MGO) { }
3548     // ~? (S) { }
3549    
3550     &ContentParticle ($doc => $doc);
3551    
3552     ~? (S) { }
3553    
3554     ~? (OR) {
3555     ~? (S) { }
3556    
3557     &ContentParticle ($doc => $doc);
3558    
3559     ~? (S) { }
3560    
3561     ~* (OR) {
3562     ~? (S) { }
3563    
3564     &ContentParticle ($doc => $doc);
3565    
3566     ~? (S) { }
3567     }
3568    
3569     } (SEQ) {
3570     ~? (S) { }
3571    
3572     &ContentParticle ($doc => $doc);
3573    
3574     ~? (S) { }
3575    
3576     ~* (SEQ) {
3577     ~? (S) { }
3578    
3579     &ContentParticle ($doc => $doc);
3580    
3581     ~? (S) { }
3582     }
3583    
3584     }
3585    
3586     ~ (MGC) { }
3587     } // _ModelGroup
3588    
3589     rule ContentParticle ($doc) {
3590     ~ (Name) {
3591 wakaba 1.26 // TODO: Name & QName check
3592 wakaba 1.4
3593     } (MGO) {
3594     ~? (S) { }
3595    
3596     &_ModelGroup ($doc => $doc);
3597     }
3598    
3599     ~? (OPT) {
3600    
3601     } (REP) {
3602    
3603     } (PLUS) {
3604    
3605     }
3606     } // ContentParticle
3607    
3608 wakaba 1.8 /*
3609     Attribute list declaration
3610     */
3611     rule _AttlistDeclaration ($doc, $doctype) {
3612 wakaba 1.4 // ~ (MDO) { }
3613     // ~ (Name == 'ATTLIST') { }
3614    
3615     ?lexmode AttlistDeclaration;
3616    
3617     ~ (S) { }
3618    
3619 wakaba 1.8 my $name;
3620 wakaba 1.4 ~ (Name) {
3621 wakaba 1.8 lang:Perl ($v => $token.value) {
3622 wakaba 1.26 __CODE{checkQName:: $name => $v}__;
3623 wakaba 1.8 $name = $v;
3624     }
3625     } else {
3626     lang:Perl { $name = '#ILLEGAL' }
3627     }
3628 wakaba 1.4
3629 wakaba 1.8 my $docxd;
3630     my $et;
3631     lang:Perl {
3632     $et = $doctype-><M::DTDef.getElementTypeDefinitionNode> ($name);
3633     unless ($et) {
3634 wakaba 1.11 $docxd = $doc-><M::Node.getFeature> (<Q::fe:XDoctype>, '3.0');
3635 wakaba 1.8 $et = $docxd-><M::DocumentXDoctype.createElementTypeDefinition>
3636     ($name);
3637     $doctype-><M::DTDef.setElementTypeDefinitionNode> ($et)
3638     unless $name eq '#ILLEGAL';
3639     }
3640 wakaba 1.4 }
3641    
3642     ~? (S) { }
3643    
3644     ~* (Name) {
3645 wakaba 1.8 my $at;
3646 wakaba 1.25 lang:Perl ($v => $token.value) : has-error {
3647 wakaba 1.26 __CODE{checkQName:: $name => $v}__;
3648 wakaba 1.8 $docxd ||= $doc-><M::Node.getFeature>
3649 wakaba 1.11 (<Q::fe:XDoctype>, '3.0');
3650 wakaba 1.8 $at = $docxd-><M::DocumentXDoctype.createAttributeDefinition> ($v);
3651 wakaba 1.25 if (exists $et-><AG::ETDef.attributeDefinitions>->{$v}) {
3652     my $location;
3653     __CODE{xp|get-location-from-token::
3654     $token => {$token},
3655     $result => {$location},
3656     }__;
3657     my $continue = __c|ERROR{xp|warning-attribute-definition-ignored::
3658     xp|error-token => {$token},
3659     c|location => {$location},
3660     xp|name => {$v},
3661     }__;
3662     unless ($continue) {
3663 wakaba 1.27 __CODE{ParseError}__;
3664 wakaba 1.25 }
3665     } elsif ($self->{dont_process} and not $self->{standalone}) {
3666     my $location;
3667     __CODE{xp|get-location-from-token::
3668     $token => {$token},
3669     $result => {$location},
3670     }__;
3671     my $continue = __c|ERROR{
3672     xp|warning-attribute-definition-not-processed::
3673     xp|error-token => {$token},
3674     c|location => {$location},
3675     xp|name => {$v},
3676     }__;
3677     unless ($continue) {
3678 wakaba 1.27 __CODE{ParseError}__;
3679 wakaba 1.25 }
3680     } else {
3681 wakaba 1.9 $et-><M::ETDef.setAttributeDefinitionNode> ($at);
3682     $self->{attr}->{$name}->{$v} = $at;
3683     }
3684 wakaba 1.8 }
3685 wakaba 1.4
3686     ~ (S) { }
3687    
3688     // AttType
3689     ~ (Name == 'NOTATION') {
3690     ~ (S) { }
3691    
3692 wakaba 1.8 my $kwd;
3693     lang:Perl {
3694     $at-><AS::ATDef.declaredType> (<C::ATDef.NOTATION_ATTR>);
3695     $kwd = $at-><AG::ATDef.allowedTokens>;
3696     }
3697    
3698 wakaba 1.4 ~ (EGO) {
3699     ~? (S) { }
3700    
3701 wakaba 1.8 ~+ (Name) {
3702 wakaba 1.26 lang:Perl ($v => $token.value) : has-error {
3703     __CODE{checkNCName:: $name => $v}__;
3704 wakaba 1.8 push @$kwd, $v;
3705     }
3706 wakaba 1.4
3707     ~? (S) { }
3708     } (OR) : separator {
3709     ~? (S) { }
3710     }
3711    
3712     ~ (EGC) { }
3713     }
3714 wakaba 1.8
3715 wakaba 1.4 } (Name) {
3716 wakaba 1.8 my $type;
3717     lang:Perl ($v => $token.value) : has-error {
3718     my $map = {
3719     CDATA => <C::ATDef.CDATA_ATTR>,
3720     ID => <C::ATDef.ID_ATTR>,
3721     IDREF => <C::ATDef.IDREF_ATTR>,
3722     IDREFS => <C::ATDef.IDREFS_ATTR>,
3723     ENTITY => <C::ATDef.ENTITY_ATTR>,
3724     ENTITIES => <C::ATDef.ENTITIES_ATTR>,
3725     NMTOKEN => <C::ATDef.NMTOKEN_ATTR>,
3726     NMTOKENS => <C::ATDef.NMTOKENS_ATTR>,
3727     };
3728     if ($map->{$v}) {
3729     $at-><AS::ATDef.declaredType> ($map->{$v});
3730     } else {
3731     ## TODO: Exception
3732     }
3733     }
3734 wakaba 1.4
3735     } (EGO) {
3736     ?lexmode Enumeration;
3737    
3738     ~? (S) { }
3739    
3740 wakaba 1.8 my $kwd;
3741     lang:Perl {
3742     $at-><AS::ATDef.declaredType> (<C::ATDef.ENUMERATION_ATTR>);
3743     $kwd = $at-><AG::ATDef.allowedTokens>;
3744     }
3745    
3746     ~+ (Nmtoken) {
3747     lang:Perl ($v => $token.value) {
3748     push @$kwd, $v;
3749     }
3750 wakaba 1.4
3751     ~? (S) { }
3752     } (OR) : separator {
3753     ~? (S) { }
3754     }
3755    
3756     ~ (EGC) {
3757     ?lexmode AttlistDeclaration;
3758     } else {
3759     ?lexmode AttlistDeclaration;
3760     }
3761    
3762     }
3763    
3764     ~ (S) { }
3765    
3766     // DefaultDecl
3767     ~ (RNI) {
3768     ~ (Name == 'REQUIRED') {
3769 wakaba 1.8 lang:Perl {
3770     $at-><AS::ATDef.defaultType> (<C::ATDef.REQUIRED_DEFAULT>);
3771     }
3772 wakaba 1.4 } (Name == 'IMPLIED') {
3773 wakaba 1.8 lang:Perl {
3774     $at-><AS::ATDef.defaultType> (<C::ATDef.IMPLIED_DEFAULT>);
3775     }
3776 wakaba 1.4 } (Name == 'FIXED') {
3777     ~ (S) { }
3778 wakaba 1.8
3779     lang:Perl {
3780     $at-><AS::ATDef.defaultType> (<C::ATDef.FIXED_DEFAULT>);
3781     }
3782 wakaba 1.4
3783     ~ (LIT) {
3784     my $vals;
3785     lang:Perl {
3786 wakaba 1.8 $vals = {nodes => [], value => ''};
3787 wakaba 1.4 }
3788    
3789     &_AttributeValueSpecification_ ($doc => $doc, $vals => $vals);
3790    
3791 wakaba 1.8 lang:Perl {
3792     for (@{$vals->{nodes}}) {
3793     $at-><M::Node.appendChild> ($_);
3794     }
3795     }
3796    
3797 wakaba 1.4 ~ (LIT) {
3798     ?lexmode AttlistDeclaration;
3799     } else {
3800     ?lexmode AttlistDeclaration;
3801     }
3802     } (LITA) {
3803     my $vals;
3804     lang:Perl {
3805 wakaba 1.8 $vals = {nodes => [], value => ''};
3806 wakaba 1.4 }
3807    
3808     &_AttributeValueSpecificationA_ ($doc => $doc, $vals => $vals);
3809    
3810 wakaba 1.8 lang:Perl {
3811     for (@{$vals->{nodes}}) {
3812     $at-><M::Node.appendChild> ($_);
3813     }
3814     }
3815    
3816     ~ (LITA) {
3817 wakaba 1.4 ?lexmode AttlistDeclaration;
3818     } else {
3819     ?lexmode AttlistDeclaration;
3820     }
3821     }
3822     }
3823    
3824     } (LIT) {
3825     my $vals;
3826     lang:Perl {
3827 wakaba 1.8 $at-><AS::ATDef.defaultType> (<C::ATDef.EXPLICIT_DEFAULT>);
3828     $vals = {nodes => [], value => ''};
3829 wakaba 1.4 }
3830    
3831     &_AttributeValueSpecification_ ($doc => $doc, $vals => $vals);
3832    
3833 wakaba 1.8 lang:Perl {
3834     for (@{$vals->{nodes}}) {
3835     $at-><M::Node.appendChild> ($_);
3836     }
3837     }
3838    
3839 wakaba 1.4 ~ (LIT) {
3840     ?lexmode AttlistDeclaration;
3841     } else {
3842     ?lexmode AttlistDeclaration;
3843     }
3844     } (LITA) {
3845     my $vals;
3846     lang:Perl {
3847 wakaba 1.8 $at-><AS::ATDef.defaultType> (<C::ATDef.EXPLICIT_DEFAULT>);
3848     $vals = {nodes => [], value => ''};
3849 wakaba 1.4 }
3850    
3851     &_AttributeValueSpecificationA_ ($doc => $doc, $vals => $vals);
3852    
3853 wakaba 1.8 lang:Perl {
3854     for (@{$vals->{nodes}}) {
3855     $at-><M::Node.appendChild> ($_);
3856     }
3857     }
3858    
3859 wakaba 1.4 ~ (LITA) {
3860     ?lexmode AttlistDeclaration;
3861     } else {
3862     ?lexmode AttlistDeclaration;
3863     }
3864     }
3865    
3866     } (S) : separator : terminator? {
3867     //
3868     }
3869    
3870     ~ (MDC) {
3871     ?lexmode DTD;
3872     } else {
3873     ?lexmode DTD;
3874     }
3875     } // _AttlistDeclaration
3876    
3877 wakaba 1.11 /*
3878 wakaba 1.26 Entity Declaration
3879 wakaba 1.11 */
3880 wakaba 1.4 rule _EntityDeclaration ($doc) {
3881     // ~ (MDO) { }
3882     // ~ (Name == ENTITY) { }
3883    
3884     ~ (S) { }
3885    
3886 wakaba 1.23 my $is_param_entity;
3887 wakaba 1.6 my $decl;
3888 wakaba 1.27 lang:Perl {
3889     $decl = {
3890     name => '#ILLEGAL',
3891     reptxt => \'',
3892     is_external_entity => false,
3893     document_uri => $self->{location}->{document_uri},
3894     base_uri => $self->{location}->{base_uri},
3895     };
3896     }
3897 wakaba 1.6
3898 wakaba 1.4 ~? (PERO) {
3899     ~ (S) { }
3900 wakaba 1.6 lang:Perl {
3901 wakaba 1.23 $is_param_entity = $decl->{is_param_entity} = true;
3902 wakaba 1.6 }
3903 wakaba 1.4 }
3904    
3905 wakaba 1.19 /*
3906     TODO: Set |$decl->{is_externally_declared}| flag
3907     and |Entity.isExternallyDeclared| attribute
3908     for entity declarations in external subset or
3909     in parameter entity.
3910     */
3911    
3912 wakaba 1.4 ~ (Name) {
3913 wakaba 1.6 lang:Perl ($v => $token.value) {
3914 wakaba 1.26 __CODE{checkNCName:: $name => $v}__;
3915 wakaba 1.6 $decl->{name} = $v;
3916     }
3917 wakaba 1.4 }
3918    
3919 wakaba 1.18 my $node;
3920 wakaba 1.11 lang:Perl {
3921 wakaba 1.18 $node =
3922 wakaba 1.11 $decl->{node} = $self->{docx}-><M::DocumentXDoctype.createGeneralEntity>
3923     ($decl->{name});
3924     ## TODO: Parameter entity...
3925     }
3926    
3927 wakaba 1.4 ~ (S) { }
3928    
3929     ~ (LIT) {
3930 wakaba 1.6 &_EntityValue ($doc => $doc, $decl => $decl);
3931 wakaba 1.4 } (LITA) {
3932 wakaba 1.6 &_EntityValueA ($doc => $doc, $decl => $decl);
3933 wakaba 1.4 } (Name == 'PUBLIC') {
3934     ~ (S) { }
3935    
3936 wakaba 1.18 &PubidLiteral ($decl => $node);
3937 wakaba 1.4
3938     ~ (S) { }
3939    
3940 wakaba 1.18 &SystemLiteral ($decl => $node);
3941    
3942     lang:Perl {
3943     $decl->{is_external_entity} = true;
3944     }
3945 wakaba 1.4 } (Name == 'SYSTEM') {
3946     ~ (S) { }
3947    
3948 wakaba 1.18 &SystemLiteral ($decl => $node);
3949    
3950     lang:Perl {
3951     $decl->{is_external_entity} = true;
3952     }
3953 wakaba 1.4 }
3954    
3955     ~? (S) {
3956     ~? (Name == 'NDATA') {
3957 wakaba 1.23 if-true ($is_param_entity) {
3958     lang:Perl : has-error {
3959     my $location;
3960     __CODE{xp|get-location-from-token::
3961     $token => {$token},
3962     $result => {$location},
3963     }__;
3964     my $continue = __DOMCore:ERROR{xp|wf-syntax-error::
3965     xp|error-token => {$token},
3966     c|location => {$location},
3967     }__;
3968     unless ($continue) {
3969 wakaba 1.27 __CODE{ParseError}__;
3970 wakaba 1.23 }
3971     }
3972     }
3973 wakaba 1.4
3974     ~ (S) { }
3975    
3976     ~ (Name) {
3977 wakaba 1.26 lang:Perl ($v => $token.value) : has-error {
3978     __CODE{checkNCName:: $name => $v}__;
3979 wakaba 1.6 $decl->{notation} = $v;
3980 wakaba 1.35 $decl->{node}-><AG::GE.notationName> ($v);
3981 wakaba 1.6 }
3982 wakaba 1.4 }
3983    
3984     ~? (S) { }
3985     }
3986     }
3987    
3988 wakaba 1.24 lang:Perl : has-error {
3989 wakaba 1.6 if ($self->{$decl->{is_param_entity} ? 'param_entity' : 'general_entity'}
3990     ->{$decl->{name}}) {
3991 wakaba 1.24 ## Predefined entity
3992     if (not $decl->{is_param_entity} and
3993     {lt => true, gt => true, amp => true,
3994     quot => true, apos => true}->{$decl->{name}}) {
3995     if ($decl->{is_external_entity}) {
3996     my $location;
3997     __CODE{xp|get-location-from-token::
3998     $token => {$token},
3999     $result => {$location},
4000     }__;
4001     my $continue = __c|ERROR{xp|error-internal-predefined-entity::
4002     xp|error-token => {$token},
4003     c|location => {$location},
4004     xp|name => {$decl->{name}},
4005     }__;
4006     unless ($continue) {
4007 wakaba 1.27 __CODE{ParseError}__;
4008 wakaba 1.24 }
4009     } elsif (
4010     not ({gt => true, apos => true, quot => true}->{$decl->{name}} and
4011     ${$decl->{reptxt}} eq {
4012     gt => '>', apos => "'", quot => '"',
4013     }->{$decl->{name}}) and
4014     not (${$decl->{reptxt}} =~ /\A&#0*@{[{
4015     lt => '60', gt => '62', amp => '38',
4016     apos => '39', quot => '34',
4017     }->{$decl->{name}}]};\z/) and
4018     not (${$decl->{reptxt}} =~ /\A&#x0*(?:(?i)@{[{
4019     lt => '3C', gt => '3E', amp => '26',
4020     apos => '27', quot => '22',
4021     }->{$decl->{name}}]});\z/)
4022     ) {
4023     ## NOTE: See "SuikaWiki - Predefined Entities"
4024     ## "http://suika.fam.cx/gate/2005/sw/%E5%AE%9A%E7%BE%A9%E6%B8%88%E5%AE%9F%E4%BD%93".
4025     my $location;
4026     __CODE{xp|get-location-from-token::
4027     $token => {$token},
4028     $result => {$location},
4029     }__;
4030     my $continue = __c|ERROR{xp|error-malformed-predefined-entity::
4031     xp|error-token => {$token},
4032     c|location => {$location},
4033     xp|name => {$decl->{name}},
4034     xp|replacement-text => {${$decl->{reptxt}}},
4035     }__;
4036     unless ($continue) {
4037 wakaba 1.27 __CODE{ParseError}__;
4038 wakaba 1.24 }
4039     }
4040 wakaba 1.25 $self->{dtdecl}->{<H::mn:node>}->{{
4041     lt => <H::d|hasLtDeclaration>,
4042     gt => <H::d|hasGtDeclaration>,
4043     amp => <H::d|hasAmpDeclaration>,
4044     apos => <H::d|hasAposDeclaration>,
4045     quot => <H::d|hasQuotDeclaration>,
4046     }->{$decl->{name}}} = true;
4047 wakaba 1.24 } else { ## Dupulicating declaration
4048     my $location;
4049     __CODE{xp|get-location-from-token::
4050     $token => {$token},
4051     $result => {$location},
4052     }__;
4053     my $continue = __c|ERROR{xp|warning-entity-declaration-ignored::
4054     xp|error-token => {$token},
4055     c|location => {$location},
4056     xp|name => {$decl->{name}},
4057     }__;
4058     unless ($continue) {
4059 wakaba 1.27 __CODE{ParseError}__;
4060 wakaba 1.24 }
4061     }
4062 wakaba 1.25 } elsif ($self->{dont_process} and not $self->{standalone}) {
4063     ## TODO: |standalone| and parameter entities??
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-not-processed::
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.25 }
4077 wakaba 1.6 } else {
4078     $self->{$decl->{is_param_entity} ? 'param_entity' : 'general_entity'}
4079     ->{$decl->{name}} = $decl;
4080 wakaba 1.11 $self->{dtdef}-><M::DTDef.setGeneralEntityNode> ($decl->{node})
4081     unless $decl->{is_param_entity};
4082 wakaba 1.6 }
4083     }
4084    
4085 wakaba 1.4 ~ (MDC) {
4086     ?lexmode DTD;
4087     } else {
4088     ?lexmode DTD;
4089     }
4090     } // _EntityDeclaration
4091    
4092 wakaba 1.26 /*
4093     Notation Declaration
4094     */
4095     rule _NotationDeclaration {
4096 wakaba 1.4 // ~ (MDO) { }
4097     // ~ (Name == NOTATION) { }
4098    
4099     ~ (S) { }
4100    
4101 wakaba 1.26 my $name;
4102 wakaba 1.4 ~ (Name) {
4103 wakaba 1.26 lang:Perl ($v => $token.value) : has-error {
4104     __CODE{checkNCName:: $name => $v}__;
4105     $name = $v;
4106     }
4107     } else {
4108     lang:Perl {
4109     $name = '#INVALID';
4110     }
4111     }
4112 wakaba 1.4
4113     ~ (S) { }
4114    
4115 wakaba 1.17 lang:Perl {
4116 wakaba 1.26 $decl = $self->{docx}-><M::DocumentXDoctype.createNotation> ($name);
4117 wakaba 1.17 }
4118    
4119 wakaba 1.4 ~ (Name == 'PUBLIC') {
4120     ~ (S) { }
4121    
4122 wakaba 1.17 &PubidLiteral ($decl => $decl);
4123 wakaba 1.4
4124     ~? (S) {
4125     ~? (LIT) {
4126     ?lexmode SystemLiteral;
4127 wakaba 1.17 &_SystemLiteral ($decl => $decl);
4128 wakaba 1.4
4129     ~? (S) { }
4130     } (LITA) {
4131     ?lexmode SystemLiteralA;
4132 wakaba 1.17 &_SystemLiteral ($decl => $decl);
4133 wakaba 1.4
4134     ~? (S) { }
4135     }
4136     }
4137     } (Name == 'SYSTEM') {
4138     ~ (S) { }
4139    
4140 wakaba 1.17 &SystemLiteral ($decl => $decl);
4141 wakaba 1.4
4142     ~? (S) { }
4143     }
4144    
4145 wakaba 1.26 lang:Perl : has-error {
4146     if ($self->{dtdef}-><M::DTDef.getNotationNode> ($name)) {
4147     ## Dupulication
4148     my $location;
4149     __CODE{xp|get-location-from-token::
4150     $token => {$token},
4151     $result => {$location},
4152     }__;
4153     my $continue = __c|ERROR{xp|vc-unique-notation-name::
4154     xp|error-token => {$token},
4155     c|location => {$location},
4156     xp|name => {$name},
4157     }__;
4158     unless ($continue) {
4159 wakaba 1.27 __CODE{ParseError}__;
4160 wakaba 1.26 }
4161     } else {
4162     $self->{dtdef}-><M::DTDef.setNotationNode> ($decl);
4163     }
4164     }
4165    
4166 wakaba 1.4 ~ (MDC) {
4167     ?lexmode DTD;
4168     } else {
4169     ?lexmode DTD;
4170     }
4171     } // _NotationDeclaration
4172    
4173 wakaba 1.11 rule _EntityValue ($decl) {
4174 wakaba 1.4 ?lexmode EntityValue;
4175    
4176     my $vals;
4177 wakaba 1.6 my $reptxt;
4178 wakaba 1.4 lang:Perl {
4179     $vals = [];
4180 wakaba 1.6 $reptxt = '';
4181 wakaba 1.4 }
4182    
4183     ~* (STRING) {
4184 wakaba 1.6 lang:Perl ($v => $token.value) {
4185     $reptxt .= $v;
4186     }
4187 wakaba 1.4 } (PERO) {
4188 wakaba 1.25 ?lexmode EntityReference;
4189 wakaba 1.19
4190     lang:Perl {
4191     $self->{has_xref} = true;
4192 wakaba 1.25 $self->{dont_process} = true;
4193 wakaba 1.19 }
4194 wakaba 1.6
4195     // TODO: Expand or wferror if internal subset
4196 wakaba 1.4
4197     ~ (Name) {
4198    
4199 wakaba 1.25 // Note that external subset and parameter entities are not supported
4200     lang:Perl ($name => $token.value) : has-error {
4201 wakaba 1.26 __CODE{checkNCName:: $name => $name}__;
4202 wakaba 1.25 my $location;
4203     __CODE{xp|get-location-from-token::
4204     $token => {$token},
4205     $result => {$location},
4206     }__;
4207     my $continue = __c|ERROR{xp|wf-pes-in-internal-subset::
4208     xp|error-token => {$token},
4209     c|location => {$location},
4210     xp|name => {$name},
4211     }__;
4212     unless ($continue) {
4213 wakaba 1.27 __CODE{ParseError}__;
4214 wakaba 1.25 }
4215     }
4216 wakaba 1.4 }
4217    
4218     ~ (REFC) {
4219     ?lexmode EntityValue;
4220     } else {
4221     ?lexmode EntityValue;
4222     }
4223     } (HCRO) {
4224 wakaba 1.11 &_HexadecimalCharacterReferenceEV_ ($vals => $vals);
4225 wakaba 1.4
4226 wakaba 1.6 lang:Perl {
4227 wakaba 1.11 $reptxt .= $vals->[-1];
4228 wakaba 1.6 }
4229    
4230 wakaba 1.4 ~ (REFC) {
4231     ?lexmode EntityValue;
4232     } else {
4233     ?lexmode EntityValue;
4234     }
4235     } (CRO) {
4236 wakaba 1.11 &_NumericCharacterReferenceEV_ ($vals => $vals);
4237 wakaba 1.6
4238     lang:Perl {
4239 wakaba 1.11 $reptxt .= $vals->[-1];
4240 wakaba 1.6 }
4241 wakaba 1.4
4242     ~ (REFC) {
4243     ?lexmode EntityValue;
4244     } else {
4245     ?lexmode EntityValue;
4246     }
4247     } (ERO) {
4248 wakaba 1.11 &_GeneralEntityReferenceEV_ ($vals => $vals);
4249 wakaba 1.4
4250 wakaba 1.6 lang:Perl {
4251 wakaba 1.11 $reptxt .= '&' . $vals->[-1] . ';';
4252 wakaba 1.6 }
4253    
4254 wakaba 1.4 ~ (REFC) {
4255     ?lexmode EntityValue;
4256     } else {
4257     ?lexmode EntityValue;
4258     }
4259     }
4260    
4261     ~ (LIT) {
4262     ?lexmode MarkupDeclaration;
4263     } (LITA) {
4264     ?lexmode MarkupDeclaration;
4265     } else {
4266     ?lexmode MarkupDeclaration;
4267     }
4268 wakaba 1.6
4269     lang:Perl {
4270     $decl->{reptxt} = \$reptxt;
4271 wakaba 1.19 $decl->{has_replacement_text} = true;
4272 wakaba 1.6 }
4273 wakaba 1.4 } // _EntityValue
4274    
4275 wakaba 1.11 rule _EntityValueA ($decl) {
4276 wakaba 1.4 ?lexmode EntityValueA;
4277    
4278     my $vals;
4279 wakaba 1.6 my $reptxt;
4280 wakaba 1.4 lang:Perl {
4281     $vals = [];
4282 wakaba 1.6 $reptxt = '';
4283 wakaba 1.4 }
4284    
4285     ~* (STRING) {
4286 wakaba 1.6 lang:Perl ($v => $token.value) {
4287     $reptxt .= $v;
4288     }
4289 wakaba 1.4 } (PERO) {
4290 wakaba 1.25 ?lexmode EntityReference;
4291 wakaba 1.4
4292 wakaba 1.19 lang:Perl {
4293     $self->{has_xref} = true;
4294 wakaba 1.25 $self->{dont_process} = true;
4295 wakaba 1.19 }
4296    
4297 wakaba 1.6 // TODO: implement this
4298 wakaba 1.4 ~ (Name) {
4299    
4300 wakaba 1.25 // Note that external subset and parameter entities are not supported
4301     lang:Perl ($name => $token.value) : has-error {
4302 wakaba 1.26 __CODE{checkNCName:: $name => $name}__;
4303 wakaba 1.25 my $location;
4304     __CODE{xp|get-location-from-token::
4305     $token => {$token},
4306     $result => {$location},
4307     }__;
4308     my $continue = __c|ERROR{xp|wf-pes-in-internal-subset::
4309     xp|error-token => {$token},
4310     c|location => {$location},
4311     xp|name => {$name},
4312     }__;
4313     unless ($continue) {
4314 wakaba 1.27 __CODE{ParseError}__;
4315 wakaba 1.25 }
4316     }
4317 wakaba 1.4 }
4318    
4319     ~ (REFC) {
4320     ?lexmode EntityValueA;
4321     } else {
4322     ?lexmode EntityValueA;
4323     }
4324     } (HCRO) {
4325 wakaba 1.11 &_HexadecimalCharacterReferenceEV_ ($vals => $vals);
4326 wakaba 1.4
4327 wakaba 1.6 lang:Perl {
4328 wakaba 1.11 $reptxt .= $vals->[-1];
4329 wakaba 1.6 }
4330    
4331    
4332 wakaba 1.4 ~ (REFC) {
4333     ?lexmode EntityValueA;
4334     } else {
4335     ?lexmode EntityValueA;
4336     }
4337     } (CRO) {
4338 wakaba 1.11 &_NumericCharacterReferenceEV_ ($vals => $vals);
4339 wakaba 1.4
4340 wakaba 1.6 lang:Perl {
4341 wakaba 1.11 $reptxt .= $vals->[-1];
4342 wakaba 1.6 }
4343    
4344 wakaba 1.4 ~ (REFC) {
4345     ?lexmode EntityValueA;
4346     } else {
4347     ?lexmode EntityValueA;
4348     }
4349     } (ERO) {
4350 wakaba 1.11 &_GeneralEntityReferenceEV_ ($vals => $vals);
4351 wakaba 1.4
4352 wakaba 1.6 lang:Perl {
4353 wakaba 1.11 $reptxt .= '&' . $vals->[-1] . ';';
4354 wakaba 1.6 }
4355    
4356 wakaba 1.4 ~ (REFC) {
4357     ?lexmode EntityValueA;
4358     } else {
4359     ?lexmode EntityValueA;
4360     }
4361     }
4362    
4363     ~ (LITA) {
4364     ?lexmode MarkupDeclaration;
4365     } else {
4366     ?lexmode MarkupDeclaration;
4367     }
4368 wakaba 1.6
4369     lang:Perl {
4370     $decl->{reptxt} = \$reptxt;
4371 wakaba 1.19 $decl->{has_replacement_text} = true;
4372 wakaba 1.6 }
4373 wakaba 1.4 } // _EntityValueA
4374    
4375    
4376     /*
4377     XML Name
4378     */
4379     lexmode NameChar {
4380     $NameStartChar10 := [
4381     '_' ':'
4382     // Letter
4383     // BaseChar
4384     U+0041..U+005A U+0061..U+007A U+00C0..U+00D6
4385     U+00D8..U+00F6 U+00F8..U+00FF U+0100..U+0131
4386     U+0134..U+013E U+0141..U+0148 U+014A..U+017E
4387     U+0180..U+01C3 U+01CD..U+01F0 U+01F4..U+01F5
4388     U+01FA..U+0217 U+0250..U+02A8 U+02BB..U+02C1
4389     U+0386 U+0388..U+038A U+038C U+038E..U+03A1
4390     U+03A3..U+03CE U+03D0..U+03D6 U+03DA U+03DC
4391     U+03DE U+03E0 U+03E2..U+03F3 U+0401..U+040C
4392     U+040E..U+044F U+0451..U+045C U+045E..U+0481
4393     U+0490..U+04C4 U+04C7..U+04C8 U+04CB..U+04CC
4394     U+04D0..U+04EB U+04EE..U+04F5 U+04F8..U+04F9
4395     U+0531..U+0556 U+0559 U+0561..U+0586
4396     U+05D0..U+05EA U+05F0..U+05F2 U+0621..U+063A
4397     U+0641..U+064A U+0671..U+06B7 U+06BA..U+06BE
4398     U+06C0..U+06CE U+06D0..U+06D3 U+06D5
4399     U+06E5..U+06E6 U+0905..U+0939 U+093D
4400     U+0958..U+0961 U+0985..U+098C U+098F..U+0990
4401     U+0993..U+09A8 U+09AA..U+09B0 U+09B2
4402     U+09B6..U+09B9 U+09DC..U+09DD U+09DF..U+09E1
4403     U+09F0..U+09F1 U+0A05..U+0A0A U+0A0F..U+0A10
4404     U+0A13..U+0A28 U+0A2A..U+0A30 U+0A32..U+0A33
4405     U+0A35..U+0A36 U+0A38..U+0A39 U+0A59..U+0A5C
4406     U+0A5E U+0A72..U+0A74 U+0A85..U+0A8B U+0A8D
4407     U+0A8F..U+0A91 U+0A93..U+0AA8 U+0AAA..U+0AB0
4408     U+0AB2..U+0AB3 U+0AB5..U+0AB9 U+0ABD U+0AE0
4409     U+0B05..U+0B0C U+0B0F..U+0B10 U+0B13..U+0B28
4410     U+0B2A..U+0B30 U+0B32..U+0B33 U+0B36..U+0B39
4411     U+0B3D U+0B5C..U+0B5D U+0B5F..U+0B61
4412     U+0B85..U+0B8A U+0B8E..U+0B90 U+0B92..U+0B95
4413     U+0B99..U+0B9A U+0B9C U+0B9E..U+0B9F
4414     U+0BA3..U+0BA4 U+0BA8..U+0BAA U+0BAE..U+0BB5
4415     U+0BB7..U+0BB9 U+0C05..U+0C0C U+0C0E..U+0C10
4416     U+0C12..U+0C28 U+0C2A..U+0C33 U+0C35..U+0C39
4417     U+0C60..U+0C61 U+0C85..U+0C8C U+0C8E..U+0C90
4418     U+0C92..U+0CA8 U+0CAA..U+0CB3 U+0CB5..U+0CB9
4419     U+0CDE U+0CE0..U+0CE1 U+0D05..U+0D0C
4420     U+0D0E..U+0D10 U+0D12..U+0D28 U+0D2A..U+0D39
4421     U+0D60..U+0D61 U+0E01..U+0E2E U+0E30
4422     U+0E32..U+0E33 U+0E40..U+0E45 U+0E81..U+0E82
4423     U+0E84 U+0E87..U+0E88 U+0E8A U+0E8D
4424     U+0E94..U+0E97 U+0E99..U+0E9F U+0EA1..U+0EA3
4425     U+0EA5 U+0EA7 U+0EAA..U+0EAB U+0EAD..U+0EAE
4426     U+0EB0 U+0EB2..U+0EB3 U+0EBD U+0EC0..U+0EC4
4427     U+0F40..U+0F47 U+0F49..U+0F69 U+10A0..U+10C5
4428     U+10D0..U+10F6 U+1100 U+1102..U+1103
4429     U+1105..U+1107 U+1109 U+110B..U+110C
4430     U+110E..U+1112 U+113C U+113E U+1140 U+114C
4431     U+114E U+1150 U+1154..U+1155 U+1159
4432     U+115F..U+1161 U+1163 U+1165 U+1167 U+1169
4433     U+116D..U+116E U+1172..U+1173 U+1175 U+119E
4434     U+11A8 U+11AB U+11AE..U+11AF U+11B7..U+11B8
4435     U+11BA U+11BC..U+11C2 U+11EB U+11F0 U+11F9
4436     U+1E00..U+1E9B U+1EA0..U+1EF9 U+1F00..U+1F15
4437     U+1F18..U+1F1D U+1F20..U+1F45 U+1F48..U+1F4D
4438     U+1F50..U+1F57 U+1F59 U+1F5B U+1F5D
4439     U+1F5F..U+1F7D U+1F80..U+1FB4 U+1FB6..U+1FBC
4440     U+1FBE U+1FC2..U+1FC4 U+1FC6..U+1FCC
4441     U+1FD0..U+1FD3 U+1FD6..U+1FDB U+1FE0..U+1FEC
4442     U+1FF2..U+1FF4 U+1FF6..U+1FFC U+2126
4443     U+212A..U+212B U+212E U+2180..U+2182
4444     U+3041..U+3094 U+30A1..U+30FA U+3105..U+312C
4445     U+AC00..U+D7A3
4446     // Ideographic
4447     U+4E00..U+9FA5 U+3007 U+3021..U+3029
4448     ];
4449     $NameChar10 := [
4450     '.' '-' '_' ':'
4451     // Letter
4452     // BaseChar
4453     U+0041..U+005A U+0061..U+007A U+00C0..U+00D6
4454     U+00D8..U+00F6 U+00F8..U+00FF U+0100..U+0131
4455     U+0134..U+013E U+0141..U+0148 U+014A..U+017E
4456     U+0180..U+01C3 U+01CD..U+01F0 U+01F4..U+01F5
4457     U+01FA..U+0217 U+0250..U+02A8 U+02BB..U+02C1
4458     U+0386 U+0388..U+038A U+038C U+038E..U+03A1
4459     U+03A3..U+03CE U+03D0..U+03D6 U+03DA U+03DC
4460     U+03DE U+03E0 U+03E2..U+03F3 U+0401..U+040C
4461     U+040E..U+044F U+0451..U+045C U+045E..U+0481
4462     U+0490..U+04C4 U+04C7..U+04C8 U+04CB..U+04CC
4463     U+04D0..U+04EB U+04EE..U+04F5 U+04F8..U+04F9
4464     U+0531..U+0556 U+0559 U+0561..U+0586
4465     U+05D0..U+05EA U+05F0..U+05F2 U+0621..U+063A
4466     U+0641..U+064A U+0671..U+06B7 U+06BA..U+06BE
4467     U+06C0..U+06CE U+06D0..U+06D3 U+06D5
4468     U+06E5..U+06E6 U+0905..U+0939 U+093D
4469     U+0958..U+0961 U+0985..U+098C U+098F..U+0990
4470     U+0993..U+09A8 U+09AA..U+09B0 U+09B2
4471     U+09B6..U+09B9 U+09DC..U+09DD U+09DF..U+09E1
4472     U+09F0..U+09F1 U+0A05..U+0A0A U+0A0F..U+0A10
4473     U+0A13..U+0A28 U+0A2A..U+0A30 U+0A32..U+0A33
4474     U+0A35..U+0A36 U+0A38..U+0A39 U+0A59..U+0A5C
4475     U+0A5E U+0A72..U+0A74 U+0A85..U+0A8B U+0A8D
4476     U+0A8F..U+0A91 U+0A93..U+0AA8 U+0AAA..U+0AB0
4477     U+0AB2..U+0AB3 U+0AB5..U+0AB9 U+0ABD U+0AE0
4478     U+0B05..U+0B0C U+0B0F..U+0B10 U+0B13..U+0B28
4479     U+0B2A..U+0B30 U+0B32..U+0B33 U+0B36..U+0B39
4480     U+0B3D U+0B5C..U+0B5D U+0B5F..U+0B61
4481     U+0B85..U+0B8A U+0B8E..U+0B90 U+0B92..U+0B95
4482     U+0B99..U+0B9A U+0B9C U+0B9E..U+0B9F
4483     U+0BA3..U+0BA4 U+0BA8..U+0BAA U+0BAE..U+0BB5
4484     U+0BB7..U+0BB9 U+0C05..U+0C0C U+0C0E..U+0C10
4485     U+0C12..U+0C28 U+0C2A..U+0C33 U+0C35..U+0C39
4486     U+0C60..U+0C61 U+0C85..U+0C8C U+0C8E..U+0C90
4487     U+0C92..U+0CA8 U+0CAA..U+0CB3 U+0CB5..U+0CB9
4488     U+0CDE U+0CE0..U+0CE1 U+0D05..U+0D0C
4489     U+0D0E..U+0D10 U+0D12..U+0D28 U+0D2A..U+0D39
4490     U+0D60..U+0D61 U+0E01..U+0E2E U+0E30
4491     U+0E32..U+0E33 U+0E40..U+0E45 U+0E81..U+0E82
4492     U+0E84 U+0E87..U+0E88 U+0E8A U+0E8D
4493     U+0E94..U+0E97 U+0E99..U+0E9F U+0EA1..U+0EA3
4494     U+0EA5 U+0EA7 U+0EAA..U+0EAB U+0EAD..U+0EAE
4495     U+0EB0 U+0EB2..U+0EB3 U+0EBD U+0EC0..U+0EC4
4496     U+0F40..U+0F47 U+0F49..U+0F69 U+10A0..U+10C5
4497     U+10D0..U+10F6 U+1100 U+1102..U+1103
4498     U+1105..U+1107 U+1109 U+110B..U+110C
4499     U+110E..U+1112 U+113C U+113E U+1140 U+114C
4500     U+114E U+1150 U+1154..U+1155 U+1159
4501     U+115F..U+1161 U+1163 U+1165 U+1167 U+1169
4502     U+116D..U+116E U+1172..U+1173 U+1175 U+119E
4503     U+11A8 U+11AB U+11AE..U+11AF U+11B7..U+11B8
4504     U+11BA U+11BC..U+11C2 U+11EB U+11F0 U+11F9
4505     U+1E00..U+1E9B U+1EA0..U+1EF9 U+1F00..U+1F15
4506     U+1F18..U+1F1D U+1F20..U+1F45 U+1F48..U+1F4D
4507     U+1F50..U+1F57 U+1F59 U+1F5B U+1F5D
4508     U+1F5F..U+1F7D U+1F80..U+1FB4 U+1FB6..U+1FBC
4509     U+1FBE U+1FC2..U+1FC4 U+1FC6..U+1FCC
4510     U+1FD0..U+1FD3 U+1FD6..U+1FDB U+1FE0..U+1FEC
4511     U+1FF2..U+1FF4 U+1FF6..U+1FFC U+2126
4512     U+212A..U+212B U+212E U+2180..U+2182
4513     U+3041..U+3094 U+30A1..U+30FA U+3105..U+312C
4514     U+AC00..U+D7A3
4515     // Ideographic
4516     U+4E00..U+9FA5 U+3007 U+3021..U+3029
4517     // Digit
4518     U+0030..U+0039 U+0660..U+0669 U+06F0..U+06F9
4519     U+0966..U+096F U+09E6..U+09EF U+0A66..U+0A6F
4520     U+0AE6..U+0AEF U+0B66..U+0B6F U+0BE7..U+0BEF
4521     U+0C66..U+0C6F U+0CE6..U+0CEF U+0D66..U+0D6F
4522     U+0E50..U+0E59 U+0ED0..U+0ED9 U+0F20..U+0F29
4523     // CombiningChar
4524     U+0300..U+0345 U+0360..U+0361 U+0483..U+0486
4525     U+0591..U+05A1 U+05A3..U+05B9 U+05BB..U+05BD
4526     U+05BF U+05C1..U+05C2 U+05C4 U+064B..U+0652
4527     U+0670 U+06D6..U+06DC U+06DD..U+06DF
4528     U+06E0..U+06E4 U+06E7..U+06E8 U+06EA..U+06ED
4529     U+0901..U+0903 U+093C U+093E..U+094C U+094D
4530     U+0951..U+0954 U+0962..U+0963 U+0981..U+0983
4531     U+09BC U+09BE U+09BF U+09C0..U+09C4
4532     U+09C7..U+09C8 U+09CB..U+09CD U+09D7
4533     U+09E2..U+09E3 U+0A02 U+0A3C U+0A3E U+0A3F
4534     U+0A40..U+0A42 U+0A47..U+0A48 U+0A4B..U+0A4D
4535     U+0A70..U+0A71 U+0A81..U+0A83 U+0ABC
4536     U+0ABE..U+0AC5 U+0AC7..U+0AC9 U+0ACB..U+0ACD
4537     U+0B01..U+0B03 U+0B3C U+0B3E..U+0B43
4538     U+0B47..U+0B48 U+0B4B..U+0B4D U+0B56..U+0B57
4539     U+0B82..U+0B83 U+0BBE..U+0BC2 U+0BC6..U+0BC8
4540     U+0BCA..U+0BCD U+0BD7 U+0C01..U+0C03
4541     U+0C3E..U+0C44 U+0C46..U+0C48 U+0C4A..U+0C4D
4542     U+0C55..U+0C56 U+0C82..U+0C83 U+0CBE..U+0CC4
4543     U+0CC6..U+0CC8 U+0CCA..U+0CCD U+0CD5..U+0CD6
4544     U+0D02..U+0D03 U+0D3E..U+0D43 U+0D46..U+0D48
4545     U+0D4A..U+0D4D U+0D57 U+0E31 U+0E34..U+0E3A
4546     U+0E47..U+0E4E U+0EB1 U+0EB4..U+0EB9
4547     U+0EBB..U+0EBC U+0EC8..U+0ECD U+0F18..U+0F19
4548     U+0F35 U+0F37 U+0F39 U+0F3E U+0F3F
4549     U+0F71..U+0F84 U+0F86..U+0F8B U+0F90..U+0F95
4550     U+0F97 U+0F99..U+0FAD U+0FB1..U+0FB7 U+0FB9
4551     U+20D0..U+20DC U+20E1 U+302A..U+302F U+3099
4552     U+309A
4553     // Extender
4554     U+00B7 U+02D0 U+02D1 U+0387 U+0640 U+0E46
4555     U+0EC6 U+3005 U+3031..U+3035 U+309D..U+309E
4556     U+30FC..U+30FE
4557     ];
4558 wakaba 1.1
4559     $NameStartChar11 := [
4560     ':' '_'
4561     'A' 'B' 'C' 'D' 'E' 'F' 'G' 'H' 'I' 'J' 'K' 'L' 'M'
4562     'N' 'O' 'P' 'Q' 'R' 'S' 'T' 'U' 'V' 'W' 'X' 'Y' 'Z'
4563     'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm'
4564     'n' 'o' 'p' 'q' 'r' 's' 't' 'u' 'v' 'w' 'x' 'y' 'z'
4565     U+00C0..U+00D6 U+00D8..U+00F6 U+00F8..U+02FF
4566     U+0370..U+037D U+037F..U+1FFF U+200C..U+200D
4567     U+2070..U+218F U+2C00..U+2FEF U+3001..U+D7FF
4568     U+F900..U+FDCF U+FDF0..U+FFFD U+10000..U+EFFFF
4569     ];
4570     $NameChar11 := [
4571     '-' '.' '0' '1' '2' '3' '4' '5' '6' '7' '8' '9'
4572     U+00B7 U+0300..U+036F U+203F..U+2040
4573     // NameStartChar
4574     ':' '_'
4575     'A' 'B' 'C' 'D' 'E' 'F' 'G' 'H' 'I' 'J' 'K' 'L' 'M'
4576     'N' 'O' 'P' 'Q' 'R' 'S' 'T' 'U' 'V' 'W' 'X' 'Y' 'Z'
4577     'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm'
4578     'n' 'o' 'p' 'q' 'r' 's' 't' 'u' 'v' 'w' 'x' 'y' 'z'
4579     U+00C0..U+00D6 U+00D8..U+00F6 U+00F8..U+02FF
4580     U+0370..U+037D U+037F..U+1FFF U+200C..U+200D
4581     U+2070..U+218F U+2C00..U+2FEF U+3001..U+D7FF
4582     U+F900..U+FDCF U+FDF0..U+FFFD U+10000..U+EFFFF
4583     ];
4584 wakaba 1.4 } // NameChar
4585    
4586     lexmode Name
4587     : extends => 'NameChar'
4588     {
4589 wakaba 1.1 Name : value := $NameStartChar11 $NameChar11*;
4590     } // Name
4591 wakaba 1.4
4592     lexmode Nmtoken
4593     : extends => 'NameChar'
4594     {
4595     Nmtoken : value := $NameChar11*;
4596     } // Nmtoken
4597 wakaba 1.1
4598     /*
4599 wakaba 1.14 S
4600 wakaba 1.1 */
4601     lexmode S {
4602 wakaba 1.14 $s := [U+0009 U+000A U+000D U+0020];
4603     S := $s+;
4604 wakaba 1.1 } // S
4605    
4606     /*
4607     Document end scanning mode
4608     */
4609     lexmode DocumentEnd
4610     : standalone
4611     : extends => 'S'
4612     {
4613     /*
4614     Processing instruction
4615     */
4616     PIO := ['<'] ['?'];
4617    
4618     /*
4619     Comment declaration
4620     */
4621     CDO := ['<'] ['!'] ['-'] ['-'];
4622     } // DocumentEnd
4623    
4624     /*
4625     Document misc scanning mode
4626    
4627     This mode scans |Misc| constructions as well
4628     as document element's start tag.
4629     */
4630     lexmode DocumentMisc
4631     : standalone
4632     : extends => 'DocumentEnd'
4633     {
4634     /*
4635     Document element start tag
4636     */
4637     STAGO := ['<'];
4638     } // DocumentMisc
4639    
4640     /*
4641     Document prolog scanning mode
4642     */
4643     lexmode DocumentProlog
4644     : standalone
4645     : extends => 'DocumentMisc'
4646     {
4647     /*
4648     |DOCTYPE| declaration
4649     */
4650     MDO := ['<'] ['!'];
4651     } // DocumentProlog
4652 wakaba 1.16
4653 wakaba 1.1 /*
4654 wakaba 1.16 Document Start Scanning Mode
4655 wakaba 1.1 */
4656     lexmode DocumentStart
4657     : standalone
4658     : extends => 'DocumentProlog'
4659     {
4660     /*
4661     XML declaration
4662     */
4663 wakaba 1.16 XDO := ['<'] ['?'] ['x'] ['m'] ['l'];
4664 wakaba 1.1 } // DocumentStart
4665    
4666     /*
4667     Comment declaration scanning mode
4668     */
4669     lexmode CommentDeclaration
4670     : standalone
4671     {
4672     /*
4673     Comment close
4674     */
4675     COM := ['-'] ['-'];
4676    
4677     /*
4678     Comment data
4679     */
4680 wakaba 1.15 ?default-token STRING : value;
4681 wakaba 1.1 } // CommentDeclaration
4682    
4683     /*
4684     Processing instruction name and |S| scanning mode
4685     */
4686     lexmode PIName
4687     : standalone
4688     : extends => 'Name'
4689     : extends => 'S'
4690     {
4691     /*
4692     Processing instruction close
4693     */
4694     PIC := ['?'] ['>'];
4695     } // PIName
4696    
4697     /*
4698 wakaba 1.16 Processing instruction name and |S| scanning mode
4699     */
4700     lexmode PINmtoken
4701     : standalone
4702     : extends => 'Nmtoken'
4703     : extends => 'S'
4704     {
4705     /*
4706     Processing instruction close
4707     */
4708     PIC := ['?'] ['>'];
4709     } // PINmtoken
4710    
4711     /*
4712 wakaba 1.1 Processing instruction data scanning mode
4713     */
4714     lexmode PIData
4715     : standalone
4716     {
4717     /*
4718     Processing instruction close
4719     */
4720     PIC := ['?'] ['>'];
4721    
4722     /*
4723     Processing instruction target data
4724     */
4725 wakaba 1.2 ?default-token DATA : value;
4726 wakaba 1.1 } // PIData
4727    
4728     /*
4729     Content of element scanning mode
4730     */
4731     lexmode ElementContent
4732     : standalone
4733     {
4734     /*
4735     Start tag open
4736     */
4737     STAGO := ['<'];
4738    
4739     /*
4740     End tag open
4741     */
4742     ETAGO := ['<'] ['/'];
4743    
4744     /*
4745     Hexadecimal character reference open
4746     */
4747     HCRO := ['&'] ['#'] ['x'];
4748    
4749     /*
4750     Numeric character reference open
4751     */
4752     CRO := ['&'] ['#'];
4753    
4754     /*
4755     General entity reference open
4756     */
4757     ERO := ['&'];
4758    
4759     /*
4760     Comment declaration open
4761     */
4762     CDO := ['<'] ['!'] ['-'] ['-'];
4763    
4764     /*
4765     CDATA section open
4766     */
4767     CDSO := ['<'] ['!'] ['[']
4768     ['C'] ['D'] ['A'] ['T'] ['A'] ['['];
4769    
4770     /*
4771     Processing instruction open
4772     */
4773     PIO := ['<'] ['?'];
4774 wakaba 1.2
4775     /*
4776     Markup section end
4777     */
4778     MSE := [']'] [']'] ['>'];
4779    
4780     /*
4781     Character data
4782     */
4783     /*
4784     Character data and/or |MSE|
4785     */
4786     ?default-token CharData : value;
4787 wakaba 1.1 } // ElementContent
4788    
4789     /*
4790     CDATA section content scanning mode
4791     */
4792     lexmode CDATASectionContent
4793     : standalone
4794     {
4795     /*
4796     Markup section end
4797     */
4798     MSE := [']'] [']'] ['>'];
4799    
4800     /*
4801     Character data
4802 wakaba 1.2 */
4803     ?default-token CData : value;
4804 wakaba 1.1 } // CDATASectionContent
4805    
4806     lexmode EntityReference
4807     : standalone
4808     : extends => 'Name'
4809     {
4810     /*
4811     Reference close
4812     */
4813     REFC := [';'];
4814     } // EntityReference
4815    
4816     lexmode NumericCharacterReference
4817     : standalone
4818     {
4819     /*
4820     Decimal number
4821     */
4822     $digit := ['0' '1' '2' '3' '4' '5' '6' '7' '8' '9'];
4823     NUMBER : value := $digit+;
4824    
4825     /*
4826     Reference close
4827     */
4828     REFC := [';'];
4829     } // NumericCharacterReference
4830    
4831     lexmode HexadecimalCharacterReference
4832     : standalone
4833     {
4834     /*
4835     Hexadecimal number
4836     */
4837     $hexdigit := ['0' '1' '2' '3' '4' '5' '6' '7' '8' '9'
4838     'A' 'B' 'C' 'D' 'E' 'F'
4839     'a' 'b' 'c' 'd' 'e' 'f'];
4840     Hex : value := $hexdigit+;
4841    
4842     /*
4843     Reference close
4844     */
4845     REFC := [';'];
4846     } // HexadecimalCharacterReference
4847    
4848 wakaba 1.16 /*
4849     The XML Declaration and Text Declaration Scanning Mode
4850     */
4851 wakaba 1.3 lexmode XMLDeclaration
4852     : standalone
4853     : extends => 'Name'
4854     : extends => 'S'
4855     {
4856    
4857     /*
4858     Value indicator
4859     */
4860     VI := ['='];
4861    
4862     /*
4863     Literal open
4864     */
4865     LIT := ['"'];
4866     LITA := [U+0027];
4867    
4868     /*
4869     Processing instruction close
4870 wakaba 1.16
4871     The |PIC|, i.e. |?>|, is split into two tokens |PIC1| and |PIC2|
4872     in this scanning mode to set |no_xml11_eol| flag in the
4873     |_XMLDeclaration_| |rule|.
4874 wakaba 1.3 */
4875 wakaba 1.16 PIC1 := ['?'];
4876     PIC2 := ['>'];
4877 wakaba 1.3 } // XMLDeclaration
4878 wakaba 1.16
4879     /*
4880     The XML Declaration or Processing Instruction Scanning Mode
4881    
4882     '<?xml' S ...
4883     (DocumentStart) (XMLDeclarationOrPI) (XMLDeclaration)
4884     '<?xml' '1' S ...
4885     (DocumentStart) (XMLDeclarationOrPI) (PINmtoken)(PIName) (PITarget)
4886     '<?xml' '-' 'stylesheet' S ...
4887     (DocumentStart) (XMLDeclarationOrPI) (PINmtoken) (PIName) (PITarget)
4888     */
4889     lexmode XMLDeclarationOrPI
4890     : standalone
4891     : extends => 'NameChar'
4892     : extends => 'S'
4893     {
4894     NameChar : value := $NameChar11;
4895     } // XMLDeclarationOrPI
4896 wakaba 1.3
4897 wakaba 1.1 lexmode StartTag
4898     : standalone
4899     : extends => 'Name'
4900     : extends => 'S'
4901     {
4902    
4903     /*
4904     Value indicator
4905     */
4906     VI := ['='];
4907    
4908     /*
4909     Literal open
4910     */
4911     LIT := ['"'];
4912     LITA := [U+0027];
4913    
4914     /*
4915     Tag close
4916     */
4917     TAGC := ['>'];
4918    
4919     /*
4920 wakaba 1.6 Null end-tag enabled start-tag close
4921 wakaba 1.1 */
4922 wakaba 1.6 NESTC := ['/'];
4923 wakaba 1.1 } // StartTag
4924    
4925     lexmode EndTag
4926     : standalone
4927     : extends => 'Name'
4928     : extends => 'S'
4929     {
4930     /*
4931     Tag close
4932     */
4933     TAGC := ['>'];
4934     } // EndTag
4935    
4936     lexmode AttributeValueLiteral_ {
4937     ERO := ['&'];
4938     CRO := ['&'] ['#'];
4939     HCRO := ['&'] ['#'] ['x'];
4940     } // AttributeValueLiteral_
4941    
4942     lexmode AttributeValueLiteral
4943     : standalone
4944     : extends => 'AttributeValueLiteral_'
4945     {
4946     LIT := ['"'];
4947 wakaba 1.3 STRING : value := [^'"' '&' '<']+;
4948 wakaba 1.1 } // AttributeValueLiteral
4949    
4950     lexmode AttributeValueLiteralA
4951     : standalone
4952     : extends => 'AttributeValueLiteral_'
4953     {
4954 wakaba 1.4 LITA := [U+0027];
4955 wakaba 1.3 STRING : value := [^U+0027 '&' '<']+;
4956 wakaba 1.1 } // AttributeValueLiteralA
4957 wakaba 1.11
4958     lexmode AttributeValueLiteralE
4959     : standalone
4960     : extends => 'AttributeValueLiteral_'
4961     {
4962     STRING : value := [^'&' '<']+;
4963     } // AttributeValueLiteralE
4964 wakaba 1.4
4965     lexmode EntityValue_ {
4966     PERO := ['%'];
4967     ERO := ['&'];
4968     CRO := ['&'] ['#'];
4969     HCRO := ['&'] ['#'] ['x'];
4970     } // EntityValue_
4971    
4972     lexmode EntityValue
4973     : standalone
4974     : extends => 'EntityValue_'
4975     {
4976     LIT := ['"'];
4977     STRING : value := [^'"' '&' '%']+;
4978     } // EntityValue
4979    
4980     lexmode EntityValueA
4981     : standalone
4982     : extends => 'EntityValue_'
4983     {
4984     LITA := [U+0027];
4985     STRING : value := [^U+0027 '&' '%']+;
4986     } // EntityValueA
4987    
4988     lexmode SystemLiteral
4989     : standalone
4990     {
4991     LIT := ['"'];
4992     ?default-token STRING : value;
4993     } // SystemLiteral
4994    
4995     lexmode SystemLiteralA
4996     : standalone
4997     {
4998     LITA := [U+0027];
4999     ?default-token STRING : value;
5000     } // SystemLiteralA
5001    
5002     lexmode DTD
5003     : standalone
5004     : extends => 'S'
5005     {
5006     /*
5007     Markup declaration open
5008     */
5009     MDO := ['<'] ['!'];
5010    
5011     /*
5012     Comment declaration open
5013     */
5014     CDO := ['<'] ['!'] ['-'] ['-'];
5015    
5016     /*
5017     Processing instruction open
5018     */
5019     PIO := ['<'] ['?'];
5020    
5021     /*
5022     Parameter entity reference open
5023     */
5024     PERO := ['%'];
5025    
5026     /*
5027     Declaration subset close
5028     */
5029     DSC := [']'];
5030    
5031     /*
5032     Contition section open
5033     */
5034     CSO := ['<'] ['!'] ['['];
5035     } // DTD
5036    
5037     /*
5038     Markup declaration scanning mode
5039    
5040     This mode is used to recognize |MDC| that terminates
5041     a comment declaration as well as the base |lexmode|
5042     for e.g. document type declaration scanning mode.
5043     */
5044     lexmode MarkupDeclaration
5045     : standalone
5046     : extends => 'Name'
5047     : extends => 'S'
5048     {
5049     /*
5050     Markup declaration close
5051     */
5052     MDC := ['>'];
5053    
5054     /*
5055     Literal open
5056     */
5057     LIT := ['"'];
5058    
5059     /*
5060     Alternative literal open
5061     */
5062     LITA := [U+0027];
5063    
5064     /*
5065     Parameter entity reference open
5066     */
5067     PERO := ['%'];
5068    
5069     /*
5070     Declaration subset open
5071     */
5072     DSO := ['['];
5073     } // MarkupDeclaration
5074    
5075     lexmode ElementDeclaration
5076     : standalone
5077     : extends => 'MarkupDeclaration'
5078     {
5079     /*
5080     Model group open
5081     */
5082     MGO := ['('];
5083    
5084     /*
5085     Model group close
5086     */
5087     MGC := [')'];
5088    
5089     /*
5090     Reserved name indicator
5091     */
5092     RNI := ['#'];
5093    
5094     /*
5095     Occurence indicators
5096     */
5097     OPT := ['?'];
5098     REP := ['*'];
5099     PLUS := ['+'];
5100    
5101     /*
5102     Connectors
5103     */
5104     OR := ['|'];
5105     SEQ := [','];
5106     } // ElementDeclaration
5107    
5108     lexmode AttlistDeclaration
5109     : standalone
5110     : extends => 'MarkupDeclaration'
5111     {
5112     /*
5113     Enumeration group open
5114     */
5115     EGO := ['('];
5116    
5117     /*
5118     Enumeration group close
5119     */
5120     EGC := [')'];
5121    
5122     /*
5123     Enumeration choice delimiter
5124     */
5125     OR := ['|'];
5126    
5127     /*
5128     Reserved name indicator
5129     */
5130     RNI := ['#'];
5131     } // AttlistDeclaration
5132    
5133     lexmode Enumeration
5134     : standalone
5135     : extends => 'Nmtoken'
5136     : extends => 'S'
5137     {
5138     /*
5139     Enumeration group close
5140     */
5141     EGC := [')'];
5142    
5143     /*
5144     Enumeration choice delimiter
5145     */
5146     OR := ['|'];
5147     } // Enumeration
5148    
5149 wakaba 1.1
5150     token-error default : default {
5151     lang:Perl {
5152 wakaba 1.3 my $location;
5153     __CODE{xp|get-location-from-token::
5154     $token => {$token},
5155     $result => {$location},
5156     }__;
5157     my $continue = __DOMCore:ERROR{xp|wf-syntax-error::
5158 wakaba 1.1 xp|error-token => {$token},
5159     DOMCore|location => {$location},
5160     }__;
5161     unless ($continue) {
5162 wakaba 1.27 __CODE{ParseError}__;
5163 wakaba 1.1 }
5164     }
5165     } // default
5166 wakaba 1.5
5167 wakaba 1.26 @ResourceDef:
5168     @@ForCheck: ManakaiDOM|ForClass
5169 wakaba 1.27 @@QName: ParseError
5170     @@rdf:type: DISPerl|BlockCode
5171     @@PerlDef:
5172     __DEEP{
5173     for (@{$self->{entity}}) {
5174     $_->{close_file}->();
5175     }
5176     }__;
5177     __EXCEPTION{DOMLS|PARSE_ERR}__;
5178    
5179     @ResourceDef:
5180     @@ForCheck: ManakaiDOM|ForClass
5181 wakaba 1.26 @@QName: checkNCName
5182     @@rdf:type: DISPerl|BlockCode
5183     @@PerlDef:
5184     if (($self->{xml_version} eq '1.0' and
5185     not <Code::DOMMain|testXML10Name:: $INPUT = $name>) or
5186     ($self->{xml_version} eq '1.1' and
5187     not <Code::DOMMain|testXML11Name:: $INPUT = $name>)) {
5188     my $__location;
5189     __CODE{xp|get-location-from-token::
5190     $token => {$token},
5191     $result => {$__location},
5192     }__;
5193     my $__continue = __c|ERROR{xp|wf-invalid-character-in-node-name::
5194     xp|error-token => {$token},
5195     c|location => {$__location},
5196     xp|name => {$name},
5197     infoset|version => {$self->{xml_version}},
5198     }__;
5199     unless ($__continue) {
5200 wakaba 1.27 __CODE{ParseError}__;
5201 wakaba 1.26 }
5202     } elsif (index ($name, ':') > -1) {
5203     my $__location;
5204     __CODE{xp|get-location-from-token::
5205     $token => {$token},
5206     $result => {$__location},
5207     }__;
5208     my $__continue = __c|ERROR{xp|nswf-legal-ncname::
5209     xp|error-token => {$token},
5210     c|location => {$__location},
5211     xp|name => {$name},
5212     infoset|version => {$self->{xml_version}},
5213     }__;
5214     unless ($__continue) {
5215 wakaba 1.27 __CODE{ParseError}__;
5216 wakaba 1.26 }
5217     }
5218    
5219     @ResourceDef:
5220     @@ForCheck: ManakaiDOM|ForClass
5221     @@QName: checkQName
5222     @@rdf:type: DISPerl|BlockCode
5223     @@PerlDef:
5224     if (($self->{xml_version} eq '1.0' and
5225     not <Code::DOMMain|testXML10Name:: $INPUT = $name>) or
5226     ($self->{xml_version} eq '1.1' and
5227     not <Code::DOMMain|testXML11Name:: $INPUT = $name>)) {
5228     my $__location;
5229     __CODE{xp|get-location-from-token::
5230     $token => {$token},
5231     $result => {$__location},
5232     }__;
5233     my $__continue = __c|ERROR{xp|wf-invalid-character-in-node-name::
5234     xp|error-token => {$token},
5235     c|location => {$__location},
5236     xp|name => {$name},
5237     infoset|version => {$self->{xml_version}},
5238     }__;
5239     unless ($__continue) {
5240 wakaba 1.27 __CODE{ParseError}__;
5241 wakaba 1.26 }
5242     } elsif (($self->{xml_version} eq '1.0' and
5243     not <Code::DOMMain|testXML10QName:: $INPUT = $name>) or
5244     ($self->{xml_version} eq '1.1' and
5245     not <Code::DOMMain|testXML11QName:: $INPUT = $name>)) {
5246     my $__location;
5247     __CODE{xp|get-location-from-token::
5248     $token => {$token},
5249     $result => {$__location},
5250     }__;
5251     my $__continue = __c|ERROR{xp|nswf-legal-qname::
5252     xp|error-token => {$token},
5253     c|location => {$__location},
5254     xp|name => {$name},
5255     infoset|version => {$self->{xml_version}},
5256     }__;
5257     unless ($__continue) {
5258 wakaba 1.27 __CODE{ParseError}__;
5259 wakaba 1.26 }
5260     }
5261    
5262    
5263 wakaba 1.5 @XMLTests:
5264     @@XMLTest:
5265 wakaba 1.15 @@@QName: xp.char.xml10.test
5266     @@@DEnt:
5267     @@@@test:value:
5268     <?xml version="1.0"?>
5269     <p>$u0009$u000A$u000D$u0020$uD7FF$uE000$uFFFD$U00010000$U0010FFFF</p>
5270     @@@test:domTree:
5271     document {
5272     xml-version: '1.0';
5273     element {
5274     text-content: U+0009 U+000A U+000A U+0020 U+D7FF
5275     U+E000 U+FFFD U+10000 U+10FFFF;
5276     }
5277     }
5278     @@XMLTest:
5279     @@@QName: xp.char.xml11.test
5280     @@@DEnt:
5281     @@@@test:value:
5282     <?xml version="1.1"?>
5283     <p>$u0009$u000A$u000D$u0020$uD7FF$uE000$uFFFD$U00010000$U0010FFFF</p>
5284     @@@test:domTree:
5285     document {
5286     xml-version: '1.1';
5287     element {
5288     text-content: U+0009 U+000A U+000A U+0020 U+D7FF
5289     U+E000 U+FFFD U+10000 U+10FFFF;
5290     }
5291     }
5292     @@XMLTest:
5293     @@@QName: xp.char.xml10.c0.test
5294     @@@DEnt:
5295     @@@@test:value:
5296     <?xml version="1.0"?>
5297     <p>$u0000$u0001$u0002$u0003$u0004$u0005$u0006$u0007$u0008$u000B$
5298     $u000C$u000E$u000F$u0010$u0011$u0012$u0013$u0014$u0015$u0016$
5299     $u0017$u0018$u0019$u001A$u001B$u001C$u001D$u001E$u001F</p>
5300     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 4); } /* U+0000 */
5301     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 5); } /* U+0001 */
5302     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 6); } /* U+0002 */
5303     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 7); } /* U+0003 */
5304     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 8); } /* U+0004 */
5305     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 9); } /* U+0005 */
5306     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 10); } /* U+0006 */
5307     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 11); } /* U+0007 */
5308     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 12); } /* U+0008 */
5309     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 13); } /* U+000B */
5310     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 14); } /* U+000C */
5311     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 15); } /* U+000E */
5312     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 16); } /* U+000F */
5313     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 17); } /* U+0010 */
5314     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 18); } /* U+0011 */
5315     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 19); } /* U+0012 */
5316     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 20); } /* U+0013 */
5317     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 21); } /* U+0014 */
5318     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 22); } /* U+0015 */
5319     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 23); } /* U+0016 */
5320     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 24); } /* U+0017 */
5321     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 25); } /* U+0018 */
5322     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 26); } /* U+0019 */
5323     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 27); } /* U+001A */
5324     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 28); } /* U+001B */
5325     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 29); } /* U+001C */
5326     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 30); } /* U+001D */
5327     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 31); } /* U+001E */
5328     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 32); } /* U+001F */
5329     @@XMLTest:
5330     @@@QName: xp.char.xml11.c0.test
5331     @@@DEnt:
5332     @@@@test:value:
5333     <?xml version="1.1"?>
5334     <p>$u0000$u0001$u0002$u0003$u0004$u0005$u0006$u0007$u0008$u000B$
5335     $u000C$u000E$u000F$u0010$u0011$u0012$u0013$u0014$u0015$u0016$
5336     $u0017$u0018$u0019$u001A$u001B$u001C$u001D$u001E$u001F</p>
5337     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 4); } /* U+0000 */
5338     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 5); } /* U+0001 */
5339     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 6); } /* U+0002 */
5340     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 7); } /* U+0003 */
5341     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 8); } /* U+0004 */
5342     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 9); } /* U+0005 */
5343     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 10); } /* U+0006 */
5344     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 11); } /* U+0007 */
5345     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 12); } /* U+0008 */
5346     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 13); } /* U+000B */
5347     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 14); } /* U+000C */
5348     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 15); } /* U+000E */
5349     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 16); } /* U+000F */
5350     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 17); } /* U+0010 */
5351     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 18); } /* U+0011 */
5352     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 19); } /* U+0012 */
5353     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 20); } /* U+0013 */
5354     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 21); } /* U+0014 */
5355     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 22); } /* U+0015 */
5356     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 23); } /* U+0016 */
5357     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 24); } /* U+0017 */
5358     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 25); } /* U+0018 */
5359     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 26); } /* U+0019 */
5360     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 27); } /* U+001A */
5361     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 28); } /* U+001B */
5362     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 29); } /* U+001C */
5363     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 30); } /* U+001D */
5364     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 31); } /* U+001E */
5365     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 32); } /* U+001F */
5366     @@XMLTest:
5367     @@@QName: xp.char.xml10.c1.test
5368     @@@DEnt:
5369     @@@@test:value:
5370     <?xml version="1.0"?>
5371     <p>$u007F$u0080$u0081$u0082$u0083$u0084$u0086$u0087$u0088$
5372     $u0089$u008A$u008B$u008C$
5373     $u008D$u008E$u008F$u0090$u0091$u0092$u0093$u0094$u0095$u0096$
5374     $u0097$u0098$u0099$u009A$u009B$u009C$u009D$u009E$u009F$u0085</p>
5375     @@@test:domTree:
5376     document {
5377     xml-version: '1.0';
5378     element {
5379     text-content: U+007F U+0080 U+0081 U+0082 U+0083 U+0084 U+0086
5380     U+0087 U+0088 U+0089 U+008A U+008B U+008C U+008D
5381     U+008E U+008F U+0090 U+0091 U+0092 U+0093 U+0094
5382     U+0095 U+0096 U+0097 U+0098 U+0099 U+009A U+009B
5383     U+009C U+009D U+009E U+009F U+0085;
5384     }
5385     }
5386     @@XMLTest:
5387     @@@QName: xp.char.xml11.c1.test
5388     @@@DEnt:
5389     @@@@test:value:
5390     <?xml version="1.1"?>
5391     <p>$u007F$u0080$u0081$u0082$u0083$u0084$u0086$u0087$u0088$
5392     $u0089$u008A$u008B$u008C$
5393     $u008D$u008E$u008F$u0090$u0091$u0092$u0093$u0094$u0095$u0096$
5394     $u0097$u0098$u0099$u009A$u009B$u009C$u009D$u009E$u009F$u0085</p>
5395     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 4); } /* U+007F */
5396     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 5); } /* U+0080 */
5397     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 6); } /* U+0081 */
5398     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 7); } /* U+0082 */
5399     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 8); } /* U+0083 */
5400     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 9); } /* U+0084 */
5401     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 10); } /* U+0086 */
5402     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 11); } /* U+0087 */
5403     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 12); } /* U+0088 */
5404     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 13); } /* U+0089 */
5405     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 14); } /* U+008A */
5406     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 15); } /* U+008B */
5407     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 16); } /* U+008C */
5408     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 17); } /* U+008D */
5409     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 18); } /* U+008E */
5410     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 19); } /* U+008F */
5411     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 20); } /* U+0090 */
5412     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 21); } /* U+0091 */
5413     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 22); } /* U+0092 */
5414     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 23); } /* U+0093 */
5415     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 24); } /* U+0094 */
5416     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 25); } /* U+0095 */
5417     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 26); } /* U+0096 */
5418     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 27); } /* U+0097 */
5419     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 28); } /* U+0098 */
5420     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 29); } /* U+0099 */
5421     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 30); } /* U+009A */
5422     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 31); } /* U+009B */
5423     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 32); } /* U+009C */
5424     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 33); } /* U+009D */
5425     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 34); } /* U+009E */
5426     @@@c:erred: <[[xp|wf-legal-literal-character]]> { (2, 35); } /* U+009F */
5427    
5428     @@XMLTest:
5429 wakaba 1.27 @@@QName: xp.c0.internal.entity.xml11.1.test
5430     @@@DEnt:
5431     @@@@test:value:
5432     <?xml version="1.1"?>
5433     <!DOCTYPE a [
5434     <!ENTITY e "&#x01;&#x02;&#x03;&#x04;&#x05;&#x06;&#x07;$
5435     &#x08;&#x09;&#x0A;&#x0B;&#x0C;&#x0D;&#x0E;&#x0F;$
5436     &#x10;&#x11;&#x12;&#x13;&#x14;&#x15;&#x16;&#x17;$
5437     &#x18;&#x19;&#x1A;&#x1B;&#x1C;&#x1D;&#x1E;&#x1F;">
5438     ]><a/>
5439 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
5440 wakaba 1.27 @@@test:domTree:
5441     document {
5442     document-type {
5443     general-entity {
5444     node-name: 'e';
5445     text-content: U+0001 U+0002 U+0003 U+0004 U+0005
5446     U+0006 U+0007 U+0008 U+0009 U+000A U+000B
5447     U+000C U+000D U+000E U+000F
5448     U+0010 U+0011 U+0012 U+0013 U+0014 U+0015
5449     U+0016 U+0017 U+0018 U+0019 U+001A U+001B
5450     U+001C U+001D U+001E U+001F;
5451     }
5452     }
5453     element { }
5454     }
5455     @@XMLTest:
5456     @@@QName: xp.c1.internal.entity.xml11.1.test
5457     @@@DEnt:
5458     @@@@test:value:
5459     <?xml version="1.1"?>
5460     <!DOCTYPE a [
5461     <!ENTITY e "&#x80;&#x81;&#x82;&#x83;&#x84;&#x85;&#x86;&#x87;$
5462     &#x88;&#x89;&#x8A;&#x8B;&#x8C;&#x8D;&#x8E;&#x8F;$
5463     &#x90;&#x91;&#x92;&#x93;&#x94;&#x95;&#x96;&#x97;$
5464     &#x98;&#x99;&#x9A;&#x9B;&#x9C;&#x9D;&#x9E;&#x9F;&#x7F;">
5465     ]><a/>
5466 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
5467 wakaba 1.27 @@@test:domTree:
5468     document {
5469     document-type {
5470     general-entity {
5471     node-name: 'e';
5472     text-content: U+0080 U+0081 U+0082 U+0083 U+0084 U+0085
5473     U+0086 U+0087 U+0088 U+0089 U+008A U+008B
5474     U+008C U+008D U+008E U+008F
5475     U+0090 U+0091 U+0092 U+0093 U+0094 U+0095
5476     U+0096 U+0097 U+0098 U+0099 U+009A U+009B
5477     U+009C U+009D U+009E U+009F U+007F;
5478     }
5479     }
5480     element { }
5481     }
5482    
5483     @@XMLTest:
5484 wakaba 1.12 @@@QName: xp.syntax.empty.test
5485     @@@DEnt:
5486     @@@@test:value: \
5487     @@@c:erred:
5488     <[[xp:wf-syntax-error]]> { (1, 1); }
5489     @@XMLTest:
5490     @@@QName: xp.syntax.space.test
5491     @@@DEnt:
5492 wakaba 1.13 @@@@test:value: \
5493 wakaba 1.12 @@@c:erred:
5494     <[[xp:wf-syntax-error]]> { (1, 4); }
5495     @@XMLTest:
5496     @@@QName: xp.syntax.newlines.test
5497     @@@DEnt:
5498     @@@@test:value:
5499     \
5500     \
5501     \
5502     @@@c:erred:
5503     <[[xp:wf-syntax-error]]> { (3, 1); }
5504    
5505     @@XMLTest:
5506 wakaba 1.6 @@@QName: xp.only.docel.test
5507 wakaba 1.5 @@@DEnt:
5508     @@@@test:value:
5509     <p></p>
5510     @@@test:domTree:
5511     document {
5512     xml-version: '1.0';
5513 wakaba 1.6 xml-encoding: null;
5514     xml-standalone: false;
5515     element {
5516     namespace-uri: null;
5517     prefix: null;
5518     local-name: 'p';
5519     text-content: '';
5520     }
5521     }
5522     @@XMLTest:
5523     @@@QName: xp.only.docel.emptyelemtag.test
5524     @@@DEnt:
5525     @@@@test:value:
5526     <p/>
5527     @@@test:domTree:
5528     document {
5529     xml-version: '1.0';
5530     xml-encoding: null;
5531     xml-standalone: false;
5532 wakaba 1.5 element {
5533     namespace-uri: null;
5534     prefix: null;
5535     local-name: 'p';
5536     text-content: '';
5537     }
5538     }
5539 wakaba 1.15 @@XMLTest:
5540     @@@QName: xp.root.s.1.test
5541     @@@DEnt:
5542     @@@@test:value:
5543     <?xml version="1.0"?>$u0020$u000D$u000A$u0009
5544     <p></p>
5545     @@@test:domTree:
5546     document {
5547     element { }
5548     }
5549    
5550     @@XMLTest:
5551     @@@QName: xp.Name.1.test
5552     @@@DEnt:
5553     @@@@test:value: <name/>
5554     @@@test:domTree:
5555     document {
5556     element {
5557     node-name: 'name';
5558     }
5559     }
5560     @@XMLTest:
5561     @@@QName: xp.Name.2.test
5562     @@@DEnt:
5563     @@@@test:value: <name0/>
5564     @@@test:domTree:
5565     document {
5566     element {
5567     node-name: 'name0';
5568     }
5569     }
5570     @@enImplNote:
5571     @@@ddid: xml11name
5572     @@@@:
5573     {TODO:: XML 1.1 Name tests required
5574     }
5575    
5576     @@XMLTest:
5577     @@@QName: xp.content.mse.1.test
5578     @@@DEnt:
5579     @@@@test:value:
5580     <p>]]></p>
5581     @@@c:erred:
5582     <[[xp|wf-syntax-error]]> { (1, 4)..(1, 6); }
5583     @@XMLTest:
5584     @@@QName: xp.content.mse.2.test
5585     @@@DEnt:
5586     @@@@test:value:
5587     <p>aaa]]>bbb</p>
5588     @@@c:erred:
5589     <[[xp|wf-syntax-error]]> { (1, 7)..(1, 9); }
5590    
5591     @@XMLTest:
5592     @@@QName: xp.root.comment.1.test
5593     @@@DEnt:
5594     @@@@test:value:
5595     <!--comment data-->
5596     <p/>
5597     @@@test:domTree:
5598     document {
5599     comment {
5600     data: 'comment data';
5601     }
5602     element { }
5603     }
5604     @@XMLTest:
5605     @@@QName: xp.root.comment.2.test
5606     @@@DEnt:
5607     @@@@test:value:
5608     <!---->
5609     <p/>
5610     @@@test:domTree:
5611     document {
5612     comment {
5613     data: '';
5614     }
5615     element { }
5616     }
5617     @@XMLTest:
5618     @@@QName: xp.root.after.pi.comment.1.test
5619     @@@DEnt:
5620     @@@@test:value:
5621     <?pi?>
5622     <!--comment data-->
5623     <p/>
5624     @@@test:domTree:
5625     document {
5626     pi { }
5627     comment {
5628     data: 'comment data';
5629     }
5630     element { }
5631     }
5632     @@XMLTest:
5633     @@@QName: xp.root.after.pi.comment.2.test
5634     @@@DEnt:
5635     @@@@test:value:
5636     <?pi?>
5637     <!---->
5638     <p/>
5639     @@@test:domTree:
5640     document {
5641     pi { }
5642     comment {
5643     data: '';
5644     }
5645     element { }
5646     }
5647     @@XMLTest:
5648     @@@QName: xp.root.after.element.comment.1.test
5649     @@@DEnt:
5650     @@@@test:value:
5651     <p/>
5652     <!--comment data-->
5653     @@@test:domTree:
5654     document {
5655     element { }
5656     comment {
5657     data: 'comment data';
5658     }
5659     }
5660     @@XMLTest:
5661     @@@QName: xp.root.after.element.comment.2.test
5662     @@@DEnt:
5663     @@@@test:value:
5664     <p/>
5665     <!---->
5666     @@@test:domTree:
5667     document {
5668     element { }
5669     comment {
5670     data: '';
5671     }
5672     }
5673     @@XMLTest:
5674     @@@QName: xp.doctype.intsubset.comment.1.test
5675     @@@DEnt:
5676     @@@@test:value:
5677     <!DOCTYPE a [
5678     <!--comment data-->
5679     ]>
5680     <p/>
5681     @@@test:domTree:
5682     document {
5683     document-type { }
5684     element { }
5685     }
5686     @@XMLTest:
5687     @@@QName: xp.doctype.intsubset.comment.2.test
5688     @@@DEnt:
5689     @@@@test:value:
5690     <!DOCTYPE a [
5691     <!---->
5692     ]>
5693     <p/>
5694     @@@test:domTree:
5695     document {
5696     document-type { }
5697     element { }
5698     }
5699     @@XMLTest:
5700     @@@QName: xp.doctype.intsubset.comment.3.test
5701     @@@DEnt:
5702     @@@@test:value:
5703     <!DOCTYPE a [
5704     <?pi?>
5705     <!---->
5706     ]>
5707     <p/>
5708     @@@test:domTree:
5709     document {
5710     document-type {
5711     pi { }
5712     }
5713     element { }
5714     }
5715     @@XMLTest:
5716     @@@QName: xp.content.comment.1.test
5717     @@@DEnt:
5718     @@@@test:value:
5719     <p><!--comment data--></p>
5720     @@@test:domTree:
5721     document {
5722     element {
5723     comment {
5724     data: 'comment data';
5725     }
5726     }
5727     }
5728     @@XMLTest:
5729     @@@QName: xp.content.comment.2.test
5730     @@@DEnt:
5731     @@@@test:value:
5732     <p><!----></p>
5733     @@@test:domTree:
5734     document {
5735     element {
5736     comment {
5737     data: '';
5738     }
5739     }
5740     }
5741     @@XMLTest:
5742     @@@QName: xp.content.comment.3.test
5743     @@@DEnt:
5744     @@@@test:value:
5745     <p>aaaaa<!---->bbbbb</p>
5746     @@@test:domTree:
5747     document {
5748     element {
5749     text {
5750     data: 'aaaaa';
5751     }
5752     comment {
5753     data: '';
5754     }
5755     text {
5756     data: 'bbbbb';
5757     }
5758     }
5759     }
5760     @@XMLTest:
5761     @@@QName: xp.content.comment.--.1.test
5762     @@@DEnt:
5763     @@@@test:value:
5764     <p><!--data--data--></p>
5765     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 12)..(1, 17); }
5766     @@XMLTest:
5767     @@@QName: xp.content.comment.---gt.test
5768     @@@DEnt:
5769     @@@@test:value:
5770     <p><!--data---></p>
5771     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 12)..(1, 15); }
5772 wakaba 1.13
5773     @@XMLTest:
5774     @@@QName: xp.xmldecl.version.1.0.test
5775     @@@DEnt:
5776     @@@@test:value:
5777     <?xml version="1.0"?>
5778     <p></p>
5779     @@@test:domTree:
5780     document {
5781     xml-version: '1.0';
5782     xml-encoding: null;
5783     xml-standalone: false;
5784     element { }
5785     }
5786     @@XMLTest:
5787     @@@QName: xp.xmldecl.version.1.0.lita.test
5788     @@@DEnt:
5789     @@@@test:value:
5790     <?xml version='1.0'?>
5791     <p></p>
5792     @@@test:domTree:
5793     document {
5794     xml-version: '1.0';
5795     xml-encoding: null;
5796     xml-standalone: false;
5797     element { }
5798     }
5799     @@XMLTest:
5800     @@@QName: xp.xmldecl.version.1.0.s.test
5801     @@@DEnt:
5802     @@@@test:value:
5803     <?xml version = "1.0" ?>
5804     <p></p>
5805     @@@test:domTree:
5806     document {
5807     xml-version: '1.0';
5808     xml-encoding: null;
5809     xml-standalone: false;
5810     element { }
5811     }
5812     @@XMLTest:
5813     @@@QName: xp.xmldecl.version.1.1.test
5814     @@@DEnt:
5815     @@@@test:value:
5816     <?xml version="1.1"?>
5817     <p></p>
5818     @@@test:domTree:
5819     document {
5820     xml-version: '1.1';
5821     xml-encoding: null;
5822     xml-standalone: false;
5823     element { }
5824     }
5825    
5826     @@XMLTest:
5827     @@@QName: xp.xmldecl.version.1.0.encoding.usascii.test
5828     @@@DEnt:
5829     @@@@test:value:
5830     <?xml version="1.0" encoding="US-ascii"?>
5831     <p></p>
5832     @@@test:domTree:
5833     document {
5834     xml-version: '1.0';
5835     xml-encoding: 'US-ascii';
5836     xml-standalone: false;
5837     element { }
5838     }
5839     @@XMLTest:
5840     @@@QName: xp.xmldecl.version.1.0.encoding.usascii.lita.test
5841     @@@DEnt:
5842     @@@@test:value:
5843     <?xml version="1.0" encoding='US-ascii'?>
5844     <p></p>
5845     @@@test:domTree:
5846     document {
5847     xml-version: '1.0';
5848     xml-encoding: 'US-ascii';
5849     xml-standalone: false;
5850     element { }
5851     }
5852     @@XMLTest:
5853     @@@QName: xp.xmldecl.version.1.0.encoding.usascii.s.test
5854     @@@DEnt:
5855     @@@@test:value:
5856     <?xml version="1.0" encoding = "US-ascii" ?>
5857     <p></p>
5858     @@@test:domTree:
5859     document {
5860     xml-version: '1.0';
5861     xml-encoding: 'US-ascii';
5862     xml-standalone: false;
5863     element { }
5864     }
5865    
5866     @@XMLTest:
5867     @@@QName: xp.xmldecl.version.1.0.encoding.usascii.standalone.yes.test
5868     @@@DEnt:
5869     @@@@test:value:
5870     <?xml version="1.0" encoding="us-ascii" standalone="yes"?>
5871     <p></p>
5872     @@@test:domTree:
5873     document {
5874     xml-version: '1.0';
5875     xml-encoding: 'us-ascii';
5876     xml-standalone: true;
5877     element { }
5878     }
5879     @@XMLTest:
5880     @@@QName: xp.xmldecl.version.1.0.encoding.usascii.standalone.no.test
5881     @@@DEnt:
5882     @@@@test:value:
5883     <?xml version="1.0" encoding="us-ascii" standalone="no"?>
5884     <p></p>
5885     @@@test:domTree:
5886     document {
5887     xml-version: '1.0';
5888     xml-encoding: 'us-ascii';
5889     xml-standalone: false;
5890     element { }
5891     }
5892     @@XMLTest:
5893     @@@QName: xp.xmldecl.version.1.0.encoding.usascii.standalone.yes.lita.test
5894     @@@DEnt:
5895     @@@@test:value:
5896     <?xml version="1.0" encoding="us-ascii" standalone='yes'?>
5897     <p></p>
5898     @@@test:domTree:
5899     document {
5900     xml-version: '1.0';
5901     xml-encoding: 'us-ascii';
5902     xml-standalone: true;
5903     element { }
5904     }
5905     @@XMLTest:
5906     @@@QName: xp.xmldecl.version.1.0.encoding.usascii.standalone.yes.s.test
5907     @@@DEnt:
5908     @@@@test:value:
5909     <?xml version="1.0" encoding="us-ascii" standalone = "yes" ?>
5910     <p></p>
5911     @@@test:domTree:
5912     document {
5913     xml-version: '1.0';
5914     xml-encoding: 'us-ascii';
5915     xml-standalone: true;
5916     element { }
5917     }
5918 wakaba 1.14 @@XMLTest:
5919     @@@QName: xp.xmldecl.no.encoding.but.standalone.attr.test
5920     @@@DEnt:
5921     @@@@test:value:
5922     <?xml version="1.0" standalone="yes"?>
5923     <p></p>
5924     @@@test:domTree:
5925     document {
5926     xml-version: '1.0';
5927     xml-encoding: null;
5928     xml-standalone: true;
5929     element { }
5930     }
5931     @@XMLTest:
5932     @@@QName: xp.xmldecl.encoding.encname.test
5933     @@@DEnt:
5934     @@@@test:value:
5935     <?xml version="1.0" encoding="a-._01-"?>
5936     <p></p>
5937     @@@test:domTree:
5938     document {
5939     xml-version: '1.0';
5940     xml-encoding: 'a-._01-';
5941     xml-standalone: false;
5942     element { }
5943     }
5944    
5945     @@XMLTest:
5946     @@@QName: xp.xmldecl.no.s.no.attr.test
5947     @@@DEnt:
5948     @@@@test:value:
5949     <?xml?>
5950     <p></p>
5951     @@@c:erred:
5952 wakaba 1.16 <[[xp:wf-syntax-error]]> { (1, 1)..(1, 7); }
5953 wakaba 1.14 @@XMLTest:
5954     @@@QName: xp.xmldecl.s.no.attr.test
5955     @@@DEnt:
5956     @@@@test:value:
5957     <?xml ?>
5958     <p></p>
5959     @@@c:erred:
5960     <[[xp:wf-syntax-error]]> { (1, 8)..(1, 9); }
5961     @@XMLTest:
5962     @@@QName: xp.xmldecl.unknown.attr.test
5963     @@@DEnt:
5964     @@@@test:value:
5965     <?xml unknown="value"?>
5966     <p></p>
5967     @@@c:erred:
5968     <[[xp:wf-syntax-error]]> { (1, 8)..(1, 22); }
5969     @@XMLTest:
5970     @@@QName: xp.xmldecl.version.unknown.attr.test
5971     @@@DEnt:
5972     @@@@test:value:
5973     <?xml version="1.0" unknown="value"?>
5974     <p></p>
5975     @@@c:erred:
5976     <[[xp:wf-syntax-error]]> { (1, 21)..(1, 35); }
5977     @@XMLTest:
5978     @@@QName: xp.xmldecl.version.encoding.unknown.attr.test
5979     @@@DEnt:
5980     @@@@test:value:
5981     <?xml version="1.0" encoding="us-ascii" unknown="value"?>
5982     <p></p>
5983     @@@c:erred:
5984     <[[xp:wf-syntax-error]]> { (1, 41)..(1, 55); }
5985     @@XMLTest:
5986     @@@QName: xp.xmldecl.version.encoding.standalone.unknown.attr.test
5987     @@@DEnt:
5988     @@@@test:value:
5989     <?xml version="1.0" encoding="us-ascii" standalone="yes"
5990     unknown="value"?>
5991     <p></p>
5992     @@@c:erred:
5993     <[[xp:wf-syntax-error]]> { (2, 1)..(2, 15); }
5994     @@XMLTest:
5995     @@@QName: xp.xmldecl.no.version.but.encoding.attr.test
5996     @@@DEnt:
5997     @@@@test:value:
5998     <?xml encoding="us-ascii"?>
5999     <p></p>
6000     @@@c:erred:
6001     <[[xp:wf-syntax-error]]> { (1, 7)..(1, 25); }
6002     @@XMLTest:
6003     @@@QName: xp.xmldecl.no.version.but.standalone.attr.test
6004     @@@DEnt:
6005     @@@@test:value:
6006     <?xml standalone="yes"?>
6007     <p></p>
6008     @@@c:erred:
6009     <[[xp:wf-syntax-error]]> { (1, 7)..(1, 24); }
6010     @@XMLTest:
6011     @@@QName: xp.xmldecl.version.unsupported.test
6012     @@@DEnt:
6013     @@@@test:value:
6014     <?xml version="1.2"?>
6015     <p></p>
6016     @@@c:erred:
6017     <[[xp:wf-unsupported-xml-version]]> { (1, 7)..(1, 19); }
6018     @@XMLTest:
6019     @@@QName: xp.xmldecl.version.unsupported.2.test
6020     @@@DEnt:
6021     @@@@test:value:
6022     <?xml version=" 1.0 "?>
6023     <p></p>
6024     @@@c:erred:
6025     <[[xp:wf-unsupported-xml-version]]> { (1, 7)..(1, 21); }
6026     @@XMLTest:
6027     @@@QName: xp.xmldecl.version.unsupported.3.test
6028     @@@DEnt:
6029     @@@@test:value:
6030     <?xml version="01.00"?>
6031     <p></p>
6032     @@@c:erred:
6033     <[[xp:wf-unsupported-xml-version]]> { (1, 7)..(1, 21); }
6034     @@XMLTest:
6035     @@@QName: xp.xmldecl.encoding.malformed.1.test
6036     @@@DEnt:
6037     @@@@test:value:
6038     <?xml version="1.0" encoding="0088"?>
6039     <p></p>
6040     @@@c:erred:
6041     <[[xp:wf-malformed-enc-name]]> { (1, 21)..(1, 35); }
6042     @@XMLTest:
6043     @@@QName: xp.xmldecl.encoding.malformed.2.test
6044     @@@DEnt:
6045     @@@@test:value:
6046     <?xml version="1.0" encoding="D.V.D!"?>
6047     <p></p>
6048     @@@c:erred:
6049     <[[xp:wf-malformed-enc-name]]> { (1, 21)..(1, 38); }
6050     @@XMLTest:
6051     @@@QName: xp.xmldecl.standalone.malformed.1.test
6052     @@@DEnt:
6053     @@@@test:value:
6054     <?xml version="1.0" standalone="true"?>
6055     <p></p>
6056     @@@c:erred:
6057     <[[xp:wf-malformed-xml-standalone]]> { (1, 21)..(1, 38); }
6058     @@XMLTest:
6059     @@@QName: xp.xmldecl.standalone.malformed.2.test
6060     @@@DEnt:
6061     @@@@test:value:
6062     <?xml version="1.0" standalone="YES"?>
6063     <p></p>
6064     @@@c:erred:
6065     <[[xp:wf-malformed-xml-standalone]]> { (1, 21)..(1, 37); }
6066     @@XMLTest:
6067     @@@QName: xp.xmldecl.standalone.malformed.3.test
6068     @@@DEnt:
6069     @@@@test:value:
6070     <?xml version="1.0" standalone="no "?>
6071     <p></p>
6072     @@@c:erred:
6073     <[[xp:wf-malformed-xml-standalone]]> { (1, 21)..(1, 38); }
6074 wakaba 1.6
6075     @@XMLTest:
6076 wakaba 1.14 @@@QName: xp.no-xmldecl.xml...-pi.test
6077     @@@DEnt:
6078     @@@@test:value:
6079     <?xmldeclaration?>
6080     <a></a>
6081     @@@test:domTree:
6082     document {
6083     pi {
6084     node-name: 'xmldeclaration';
6085     node-value: '';
6086     }
6087     element { }
6088     }
6089     @@XMLTest:
6090     @@@QName: xp.no-xmldecl.xml...-pi.after.document.element.test
6091     @@@DEnt:
6092     @@@@test:value:
6093     <a></a>
6094     <?xmldeclaration?>
6095     @@@test:domTree:
6096     document {
6097     element { }
6098     pi {
6099     node-name: 'xmldeclaration';
6100     node-value: '';
6101     }
6102     }
6103     @@XMLTest:
6104     @@@QName: xp.no-xmldecl.xml...-pi.in.document.element.test
6105     @@@DEnt:
6106     @@@@test:value:
6107     <a>
6108     <?xmldeclaration?>
6109     </a>
6110     @@@test:domTree:
6111     document {
6112     element {
6113     text { }
6114     pi {
6115     node-name: 'xmldeclaration';
6116     node-value: '';
6117     }
6118     text { }
6119     }
6120     }
6121     @@XMLTest:
6122     @@@QName: xp.no-xmldecl.xml...-pi.in.doctype.test
6123     @@@DEnt:
6124     @@@@test:value:
6125     <!DOCTYPE a [
6126     <?xmldeclaration?>
6127     ]>
6128     <a></a>
6129     @@@test:domTree:
6130     document {
6131     document-type {
6132     pi {
6133     node-name: 'xmldeclaration';
6134     node-value: '';
6135     }
6136     }
6137     element { }
6138     }
6139    
6140     @@XMLTest:
6141     @@@QName: xp.XMLdecl.test
6142     @@@DEnt:
6143     @@@@test:value:
6144     <?XML version="1.0"?>
6145     <p></p>
6146     @@@c:erred:
6147     <[[xp:wf-pi-target-is-xml]]> { (1, 1)..(1, 5); }
6148     @@XMLTest:
6149     @@@QName: xp.Xmldecl.test
6150     @@@DEnt:
6151     @@@@test:value:
6152     <?Xml version="1.0"?>
6153     <p></p>
6154     @@@c:erred:
6155     <[[xp:wf-pi-target-is-xml]]> { (1, 1)..(1, 5); }
6156     @@XMLTest:
6157     @@@QName: xp.xmldecl.after.document.element.empty.test
6158     @@@DEnt:
6159     @@@@test:value:
6160     <p></p>
6161     <?xml?>
6162     @@@c:erred:
6163     <[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); }
6164     @@XMLTest:
6165     @@@QName: xp.xmldecl.after.document.element.test
6166     @@@DEnt:
6167     @@@@test:value:
6168     <p></p>
6169     <?xml version="1.0"?>
6170     @@@c:erred:
6171     <[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); }
6172     @@XMLTest:
6173     @@@QName: xp.xmldecl.in.element.empty.test
6174     @@@DEnt:
6175     @@@@test:value:
6176     <p>
6177     <?xml?>
6178     </p>
6179     @@@c:erred:
6180     <[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); }
6181     @@XMLTest:
6182     @@@QName: xp.xmldecl.in.element.test
6183     @@@DEnt:
6184     @@@@test:value:
6185     <p>
6186     <?xml version="1.0"?>
6187     </p>
6188     @@@c:erred:
6189     <[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); }
6190     @@XMLTest:
6191     @@@QName: xp.xmldecl.after.comment.test
6192     @@@DEnt:
6193     @@@@test:value:
6194     <!---->
6195     <?xml version="1.0"?>
6196     <p></p>
6197     @@@c:erred:
6198     <[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); }
6199     @@XMLTest:
6200     @@@QName: xp.xmldecl.after.comment.empty.test
6201     @@@DEnt:
6202     @@@@test:value:
6203     <!---->
6204     <?xml?>
6205     <p></p>
6206     @@@c:erred:
6207     <[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); }
6208     @@XMLTest:
6209     @@@QName: xp.xmldecl.after.pi.test
6210     @@@DEnt:
6211     @@@@test:value:
6212     <?xml-declaration?>
6213     <?xml version="1.0"?>
6214     <p></p>
6215     @@@c:erred:
6216     <[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); }
6217     @@XMLTest:
6218     @@@QName: xp.xmldecl.after.pi.empty.test
6219     @@@DEnt:
6220     @@@@test:value:
6221     <?xml-declaration?>
6222     <?xml?>
6223     <p></p>
6224     @@@c:erred:
6225     <[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); }
6226     @@XMLTest:
6227 wakaba 1.16 @@@QName: xp.xmldecl.after.pi.2.test
6228     @@@DEnt:
6229     @@@@test:value:
6230     <?declaration?>
6231     <?xml version="1.0"?>
6232     <p></p>
6233     @@@c:erred:
6234     <[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); }
6235     @@XMLTest:
6236     @@@QName: xp.xmldecl.after.pi.empty.2.test
6237     @@@DEnt:
6238     @@@@test:value:
6239     <?declaration?>
6240     <?xml?>
6241     <p></p>
6242     @@@c:erred:
6243     <[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); }
6244     @@XMLTest:
6245 wakaba 1.14 @@@QName: xp.xmldecl.after.doctype.test
6246     @@@DEnt:
6247     @@@@test:value:
6248     <!DOCTYPE a>
6249     <?xml version="1.0"?>
6250     <p></p>
6251     @@@c:erred:
6252     <[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); }
6253     @@XMLTest:
6254     @@@QName: xp.xmldecl.after.doctype.empty.test
6255     @@@DEnt:
6256     @@@@test:value:
6257     <!DOCTYPE a>
6258     <?xml?>
6259     <p></p>
6260     @@@c:erred:
6261     <[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); }
6262     @@XMLTest:
6263     @@@QName: xp.xmldecl.in.doctype.test
6264     @@@DEnt:
6265     @@@@test:value:
6266     <!DOCTYPE a [
6267     <?xml version="1.0"?>
6268     ]>
6269     <p></p>
6270     @@@c:erred:
6271     <[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); }
6272     @@XMLTest:
6273     @@@QName: xp.xmldecl.in.doctype.empty.test
6274     @@@DEnt:
6275     @@@@test:value:
6276     <!DOCTYPE a [
6277     <?xml?>
6278     ]>
6279     <p></p>
6280     @@@c:erred:
6281     <[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); }
6282    
6283     @@XMLTest:
6284     @@@QName: xp.pi.before.element.empty.test
6285     @@@DEnt:
6286     @@@@test:value:
6287     <?target?>
6288     <a></a>
6289     @@@test:domTree:
6290     document {
6291     pi {
6292     node-name: 'target';
6293     node-value: '';
6294     }
6295     element { }
6296     }
6297     @@XMLTest:
6298     @@@QName: xp.pi.before.element.s.test
6299     @@@DEnt:
6300     @@@@test:value:
6301     <?target ?>
6302     <a></a>
6303     @@@test:domTree:
6304     document {
6305     pi {
6306     node-name: 'target';
6307     node-value: '';
6308     }
6309     element { }
6310     }
6311     @@XMLTest:
6312     @@@QName: xp.pi.before.element.string.test
6313     @@@DEnt:
6314     @@@@test:value:
6315     <?target string?>
6316     <a></a>
6317     @@@test:domTree:
6318     document {
6319     pi {
6320     node-name: 'target';
6321     node-value: 'string';
6322     }
6323     element { }
6324     }
6325     @@XMLTest:
6326     @@@QName: xp.pi.before.element.string.s.test
6327     @@@DEnt:
6328     @@@@test:value:
6329     <?target string ?>
6330     <a></a>
6331     @@@test:domTree:
6332     document {
6333     pi {
6334     node-name: 'target';
6335     node-value: 'string ';
6336     }
6337     element { }
6338     }
6339     @@XMLTest:
6340     @@@QName: xp.pi.before.element.gt.test
6341     @@@DEnt:
6342     @@@@test:value:
6343     <?target string>string?>
6344     <a></a>
6345     @@@test:domTree:
6346     document {
6347     pi {
6348     node-name: 'target';
6349     node-value: 'string>string';
6350     }
6351     element { }
6352     }
6353     @@XMLTest:
6354     @@@QName: xp.pi.doctype.empty.test
6355     @@@DEnt:
6356     @@@@test:value:
6357     <!DOCTYPE a [
6358     <?target?>
6359     ]>
6360     <a></a>
6361     @@@test:domTree:
6362     document {
6363     document-type {
6364     pi {
6365     node-name: 'target';
6366     node-value: '';
6367     }
6368     }
6369     element { }
6370     }
6371    
6372     @@XMLTest:
6373     @@@QName: xp.pi.no.target.test
6374     @@@DEnt:
6375     @@@@test:value:
6376     <??>
6377     <p></p>
6378     @@@c:erred:
6379     <[[xp:wf-syntax-error]]> { (1, 3)..(1, 4); }
6380     @@XMLTest:
6381     @@@QName: xp.pi.no.target.2.test
6382     @@@DEnt:
6383     @@@@test:value:
6384     <? ?>
6385     <p></p>
6386     @@@c:erred:
6387     <[[xp:wf-syntax-error]]> { (1, 3)..(1, 4); }
6388     @@XMLTest:
6389     @@@QName: xp.pi.bad.target.1.test
6390     @@@DEnt:
6391     @@@@test:value:
6392     <?target! ?>
6393     <p></p>
6394     @@@c:erred:
6395     <[[xp:wf-syntax-error]]> { (1, 9)..(1, 9); }
6396     @@XMLTest:
6397     @@@QName: xp.pi.bad.target.2.test
6398     @@@DEnt:
6399     @@@@test:value:
6400     <?0target ?>
6401     <p></p>
6402     @@@c:erred:
6403     <[[xp:wf-syntax-error]]> { (1, 3)..(1, 3); }
6404    
6405     @@XMLTest:
6406 wakaba 1.15 @@@QName: xp.cdatasection.empty.1.test
6407     @@@DEnt:
6408     @@@@test:value:
6409     <p><![CDATA[]]></p>
6410     @@@test:domTree:
6411     document {
6412     element {
6413     cdata-section {
6414     data: '';
6415     }
6416     }
6417     }
6418     @@XMLTest:
6419     @@@QName: xp.cdatasection.empty.2.test
6420     @@@DEnt:
6421     @@@@test:value:
6422     <p>aa<![CDATA[]]>bb</p>
6423     @@@test:domTree:
6424     document {
6425     element {
6426     text { data: 'aa'; }
6427     cdata-section {
6428     data: '';
6429     }
6430     text { data: 'bb'; }
6431     }
6432     }
6433     @@XMLTest:
6434     @@@QName: xp.cdatasection.1.test
6435     @@@DEnt:
6436     @@@@test:value:
6437     <p><![CDATA[abcdefg]]></p>
6438     @@@test:domTree:
6439     document {
6440     element {
6441     cdata-section {
6442     data: 'abcdefg';
6443     }
6444     }
6445     }
6446     @@XMLTest:
6447     @@@QName: xp.cdatasection.2.test
6448     @@@DEnt:
6449     @@@@test:value:
6450     <p>aa<![CDATA[abcdefg]]>bb</p>
6451     @@@test:domTree:
6452     document {
6453     element {
6454     text { data: 'aa'; }
6455     cdata-section {
6456     data: 'abcdefg';
6457     }
6458     text { data: 'bb'; }
6459     }
6460     }
6461     @@XMLTest:
6462     @@@QName: xp.cdatasection.ref.1.test
6463     @@@DEnt:
6464     @@@@test:value:
6465     <p><![CDATA[a&amp;&#x32;&#32;%abc;&def;]]&gt;b]]></p>
6466     @@@test:domTree:
6467     document {
6468     element {
6469     cdata-section {
6470     data: 'a&amp;&#x32;&#32;%abc;&def;]]&gt;b';
6471     }
6472     }
6473     }
6474     @@XMLTest:
6475     @@@QName: xp.cdatasection.in.general.entity.test
6476     @@@DEnt:
6477     @@@@test:value:
6478     <!DOCTYPE p [
6479     <!ENTITY cdata "<![CDATA[text]]>">
6480     ]>
6481     <p>&cdata;</p>
6482 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
6483 wakaba 1.15 @@@test:domTree:
6484     document {
6485     document-type {
6486     general-entity {
6487     node-name: 'cdata';
6488     cdata-section {
6489     data: 'text';
6490     }
6491     }
6492     }
6493     element {
6494     general-entity-reference {
6495 wakaba 1.23 node-name: 'cdata';
6496 wakaba 1.34 manakai-expanded: true;
6497 wakaba 1.15 cdata-section {
6498     data: 'text';
6499     }
6500     }
6501     }
6502     }
6503     @@XMLTest:
6504     @@@QName: xp.cdatasection.no.mse.test
6505     @@@DEnt:
6506     @@@@test:value:
6507     <p><![CDATA[text</p>
6508     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 21); }
6509     @@XMLTest:
6510     @@@QName: xp.cdatasection.nest.test
6511     @@@DEnt:
6512     @@@@test:value:
6513     <p><![CDATA[text01<![CDATA[txt2]]>text3]]></p>
6514     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 40)..(1, 42); }
6515    
6516     @@XMLTest:
6517 wakaba 1.6 @@@QName: xp.doctype.empty.test
6518     @@@DEnt:
6519     @@@@test:value:
6520     <!DOCTYPE a>
6521     <a></a>
6522     @@@test:domTree:
6523     document {
6524     xml-version: '1.0';
6525     xml-encoding: null;
6526     xml-standalone: false;
6527     document-type {
6528     node-name: 'a';
6529 wakaba 1.17 public-id: null;
6530     system-id: null;
6531 wakaba 1.6 }
6532     element {
6533     namespace-uri: null;
6534     prefix: null;
6535     local-name: 'a';
6536     text-content: '';
6537     }
6538     }
6539 wakaba 1.15 @@XMLTest:
6540     @@@QName: xp.doctype.empty.after.document.element.test
6541     @@@DEnt:
6542     @@@@test:value:
6543     <a></a>
6544     <!DOCTYPE a>
6545     @@@c:erred: <[[xp|wf-syntax-error]]> { (2, 1)..(2, 12); }
6546     @@XMLTest:
6547     @@@QName: xp.doctype.empty.in.element.test
6548     @@@DEnt:
6549     @@@@test:value:
6550     <a>
6551     <!DOCTYPE a>
6552     </a>
6553     @@@c:erred: <[[xp|wf-syntax-error]]> { (2, 1)..(2, 12); }
6554     @@XMLTest:
6555     @@@QName: xp.doctype.empty.dup.test
6556     @@@DEnt:
6557     @@@@test:value:
6558     <!DOCTYPE a>
6559     <!DOCTYPE a>
6560     <a></a>
6561     @@@c:erred: <[[xp|wf-syntax-error]]> { (2, 1)..(2, 12); }
6562     @@XMLTest:
6563     @@@QName: xp.doctype.empty.in.intsubset.test
6564     @@@DEnt:
6565     @@@@test:value:
6566     <!DOCTYPE a [
6567     <!DOCTYPE a>
6568     ]>
6569     <a></a>
6570     @@@c:erred: <[[xp|wf-syntax-error]]> { (2, 1)..(2, 12); }
6571 wakaba 1.16 @@XMLTest:
6572     @@@QName: xp.doctype.no.s.no.name.test
6573     @@@DEnt:
6574     @@@@test:value:
6575     <!DOCTYPE>
6576     <a></a>
6577     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 10); }
6578     @@XMLTest:
6579     @@@QName: xp.doctype.no.name.test
6580     @@@DEnt:
6581     @@@@test:value:
6582     <!DOCTYPE >
6583     <a></a>
6584     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 11); }
6585     @@XMLTest:
6586     @@@QName: xp.doctype.name.s.test
6587     @@@DEnt:
6588     @@@@test:value:
6589     <!DOCTYPE aa >
6590     <aa></aa>
6591     @@@test:domTree:
6592     document {
6593     document-type {
6594     node-name: 'aa';
6595 wakaba 1.17 public-id: null;
6596     system-id: null;
6597 wakaba 1.16 }
6598     element { }
6599     }
6600     @@XMLTest:
6601     @@@QName: xp.doctype.no.mdc.test
6602     @@@DEnt:
6603     @@@@test:value:
6604     <!DOCTYPE aa
6605     <aa></aa>
6606     @@@c:erred: <[[xp|wf-syntax-error]]> { (2, 1); }
6607 wakaba 1.6
6608     @@XMLTest:
6609 wakaba 1.16 @@@QName: xp.doctype.intsubset.empty.1.test
6610 wakaba 1.6 @@@DEnt:
6611     @@@@test:value:
6612 wakaba 1.16 <!DOCTYPE a []>
6613 wakaba 1.6 <a></a>
6614     @@@test:domTree:
6615     document {
6616     xml-version: '1.0';
6617     xml-encoding: null;
6618     xml-standalone: false;
6619     document-type {
6620     node-name: 'a';
6621 wakaba 1.17 public-id: null;
6622     system-id: null;
6623 wakaba 1.6 }
6624     element {
6625     namespace-uri: null;
6626     prefix: null;
6627     local-name: 'a';
6628     text-content: '';
6629     }
6630     }
6631     @@XMLTest:
6632 wakaba 1.16 @@@QName: xp.doctype.intsubset.empty.2.test
6633 wakaba 1.6 @@@DEnt:
6634     @@@@test:value:
6635     <!DOCTYPE a [
6636 wakaba 1.16
6637 wakaba 1.6 ]>
6638     <a></a>
6639     @@@test:domTree:
6640     document {
6641     xml-version: '1.0';
6642     xml-encoding: null;
6643     xml-standalone: false;
6644     document-type {
6645     node-name: 'a';
6646 wakaba 1.17 public-id: null;
6647     system-id: null;
6648 wakaba 1.6 }
6649     element {
6650     namespace-uri: null;
6651     prefix: null;
6652     local-name: 'a';
6653     text-content: '';
6654     }
6655     }
6656     @@XMLTest:
6657 wakaba 1.16 @@@QName: xp.doctype.intsubset.empty.3.test
6658 wakaba 1.6 @@@DEnt:
6659     @@@@test:value:
6660 wakaba 1.16 <!DOCTYPE a[]>
6661 wakaba 1.6 <a></a>
6662     @@@test:domTree:
6663     document {
6664     document-type {
6665     node-name: 'a';
6666 wakaba 1.17 public-id: null;
6667     system-id: null;
6668 wakaba 1.6 }
6669 wakaba 1.16 element { }
6670     }
6671     @@XMLTest:
6672     @@@QName: xp.doctype.intsubset.empty.4.test
6673     @@@DEnt:
6674     @@@@test:value:
6675     <!DOCTYPE a[] >
6676     <a></a>
6677     @@@test:domTree:
6678     document {
6679     document-type {
6680     node-name: 'a';
6681 wakaba 1.17 public-id: null;
6682     system-id: null;
6683 wakaba 1.6 }
6684 wakaba 1.16 element { }
6685 wakaba 1.6 }
6686     @@XMLTest:
6687 wakaba 1.16 @@@QName: xp.doctype.intsubset.no.dsc.1.test
6688     @@@DEnt:
6689     @@@@test:value:
6690     <!DOCTYPE a [>
6691     <a></a>
6692     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 14); }
6693     @@XMLTest:
6694     @@@QName: xp.doctype.intsubset.no.dsc.2.test
6695 wakaba 1.6 @@@DEnt:
6696     @@@@test:value:
6697     <!DOCTYPE a [
6698     <a></a>
6699 wakaba 1.16 @@@c:erred: <[[xp|wf-syntax-error]]> { (2, 1); }
6700     @@XMLTest:
6701     @@@QName: xp.doctype.intsubset.no.dsc.3.test
6702     @@@DEnt:
6703     @@@@test:value:
6704     <!DOCTYPE a [
6705     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 14); }
6706     @@XMLTest:
6707     @@@QName: xp.doctype.intsubset.no.mdc.1.test
6708     @@@DEnt:
6709     @@@@test:value:
6710     <!DOCTYPE a []
6711     <a/>
6712     @@@c:erred: <[[xp|wf-syntax-error]]> { (2, 1); }
6713     @@XMLTest:
6714     @@@QName: xp.doctype.intsubset.no.mdc.2.test
6715     @@@DEnt:
6716     @@@@test:value:
6717     <!DOCTYPE a []]>
6718     <a/>
6719     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 15); }
6720 wakaba 1.17 @@XMLTest:
6721     @@@QName: xp.doctype.pubid.sysid.1.test
6722     @@@DEnt:
6723     @@@@test:value:
6724     <!DOCTYPE a PUBLIC "pubid" "sysid">
6725     <a/>
6726     @@@test:domTree:
6727     document {
6728     document-type {
6729     node-name: 'a';
6730     public-id: 'pubid';
6731     system-id: 'sysid';
6732     }
6733     element { }
6734     }
6735     @@XMLTest:
6736     @@@QName: xp.doctype.pubid.sysid.2.test
6737     @@@DEnt:
6738     @@@@test:value:
6739     <!DOCTYPE a PUBLIC 'pubid' "sysid">
6740     <a/>
6741     @@@test:domTree:
6742     document {
6743     document-type {
6744     node-name: 'a';
6745     public-id: 'pubid';
6746     system-id: 'sysid';
6747     }
6748     element { }
6749     }
6750     @@XMLTest:
6751     @@@QName: xp.doctype.pubid.sysid.3.test
6752     @@@DEnt:
6753     @@@@test:value:
6754     <!DOCTYPE a PUBLIC "pubid" 'sysid'>
6755     <a/>
6756     @@@test:domTree:
6757     document {
6758     document-type {
6759     node-name: 'a';
6760     public-id: 'pubid';
6761     system-id: 'sysid';
6762     }
6763     element { }
6764     }
6765     @@XMLTest:
6766     @@@QName: xp.doctype.pubid.sysid.4.test
6767     @@@DEnt:
6768     @@@@test:value:
6769     <!DOCTYPE a PUBLIC 'pubid' 'sysid'>
6770     <a/>
6771     @@@test:domTree:
6772     document {
6773     document-type {
6774     node-name: 'a';
6775     public-id: 'pubid';
6776     system-id: 'sysid';
6777     }
6778     element { }
6779     }
6780     @@XMLTest:
6781     @@@QName: xp.doctype.pubid.sysid.5.test
6782     @@@DEnt:
6783     @@@@test:value:
6784     <!DOCTYPE a PUBLIC "pubid" "sysid" >
6785     <a/>
6786     @@@test:domTree:
6787     document {
6788     document-type {
6789     node-name: 'a';
6790     public-id: 'pubid';
6791     system-id: 'sysid';
6792     }
6793     element { }
6794     }
6795     @@XMLTest:
6796     @@@QName: xp.doctype.pubid.sysid.6.test
6797     @@@DEnt:
6798     @@@@test:value:
6799     <!DOCTYPE a PUBLIC 'pubid' 'sysid' >
6800     <a/>
6801     @@@test:domTree:
6802     document {
6803     document-type {
6804     node-name: 'a';
6805     public-id: 'pubid';
6806     system-id: 'sysid';
6807     }
6808     element { }
6809     }
6810     @@XMLTest:
6811     @@@QName: xp.doctype.pubid.sysid.intsubset.1.test
6812     @@@DEnt:
6813     @@@@test:value:
6814     <!DOCTYPE a PUBLIC "pubid" "sysid"[]>
6815     <a/>
6816     @@@test:domTree:
6817     document {
6818     document-type {
6819     node-name: 'a';
6820     public-id: 'pubid';
6821     system-id: 'sysid';
6822     }
6823     element { }
6824     }
6825     @@XMLTest:
6826     @@@QName: xp.doctype.pubid.sysid.intsubset.2.test
6827     @@@DEnt:
6828     @@@@test:value:
6829     <!DOCTYPE a PUBLIC "pubid" "sysid" []>
6830     <a/>
6831     @@@test:domTree:
6832     document {
6833     document-type {
6834     node-name: 'a';
6835     public-id: 'pubid';
6836     system-id: 'sysid';
6837     }
6838     element { }
6839     }
6840     @@XMLTest:
6841     @@@QName: xp.doctype.pubid.sysid.intsubset.3.test
6842     @@@DEnt:
6843     @@@@test:value:
6844     <!DOCTYPE a PUBLIC 'pubid' 'sysid'[]>
6845     <a/>
6846     @@@test:domTree:
6847     document {
6848     document-type {
6849     node-name: 'a';
6850     public-id: 'pubid';
6851     system-id: 'sysid';
6852     }
6853     element { }
6854     }
6855     @@XMLTest:
6856     @@@QName: xp.doctype.pubid.sysid.intsubset.4.test
6857     @@@DEnt:
6858     @@@@test:value:
6859     <!DOCTYPE a PUBLIC 'pubid' 'sysid' []>
6860     <a/>
6861     @@@test:domTree:
6862     document {
6863     document-type {
6864     node-name: 'a';
6865     public-id: 'pubid';
6866     system-id: 'sysid';
6867     }
6868     element { }
6869     }
6870     @@XMLTest:
6871     @@@QName: xp.doctype.sysid.1.test
6872     @@@DEnt:
6873     @@@@test:value:
6874     <!DOCTYPE a SYSTEM "sysid">
6875     <a/>
6876     @@@test:domTree:
6877     document {
6878     document-type {
6879     node-name: 'a';
6880     public-id: null;
6881     system-id: 'sysid';
6882     }
6883     element { }
6884     }
6885     @@XMLTest:
6886     @@@QName: xp.doctype.sysid.2.test
6887     @@@DEnt:
6888     @@@@test:value:
6889     <!DOCTYPE a SYSTEM 'sysid'>
6890     <a/>
6891     @@@test:domTree:
6892     document {
6893     document-type {
6894     node-name: 'a';
6895     public-id: null;
6896     system-id: 'sysid';
6897     }
6898     element { }
6899     }
6900     @@XMLTest:
6901     @@@QName: xp.doctype.sysid.3.test
6902     @@@DEnt:
6903     @@@@test:value:
6904     <!DOCTYPE a SYSTEM "sysid" >
6905     <a/>
6906     @@@test:domTree:
6907     document {
6908     document-type {
6909     node-name: 'a';
6910     public-id: null;
6911     system-id: 'sysid';
6912     }
6913     element { }
6914     }
6915     @@XMLTest:
6916     @@@QName: xp.doctype.sysid.4.test
6917     @@@DEnt:
6918     @@@@test:value:
6919     <!DOCTYPE a SYSTEM 'sysid' >
6920     <a/>
6921     @@@test:domTree:
6922     document {
6923     document-type {
6924     node-name: 'a';
6925     public-id: null;
6926     system-id: 'sysid';
6927     }
6928     element { }
6929     }
6930     @@XMLTest:
6931     @@@QName: xp.doctype.sysid.intsubset.1.test
6932     @@@DEnt:
6933     @@@@test:value:
6934     <!DOCTYPE a SYSTEM "sysid"[]>
6935     <a/>
6936     @@@test:domTree:
6937     document {
6938     document-type {
6939     node-name: 'a';
6940     public-id: null;
6941     system-id: 'sysid';
6942     }
6943     element { }
6944     }
6945     @@XMLTest:
6946     @@@QName: xp.doctype.sysid.intsubset.2.test
6947     @@@DEnt:
6948     @@@@test:value:
6949     <!DOCTYPE a SYSTEM "sysid" []>
6950     <a/>
6951     @@@test:domTree:
6952     document {
6953     document-type {
6954     node-name: 'a';
6955     public-id: null;
6956     system-id: 'sysid';
6957     }
6958     element { }
6959     }
6960     @@XMLTest:
6961     @@@QName: xp.doctype.sysid.intsubset.3.test
6962     @@@DEnt:
6963     @@@@test:value:
6964     <!DOCTYPE a SYSTEM 'sysid'[]>
6965     <a/>
6966     @@@test:domTree:
6967     document {
6968     document-type {
6969     node-name: 'a';
6970     public-id: null;
6971     system-id: 'sysid';
6972     }
6973     element { }
6974     }
6975     @@XMLTest:
6976     @@@QName: xp.doctype.sysid.intsubset.4.test
6977     @@@DEnt:
6978     @@@@test:value:
6979     <!DOCTYPE a SYSTEM 'sysid' []>
6980     <a/>
6981     @@@test:domTree:
6982     document {
6983     document-type {
6984     node-name: 'a';
6985     public-id: null;
6986     system-id: 'sysid';
6987     }
6988     element { }
6989     }
6990     @@XMLTest:
6991     @@@QName: xp.doctype.public.stago.test
6992     @@@DEnt:
6993     @@@@test:value:
6994     <!DOCTYPE a PUBLIC<a/>
6995     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 19); }
6996     @@XMLTest:
6997     @@@QName: xp.doctype.public.mdc.test
6998     @@@DEnt:
6999     @@@@test:value:
7000     <!DOCTYPE a PUBLIC>
7001     <a/>
7002     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 19); }
7003     @@XMLTest:
7004     @@@QName: xp.doctype.public.s.stago.test
7005     @@@DEnt:
7006     @@@@test:value:
7007     <!DOCTYPE a PUBLIC <a/>
7008     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 20); }
7009     @@XMLTest:
7010     @@@QName: xp.doctype.public.s.mdc.test
7011     @@@DEnt:
7012     @@@@test:value:
7013     <!DOCTYPE a PUBLIC >
7014     <a/>
7015     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 20); }
7016     @@XMLTest:
7017     @@@QName: xp.doctype.public.lit.test
7018     @@@DEnt:
7019     @@@@test:value:
7020     <!DOCTYPE a PUBLIC"p" "s">
7021     <a/>
7022     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 19); }
7023     @@XMLTest:
7024     @@@QName: xp.doctype.public.lita.test
7025     @@@DEnt:
7026     @@@@test:value:
7027     <!DOCTYPE a PUBLIC'p' "s">
7028     <a/>
7029     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 19); }
7030     @@XMLTest:
7031     @@@QName: xp.doctype.pubid.lit.lita.unmatched.1.test
7032     @@@DEnt:
7033     @@@@test:value:
7034     <!DOCTYPE a PUBLIC "p' "s">
7035     <a/>
7036     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 25); }
7037     @@XMLTest:
7038     @@@QName: xp.doctype.pubid.lit.lita.unmatched.2.test
7039     @@@DEnt:
7040     @@@@test:value:
7041     <!DOCTYPE a PUBLIC "p' 's'><a/>
7042     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 32); }
7043     @@XMLTest:
7044     @@@QName: xp.doctype.pubid.lita.lit.unmatched.1.test
7045     @@@DEnt:
7046     @@@@test:value:
7047     <!DOCTYPE a PUBLIC 'p" "s"><a/>
7048     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 32); }
7049     @@XMLTest:
7050     @@@QName: xp.doctype.pubid.lita.lit.unmatched.2.test
7051     @@@DEnt:
7052     @@@@test:value:
7053     <!DOCTYPE a PUBLIC 'p" 's'>
7054     <a/>
7055     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 21)..(1, 25); }
7056     @@XMLTest:
7057     @@@QName: xp.doctype.public.s.lit.mdc.test
7058     @@@DEnt:
7059     @@@@test:value:
7060     <!DOCTYPE a PUBLIC "><a/>
7061     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 26); }
7062     @@XMLTest:
7063     @@@QName: xp.doctype.public.s.lita.mdc.test
7064     @@@DEnt:
7065     @@@@test:value:
7066     <!DOCTYPE a PUBLIC '><a/>
7067     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 26); }
7068     @@XMLTest:
7069     @@@QName: xp.doctype.public.lit.pubid.lit.mdc.test
7070     @@@DEnt:
7071     @@@@test:value:
7072     <!DOCTYPE a PUBLIC "p">
7073     <a/>
7074     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 23); }
7075     @@XMLTest:
7076     @@@QName: xp.doctype.public.lita.pubid.lita.mdc.test
7077     @@@DEnt:
7078     @@@@test:value:
7079     <!DOCTYPE a PUBLIC 'p'>
7080     <a/>
7081     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 23); }
7082     @@XMLTest:
7083     @@@QName: xp.doctype.public.lit.pubid.lit.s.mdc.test
7084     @@@DEnt:
7085     @@@@test:value:
7086     <!DOCTYPE a PUBLIC "p" >
7087     <a/>
7088     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 24); }
7089     @@XMLTest:
7090     @@@QName: xp.doctype.public.lita.pubid.lita.s.mdc.test
7091     @@@DEnt:
7092     @@@@test:value:
7093     <!DOCTYPE a PUBLIC 'p' >
7094     <a/>
7095     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 24); }
7096     @@XMLTest:
7097     @@@QName: xp.doctype.public.lit.pubid.lit.s.lit.mdc.test
7098     @@@DEnt:
7099     @@@@test:value:
7100     <!DOCTYPE a PUBLIC "p" "><a/>
7101     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 30); }
7102     @@XMLTest:
7103     @@@QName: xp.doctype.public.lit.pubid.lit.s.lita.mdc.test
7104     @@@DEnt:
7105     @@@@test:value:
7106     <!DOCTYPE a PUBLIC "p" '><a/>
7107     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 30); }
7108     @@XMLTest:
7109     @@@QName: xp.doctype.public.lita.pubid.lita.s.lit.mdc.test
7110     @@@DEnt:
7111     @@@@test:value:
7112     <!DOCTYPE a PUBLIC 'p' "><a/>
7113     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 30); }
7114     @@XMLTest:
7115     @@@QName: xp.doctype.public.lita.pubid.lita.s.lita.mdc.test
7116     @@@DEnt:
7117     @@@@test:value:
7118     <!DOCTYPE a PUBLIC 'p' '><a/>
7119     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 30); }
7120     @@XMLTest:
7121     @@@QName: xp.doctype.public.lit.pubid.lit.lit.lita.unmatched.mdc.test
7122     @@@DEnt:
7123     @@@@test:value:
7124     <!DOCTYPE a PUBLIC "p" "s'><a/>
7125     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 32); }
7126     @@XMLTest:
7127     @@@QName: xp.doctype.public.lita.pubid.lita.lita.lit.unmatched.mdc.test
7128     @@@DEnt:
7129     @@@@test:value:
7130     <!DOCTYPE a PUBLIC 'p' 's"><a/>
7131     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 32); }
7132     @@XMLTest:
7133     @@@QName: xp.doctype.pubid.sysid.stago.1.test
7134     @@@DEnt:
7135     @@@@test:value:
7136     <!DOCTYPE a PUBLIC "p" "s"<a/>
7137     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 27); }
7138     @@XMLTest:
7139     @@@QName: xp.doctype.pubid.sysid.stago.2.test
7140     @@@DEnt:
7141     @@@@test:value:
7142     <!DOCTYPE a PUBLIC "p" 's'<a/>
7143     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 27); }
7144     @@XMLTest:
7145     @@@QName: xp.doctype.pubid.sysid.stago.s.1.test
7146     @@@DEnt:
7147     @@@@test:value:
7148     <!DOCTYPE a PUBLIC "p" "s" <a/>
7149     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 28); }
7150     @@XMLTest:
7151     @@@QName: xp.doctype.pubid.sysid.stago.s.2.test
7152     @@@DEnt:
7153     @@@@test:value:
7154     <!DOCTYPE a PUBLIC "p" 's' <a/>
7155     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 28); }
7156 wakaba 1.16
7157     @@XMLTest:
7158     @@@QName: xp.endofline.1.0.crlf.test
7159     @@@DEnt:
7160     @@@@test:value:
7161     <?xml version="1.0"?>
7162     <p>aaa$u000D$u000Abbb</p>
7163 wakaba 1.6 @@@test:domTree:
7164     document {
7165     xml-version: '1.0';
7166 wakaba 1.16 element {
7167     text-content: 'aaa' U+000A 'bbb';
7168 wakaba 1.6 }
7169 wakaba 1.16 }
7170     @@XMLTest:
7171     @@@QName: xp.endofline.1.1.crlf.test
7172     @@@DEnt:
7173     @@@@test:value:
7174     <?xml version="1.1"?>
7175     <p>aaa$u000D$u000Abbb</p>
7176     @@@test:domTree:
7177     document {
7178     xml-version: '1.1';
7179 wakaba 1.6 element {
7180 wakaba 1.16 text-content: 'aaa' U+000A 'bbb';
7181 wakaba 1.6 }
7182     }
7183     @@XMLTest:
7184 wakaba 1.16 @@@QName: xp.endofline.1.0.crnl.test
7185 wakaba 1.6 @@@DEnt:
7186     @@@@test:value:
7187 wakaba 1.16 <?xml version="1.0"?>
7188     <p>aaa$u000D$u0085bbb</p>
7189 wakaba 1.6 @@@test:domTree:
7190     document {
7191     xml-version: '1.0';
7192 wakaba 1.16 element {
7193     text-content: 'aaa' U+000A U+0085 'bbb';
7194 wakaba 1.6 }
7195 wakaba 1.16 }
7196     @@XMLTest:
7197     @@@QName: xp.endofline.1.1.crnl.test
7198     @@@DEnt:
7199     @@@@test:value:
7200     <?xml version="1.1"?>
7201     <p>aaa$u000D$u0085bbb</p>
7202     @@@test:domTree:
7203     document {
7204     xml-version: '1.1';
7205 wakaba 1.6 element {
7206 wakaba 1.16 text-content: 'aaa' U+000A 'bbb';
7207 wakaba 1.6 }
7208     }
7209     @@XMLTest:
7210 wakaba 1.16 @@@QName: xp.endofline.1.0.nl.test
7211 wakaba 1.6 @@@DEnt:
7212     @@@@test:value:
7213 wakaba 1.16 <?xml version="1.0"?>
7214     <p>aaa$u0085bbb</p>
7215 wakaba 1.6 @@@test:domTree:
7216     document {
7217     xml-version: '1.0';
7218     element {
7219 wakaba 1.16 text-content: 'aaa' U+0085 'bbb';
7220 wakaba 1.6 }
7221     }
7222     @@XMLTest:
7223 wakaba 1.16 @@@QName: xp.endofline.1.1.nl.test
7224 wakaba 1.6 @@@DEnt:
7225     @@@@test:value:
7226 wakaba 1.16 <?xml version="1.1"?>
7227     <p>aaa$u0085bbb</p>
7228     @@@test:domTree:
7229     document {
7230     xml-version: '1.1';
7231     element {
7232     text-content: 'aaa' U+000A 'bbb';
7233     }
7234     }
7235     @@XMLTest:
7236     @@@QName: xp.endofline.1.0.ls.test
7237     @@@DEnt:
7238     @@@@test:value:
7239     <?xml version="1.0"?>
7240     <p>aaa$u2028bbb</p>
7241     @@@test:domTree:
7242     document {
7243     xml-version: '1.0';
7244     element {
7245     text-content: 'aaa' U+2028 'bbb';
7246     }
7247     }
7248     @@XMLTest:
7249     @@@QName: xp.endofline.1.1.ls.test
7250     @@@DEnt:
7251     @@@@test:value:
7252     <?xml version="1.1"?>
7253     <p>aaa$u2028bbb</p>
7254     @@@test:domTree:
7255     document {
7256     xml-version: '1.1';
7257     element {
7258     text-content: 'aaa' U+000A 'bbb';
7259     }
7260     }
7261     @@XMLTest:
7262     @@@QName: xp.endofline.1.0.cr.test
7263     @@@DEnt:
7264     @@@@test:value:
7265     <?xml version="1.0"?>
7266     <p>aaa$u000Dbbb</p>
7267     @@@test:domTree:
7268     document {
7269     xml-version: '1.0';
7270     element {
7271     text-content: 'aaa' U+000A 'bbb';
7272     }
7273     }
7274     @@XMLTest:
7275     @@@QName: xp.endofline.1.1.cr.test
7276     @@@DEnt:
7277     @@@@test:value:
7278     <?xml version="1.1"?>
7279     <p>aaa$u000Dbbb</p>
7280     @@@test:domTree:
7281     document {
7282     xml-version: '1.1';
7283     element {
7284     text-content: 'aaa' U+000A 'bbb';
7285     }
7286     }
7287     @@XMLTest:
7288     @@@QName: xp.endofline.1.0.lf.test
7289     @@@DEnt:
7290     @@@@test:value:
7291     <?xml version="1.0"?>
7292     <p>aaa$u000Abbb</p>
7293     @@@test:domTree:
7294     document {
7295     xml-version: '1.0';
7296     element {
7297     text-content: 'aaa' U+000A 'bbb';
7298     }
7299     }
7300     @@XMLTest:
7301     @@@QName: xp.endofline.1.1.lf.test
7302     @@@DEnt:
7303     @@@@test:value:
7304     <?xml version="1.1"?>
7305     <p>aaa$u000Abbb</p>
7306     @@@test:domTree:
7307     document {
7308     xml-version: '1.1';
7309     element {
7310     text-content: 'aaa' U+000A 'bbb';
7311     }
7312     }
7313     @@XMLTest:
7314     @@@QName: xp.xml10.endofline.nl.in.xmldecl.1.test
7315     @@@DEnt:
7316     @@@@test:value:
7317     <?xml$u0085version="1.0"?>
7318     <p/>
7319     @@@c:erred:
7320     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 6)..(2, 0); }
7321     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7322     @@XMLTest:
7323     @@@QName: xp.xml11.endofline.nl.in.xmldecl.1.test
7324     @@@DEnt:
7325     @@@@test:value:
7326     <?xml$u0085version="1.1"?>
7327     (err)<p/>
7328     @@@c:erred:
7329     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 6)..(2, 0); }
7330     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7331     @@XMLTest:
7332     @@@QName: xp.xml10.endofline.crnl.in.xmldecl.1.test
7333     @@@DEnt:
7334     @@@@test:value:
7335     <?xml$u000D$u0085version="1.0"?>
7336     <p/>
7337     @@@c:erred:
7338     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 6)..(2, 0); }
7339     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7340     @@XMLTest:
7341     @@@QName: xp.xml11.endofline.crnl.in.xmldecl.1.test
7342     @@@DEnt:
7343     @@@@test:value:
7344     <?xml$u000D$u0085version="1.1"?>
7345     (err)<p/>
7346     @@@c:erred:
7347     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 6)..(2, 0); }
7348     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7349     @@XMLTest:
7350     @@@QName: xp.xml10.endofline.ls.in.xmldecl.1.test
7351     @@@DEnt:
7352     @@@@test:value:
7353     <?xml$u2028version="1.0"?>
7354     <p/>
7355     @@@c:erred:
7356     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 6)..(2, 0); }
7357     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7358     @@XMLTest:
7359     @@@QName: xp.xml11.endofline.ls.in.xmldecl.1.test
7360     @@@DEnt:
7361     @@@@test:value:
7362     <?xml$u2028version="1.1"?>
7363     (err)<p/>
7364     @@@c:erred:
7365     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 6)..(2, 0); }
7366     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7367     @@XMLTest:
7368     @@@QName: xp.xml10.endofline.nl.in.xmldecl.2.test
7369     @@@DEnt:
7370     @@@@test:value:
7371     <?xml version="1.0"$u0085?>
7372     <p/>
7373     @@@c:erred:
7374     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 20)..(2, 0); }
7375     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7376     @@XMLTest:
7377     @@@QName: xp.xml11.endofline.nl.in.xmldecl.2.test
7378     @@@DEnt:
7379     @@@@test:value:
7380     <?xml version="1.1"$u0085?>
7381     (err)<p/>
7382     @@@c:erred:
7383     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 20)..(2, 0); }
7384     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7385     @@XMLTest:
7386     @@@QName: xp.xml10.endofline.crnl.in.xmldecl.2.test
7387     @@@DEnt:
7388     @@@@test:value:
7389     <?xml version="1.0"$u000D$u0085?>
7390     <p/>
7391     @@@c:erred:
7392     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 20)..(2, 0); }
7393     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7394     @@XMLTest:
7395     @@@QName: xp.xml11.endofline.crnl.in.xmldecl.2.test
7396     @@@DEnt:
7397     @@@@test:value:
7398     <?xml version="1.1"$u000D$u0085?>
7399     (err)<p/>
7400     @@@c:erred:
7401     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 20)..(2, 0); }
7402     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7403     @@XMLTest:
7404     @@@QName: xp.xml10.endofline.ls.in.xmldecl.2.test
7405     @@@DEnt:
7406     @@@@test:value:
7407     <?xml version="1.0"$u2028?>
7408     <p/>
7409     @@@c:erred:
7410     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 20)..(2, 0); }
7411     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7412     @@XMLTest:
7413     @@@QName: xp.xml11.endofline.ls.in.xmldecl.2.test
7414     @@@DEnt:
7415     @@@@test:value:
7416     <?xml version="1.1"$u2028?>
7417     (err)<p/>
7418     @@@c:erred:
7419     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 20)..(2, 0); }
7420     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7421     @@XMLTest:
7422     @@@QName: xp.xml10.endofline.nl.in.xmldecl.3.test
7423     @@@DEnt:
7424     @@@@test:value:
7425     <?xml $u0085version="1.0"?>
7426     <p/>
7427     @@@c:erred:
7428     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 7)..(2, 0); }
7429     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7430     @@XMLTest:
7431     @@@QName: xp.xml11.endofline.nl.in.xmldecl.3.test
7432     @@@DEnt:
7433     @@@@test:value:
7434     <?xml $u0085version="1.1"?>
7435     (err)<p/>
7436     @@@c:erred:
7437     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 7)..(2, 0); }
7438     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7439     @@XMLTest:
7440     @@@QName: xp.xml10.endofline.crnl.in.xmldecl.3.test
7441     @@@DEnt:
7442     @@@@test:value:
7443     <?xml $u000D$u0085version="1.0"?>
7444     <p/>
7445     @@@c:erred:
7446     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 7)..(2, 0); }
7447     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7448     @@XMLTest:
7449     @@@QName: xp.xml11.endofline.crnl.in.xmldecl.3.test
7450     @@@DEnt:
7451     @@@@test:value:
7452     <?xml $u000D$u0085version="1.1"?>
7453     (err)<p/>
7454     @@@c:erred:
7455     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 7)..(2, 0); }
7456     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7457     @@XMLTest:
7458     @@@QName: xp.xml10.endofline.ls.in.xmldecl.3.test
7459     @@@DEnt:
7460     @@@@test:value:
7461     <?xml $u2028version="1.0"?>
7462     <p/>
7463     @@@c:erred:
7464     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 7)..(2, 0); }
7465     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7466     @@XMLTest:
7467     @@@QName: xp.xml11.endofline.ls.in.xmldecl.3.test
7468     @@@DEnt:
7469     @@@@test:value:
7470     <?xml $u2028version="1.1"?>
7471     (err)<p/>
7472     @@@c:erred:
7473     <[[xp|fatal-xml11-end-of-line-in-xml-declaration]]> { (1, 7)..(2, 0); }
7474     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7475     @@XMLTest:
7476     @@@QName: xp.xml10implied.endofline.nl.in.pi.1.test
7477     @@@DEnt:
7478     @@@@test:value:
7479     <?xml-$u0085?>
7480     <p/>
7481     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 7)..(2, 0); }
7482     @@XMLTest:
7483     @@@QName: xp.xml10.endofline.nl.in.pi.1.test
7484     @@@DEnt:
7485     @@@@test:value:
7486     <?xml version="1.0"?>
7487     <?xml-$u0085?>
7488     <p/>
7489     @@@c:erred: <[[xp|wf-syntax-error]]> { (2, 7)..(3, 0); }
7490     @@XMLTest:
7491     @@@QName: xp.xml11.endofline.nl.in.pi.1.test
7492     @@@DEnt:
7493     @@@@test:value:
7494     <?xml version="1.1"?>
7495     <?xml-$u0085?>
7496     <p/>
7497     @@@test:domTree:
7498     document {
7499     xml-version: '1.1';
7500     pi {
7501     node-name: 'xml-';
7502     node-value: '';
7503     }
7504     element { }
7505     }
7506     @@XMLTest:
7507     @@@QName: xp.xml10implied.endofline.crnl.in.pi.1.test
7508     @@@DEnt:
7509     @@@@test:value:
7510     <?xml-$u000D$u0085?>
7511     <p/>
7512     @@@test:domTree:
7513     document {
7514     xml-version: '1.0';
7515     pi {
7516     node-name: 'xml-';
7517     node-value: U+0085;
7518     }
7519     element { }
7520     }
7521     @@XMLTest:
7522     @@@QName: xp.xml10.endofline.crnl.in.pi.1.test
7523     @@@DEnt:
7524     @@@@test:value:
7525     <?xml version="1.0"?>
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.xml11.endofline.crnl.in.pi.1.test
7539     @@@DEnt:
7540     @@@@test:value:
7541     <?xml version="1.1"?>
7542     <?xml-$u000D$u0085?>
7543     <p/>
7544     @@@test:domTree:
7545     document {
7546     xml-version: '1.1';
7547     pi {
7548     node-name: 'xml-';
7549     node-value: '';
7550     }
7551     element { }
7552     }
7553     @@XMLTest:
7554     @@@QName: xp.xml10implied.endofline.ls.in.pi.1.test
7555     @@@DEnt:
7556     @@@@test:value:
7557     <?xml-$u2028?>
7558     <p/>
7559     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 7)..(2, 0); }
7560     @@XMLTest:
7561     @@@QName: xp.xml10.endofline.ls.in.pi.1.test
7562     @@@DEnt:
7563     @@@@test:value:
7564     <?xml version="1.0"?>
7565     <?xml-$u2028?>
7566     <p/>
7567     @@@c:erred: <[[xp|wf-syntax-error]]> { (2, 7)..(3, 0); }
7568     @@XMLTest:
7569     @@@QName: xp.xml11.endofline.ls.in.pi.1.test
7570     @@@DEnt:
7571     @@@@test:value:
7572     <?xml version="1.1"?>
7573     <?xml-$u2028?>
7574     <p/>
7575     @@@test:domTree:
7576     document {
7577     xml-version: '1.1';
7578     pi {
7579     node-name: 'xml-';
7580     node-value: '';
7581     }
7582     element { }
7583     }
7584 wakaba 1.27
7585     @@XMLTest:
7586     @@@QName: xp.xml10.endofline.internal.1.test
7587     @@@DEnt:
7588     @@@@test:value:
7589     <?xml version="1.0"?>
7590     <!DOCTYPE a [
7591     <!ENTITY e "&#x000D; &#x000A; &#x0085; &#x000D;&#x000A; $
7592     &#x000D;&#x0085; &#x2028;">
7593     ]><a>&e;</a>
7594 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
7595 wakaba 1.27 @@@test:domTree:
7596     document {
7597     xml-version: '1.0';
7598     document-type {
7599     general-entity {
7600     node-name: 'e';
7601     text-content: U+000D ' ' U+000A ' ' U+0085 ' '
7602     U+000D U+000A ' ' U+000D U+0085 ' ' U+2028;
7603     }
7604     }
7605     element {
7606     text-content: U+000D ' ' U+000A ' ' U+0085 ' '
7607     U+000D U+000A ' ' U+000D U+0085 ' ' U+2028;
7608     }
7609     }
7610     @@XMLTest:
7611     @@@QName: xp.xml11.endofline.internal.1.test
7612     @@@DEnt:
7613     @@@@test:value:
7614     <?xml version="1.1"?>
7615     <!DOCTYPE a [
7616     <!ENTITY e "&#x000D; &#x000A; &#x0085; &#x000D;&#x000A; $
7617     &#x000D;&#x0085; &#x2028;">
7618     ]><a>&e;</a>
7619 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
7620 wakaba 1.27 @@@test:domTree:
7621     document {
7622     xml-version: '1.1';
7623     document-type {
7624     general-entity {
7625     node-name: 'e';
7626     text-content: U+000D ' ' U+000A ' ' U+0085 ' '
7627     U+000D U+000A ' ' U+000D U+0085 ' ' U+2028;
7628     }
7629     }
7630     element {
7631     text-content: U+000D ' ' U+000A ' ' U+0085 ' '
7632     U+000D U+000A ' ' U+000D U+0085 ' ' U+2028;
7633     }
7634     }
7635    
7636 wakaba 1.16 @@XMLTest:
7637     @@@QName: xp.noxmldecl.pi.pi.test
7638     @@@DEnt:
7639     @@@@test:value:
7640     <?noxml 1?><?noxml 2?><p/>
7641     @@@test:domTree:
7642     document {
7643     xml-version: '1.0';
7644     pi {
7645     node-name: 'noxml';
7646     node-value: '1';
7647     }
7648     pi {
7649     node-name: 'noxml';
7650     node-value: '2';
7651     }
7652     element { }
7653     }
7654     @@XMLTest:
7655     @@@QName: xp.noxmldecl.pi.pi.2.test
7656     @@@DEnt:
7657     @@@@test:value:
7658     <?xmlno 1?><?xmlno 2?><p/>
7659     @@@test:domTree:
7660     document {
7661     xml-version: '1.0';
7662     pi {
7663     node-name: 'xmlno';
7664     node-value: '1';
7665     }
7666     pi {
7667     node-name: 'xmlno';
7668     node-value: '2';
7669     }
7670     element { }
7671     }
7672     @@XMLTest:
7673     @@@QName: xp.noxmldecl.pi.pi.3.test
7674     @@@DEnt:
7675     @@@@test:value:
7676     <?xmln 1?><?xmln 2?><p/>
7677     @@@test:domTree:
7678     document {
7679     xml-version: '1.0';
7680     pi {
7681     node-name: 'xmln';
7682     node-value: '1';
7683     }
7684     pi {
7685     node-name: 'xmln';
7686     node-value: '2';
7687     }
7688     element { }
7689     }
7690     @@XMLTest:
7691     @@@QName: xp.noxml.s.nl.test
7692     @@@DEnt:
7693     @@@@test:value:
7694     $u0085<p/>
7695     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 1)..(2, 0); }
7696     @@XMLTest:
7697     @@@QName: xp.noxml.s.crnl.test
7698     @@@DEnt:
7699     @@@@test:value:
7700     $u000D$u0085<p/>
7701     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 1)..(2, 0); }
7702     @@XMLTest:
7703     @@@QName: xp.noxml.s.ls.test
7704     @@@DEnt:
7705     @@@@test:value:
7706     $u2028<p/>
7707     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 1)..(2, 0); }
7708     @@XMLTest:
7709     @@@QName: xp.xml10.decl.s.nl.test
7710     @@@DEnt:
7711     @@@@test:value:
7712     <?xml version="1.0"?>$u0085<p/>
7713     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 22)..(2, 0); }
7714     @@XMLTest:
7715     @@@QName: xp.xml10.decl.s.crnl.test
7716     @@@DEnt:
7717     @@@@test:value:
7718     <?xml version="1.0"?>$u000D$u0085<p/>
7719     @@@c:erred: <[[xp|wf-syntax-error]]> { (2, 0)..(3, 0); }
7720     @@XMLTest:
7721     @@@QName: xp.xml10.decl.s.ls.test
7722     @@@DEnt:
7723     @@@@test:value:
7724     <?xml version="1.0"?>$u2028<p/>
7725     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 22)..(2, 0); }
7726     @@XMLTest:
7727     @@@QName: xp.xml11.decl.s.nl.test
7728     @@@DEnt:
7729     @@@@test:value:
7730     <?xml version="1.1"?>$u0085<p/>
7731     @@@test:domTree:
7732     document {
7733     xml-version: '1.1';
7734     element { }
7735     }
7736     @@XMLTest:
7737     @@@QName: xp.xml11.decl.s.crnl.test
7738     @@@DEnt:
7739     @@@@test:value:
7740     <?xml version="1.1"?>$u000D$u0085<p/>
7741     @@@test:domTree:
7742     document {
7743     xml-version: '1.1';
7744     element { }
7745     }
7746     @@XMLTest:
7747     @@@QName: xp.xml11.decl.s.ls.test
7748     @@@DEnt:
7749     @@@@test:value:
7750     <?xml version="1.1"?>$u2028<p/>
7751     @@@test:domTree:
7752     document {
7753     xml-version: '1.1';
7754     element { }
7755     }
7756    
7757     @@XMLTest:
7758 wakaba 1.18 @@@QName: xp.element.type.match.1.test
7759     @@@DEnt:
7760     @@@@test:value:
7761     <p></pa>(err)
7762     @@@c:erred: <[[xp|wf-element-type-match]]> { (1, 4)..(1, 8); }
7763     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7764     @@XMLTest:
7765     @@@QName: xp.element.type.match.2.test
7766     @@@DEnt:
7767     @@@@test:value:
7768     <p><pa></pa></pa>(err)
7769     @@@c:erred: <[[xp|wf-element-type-match]]> { (1, 13)..(1, 17); }
7770     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7771     @@XMLTest:
7772     @@@QName: xp.element.type.match.3.test
7773     @@@DEnt:
7774     @@@@test:value:
7775     <p><pa></p></p>(err)
7776     @@@c:erred: <[[xp|wf-element-type-match]]> { (1, 8)..(1, 11); }
7777     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7778     @@XMLTest:
7779     @@@QName: xp.element.type.match.4.test
7780     @@@DEnt:
7781     @@@@test:value:
7782     <a:p xmlns:a="about:1"></p>(err)
7783     @@@c:erred: <[[xp|wf-element-type-match]]> { (1, 24)..(1, 27); }
7784     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7785     @@XMLTest:
7786     @@@QName: xp.element.type.match.5.test
7787     @@@DEnt:
7788     @@@@test:value:
7789     <a:p xmlns:a="about:1" xmlns:b="about:1"></b:p>(err)
7790     @@@c:erred: <[[xp|wf-element-type-match]]> { (1, 42)..(1, 47); }
7791     @@@c:erred: <[[xp|wf-syntax-error]]> { }
7792    
7793     @@XMLTest:
7794     @@@QName: xp.stag.stago.name.etago.test
7795     @@@DEnt:
7796     @@@@test:value:
7797     <a</a>
7798     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 3); }
7799     @@XMLTest:
7800     @@@QName: xp.stag.stago.name.s.etago.test
7801     @@@DEnt:
7802     @@@@test:value:
7803     <a </a>
7804     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 4); }
7805     @@XMLTest:
7806     @@@QName: xp.stag.stago.name.s.attr.etago.test
7807     @@@DEnt:
7808     @@@@test:value:
7809     <a a="b"</a>
7810     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 9); }
7811     @@XMLTest:
7812     @@@QName: xp.stag.stago.name.s.attr.s.attr.etago.test
7813     @@@DEnt:
7814     @@@@test:value:
7815     <a a="b" c="d"</a>
7816     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 15); }
7817     @@XMLTest:
7818     @@@QName: xp.stag.stago.name.s.attr.s.etago.test
7819     @@@DEnt:
7820     @@@@test:value:
7821     <a a="b" </a>
7822     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 10); }
7823     @@XMLTest:
7824     @@@QName: xp.stag.etag.1.test
7825 wakaba 1.16 @@@DEnt:
7826     @@@@test:value:
7827 wakaba 1.18 <root><a></a></root>
7828 wakaba 1.16 @@@test:domTree:
7829     document {
7830 wakaba 1.18 element {
7831     element {
7832     node-name: 'a';
7833 wakaba 1.16 }
7834     }
7835 wakaba 1.18 }
7836     @@XMLTest:
7837     @@@QName: xp.stag.etag.2.test
7838     @@@DEnt:
7839     @@@@test:value:
7840     <root><ab></ab></root>
7841     @@@test:domTree:
7842     document {
7843 wakaba 1.16 element {
7844 wakaba 1.18 element {
7845     node-name: 'ab';
7846     }
7847 wakaba 1.16 }
7848 wakaba 1.18 }
7849 wakaba 1.16 @@XMLTest:
7850 wakaba 1.18 @@@QName: xp.stag.etag.s.1.test
7851 wakaba 1.16 @@@DEnt:
7852     @@@@test:value:
7853 wakaba 1.18 <root><a ></a ></root>
7854 wakaba 1.16 @@@test:domTree:
7855     document {
7856 wakaba 1.18 element {
7857     element {
7858     node-name: 'a';
7859 wakaba 1.16 }
7860     }
7861 wakaba 1.18 }
7862     @@XMLTest:
7863     @@@QName: xp.etag.1.test
7864     @@@DEnt:
7865     @@@@test:value:
7866     <root><a/></root>
7867     @@@test:domTree:
7868     document {
7869 wakaba 1.16 element {
7870 wakaba 1.18 element {
7871     node-name: 'a';
7872     }
7873 wakaba 1.16 }
7874 wakaba 1.18 }
7875 wakaba 1.16 @@XMLTest:
7876 wakaba 1.18 @@@QName: xp.etag.2.test
7877 wakaba 1.16 @@@DEnt:
7878     @@@@test:value:
7879 wakaba 1.18 <root><a /></root>
7880 wakaba 1.16 @@@test:domTree:
7881     document {
7882     element {
7883 wakaba 1.18 element {
7884     node-name: 'a';
7885     }
7886 wakaba 1.16 }
7887 wakaba 1.18 }
7888 wakaba 1.16 @@XMLTest:
7889 wakaba 1.18 @@@QName: xp.stag.etag.attr.1.test
7890 wakaba 1.16 @@@DEnt:
7891     @@@@test:value:
7892 wakaba 1.18 <root><a at="v"></a></root>
7893 wakaba 1.16 @@@test:domTree:
7894     document {
7895 wakaba 1.18 element {
7896     element {
7897     node-name: 'a';
7898     attribute {
7899     node-name: 'at';
7900     value: 'v';
7901     }
7902 wakaba 1.16 }
7903     }
7904 wakaba 1.18 }
7905     @@XMLTest:
7906     @@@QName: xp.stag.etag.attr.2.test
7907     @@@DEnt:
7908     @@@@test:value:
7909     <root><a at="v" ></a></root>
7910     @@@test:domTree:
7911     document {
7912 wakaba 1.16 element {
7913 wakaba 1.18 element {
7914     node-name: 'a';
7915     attribute {
7916     node-name: 'at';
7917     value: 'v';
7918 wakaba 1.16 }
7919     }
7920     }
7921 wakaba 1.18 }
7922 wakaba 1.16 @@XMLTest:
7923 wakaba 1.18 @@@QName: xp.stag.etag.attr.3.test
7924 wakaba 1.16 @@@DEnt:
7925     @@@@test:value:
7926 wakaba 1.18 <root><a at ="v"></a></root>
7927 wakaba 1.16 @@@test:domTree:
7928     document {
7929 wakaba 1.18 element {
7930     element {
7931     node-name: 'a';
7932     attribute {
7933     node-name: 'at';
7934     value: 'v';
7935     }
7936 wakaba 1.16 }
7937     }
7938 wakaba 1.18 }
7939     @@XMLTest:
7940     @@@QName: xp.stag.etag.attr.4.test
7941     @@@DEnt:
7942     @@@@test:value:
7943     <root><a at= "v"></a></root>
7944     @@@test:domTree:
7945     document {
7946 wakaba 1.16 element {
7947 wakaba 1.18 element {
7948     node-name: 'a';
7949     attribute {
7950     node-name: 'at';
7951     value: 'v';
7952 wakaba 1.16 }
7953     }
7954 wakaba 1.18 }
7955     }
7956     @@XMLTest:
7957     @@@QName: xp.stag.etag.attr.5.test
7958     @@@DEnt:
7959     @@@@test:value:
7960     <root><a at='v'></a></root>
7961     @@@test:domTree:
7962     document {
7963     element {
7964     element {
7965     node-name: 'a';
7966     attribute {
7967     node-name: 'at';
7968     value: 'v';
7969 wakaba 1.16 }
7970     }
7971     }
7972 wakaba 1.18 }
7973 wakaba 1.16 @@XMLTest:
7974 wakaba 1.18 @@@QName: xp.stag.etag.attr.6.test
7975 wakaba 1.16 @@@DEnt:
7976     @@@@test:value:
7977 wakaba 1.18 <root><a at= 'v' ></a></root>
7978 wakaba 1.6 @@@test:domTree:
7979     document {
7980 wakaba 1.18 element {
7981     element {
7982     node-name: 'a';
7983     attribute {
7984     node-name: 'at';
7985     value: 'v';
7986     }
7987 wakaba 1.11 }
7988 wakaba 1.6 }
7989 wakaba 1.18 }
7990     @@XMLTest:
7991     @@@QName: xp.stag.etag.attr.attr.1.test
7992     @@@DEnt:
7993     @@@@test:value:
7994     <root><a at="v" tr="w"></a></root>
7995     @@@test:domTree:
7996     document {
7997 wakaba 1.6 element {
7998 wakaba 1.18 element {
7999     node-name: 'a';
8000     attribute {
8001     node-name: 'at';
8002     value: 'v';
8003 wakaba 1.6 }
8004 wakaba 1.18 attribute {
8005     node-name: 'tr';
8006     value: 'w';
8007 wakaba 1.6 }
8008     }
8009     }
8010 wakaba 1.18 }
8011 wakaba 1.6 @@XMLTest:
8012 wakaba 1.18 @@@QName: xp.stag.etag.attr.attr.2.test
8013 wakaba 1.6 @@@DEnt:
8014     @@@@test:value:
8015 wakaba 1.18 <root><a tr="w" at="v"></a></root>
8016 wakaba 1.6 @@@test:domTree:
8017     document {
8018 wakaba 1.18 element {
8019     element {
8020     node-name: 'a';
8021     attribute {
8022     node-name: 'at';
8023     value: 'v';
8024     }
8025     attribute {
8026     node-name: 'tr';
8027     value: 'w';
8028 wakaba 1.11 }
8029     }
8030 wakaba 1.6 }
8031 wakaba 1.18 }
8032     @@XMLTest:
8033     @@@QName: xp.stag.etag.attr.no.s.attr.test
8034     @@@DEnt:
8035     @@@@test:value:
8036     <root><a at="v"tr="w"></a></root>
8037     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 16)..(1, 17); }
8038     @@XMLTest:
8039     @@@QName: xp.etag.attr.1.test
8040     @@@DEnt:
8041     @@@@test:value:
8042     <root><a at="v" tr="w"></a b="c"></root>
8043     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 28); }
8044     @@XMLTest:
8045     @@@QName: xp.etag.no.etagc.1.test
8046     @@@DEnt:
8047     @@@@test:value:
8048     <root><a at="v" tr="w"></a</root>
8049     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 27)..(1, 28); }
8050     @@XMLTest:
8051     @@@QName: xp.etag.no.etagc.2.test
8052     @@@DEnt:
8053     @@@@test:value:
8054     <root><a at="v" tr="w"></a </root>
8055     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 29)..(1, 30); }
8056     @@XMLTest:
8057     @@@QName: xp.mtag.attr.1.test
8058     @@@DEnt:
8059     @@@@test:value:
8060     <root><a b="c"/></root>
8061     @@@test:domTree:
8062     document {
8063 wakaba 1.6 element {
8064 wakaba 1.18 element {
8065     node-name: 'a';
8066     attribute {
8067     node-name: 'b';
8068     value: 'c';
8069 wakaba 1.6 }
8070     }
8071 wakaba 1.8 }
8072 wakaba 1.18 }
8073 wakaba 1.11 @@XMLTest:
8074 wakaba 1.18 @@@QName: xp.mtag.attr.2.test
8075 wakaba 1.11 @@@DEnt:
8076     @@@@test:value:
8077 wakaba 1.18 <root><a b="c" /></root>
8078 wakaba 1.11 @@@test:domTree:
8079     document {
8080 wakaba 1.18 element {
8081     element {
8082     node-name: 'a';
8083     attribute {
8084     node-name: 'b';
8085     value: 'c';
8086     }
8087 wakaba 1.11 }
8088     }
8089 wakaba 1.18 }
8090 wakaba 1.11 @@XMLTest:
8091 wakaba 1.18 @@@QName: xp.mtag.attr.3.test
8092 wakaba 1.11 @@@DEnt:
8093     @@@@test:value:
8094 wakaba 1.18 <root><a b='c'/></root>
8095 wakaba 1.11 @@@test:domTree:
8096     document {
8097     element {
8098 wakaba 1.18 element {
8099     node-name: 'a';
8100     attribute {
8101     node-name: 'b';
8102     value: 'c';
8103     }
8104     }
8105 wakaba 1.11 }
8106 wakaba 1.18 }
8107 wakaba 1.11 @@XMLTest:
8108 wakaba 1.18 @@@QName: xp.mtag.attr.4.test
8109 wakaba 1.11 @@@DEnt:
8110     @@@@test:value:
8111 wakaba 1.18 <root><a b="c" d="e"/></root>
8112 wakaba 1.11 @@@test:domTree:
8113     document {
8114     element {
8115 wakaba 1.18 element {
8116     node-name: 'a';
8117     attribute {
8118     node-name: 'b';
8119     value: 'c';
8120     }
8121     attribute {
8122     node-name: 'd';
8123     value: 'e';
8124     }
8125 wakaba 1.11 }
8126     }
8127 wakaba 1.18 }
8128    
8129     @@XMLTest:
8130     @@@QName: xp.attvalue.lt.1.test
8131     @@@DEnt:
8132     @@@@test:value:
8133     <a b="aa<dd"/>
8134     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 9); }
8135     @@XMLTest:
8136     @@@QName: xp.attvalue.lt.2.test
8137     @@@DEnt:
8138     @@@@test:value:
8139     <a b='aa<dd'/>
8140     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 9); }
8141     @@XMLTest:
8142     @@@QName: xp.attvalue.amp.1.test
8143     @@@DEnt:
8144     @@@@test:value:
8145     <a b="aa& dd"/>
8146     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 9)..(1, 12); }
8147     @@XMLTest:
8148     @@@QName: xp.attvalue.amp.2.test
8149     @@@DEnt:
8150     @@@@test:value:
8151     <a b='aa& dd'/>
8152     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 9)..(1, 12); }
8153     @@XMLTest:
8154     @@@QName: xp.attvalue.amp.3.test
8155     @@@DEnt:
8156     @@@@test:value:
8157     <a b="aa&# dd"/>
8158     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 9)..(1, 13); }
8159     @@XMLTest:
8160     @@@QName: xp.attvalue.amp.4.test
8161     @@@DEnt:
8162     @@@@test:value:
8163     <a b="aa&#x dd"/>
8164     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 9)..(1, 14); }
8165    
8166     @@XMLTest:
8167     @@@QName: xp.unique.att.spec.1.test
8168     @@@DEnt:
8169     @@@@test:value:
8170     <a b="c" b="d"/>
8171     @@@c:erred: <[[xp|wf-unique-att-spec]]> { (1, 4)..(1, 14); }
8172     @@XMLTest:
8173     @@@QName: xp.unique.att.spec.2.test
8174     @@@DEnt:
8175     @@@@test:value:
8176     <a d:b="c" d:b="d" xmlns:d="about:2"/>
8177     @@@c:erred: <[[xp|wf-unique-att-spec]]> { (1, 4)..(1, 18); }
8178    
8179     @@XMLTest:
8180     @@@QName: xp.no.external.entity.references.1.test
8181     @@@DEnt:
8182     @@@@test:value:
8183     <!DOCTYPE a [
8184     <!ENTITY ent SYSTEM "something">
8185     ]>
8186     <a b="c&ent;"/>
8187     @@@c:erred: <[[xp|wf-no-external-entity-references]]> { (4, 8)..(4, 12); }
8188     @@XMLTest:
8189     @@@QName: xp.no.external.entity.references.2.test
8190     @@@DEnt:
8191     @@@@test:value:
8192     <!DOCTYPE a [
8193     <!NOTATION n SYSTEM "notation">
8194     <!ENTITY ent SYSTEM "something" NDATA n>
8195     ]>
8196     <a b="c&ent;"/>
8197     @@@c:erred: <[[xp|wf-no-external-entity-references]]> { (5, 8)..(5, 12); }
8198     @@XMLTest:
8199     @@@QName: xp.no.external.entity.references.3.test
8200     @@@DEnt:
8201     @@@@test:value:
8202     <!DOCTYPE a [
8203     <!ENTITY ent SYSTEM "something">
8204     <!ENTITY ent2 "ddd&ent;">
8205     ]>
8206     <a b="c&ent2;"/>
8207     @@@c:erred: <[[xp|wf-no-external-entity-references]]> { (1, 4)..(1, 8); }
8208     @@XMLTest:
8209     @@@QName: xp.no.external.entity.references.4.test
8210     @@@DEnt:
8211     @@@@test:value:
8212     <!DOCTYPE a [
8213     <!NOTATION n SYSTEM "notation">
8214     <!ENTITY ent SYSTEM "something" NDATA n>
8215     <!ENTITY ent2 "ddd&ent;">
8216     ]>
8217     <a b="c&ent2;"/>
8218 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
8219 wakaba 1.18 @@@c:erred: <[[xp|wf-no-external-entity-references]]> { (1, 4)..(1, 8); }
8220 wakaba 1.23 @@@c:erred: <[[xp|wf-parsed-entity]]> { }
8221 wakaba 1.18 @@XMLTest:
8222     @@@QName: xp.no.lt.in.attr.value.1.test
8223     @@@DEnt:
8224     @@@@test:value:
8225     <!DOCTYPE a [
8226     <!ENTITY ent "aa<bb">
8227     ]>
8228     <a b="c&ent;"/>
8229 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
8230 wakaba 1.18 @@@c:erred: <[[xp|wf-no-lt-in-attribute-values]]> { (1, 3); }
8231 wakaba 1.20 @@@c:erred:
8232     @@@@@: <[[xp|wf-syntax-error]]> { (1, 3)..(1, 6); }
8233     @@@@enImplNote: When entity node is created.
8234 wakaba 1.18 @@XMLTest:
8235 wakaba 1.34 @@@QName: xp.no.lt.in.attr.value.1.2.test
8236     @@@DEnt:
8237     @@@@test:value:
8238     <!DOCTYPE a [
8239     <!ENTITY ent "aa<bb">
8240     ]>
8241     <a b="c&ent;"/>
8242     @@@cfg:entity-replacement-tree: 0
8243     @@@c:erred: <[[xp|wf-no-lt-in-attribute-values]]> { (1, 3); }
8244     @@XMLTest:
8245 wakaba 1.18 @@@QName: xp.no.lt.in.attr.value.2.test
8246     @@@DEnt:
8247     @@@@test:value:
8248     <!DOCTYPE a [
8249     <!ENTITY ent "aa<bb">
8250     <!ENTITY ent2 "ccc&ent;">
8251     ]>
8252     <a b="c&ent2;"/>
8253 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
8254 wakaba 1.18 @@@c:erred: <[[xp|wf-no-lt-in-attribute-values]]> { (1, 3); }
8255 wakaba 1.20 @@@c:erred:
8256     @@@@@: <[[xp|wf-syntax-error]]> { (1, 3)..(1, 6); }
8257     @@@@enImplNote: When entity node is created.
8258 wakaba 1.18 @@XMLTest:
8259     @@@QName: xp.no.lt.in.attr.value.3.test
8260     @@@DEnt:
8261     @@@@test:value:
8262     <!DOCTYPE a [
8263     <!ENTITY ent "aa&#x3C;bb">
8264     ]>
8265     <a b="c&ent;"/>
8266 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
8267 wakaba 1.18 @@@c:erred: <[[xp|wf-no-lt-in-attribute-values]]> { (1, 3); }
8268 wakaba 1.20 @@@c:erred:
8269     @@@@@: <[[xp|wf-syntax-error]]> { (1, 3)..(1, 6); }
8270     @@@@enImplNote: When entity node is created.
8271 wakaba 1.18 @@XMLTest:
8272     @@@QName: xp.no.lt.in.attr.value.4.test
8273     @@@DEnt:
8274     @@@@test:value:
8275     <!DOCTYPE a [
8276     <!ENTITY ent "aa&#x3C;bb">
8277     <!ENTITY ent2 "ccc&ent;">
8278     ]>
8279     <a b="c&ent2;"/>
8280 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
8281 wakaba 1.18 @@@c:erred: <[[xp|wf-no-lt-in-attribute-values]]> { (1, 3); }
8282 wakaba 1.20 @@@c:erred:
8283     @@@@@: <[[xp|wf-syntax-error]]> { (1, 3)..(1, 6); }
8284     @@@@enImplNote: When entity node is created.
8285 wakaba 1.11 @@XMLTest:
8286 wakaba 1.18 @@@QName: xp.ger.lt.in.attr.value.1.test
8287 wakaba 1.11 @@@DEnt:
8288     @@@@test:value:
8289     <!DOCTYPE a [
8290 wakaba 1.18 <!ENTITY ent "aa&lt;bb">
8291 wakaba 1.11 ]>
8292 wakaba 1.18 <a b="c&ent;"/>
8293 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
8294 wakaba 1.11 @@@test:domTree:
8295     document {
8296     document-type {
8297     general-entity {
8298     node-name: 'ent';
8299 wakaba 1.18 text-content: 'aa<bb';
8300 wakaba 1.11 }
8301     }
8302     element {
8303 wakaba 1.18 attribute {
8304     node-name: 'b';
8305     text { data: 'c'; }
8306     general-entity-reference {
8307 wakaba 1.34 manakai-expanded: true;
8308 wakaba 1.18 node-name: 'ent';
8309     text-content: 'aa<bb';
8310     }
8311     }
8312 wakaba 1.11 }
8313     }
8314     @@XMLTest:
8315 wakaba 1.18 @@@QName: xp.ger.lt.in.attr.value.2.test
8316 wakaba 1.11 @@@DEnt:
8317     @@@@test:value:
8318     <!DOCTYPE a [
8319 wakaba 1.18 <!ENTITY ent "aa&lt;bb">
8320     <!ENTITY ent2 "ccc&ent;">
8321 wakaba 1.11 ]>
8322 wakaba 1.18 <a b="c&ent2;"/>
8323 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
8324 wakaba 1.11 @@@test:domTree:
8325     document {
8326     document-type {
8327     general-entity {
8328 wakaba 1.18 node-name: 'ent';
8329     text-content: 'aa<bb';
8330     }
8331     general-entity {
8332     node-name: 'ent2';
8333     text { data: 'ccc'; }
8334     general-entity-reference {
8335     node-name: 'ent';
8336     text-content: 'aa<bb';
8337 wakaba 1.34 manakai-expanded: true;
8338 wakaba 1.18 }
8339 wakaba 1.11 }
8340     }
8341     element {
8342 wakaba 1.18 attribute {
8343     node-name: 'b';
8344     text { data: 'c'; }
8345     general-entity-reference {
8346     node-name: 'ent2';
8347     text { data: 'ccc'; }
8348     general-entity-reference {
8349     node-name: 'ent';
8350     text-content: 'aa<bb';
8351 wakaba 1.34 manakai-expanded: true;
8352 wakaba 1.18 }
8353 wakaba 1.34 manakai-expanded: true;
8354 wakaba 1.18 }
8355     }
8356 wakaba 1.11 }
8357     }
8358    
8359 wakaba 1.8 @@XMLTest:
8360 wakaba 1.18 @@@QName: xp.doctype.intsubset.pi.test
8361 wakaba 1.8 @@@DEnt:
8362     @@@@test:value:
8363     <!DOCTYPE a [
8364 wakaba 1.18 <?pi data ?>
8365 wakaba 1.8 ]>
8366     <a></a>
8367     @@@test:domTree:
8368     document {
8369     xml-version: '1.0';
8370     xml-encoding: null;
8371     xml-standalone: false;
8372     document-type {
8373     node-name: 'a';
8374 wakaba 1.18 pi {
8375     target: 'pi';
8376     data: 'data ';
8377 wakaba 1.8 }
8378     }
8379     element {
8380     namespace-uri: null;
8381 wakaba 1.18 prefix: null;
8382 wakaba 1.8 local-name: 'a';
8383 wakaba 1.18 text-content: '';
8384 wakaba 1.8 }
8385     }
8386 wakaba 1.18 @@@enImplNote:
8387     A DOM PI node in doctype node is a manakai extension.
8388    
8389    
8390 wakaba 1.8 @@XMLTest:
8391 wakaba 1.18 @@@QName: xp.doctype.intsubset.entity.general.internal.test
8392 wakaba 1.8 @@@DEnt:
8393     @@@@test:value:
8394     <!DOCTYPE a [
8395 wakaba 1.18 <!ENTITY entity "entity value">
8396 wakaba 1.8 ]>
8397     <a></a>
8398 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
8399 wakaba 1.8 @@@test:domTree:
8400     document {
8401     xml-version: '1.0';
8402     xml-encoding: null;
8403     xml-standalone: false;
8404     document-type {
8405     node-name: 'a';
8406 wakaba 1.18 general-entity {
8407     node-name: 'entity';
8408     text-content: 'entity value';
8409     has-replacement-tree: true;
8410 wakaba 1.8 }
8411     }
8412     element {
8413     namespace-uri: null;
8414 wakaba 1.18 prefix: null;
8415 wakaba 1.8 local-name: 'a';
8416 wakaba 1.18 text-content: '';
8417 wakaba 1.8 }
8418     }
8419     @@XMLTest:
8420 wakaba 1.18 @@@QName: xp.doctype.intsubset.entity.parameter.internal.test
8421 wakaba 1.8 @@@DEnt:
8422     @@@@test:value:
8423     <!DOCTYPE a [
8424 wakaba 1.18 <!ENTITY % entity "entity value">
8425 wakaba 1.8 ]>
8426     <a></a>
8427     @@@test:domTree:
8428     document {
8429     xml-version: '1.0';
8430     xml-encoding: null;
8431     xml-standalone: false;
8432     document-type {
8433     node-name: 'a';
8434     }
8435     element {
8436     namespace-uri: null;
8437 wakaba 1.18 prefix: null;
8438 wakaba 1.8 local-name: 'a';
8439 wakaba 1.18 text-content: '';
8440 wakaba 1.8 }
8441     }
8442 wakaba 1.18
8443 wakaba 1.8 @@XMLTest:
8444 wakaba 1.18 @@@QName: xp.doctype.internal.entity.root.element.text.only.test
8445 wakaba 1.8 @@@DEnt:
8446     @@@@test:value:
8447     <!DOCTYPE a [
8448 wakaba 1.18 <!ENTITY entity "entity value">
8449 wakaba 1.8 ]>
8450 wakaba 1.18 <a>&entity;</a>
8451 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
8452 wakaba 1.8 @@@test:domTree:
8453     document {
8454     xml-version: '1.0';
8455     xml-encoding: null;
8456     xml-standalone: false;
8457     document-type {
8458     node-name: 'a';
8459 wakaba 1.18 general-entity {
8460     node-name: 'entity';
8461     text-content: 'entity value';
8462     has-replacement-tree: true;
8463 wakaba 1.8 }
8464     }
8465     element {
8466     namespace-uri: null;
8467 wakaba 1.18 prefix: null;
8468 wakaba 1.8 local-name: 'a';
8469 wakaba 1.18 general-entity-reference {
8470     node-name: 'entity';
8471     text {
8472     data: 'entity value';
8473     }
8474 wakaba 1.34 manakai-expanded: true;
8475 wakaba 1.10 }
8476 wakaba 1.9 }
8477     }
8478     @@XMLTest:
8479 wakaba 1.18 @@@QName: xp.doctype.internal.entity.root.element.text.mult.test
8480 wakaba 1.9 @@@DEnt:
8481     @@@@test:value:
8482     <!DOCTYPE a [
8483 wakaba 1.18 <!ENTITY entity "entity value">
8484 wakaba 1.9 ]>
8485 wakaba 1.18 <a>&entity; and &entity;</a>
8486 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
8487 wakaba 1.9 @@@test:domTree:
8488     document {
8489     xml-version: '1.0';
8490     xml-encoding: null;
8491     xml-standalone: false;
8492     document-type {
8493     node-name: 'a';
8494 wakaba 1.18 general-entity {
8495     node-name: 'entity';
8496     text-content: 'entity value';
8497     has-replacement-tree: true;
8498 wakaba 1.9 }
8499     }
8500     element {
8501     namespace-uri: null;
8502 wakaba 1.18 prefix: null;
8503 wakaba 1.9 local-name: 'a';
8504 wakaba 1.18 general-entity-reference {
8505     node-name: 'entity';
8506     text {
8507     data: 'entity value';
8508     }
8509 wakaba 1.34 manakai-expanded: true;
8510 wakaba 1.18 }
8511     text { data: ' and '; }
8512     general-entity-reference {
8513     node-name: 'entity';
8514     text {
8515     data: 'entity value';
8516     }
8517 wakaba 1.34 manakai-expanded: true;
8518 wakaba 1.10 }
8519 wakaba 1.9 }
8520     }
8521     @@XMLTest:
8522 wakaba 1.18 @@@QName: xp.doctype.internal.entity.root.element.text.element.test
8523 wakaba 1.9 @@@DEnt:
8524     @@@@test:value:
8525     <!DOCTYPE a [
8526 wakaba 1.18 <!ENTITY entity "entity <p>value</p> with <e>element</e> ">
8527 wakaba 1.9 ]>
8528 wakaba 1.18 <a>&entity;</a>
8529 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
8530 wakaba 1.18 @@@test:domTree:
8531     document {
8532     xml-version: '1.0';
8533     xml-encoding: null;
8534     xml-standalone: false;
8535     document-type {
8536     node-name: 'a';
8537     general-entity {
8538     node-name: 'entity';
8539     has-replacement-tree: true;
8540     text { data: 'entity '; }
8541     element {
8542     node-name: 'p';
8543     text-content: 'value';
8544     }
8545     text { data: ' with '; }
8546     element {
8547     node-name: 'e';
8548     text-content: 'element';
8549     }
8550 wakaba 1.20 text { data: ' '; }
8551 wakaba 1.18 }
8552     }
8553     element {
8554     namespace-uri: null;
8555     prefix: null;
8556     local-name: 'a';
8557     general-entity-reference {
8558     node-name: 'entity';
8559 wakaba 1.34 manakai-expanded: true;
8560 wakaba 1.18 text {
8561     data: 'entity ';
8562     }
8563     element {
8564     namespace-uri: null;
8565     prefix: null;
8566     local-name: 'p';
8567     text {
8568     data: 'value';
8569     }
8570     }
8571     text {
8572     data: ' with ';
8573     }
8574     element {
8575     namespace-uri: null;
8576     prefix: null;
8577     local-name: 'e';
8578     text {
8579     data: 'element';
8580     }
8581     }
8582     text {
8583     data: ' ';
8584     }
8585     }
8586     }
8587     }
8588     @@XMLTest:
8589     @@@QName: xp.doctype.internal.entity.root.element.text.in.ent.test
8590     @@@DEnt:
8591     @@@@test:value:
8592     <!DOCTYPE a [
8593     <!ENTITY entity1 "entity value">
8594     <!ENTITY entity2 "e&entity1;n">
8595     ]>
8596     <a>&entity2;</a>
8597 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
8598 wakaba 1.18 @@@test:domTree:
8599     document {
8600     xml-version: '1.0';
8601     xml-encoding: null;
8602     xml-standalone: false;
8603     document-type {
8604     node-name: 'a';
8605     general-entity {
8606     node-name: 'entity1';
8607     text-content: 'entity value';
8608     }
8609     general-entity {
8610     node-name: 'entity2';
8611     text { data: 'e'; }
8612     general-entity-reference {
8613     node-name: 'entity1';
8614     text-content: 'entity value';
8615 wakaba 1.34 manakai-expanded: true;
8616 wakaba 1.18 }
8617     text { data: 'n'; }
8618     }
8619     }
8620     element {
8621     namespace-uri: null;
8622     prefix: null;
8623     local-name: 'a';
8624     general-entity-reference {
8625     node-name: 'entity2';
8626     text { data: 'e'; }
8627 wakaba 1.34 manakai-expanded: true;
8628 wakaba 1.18 general-entity-reference {
8629     node-name: 'entity1';
8630     text {
8631     data: 'entity value';
8632     }
8633 wakaba 1.34 manakai-expanded: true;
8634 wakaba 1.18 }
8635     text { data: 'n'; }
8636     }
8637     }
8638     }
8639    
8640     @@XMLTest:
8641     @@@QName: xp.doctype.entity.value.charref.test
8642     @@@DEnt:
8643     @@@@test:value:
8644     <!DOCTYPE a [
8645     <!ENTITY entity1 "entity &#x21;value&#35;">
8646     <!ENTITY entity2 '&#x21;value&#35;'>
8647     ]>
8648     <a></a>
8649 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
8650 wakaba 1.18 @@@test:domTree:
8651     document {
8652     document-type {
8653     general-entity {
8654     node-name: 'entity1';
8655     text-content: 'entity !value#';
8656     has-replacement-tree: true;
8657     }
8658     general-entity {
8659     node-name: 'entity2';
8660     text-content: '!value#';
8661     has-replacement-tree: true;
8662     }
8663     }
8664     element { }
8665     }
8666    
8667     @@XMLTest:
8668     @@@QName: xp.predefined.in.content.test
8669     @@@DEnt:
8670     @@@@test:value:
8671     <a>_&lt;_&gt;_&quot;_&apos;_&amp;_</a>
8672     @@@test:domTree:
8673     document {
8674     element {
8675     text-content: '_<_>_"_' U+0027 '_&_';
8676     }
8677     }
8678     @@XMLTest:
8679     @@@QName: xp.predefined.in.attr.test
8680     @@@DEnt:
8681     @@@@test:value:
8682     <a at="_&lt;_&gt;_&quot;_&apos;_&amp;_"></a>
8683     @@@test:domTree:
8684     document {
8685     element {
8686     attribute {
8687     node-name: 'at';
8688     text-content: '_<_>_"_' U+0027 '_&_';
8689     }
8690     }
8691     }
8692     @@XMLTest:
8693     @@@QName: xp.predefined.in.content.in.entity.test
8694     @@@DEnt:
8695     @@@@test:value:
8696     <!DOCTYPE a [
8697     <!ENTITY ent "_&lt;_&gt;_&quot;_&apos;_&amp;_">
8698     ]>
8699     <a>&ent;</a>
8700 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
8701 wakaba 1.18 @@@test:domTree:
8702     document {
8703     document-type {
8704     general-entity {
8705     node-name: 'ent';
8706     text-content: '_<_>_"_' U+0027 '_&_';
8707     }
8708     }
8709     element {
8710     text-content: '_<_>_"_' U+0027 '_&_';
8711     }
8712     }
8713     @@XMLTest:
8714     @@@QName: xp.predefined.decl.ignore.test
8715     @@@DEnt:
8716     @@@@test:value:
8717     <!DOCTYPE a [
8718     <!ENTITY lt "&#x26;#x3C;">
8719     <!ENTITY gt "&#x3E;">
8720     <!ENTITY amp "&#x26;#x26;">
8721     <!ENTITY quot "&#x22;">
8722     <!ENTITY apos "&#x27;">
8723     <!ENTITY other "other">
8724     ]>
8725     <a>_&lt;_&gt;_&quot;_&apos;_&amp;_&other;_</a>
8726 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
8727 wakaba 1.18 @@@test:domTree:
8728     document {
8729     document-type {
8730     general-entity {
8731     node-name: 'other';
8732     text-content: 'other';
8733     }
8734     }
8735     element {
8736     text-content: '_<_>_"_' U+0027 '_&_other_';
8737     }
8738     }
8739    
8740     @@XMLTest:
8741     @@@QName: xp.doctype.internal.attr.empty.test
8742     @@@DEnt:
8743     @@@@test:value:
8744     <!DOCTYPE a [
8745     <!ATTLIST a>
8746     ]>
8747     <a></a>
8748     @@@test:domTree:
8749     document {
8750     xml-version: '1.0';
8751     xml-encoding: null;
8752     xml-standalone: false;
8753     document-type {
8754     node-name: 'a';
8755     element-type-definition {
8756     node-name: 'a';
8757     }
8758     }
8759     element {
8760     namespace-uri: null;
8761     local-name: 'a';
8762     }
8763     }
8764     @@XMLTest:
8765     @@@QName: xp.doctype.internal.attr.cdata.implied.test
8766     @@@DEnt:
8767     @@@@test:value:
8768     <!DOCTYPE a [
8769     <!ATTLIST a
8770     at CDATA #IMPLIED
8771     >
8772     ]>
8773     <a></a>
8774 wakaba 1.9 @@@test:domTree:
8775     document {
8776     xml-version: '1.0';
8777     xml-encoding: null;
8778     xml-standalone: false;
8779     document-type {
8780     node-name: 'a';
8781     element-type-definition {
8782     node-name: 'a';
8783     attribute-definition {
8784     node-name: 'at';
8785 wakaba 1.18 declared-type: const (CDATA_ATTR);
8786 wakaba 1.9 allowed-tokens: DOMStringList ();
8787 wakaba 1.18 default-type: const (IMPLIED_DEFAULT);
8788     text-content: '';
8789 wakaba 1.9 }
8790     }
8791     }
8792     element {
8793     namespace-uri: null;
8794     local-name: 'a';
8795 wakaba 1.18 }
8796     }
8797     @@XMLTest:
8798     @@@QName: xp.doctype.internal.attr.types.implied.test
8799     @@@DEnt:
8800     @@@@test:value:
8801     <!DOCTYPE a [
8802     <!ATTLIST a
8803     at1 ID #IMPLIED
8804     at2 IDREF #IMPLIED
8805     at3 IDREFS #IMPLIED
8806     at4 ENTITY #IMPLIED
8807     at5 ENTITIES #IMPLIED
8808     at6 NMTOKEN #IMPLIED
8809     at7 NMTOKENS #IMPLIED
8810     at8 NOTATION (n1 | n2|n3) #IMPLIED
8811     at9 (e1| e2| e3 ) #IMPLIED
8812     >
8813     ]>
8814     <a></a>
8815     @@@test:domTree:
8816     document {
8817     xml-version: '1.0';
8818     xml-encoding: null;
8819     xml-standalone: false;
8820     document-type {
8821     node-name: 'a';
8822     element-type-definition {
8823     node-name: 'a';
8824     attribute-definition {
8825     node-name: 'at1';
8826     declared-type: const (ID_ATTR);
8827     allowed-tokens: DOMStringList ();
8828     default-type: const (IMPLIED_DEFAULT);
8829     text-content: '';
8830     }
8831     attribute-definition {
8832     node-name: 'at2';
8833     declared-type: const (IDREF_ATTR);
8834     allowed-tokens: DOMStringList ();
8835     default-type: const (IMPLIED_DEFAULT);
8836     text-content: '';
8837     }
8838     attribute-definition {
8839     node-name: 'at3';
8840     declared-type: const (IDREFS_ATTR);
8841     allowed-tokens: DOMStringList ();
8842     default-type: const (IMPLIED_DEFAULT);
8843     text-content: '';
8844     }
8845     attribute-definition {
8846     node-name: 'at4';
8847     declared-type: const (ENTITY_ATTR);
8848     allowed-tokens: DOMStringList ();
8849     default-type: const (IMPLIED_DEFAULT);
8850     text-content: '';
8851     }
8852     attribute-definition {
8853     node-name: 'at5';
8854     declared-type: const (ENTITIES_ATTR);
8855     allowed-tokens: DOMStringList ();
8856     default-type: const (IMPLIED_DEFAULT);
8857     text-content: '';
8858     }
8859     attribute-definition {
8860     node-name: 'at6';
8861     declared-type: const (NMTOKEN_ATTR);
8862     allowed-tokens: DOMStringList ();
8863     default-type: const (IMPLIED_DEFAULT);
8864     text-content: '';
8865     }
8866     attribute-definition {
8867     node-name: 'at7';
8868     declared-type: const (NMTOKENS_ATTR);
8869     allowed-tokens: DOMStringList ();
8870     default-type: const (IMPLIED_DEFAULT);
8871     text-content: '';
8872     }
8873     attribute-definition {
8874     node-name: 'at8';
8875     declared-type: const (NOTATION_ATTR);
8876     allowed-tokens: DOMStringList ('n1', 'n2', 'n3');
8877     default-type: const (IMPLIED_DEFAULT);
8878     text-content: '';
8879     }
8880     attribute-definition {
8881     node-name: 'at9';
8882     declared-type: const (ENUMERATION_ATTR);
8883     allowed-tokens: DOMStringList ('e1', 'e2', 'e3');
8884     default-type: const (IMPLIED_DEFAULT);
8885     text-content: '';
8886     }
8887     }
8888     }
8889     element {
8890     namespace-uri: null;
8891     local-name: 'a';
8892     }
8893     }
8894     @@XMLTest:
8895     @@@QName: xp.doctype.internal.attr.cdata.defaults.test
8896     @@@DEnt:
8897     @@@@test:value:
8898     <!DOCTYPE a [
8899     <!ATTLIST a
8900     at1 CDATA #IMPLIED
8901     at2 CDATA #REQUIRED
8902     at3 CDATA #FIXED "value3"
8903     at4 CDATA "value4"
8904     at5 CDATA #FIXED 'value5'
8905     at6 CDATA 'value6'
8906     >
8907     ]>
8908     <a></a>
8909     @@@test:domTree:
8910     document {
8911     xml-version: '1.0';
8912     xml-encoding: null;
8913     xml-standalone: false;
8914     document-type {
8915     node-name: 'a';
8916     element-type-definition {
8917     node-name: 'a';
8918     attribute-definition {
8919     node-name: 'at1';
8920     declared-type: const (CDATA_ATTR);
8921     allowed-tokens: DOMStringList ();
8922     default-type: const (IMPLIED_DEFAULT);
8923     text-content: '';
8924     }
8925     attribute-definition {
8926     node-name: 'at2';
8927     declared-type: const (CDATA_ATTR);
8928     allowed-tokens: DOMStringList ();
8929     default-type: const (REQUIRED_DEFAULT);
8930     text-content: '';
8931     }
8932     attribute-definition {
8933     node-name: 'at3';
8934     declared-type: const (CDATA_ATTR);
8935     allowed-tokens: DOMStringList ();
8936     default-type: const (FIXED_DEFAULT);
8937     text-content: 'value3';
8938     }
8939     attribute-definition {
8940     node-name: 'at4';
8941     declared-type: const (CDATA_ATTR);
8942     allowed-tokens: DOMStringList ();
8943     default-type: const (EXPLICIT_DEFAULT);
8944     text-content: 'value4';
8945     }
8946     attribute-definition {
8947     node-name: 'at5';
8948     declared-type: const (CDATA_ATTR);
8949     allowed-tokens: DOMStringList ();
8950     default-type: const (FIXED_DEFAULT);
8951     text-content: 'value5';
8952     }
8953     attribute-definition {
8954     node-name: 'at6';
8955     declared-type: const (CDATA_ATTR);
8956     allowed-tokens: DOMStringList ();
8957     default-type: const (EXPLICIT_DEFAULT);
8958     text-content: 'value6';
8959     }
8960     }
8961     }
8962     element {
8963     namespace-uri: null;
8964     local-name: 'a';
8965     attribute {
8966     node-name: 'at3';
8967     text-content: 'value3';
8968     specified: false;
8969     }
8970     attribute {
8971     node-name: 'at4';
8972     text-content: 'value4';
8973     specified: false;
8974     }
8975     attribute {
8976     node-name: 'at5';
8977     text-content: 'value5';
8978     specified: false;
8979     }
8980     attribute {
8981     node-name: 'at6';
8982     text-content: 'value6';
8983     specified: false;
8984     }
8985     }
8986     }
8987    
8988     @@XMLTest:
8989     @@@QName: xp.doctype.internal.attr.cdata.default.normalize.test
8990     @@@DEnt:
8991     @@@@test:value:
8992     <!DOCTYPE a [
8993     <!ATTLIST a
8994     at CDATA " default &#x0A;value "
8995     >
8996     ]>
8997     <a></a>
8998     @@@test:domTree:
8999     document {
9000     xml-version: '1.0';
9001     xml-encoding: null;
9002     xml-standalone: false;
9003     document-type {
9004     node-name: 'a';
9005     element-type-definition {
9006     node-name: 'a';
9007     attribute-definition {
9008     node-name: 'at';
9009     declared-type: const (CDATA_ATTR);
9010     allowed-tokens: DOMStringList ();
9011     default-type: const (EXPLICIT_DEFAULT);
9012     text-content: ' default ' U+000A 'value ';
9013     }
9014     }
9015     }
9016     element {
9017     namespace-uri: null;
9018     local-name: 'a';
9019     attribute {
9020     node-name: 'at';
9021     text-content: ' default ' U+000A 'value ';
9022     specified: false;
9023     }
9024     }
9025     }
9026     @@XMLTest:
9027     @@@QName: xp.doctype.internal.attr.nmtoken.default.normalize.test
9028     @@@DEnt:
9029     @@@@test:value:
9030     <!DOCTYPE a [
9031     <!ATTLIST a
9032     at NMTOKEN " default &#x0A;value "
9033     >
9034     ]>
9035     <a></a>
9036     @@@test:domTree:
9037     document {
9038     xml-version: '1.0';
9039     xml-encoding: null;
9040     xml-standalone: false;
9041     document-type {
9042     node-name: 'a';
9043     element-type-definition {
9044     node-name: 'a';
9045     attribute-definition {
9046     node-name: 'at';
9047     declared-type: const (NMTOKEN_ATTR);
9048     allowed-tokens: DOMStringList ();
9049     default-type: const (EXPLICIT_DEFAULT);
9050     text-content: ' default ' U+000A 'value ';
9051     }
9052     }
9053     }
9054     element {
9055     namespace-uri: null;
9056     local-name: 'a';
9057     attribute {
9058     node-name: 'at';
9059     text-content: ' default ' U+000A 'value ';
9060     specified: false;
9061     }
9062     }
9063     }
9064    
9065     @@XMLTest:
9066     @@@QName: xp.doctype.attrtype.no-value.test
9067     @@@DEnt:
9068     @@@@test:value:
9069     <!DOCTYPE a>
9070     <a at=" at value "></a>
9071     @@@test:domTree:
9072     document {
9073     xml-version: '1.0';
9074     xml-encoding: null;
9075     xml-standalone: false;
9076     document-type { }
9077     element {
9078     namespace-uri: null;
9079     local-name: 'a';
9080     attribute {
9081     namespace-uri: null;
9082     local-name: 'at';
9083     value: ' at value ';
9084     text {
9085     data: ' at value ';
9086     }
9087     schema-type-info: TypeInfo (null, null);
9088     specified: true;
9089     }
9090     }
9091     }
9092     @@XMLTest:
9093     @@@QName: xp.doctype.attrtype.cdata.test
9094     @@@DEnt:
9095     @@@@test:value:
9096     <!DOCTYPE a [
9097     <!ATTLIST a
9098     at CDATA #IMPLIED
9099     >
9100     ]>
9101     <a at=" at value "></a>
9102     @@@test:domTree:
9103     document {
9104     xml-version: '1.0';
9105     xml-encoding: null;
9106     xml-standalone: false;
9107     document-type { }
9108     element {
9109     namespace-uri: null;
9110     local-name: 'a';
9111     attribute {
9112     namespace-uri: null;
9113     local-name: 'at';
9114     value: ' at value ';
9115     text {
9116     data: ' at value ';
9117     }
9118     schema-type-info:
9119     TypeInfo ('http://www.w3.org/TR/REC-xml', 'CDATA');
9120     specified: true;
9121     }
9122     }
9123     }
9124     @@XMLTest:
9125     @@@QName: xp.doctype.attrtype.nmtoken.test
9126     @@@DEnt:
9127     @@@@test:value:
9128     <!DOCTYPE a [
9129     <!ATTLIST a
9130     at NMTOKEN #IMPLIED
9131     >
9132     ]>
9133     <a at=" at value "></a>
9134     @@@test:domTree:
9135     document {
9136     xml-version: '1.0';
9137     xml-encoding: null;
9138     xml-standalone: false;
9139     document-type { }
9140     element {
9141     namespace-uri: null;
9142     local-name: 'a';
9143     attribute {
9144     namespace-uri: null;
9145     local-name: 'at';
9146     value: 'at value';
9147     text {
9148     data: ' at value ';
9149     }
9150     schema-type-info:
9151     TypeInfo ('http://www.w3.org/TR/REC-xml', 'NMTOKEN');
9152     specified: true;
9153     }
9154     }
9155     }
9156    
9157     @@XMLTest:
9158     @@@QName: xp.doctype.attr.normalization.1.test
9159     @@@DEnt:
9160     @@@@test:value:
9161     <a at=" at &#xA;value "></a>
9162     @@@test:domTree:
9163     document {
9164     element {
9165     attribute {
9166     node-name: 'at';
9167     value: ' at ' U+000A 'value ';
9168     schema-type-info: TypeInfo (null, null);
9169     specified: true;
9170     }
9171     }
9172     }
9173     @@XMLTest:
9174     @@@QName: xp.doctype.attr.normalization.2.test
9175     @@@DEnt:
9176     @@@@test:value:
9177     <a at=" at &#xD;value "></a>
9178     @@@test:domTree:
9179     document {
9180     element {
9181     attribute {
9182     value: ' at ' U+000D 'value ';
9183     schema-type-info: TypeInfo (null, null);
9184     specified: true;
9185     }
9186     }
9187     }
9188     @@XMLTest:
9189     @@@QName: xp.doctype.attr.normalization.3.test
9190     @@@DEnt:
9191     @@@@test:value:
9192     <a at=" at &#x9;value "></a>
9193     @@@test:domTree:
9194     document {
9195     element {
9196     attribute {
9197     node-name: 'at';
9198     value: ' at ' U+0009 'value ';
9199     schema-type-info: TypeInfo (null, null);
9200     specified: true;
9201     }
9202     }
9203     }
9204    
9205     @@XMLTest:
9206     @@@QName: xp.doctype.attr.specified.1.test
9207     @@@DEnt:
9208     @@@@test:value:
9209     <!DOCTYPE a [
9210     <!ATTLIST a
9211     at CDATA "default"
9212     >
9213     ]>
9214     <a></a>
9215     @@@test:domTree:
9216     document {
9217     document-type { }
9218     element {
9219     attribute {
9220     node-name: 'at';
9221     value: 'default';
9222     specified: false;
9223     }
9224     }
9225     }
9226     @@XMLTest:
9227     @@@QName: xp.doctype.attr.specified.2.test
9228     @@@DEnt:
9229     @@@@test:value:
9230     <!DOCTYPE a [
9231     <!ATTLIST a
9232     at CDATA "default"
9233     >
9234     ]>
9235     <a at2="specified"></a>
9236     @@@test:domTree:
9237     document {
9238     document-type { }
9239     element {
9240     attribute {
9241     node-name: 'at';
9242     value: 'default';
9243     specified: false;
9244     }
9245     attribute {
9246     node-name: 'at2';
9247     value: 'specified';
9248     specified: true;
9249     }
9250     }
9251     }
9252     @@XMLTest:
9253     @@@QName: xp.doctype.attr.specified.3.test
9254     @@@DEnt:
9255     @@@@test:value:
9256     <!DOCTYPE a [
9257     <!ATTLIST a
9258     at CDATA "default"
9259     >
9260     ]>
9261     <a at="specified"></a>
9262     @@@test:domTree:
9263     document {
9264     document-type { }
9265     element {
9266     attribute {
9267     node-name: 'at';
9268     value: 'specified';
9269     specified: true;
9270     }
9271     }
9272     }
9273    
9274     @@XMLTest:
9275     @@@QName: xp.attr.literal.charref.test
9276     @@@DEnt:
9277     @@@@test:value:
9278     <a at1 = "value&#33;_&#x25;value"
9279     at2 = 'value&#x25;_&#33;value'></a>
9280     @@@test:domTree:
9281     document {
9282     element {
9283     attribute {
9284     node-name: 'at1';
9285     text-content: 'value!_%value';
9286     }
9287     attribute {
9288     node-name: 'at2';
9289     text-content: 'value%_!value';
9290     }
9291     }
9292     }
9293     @@XMLTest:
9294     @@@QName: xp.attr.literal.entref.test
9295     @@@DEnt:
9296     @@@@test:value:
9297     <!DOCTYPE a [
9298     <!ENTITY ent "entity&#x26;#33;_&#x26;#x29;value">
9299     ]>
9300     <a at1 = "value&ent;value"
9301     at2 = 'value&ent;value'></a>
9302 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
9303 wakaba 1.18 @@@test:domTree:
9304     document {
9305     document-type {
9306     general-entity {
9307     node-name: 'ent';
9308     text-content: 'entity!_)value';
9309     }
9310     }
9311     element {
9312     attribute {
9313     node-name: 'at1';
9314     text-content: 'valueentity!_)valuevalue';
9315     }
9316     attribute {
9317     node-name: 'at2';
9318     text-content: 'valueentity!_)valuevalue';
9319     }
9320     }
9321     }
9322     @@XMLTest:
9323     @@@QName: xp.attr.literal.entref.nest.test
9324     @@@DEnt:
9325     @@@@test:value:
9326     <!DOCTYPE a [
9327     <!ENTITY ent1 "entity&#x26;#33;_&#x26;#x29;value">
9328     <!ENTITY ent2 "@&ent1;@">
9329     ]>
9330     <a at1 = "value&ent2;value"
9331     at2 = 'value&ent2;value'></a>
9332 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
9333 wakaba 1.18 @@@test:domTree:
9334     document {
9335     document-type {
9336     general-entity {
9337     node-name: 'ent1';
9338     text-content: 'entity!_)value';
9339     }
9340     general-entity {
9341     node-name: 'ent2';
9342     text-content: '@entity!_)value@';
9343     }
9344     }
9345     element {
9346     attribute {
9347     node-name: 'at1';
9348     text-content: 'value@entity!_)value@value';
9349     }
9350     attribute {
9351     node-name: 'at2';
9352     text-content: 'value@entity!_)value@value';
9353     }
9354     }
9355     }
9356    
9357     @@XMLTest:
9358     @@@QName: xp.element.content.ncr.1.test
9359     @@@DEnt:
9360     @@@@test:value:
9361     <e>&#33;</e>
9362     @@@test:domTree:
9363     document {
9364     element {
9365     text-content: '!';
9366     }
9367     }
9368     @@XMLTest:
9369     @@@QName: xp.element.content.ncr.2.test
9370     @@@DEnt:
9371     @@@@test:value:
9372     <e>aaaa&#33;bbbb</e>
9373     @@@test:domTree:
9374     document {
9375     element {
9376     text-content: 'aaaa!bbbb';
9377 wakaba 1.31 text {
9378     text-content: 'aaaa!bbbb';
9379     }
9380 wakaba 1.18 }
9381     }
9382     @@XMLTest:
9383     @@@QName: xp.attrval.ncr.1.test
9384     @@@DEnt:
9385     @@@@test:value:
9386     <e a="&#33;"/>
9387     @@@test:domTree:
9388     document {
9389     element {
9390     attribute {
9391     node-name: 'a';
9392     text-content: '!';
9393     }
9394     }
9395     }
9396     @@XMLTest:
9397     @@@QName: xp.attrval.ncr.2.test
9398     @@@DEnt:
9399     @@@@test:value:
9400     <e a="aaaaa&#33;bbbbb"/>
9401     @@@test:domTree:
9402     document {
9403     element {
9404     attribute {
9405     node-name: 'a';
9406     text-content: 'aaaaa!bbbbb';
9407 wakaba 1.31 text {
9408     text-content: 'aaaaa!bbbbb';
9409     }
9410 wakaba 1.18 }
9411     }
9412     }
9413     @@XMLTest:
9414     @@@QName: xp.attrval.ncr.3.test
9415     @@@DEnt:
9416     @@@@test:value:
9417     <e a='&#33;'/>
9418     @@@test:domTree:
9419     document {
9420     element {
9421     attribute {
9422     node-name: 'a';
9423     text-content: '!';
9424     }
9425     }
9426     }
9427     @@XMLTest:
9428     @@@QName: xp.attrval.ncr.4.test
9429     @@@DEnt:
9430     @@@@test:value:
9431     <e a='aaaaa&#33;bbbbb'/>
9432     @@@test:domTree:
9433     document {
9434     element {
9435     attribute {
9436     node-name: 'a';
9437     text-content: 'aaaaa!bbbbb';
9438     }
9439     }
9440     }
9441     @@XMLTest:
9442     @@@QName: xp.entval.ncr.1.test
9443     @@@DEnt:
9444     @@@@test:value:
9445     <!DOCTYPE e [
9446     <!ENTITY ent "&#33;">
9447     ]>
9448     <e/>
9449 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
9450 wakaba 1.18 @@@test:domTree:
9451     document {
9452     document-type {
9453     general-entity {
9454     node-name: 'ent';
9455     text-content: '!';
9456     }
9457     }
9458     element { }
9459     }
9460     @@XMLTest:
9461     @@@QName: xp.entval.ncr.2.test
9462     @@@DEnt:
9463     @@@@test:value:
9464     <!DOCTYPE e [
9465     <!ENTITY ent "aaaaa&#33;bbbbb">
9466     ]>
9467     <e/>
9468 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
9469 wakaba 1.18 @@@test:domTree:
9470     document {
9471     document-type {
9472     general-entity {
9473     node-name: 'ent';
9474     text-content: 'aaaaa!bbbbb';
9475     }
9476     }
9477     element { }
9478     }
9479     @@XMLTest:
9480     @@@QName: xp.element.content.reptxt.ncr.1.test
9481     @@@DEnt:
9482     @@@@test:value:
9483     <!DOCTYPE e [
9484     <!ENTITY ent "&#38;#33;">
9485     ]>
9486     <e>&ent;</e>
9487     @@@test:domTree:
9488     document {
9489     document-type { }
9490     element {
9491     general-entity-reference {
9492     node-name: 'ent';
9493     text-content: '!';
9494 wakaba 1.34 manakai-expanded: true;
9495 wakaba 1.18 }
9496     }
9497     }
9498     @@XMLTest:
9499     @@@QName: xp.element.content.reptxt.ncr.2.test
9500     @@@DEnt:
9501     @@@@test:value:
9502     <!DOCTYPE e [
9503     <!ENTITY ent "aaaaa&#38;#33;bbbbb">
9504     ]>
9505     <e>&ent;</e>
9506     @@@test:domTree:
9507     document {
9508     document-type { }
9509     element {
9510     general-entity-reference {
9511     node-name: 'ent';
9512     text-content: 'aaaaa!bbbbb';
9513 wakaba 1.34 manakai-expanded: true;
9514 wakaba 1.18 }
9515     }
9516     }
9517     @@XMLTest:
9518     @@@QName: xp.element.content.reptxt.reptxt.ncr.1.test
9519     @@@DEnt:
9520     @@@@test:value:
9521     <!DOCTYPE e [
9522     <!ENTITY ent "&#38;#33;">
9523     <!ENTITY ent2 "&ent;">
9524     ]>
9525     <e>&ent2;</e>
9526     @@@test:domTree:
9527     document {
9528     document-type { }
9529     element {
9530     general-entity-reference {
9531     node-name: 'ent2';
9532     general-entity-reference {
9533     node-name: 'ent';
9534     text-content: '!';
9535 wakaba 1.34 manakai-expanded: true;
9536 wakaba 1.18 }
9537 wakaba 1.34 manakai-expanded: true;
9538 wakaba 1.18 }
9539     }
9540     }
9541     @@XMLTest:
9542     @@@QName: xp.element.content.reptxt.reptxt.ncr.2.test
9543     @@@DEnt:
9544     @@@@test:value:
9545     <!DOCTYPE e [
9546     <!ENTITY ent "aa&#38;#33;bb">
9547     <!ENTITY ent2 "&ent;">
9548     ]>
9549     <e>&ent2;</e>
9550     @@@test:domTree:
9551     document {
9552     document-type { }
9553     element {
9554     general-entity-reference {
9555     node-name: 'ent2';
9556     general-entity-reference {
9557     node-name: 'ent';
9558     text-content: 'aa!bb';
9559 wakaba 1.34 manakai-expanded: true;
9560 wakaba 1.31 text {
9561     text-content: 'aa!bb';
9562     }
9563 wakaba 1.18 }
9564 wakaba 1.34 manakai-expanded: true;
9565 wakaba 1.18 }
9566     }
9567     }
9568     @@XMLTest:
9569     @@@QName: xp.attval.reptxt.ncr.1.test
9570     @@@DEnt:
9571     @@@@test:value:
9572     <!DOCTYPE e [
9573     <!ENTITY ent "&#38;#33;">
9574     ]>
9575     <e a="&ent;"/>
9576     @@@test:domTree:
9577     document {
9578     document-type { }
9579     element {
9580     attribute {
9581     node-name: 'a';
9582     general-entity-reference {
9583     node-name: 'ent';
9584     text-content: '!';
9585 wakaba 1.34 manakai-expanded: true;
9586 wakaba 1.18 }
9587     }
9588     }
9589     }
9590     @@XMLTest:
9591     @@@QName: xp.attval.reptxt.ncr.2.test
9592     @@@DEnt:
9593     @@@@test:value:
9594     <!DOCTYPE e [
9595     <!ENTITY ent "aaaaa&#38;#33;bbbbb">
9596     ]>
9597     <e a="&ent;"/>
9598     @@@test:domTree:
9599     document {
9600     document-type { }
9601     element {
9602     attribute {
9603     node-name: 'a';
9604     general-entity-reference {
9605     node-name: 'ent';
9606     text-content: 'aaaaa!bbbbb';
9607 wakaba 1.34 manakai-expanded: true;
9608 wakaba 1.31 text {
9609     text-content: 'aaaaa!bbbbb';
9610     }
9611 wakaba 1.18 }
9612     }
9613     }
9614     }
9615     @@XMLTest:
9616     @@@QName: xp.attval.reptxt.reptxt.ncr.1.test
9617     @@@DEnt:
9618     @@@@test:value:
9619     <!DOCTYPE e [
9620     <!ENTITY ent "&#38;#33;">
9621     <!ENTITY ent2 "&ent;">
9622     ]>
9623     <e a="&ent2;"/>
9624     @@@test:domTree:
9625     document {
9626     document-type { }
9627     element {
9628     attribute {
9629     node-name: 'a';
9630     general-entity-reference {
9631     node-name: 'ent2';
9632 wakaba 1.34 manakai-expanded: true;
9633 wakaba 1.18 general-entity-reference {
9634     node-name: 'ent';
9635     text-content: '!';
9636 wakaba 1.34 manakai-expanded: true;
9637 wakaba 1.18 }
9638     }
9639     }
9640     }
9641     }
9642     @@XMLTest:
9643     @@@QName: xp.attval.reptxt.reptxt.ncr.2.test
9644     @@@DEnt:
9645     @@@@test:value:
9646     <!DOCTYPE e [
9647     <!ENTITY ent "aa&#38;#33;bb">
9648     <!ENTITY ent2 "&ent;">
9649     ]>
9650     <e a="&ent2;"/>
9651     @@@test:domTree:
9652     document {
9653     document-type { }
9654     element {
9655     attribute {
9656     node-name: 'a';
9657     general-entity-reference {
9658     node-name: 'ent2';
9659 wakaba 1.34 manakai-expanded: true;
9660 wakaba 1.18 general-entity-reference {
9661     node-name: 'ent';
9662     text-content: 'aa!bb';
9663 wakaba 1.34 manakai-expanded: true;
9664 wakaba 1.18 }
9665     }
9666     }
9667     }
9668     }
9669    
9670     @@XMLTest:
9671     @@@QName: xp.element.content.hcr.1.test
9672     @@@DEnt:
9673     @@@@test:value:
9674     <e>&#x21;</e>
9675     @@@test:domTree:
9676     document {
9677     element {
9678     text-content: '!';
9679     }
9680     }
9681     @@XMLTest:
9682     @@@QName: xp.element.content.hcr.2.test
9683     @@@DEnt:
9684     @@@@test:value:
9685     <e>aaaa&#x21;bbbb</e>
9686     @@@test:domTree:
9687     document {
9688     element {
9689     text-content: 'aaaa!bbbb';
9690 wakaba 1.31 text {
9691     text-content: 'aaaa!bbbb';
9692     }
9693 wakaba 1.18 }
9694     }
9695     @@XMLTest:
9696     @@@QName: xp.attrval.hcr.1.test
9697     @@@DEnt:
9698     @@@@test:value:
9699     <e a="&#x21;"/>
9700     @@@test:domTree:
9701     document {
9702     element {
9703     attribute {
9704     node-name: 'a';
9705     text-content: '!';
9706     }
9707     }
9708     }
9709     @@XMLTest:
9710     @@@QName: xp.attrval.hcr.2.test
9711     @@@DEnt:
9712     @@@@test:value:
9713     <e a="aaaaa&#x21;bbbbb"/>
9714     @@@test:domTree:
9715     document {
9716     element {
9717     attribute {
9718     node-name: 'a';
9719     text-content: 'aaaaa!bbbbb';
9720 wakaba 1.31 text {
9721     text-content: 'aaaaa!bbbbb';
9722     }
9723 wakaba 1.18 }
9724     }
9725     }
9726     @@XMLTest:
9727     @@@QName: xp.attrval.hcr.3.test
9728     @@@DEnt:
9729     @@@@test:value:
9730     <e a='&#x21;'/>
9731     @@@test:domTree:
9732     document {
9733     element {
9734     attribute {
9735     node-name: 'a';
9736     text-content: '!';
9737     }
9738     }
9739     }
9740     @@XMLTest:
9741     @@@QName: xp.attrval.hcr.4.test
9742     @@@DEnt:
9743     @@@@test:value:
9744     <e a='aaaaa&#x21;bbbbb'/>
9745     @@@test:domTree:
9746     document {
9747     element {
9748     attribute {
9749     node-name: 'a';
9750     text-content: 'aaaaa!bbbbb';
9751     }
9752     }
9753     }
9754     @@XMLTest:
9755     @@@QName: xp.entval.hcr.1.test
9756     @@@DEnt:
9757     @@@@test:value:
9758     <!DOCTYPE e [
9759     <!ENTITY ent "&#x21;">
9760     ]>
9761     <e/>
9762 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
9763 wakaba 1.18 @@@test:domTree:
9764     document {
9765     document-type {
9766     general-entity {
9767     node-name: 'ent';
9768     text-content: '!';
9769 wakaba 1.10 }
9770 wakaba 1.9 }
9771 wakaba 1.18 element { }
9772 wakaba 1.9 }
9773     @@XMLTest:
9774 wakaba 1.18 @@@QName: xp.entval.hcr.2.test
9775 wakaba 1.9 @@@DEnt:
9776     @@@@test:value:
9777 wakaba 1.18 <!DOCTYPE e [
9778     <!ENTITY ent "aaaaa&#x21;bbbbb">
9779     ]>
9780     <e/>
9781 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
9782 wakaba 1.9 @@@test:domTree:
9783     document {
9784 wakaba 1.18 document-type {
9785     general-entity {
9786     node-name: 'ent';
9787     text-content: 'aaaaa!bbbbb';
9788 wakaba 1.31 text {
9789     text-content: 'aaaaa!bbbbb';
9790     }
9791 wakaba 1.9 }
9792     }
9793 wakaba 1.18 element { }
9794 wakaba 1.9 }
9795     @@XMLTest:
9796 wakaba 1.18 @@@QName: xp.element.content.reptxt.hcr.1.test
9797 wakaba 1.9 @@@DEnt:
9798     @@@@test:value:
9799 wakaba 1.18 <!DOCTYPE e [
9800     <!ENTITY ent "&#38;#x21;">
9801 wakaba 1.9 ]>
9802 wakaba 1.18 <e>&ent;</e>
9803 wakaba 1.9 @@@test:domTree:
9804     document {
9805     document-type { }
9806     element {
9807 wakaba 1.18 general-entity-reference {
9808     node-name: 'ent';
9809     text-content: '!';
9810 wakaba 1.34 manakai-expanded: true;
9811 wakaba 1.9 }
9812     }
9813     }
9814     @@XMLTest:
9815 wakaba 1.18 @@@QName: xp.element.content.reptxt.hcr.2.test
9816 wakaba 1.9 @@@DEnt:
9817     @@@@test:value:
9818 wakaba 1.18 <!DOCTYPE e [
9819     <!ENTITY ent "aaaaa&#38;#x21;bbbbb">
9820 wakaba 1.9 ]>
9821 wakaba 1.18 <e>&ent;</e>
9822 wakaba 1.9 @@@test:domTree:
9823     document {
9824     document-type { }
9825     element {
9826 wakaba 1.18 general-entity-reference {
9827     node-name: 'ent';
9828     text-content: 'aaaaa!bbbbb';
9829 wakaba 1.34 manakai-expanded: true;
9830 wakaba 1.9 }
9831     }
9832     }
9833     @@XMLTest:
9834 wakaba 1.18 @@@QName: xp.element.content.reptxt.reptxt.hcr.1.test
9835 wakaba 1.9 @@@DEnt:
9836     @@@@test:value:
9837 wakaba 1.18 <!DOCTYPE e [
9838     <!ENTITY ent "&#38;#x21;">
9839     <!ENTITY ent2 "&ent;">
9840     ]>
9841     <e>&ent2;</e>
9842 wakaba 1.9 @@@test:domTree:
9843     document {
9844 wakaba 1.18 document-type { }
9845 wakaba 1.9 element {
9846 wakaba 1.18 general-entity-reference {
9847     node-name: 'ent2';
9848 wakaba 1.34 manakai-expanded: true;
9849 wakaba 1.18 general-entity-reference {
9850     node-name: 'ent';
9851     text-content: '!';
9852 wakaba 1.34 manakai-expanded: true;
9853 wakaba 1.18 }
9854 wakaba 1.9 }
9855     }
9856     }
9857     @@XMLTest:
9858 wakaba 1.18 @@@QName: xp.element.content.reptxt.reptxt.hcr.2.test
9859 wakaba 1.9 @@@DEnt:
9860     @@@@test:value:
9861 wakaba 1.18 <!DOCTYPE e [
9862     <!ENTITY ent "aa&#38;#x21;bb">
9863     <!ENTITY ent2 "&ent;">
9864     ]>
9865     <e>&ent2;</e>
9866 wakaba 1.9 @@@test:domTree:
9867     document {
9868 wakaba 1.18 document-type { }
9869 wakaba 1.9 element {
9870 wakaba 1.18 general-entity-reference {
9871     node-name: 'ent2';
9872 wakaba 1.34 manakai-expanded: true;
9873 wakaba 1.18 general-entity-reference {
9874     node-name: 'ent';
9875 wakaba 1.34 manakai-expanded: true;
9876 wakaba 1.18 text-content: 'aa!bb';
9877     }
9878 wakaba 1.9 }
9879     }
9880     }
9881     @@XMLTest:
9882 wakaba 1.18 @@@QName: xp.attval.reptxt.hcr.1.test
9883 wakaba 1.9 @@@DEnt:
9884     @@@@test:value:
9885 wakaba 1.18 <!DOCTYPE e [
9886     <!ENTITY ent "&#38;#x21;">
9887     ]>
9888     <e a="&ent;"/>
9889 wakaba 1.9 @@@test:domTree:
9890     document {
9891 wakaba 1.18 document-type { }
9892 wakaba 1.9 element {
9893     attribute {
9894 wakaba 1.18 node-name: 'a';
9895     general-entity-reference {
9896     node-name: 'ent';
9897 wakaba 1.34 manakai-expanded: true;
9898 wakaba 1.18 text-content: '!';
9899     }
9900 wakaba 1.10 }
9901     }
9902     }
9903     @@XMLTest:
9904 wakaba 1.18 @@@QName: xp.attval.reptxt.hcr.2.test
9905 wakaba 1.10 @@@DEnt:
9906     @@@@test:value:
9907 wakaba 1.18 <!DOCTYPE e [
9908     <!ENTITY ent "aaaaa&#38;#x21;bbbbb">
9909 wakaba 1.10 ]>
9910 wakaba 1.18 <e a="&ent;"/>
9911 wakaba 1.10 @@@test:domTree:
9912     document {
9913     document-type { }
9914     element {
9915     attribute {
9916 wakaba 1.18 node-name: 'a';
9917     general-entity-reference {
9918     node-name: 'ent';
9919 wakaba 1.34 manakai-expanded: true;
9920 wakaba 1.18 text-content: 'aaaaa!bbbbb';
9921 wakaba 1.31 text {
9922     text-content: 'aaaaa!bbbbb';
9923     }
9924 wakaba 1.18 }
9925 wakaba 1.10 }
9926     }
9927     }
9928     @@XMLTest:
9929 wakaba 1.18 @@@QName: xp.attval.reptxt.reptxt.hcr.1.test
9930 wakaba 1.10 @@@DEnt:
9931     @@@@test:value:
9932 wakaba 1.18 <!DOCTYPE e [
9933     <!ENTITY ent "&#38;#x21;">
9934     <!ENTITY ent2 "&ent;">
9935 wakaba 1.10 ]>
9936 wakaba 1.18 <e a="&ent2;"/>
9937 wakaba 1.10 @@@test:domTree:
9938     document {
9939     document-type { }
9940     element {
9941     attribute {
9942 wakaba 1.18 node-name: 'a';
9943     general-entity-reference {
9944     node-name: 'ent2';
9945 wakaba 1.34 manakai-expanded: true;
9946 wakaba 1.18 general-entity-reference {
9947     node-name: 'ent';
9948 wakaba 1.34 manakai-expanded: true;
9949 wakaba 1.18 text-content: '!';
9950     }
9951     }
9952 wakaba 1.10 }
9953     }
9954     }
9955     @@XMLTest:
9956 wakaba 1.18 @@@QName: xp.attval.reptxt.reptxt.hcr.2.test
9957 wakaba 1.10 @@@DEnt:
9958     @@@@test:value:
9959 wakaba 1.18 <!DOCTYPE e [
9960     <!ENTITY ent "aa&#38;#x21;bb">
9961     <!ENTITY ent2 "&ent;">
9962 wakaba 1.10 ]>
9963 wakaba 1.18 <e a="&ent2;"/>
9964 wakaba 1.10 @@@test:domTree:
9965     document {
9966     document-type { }
9967     element {
9968     attribute {
9969 wakaba 1.18 node-name: 'a';
9970     general-entity-reference {
9971     node-name: 'ent2';
9972 wakaba 1.34 manakai-expanded: true;
9973 wakaba 1.18 general-entity-reference {
9974     node-name: 'ent';
9975 wakaba 1.34 manakai-expanded: true;
9976 wakaba 1.18 text-content: 'aa!bb';
9977     }
9978     }
9979 wakaba 1.11 }
9980     }
9981     }
9982    
9983     @@XMLTest:
9984 wakaba 1.18 @@@QName: xp.element.content.ncr.legal.char.1.0.1.test
9985     @@@DEnt:
9986     @@@@test:value:
9987     <?xml version="1.0"?>
9988     <e>&#0;</e>
9989     @@@c:erred: <[[xp|wf-legal-character]]> { (2, 4)..(2, 7); }
9990     @@XMLTest:
9991     @@@QName: xp.element.content.ncr.legal.char.1.1.1.test
9992     @@@DEnt:
9993     @@@@test:value:
9994     <?xml version="1.1"?>
9995     <e>&#0;</e>
9996     @@@c:erred: <[[xp|wf-legal-character]]> { (2, 4)..(2, 7); }
9997     @@XMLTest:
9998     @@@QName: xp.element.content.ncr.legal.char.1.0.2.test
9999     @@@DEnt:
10000     @@@@test:value:
10001     <?xml version="1.0"?>
10002     <e>&#1;</e>
10003     @@@c:erred: <[[xp|wf-legal-character]]> { (2, 4)..(2, 7); }
10004     @@XMLTest:
10005     @@@QName: xp.element.content.ncr.legal.char.1.1.2.test
10006 wakaba 1.11 @@@DEnt:
10007     @@@@test:value:
10008 wakaba 1.18 <?xml version="1.1"?>
10009     <e>&#1;</e>
10010 wakaba 1.11 @@@test:domTree:
10011     document {
10012 wakaba 1.18 xml-version: '1.1';
10013 wakaba 1.11 element {
10014 wakaba 1.18 text-content: U+0001;
10015 wakaba 1.11 }
10016     }
10017     @@XMLTest:
10018 wakaba 1.18 @@@QName: xp.element.content.hcr.legal.char.1.0.1.test
10019     @@@DEnt:
10020     @@@@test:value:
10021     <?xml version="1.0"?>
10022     <e>&#x0;</e>
10023     @@@c:erred: <[[xp|wf-legal-character]]> { (2, 4)..(2, 8); }
10024     @@XMLTest:
10025     @@@QName: xp.element.content.hcr.legal.char.1.1.1.test
10026     @@@DEnt:
10027     @@@@test:value:
10028     <?xml version="1.1"?>
10029     <e>&#x0;</e>
10030     @@@c:erred: <[[xp|wf-legal-character]]> { (2, 4)..(2, 8); }
10031     @@XMLTest:
10032     @@@QName: xp.element.content.hcr.legal.char.1.0.2.test
10033 wakaba 1.11 @@@DEnt:
10034     @@@@test:value:
10035 wakaba 1.18 <?xml version="1.0"?>
10036     <e>&#x1;</e>
10037     @@@c:erred: <[[xp|wf-legal-character]]> { (2, 4)..(2, 8); }
10038 wakaba 1.11 @@XMLTest:
10039 wakaba 1.18 @@@QName: xp.element.content.hcr.legal.char.1.1.2.test
10040 wakaba 1.11 @@@DEnt:
10041     @@@@test:value:
10042 wakaba 1.18 <?xml version="1.1"?>
10043     <e>&#x1;</e>
10044 wakaba 1.11 @@@test:domTree:
10045     document {
10046 wakaba 1.18 xml-version: '1.1';
10047 wakaba 1.11 element {
10048 wakaba 1.18 text-content: U+0001;
10049 wakaba 1.6 }
10050     }
10051    
10052 wakaba 1.19 @@XMLTest:
10053     @@@QName: xp.element.content.ger.entity.declared.nodtd.1.test
10054     @@@DEnt:
10055     @@@@test:value:
10056     <p>&entity;</p>
10057     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 4)..(1, 11); }
10058     @@XMLTest:
10059     @@@QName: xp.element.content.ger.entity.declared.nodtd.2.test
10060     @@@DEnt:
10061     @@@@test:value:
10062     <?xml version="1.0" standalone="yes"?>
10063     <p>&entity;</p>
10064     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 4)..(2, 11); }
10065     @@XMLTest:
10066     @@@QName: xp.element.content.ger.entity.declared.nodtd.3.test
10067     @@@DEnt:
10068     @@@@test:value:
10069     <?xml version="1.0" standalone="no"?>
10070     <p>&entity;</p>
10071     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 4)..(2, 11); }
10072     @@XMLTest:
10073     @@@QName: xp.element.content.ger.entity.declared.nodtd.-1.test
10074     @@@DEnt:
10075     @@@@test:value:
10076     <p>&lt;&gt;&amp;&quot;&apos;</p>
10077     @@@test:domTree:
10078     document {
10079     element {
10080     text-content: '<>&"' U+0027;
10081     }
10082     }
10083     @@XMLTest:
10084     @@@QName: xp.element.content.ger.entity.declared.nopref.1.test
10085     @@@DEnt:
10086     @@@@test:value:
10087     <!DOCTYPE p []>
10088     <p>&entity;</p>
10089     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 4)..(2, 11); }
10090     @@XMLTest:
10091     @@@QName: xp.element.content.ger.entity.declared.nopref.2.test
10092     @@@DEnt:
10093     @@@@test:value:
10094     <!DOCTYPE p [
10095     <!ENTITY other "aa">
10096     <!ENTITY % another "aa">
10097     ]>
10098     <p>&entity;</p>
10099     @@@c:erred: <[[xp|wf-entity-declared]]> { (5, 4)..(5, 11); }
10100     @@XMLTest:
10101     @@@QName: xp.element.content.ger.entity.declared.nopref.3.test
10102     @@@DEnt:
10103     @@@@test:value:
10104     <?xml version="1.0" standalone="yes"?>
10105     <!DOCTYPE p []>
10106     <p>&entity;</p>
10107     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 4)..(3, 11); }
10108     @@XMLTest:
10109     @@@QName: xp.element.content.ger.entity.declared.nopref.4.test
10110     @@@DEnt:
10111     @@@@test:value:
10112     <?xml version="1.0" standalone="no"?>
10113     <!DOCTYPE p []>
10114     <p>&entity;</p>
10115     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 4)..(3, 11); }
10116     @@XMLTest:
10117     @@@QName: xp.element.content.ger.entity.declared.nopref.5.test
10118     @@@DEnt:
10119     @@@@test:value:
10120     <?xml version="1.0" standalone="yes"?>
10121     <!DOCTYPE p [
10122     <!ENTITY other "aa">
10123     <!ENTITY % another "aa">
10124     ]>
10125     <p>&entity;</p>
10126     @@@c:erred: <[[xp|wf-entity-declared]]> { (6, 4)..(6, 11); }
10127     @@XMLTest:
10128     @@@QName: xp.element.content.ger.entity.declared.nopref.6.test
10129     @@@DEnt:
10130     @@@@test:value:
10131     <?xml version="1.0" standalone="no"?>
10132     <!DOCTYPE p [
10133     <!ENTITY other "aa">
10134     <!ENTITY % another "aa">
10135     ]>
10136     <p>&entity;</p>
10137     @@@c:erred: <[[xp|wf-entity-declared]]> { (6, 4)..(6, 11); }
10138     @@XMLTest:
10139     @@@QName: xp.element.content.ger.entity.declared.nopref.-1.test
10140     @@@DEnt:
10141     @@@@test:value:
10142     <!DOCTYPE p [
10143     <!ENTITY entity "value">
10144     ]>
10145     <p>&entity;</p>
10146 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
10147 wakaba 1.19 @@@test:domTree:
10148     document {
10149     document-type {
10150     general-entity {
10151     node-name: 'entity';
10152     text-content: 'value';
10153     }
10154     }
10155     element {
10156 wakaba 1.20 general-entity-reference {
10157 wakaba 1.19 node-name: 'entity';
10158 wakaba 1.34 manakai-expanded: true;
10159 wakaba 1.19 text-content: 'value';
10160     }
10161     }
10162     }
10163     @@XMLTest:
10164     @@@QName: xp.element.content.ger.entity.declared.nopref.-2.test
10165     @@@DEnt:
10166     @@@@test:value:
10167     <!DOCTYPE p [
10168     <!ENTITY entity "value">
10169     <!ENTITY another SYSTEM "another">
10170     ]>
10171     <p>&entity;</p>
10172 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
10173 wakaba 1.19 @@@test:domTree:
10174     document {
10175     document-type {
10176     general-entity {
10177     node-name: 'entity';
10178     text-content: 'value';
10179     }
10180 wakaba 1.20 general-entity {
10181     node-name: 'another';
10182     public-id: null;
10183     system-id: 'another';
10184     }
10185 wakaba 1.19 }
10186     element {
10187 wakaba 1.20 general-entity-reference {
10188 wakaba 1.19 node-name: 'entity';
10189 wakaba 1.34 manakai-expanded: true;
10190 wakaba 1.19 text-content: 'value';
10191     }
10192     }
10193     }
10194     @@XMLTest:
10195     @@@QName: xp.element.content.ger.entity.declared.standalone.1.test
10196     @@@DEnt:
10197     @@@@test:value:
10198     <?xml version="1.0" standalone="yes"?>
10199     <p>&entity;</p>
10200     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 4)..(2, 11); }
10201     @@XMLTest:
10202     @@@QName: xp.element.content.ger.entity.declared.standalone.2.test
10203     @@@DEnt:
10204     @@@@test:value:
10205     <?xml version="1.0" standalone="yes"?>
10206     <!DOCTYPE p []>
10207     <p>&entity;</p>
10208     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 4)..(3, 11); }
10209     @@XMLTest:
10210     @@@QName: xp.element.content.ger.entity.declared.standalone.3.test
10211     @@@DEnt:
10212     @@@@test:value:
10213     <?xml version="1.0" standalone="yes"?>
10214     <!DOCTYPE p [
10215     <!ENTITY % para "<!-- -->">
10216     %para;
10217     ]>
10218     <p>&entity;</p>
10219     @@@c:erred: <[[xp|wf-entity-declared]]> { (6, 4)..(6, 11); }
10220     @@XMLTest:
10221     @@@QName: xp.element.content.ger.entity.declared.standalone.-1.test
10222     @@@DEnt:
10223     @@@@test:value:
10224     <?xml version="1.0" standalone="no"?>
10225     <!DOCTYPE p [
10226     <!ENTITY % para "<!-- -->">
10227     %para;
10228     ]>
10229     <p>&entity;</p>
10230     @@@test:domTree:
10231     document {
10232     document-type { }
10233     element {
10234     general-entity-reference {
10235 wakaba 1.34 manakai-expanded: false;
10236 wakaba 1.19 }
10237     }
10238     }
10239     @@XMLTest:
10240     @@@QName: xp.element.content.ger.entity.declared.standalone.-2.test
10241     @@@DEnt:
10242     @@@@test:value:
10243     <!DOCTYPE p [
10244     <!ENTITY % para "<!-- -->">
10245     %para;
10246     ]>
10247     <p>&entity;</p>
10248     @@@test:domTree:
10249     document {
10250     document-type { }
10251     element {
10252     general-entity-reference {
10253 wakaba 1.34 manakai-expanded: false;
10254 wakaba 1.19 }
10255     }
10256     }
10257     @@XMLTest:
10258     @@@QName: xp.element.content.ger.entity.declared.standalone.4.test
10259     @@@DEnt:
10260     @@@@test:value:
10261     <?xml version="1.0" standalone="yes"?>
10262     <!DOCTYPE p [
10263     <!ENTITY % para SYSTEM "para">
10264     %para;
10265     ]>
10266     <p>&entity;</p>
10267     @@@c:erred: <[[xp|wf-entity-declared]]> { (6, 4)..(6, 11); }
10268     @@XMLTest:
10269     @@@QName: xp.element.content.ger.entity.declared.standalone.-3.test
10270     @@@DEnt:
10271     @@@@test:value:
10272     <?xml version="1.0" standalone="no"?>
10273     <!DOCTYPE p [
10274     <!ENTITY % para SYSTEM "para">
10275     %para;
10276     ]>
10277     <p>&entity;</p>
10278     @@@test:domTree:
10279     document {
10280     document-type { }
10281     element {
10282     general-entity-reference {
10283 wakaba 1.34 manakai-expanded: false;
10284 wakaba 1.19 }
10285     }
10286     }
10287     @@XMLTest:
10288     @@@QName: xp.element.content.ger.entity.declared.standalone.-4.test
10289     @@@DEnt:
10290     @@@@test:value:
10291     <!DOCTYPE p [
10292     <!ENTITY % para SYSTEM "para">
10293     %para;
10294     ]>
10295     <p>&entity;</p>
10296     @@@test:domTree:
10297     document {
10298     document-type { }
10299     element {
10300     general-entity-reference {
10301 wakaba 1.34 manakai-expanded: false;
10302 wakaba 1.19 }
10303     }
10304     }
10305     @@XMLTest:
10306     @@@QName: xp.element.content.ger.entity.declared.standalone.5.test
10307     @@@DEnt:
10308     @@@@test:value:
10309     <?xml version="1.0" standalone="yes"?>
10310     <!DOCTYPE p SYSTEM "dtd">
10311     <p>&entity;</p>
10312     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 4)..(3, 11); }
10313     @@XMLTest:
10314     @@@QName: xp.element.content.ger.entity.declared.standalone.-5.test
10315     @@@DEnt:
10316     @@@@test:value:
10317     <?xml version="1.0" standalone="no"?>
10318     <!DOCTYPE p SYSTEM "dtd">
10319     <p>&entity;</p>
10320     @@@test:domTree:
10321     document {
10322     document-type { }
10323     element {
10324     general-entity-reference {
10325 wakaba 1.34 manakai-expanded: false;
10326 wakaba 1.19 }
10327     }
10328     }
10329     @@XMLTest:
10330     @@@QName: xp.element.content.ger.entity.declared.standalone.-6.test
10331     @@@DEnt:
10332     @@@@test:value:
10333     <!DOCTYPE p SYSTEM "dtd">
10334     <p>&entity;</p>
10335     @@@test:domTree:
10336     document {
10337     document-type { }
10338     element {
10339     general-entity-reference {
10340 wakaba 1.34 manakai-expanded: false;
10341 wakaba 1.19 }
10342     }
10343     }
10344    
10345 wakaba 1.20 @@XMLTest:
10346     @@@QName: xp.reptxt.element.content.ger.entity.declared.nopref.1.test
10347     @@@DEnt:
10348     @@@@test:value:
10349     <!DOCTYPE p [
10350     <!ENTITY c "&entity;">
10351     ]>
10352     <p>&c;</p>
10353     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
10354     @@XMLTest:
10355     @@@QName: xp.reptxt.element.content.ger.entity.declared.nopref.2.test
10356     @@@DEnt:
10357     @@@@test:value:
10358     <!DOCTYPE p [
10359     <!ENTITY other "aa">
10360     <!ENTITY % another "aa">
10361     <!ENTITY c "&entity;">
10362     ]>
10363     <p>&c;</p>
10364     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
10365     @@XMLTest:
10366     @@@QName: xp.reptxt.element.content.ger.entity.declared.nopref.3.test
10367     @@@DEnt:
10368     @@@@test:value:
10369     <?xml version="1.0" standalone="yes"?>
10370     <!DOCTYPE p [
10371     <!ENTITY c "&entity;">
10372     ]>
10373     <p>&c;</p>
10374     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
10375     @@XMLTest:
10376     @@@QName: xp.reptxt.element.content.ger.entity.declared.nopref.4.test
10377     @@@DEnt:
10378     @@@@test:value:
10379     <?xml version="1.0" standalone="no"?>
10380     <!DOCTYPE p [
10381     <!ENTITY c "&entity;">
10382     ]>
10383     <p>&c;</p>
10384     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
10385     @@XMLTest:
10386     @@@QName: xp.reptxt.element.content.ger.entity.declared.nopref.5.test
10387     @@@DEnt:
10388     @@@@test:value:
10389     <?xml version="1.0" standalone="yes"?>
10390     <!DOCTYPE p [
10391     <!ENTITY other "aa">
10392     <!ENTITY % another "aa">
10393     <!ENTITY c "&entity;">
10394     ]>
10395     <p>&c;</p>
10396     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
10397     @@XMLTest:
10398     @@@QName: xp.reptxt.element.content.ger.entity.declared.nopref.6.test
10399     @@@DEnt:
10400     @@@@test:value:
10401     <?xml version="1.0" standalone="no"?>
10402     <!DOCTYPE p [
10403     <!ENTITY other "aa">
10404     <!ENTITY % another "aa">
10405     <!ENTITY c "&entity;">
10406     ]>
10407     <p>&c;</p>
10408     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
10409     @@XMLTest:
10410     @@@QName: xp.reptxt.element.content.ger.entity.declared.nopref.-1.test
10411     @@@DEnt:
10412     @@@@test:value:
10413     <!DOCTYPE p [
10414     <!ENTITY entity "value">
10415     <!ENTITY c "&entity;">
10416     ]>
10417     <p>&c;</p>
10418 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
10419 wakaba 1.20 @@@test:domTree:
10420     document {
10421     document-type {
10422     general-entity {
10423     node-name: 'entity';
10424     text-content: 'value';
10425     }
10426     general-entity {
10427     node-name: 'c';
10428     general-entity-reference {
10429     node-name: 'entity';
10430     text-content: 'value';
10431     }
10432     }
10433     }
10434     element {
10435     general-entity-reference {
10436     node-name: 'c';
10437     general-entity-reference {
10438     node-name: 'entity';
10439     text-content: 'value';
10440     }
10441     }
10442     }
10443     }
10444     @@XMLTest:
10445     @@@QName: xp.reptxt.element.content.ger.entity.declared.nopref.-2.test
10446     @@@DEnt:
10447     @@@@test:value:
10448     <!DOCTYPE p [
10449     <!ENTITY entity "value">
10450     <!ENTITY another SYSTEM "another">
10451     <!ENTITY c "&entity;">
10452     ]>
10453     <p>&c;</p>
10454 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
10455 wakaba 1.20 @@@test:domTree:
10456     document {
10457     document-type {
10458     general-entity {
10459     node-name: 'entity';
10460     text-content: 'value';
10461     }
10462     general-entity {
10463     node-name: 'c';
10464     general-entity-reference {
10465     node-name: 'entity';
10466 wakaba 1.34 manakai-expanded: true;
10467 wakaba 1.20 text-content: 'value';
10468     }
10469     }
10470     general-entity {
10471     node-name: 'another';
10472     public-id: null;
10473     system-id: 'another';
10474     has-replacement-tree: false;
10475     }
10476     }
10477     element {
10478     general-entity-reference {
10479     node-name: 'c';
10480 wakaba 1.34 manakai-expanded: true;
10481 wakaba 1.20 general-entity-reference {
10482     node-name: 'entity';
10483 wakaba 1.34 manakai-expanded: true;
10484 wakaba 1.20 text-content: 'value';
10485     }
10486     }
10487     }
10488     }
10489     @@XMLTest:
10490     @@@QName: xp.reptxt.element.content.ger.entity.declared.standalone.2.test
10491     @@@DEnt:
10492     @@@@test:value:
10493     <?xml version="1.0" standalone="yes"?>
10494     <!DOCTYPE p [
10495     <!ENTITY c "&entity;">
10496     ]>
10497     <p>&c;</p>
10498     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
10499     @@XMLTest:
10500     @@@QName: xp.reptxt.element.content.ger.entity.declared.standalone.3.test
10501     @@@DEnt:
10502     @@@@test:value:
10503     <?xml version="1.0" standalone="yes"?>
10504     <!DOCTYPE p [
10505     <!ENTITY % para "<!-- -->">
10506     %para;
10507     <!ENTITY c "&entity;">
10508     ]>
10509     <p>&c;</p>
10510     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
10511     @@XMLTest:
10512     @@@QName: xp.reptxt.element.content.ger.entity.declared.standalone.-1.test
10513     @@@DEnt:
10514     @@@@test:value:
10515     <?xml version="1.0" standalone="no"?>
10516     <!DOCTYPE p [
10517     <!ENTITY c "&entity;">
10518     <!ENTITY % para "<!-- -->">
10519     %para;
10520     ]>
10521     <p>&c;</p>
10522 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
10523 wakaba 1.20 @@@test:domTree:
10524     document {
10525     document-type {
10526     general-entity {
10527     node-name: 'c';
10528     general-entity-reference {
10529     node-name: 'entity';
10530 wakaba 1.34 manakai-expanded: false;
10531 wakaba 1.20 }
10532     }
10533     }
10534     element {
10535     general-entity-reference {
10536     node-name: 'c';
10537     general-entity-reference {
10538     node-name: 'entity';
10539 wakaba 1.34 manakai-expanded: false;
10540 wakaba 1.20 }
10541     }
10542     }
10543     }
10544     @@XMLTest:
10545     @@@QName:
10546     xp.reptxt.element.content.ger.entity.declared.standalone.-1.2.test
10547     @@@DEnt:
10548     @@@@test:value:
10549     <?xml version="1.0" standalone="no"?>
10550     <!DOCTYPE p [
10551     <!ENTITY % para "<!-- -->">
10552     %para;
10553     <!ENTITY c "&entity;">
10554     ]>
10555     <p>&c;</p>
10556     @@@test:domTree:
10557     document {
10558     document-type { }
10559     element {
10560     general-entity-reference {
10561     node-name: 'c';
10562 wakaba 1.34 manakai-expanded: false;
10563 wakaba 1.20 }
10564     }
10565     }
10566     @@XMLTest:
10567     @@@QName: xp.reptxt.element.content.ger.entity.declared.standalone.-2.test
10568     @@@DEnt:
10569     @@@@test:value:
10570     <!DOCTYPE p [
10571     <!ENTITY c "&entity;">
10572     <!ENTITY % para "<!-- -->">
10573     %para;
10574     ]>
10575     <p>&c;</p>
10576     @@@test:domTree:
10577     document {
10578     document-type { }
10579     element {
10580     general-entity-reference {
10581     node-name: 'c';
10582 wakaba 1.34 manakai-expanded: true;
10583 wakaba 1.20 general-entity-reference {
10584     node-name: 'entity';
10585 wakaba 1.34 manakai-expanded: false;
10586 wakaba 1.20 }
10587     }
10588     }
10589     }
10590     @@XMLTest:
10591     @@@QName:
10592     xp.reptxt.element.content.ger.entity.declared.standalone.-2.2.test
10593     @@@DEnt:
10594     @@@@test:value:
10595     <!DOCTYPE p [
10596     <!ENTITY % para "<!-- -->">
10597     %para;
10598     <!ENTITY c "&entity;">
10599     ]>
10600     <p>&c;</p>
10601     @@@test:domTree:
10602     document {
10603     document-type { }
10604     element {
10605     general-entity-reference {
10606     node-name: 'c';
10607 wakaba 1.34 manakai-expanded: false;
10608 wakaba 1.20 }
10609     }
10610     }
10611     @@XMLTest:
10612     @@@QName: xp.reptxt.element.content.ger.entity.declared.standalone.4.test
10613     @@@DEnt:
10614     @@@@test:value:
10615     <?xml version="1.0" standalone="yes"?>
10616     <!DOCTYPE p [
10617     <!ENTITY % para SYSTEM "para">
10618     %para;
10619     <!ENTITY c "&entity;">
10620     ]>
10621     <p>&c;</p>
10622     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
10623     @@XMLTest:
10624     @@@QName: xp.reptxt.element.content.ger.entity.declared.standalone.-3.test
10625     @@@DEnt:
10626     @@@@test:value:
10627     <?xml version="1.0" standalone="no"?>
10628     <!DOCTYPE p [
10629     <!ENTITY c "&entity;">
10630     <!ENTITY % para SYSTEM "para">
10631     %para;
10632     ]>
10633     <p>&c;</p>
10634     @@@test:domTree:
10635     document {
10636     document-type { }
10637     element {
10638     general-entity-reference {
10639     node-name: 'c';
10640 wakaba 1.34 manakai-expanded: true;
10641 wakaba 1.20 general-entity-reference {
10642     node-name: 'entity';
10643 wakaba 1.34 manakai-expanded: false;
10644 wakaba 1.20 }
10645     }
10646     }
10647     }
10648     @@XMLTest:
10649     @@@QName:
10650     xp.reptxt.element.content.ger.entity.declared.standalone.-3.2.test
10651     @@@DEnt:
10652     @@@@test:value:
10653     <?xml version="1.0" standalone="no"?>
10654     <!DOCTYPE p [
10655     <!ENTITY % para SYSTEM "para">
10656     %para;
10657     <!ENTITY c "&entity;">
10658     ]>
10659     <p>&c;</p>
10660     @@@test:domTree:
10661     document {
10662     document-type { }
10663     element {
10664     general-entity-reference {
10665     node-name: 'c';
10666 wakaba 1.34 manakai-expanded: false;
10667 wakaba 1.20 }
10668     }
10669     }
10670     @@XMLTest:
10671     @@@QName: xp.reptxt.element.content.ger.entity.declared.standalone.-4.test
10672     @@@DEnt:
10673     @@@@test:value:
10674     <!DOCTYPE p [
10675     <!ENTITY c "&entity;">
10676     <!ENTITY % para SYSTEM "para">
10677     %para;
10678     ]>
10679     <p>&c;</p>
10680     @@@test:domTree:
10681     document {
10682     document-type { }
10683     element {
10684     general-entity-reference {
10685     node-name: 'c';
10686 wakaba 1.34 manakai-expanded: true;
10687 wakaba 1.20 general-entity-reference {
10688     node-name: 'entity';
10689 wakaba 1.34 manakai-expanded: false;
10690 wakaba 1.20 }
10691     }
10692     }
10693     }
10694     @@XMLTest:
10695     @@@QName:
10696     xp.reptxt.element.content.ger.entity.declared.standalone.-4.2.test
10697     @@@DEnt:
10698     @@@@test:value:
10699     <!DOCTYPE p [
10700     <!ENTITY % para SYSTEM "para">
10701     %para;
10702     <!ENTITY c "&entity;">
10703     ]>
10704     <p>&c;</p>
10705     @@@test:domTree:
10706     document {
10707     document-type { }
10708     element {
10709     general-entity-reference {
10710     node-name: 'c';
10711 wakaba 1.34 manakai-expanded: false;
10712 wakaba 1.20 }
10713     }
10714     }
10715     @@XMLTest:
10716     @@@QName: xp.reptxt.element.content.ger.entity.declared.standalone.5.test
10717     @@@DEnt:
10718     @@@@test:value:
10719     <?xml version="1.0" standalone="yes"?>
10720     <!DOCTYPE p SYSTEM "dtd" [
10721     <!ENTITY c "&entity;">
10722     ]>
10723     <p>&c;</p>
10724     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
10725     @@XMLTest:
10726     @@@QName: xp.reptxt.element.content.ger.entity.declared.standalone.-5.test
10727     @@@DEnt:
10728     @@@@test:value:
10729     <?xml version="1.0" standalone="no"?>
10730     <!DOCTYPE p SYSTEM "dtd" [
10731     <!ENTITY c "&entity;">
10732     ]>
10733     <p>&c;</p>
10734     @@@test:domTree:
10735     document {
10736     document-type { }
10737     element {
10738     general-entity-reference {
10739     node-name: 'c';
10740 wakaba 1.34 manakai-expanded: true;
10741 wakaba 1.20 general-entity-reference {
10742     node-name: 'entity';
10743 wakaba 1.34 manakai-expanded: false;
10744 wakaba 1.20 }
10745     }
10746     }
10747     }
10748     @@XMLTest:
10749     @@@QName: xp.reptxt.element.content.ger.entity.declared.standalone.-6.test
10750     @@@DEnt:
10751     @@@@test:value:
10752     <!DOCTYPE p SYSTEM "dtd" [<!ENTITY c "&entity;">]>
10753     <p>&c;</p>
10754     @@@test:domTree:
10755     document {
10756     document-type { }
10757     element {
10758     general-entity-reference {
10759     node-name: 'c';
10760 wakaba 1.34 manakai-expanded: true;
10761 wakaba 1.20 general-entity-reference {
10762     node-name: 'entity';
10763 wakaba 1.34 manakai-expanded: false;
10764 wakaba 1.20 }
10765     }
10766     }
10767     }
10768    
10769     @@XMLTest:
10770     @@@QName: xp.attval.ger.entity.declared.nodtd.1.test
10771     @@@DEnt:
10772     @@@@test:value:
10773     <p a="&entity;"/>
10774     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 7)..(1, 14); }
10775     @@XMLTest:
10776     @@@QName: xp.attval.ger.entity.declared.nodtd.2.test
10777     @@@DEnt:
10778     @@@@test:value:
10779     <?xml version="1.0" standalone="yes"?>
10780     <p a="&entity;"/>
10781     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 7)..(2, 14); }
10782     @@XMLTest:
10783     @@@QName: xp.attval.ger.entity.declared.nodtd.3.test
10784     @@@DEnt:
10785     @@@@test:value:
10786     <?xml version="1.0" standalone="no"?>
10787     <p a="&entity;"/>
10788     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 7)..(2, 14); }
10789     @@XMLTest:
10790     @@@QName: xp.attval.ger.entity.declared.nodtd.-1.test
10791     @@@DEnt:
10792     @@@@test:value:
10793     <p a="&lt;&gt;&amp;&quot;&apos;"/>
10794     @@@test:domTree:
10795     document {
10796     element {
10797     attribute {
10798     node-name: 'a';
10799     text-content: '<>&"' U+0027;
10800     }
10801     }
10802     }
10803     @@XMLTest:
10804     @@@QName: xp.attval.ger.entity.declared.nopref.1.test
10805     @@@DEnt:
10806     @@@@test:value:
10807     <!DOCTYPE p []>
10808     <p a="&entity;"/>
10809     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 7)..(2, 14); }
10810     @@XMLTest:
10811     @@@QName: xp.attval.ger.entity.declared.nopref.2.test
10812     @@@DEnt:
10813     @@@@test:value:
10814     <!DOCTYPE p [
10815     <!ENTITY other "aa">
10816     <!ENTITY % another "aa">
10817     ]>
10818     <p a="&entity;"/>
10819     @@@c:erred: <[[xp|wf-entity-declared]]> { (5, 7)..(5, 14); }
10820     @@XMLTest:
10821     @@@QName: xp.attval.ger.entity.declared.nopref.3.test
10822     @@@DEnt:
10823     @@@@test:value:
10824     <?xml version="1.0" standalone="yes"?>
10825     <!DOCTYPE p []>
10826     <p a="&entity;"/>
10827     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 7)..(3, 14); }
10828     @@XMLTest:
10829     @@@QName: xp.attval.ger.entity.declared.nopref.4.test
10830     @@@DEnt:
10831     @@@@test:value:
10832     <?xml version="1.0" standalone="no"?>
10833     <!DOCTYPE p []>
10834     <p a="&entity;"/>
10835     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 7)..(3, 14); }
10836     @@XMLTest:
10837     @@@QName: xp.attval.ger.entity.declared.nopref.5.test
10838     @@@DEnt:
10839     @@@@test:value:
10840     <?xml version="1.0" standalone="yes"?>
10841     <!DOCTYPE p [
10842     <!ENTITY other "aa">
10843     <!ENTITY % another "aa">
10844     ]>
10845     <p a="&entity;"/>
10846     @@@c:erred: <[[xp|wf-entity-declared]]> { (6, 7)..(6, 14); }
10847     @@XMLTest:
10848     @@@QName: xp.attval.ger.entity.declared.nopref.6.test
10849     @@@DEnt:
10850     @@@@test:value:
10851     <?xml version="1.0" standalone="no"?>
10852     <!DOCTYPE p [
10853     <!ENTITY other "aa">
10854     <!ENTITY % another "aa">
10855     ]>
10856     <p a="&entity;"/>
10857     @@@c:erred: <[[xp|wf-entity-declared]]> { (6, 7)..(6, 14); }
10858     @@XMLTest:
10859     @@@QName: xp.attval.ger.entity.declared.nopref.-1.test
10860     @@@DEnt:
10861     @@@@test:value:
10862     <!DOCTYPE p [
10863     <!ENTITY entity "value">
10864     ]>
10865     <p a="&entity;"/>
10866 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
10867 wakaba 1.20 @@@test:domTree:
10868     document {
10869     document-type {
10870     general-entity {
10871     node-name: 'entity';
10872     text-content: 'value';
10873     }
10874     }
10875     element {
10876     attribute {
10877     node-name: 'a';
10878     general-entity-reference {
10879     node-name: 'entity';
10880 wakaba 1.34 manakai-expanded: true;
10881 wakaba 1.20 text-content: 'value';
10882     }
10883     }
10884     }
10885     }
10886     @@XMLTest:
10887     @@@QName: xp.attval.ger.entity.declared.nopref.-2.test
10888     @@@DEnt:
10889     @@@@test:value:
10890     <!DOCTYPE p [
10891     <!ENTITY entity "value">
10892     <!ENTITY another SYSTEM "another">
10893     ]>
10894     <p a="&entity;"/>
10895 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
10896 wakaba 1.20 @@@test:domTree:
10897     document {
10898     document-type {
10899     general-entity {
10900     node-name: 'entity';
10901     text-content: 'value';
10902     has-replacement-tree: true;
10903     }
10904     general-entity {
10905     node-name: 'another';
10906     public-id: null;
10907     system-id: 'another';
10908     has-replacement-tree: false;
10909     }
10910     }
10911     element {
10912     attribute {
10913     node-name: 'a';
10914     general-entity-reference {
10915     node-name: 'entity';
10916 wakaba 1.34 manakai-expanded: true;
10917 wakaba 1.20 text-content: 'value';
10918     }
10919     }
10920     }
10921     }
10922     @@XMLTest:
10923     @@@QName: xp.attval.ger.entity.declared.standalone.1.test
10924     @@@DEnt:
10925     @@@@test:value:
10926     <?xml version="1.0" standalone="yes"?>
10927     <p a="&entity;"/>
10928     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 7)..(2, 14); }
10929     @@XMLTest:
10930     @@@QName: xp.attval.ger.entity.declared.standalone.2.test
10931     @@@DEnt:
10932     @@@@test:value:
10933     <?xml version="1.0" standalone="yes"?>
10934     <!DOCTYPE p []>
10935     <p a="&entity;"/>
10936     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 7)..(3, 14); }
10937     @@XMLTest:
10938     @@@QName: xp.attval.ger.entity.declared.standalone.3.test
10939     @@@DEnt:
10940     @@@@test:value:
10941     <?xml version="1.0" standalone="yes"?>
10942     <!DOCTYPE p [
10943     <!ENTITY % para "<!-- -->">
10944     %para;
10945     ]>
10946     <p a="&entity;"/>
10947     @@@c:erred: <[[xp|wf-entity-declared]]> { (6, 7)..(6, 14); }
10948     @@XMLTest:
10949     @@@QName: xp.attval.ger.entity.declared.standalone.-1.test
10950     @@@DEnt:
10951     @@@@test:value:
10952     <?xml version="1.0" standalone="no"?>
10953     <!DOCTYPE p [
10954     <!ENTITY % para "<!-- -->">
10955     %para;
10956     ]>
10957     <p a="&entity;"/>
10958     @@@test:domTree:
10959     document {
10960     document-type { }
10961     element {
10962     attribute {
10963     node-name: 'a';
10964     general-entity-reference {
10965 wakaba 1.34 manakai-expanded: false;
10966 wakaba 1.20 }
10967     }
10968     }
10969     }
10970     @@XMLTest:
10971     @@@QName: xp.attval.ger.entity.declared.standalone.-2.test
10972     @@@DEnt:
10973     @@@@test:value:
10974     <!DOCTYPE p [
10975     <!ENTITY % para "<!-- -->">
10976     %para;
10977     ]>
10978     <p a="&entity;"/>
10979     @@@test:domTree:
10980     document {
10981     document-type { }
10982     element {
10983     attribute {
10984     node-name: 'a';
10985     general-entity-reference {
10986 wakaba 1.34 manakai-expanded: false;
10987 wakaba 1.20 }
10988     }
10989     }
10990     }
10991     @@XMLTest:
10992     @@@QName: xp.attval.ger.entity.declared.standalone.4.test
10993     @@@DEnt:
10994     @@@@test:value:
10995     <?xml version="1.0" standalone="yes"?>
10996     <!DOCTYPE p [
10997     <!ENTITY % para SYSTEM "para">
10998     %para;
10999     ]>
11000     <p a="&entity;"/>
11001     @@@c:erred: <[[xp|wf-entity-declared]]> { (6, 7)..(6, 14); }
11002     @@XMLTest:
11003     @@@QName: xp.attval.ger.entity.declared.standalone.-3.test
11004     @@@DEnt:
11005     @@@@test:value:
11006     <?xml version="1.0" standalone="no"?>
11007     <!DOCTYPE p [
11008     <!ENTITY % para SYSTEM "para">
11009     %para;
11010     ]>
11011     <p a="&entity;"/>
11012     @@@test:domTree:
11013     document {
11014     document-type { }
11015     element {
11016     attribute {
11017     node-name: 'a';
11018     general-entity-reference {
11019 wakaba 1.34 manakai-expanded: false;
11020 wakaba 1.20 }
11021     }
11022     }
11023     }
11024     @@XMLTest:
11025     @@@QName: xp.attval.ger.entity.declared.standalone.-4.test
11026     @@@DEnt:
11027     @@@@test:value:
11028     <!DOCTYPE p [
11029     <!ENTITY % para SYSTEM "para">
11030     %para;
11031     ]>
11032     <p a="&entity;"/>
11033     @@@test:domTree:
11034     document {
11035     document-type { }
11036     element {
11037     attribute {
11038     node-name: 'a';
11039     general-entity-reference {
11040 wakaba 1.34 manakai-expanded: false;
11041 wakaba 1.20 }
11042     }
11043     }
11044     }
11045     @@XMLTest:
11046     @@@QName: xp.attval.ger.entity.declared.standalone.5.test
11047     @@@DEnt:
11048     @@@@test:value:
11049     <?xml version="1.0" standalone="yes"?>
11050     <!DOCTYPE p SYSTEM "dtd">
11051     <p a="&entity;"/>
11052     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 7)..(3, 14); }
11053     @@XMLTest:
11054     @@@QName: xp.attval.ger.entity.declared.standalone.-5.test
11055     @@@DEnt:
11056     @@@@test:value:
11057     <?xml version="1.0" standalone="no"?>
11058     <!DOCTYPE p SYSTEM "dtd">
11059     <p a="&entity;"/>
11060     @@@test:domTree:
11061     document {
11062     document-type { }
11063     element {
11064     attribute {
11065     node-name: 'a';
11066     general-entity-reference {
11067 wakaba 1.34 manakai-expanded: false;
11068 wakaba 1.20 }
11069     }
11070     }
11071     }
11072     @@XMLTest:
11073     @@@QName: xp.attval.ger.entity.declared.standalone.-6.test
11074     @@@DEnt:
11075     @@@@test:value:
11076     <!DOCTYPE p SYSTEM "dtd">
11077     <p a="&entity;"/>
11078     @@@test:domTree:
11079     document {
11080     document-type { }
11081     element {
11082     attribute {
11083     node-name: 'a';
11084     general-entity-reference {
11085 wakaba 1.34 manakai-expanded: false;
11086 wakaba 1.20 }
11087     }
11088     }
11089     }
11090    
11091 wakaba 1.21 @@XMLTest:
11092 wakaba 1.22 @@@QName: xp.reptxt.attval.ger.entity.declared.nopref.1.test
11093 wakaba 1.21 @@@DEnt:
11094     @@@@test:value:
11095     <!DOCTYPE p [
11096 wakaba 1.22 <!ENTITY c "&entity;">
11097 wakaba 1.21 ]>
11098 wakaba 1.22 <p a="&c;"/>
11099     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11100 wakaba 1.21 @@XMLTest:
11101 wakaba 1.22 @@@QName: xp.reptxt.attval.ger.entity.declared.nopref.2.test
11102 wakaba 1.21 @@@DEnt:
11103     @@@@test:value:
11104     <!DOCTYPE p [
11105     <!ENTITY other "aa">
11106     <!ENTITY % another "aa">
11107 wakaba 1.22 <!ENTITY c "&entity;">
11108 wakaba 1.21 ]>
11109 wakaba 1.22 <p a="&c;"/>
11110     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11111 wakaba 1.21 @@XMLTest:
11112 wakaba 1.22 @@@QName: xp.reptxt.attval.ger.entity.declared.nopref.3.test
11113 wakaba 1.21 @@@DEnt:
11114     @@@@test:value:
11115     <?xml version="1.0" standalone="yes"?>
11116     <!DOCTYPE p [
11117 wakaba 1.22 <!ENTITY c "&entity;">
11118 wakaba 1.21 ]>
11119 wakaba 1.22 <p a="&c;"/>
11120     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11121 wakaba 1.21 @@XMLTest:
11122 wakaba 1.22 @@@QName: xp.reptxt.attval.ger.entity.declared.nopref.4.test
11123 wakaba 1.21 @@@DEnt:
11124     @@@@test:value:
11125     <?xml version="1.0" standalone="no"?>
11126     <!DOCTYPE p [
11127 wakaba 1.22 <!ENTITY c "&entity;">
11128 wakaba 1.21 ]>
11129 wakaba 1.22 <p a="&c;"/>
11130     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11131 wakaba 1.21 @@XMLTest:
11132 wakaba 1.22 @@@QName: xp.reptxt.attval.ger.entity.declared.nopref.5.test
11133 wakaba 1.21 @@@DEnt:
11134     @@@@test:value:
11135     <?xml version="1.0" standalone="yes"?>
11136     <!DOCTYPE p [
11137     <!ENTITY other "aa">
11138     <!ENTITY % another "aa">
11139 wakaba 1.22 <!ENTITY c "&entity;">
11140 wakaba 1.21 ]>
11141 wakaba 1.22 <p a="&c;"/>
11142     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11143 wakaba 1.21 @@XMLTest:
11144 wakaba 1.22 @@@QName: xp.reptxt.attval.ger.entity.declared.nopref.6.test
11145 wakaba 1.21 @@@DEnt:
11146     @@@@test:value:
11147     <?xml version="1.0" standalone="no"?>
11148     <!DOCTYPE p [
11149     <!ENTITY other "aa">
11150     <!ENTITY % another "aa">
11151 wakaba 1.22 <!ENTITY c "&entity;">
11152 wakaba 1.21 ]>
11153 wakaba 1.22 <p a="&c;"/>
11154     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11155 wakaba 1.21 @@XMLTest:
11156 wakaba 1.22 @@@QName: xp.reptxt.attval.ger.entity.declared.nopref.-1.test
11157 wakaba 1.21 @@@DEnt:
11158     @@@@test:value:
11159     <!DOCTYPE p [
11160     <!ENTITY entity "value">
11161 wakaba 1.22 <!ENTITY c "&entity;">
11162 wakaba 1.21 ]>
11163 wakaba 1.22 <p a="&c;"/>
11164 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
11165 wakaba 1.21 @@@test:domTree:
11166     document {
11167     document-type {
11168     general-entity {
11169     node-name: 'entity';
11170     text-content: 'value';
11171     }
11172 wakaba 1.22 general-entity {
11173     node-name: 'c';
11174     general-entity-reference {
11175     node-name: 'entity';
11176     text-content: 'value';
11177 wakaba 1.21 }
11178     }
11179     }
11180     element {
11181     attribute {
11182     node-name: 'a';
11183     general-entity-reference {
11184 wakaba 1.22 node-name: 'c';
11185     general-entity-reference {
11186     node-name: 'entity';
11187     text-content: 'value';
11188     }
11189 wakaba 1.21 }
11190     }
11191     }
11192     }
11193     @@XMLTest:
11194 wakaba 1.22 @@@QName: xp.reptxt.attval.ger.entity.declared.nopref.-2.test
11195 wakaba 1.21 @@@DEnt:
11196     @@@@test:value:
11197     <!DOCTYPE p [
11198     <!ENTITY entity "value">
11199     <!ENTITY another SYSTEM "another">
11200 wakaba 1.22 <!ENTITY c "&entity;">
11201 wakaba 1.21 ]>
11202 wakaba 1.22 <p a="&c;"/>
11203 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
11204 wakaba 1.21 @@@test:domTree:
11205     document {
11206     document-type {
11207     general-entity {
11208     node-name: 'entity';
11209     text-content: 'value';
11210 wakaba 1.22 }
11211     general-entity {
11212     node-name: 'c';
11213     general-entity-reference {
11214     node-name: 'entity';
11215     text-content: 'value';
11216     }
11217 wakaba 1.21 }
11218     general-entity {
11219     node-name: 'another';
11220     public-id: null;
11221     system-id: 'another';
11222     has-replacement-tree: false;
11223     }
11224     }
11225     element {
11226     attribute {
11227     node-name: 'a';
11228     general-entity-reference {
11229 wakaba 1.22 node-name: 'c';
11230     general-entity-reference {
11231     node-name: 'entity';
11232     text-content: 'value';
11233     }
11234 wakaba 1.21 }
11235     }
11236     }
11237     }
11238     @@XMLTest:
11239 wakaba 1.22 @@@QName: xp.reptxt.attval.ger.entity.declared.standalone.2.test
11240 wakaba 1.21 @@@DEnt:
11241     @@@@test:value:
11242     <?xml version="1.0" standalone="yes"?>
11243     <!DOCTYPE p [
11244 wakaba 1.22 <!ENTITY c "&entity;">
11245 wakaba 1.21 ]>
11246 wakaba 1.22 <p a="&c;"/>
11247     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11248 wakaba 1.21 @@XMLTest:
11249 wakaba 1.22 @@@QName: xp.reptxt.attval.ger.entity.declared.standalone.3.test
11250 wakaba 1.21 @@@DEnt:
11251     @@@@test:value:
11252     <?xml version="1.0" standalone="yes"?>
11253     <!DOCTYPE p [
11254     <!ENTITY % para "<!-- -->">
11255     %para;
11256 wakaba 1.22 <!ENTITY c "&entity;">
11257 wakaba 1.21 ]>
11258 wakaba 1.22 <p a="&c;"/>
11259     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11260 wakaba 1.21 @@XMLTest:
11261 wakaba 1.22 @@@QName: xp.reptxt.attval.ger.entity.declared.standalone.-1.test
11262 wakaba 1.21 @@@DEnt:
11263     @@@@test:value:
11264 wakaba 1.22 <?xml version="1.0" standalone="no"?>
11265 wakaba 1.21 <!DOCTYPE p [
11266 wakaba 1.22 <!ENTITY c "&entity;">
11267 wakaba 1.21 <!ENTITY % para "<!-- -->">
11268     %para;
11269     ]>
11270 wakaba 1.22 <p a="&c;"/>
11271 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
11272 wakaba 1.22 @@@test:domTree:
11273     document {
11274     document-type {
11275     general-entity {
11276     node-name: 'c';
11277     general-entity-reference {
11278     node-name: 'entity';
11279 wakaba 1.34 manakai-expanded: false;
11280 wakaba 1.22 }
11281     }
11282     }
11283     element {
11284     attribute {
11285     node-name: 'a';
11286     general-entity-reference {
11287     node-name: 'c';
11288     general-entity-reference {
11289     node-name: 'entity';
11290 wakaba 1.34 manakai-expanded: false;
11291 wakaba 1.22 }
11292     }
11293     }
11294     }
11295     }
11296 wakaba 1.21 @@XMLTest:
11297 wakaba 1.22 @@@QName:
11298     xp.reptxt.attval.ger.entity.declared.standalone.-1.2.test
11299 wakaba 1.21 @@@DEnt:
11300     @@@@test:value:
11301     <?xml version="1.0" standalone="no"?>
11302     <!DOCTYPE p [
11303     <!ENTITY % para "<!-- -->">
11304     %para;
11305 wakaba 1.22 <!ENTITY c "&entity;">
11306 wakaba 1.21 ]>
11307 wakaba 1.22 <p a="&c;"/>
11308     @@@test:domTree:
11309     document {
11310     document-type { }
11311     element {
11312     attribute {
11313     node-name: 'a';
11314     general-entity-reference {
11315     node-name: 'c';
11316 wakaba 1.34 manakai-expanded: false;
11317 wakaba 1.22 }
11318     }
11319     }
11320     }
11321 wakaba 1.21 @@XMLTest:
11322 wakaba 1.22 @@@QName: xp.reptxt.attval.ger.entity.declared.standalone.-2.test
11323 wakaba 1.21 @@@DEnt:
11324     @@@@test:value:
11325     <!DOCTYPE p [
11326 wakaba 1.22 <!ENTITY c "&entity;">
11327     <!ENTITY % para "<!-- -->">
11328     %para;
11329     ]>
11330     <p a="&c;"/>
11331     @@@test:domTree:
11332     document {
11333     document-type { }
11334     element {
11335     attribute {
11336     node-name: 'a';
11337     general-entity-reference {
11338     node-name: 'c';
11339 wakaba 1.34 manakai-expanded: true;
11340 wakaba 1.22 general-entity-reference {
11341     node-name: 'entity';
11342 wakaba 1.34 manakai-expanded: false;
11343 wakaba 1.22 }
11344     }
11345     }
11346     }
11347     }
11348     @@XMLTest:
11349     @@@QName:
11350     xp.reptxt.attval.ger.entity.declared.standalone.-2.2.test
11351     @@@DEnt:
11352     @@@@test:value:
11353     <!DOCTYPE p [
11354     <!ENTITY % para "<!-- -->">
11355     %para;
11356     <!ENTITY c "&entity;">
11357     ]>
11358     <p a="&c;"/>
11359     @@@test:domTree:
11360     document {
11361     document-type { }
11362     element {
11363     attribute {
11364     node-name: 'a';
11365     general-entity-reference {
11366     node-name: 'c';
11367 wakaba 1.34 manakai-expanded: false;
11368 wakaba 1.22 }
11369     }
11370     }
11371     }
11372     @@XMLTest:
11373     @@@QName: xp.reptxt.attval.ger.entity.declared.standalone.4.test
11374     @@@DEnt:
11375     @@@@test:value:
11376     <?xml version="1.0" standalone="yes"?>
11377     <!DOCTYPE p [
11378     <!ENTITY % para SYSTEM "para">
11379     %para;
11380     <!ENTITY c "&entity;">
11381     ]>
11382     <p a="&c;"/>
11383     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11384     @@XMLTest:
11385     @@@QName: xp.reptxt.attval.ger.entity.declared.standalone.-3.test
11386     @@@DEnt:
11387     @@@@test:value:
11388     <?xml version="1.0" standalone="no"?>
11389     <!DOCTYPE p [
11390     <!ENTITY c "&entity;">
11391     <!ENTITY % para SYSTEM "para">
11392     %para;
11393     ]>
11394     <p a="&c;"/>
11395     @@@test:domTree:
11396     document {
11397     document-type { }
11398     element {
11399     attribute {
11400     node-name: 'a';
11401     general-entity-reference {
11402     node-name: 'c';
11403 wakaba 1.34 manakai-expanded: true;
11404 wakaba 1.22 general-entity-reference {
11405     node-name: 'entity';
11406 wakaba 1.34 manakai-expanded: false;
11407 wakaba 1.22 }
11408     }
11409     }
11410     }
11411     }
11412     @@XMLTest:
11413     @@@QName:
11414     xp.reptxt.attval.ger.entity.declared.standalone.-3.2.test
11415     @@@DEnt:
11416     @@@@test:value:
11417     <?xml version="1.0" standalone="no"?>
11418     <!DOCTYPE p [
11419     <!ENTITY % para SYSTEM "para">
11420     %para;
11421     <!ENTITY c "&entity;">
11422     ]>
11423     <p a="&c;"/>
11424     @@@test:domTree:
11425     document {
11426     document-type { }
11427     element {
11428     attribute {
11429     node-name: 'a';
11430     general-entity-reference {
11431     node-name: 'c';
11432 wakaba 1.34 manakai-expanded: false;
11433 wakaba 1.22 }
11434     }
11435     }
11436     }
11437     @@XMLTest:
11438     @@@QName: xp.reptxt.attval.ger.entity.declared.standalone.-4.test
11439     @@@DEnt:
11440     @@@@test:value:
11441     <!DOCTYPE p [
11442     <!ENTITY c "&entity;">
11443     <!ENTITY % para SYSTEM "para">
11444     %para;
11445     ]>
11446     <p a="&c;"/>
11447     @@@test:domTree:
11448     document {
11449     document-type { }
11450     element {
11451     attribute {
11452     node-name: 'a';
11453     general-entity-reference {
11454     node-name: 'c';
11455 wakaba 1.34 manakai-expanded: true;
11456 wakaba 1.22 general-entity-reference {
11457     node-name: 'entity';
11458 wakaba 1.34 manakai-expanded: false;
11459 wakaba 1.22 }
11460     }
11461     }
11462     }
11463     }
11464     @@XMLTest:
11465     @@@QName:
11466     xp.reptxt.attval.ger.entity.declared.standalone.-4.2.test
11467     @@@DEnt:
11468     @@@@test:value:
11469     <!DOCTYPE p [
11470     <!ENTITY % para SYSTEM "para">
11471     %para;
11472     <!ENTITY c "&entity;">
11473     ]>
11474     <p a="&c;"/>
11475     @@@test:domTree:
11476     document {
11477     document-type { }
11478     element {
11479     attribute {
11480     node-name: 'a';
11481     general-entity-reference {
11482     node-name: 'c';
11483 wakaba 1.34 manakai-expanded: false;
11484 wakaba 1.22 }
11485     }
11486     }
11487     }
11488     @@XMLTest:
11489     @@@QName: xp.reptxt.attval.ger.entity.declared.standalone.5.test
11490     @@@DEnt:
11491     @@@@test:value:
11492     <?xml version="1.0" standalone="yes"?>
11493     <!DOCTYPE p SYSTEM "dtd" [
11494     <!ENTITY c "&entity;">
11495     ]>
11496     <p a="&c;"/>
11497     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11498     @@XMLTest:
11499     @@@QName: xp.reptxt.attval.ger.entity.declared.standalone.-5.test
11500     @@@DEnt:
11501     @@@@test:value:
11502     <?xml version="1.0" standalone="no"?>
11503     <!DOCTYPE p SYSTEM "dtd" [
11504     <!ENTITY c "&entity;">
11505     ]>
11506     <p a="&c;"/>
11507     @@@test:domTree:
11508     document {
11509     document-type { }
11510     element {
11511     attribute {
11512     node-name: 'a';
11513     general-entity-reference {
11514     node-name: 'c';
11515 wakaba 1.34 manakai-expanded: true;
11516 wakaba 1.22 general-entity-reference {
11517     node-name: 'entity';
11518 wakaba 1.34 manakai-expanded: false;
11519 wakaba 1.22 }
11520     }
11521     }
11522     }
11523     }
11524     @@XMLTest:
11525     @@@QName: xp.reptxt.attval.ger.entity.declared.standalone.-6.test
11526     @@@DEnt:
11527     @@@@test:value:
11528     <!DOCTYPE p SYSTEM "dtd" [<!ENTITY c "&entity;">]>
11529     <p a="&c;"/>
11530     @@@test:domTree:
11531     document {
11532     document-type { }
11533     element {
11534     attribute {
11535     node-name: 'a';
11536     general-entity-reference {
11537     node-name: 'c';
11538 wakaba 1.34 manakai-expanded: true;
11539 wakaba 1.22 general-entity-reference {
11540     node-name: 'entity';
11541 wakaba 1.34 manakai-expanded: false;
11542 wakaba 1.22 }
11543     }
11544     }
11545     }
11546     }
11547    
11548     @@XMLTest:
11549     @@@QName: xp.attlist.dup.entity.declared.1.test
11550     @@@DEnt:
11551     @@@@test:value:
11552     <!DOCTYPE p [
11553     <!ATTLIST p a CDATA "no-entity">
11554     <!ATTLIST p a CDATA "&entity;">
11555     ]>
11556     <p/>
11557     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 21)..(3, 29); }
11558     @@XMLTest:
11559     @@@QName: xp.attlist.dup.entity.declared.2.test
11560     @@@DEnt:
11561     @@@@test:value:
11562     <!DOCTYPE p [
11563     <!ATTLIST p a CDATA "no-entity"
11564     a CDATA "&entity;">
11565     ]>
11566     <p/>
11567     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 21)..(3, 29); }
11568     @@XMLTest:
11569     @@@QName: xp.attlist.unused.entity.declared.1.test
11570     @@@DEnt:
11571     @@@@test:value:
11572     <!DOCTYPE p [
11573     <!ATTLIST q a CDATA "&entity;">
11574     ]>
11575     <p/>
11576     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 21)..(2, 29); }
11577     @@XMLTest:
11578     @@@QName: xp.attlist.unused.entity.declared.2.test
11579     @@@DEnt:
11580     @@@@test:value:
11581     <!DOCTYPE p [
11582     <!ATTLIST p a CDATA "&entity;">
11583     ]>
11584     <p a="bb"/>
11585     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 21)..(2, 29); }
11586    
11587     @@XMLTest:
11588     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.nopref.1.test
11589     @@@DEnt:
11590     @@@@test:value:
11591     <!DOCTYPE p [
11592     <!ENTITY c "&entity;">
11593     <!ATTLIST p a CDATA "&c;">
11594     ]>
11595     <p/>
11596     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11597     @@XMLTest:
11598     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.nopref.2.test
11599     @@@DEnt:
11600     @@@@test:value:
11601     <!DOCTYPE p [
11602     <!ENTITY other "aa">
11603     <!ENTITY % another "aa">
11604     <!ENTITY c "&entity;">
11605     <!ATTLIST p a CDATA "&c;">
11606     ]>
11607     <p/>
11608     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11609     @@XMLTest:
11610     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.nopref.3.test
11611     @@@DEnt:
11612     @@@@test:value:
11613     <?xml version="1.0" standalone="yes"?>
11614     <!DOCTYPE p [
11615     <!ENTITY c "&entity;">
11616     <!ATTLIST p a CDATA "&c;">
11617     ]>
11618     <p/>
11619     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11620     @@XMLTest:
11621     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.nopref.4.test
11622     @@@DEnt:
11623     @@@@test:value:
11624     <?xml version="1.0" standalone="no"?>
11625     <!DOCTYPE p [
11626     <!ENTITY c "&entity;">
11627     <!ATTLIST p a CDATA "&c;">
11628     ]>
11629     <p/>
11630     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11631     @@XMLTest:
11632     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.nopref.5.test
11633     @@@DEnt:
11634     @@@@test:value:
11635     <?xml version="1.0" standalone="yes"?>
11636     <!DOCTYPE p [
11637     <!ENTITY other "aa">
11638     <!ENTITY % another "aa">
11639     <!ENTITY c "&entity;">
11640     <!ATTLIST p a CDATA "&c;">
11641     ]>
11642     <p/>
11643     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11644     @@XMLTest:
11645     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.nopref.6.test
11646     @@@DEnt:
11647     @@@@test:value:
11648     <?xml version="1.0" standalone="no"?>
11649     <!DOCTYPE p [
11650     <!ENTITY other "aa">
11651     <!ENTITY % another "aa">
11652     <!ENTITY c "&entity;">
11653     <!ATTLIST p a CDATA "&c;">
11654     ]>
11655     <p/>
11656     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11657     @@XMLTest:
11658     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.nopref.-1.test
11659     @@@DEnt:
11660     @@@@test:value:
11661     <!DOCTYPE p [
11662     <!ENTITY entity "value">
11663     <!ENTITY c "&entity;">
11664     <!ATTLIST p a CDATA "&c;">
11665     ]>
11666     <p/>
11667 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
11668 wakaba 1.22 @@@test:domTree:
11669     document {
11670     document-type {
11671     general-entity {
11672     node-name: 'entity';
11673     text-content: 'value';
11674     }
11675     general-entity {
11676     node-name: 'c';
11677     general-entity-reference {
11678     node-name: 'entity';
11679 wakaba 1.34 manakai-expanded: true;
11680 wakaba 1.22 text-content: 'value';
11681     }
11682     }
11683     element-type-definition {
11684     node-name: 'p';
11685     attribute-definition {
11686     node-name: 'a';
11687     general-entity-reference {
11688     node-name: 'c';
11689 wakaba 1.34 manakai-expanded: true;
11690 wakaba 1.22 general-entity-reference {
11691     node-name: 'entity';
11692 wakaba 1.34 manakai-expanded: true;
11693 wakaba 1.22 text-content: 'value';
11694     }
11695     }
11696     }
11697     }
11698     }
11699     element {
11700     attribute {
11701     node-name: 'a';
11702     specified: false;
11703     general-entity-reference {
11704     node-name: 'c';
11705     general-entity-reference {
11706     node-name: 'entity';
11707     text-content: 'value';
11708     }
11709     }
11710     }
11711     }
11712     }
11713     @@XMLTest:
11714     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.nopref.-2.test
11715     @@@DEnt:
11716     @@@@test:value:
11717     <!DOCTYPE p [
11718     <!ENTITY entity "value">
11719     <!ENTITY another SYSTEM "another">
11720     <!ENTITY c "&entity;">
11721     <!ATTLIST p a CDATA "&c;">
11722     ]>
11723     <p/>
11724 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
11725 wakaba 1.22 @@@test:domTree:
11726     document {
11727     document-type {
11728     general-entity {
11729     node-name: 'entity';
11730     text-content: 'value';
11731     }
11732     general-entity {
11733     node-name: 'c';
11734     general-entity-reference {
11735     node-name: 'entity';
11736     text-content: 'value';
11737     }
11738     }
11739     general-entity {
11740     node-name: 'another';
11741     public-id: null;
11742     system-id: 'another';
11743     has-replacement-tree: false;
11744     }
11745     element-type-definition {
11746     node-name: 'p';
11747     attribute-definition {
11748     node-name: 'a';
11749     general-entity-reference {
11750     node-name: 'c';
11751 wakaba 1.34 manakai-expanded: true;
11752 wakaba 1.22 general-entity-reference {
11753     node-name: 'entity';
11754 wakaba 1.34 manakai-expanded: true;
11755 wakaba 1.22 text-content: 'value';
11756     }
11757     }
11758     }
11759     }
11760     }
11761     element {
11762     attribute {
11763     node-name: 'a';
11764     specified: false;
11765     general-entity-reference {
11766     node-name: 'c';
11767     general-entity-reference {
11768     node-name: 'entity';
11769     text-content: 'value';
11770     }
11771     }
11772     }
11773     }
11774     }
11775     @@XMLTest:
11776     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.standalone.2.test
11777     @@@DEnt:
11778     @@@@test:value:
11779     <?xml version="1.0" standalone="yes"?>
11780     <!DOCTYPE p [
11781     <!ENTITY c "&entity;">
11782     <!ATTLIST p a CDATA "&c;">
11783     ]>
11784     <p/>
11785     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11786     @@XMLTest:
11787     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.standalone.3.test
11788     @@@DEnt:
11789     @@@@test:value:
11790     <?xml version="1.0" standalone="yes"?>
11791     <!DOCTYPE p [
11792     <!ENTITY % para "<!-- -->">
11793     %para;
11794     <!ENTITY c "&entity;">
11795     <!ATTLIST p a CDATA "&c;">
11796     ]>
11797     <p/>
11798     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11799     @@XMLTest:
11800     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.standalone.-1.test
11801     @@@DEnt:
11802     @@@@test:value:
11803     <?xml version="1.0" standalone="no"?>
11804     <!DOCTYPE p [
11805     <!ENTITY c "&entity;">
11806     <!ATTLIST p a CDATA "&c;">
11807     <!ENTITY % para "<!-- -->">
11808     %para;
11809     ]>
11810     <p/>
11811     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11812     @@XMLTest:
11813     @@@QName:
11814     xp.reptxt.attlist.attval.ger.entity.declared.standalone.-1.2.test
11815     @@@DEnt:
11816     @@@@test:value:
11817     <?xml version="1.0" standalone="no"?>
11818     <!DOCTYPE p [
11819     <!ENTITY % para "<!-- -->">
11820     %para;
11821     <!ENTITY c "&entity;">
11822     <!ATTLIST p a CDATA "&c;">
11823     ]>
11824     <p g="h"/>
11825     @@@test:domTree:
11826     document {
11827     document-type { }
11828     element {
11829     attribute {
11830     node-name: 'g';
11831     text-content: 'h';
11832     }
11833     }
11834     }
11835     @@XMLTest:
11836     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.standalone.-2.test
11837     @@@DEnt:
11838     @@@@test:value:
11839     <!DOCTYPE p [
11840     <!ENTITY c "&entity;">
11841     <!ATTLIST p a CDATA "&c;">
11842     <!ENTITY % para "<!-- -->">
11843     %para;
11844     ]>
11845     <p/>
11846     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11847     @@XMLTest:
11848     @@@QName:
11849     xp.reptxt.attlist.attval.ger.entity.declared.standalone.-2.2.test
11850     @@@DEnt:
11851     @@@@test:value:
11852     <!DOCTYPE p [
11853     <!ENTITY % para "<!-- -->">
11854     %para;
11855     <!ENTITY c "&entity;">
11856     <!ATTLIST p a CDATA "&c;">
11857     ]>
11858     <p g="h"/>
11859     @@@test:domTree:
11860     document {
11861     document-type { }
11862     element {
11863     attribute {
11864     node-name: 'g';
11865     text-content: 'h';
11866     }
11867     }
11868     }
11869     @@XMLTest:
11870     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.standalone.4.test
11871     @@@DEnt:
11872     @@@@test:value:
11873     <?xml version="1.0" standalone="yes"?>
11874     <!DOCTYPE p [
11875     <!ENTITY % para SYSTEM "para">
11876     %para;
11877     <!ENTITY c "&entity;">
11878     <!ATTLIST p a CDATA "&c;">
11879     ]>
11880     <p/>
11881     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11882     @@XMLTest:
11883     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.standalone.-3.test
11884     @@@DEnt:
11885     @@@@test:value:
11886     <?xml version="1.0" standalone="no"?>
11887     <!DOCTYPE p [
11888     <!ENTITY c "&entity;">
11889     <!ATTLIST p a CDATA "&c;">
11890     <!ENTITY % para SYSTEM "para">
11891     %para;
11892     ]>
11893     <p/>
11894     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11895     @@XMLTest:
11896     @@@QName:
11897     xp.reptxt.attlist.attval.ger.entity.declared.standalone.-3.2.test
11898     @@@DEnt:
11899     @@@@test:value:
11900     <?xml version="1.0" standalone="no"?>
11901     <!DOCTYPE p [
11902     <!ENTITY % para SYSTEM "para">
11903     %para;
11904     <!ENTITY c "&entity;">
11905     <!ATTLIST p a CDATA "&c;">
11906     ]>
11907     <p g="h"/>
11908     @@@test:domTree:
11909     document {
11910     document-type { }
11911     element {
11912     attribute {
11913     node-name: 'g';
11914     text-content: 'h';
11915     }
11916     }
11917     }
11918     @@XMLTest:
11919     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.standalone.-4.test
11920     @@@DEnt:
11921     @@@@test:value:
11922     <!DOCTYPE p [
11923     <!ENTITY c "&entity;">
11924     <!ATTLIST p a CDATA "&c;">
11925     <!ENTITY % para SYSTEM "para">
11926     %para;
11927     ]>
11928     <p/>
11929     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11930     @@XMLTest:
11931     @@@QName:
11932     xp.reptxt.attlist.attval.ger.entity.declared.standalone.-4.2.test
11933     @@@DEnt:
11934     @@@@test:value:
11935     <!DOCTYPE p [
11936     <!ENTITY % para SYSTEM "para">
11937     %para;
11938     <!ENTITY c "&entity;">
11939     <!ATTLIST p a CDATA "&c;">
11940     ]>
11941     <p g="h"/>
11942     @@@test:domTree:
11943     document {
11944     document-type { }
11945     element {
11946     attribute {
11947     node-name: 'g';
11948     text-content: 'h';
11949     }
11950     }
11951     }
11952     @@XMLTest:
11953     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.standalone.5.test
11954     @@@DEnt:
11955     @@@@test:value:
11956     <?xml version="1.0" standalone="yes"?>
11957     <!DOCTYPE p SYSTEM "dtd" [
11958     <!ENTITY c "&entity;">
11959     <!ATTLIST p a CDATA "&c;">
11960     ]>
11961     <p/>
11962     @@@c:erred: <[[xp|wf-entity-declared]]> { (1, 1)..(1, 8); }
11963     @@XMLTest:
11964     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.standalone.-5.test
11965     @@@DEnt:
11966     @@@@test:value:
11967     <?xml version="1.0" standalone="no"?>
11968     <!DOCTYPE p SYSTEM "dtd" [
11969     <!ENTITY c "&entity;">
11970     <!ATTLIST p a CDATA "&c;">
11971     ]>
11972     <p/>
11973     @@@test:domTree:
11974     document {
11975     document-type { }
11976     element {
11977     attribute {
11978     node-name: 'a';
11979     specified: false;
11980     general-entity-reference {
11981     node-name: 'c';
11982 wakaba 1.34 manakai-expanded: true;
11983 wakaba 1.22 general-entity-reference {
11984     node-name: 'entity';
11985 wakaba 1.34 manakai-expanded: false;
11986 wakaba 1.22 }
11987     }
11988     }
11989     }
11990     }
11991     @@XMLTest:
11992     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.standalone.-6.test
11993     @@@DEnt:
11994     @@@@test:value:
11995     <!DOCTYPE p SYSTEM "dtd" [<!ENTITY c "&entity;">
11996     <!ATTLIST p a CDATA "&c;">
11997     ]>
11998     <p/>
11999     @@@test:domTree:
12000     document {
12001     document-type { }
12002     element {
12003     attribute {
12004     node-name: 'a';
12005     specified: false;
12006     general-entity-reference {
12007     node-name: 'c';
12008 wakaba 1.34 manakai-expanded: true;
12009 wakaba 1.22 general-entity-reference {
12010     node-name: 'entity';
12011 wakaba 1.34 manakai-expanded: false;
12012 wakaba 1.22 }
12013     }
12014     }
12015     }
12016     }
12017    
12018     @@XMLTest:
12019     @@@QName: xp.attlist.attval.ger.entity.declared.nopref.1.test
12020     @@@DEnt:
12021     @@@@test:value:
12022     <!DOCTYPE p [
12023     <!ATTLIST p a CDATA "&entity;">
12024     ]>
12025     <p/>
12026     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 22)..(2, 29); }
12027     @@XMLTest:
12028     @@@QName: xp.attlist.attval.ger.entity.declared.nopref.2.test
12029     @@@DEnt:
12030     @@@@test:value:
12031     <!DOCTYPE p [
12032     <!ENTITY other "aa">
12033     <!ENTITY % another "aa">
12034     <!ATTLIST p a CDATA "&entity;">
12035     ]>
12036     <p/>
12037     @@@c:erred: <[[xp|wf-entity-declared]]> { (4, 22)..(4, 29); }
12038     @@XMLTest:
12039     @@@QName: xp.attlist.attval.ger.entity.declared.nopref.3.test
12040     @@@DEnt:
12041     @@@@test:value:
12042     <?xml version="1.0" standalone="yes"?>
12043     <!DOCTYPE p [
12044     <!ATTLIST p a CDATA "&entity;">
12045     ]>
12046     <p/>
12047     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 22)..(3, 29); }
12048     @@XMLTest:
12049     @@@QName: xp.attlist.attval.ger.entity.declared.nopref.4.test
12050     @@@DEnt:
12051     @@@@test:value:
12052     <?xml version="1.0" standalone="no"?>
12053     <!DOCTYPE p [
12054     <!ATTLIST p a CDATA "&entity;">
12055     ]>
12056     <p/>
12057     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 22)..(3, 29); }
12058     @@XMLTest:
12059     @@@QName: xp.attlist.attval.ger.entity.declared.nopref.5.test
12060     @@@DEnt:
12061     @@@@test:value:
12062     <?xml version="1.0" standalone="yes"?>
12063     <!DOCTYPE p [
12064     <!ENTITY other "aa">
12065     <!ENTITY % another "aa">
12066     <!ATTLIST p a CDATA "&entity;">
12067     ]>
12068     <p/>
12069     @@@c:erred: <[[xp|wf-entity-declared]]> { (5, 22)..(5, 29); }
12070     @@XMLTest:
12071     @@@QName: xp.attlist.attval.ger.entity.declared.nopref.6.test
12072     @@@DEnt:
12073     @@@@test:value:
12074     <?xml version="1.0" standalone="no"?>
12075     <!DOCTYPE p [
12076     <!ENTITY other "aa">
12077     <!ENTITY % another "aa">
12078     <!ATTLIST p a CDATA "&entity;">
12079     ]>
12080     <p/>
12081     @@@c:erred: <[[xp|wf-entity-declared]]> { (5, 22)..(5, 29); }
12082     @@XMLTest:
12083     @@@QName: xp.attlist.attval.ger.entity.declared.nopref.-1.test
12084     @@@DEnt:
12085     @@@@test:value:
12086     <!DOCTYPE p [
12087     <!ENTITY entity "value">
12088     <!ATTLIST p a CDATA "&entity;">
12089     ]>
12090     <p/>
12091 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
12092 wakaba 1.22 @@@test:domTree:
12093     document {
12094     document-type {
12095     general-entity {
12096     node-name: 'entity';
12097     text-content: 'value';
12098     }
12099     element-type-definition {
12100     node-name: 'p';
12101     attribute-definition {
12102     node-name: 'a';
12103     general-entity-reference {
12104     node-name: 'entity';
12105 wakaba 1.34 manakai-expanded: true;
12106 wakaba 1.22 text-content: 'value';
12107     }
12108     }
12109     }
12110     }
12111     element {
12112     attribute {
12113     node-name: 'a';
12114     specified: false;
12115     general-entity-reference {
12116     node-name: 'entity';
12117 wakaba 1.34 manakai-expanded: true;
12118 wakaba 1.22 text-content: 'value';
12119     }
12120     }
12121     }
12122     }
12123     @@XMLTest:
12124     @@@QName: xp.attlist.attval.ger.entity.declared.nopref.-1.2.test
12125     @@@DEnt:
12126     @@@@test:value:
12127     <!DOCTYPE p [
12128     <!ATTLIST p a CDATA "&entity;">
12129     <!ENTITY entity "value">
12130     ]>
12131     <p/>
12132     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 22)..(2, 29); }
12133     @@XMLTest:
12134     @@@QName: xp.attlist.attval.ger.entity.declared.nopref.-2.test
12135     @@@DEnt:
12136     @@@@test:value:
12137     <!DOCTYPE p [
12138     <!ENTITY entity "value">
12139     <!ENTITY another SYSTEM "another">
12140     <!ATTLIST p a CDATA "&entity;">
12141     ]>
12142     <p/>
12143 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
12144 wakaba 1.22 @@@test:domTree:
12145     document {
12146     document-type {
12147     element-type-definition {
12148     node-name: 'p';
12149     attribute-definition {
12150     node-name: 'a';
12151     general-entity-reference {
12152     node-name: 'entity';
12153 wakaba 1.34 manakai-expanded: true;
12154 wakaba 1.22 text-content: 'value';
12155     }
12156     }
12157     }
12158     general-entity {
12159     node-name: 'entity';
12160     text-content: 'value';
12161     has-replacement-tree: true;
12162     }
12163     general-entity {
12164     node-name: 'another';
12165     public-id: null;
12166     system-id: 'another';
12167     has-replacement-tree: false;
12168     }
12169     }
12170     element {
12171     attribute {
12172     node-name: 'a';
12173     specified: false;
12174     general-entity-reference {
12175     node-name: 'entity';
12176 wakaba 1.34 manakai-expanded: true;
12177 wakaba 1.22 text-content: 'value';
12178     }
12179     }
12180     }
12181     }
12182     @@XMLTest:
12183     @@@QName: xp.attlist.attval.ger.entity.declared.nopref.-2.2.test
12184     @@@DEnt:
12185     @@@@test:value:
12186     <!DOCTYPE p [
12187     <!ATTLIST p a CDATA "&entity;">
12188     <!ENTITY entity "value">
12189     <!ENTITY another SYSTEM "another">
12190     ]>
12191     <p/>
12192     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 22)..(2, 29); }
12193     @@XMLTest:
12194     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.2.test
12195     @@@DEnt:
12196     @@@@test:value:
12197     <?xml version="1.0" standalone="yes"?>
12198     <!DOCTYPE p [
12199     <!ATTLIST p a CDATA "&entity;">
12200     ]>
12201     <p/>
12202     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 22)..(3, 29); }
12203     @@XMLTest:
12204     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.3.test
12205     @@@DEnt:
12206     @@@@test:value:
12207     <?xml version="1.0" standalone="yes"?>
12208     <!DOCTYPE p [
12209     <!ATTLIST p a CDATA "&entity;">
12210     <!ENTITY % para "<!-- -->">
12211     %para;
12212     ]>
12213     <p/>
12214     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 22)..(3, 29); }
12215     @@XMLTest:
12216     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.3.2.test
12217     @@@DEnt:
12218     @@@@test:value:
12219     <?xml version="1.0" standalone="yes"?>
12220     <!DOCTYPE p [
12221     <!ENTITY % para "<!-- -->">
12222     %para;
12223     <!ATTLIST p a CDATA "&entity;">
12224     ]>
12225     <p/>
12226     @@@c:erred: <[[xp|wf-entity-declared]]> { (5, 22)..(5, 29); }
12227     @@@enImplNote:
12228     The <XML::ATTLIST> declaration is processed since
12229     it is a <XA::standalone> document.
12230     @@XMLTest:
12231     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.-1.test
12232     @@@DEnt:
12233     @@@@test:value:
12234     <?xml version="1.0" standalone="no"?>
12235     <!DOCTYPE p [
12236     <!ATTLIST p a CDATA "&entity;">
12237     <!ENTITY % para "<!-- -->">
12238     %para;
12239     ]>
12240     <p/>
12241     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 22)..(3, 29); }
12242     @@XMLTest:
12243     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.-1.2.test
12244     @@@DEnt:
12245     @@@@test:value:
12246     <?xml version="1.0" standalone="no"?>
12247     <!DOCTYPE p [
12248 wakaba 1.25 <!ATTLIST p b CDATA #IMPLIED>
12249 wakaba 1.21 <!ENTITY % para "<!-- -->">
12250     %para;
12251     <!ATTLIST p a CDATA "&entity;">
12252     ]>
12253     <p c="d"/>
12254 wakaba 1.25 @@@c:erred:
12255     <[[xp|warning-attribute-definition-not-processed]]> { (6, 13)..(6, 30); }
12256 wakaba 1.21 @@@test:domTree:
12257     document {
12258     document-type {
12259     element-type-definition {
12260 wakaba 1.25 node-name: 'p';
12261 wakaba 1.21 attribute-definition {
12262     node-name: 'b';
12263     }
12264     }
12265     }
12266     element {
12267     attribute {
12268     node-name: 'c';
12269     text-content: 'd';
12270     }
12271     }
12272     }
12273     @@@enImplNote:
12274     The second <XML::ATTLIST> declaration is read but not processed
12275     and its <XML::&entity;> general entity reference violates
12276     entity declared validty constraint rather than well-formedness
12277     constraint.
12278     @@XMLTest:
12279     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.-2.test
12280     @@@DEnt:
12281     @@@@test:value:
12282     <!DOCTYPE p [
12283     <!ATTLIST p a CDATA "&entity;">
12284     <!ENTITY % para "<!-- -->">
12285     %para;
12286     ]>
12287     <p/>
12288     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 22)..(2, 29); }
12289     @@XMLTest:
12290     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.-2.2.test
12291     @@@DEnt:
12292     @@@@test:value:
12293     <!DOCTYPE p [
12294 wakaba 1.25 <!ATTLIST p b CDATA #IMPLIED>
12295 wakaba 1.21 <!ENTITY % para "<!-- -->">
12296     %para;
12297     <!ATTLIST p a CDATA "&entity;">
12298     ]>
12299     <p c="d"/>
12300 wakaba 1.25 @@@c:erred:
12301     <[[xp|warning-attribute-definition-not-processed]]> { (5, 13)..(5, 30); }
12302 wakaba 1.21 @@@test:domTree:
12303     document {
12304     document-type {
12305     element-type-definition {
12306 wakaba 1.25 node-name: 'p';
12307 wakaba 1.21 attribute-definition {
12308     node-name: 'b';
12309     }
12310     }
12311     }
12312     element {
12313     attribute {
12314     node-name: 'c';
12315     text-content: 'd';
12316     }
12317     }
12318     }
12319     @@XMLTest:
12320     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.4.test
12321     @@@DEnt:
12322     @@@@test:value:
12323     <?xml version="1.0" standalone="yes"?>
12324     <!DOCTYPE p [
12325     <!ATTLIST p a CDATA "&entity;">
12326     <!ENTITY % para SYSTEM "p">
12327     %para;
12328     ]>
12329     <p/>
12330     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 22)..(3, 29); }
12331     @@XMLTest:
12332     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.4.2.test
12333     @@@DEnt:
12334     @@@@test:value:
12335     <?xml version="1.0" standalone="yes"?>
12336     <!DOCTYPE p [
12337     <!ENTITY % para SYSTEM "p">
12338     %para;
12339     <!ATTLIST p a CDATA "&entity;">
12340     ]>
12341     <p/>
12342     @@@c:erred: <[[xp|wf-entity-declared]]> { (5, 22)..(5, 29); }
12343     @@@enImplNote:
12344     The <XML::ATTLIST> declaration is processed since
12345     it is a <XA::standalone> document.
12346     @@XMLTest:
12347     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.-3.test
12348     @@@DEnt:
12349     @@@@test:value:
12350     <?xml version="1.0" standalone="no"?>
12351     <!DOCTYPE p [
12352     <!ATTLIST p a CDATA "&entity;">
12353     <!ENTITY % para SYSTEM "p">
12354     %para;
12355     ]>
12356     <p/>
12357     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 22)..(3, 29); }
12358     @@@enImplNote:
12359     Is this well-formed? It has a parameter entity reference,
12360     therefore, it does not violates Entity Declared WFC, isn't it?
12361    
12362     Note that Firefox 1.5 and Opera 9 TP1 reports that this document has a
12363     fatal error (also note that they does not support unexpanded).
12364    
12365     See also:
12366     <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>
12367     @@XMLTest:
12368     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.-3.2.test
12369     @@@DEnt:
12370     @@@@test:value:
12371     <?xml version="1.0" standalone="no"?>
12372     <!DOCTYPE p [
12373 wakaba 1.25 <!ATTLIST p b CDATA #IMPLIED>
12374 wakaba 1.21 <!ENTITY % para SYSTEM "p">
12375     %para;
12376     <!ATTLIST p a CDATA "&entity;">
12377     ]>
12378     <p c="d"/>
12379 wakaba 1.25 @@@c:erred:
12380     <[[xp|warning-attribute-definition-not-processed]]> { (6, 13)..(6, 30); }
12381 wakaba 1.21 @@@test:domTree:
12382     document {
12383     document-type {
12384     element-type-definition {
12385 wakaba 1.25 node-name: 'p';
12386 wakaba 1.21 attribute-definition {
12387     node-name: 'b';
12388     }
12389     }
12390     }
12391     element {
12392     attribute {
12393     node-name: 'c';
12394     text-content: 'd';
12395     }
12396     }
12397     }
12398     @@@enImplNote:
12399     The second <XML::ATTLIST> declaration is read but not processed
12400     and its <XML::&entity;> general entity reference violates
12401     entity declared validty constraint rather than well-formedness
12402     constraint.
12403     @@XMLTest:
12404     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.-4.test
12405     @@@DEnt:
12406     @@@@test:value:
12407     <!DOCTYPE p [
12408     <!ATTLIST p a CDATA "&entity;">
12409     <!ENTITY % para SYSTEM "p">
12410     %para;
12411     ]>
12412     <p/>
12413     @@@c:erred: <[[xp|wf-entity-declared]]> { (2, 22)..(2, 29); }
12414     @@XMLTest:
12415     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.-4.2.test
12416     @@@DEnt:
12417     @@@@test:value:
12418     <!DOCTYPE p [
12419 wakaba 1.25 <!ATTLIST p b CDATA #IMPLIED>
12420 wakaba 1.21 <!ENTITY % para SYSTEM "p">
12421     %para;
12422     <!ATTLIST p a CDATA "&entity;">
12423     ]>
12424     <p c="d"/>
12425 wakaba 1.25 @@@c:erred:
12426     <[[xp|warning-attribute-definition-not-processed]]> { (5, 13)..(5, 30); }
12427 wakaba 1.21 @@@test:domTree:
12428     document {
12429     document-type {
12430     element-type-definition {
12431 wakaba 1.25 node-name: 'p';
12432 wakaba 1.21 attribute-definition {
12433     node-name: 'b';
12434     }
12435     }
12436     }
12437     element {
12438     attribute {
12439     node-name: 'c';
12440     text-content: 'd';
12441     }
12442     }
12443     }
12444     @@XMLTest:
12445     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.5.test
12446     @@@DEnt:
12447     @@@@test:value:
12448     <?xml version="1.0" standalone="yes"?>
12449     <!DOCTYPE p SYSTEM "dtd" [
12450     <!ATTLIST p a CDATA "&entity;">
12451     ]>
12452     <p/>
12453     @@@c:erred: <[[xp|wf-entity-declared]]> { (3, 22)..(3, 29); }
12454     @@@enImplNote:
12455     This document has an error - result is implementation dependent.
12456     @@XMLTest:
12457     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.-5.test
12458     @@@DEnt:
12459     @@@@test:value:
12460     <?xml version="1.0" standalone="no"?>
12461     <!DOCTYPE p SYSTEM "dtd" [
12462     <!ATTLIST p a CDATA "&entity;">
12463     ]>
12464     <p/>
12465     @@@test:domTree:
12466     document {
12467     document-type {
12468     element-type-definition {
12469     node-name: 'p';
12470     attribute-definition {
12471     node-name: 'a';
12472     general-entity-reference {
12473     node-name: 'entity';
12474 wakaba 1.34 manakai-expanded: false;
12475 wakaba 1.21 }
12476     }
12477     }
12478     }
12479     element {
12480     attribute {
12481     node-name: 'a';
12482     specified: false;
12483     general-entity-reference {
12484     node-name: 'entity';
12485 wakaba 1.34 manakai-expanded: false;
12486 wakaba 1.21 }
12487     }
12488     }
12489     }
12490     @@@enImplNote:
12491     This document has an error - result is implementation dependent.
12492     @@XMLTest:
12493     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.-6.test
12494     @@@DEnt:
12495     @@@@test:value:
12496     <!DOCTYPE p SYSTEM "dtd" [
12497     <!ATTLIST p a CDATA "&entity;">
12498     ]>
12499     <p/>
12500     @@@test:domTree:
12501     document {
12502     document-type {
12503     element-type-definition {
12504     node-name: 'p';
12505     attribute-definition {
12506     node-name: 'a';
12507     general-entity-reference {
12508     node-name: 'entity';
12509 wakaba 1.34 manakai-expanded: false;
12510 wakaba 1.21 }
12511     }
12512     }
12513     }
12514     element {
12515     attribute {
12516     node-name: 'a';
12517     specified: false;
12518     general-entity-reference {
12519     node-name: 'entity';
12520 wakaba 1.34 manakai-expanded: false;
12521 wakaba 1.21 }
12522     }
12523     }
12524     }
12525     @@@enImplNote:
12526     This document has an error - result is implementation dependent.
12527    
12528 wakaba 1.19 @@enImplNote:
12529     {TODO:: Entity declared WFC for
12530 wakaba 1.20
12531     - General entity references in entity value??
12532 wakaba 1.19
12533     }
12534    
12535 wakaba 1.23 @@XMLTest:
12536     @@@QName: xp.element.content.parsed.entity.reference.test
12537     @@@DEnt:
12538     @@@@test:value:
12539     <!DOCTYPE p [
12540     <!NOTATION n SYSTEM "notation">
12541     <!ENTITY ext SYSTEM "system" NDATA n>
12542     ]>
12543     <p>&ext;</p>
12544     @@@c:erred: <[[xp|wf-parsed-entity]]> { (5, 4)..(5, 8); }
12545     @@XMLTest:
12546     @@@QName: xp.attval.parsed.entity.reference.test
12547     @@@DEnt:
12548     @@@@test:value:
12549     <!DOCTYPE p [
12550     <!NOTATION n SYSTEM "notation">
12551     <!ENTITY ext SYSTEM "system" NDATA n>
12552     ]>
12553     <p a="&ext;"/>
12554     # @@@c:erred: <[[xp|wf-parsed-entity]]> { (5, 7)..(5, 11); }
12555     @@@c:erred: <[[xp|wf-no-external-entity-references]]> { (5, 7)..(5, 11); }
12556     @@XMLTest:
12557     @@@QName: xp.element.content.reptxt.parsed.entity.reference.test
12558     @@@DEnt:
12559     @@@@test:value:
12560     <!DOCTYPE p [
12561     <!NOTATION n SYSTEM "notation">
12562     <!ENTITY ext SYSTEM "system" NDATA n>
12563     <!ENTITY c "&#x26;ext;">
12564     ]>
12565     <p>&c;</p>
12566     @@@c:erred: <[[xp|wf-parsed-entity]]> { (1, 1)..(1, 5); }
12567     @@XMLTest:
12568     @@@QName: xp.attval.reptxt.parsed.entity.reference.test
12569     @@@DEnt:
12570     @@@@test:value:
12571     <!DOCTYPE p [
12572     <!NOTATION n SYSTEM "notation">
12573     <!ENTITY ext SYSTEM "system" NDATA n>
12574     <!ENTITY c "&#x26;ext;">
12575     ]>
12576     <p a="&c;"/>
12577 wakaba 1.34 @@@cfg:entity-replacement-tree: 0
12578     @@@c:erred: <[[xp|wf-no-external-entity-references]]> { (1, 1)..(1, 5); }
12579     @@XMLTest:
12580     @@@QName: xp.attval.reptxt.parsed.entity.reference.2.test
12581     @@@DEnt:
12582     @@@@test:value:
12583     <!DOCTYPE p [
12584     <!NOTATION n SYSTEM "notation">
12585     <!ENTITY ext SYSTEM "system" NDATA n>
12586     <!ENTITY c "&#x26;ext;">
12587     ]>
12588     <p a="&c;"/>
12589     @@@cfg:entity-replacement-tree: 1
12590 wakaba 1.23 @@@c:erred: <[[xp|wf-no-external-entity-references]]> { (1, 1)..(1, 5); }
12591     @@@c:erred:
12592     @@@@@: <[[xp|wf-parsed-entity]]> { }
12593     @@@@enImplNote: During entity node construction.
12594     @@XMLTest:
12595     @@@QName: xp.element.content.entval.parsed.entity.reference.test
12596     @@@DEnt:
12597     @@@@test:value:
12598     <!DOCTYPE p [
12599     <!NOTATION n SYSTEM "notation">
12600     <!ENTITY ext SYSTEM "system" NDATA n>
12601     <!ENTITY c "&ext;">
12602     ]>
12603     <p>&c;</p>
12604     @@@c:erred: <[[xp|wf-parsed-entity]]> { }
12605     @@XMLTest:
12606     @@@QName: xp.attval.entval.parsed.entity.reference.test
12607     @@@DEnt:
12608     @@@@test:value:
12609     <!DOCTYPE p [
12610     <!NOTATION n SYSTEM "notation">
12611     <!ENTITY ext SYSTEM "system" NDATA n>
12612     <!ENTITY c "&ext;">
12613     ]>
12614     <p a="&c;"/>
12615 wakaba 1.34 @@@cfg:entity-replacement-tree: 0
12616     @@@c:erred: <[[xp|wf-no-external-entity-references]]> { }
12617     @@XMLTest:
12618     @@@QName: xp.attval.entval.parsed.entity.reference.2.test
12619     @@@DEnt:
12620     @@@@test:value:
12621     <!DOCTYPE p [
12622     <!NOTATION n SYSTEM "notation">
12623     <!ENTITY ext SYSTEM "system" NDATA n>
12624     <!ENTITY c "&ext;">
12625     ]>
12626     <p a="&c;"/>
12627     @@@cfg:entity-replacement-tree: 1
12628 wakaba 1.23 @@@c:erred: <[[xp|wf-no-external-entity-references]]> { }
12629     @@@c:erred: <[[xp|wf-parsed-entity]]> { }
12630    
12631     @@XMLTest:
12632     @@@QName: xp.element.content.no.recursion.direct.test
12633     @@@DEnt:
12634     @@@@test:value:
12635     <!DOCTYPE p [
12636     <!ENTITY c "&c;">
12637     ]>
12638     <p>&c;</p>
12639     @@@c:erred: <[[xp|wf-no-recursion]]> { (1, 1)..(1, 3); }
12640     @@XMLTest:
12641     @@@QName: xp.element.content.no.recursion.indirect.test
12642     @@@DEnt:
12643     @@@@test:value:
12644     <!DOCTYPE p [
12645     <!ENTITY d "&c;">
12646     <!ENTITY c "&d;">
12647     ]>
12648     <p>&c;</p>
12649     @@@c:erred: <[[xp|wf-no-recursion]]> { /* |d| */ (1, 1)..(1, 3); }
12650     @@XMLTest:
12651     @@@QName: xp.attval.no.recursion.direct.test
12652     @@@DEnt:
12653     @@@@test:value:
12654     <!DOCTYPE p [
12655     <!ENTITY c "&c;">
12656     ]>
12657     <p a="&c;"/>
12658     @@@c:erred: <[[xp|wf-no-recursion]]> { (1, 1)..(1, 3); }
12659     @@XMLTest:
12660     @@@QName: xp.attval.no.recursion.indirect.test
12661     @@@DEnt:
12662     @@@@test:value:
12663     <!DOCTYPE p [
12664     <!ENTITY d "&c;">
12665     <!ENTITY c "&d;">
12666     ]>
12667     <p a="&c;"/>
12668     @@@c:erred: <[[xp|wf-no-recursion]]> { /* |d| */ (1, 1)..(1, 3); }
12669     @@XMLTest:
12670     @@@QName: xp.reptxt.element.content.no.recursion.direct.test
12671     @@@DEnt:
12672     @@@@test:value:
12673     <!DOCTYPE p [
12674     <!ENTITY c "&c;">
12675     <!ENTITY e "&#x26;c;">
12676     ]>
12677     <p>&e;</p>
12678     @@@c:erred: <[[xp|wf-no-recursion]]> { /* |e| */ (1, 1)..(1, 3); }
12679     @@XMLTest:
12680     @@@QName: xp.reptxt.element.content.no.recursion.indirect.test
12681     @@@DEnt:
12682     @@@@test:value:
12683     <!DOCTYPE p [
12684     <!ENTITY d "&c;">
12685     <!ENTITY c "&d;">
12686     <!ENTITY e "&#x26;c;">
12687     ]>
12688     <p>&e;</p>
12689     @@@c:erred: <[[xp|wf-no-recursion]]> { /* |d| */ (1, 1)..(1, 3); }
12690     @@XMLTest:
12691     @@@QName: xp.reptxt.attval.no.recursion.direct.test
12692     @@@DEnt:
12693     @@@@test:value:
12694     <!DOCTYPE p [
12695     <!ENTITY c "&c;">
12696     <!ENTITY e "&#x26;c;">
12697     ]>
12698     <p a="&e;"/>
12699     @@@c:erred: <[[xp|wf-no-recursion]]> { /* |e| */ (1, 1)..(1, 3); }
12700     @@XMLTest:
12701     @@@QName: xp.reptxt.attval.no.recursion.indirect.test
12702     @@@DEnt:
12703     @@@@test:value:
12704     <!DOCTYPE p [
12705     <!ENTITY d "&c;">
12706     <!ENTITY c "&d;">
12707     <!ENTITY e "&#x26;c;">
12708     ]>
12709     <p a="&e;"/>
12710     @@@c:erred: <[[xp|wf-no-recursion]]> { /* |d| */ (1, 1)..(1, 3); }
12711    
12712     @@XMLTest:
12713     @@@QName: xp.ENTITY.system.ndata.name.test
12714     @@@DEnt:
12715     @@@@test:value:
12716     <!DOCTYPE a [
12717     <!NOTATION n SYSTEM "n">
12718     <!ENTITY % e SYSTEM "sys" NDATA n>
12719     ]><a/>
12720     @@@c:erred: <[[xp|wf-syntax-error]]> { (3, 26)..(3, 30); }
12721     @@XMLTest:
12722     @@@QName: xp.ENTITY.public.ndata.name.test
12723     @@@DEnt:
12724     @@@@test:value:
12725     <!DOCTYPE a [
12726     <!NOTATION n SYSTEM "n">
12727     <!ENTITY % e PUBLIC "pub" "sys" NDATA n>
12728     ]><a/>
12729     @@@c:erred: <[[xp|wf-syntax-error]]> { (3, 33)..(3, 37); }
12730     @@XMLTest:
12731     @@@QName: xp.ENTITY.public.ndata.name.-1.test
12732     @@@DEnt:
12733     @@@@test:value:
12734     <!DOCTYPE a [
12735     <!NOTATION n SYSTEM "n">
12736     <!ENTITY % e PUBLIC "pub" "sys" >
12737     ]><a/>
12738     @@@test:domTree:
12739     document { }
12740    
12741     @@XMLTest:
12742     @@@QName: xp.ENTITY.pubid.1.test
12743     @@@DEnt:
12744     @@@@test:value:
12745     <!DOCTYPE a [
12746     <!ENTITY e PUBLIC "p" "s">
12747     ]><a/>
12748     @@@test:domTree:
12749     document {
12750     document-type {
12751     general-entity {
12752     node-name: 'e';
12753     public-id: 'p';
12754     system-id: 's';
12755     }
12756     }
12757     element { }
12758     }
12759     @@XMLTest:
12760     @@@QName: xp.ENTITY.pubid.2.test
12761     @@@DEnt:
12762     @@@@test:value:
12763     <!DOCTYPE a [
12764     <!ENTITY e PUBLIC " p " "s">
12765     ]><a/>
12766     @@@test:domTree:
12767     document {
12768     document-type {
12769     general-entity {
12770     node-name: 'e';
12771     public-id: 'p';
12772     system-id: 's';
12773     }
12774     }
12775     element { }
12776     }
12777     @@XMLTest:
12778     @@@QName: xp.ENTITY.pubid.3.test
12779     @@@DEnt:
12780     @@@@test:value:
12781     <!DOCTYPE a [
12782     <!ENTITY e PUBLIC " p $u000Aq$u000A " "s">
12783     ]><a/>
12784     @@@test:domTree:
12785     document {
12786     document-type {
12787     general-entity {
12788     node-name: 'e';
12789     public-id: 'p q';
12790     system-id: 's';
12791     }
12792     }
12793     element { }
12794     }
12795     @@XMLTest:
12796     @@@QName: xp.ENTITY.pubid.4.test
12797     @@@DEnt:
12798     @@@@test:value:
12799     <!DOCTYPE a [
12800     <!ENTITY e PUBLIC " p $u000D$u000Aq" "s">
12801     ]><a/>
12802     @@@test:domTree:
12803     document {
12804     document-type {
12805     general-entity {
12806     node-name: 'e';
12807     public-id: 'p q';
12808     system-id: 's';
12809     }
12810     }
12811     element { }
12812     }
12813     @@XMLTest:
12814     @@@QName: xp.ENTITY.pubid.5.test
12815     @@@DEnt:
12816     @@@@test:value:
12817     <?xml version="1.1"?>
12818     <!DOCTYPE a [
12819 wakaba 1.27 <!ENTITY e PUBLIC " p $u000D$u0085q" "s">
12820 wakaba 1.23 ]><a/>
12821     @@@test:domTree:
12822     document {
12823     document-type {
12824     general-entity {
12825     node-name: 'e';
12826     public-id: 'p q';
12827     system-id: 's';
12828     }
12829     }
12830     element { }
12831     }
12832    
12833 wakaba 1.24 @@XMLTest:
12834     @@@QName: xp.ENTITY.ignored.test
12835     @@@DEnt:
12836     @@@@test:value:
12837     <!DOCTYPE a [
12838     <!ENTITY e "a">
12839     <!ENTITY e "b">
12840     ]><a/>
12841 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
12842 wakaba 1.24 @@@test:domTree:
12843     document {
12844     document-type {
12845     general-entity {
12846     node-name: 'e';
12847     text-content: 'a';
12848     }
12849     }
12850     element { }
12851     }
12852     @@@c:erred:
12853     <[[xp|warning-entity-declaration-ignored]]> { (3, 1)..(3, 15); }
12854     @@XMLTest:
12855     @@@QName: xp.ENTITY.ignored.2.test
12856     @@@DEnt:
12857     @@@@test:value:
12858     <!DOCTYPE a [
12859     <!ENTITY % e "a">
12860     <!ENTITY % e "b">
12861     ]><a/>
12862     @@@test:domTree:
12863     document { }
12864     @@@c:erred:
12865     <[[xp|warning-entity-declaration-ignored]]> { (3, 1)..(3, 17); }
12866    
12867     @@XMLTest:
12868     @@@QName: xp.ENTITY.predefined.1.test
12869     @@@DEnt:
12870     @@@@test:value:
12871     <!DOCTYPE a [
12872     <!ENTITY lt "&#38;#60;">
12873     <!ENTITY gt "&#62;">
12874     <!ENTITY amp "&#38;#38;">
12875     <!ENTITY apos "&#39;">
12876     <!ENTITY quot "&#34;">
12877     <!ENTITY e "f">
12878     ]><a>&lt;&gt;&amp;&apos;&quot;</a>
12879 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
12880 wakaba 1.24 @@@test:domTree:
12881     document {
12882     document-type {
12883     general-entity {
12884     node-name: 'e';
12885     text-content: 'f';
12886     }
12887     }
12888     element {
12889     text-content: '<>&' U+0027 '"';
12890     }
12891     }
12892     @@XMLTest:
12893     @@@QName: xp.ENTITY.predefined.2.test
12894     @@@DEnt:
12895     @@@@test:value:
12896     <!DOCTYPE a [
12897     <!ENTITY lt "&#38;#60;">
12898     <!ENTITY gt "&#x26;#62;">
12899     <!ENTITY amp "&#38;#38;">
12900     <!ENTITY apos "&#x26;#39;">
12901     <!ENTITY quot "&#x26;#34;">
12902     <!ENTITY e "f">
12903     ]><a>&lt;&gt;&amp;&apos;&quot;</a>
12904 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
12905 wakaba 1.24 @@@test:domTree:
12906     document {
12907     document-type {
12908     general-entity {
12909     node-name: 'e';
12910     text-content: 'f';
12911     }
12912     }
12913     element {
12914     text-content: '<>&' U+0027 '"';
12915     }
12916     }
12917     @@XMLTest:
12918     @@@QName: xp.ENTITY.predefined.3.test
12919     @@@DEnt:
12920     @@@@test:value:
12921     <!DOCTYPE a [
12922     <!ENTITY lt "&#60;">
12923     <!ENTITY gt "&#62;">
12924     <!ENTITY amp "&#38;">
12925     <!ENTITY apos "&#39;">
12926     <!ENTITY quot "&#34;">
12927     <!ENTITY e "f">
12928     ]><a>&lt;&gt;&amp;&apos;&quot;</a>
12929 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
12930 wakaba 1.24 @@@c:erred: <[[xp|error-malformed-predefined-entity]]> { (2, 1)..(2, 24); }
12931     @@@c:erred: <[[xp|error-malformed-predefined-entity]]> { (4, 1)..(4, 24); }
12932     @@@test:domTree:
12933     document {
12934     document-type {
12935     general-entity {
12936     node-name: 'e';
12937     text-content: 'f';
12938     }
12939     }
12940     element {
12941     text-content: '<>&' U+0027 '"';
12942     }
12943     }
12944     @@XMLTest:
12945     @@@QName: xp.ENTITY.predefined.4.test
12946     @@@DEnt:
12947     @@@@test:value:
12948     <!DOCTYPE a [
12949     <!ENTITY lt "1">
12950     <!ENTITY gt "2">
12951     <!ENTITY amp "3">
12952     <!ENTITY apos "4">
12953     <!ENTITY quot "5">
12954     <!ENTITY e "f">
12955     ]><a>&lt;&gt;&amp;&apos;&quot;</a>
12956 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
12957 wakaba 1.24 @@@c:erred: <[[xp|error-malformed-predefined-entity]]> { (2, 1)..(2, 24); }
12958     @@@c:erred: <[[xp|error-malformed-predefined-entity]]> { (3, 1)..(3, 24); }
12959     @@@c:erred: <[[xp|error-malformed-predefined-entity]]> { (4, 1)..(4, 24); }
12960     @@@c:erred: <[[xp|error-malformed-predefined-entity]]> { (5, 1)..(5, 24); }
12961     @@@c:erred: <[[xp|error-malformed-predefined-entity]]> { (6, 1)..(6, 24); }
12962     @@@test:domTree:
12963     document {
12964     document-type {
12965     general-entity {
12966     node-name: 'e';
12967     text-content: 'f';
12968     }
12969     }
12970     element {
12971     text-content: '<>&' U+0027 '"';
12972     }
12973     }
12974     @@XMLTest:
12975     @@@QName: xp.ENTITY.predefined.5.test
12976     @@@DEnt:
12977     @@@@test:value:
12978     <!DOCTYPE a [
12979     <!ENTITY lt SYSTEM "1">
12980     <!ENTITY gt SYSTEM "2">
12981     <!ENTITY amp SYSTEM "3">
12982     <!ENTITY apos SYSTEM "4">
12983     <!ENTITY quot SYSTEM "5">
12984     <!ENTITY e "f">
12985     ]><a>&lt;&gt;&amp;&apos;&quot;</a>
12986 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
12987 wakaba 1.24 @@@c:erred: <[[xp|error-internal-predefined-entity]]> { (2, 1)..(2, 27); }
12988     @@@c:erred: <[[xp|error-internal-predefined-entity]]> { (3, 1)..(3, 27); }
12989     @@@c:erred: <[[xp|error-internal-predefined-entity]]> { (4, 1)..(4, 27); }
12990     @@@c:erred: <[[xp|error-internal-predefined-entity]]> { (5, 1)..(5, 27); }
12991     @@@c:erred: <[[xp|error-internal-predefined-entity]]> { (6, 1)..(6, 27); }
12992     @@@test:domTree:
12993     document {
12994     document-type {
12995     general-entity {
12996     node-name: 'e';
12997     text-content: 'f';
12998     }
12999     }
13000     element {
13001     text-content: '<>&' U+0027 '"';
13002     }
13003     }
13004     @@XMLTest:
13005     @@@QName: xp.ENTITY.predefined.6.test
13006     @@@DEnt:
13007     @@@@test:value:
13008     <!DOCTYPE a [
13009     <!ENTITY % lt SYSTEM "1">
13010     <!ENTITY % gt SYSTEM "2">
13011     <!ENTITY % amp SYSTEM "3">
13012     <!ENTITY % apos SYSTEM "4">
13013     <!ENTITY % quot SYSTEM "5">
13014     <!ENTITY e "f">
13015     ]><a>&lt;&gt;&amp;&apos;&quot;</a>
13016 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
13017 wakaba 1.24 @@@test:domTree:
13018     document {
13019     document-type {
13020     general-entity {
13021     node-name: 'e';
13022     text-content: 'f';
13023     }
13024     }
13025     element {
13026     text-content: '<>&' U+0027 '"';
13027     }
13028     }
13029     @@XMLTest:
13030     @@@QName: xp.ENTITY.predefined.7.test
13031     @@@DEnt:
13032     @@@@test:value:
13033     <!DOCTYPE a [
13034     <!ENTITY lt "&#38;#x3C;">
13035     <!ENTITY gt "&#x3E;">
13036     <!ENTITY amp "&#38;#x26;">
13037     <!ENTITY apos "&#x27;">
13038     <!ENTITY quot "&#x22;">
13039     <!ENTITY e "f">
13040     ]><a>&lt;&gt;&amp;&apos;&quot;</a>
13041 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
13042 wakaba 1.24 @@@test:domTree:
13043     document {
13044     document-type {
13045     general-entity {
13046     node-name: 'e';
13047     text-content: 'f';
13048     }
13049     }
13050     element {
13051     text-content: '<>&' U+0027 '"';
13052     }
13053     }
13054     @@XMLTest:
13055     @@@QName: xp.ENTITY.predefined.8.test
13056     @@@DEnt:
13057     @@@@test:value:
13058     <!DOCTYPE a [
13059     <!ENTITY lt "&#38;#x3c;">
13060     <!ENTITY gt "&#x3e;">
13061     <!ENTITY amp "&#38;#x26;">
13062     <!ENTITY apos "&#x27;">
13063     <!ENTITY quot "&#x22;">
13064     <!ENTITY e "f">
13065     ]><a>&lt;&gt;&amp;&apos;&quot;</a>
13066 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
13067 wakaba 1.24 @@@test:domTree:
13068     document {
13069     document-type {
13070     general-entity {
13071     node-name: 'e';
13072     text-content: 'f';
13073     }
13074     }
13075     element {
13076     text-content: '<>&' U+0027 '"';
13077     }
13078     }
13079     @@XMLTest:
13080     @@@QName: xp.ENTITY.predefined.9.test
13081     @@@DEnt:
13082     @@@@test:value:
13083     <!DOCTYPE a [
13084     <!ENTITY lt "&#38;#x00003C;">
13085     <!ENTITY gt "&#x0003E;">
13086     <!ENTITY amp "&#38;#x026;">
13087     <!ENTITY apos "&#x000027;">
13088     <!ENTITY quot "&#x0022;">
13089     <!ENTITY e "f">
13090     ]><a>&lt;&gt;&amp;&apos;&quot;</a>
13091 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
13092 wakaba 1.24 @@@test:domTree:
13093     document {
13094     document-type {
13095     general-entity {
13096     node-name: 'e';
13097     text-content: 'f';
13098     }
13099     }
13100     element {
13101     text-content: '<>&' U+0027 '"';
13102     }
13103     }
13104     @@XMLTest:
13105     @@@QName: xp.ENTITY.predefined.10.test
13106     @@@DEnt:
13107     @@@@test:value:
13108     <!DOCTYPE a [
13109     <!ENTITY lt "&#38;#00060;">
13110     <!ENTITY gt "&#062;">
13111     <!ENTITY amp "&#38;#000038;">
13112     <!ENTITY apos "&#0000039;">
13113     <!ENTITY quot "&#0034;">
13114     <!ENTITY e "f">
13115     ]><a>&lt;&gt;&amp;&apos;&quot;</a>
13116 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
13117 wakaba 1.24 @@@test:domTree:
13118     document {
13119     document-type {
13120     general-entity {
13121     node-name: 'e';
13122     text-content: 'f';
13123     }
13124     }
13125     element {
13126     text-content: '<>&' U+0027 '"';
13127     }
13128     }
13129    
13130 wakaba 1.25 @@XMLTest:
13131     @@@QName: xp.processed.1.test
13132     @@@DEnt:
13133     @@@@test:value:
13134     <a/>
13135     @@@test:domTree:
13136     document {
13137     all-declarations-processed: true;
13138     element { }
13139     }
13140     @@XMLTest:
13141     @@@QName: xp.processed.2.test
13142     @@@DEnt:
13143     @@@@test:value:
13144     <!DOCTYPE a [
13145     <!ENTITY e "f">
13146     <!ATTLIST a b NMTOKEN " c ">
13147     ]><a>&e;</a>
13148     @@@test:domTree:
13149     document {
13150     document-type {
13151     general-entity {
13152     node-name: 'e';
13153     }
13154     element-type-definition {
13155     node-name: 'a';
13156     attribute-definition {
13157     node-name: 'b';
13158     }
13159     }
13160     }
13161     all-declarations-processed: true;
13162     element {
13163     attribute {
13164     node-name: 'b';
13165     node-value: 'c';
13166     }
13167     text-content: 'f';
13168     }
13169     }
13170     @@XMLTest:
13171     @@@QName: xp.processed.3.test
13172     @@@DEnt:
13173     @@@@test:value:
13174     <!DOCTYPE a [
13175     <!ENTITY % p SYSTEM "p">
13176     %p;
13177     <!ENTITY e "f">
13178     <!ATTLIST a b NMTOKEN " c ">
13179     ]><a d="e">&e;</a>
13180     @@@test:domTree:
13181     document {
13182     document-type { }
13183     all-declarations-processed: false;
13184     element {
13185     attribute {
13186     node-name: 'd';
13187     node-value: 'e';
13188     }
13189     general-entity-reference {
13190     node-name: 'e';
13191 wakaba 1.34 manakai-expanded: false;
13192 wakaba 1.25 }
13193     }
13194     }
13195     @@@c:erred:
13196     <[[xp|warning-entity-declaration-not-processed]]> { (4, 1)..(4, 20); }
13197     @@@c:erred:
13198     <[[xp|warning-attribute-definition-not-processed]]> { (5, 13)..(5, 31); }
13199     @@XMLTest:
13200     @@@QName: xp.processed.4.test
13201     @@@DEnt:
13202     @@@@test:value:
13203     <?xml version="1.1" standalone="yes"?>
13204     <!DOCTYPE a [
13205     <!ENTITY % p SYSTEM "p">
13206     %p;
13207     <!ENTITY e "f">
13208     <!ATTLIST a b NMTOKEN " c ">
13209     ]><a>&e;</a>
13210     @@@test:domTree:
13211     document {
13212     document-type {
13213     general-entity {
13214     node-name: 'e';
13215     }
13216     element-type-definition {
13217     node-name: 'a';
13218     attribute-definition {
13219     node-name: 'b';
13220     }
13221     }
13222     }
13223     all-declarations-processed: false;
13224     element {
13225     attribute {
13226     node-name: 'b';
13227     node-value: 'c';
13228     }
13229     text-content: 'f';
13230     }
13231     }
13232     @@XMLTest:
13233     @@@QName: xp.processed.5.test
13234     @@@DEnt:
13235     @@@@test:value:
13236     <!DOCTYPE a SYSTEM "p" [
13237     <!ENTITY e "f">
13238     <!ATTLIST a b NMTOKEN " c ">
13239     ]><a>&e;</a>
13240     @@@test:domTree:
13241     document {
13242     document-type {
13243     general-entity {
13244     node-name: 'e';
13245     }
13246     element-type-definition {
13247     node-name: 'a';
13248     attribute-definition {
13249     node-name: 'b';
13250     }
13251     }
13252     }
13253     all-declarations-processed: false;
13254     element {
13255     attribute {
13256     node-name: 'b';
13257     node-value: 'c';
13258     }
13259     text-content: 'f';
13260     }
13261     }
13262    
13263     @@XMLTest:
13264     @@@QName: xp.PEs.in.internal.subset.1.test
13265     @@@DEnt:
13266     @@@@test:value:
13267     <!DOCTYPE a [
13268     <!ENTITY % p " ">
13269 wakaba 1.26 <!ENTITY % q "%p;">
13270 wakaba 1.25 ]><a/>
13271     @@@c:erred: <[[xp|wf-pes-in-internal-subset]]> { (3, 15)..(3, 17); }
13272     @@XMLTest:
13273     @@@QName: xp.PEs.in.internal.subset.2.test
13274     @@@DEnt:
13275     @@@@test:value:
13276     <!DOCTYPE a [
13277     <!ENTITY % p " ">
13278 wakaba 1.26 <!ENTITY % q '%p;'>
13279 wakaba 1.25 ]><a/>
13280     @@@c:erred: <[[xp|wf-pes-in-internal-subset]]> { (3, 15)..(3, 17); }
13281    
13282 wakaba 1.26 @@XMLTest:
13283     @@@QName: xp.name.pitarget.content.1.0.2.test
13284     @@@DEnt:
13285     @@@@test:value:
13286     <?xml version="1.0"?>
13287     <p>
13288     <?$u3001$u3002?>
13289     </p>
13290     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]> { (3, 3)..(3, 4); }
13291     @@XMLTest:
13292     @@@QName: xp.name.pitarget.content.1.1.2.test
13293     @@@DEnt:
13294     @@@@test:value:
13295     <?xml version="1.1"?>
13296     <p>$
13297     <?$u3001$u3002?>$
13298     </p>
13299     @@@test:domTree:
13300     document {
13301     xml-version: '1.1';
13302     element {
13303     pi {
13304     node-name: U+3001 U+3002;
13305 wakaba 1.14 }
13306 wakaba 1.12 }
13307 wakaba 1.26 }
13308     @@XMLTest:
13309     @@@QName: xp.name.pitarget.content.1.0.3.test
13310     @@@DEnt:
13311     @@@@test:value:
13312     <?xml version="1.0"?>
13313     <p>
13314     <?$u3005b?>
13315     </p>
13316     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]> { (3, 3)..(3, 4); }
13317     @@XMLTest:
13318     @@@QName: xp.name.pitarget.content.1.1.3.test
13319     @@@DEnt:
13320     @@@@test:value:
13321     <?xml version="1.1"?>
13322     <p>$
13323     <?$u3005b?>$
13324     </p>
13325     @@@test:domTree:
13326     document {
13327     xml-version: '1.1';
13328     element {
13329     pi {
13330     node-name: U+3005 'b';
13331 wakaba 1.12 }
13332     }
13333 wakaba 1.26 }
13334     @@XMLTest:
13335     @@@QName: xp.name.pitarget.content.names.1.0.1.test
13336     @@@DEnt:
13337     @@@@test:value:
13338     <?xml version="1.0"?>
13339     <p>
13340     <?a:b?>
13341     </p>
13342     @@@c:erred: <[[xp|nswf-legal-ncname]]> { (3, 3)..(3, 5); }
13343     @@XMLTest:
13344     @@@QName: xp.name.pitarget.content.names.1.1.1.test
13345     @@@DEnt:
13346     @@@@test:value:
13347     <?xml version="1.1"?>
13348     <p>
13349     <?a:b?>
13350     </p>
13351     @@@c:erred: <[[xp|nswf-legal-ncname]]> { (3, 3)..(3, 5); }
13352     @@XMLTest:
13353     @@@QName: xp.name.pitarget.intsubset.1.0.2.test
13354     @@@DEnt:
13355     @@@@test:value:
13356     <?xml version="1.0"?>
13357     <!DOCTYPE p [
13358     <?$u3001$u3002?>
13359     ]><p/>
13360     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]> { (3, 3)..(3, 4); }
13361     @@XMLTest:
13362     @@@QName: xp.name.pitarget.intsubset.1.1.2.test
13363     @@@DEnt:
13364     @@@@test:value:
13365     <?xml version="1.1"?>
13366     <!DOCTYPE p [
13367     <?$u3001$u3002?>
13368     ]><p/>
13369     @@@test:domTree:
13370     document {
13371     xml-version: '1.1';
13372     document-type {
13373     pi {
13374     node-name: U+3001 U+3002;
13375     }
13376     }
13377     element { }
13378     }
13379     @@XMLTest:
13380     @@@QName: xp.name.pitarget.intsubset.1.0.3.test
13381     @@@DEnt:
13382     @@@@test:value:
13383     <?xml version="1.0"?>
13384     <!DOCTYPE p [
13385     <?$u3005b?>
13386     ]><p/>
13387     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]> { (3, 3)..(3, 4); }
13388     @@XMLTest:
13389     @@@QName: xp.name.pitarget.intsubset.1.1.3.test
13390     @@@DEnt:
13391     @@@@test:value:
13392     <?xml version="1.1"?>
13393     <!DOCTYPE p [
13394     <?$u3005b?>
13395     ]><p/>
13396     @@@test:domTree:
13397     document {
13398     xml-version: '1.1';
13399     document-type {
13400     pi {
13401     node-name: U+3005 'b';
13402     }
13403     }
13404     element { }
13405     }
13406     @@XMLTest:
13407     @@@QName: xp.name.pitarget.intsubset.names.1.0.1.test
13408     @@@DEnt:
13409     @@@@test:value:
13410     <?xml version="1.0"?>
13411     <!DOCTYPE p [
13412     <?a:b?>
13413     ]><p/>
13414     @@@c:erred: <[[xp|nswf-legal-ncname]]> { (3, 3)..(3, 5); }
13415     @@XMLTest:
13416     @@@QName: xp.name.pitarget.intsubset.names.1.1.1.test
13417     @@@DEnt:
13418     @@@@test:value:
13419     <?xml version="1.1"?>
13420     <!DOCTYPE p [
13421     <?a:b?>
13422     ]><p/>
13423     @@@c:erred: <[[xp|nswf-legal-ncname]]> { (3, 3)..(3, 5); }
13424     @@XMLTest:
13425     @@@QName: xp.name.doctypedecl.stag.etag.1.0.2.test
13426     @@@DEnt:
13427     @@@@test:value:
13428     <?xml version="1.0"?>
13429     <!DOCTYPE $u3001$u3002>
13430     <$u3001$u3002>
13431     </$u3001$u3002>
13432     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (2, 11)..(2, 12); }
13433     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (3, 2)..(3, 3); }
13434     # @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (4, 3)..(4, 4); }
13435     @@XMLTest:
13436     @@@QName: xp.name.doctypedecl.stag.etag.1.1.2.test
13437     @@@DEnt:
13438     @@@@test:value:
13439     <?xml version="1.1"?>
13440     <!DOCTYPE $u3001$u3002>
13441     <$u3001$u3002>
13442     </$u3001$u3002>
13443     @@@test:domTree:
13444     document {
13445     xml-version: '1.1';
13446     document-type {
13447     node-name: U+3001 U+3002;
13448     }
13449     element {
13450     node-name: U+3001 U+3002;
13451     }
13452     }
13453     @@XMLTest:
13454     @@@QName: xp.name.doctypedecl.stag.etag.1.0.3.test
13455     @@@DEnt:
13456     @@@@test:value:
13457     <?xml version="1.0"?>
13458     <!DOCTYPE $u3005b>
13459     <$u3005b>
13460     </$u3005b>
13461     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (2, 11)..(2, 12); }
13462     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (3, 2)..(3, 3); }
13463     # @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (4, 3)..(4, 4); }
13464     @@XMLTest:
13465     @@@QName: xp.name.doctype.decl.stag.etag.1.1.3.test
13466     @@@DEnt:
13467     @@@@test:value:
13468     <?xml version="1.1"?>
13469     <!DOCTYPE $u3005b>
13470     <$u3005b>
13471     </$u3005b>
13472     @@@test:domTree:
13473     document {
13474     xml-version: '1.1';
13475     document-type {
13476     node-name: U+3005 'b';
13477     }
13478     element {
13479     node-name: U+3005 'b';
13480     }
13481     }
13482     @@XMLTest:
13483     @@@QName: xp.name.doctypedecl.stag.etag.names.1.0.1.test
13484     @@@DEnt:
13485     @@@@test:value:
13486     <?xml version="1.0"?>
13487     <!DOCTYPE a:b>
13488     <a:b xmlns:a="http://a.example/">
13489     </a:b>
13490     @@@test:domTree:
13491     document {
13492     xml-version: '1.0';
13493     document-type {
13494     node-name: 'a:b';
13495     }
13496     element {
13497     prefix: 'a';
13498     local-name: 'b';
13499     namespace-uri: 'http://a.example/';
13500     attribute {
13501     namespace-uri: 'http://www.w3.org/2000/xmlns/';
13502     prefix: 'xmlns';
13503     local-name: 'a';
13504     value: 'http://a.example/';
13505     specified: true;
13506     }
13507     }
13508     }
13509     @@XMLTest:
13510     @@@QName: xp.name.doctypedecl.stag.etag.names.1.1.1.test
13511     @@@DEnt:
13512     @@@@test:value:
13513     <?xml version="1.1"?>
13514     <!DOCTYPE a:b>
13515     <a:b xmlns:a="http://a.example/">
13516     </a:b>
13517     @@@test:domTree:
13518     document {
13519     xml-version: '1.1';
13520     document-type {
13521     node-name: 'a:b';
13522     }
13523     element {
13524     prefix: 'a';
13525     local-name: 'b';
13526     namespace-uri: 'http://a.example/';
13527     attribute {
13528     namespace-uri: 'http://www.w3.org/2000/xmlns/';
13529     prefix: 'xmlns';
13530     local-name: 'a';
13531     specified: true;
13532     }
13533     }
13534     }
13535     @@XMLTest:
13536     @@@QName: xp.name.doctypedecl.stag.etag.names.1.0.2.test
13537     @@@DEnt:
13538     @@@@test:value:
13539     <?xml version="1.0"?>
13540     <!DOCTYPE :ab>
13541     <:ab>
13542     </:ab>
13543     @@@c:erred: <[[xp|nswf-legal-qname]]> { (2, 11)..(2, 13); }
13544     @@@c:erred: <[[xp|nswf-legal-qname]]> { (3, 2)..(3, 4); }
13545     @@@c:erred: <[[xp|nsc-prefix-declared]]> { /* prefix || */ }
13546     @@XMLTest:
13547     @@@QName: xp.name.doctypedecl.stag.etag.names.1.1.2.test
13548     @@@DEnt:
13549     @@@@test:value:
13550     <?xml version="1.1"?>
13551     <!DOCTYPE :ab>
13552     <:ab>
13553     </:ab>
13554     @@@c:erred: <[[xp|nswf-legal-qname]]> { (2, 11)..(2, 13); }
13555     @@@c:erred: <[[xp|nswf-legal-qname]]> { (3, 2)..(3, 4); }
13556     @@@c:erred: <[[xp|nsc-prefix-declared]]> { /* prefix || */ }
13557     @@XMLTest:
13558     @@@QName: xp.name.doctypedecl.stag.etag.names.1.0.3.test
13559     @@@DEnt:
13560     @@@@test:value:
13561     <?xml version="1.0"?>
13562     <!DOCTYPE a:$u3005>
13563     <a:$u3005 xmlns:a="http://a.example/">
13564     </a:$u3005>
13565     @@@c:erred: <[[xp|nswf-legal-qname]]> { (2, 11)..(2, 13); }
13566     @@@c:erred: <[[xp|nswf-legal-qname]]> { (3, 2)..(3, 4); }
13567     @@XMLTest:
13568     @@@QName: xp.name.doctypedecl.stag.etag.names.1.1.3.test
13569     @@@DEnt:
13570     @@@@test:value:
13571     <?xml version="1.1"?>
13572     <!DOCTYPE a:$u3005>
13573     <a:$u3005 xmlns:a="http://a.example/">
13574     </a:$u3005>
13575     @@@test:domTree:
13576     document {
13577     xml-version: '1.1';
13578     document-type {
13579     node-name: 'a:' U+3005;
13580     }
13581     element {
13582     prefix: 'a';
13583     local-name: U+3005;
13584     namespace-uri: 'http://a.example/';
13585     attribute {
13586     namespace-uri: 'http://www.w3.org/2000/xmlns/';
13587     prefix: 'xmlns';
13588     local-name: 'a';
13589     value: 'http://a.example/';
13590     specified: true;
13591     }
13592     }
13593     }
13594     @@XMLTest:
13595     @@@QName: xp.name.doctypedecl.stag.etag.names.1.0.4.test
13596     @@@DEnt:
13597     @@@@test:value:
13598     <?xml version="1.0"?>
13599     <!DOCTYPE a:b>
13600     <a:b>
13601     </a:b>
13602     @@@c:erred: <[[xp|nsc-prefix-declared]]> { (3, 1)..(3, 5); }
13603     @@XMLTest:
13604     @@@QName: xp.name.doctypedecl.stag.etag.names.1.1.4.test
13605     @@@DEnt:
13606     @@@@test:value:
13607     <?xml version="1.1"?>
13608     <!DOCTYPE a:b>
13609     <a:b>
13610     </a:b>
13611     @@@c:erred: <[[xp|nsc-prefix-declared]]> { (3, 1)..(3, 5); }
13612     @@XMLTest:
13613     @@@QName: xp.name.emptyelemtag.1.0.2.test
13614     @@@DEnt:
13615     @@@@test:value:
13616     <?xml version="1.0"?>
13617     <$u3001$u3002/>
13618     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (2, 2)..(2, 3); }
13619     @@XMLTest:
13620     @@@QName: xp.name.emptyelemtag.1.1.2.test
13621     @@@DEnt:
13622     @@@@test:value:
13623     <?xml version="1.1"?>
13624     <$u3001$u3002/>
13625     @@@test:domTree:
13626     document {
13627     xml-version: '1.1';
13628     element {
13629     node-name: U+3001 U+3002;
13630     }
13631     }
13632     @@XMLTest:
13633     @@@QName: xp.name.emptyelemtag.1.0.3.test
13634     @@@DEnt:
13635     @@@@test:value:
13636     <?xml version="1.0"?>
13637     <$u3005b/>
13638     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (2, 2)..(2, 3); }
13639     @@XMLTest:
13640     @@@QName: xp.name.emptyelemtag.1.1.3.test
13641     @@@DEnt:
13642     @@@@test:value:
13643     <?xml version="1.1"?>
13644     <$u3005b/>
13645     @@@test:domTree:
13646     document {
13647     xml-version: '1.1';
13648     element {
13649     node-name: U+3005 'b';
13650     }
13651     }
13652     @@XMLTest:
13653     @@@QName: xp.name.emptyelemtag.names.1.0.1.test
13654     @@@DEnt:
13655     @@@@test:value:
13656     <?xml version="1.0"?>
13657     <a:b/>
13658     @@@c:erred: <[[xp|nsc-prefix-declared]]>{ (2, 1)..(2, 6); }
13659     @@XMLTest:
13660     @@@QName: xp.name.emptyelemtag.names.1.1.1.test
13661     @@@DEnt:
13662     @@@@test:value:
13663     <?xml version="1.1"?>
13664     <a:b/>
13665     @@@c:erred: <[[xp|nsc-prefix-declared]]>{ (2, 1)..(2, 6); }
13666     @@XMLTest:
13667     @@@QName: xp.name.attr.1.0.2.test
13668     @@@DEnt:
13669     @@@@test:value:
13670     <?xml version="1.0"?>
13671     <a $u3001$u3002=""/>
13672     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (2, 4)..(2, 5); }
13673     @@XMLTest:
13674     @@@QName: xp.name.attr.1.1.2.test
13675     @@@DEnt:
13676     @@@@test:value:
13677     <?xml version="1.1"?>
13678     <a $u3001$u3002=""/>
13679     @@@test:domTree:
13680     document {
13681     xml-version: '1.1';
13682     element {
13683     attribute {
13684     node-name: U+3001 U+3002;
13685     }
13686     }
13687     }
13688     @@XMLTest:
13689     @@@QName: xp.name.attr.1.0.3.test
13690     @@@DEnt:
13691     @@@@test:value:
13692     <?xml version="1.0"?>
13693     <a $u3005b=""/>
13694     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (2, 4)..(2, 5); }
13695     @@XMLTest:
13696     @@@QName: xp.name.attr.1.1.3.test
13697     @@@DEnt:
13698     @@@@test:value:
13699     <?xml version="1.1"?>
13700     <a $u3005b=""/>
13701     @@@test:domTree:
13702     document {
13703     xml-version: '1.1';
13704     element {
13705     attribute {
13706     node-name: U+3005 'b';
13707     }
13708     }
13709     }
13710     @@XMLTest:
13711     @@@QName: xp.name.attr.names.1.0.1.test
13712     @@@DEnt:
13713     @@@@test:value:
13714     <?xml version="1.0"?>
13715     <a a:b=""/>
13716     @@@c:erred: <[[xp|nsc-prefix-declared]]>{ (2, 1)..(2, 11); }
13717     @@XMLTest:
13718     @@@QName: xp.name.attr.names.1.1.1.test
13719     @@@DEnt:
13720     @@@@test:value:
13721     <?xml version="1.1"?>
13722     <a a:b=""/>
13723     @@@c:erred: <[[xp|nsc-prefix-declared]]>{ (2, 1)..(2, 11); }
13724     @@XMLTest:
13725     @@@QName: xp.name.attr.names.1.0.2.test
13726     @@@DEnt:
13727     @@@@test:value:
13728     <?xml version="1.0"?>
13729     <a :ab=""/>
13730     @@@c:erred: <[[xp|nswf-legal-qname]]>{ (2, 4)..(2, 6); }
13731     @@@c:erred: <[[xp|nsc-prefix-declared]]> { }
13732     @@XMLTest:
13733     @@@QName: xp.name.attr.names.1.1.2.test
13734     @@@DEnt:
13735     @@@@test:value:
13736     <?xml version="1.1"?>
13737     <a :ab=""/>
13738     @@@c:erred: <[[xp|nswf-legal-qname]]>{ (2, 4)..(2, 6); }
13739     @@@c:erred: <[[xp|nsc-prefix-declared]]> { }
13740     @@XMLTest:
13741     @@@QName: xp.name.attlist.1.0.2.test
13742     @@@DEnt:
13743     @@@@test:value:
13744     <?xml version="1.0"?>
13745     <!DOCTYPE p [
13746     <!NOTATION $u3001$u3002 SYSTEM "n">
13747     <!ATTLIST $u3001$u3002
13748     $u3001$u3002
13749     NOTATION
13750     ($u3001$u3002)
13751     #IMPLIED>
13752     ]><p/>
13753     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (3, 12)..(3, 13); }
13754     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (4, 11)..(4, 12); }
13755     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (5, 1)..(5, 2); }
13756     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (7, 2)..(7, 3); }
13757     @@XMLTest:
13758     @@@QName: xp.name.attlist.1.1.2.test
13759     @@@DEnt:
13760     @@@@test:value:
13761     <?xml version="1.1"?>
13762     <!DOCTYPE p [
13763     <!NOTATION $u3001$u3002 SYSTEM "n">
13764     <!ATTLIST $u3001$u3002
13765     $u3001$u3002
13766     NOTATION
13767     ($u3001$u3002)
13768     #IMPLIED>
13769     ]><p/>
13770     @@@test:domTree:
13771     document {
13772     xml-version: '1.1';
13773     document-type {
13774     notation {
13775     node-name: U+3001 U+3002;
13776     }
13777     element-type-definition {
13778     node-name: U+3001 U+3002;
13779     attribute-definition {
13780     node-name: U+3001 U+3002;
13781     allowed-tokens: DOMStringList (U+3001 U+3002);
13782     }
13783     }
13784     }
13785     element { }
13786     }
13787     @@XMLTest:
13788     @@@QName: xp.name.attlist.1.0.3.test
13789     @@@DEnt:
13790     @@@@test:value:
13791     <?xml version="1.0"?>
13792     <!DOCTYPE p [
13793     <!NOTATION $u3005b SYSTEM "n">
13794     <!ATTLIST $u3005b
13795     $u3005b
13796     NOTATION
13797     ($u3005b)
13798     #IMPLIED>
13799     ]><p/>
13800     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (3, 12)..(3, 13); }
13801     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (4, 11)..(4, 12); }
13802     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (5, 1)..(5, 2); }
13803     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (7, 2)..(7, 3); }
13804     @@XMLTest:
13805     @@@QName: xp.name.attlist.1.1.3.test
13806     @@@DEnt:
13807     @@@@test:value:
13808     <?xml version="1.1"?>
13809     <!DOCTYPE p [
13810     <!NOTATION $u3005b SYSTEM "n">
13811     <!ATTLIST $u3005b
13812     $u3005b
13813     NOTATION
13814     ($u3005b)
13815     #IMPLIED>
13816     ]><p/>
13817     @@@test:domTree:
13818     document {
13819     xml-version: '1.1';
13820     document-type {
13821     notation {
13822     node-name: U+3005 'b';
13823     }
13824     element-type-definition {
13825     node-name: U+3005 'b';
13826     attribute-definition {
13827     node-name: U+3005 'b';
13828     allowed-tokens: DOMStringList (U+3005 'b');
13829     }
13830     }
13831     }
13832     element { }
13833     }
13834     @@XMLTest:
13835     @@@QName: xp.name.attlist.names.1.0.1.test
13836     @@@DEnt:
13837     @@@@test:value:
13838     <?xml version="1.0"?>
13839     <!DOCTYPE p [
13840     <!NOTATION a:b SYSTEM "n">
13841     <!ATTLIST a:b
13842     a:b
13843     NOTATION
13844     (a:b)
13845     #IMPLIED>
13846     ]><p/>
13847     @@@c:erred: <[[xp|nswf-legal-ncname]]>{ (3, 12)..(3, 14); }
13848     @@@c:erred: <[[xp|nswf-legal-ncname]]>{ (7, 2)..(7, 4); }
13849     @@XMLTest:
13850     @@@QName: xp.name.attlist.names.1.1.1.test
13851     @@@DEnt:
13852     @@@@test:value:
13853     <?xml version="1.1"?>
13854     <!DOCTYPE p [
13855     <!NOTATION a:b SYSTEM "n">
13856     <!ATTLIST a:b
13857     a:b
13858     NOTATION
13859     (a:b)
13860     #IMPLIED>
13861     ]><p/>
13862     @@@c:erred: <[[xp|nswf-legal-ncname]]>{ (3, 12)..(3, 14); }
13863     @@@c:erred: <[[xp|nswf-legal-ncname]]>{ (7, 2)..(7, 4); }
13864     @@XMLTest:
13865     @@@QName: xp.name.attlist.names.1.0.2.test
13866     @@@DEnt:
13867     @@@@test:value:
13868     <?xml version="1.0"?>
13869     <!DOCTYPE p [
13870     <!NOTATION :ab SYSTEM "n">
13871     <!ATTLIST :ab
13872     :ab
13873     NOTATION
13874     (:ab)
13875     #IMPLIED>
13876     ]><p/>
13877     @@@c:erred: <[[xp|nswf-legal-ncname]]>{ (3, 12)..(3, 14); }
13878     @@@c:erred: <[[xp|nswf-legal-qname]]>{ (4, 11)..(4, 13); }
13879     @@@c:erred: <[[xp|nswf-legal-qname]]>{ (5, 1)..(5, 3); }
13880     @@@c:erred: <[[xp|nswf-legal-ncname]]>{ (7, 2)..(7, 4); }
13881     @@XMLTest:
13882     @@@QName: xp.name.attlist.names.1.1.2.test
13883     @@@DEnt:
13884     @@@@test:value:
13885     <?xml version="1.1"?>
13886     <!DOCTYPE p [
13887     <!NOTATION :ab SYSTEM "n">
13888     <!ATTLIST :ab
13889     :ab
13890     NOTATION
13891     (:ab)
13892     #IMPLIED>
13893     ]><p/>
13894     @@@c:erred: <[[xp|nswf-legal-ncname]]>{ (3, 12)..(3, 14); }
13895     @@@c:erred: <[[xp|nswf-legal-qname]]>{ (4, 11)..(4, 13); }
13896     @@@c:erred: <[[xp|nswf-legal-qname]]>{ (5, 1)..(5, 3); }
13897     @@@c:erred: <[[xp|nswf-legal-ncname]]>{ (7, 2)..(7, 4); }
13898     @@XMLTest:
13899     @@@QName: xp.name.gent.1.0.2.test
13900     @@@DEnt:
13901     @@@@test:value:
13902     <?xml version="1.0"?>
13903     <!DOCTYPE p [
13904     <!ENTITY $u3001$u3002 "n">
13905     ]>
13906     <p a="&$u3001$u3002;">
13907     &$u3001$u3002;
13908     </p>
13909     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (3, 10)..(3, 11); }
13910     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (5, 8)..(5, 9); }
13911     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (6, 2)..(6, 3); }
13912     @@XMLTest:
13913     @@@QName: xp.name.ger.1.1.2.test
13914     @@@DEnt:
13915     @@@@test:value:
13916     <?xml version="1.1"?>
13917     <!DOCTYPE p [
13918     <!ENTITY $u3001$u3002 "n">
13919     ]>
13920     <p a="&$u3001$u3002;">$
13921     &$u3001$u3002;$
13922     </p>
13923     @@@test:domTree:
13924     document {
13925     xml-version: '1.1';
13926     document-type {
13927     general-entity {
13928     node-name: U+3001 U+3002;
13929     }
13930     }
13931     element {
13932     attribute {
13933     node-name: 'a';
13934     general-entity-reference {
13935     node-name: U+3001 U+3002;
13936     }
13937     }
13938     general-entity-reference {
13939     node-name: U+3001 U+3002;
13940     }
13941     }
13942     }
13943     @@XMLTest:
13944     @@@QName: xp.name.ger.1.0.3.test
13945     @@@DEnt:
13946     @@@@test:value:
13947     <?xml version="1.0"?>
13948     <!DOCTYPE p [
13949     <!ENTITY $u3005b "n">
13950     ]>
13951     <p a="&$u3005b;">
13952     &$u3005b;
13953     </p>
13954     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (3, 10)..(3, 11); }
13955     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (5, 8)..(5, 9); }
13956     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (6, 2)..(6, 3); }
13957     @@XMLTest:
13958     @@@QName: xp.name.ger.1.1.3.test
13959     @@@DEnt:
13960     @@@@test:value:
13961     <?xml version="1.1"?>
13962     <!DOCTYPE p [
13963     <!ENTITY $u3005b "n">
13964     ]>
13965     <p a="&$u3005b;">$
13966     &$u3005b;$
13967     </p>
13968     @@@test:domTree:
13969     document {
13970     xml-version: '1.1';
13971     document-type {
13972     general-entity {
13973     node-name: U+3005 'b';
13974     }
13975     }
13976     element {
13977     attribute {
13978     node-name: 'a';
13979     general-entity-reference {
13980     node-name: U+3005 'b';
13981     }
13982     }
13983     general-entity-reference {
13984     node-name: U+3005 'b';
13985     }
13986     }
13987     }
13988     @@XMLTest:
13989     @@@QName: xp.name.ger.names.1.0.1.test
13990     @@@DEnt:
13991     @@@@test:value:
13992     <?xml version="1.0"?>
13993     <!DOCTYPE p [
13994     <!ENTITY a:b "n">
13995     ]>
13996     <p a="&a:b;">
13997     &a:b;
13998     </p>
13999     @@@c:erred: <[[xp|nswf-legal-ncname]]>{ (3, 10)..(3, 12); }
14000     @@@c:erred: <[[xp|nswf-legal-ncname]]>{ (5, 8)..(5, 10); }
14001     @@@c:erred: <[[xp|nswf-legal-ncname]]>{ (6, 2)..(6, 4); }
14002     @@XMLTest:
14003     @@@QName: xp.name.ger.names.1.1.1.test
14004     @@@DEnt:
14005     @@@@test:value:
14006     <?xml version="1.1"?>
14007     <!DOCTYPE p [
14008     <!ENTITY a:b "n">
14009     ]>
14010     <p a="&a:b;">
14011     &a:b;
14012     </p>
14013     @@@c:erred: <[[xp|nswf-legal-ncname]]>{ (3, 10)..(3, 12); }
14014     @@@c:erred: <[[xp|nswf-legal-ncname]]>{ (5, 8)..(5, 10); }
14015     @@@c:erred: <[[xp|nswf-legal-ncname]]>{ (6, 2)..(6, 4); }
14016     @@XMLTest:
14017     @@@QName: xp.name.ndata.1.0.2.test
14018     @@@DEnt:
14019     @@@@test:value:
14020     <?xml version="1.0"?>
14021     <!DOCTYPE p [
14022     <!NOTATION $u3001$u3002 SYSTEM "n">
14023     <!ENTITY e SYSTEM "s" NDATA $u3001$u3002>
14024     ]><p/>
14025     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (3, 12)..(3, 13); }
14026     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (4, 29)..(4, 30); }
14027     @@XMLTest:
14028     @@@QName: xp.name.ndata.1.1.2.test
14029     @@@DEnt:
14030     @@@@test:value:
14031     <?xml version="1.1"?>
14032     <!DOCTYPE p [
14033     <!NOTATION $u3001$u3002 SYSTEM "n">
14034     <!ENTITY e SYSTEM "s" NDATA $u3001$u3002>
14035     ]><p/>
14036     @@@test:domTree:
14037     document {
14038     xml-version: '1.1';
14039     document-type {
14040     notation {
14041     node-name: U+3001 U+3002;
14042     }
14043     general-entity {
14044     node-name: 'e';
14045     notation-name: U+3001 U+3002;
14046     }
14047     }
14048     element { }
14049     }
14050     @@XMLTest:
14051     @@@QName: xp.name.ndata.1.0.3.test
14052     @@@DEnt:
14053     @@@@test:value:
14054     <?xml version="1.0"?>
14055     <!DOCTYPE p [
14056     <!NOTATION $u3005b SYSTEM "n">
14057     <!ENTITY e SYSTEM "s" NDATA $u3005b>
14058     ]><p/>
14059     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (3, 12)..(3, 13); }
14060     @@@c:erred: <[[xp|wf-invalid-character-in-node-name]]>{ (4, 29)..(4, 30); }
14061     @@XMLTest:
14062     @@@QName: xp.name.ndata.1.1.3.test
14063     @@@DEnt:
14064     @@@@test:value:
14065     <?xml version="1.1"?>
14066     <!DOCTYPE p [
14067     <!NOTATION $u3005b SYSTEM "n">
14068     <!ENTITY e SYSTEM "s" NDATA $u3005b>
14069     ]><p/>
14070     @@@test:domTree:
14071     document {
14072     xml-version: '1.1';
14073     document-type {
14074     notation {
14075     node-name: U+3005 'b';
14076     }
14077     general-entity {
14078     node-name: 'e';
14079     notation-name: U+3005 'b';
14080     }
14081     }
14082     element { }
14083     }
14084     @@XMLTest:
14085     @@@QName: xp.name.ndata.names.1.0.1.test
14086     @@@DEnt:
14087     @@@@test:value:
14088     <?xml version="1.0"?>
14089     <!DOCTYPE p [
14090     <!NOTATION a:b SYSTEM "n">
14091     <!ENTITY e SYSTEM "s" NDATA a:b>
14092     ]><p/>
14093     @@@c:erred: <[[xp|nswf-legal-ncname]]>{ (3, 12)..(3, 14); }
14094     @@@c:erred: <[[xp|nswf-legal-ncname]]>{ (4, 29)..(4, 31); }
14095     @@XMLTest:
14096     @@@QName: xp.name.ndata.names.1.1.1.test
14097     @@@DEnt:
14098     @@@@test:value:
14099     <?xml version="1.1"?>
14100     <!DOCTYPE p [
14101     <!NOTATION a:b SYSTEM "n">
14102     <!ENTITY e SYSTEM "s" NDATA a:b>
14103     ]><p/>
14104     @@@c:erred: <[[xp|nswf-legal-ncname]]>{ (3, 12)..(3, 14); }
14105     @@@c:erred: <[[xp|nswf-legal-ncname]]>{ (4, 29)..(4, 31); }
14106    
14107     @@enImplNote:
14108     @@@ddid: wf-invalid-character-in-node-name
14109     @@@@:
14110     {ISSUE::
14111     {P:: Tests required for:
14112    
14113     - <CODE::Name> in element type declaration
14114    
14115     - <CODE::Name> in model group
14116    
14117     - <CODE::Name> in parameter entity declaration
14118    
14119     - <CODE::Name> in parameter entity reference
14120    
14121     }
14122     }
14123    
14124     @@XMLTest:
14125     @@@QName: xp.NOTATION.1.test
14126     @@@DEnt:
14127     @@@@test:value:
14128     <!DOCTYPE p [
14129     <!NOTATION n SYSTEM "m">
14130     ]><p/>
14131     @@@test:domTree:
14132     document {
14133     document-type {
14134     notation {
14135     node-name: 'n';
14136     public-id: null;
14137     system-id: 'm';
14138     }
14139     }
14140     element { }
14141     }
14142     @@XMLTest:
14143     @@@QName: xp.NOTATION.2.test
14144     @@@DEnt:
14145     @@@@test:value:
14146     <!DOCTYPE p [
14147     <!NOTATION n PUBLIC "m">
14148     ]><p/>
14149     @@@test:domTree:
14150     document {
14151     document-type {
14152     notation {
14153     node-name: 'n';
14154     system-id: null;
14155     public-id: 'm';
14156     }
14157     }
14158     element { }
14159     }
14160     @@XMLTest:
14161     @@@QName: xp.NOTATION.3.test
14162     @@@DEnt:
14163     @@@@test:value:
14164     <!DOCTYPE p [
14165     <!NOTATION n PUBLIC "m" "l">
14166     ]><p/>
14167     @@@test:domTree:
14168     document {
14169     document-type {
14170     notation {
14171     node-name: 'n';
14172     public-id: 'm';
14173     system-id: 'l';
14174     }
14175     }
14176     element { }
14177     }
14178     @@XMLTest:
14179     @@@QName: xp.NOTATION.4.test
14180     @@@DEnt:
14181     @@@@test:value:
14182     <!DOCTYPE p [
14183     <!NOTATION n SYSTEM "m">
14184     <!NOTATION n SYSTEM "l">
14185     ]><p/>
14186     @@@c:erred: <[[xp|vc-unique-notation-name]]> { (3, 1)..(3, 24); }
14187     @@@test:domTree:
14188     document {
14189     document-type {
14190     notation {
14191     node-name: 'n';
14192     system-id: 'm';
14193     }
14194     }
14195     element { }
14196     }
14197    
14198     @@XMLTest:
14199     @@@QName: xp.names.1.test
14200     @@@DEnt:
14201     @@@@test:value:
14202     <p xmlns="http://1.example/" a="b"/>
14203     @@@test:domTree:
14204     document {
14205     element {
14206     prefix: null;
14207     local-name: 'p';
14208     namespace-uri: 'http://1.example/';
14209     attribute {
14210     prefix: null;
14211     local-name: 'xmlns';
14212     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14213     specified: true;
14214     }
14215     attribute {
14216     prefix: null;
14217     local-name: 'a';
14218     specified: true;
14219     }
14220     }
14221     }
14222     @@XMLTest:
14223     @@@QName: xp.names.2.test
14224     @@@DEnt:
14225     @@@@test:value:
14226     <p xmlns:a="http://1.example/" a="b" a:a="c"/>
14227     @@@test:domTree:
14228     document {
14229     element {
14230     prefix: null;
14231     local-name: 'p';
14232     namespace-uri: null;
14233     attribute {
14234     prefix: 'xmlns';
14235     local-name: 'a';
14236     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14237     specified: true;
14238     }
14239     attribute {
14240     prefix: null;
14241     local-name: 'a';
14242     specified: true;
14243     }
14244     attribute {
14245     prefix: 'a';
14246     local-name: 'a';
14247     namespace-uri: 'http://1.example/';
14248     specified: true;
14249     }
14250     }
14251     }
14252     @@XMLTest:
14253     @@@QName: xp.names.3.test
14254     @@@DEnt:
14255     @@@@test:value:
14256     <a:p xmlns:a="http://1.example/" a="b" a:a="c"/>
14257     @@@test:domTree:
14258     document {
14259     element {
14260     prefix: 'a';
14261     local-name: 'p';
14262     namespace-uri: 'http://1.example/';
14263     attribute {
14264     prefix: 'xmlns';
14265     local-name: 'a';
14266     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14267     specified: true;
14268     }
14269     attribute {
14270     prefix: null;
14271     local-name: 'a';
14272     specified: true;
14273     }
14274     attribute {
14275     prefix: 'a';
14276     local-name: 'a';
14277     namespace-uri: 'http://1.example/';
14278     specified: true;
14279     }
14280     }
14281     }
14282     @@XMLTest:
14283     @@@QName: xp.names.5.test
14284     @@@DEnt:
14285     @@@@test:value:
14286     <p xmlns:a="http://1.example/">$
14287     <a:q/>$
14288     </p>
14289     @@@test:domTree:
14290     document {
14291     element {
14292     prefix: null;
14293     local-name: 'p';
14294     namespace-uri: null;
14295     attribute {
14296     prefix: 'xmlns';
14297     local-name: 'a';
14298     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14299     specified: true;
14300     }
14301     element {
14302     prefix: 'a';
14303     local-name: 'q';
14304     namespace-uri: 'http://1.example/';
14305     }
14306     }
14307     }
14308     @@XMLTest:
14309     @@@QName: xp.names.6.test
14310     @@@DEnt:
14311     @@@@test:value:
14312     <p xmlns:a="http://1.example/">$
14313     <q a:b="c"/>$
14314     </p>
14315     @@@test:domTree:
14316     document {
14317     element {
14318     prefix: null;
14319     local-name: 'p';
14320     namespace-uri: null;
14321     attribute {
14322     prefix: 'xmlns';
14323     local-name: 'a';
14324     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14325     specified: true;
14326     }
14327     element {
14328     prefix: null;
14329     local-name: 'q';
14330     namespace-uri: null;
14331     attribute {
14332     prefix: 'a';
14333     local-name: 'b';
14334     namespace-uri: 'http://1.example/';
14335     specified: true;
14336     }
14337     }
14338     }
14339     }
14340     @@XMLTest:
14341     @@@QName: xp.names.7.test
14342     @@@DEnt:
14343     @@@@test:value:
14344     <p xmlns:a="http://1.example/">$
14345     <q a:b="c" xmlns:a="http://2.example/"/>$
14346     </p>
14347     @@@test:domTree:
14348     document {
14349     element {
14350     prefix: null;
14351     local-name: 'p';
14352     namespace-uri: null;
14353     attribute {
14354     prefix: 'xmlns';
14355     local-name: 'a';
14356     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14357     specified: true;
14358     }
14359     element {
14360     prefix: null;
14361     local-name: 'q';
14362     namespace-uri: null;
14363     attribute {
14364     prefix: 'a';
14365     local-name: 'b';
14366     namespace-uri: 'http://2.example/';
14367     specified: true;
14368     }
14369     attribute {
14370     prefix: 'xmlns';
14371     local-name: 'a';
14372     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14373     specified: true;
14374     }
14375     }
14376     }
14377     }
14378    
14379     @@XMLTest:
14380     @@@QName: xp.names.undeclare.1.test
14381     @@@DEnt:
14382     @@@@test:value:
14383     <p xmlns="http://1.example/">$
14384     <q xmlns="">$
14385     <r xmlns="http://2.example/"/>$
14386     </q>$
14387     </p>
14388     @@@test:domTree:
14389     document {
14390     element {
14391     prefix: null;
14392     local-name: 'p';
14393     namespace-uri: 'http://1.example/';
14394     attribute {
14395     prefix: null;
14396     local-name: 'xmlns';
14397     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14398     specified: true;
14399     }
14400     element {
14401     prefix: null;
14402     local-name: 'q';
14403     namespace-uri: null;
14404     attribute {
14405     prefix: null;
14406     local-name: 'xmlns';
14407     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14408     specified: true;
14409     }
14410     element {
14411     prefix: null;
14412     local-name: 'r';
14413     namespace-uri: 'http://2.example/';
14414     attribute {
14415     prefix: null;
14416     local-name: 'xmlns';
14417     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14418     specified: true;
14419     }
14420     }
14421     }
14422     }
14423     }
14424    
14425     @@XMLTest:
14426     @@@QName: xp.names.undeclare.1.0.1.test
14427     @@@DEnt:
14428     @@@@test:value:
14429     <?xml version="1.0"?>
14430     <a:p xmlns:a="http://1.example/">$
14431     <q xmlns:a="">$
14432     <a:r xmlns:a="http://2.example/"/>$
14433     </q>$
14434     </a:p>
14435     @@@c:erred: <[[xp|nswf-empty-namespace-name]]> { (2, 34)..(2, 47); }
14436     @@XMLTest:
14437     @@@QName: xp.names.undeclare.1.1.1.test
14438     @@@DEnt:
14439     @@@@test:value:
14440     <?xml version="1.1"?>
14441     <a:p xmlns:a="http://1.example/">$
14442     <q xmlns:a="">$
14443     <a:r xmlns:a="http://2.example/"/>$
14444     </q>$
14445     </a:p>
14446     @@@test:domTree:
14447     document {
14448     element {
14449     prefix: 'a';
14450     local-name: 'p';
14451     namespace-uri: 'http://1.example/';
14452     attribute {
14453     prefix: 'xmlns';
14454     local-name: 'a';
14455     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14456     specified: true;
14457     }
14458     element {
14459     prefix: null;
14460     local-name: 'q';
14461     namespace-uri: null;
14462     attribute {
14463     prefix: 'xmlns';
14464     local-name: 'a';
14465     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14466     specified: true;
14467     }
14468     element {
14469     prefix: 'a';
14470     local-name: 'r';
14471     namespace-uri: 'http://2.example/';
14472     attribute {
14473     prefix: 'xmlns';
14474     local-name: 'a';
14475     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14476     specified: true;
14477     }
14478     }
14479     }
14480     }
14481     }
14482     @@XMLTest:
14483     @@@QName: xp.names.undeclare.1.1.2.test
14484     @@@DEnt:
14485     @@@@test:value:
14486     <?xml version="1.1"?>
14487     <a:p xmlns:a="http://1.example/">$
14488     <q xmlns:a="">$
14489     <a:r/>$
14490     </q>$
14491     </a:p>
14492     @@@c:erred: <[[xp|nsc-prefix-declared]]> { (2, 48)..(2, 53); }
14493    
14494     @@XMLTest:
14495     @@@QName: xp.names.xml.prefix.1.test
14496     @@@DEnt:
14497     @@@@test:value:
14498     <a xmlns:xml="http://www.w3.org/XML/1998/namespace"/>
14499     @@@test:domTree:
14500     document {
14501     element {
14502     attribute {
14503     prefix: 'xmlns';
14504     local-name: 'xml';
14505     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14506     }
14507     }
14508     }
14509     @@XMLTest:
14510     @@@QName: xp.names.xml.prefix.2.test
14511     @@@DEnt:
14512     @@@@test:value:
14513     <a xmlns:xml="a"/>
14514     @@@c:erred: <[[xp|nsc-reserved-prefix-xml]]> { (1, 1)..(1, 18); }
14515     @@XMLTest:
14516     @@@QName: xp.names.xml.prefix.3.test
14517     @@@DEnt:
14518     @@@@test:value:
14519     <a xmlns:a="http://www.w3.org/XML/1998/namespace"
14520     />
14521     @@@c:erred: <[[xp|nsc-reserved-namespace-name-xml]]> { (1, 1)..(2, 2); }
14522     @@XMLTest:
14523     @@@QName: xp.names.xml.prefix.4.test
14524     @@@DEnt:
14525     @@@@test:value:
14526     <a xml:lang="ja"/>
14527     @@@test:domTree:
14528     document {
14529     element {
14530     attribute {
14531     prefix: 'xml';
14532     local-name: 'lang';
14533     namespace-uri: 'http://www.w3.org/XML/1998/namespace';
14534     }
14535     }
14536     }
14537    
14538     @@XMLTest:
14539     @@@QName: xp.names.prefix.declared.1.test
14540     @@@DEnt:
14541     @@@@test:value:
14542     <!DOCTYPE a [
14543     <!ATTLIST a
14544     b:c CDATA "d"
14545     >
14546     ]>
14547     <a/>
14548     @@@c:erred: <[[xp|nsc-prefix-declared]]> { (6, 1)..(6, 4); }
14549    
14550     @@XMLTest:
14551     @@@QName: xp.names.xmlns.reserved.1.test
14552     @@@DEnt:
14553     @@@@test:value:
14554     <a xmlns:xmlns="http://www.w3.org/2000/xmlns/"
14555     />
14556     @@@c:erred: <[[xp|nsc-reserved-prefix-xmlns]]> { (1, 1)..(2, 2); }
14557     @@@c:erred: <[[xp|nsc-reserved-namespace-name-xmlns]]> { (1, 1)..(2, 2); }
14558     @@XMLTest:
14559     @@@QName: xp.names.xmlns.reserved.2.test
14560     @@@DEnt:
14561     @@@@test:value:
14562     <a xmlns:xmlns="a"
14563     />
14564     @@@c:erred: <[[xp|nsc-reserved-prefix-xmlns]]> { (1, 1)..(2, 2); }
14565     @@XMLTest:
14566     @@@QName: xp.names.xmlns.reserved.3.test
14567     @@@DEnt:
14568     @@@@test:value:
14569     <a xmlns:a="http://www.w3.org/2000/xmlns/"
14570     />
14571     @@@c:erred: <[[xp|nsc-reserved-namespace-name-xmlns]]> { (1, 1)..(2, 2); }
14572    
14573     @@XMLTest:
14574     @@@QName: xp.names.default.1.test
14575     @@@DEnt:
14576     @@@@test:value:
14577     <!DOCTYPE a [
14578     <!ATTLIST a
14579     xmlns CDATA "http://1.example/">
14580     ]>
14581     <a/>
14582     @@@test:domTree:
14583     document {
14584     document-type {
14585     element-type-definition {
14586     node-name: 'a';
14587     attribute-definition {
14588     node-name: 'xmlns';
14589     node-value: 'http://1.example/';
14590     }
14591     }
14592     }
14593     element {
14594     prefix: null;
14595     local-name: 'a';
14596     namespace-uri: 'http://1.example/';
14597     attribute {
14598     prefix: null;
14599     local-name: 'xmlns';
14600     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14601     value: 'http://1.example/';
14602     specified: false;
14603     }
14604     }
14605     }
14606     @@XMLTest:
14607     @@@QName: xp.names.default.2.test
14608     @@@DEnt:
14609     @@@@test:value:
14610     <!DOCTYPE a [
14611     <!ATTLIST a
14612     xmlns CDATA "http://1.example/">
14613     ]>
14614     <a xmlns="http://2.example/"/>
14615     @@@test:domTree:
14616     document {
14617     document-type {
14618     element-type-definition {
14619     node-name: 'a';
14620     attribute-definition {
14621     node-name: 'xmlns';
14622     node-value: 'http://1.example/';
14623     }
14624     }
14625     }
14626     element {
14627     prefix: null;
14628     local-name: 'a';
14629     namespace-uri: 'http://2.example/';
14630     attribute {
14631     prefix: null;
14632     local-name: 'xmlns';
14633     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14634     value: 'http://2.example/';
14635     specified: true;
14636     }
14637     }
14638     }
14639     @@XMLTest:
14640     @@@QName: xp.names.default.3.test
14641     @@@DEnt:
14642     @@@@test:value:
14643     <!DOCTYPE b:a [
14644     <!ATTLIST b:a
14645     xmlns:b CDATA "http://1.example/">
14646     ]>
14647     <b:a/>
14648     @@@test:domTree:
14649     document {
14650     document-type {
14651     element-type-definition {
14652     node-name: 'b:a';
14653     attribute-definition {
14654     node-name: 'xmlns:b';
14655     node-value: 'http://1.example/';
14656     }
14657     }
14658     }
14659     element {
14660     prefix: 'b';
14661     local-name: 'a';
14662     namespace-uri: 'http://1.example/';
14663     attribute {
14664     prefix: 'xmlns';
14665     local-name: 'b';
14666     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14667     value: 'http://1.example/';
14668     specified: false;
14669     }
14670     }
14671     }
14672     @@XMLTest:
14673     @@@QName: xp.names.default.4.test
14674     @@@DEnt:
14675     @@@@test:value:
14676     <!DOCTYPE b:a [
14677     <!ATTLIST b:a
14678     xmlns:b CDATA "http://1.example/">
14679     ]>
14680     <b:a xmlns:b="http://2.example/"/>
14681     @@@test:domTree:
14682     document {
14683     document-type {
14684     element-type-definition {
14685     node-name: 'b:a';
14686     attribute-definition {
14687     node-name: 'xmlns:b';
14688     node-value: 'http://1.example/';
14689     }
14690     }
14691     }
14692     element {
14693     prefix: 'b';
14694     local-name: 'a';
14695     namespace-uri: 'http://2.example/';
14696     attribute {
14697     prefix: 'xmlns';
14698     local-name: 'b';
14699     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14700     value: 'http://2.example/';
14701     specified: true;
14702     }
14703     }
14704     }
14705     @@XMLTest:
14706     @@@QName: xp.names.default.5.test
14707     @@@DEnt:
14708     @@@@test:value:
14709     <!DOCTYPE a [
14710     <!ATTLIST a
14711     xmlns:b CDATA "http://1.example/"
14712     b:c CDATA "http://1.example/">
14713     ]>
14714     <a xmlns:b="http://2.example/"/>
14715     @@@test:domTree:
14716     document {
14717     document-type {
14718     element-type-definition {
14719     node-name: 'a';
14720     attribute-definition {
14721     node-name: 'xmlns:b';
14722     text-content: 'http://1.example/';
14723     }
14724     attribute-definition {
14725     node-name: 'b:c';
14726     text-content: 'http://1.example/';
14727     }
14728     }
14729     }
14730     element {
14731     prefix: null;
14732     local-name: 'a';
14733     namespace-uri: null;
14734     attribute {
14735     prefix: 'xmlns';
14736     local-name: 'b';
14737     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14738     value: 'http://2.example/';
14739     specified: true;
14740     }
14741     attribute {
14742     prefix: 'b';
14743     local-name: 'c';
14744     namespace-uri: 'http://2.example/';
14745     specified: false;
14746     }
14747     }
14748     }
14749    
14750     @@XMLTest:
14751     @@@QName: xp.names.unique.1.test
14752     @@@DEnt:
14753     @@@@test:value:
14754     <a
14755     xmlns:b="http://2.example/"
14756     xmlns:c="http://2.example/"
14757     b:d=""
14758     c:d=""
14759     />
14760     @@@c:erred: <[[xp|nswf-unique-att-spec-expanded-name]]> { (1, 1)..(6, 2); }
14761     @@XMLTest:
14762     @@@QName: xp.names.unique.2.test
14763     @@@DEnt:
14764     @@@@test:value:
14765     <!DOCTYPE a [
14766     <!ATTLIST a
14767     c:d CDATA ""
14768     >
14769     ]>
14770     <a
14771     xmlns:b="http://2.example/"
14772     xmlns:c="http://2.example/"
14773     b:d=""
14774     />
14775     @@@c:erred: <[[xp|nswf-unique-att-spec-expanded-name]]> { (6, 1)..(10, 2);}
14776     @@XMLTest:
14777     @@@QName: xp.names.unique.3.test
14778     @@@DEnt:
14779     @@@@test:value:
14780     <!DOCTYPE a [
14781     <!ATTLIST a
14782     c:d CDATA "value1"
14783     >
14784     ]>
14785     <a
14786     xmlns:c="http://2.example/"
14787     c:d="value2"
14788     />
14789     @@@test:domTree:
14790     document {
14791     document-type { }
14792     element {
14793     attribute {
14794     prefix: 'xmlns';
14795     local-name: 'c';
14796     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14797     specified: true;
14798     }
14799     attribute {
14800     prefix: 'c';
14801     local-name: 'd';
14802     namespace-uri: 'http://2.example/';
14803     value: 'value2';
14804     specified: true;
14805     }
14806     }
14807     }
14808    
14809     @@XMLTest:
14810     @@@QName: xp.names.normalize.1.test
14811     @@@DEnt:
14812     @@@@test:value:
14813     <!DOCTYPE a [
14814     <!ATTLIST a
14815     xmlns NMTOKEN #IMPLIED
14816     >
14817     ]>
14818     <a xmlns=" "/>
14819     @@@test:domTree:
14820     document {
14821     document-type { }
14822     element {
14823     namespace-uri: null;
14824     prefix: null;
14825     local-name: 'a';
14826     }
14827     }
14828     @@XMLTest:
14829     @@@QName: xp.names.normalize.2.test
14830     @@@DEnt:
14831     @@@@test:value:
14832     <!DOCTYPE a [
14833     <!ATTLIST a
14834     xmlns NMTOKEN #IMPLIED
14835     >
14836     ]>
14837     <a xmlns=" about:blank "/>
14838     @@@test:domTree:
14839     document {
14840     document-type { }
14841     element {
14842     namespace-uri: 'about:blank';
14843     prefix: null;
14844     local-name: 'a';
14845     }
14846     }
14847     @@XMLTest:
14848     @@@QName: xp.names.normalize.3.test
14849     @@@DEnt:
14850     @@@@test:value:
14851     <!DOCTYPE a:a [
14852     <!ATTLIST a:a
14853     xmlns:a NMTOKEN #IMPLIED
14854     >
14855     ]>
14856     <a:a xmlns:a=" about:blank "/>
14857     @@@test:domTree:
14858     document {
14859     document-type { }
14860     element {
14861     namespace-uri: 'about:blank';
14862     prefix: 'a';
14863     local-name: 'a';
14864     }
14865     }
14866    
14867 wakaba 1.29 @@XMLTest:
14868     @@@QName: xp.no.baseuri.test
14869     @@@DEnt:
14870     @@@@test:value:
14871     <p/>
14872     @@@test:domTree:
14873     document {
14874     document-uri: null;
14875     base-uri: null;
14876     element {
14877     node-name: 'p';
14878     base-uri: null;
14879     }
14880     }
14881     @@XMLTest:
14882     @@@QName: xp.docuri.no.baseuri.test
14883     @@@DEnt:
14884     @@@@test:uri:
14885     http://www.example.com/
14886     @@@@test:value:
14887     <p/>
14888     @@@test:domTree:
14889     document {
14890     document-uri: 'http://www.example.com/';
14891     base-uri: 'http://www.example.com/';
14892     element {
14893     node-name: 'p';
14894     base-uri: 'http://www.example.com/';
14895     }
14896     }
14897     @@XMLTest:
14898     @@@QName: xp.docuri.baseuri.test
14899     @@@DEnt:
14900     @@@@test:uri:
14901     http://www.example.com/
14902     @@@@test:baseURI:
14903     ftp://ftp.example.com/
14904     @@@@test:value:
14905     <p/>
14906     @@@test:domTree:
14907     document {
14908     document-uri: 'http://www.example.com/';
14909     base-uri: 'ftp://ftp.example.com/';
14910     element {
14911     node-name: 'p';
14912     base-uri: 'ftp://ftp.example.com/';
14913     }
14914     }
14915     @@XMLTest:
14916     @@@QName: xp.doctype.baseuri.test
14917     @@@DEnt:
14918     @@@@test:uri:
14919     http://www.example.com/
14920     @@@@test:baseURI:
14921     ftp://ftp.example.com/
14922     @@@@test:value:
14923     <!DOCTYPE p SYSTEM "sys">
14924     <p/>
14925     @@@test:domTree:
14926     document {
14927     document-uri: 'http://www.example.com/';
14928     base-uri: 'ftp://ftp.example.com/';
14929     document-type {
14930     system-id: 'sys';
14931     manakai-declaration-base-uri: 'ftp://ftp.example.com/';
14932     }
14933     element {
14934     node-name: 'p';
14935     base-uri: 'ftp://ftp.example.com/';
14936     }
14937     }
14938     @@XMLTest:
14939     @@@QName: xp.entdecl.baseuri.test
14940     @@@DEnt:
14941     @@@@test:uri:
14942     http://www.example.com/
14943     @@@@test:baseURI:
14944     ftp://ftp.example.com/
14945     @@@@test:value:
14946     <!DOCTYPE p [
14947     <!ENTITY ent SYSTEM "ent">
14948     ]>
14949     <p/>
14950     @@@test:domTree:
14951     document {
14952     document-uri: 'http://www.example.com/';
14953     base-uri: 'ftp://ftp.example.com/';
14954     document-type {
14955     general-entity {
14956     node-name: 'ent';
14957     manakai-declaration-base-uri: 'ftp://ftp.example.com/';
14958     }
14959     }
14960     element {
14961     node-name: 'p';
14962     base-uri: 'ftp://ftp.example.com/';
14963     }
14964     }
14965     @@XMLTest:
14966     @@@QName: xp.notdecl.baseuri.test
14967     @@@DEnt:
14968     @@@@test:uri:
14969     http://www.example.com/
14970     @@@@test:baseURI:
14971     ftp://ftp.example.com/
14972     @@@@test:value:
14973     <!DOCTYPE p [
14974     <!NOTATION not SYSTEM "not">
14975     ]>
14976     <p/>
14977     @@@test:domTree:
14978     document {
14979     document-uri: 'http://www.example.com/';
14980     base-uri: 'ftp://ftp.example.com/';
14981     document-type {
14982     notation {
14983     node-name: 'not';
14984     manakai-declaration-base-uri: 'ftp://ftp.example.com/';
14985     }
14986     }
14987     element {
14988     node-name: 'p';
14989     base-uri: 'ftp://ftp.example.com/';
14990     }
14991     }
14992     @@XMLTest:
14993     @@@QName: xp.doctype.intsubset.pi.baseuri.test
14994     @@@DEnt:
14995     @@@@test:uri:
14996     http://www.example.com/
14997     @@@@test:baseURI:
14998     ftp://ftp.example.com/
14999     @@@@test:value:
15000     <!DOCTYPE p [
15001     <?pi?>
15002     ]>
15003     <p/>
15004     @@@test:domTree:
15005     document {
15006     document-uri: 'http://www.example.com/';
15007     base-uri: 'ftp://ftp.example.com/';
15008     document-type {
15009     pi {
15010     node-name: 'pi';
15011     base-uri: 'ftp://ftp.example.com/';
15012     }
15013     }
15014     element {
15015     node-name: 'p';
15016     base-uri: 'ftp://ftp.example.com/';
15017     }
15018     }
15019    
15020 wakaba 1.30 @@XMLTest:
15021     @@@QName: xp.xmlid.attr.test
15022     @@@DEnt:
15023     @@@@test:value:
15024     <p xml:id="idv"/>
15025 wakaba 1.34 @@@cfg:xml-id: 1
15026 wakaba 1.30 @@@test:domTree:
15027     document {
15028     element {
15029     attribute {
15030     node-name: 'xml:id';
15031     value: 'idv';
15032     schema-type-info: TypeInfo ('http://www.w3.org/TR/REC-xml',
15033     'ID');
15034     specified: true;
15035     }
15036     }
15037     }
15038     @@XMLTest:
15039 wakaba 1.34 @@@QName: xp.xmlid.attr.disabled.test
15040     @@@DEnt:
15041     @@@@test:value:
15042     <p xml:id="idv"/>
15043     @@@cfg:xml-id: 0
15044     @@@test:domTree:
15045     document {
15046     element {
15047     attribute {
15048     node-name: 'xml:id';
15049     value: 'idv';
15050     schema-type-info: TypeInfo (null, null);
15051     specified: true;
15052     }
15053     }
15054     }
15055     @@XMLTest:
15056 wakaba 1.30 @@@QName: xp.xmlid.attr.norm.test
15057     @@@DEnt:
15058     @@@@test:value:
15059     <p xml:id=" $u000Aidv "/>
15060 wakaba 1.34 @@@cfg:xml-id: 1
15061 wakaba 1.30 @@@test:domTree:
15062     document {
15063     element {
15064     attribute {
15065     node-name: 'xml:id';
15066     value: 'idv';
15067     schema-type-info: TypeInfo ('http://www.w3.org/TR/REC-xml',
15068     'ID');
15069     specified: true;
15070     }
15071     }
15072     }
15073     @@XMLTest:
15074 wakaba 1.34 @@@QName: xp.xmlid.attr.norm.disabled.test
15075     @@@DEnt:
15076     @@@@test:value:
15077     <p xml:id=" $u000Aidv "/>
15078     @@@cfg:xml-id: 0
15079     @@@test:domTree:
15080     document {
15081     element {
15082     attribute {
15083     node-name: 'xml:id';
15084     value: ' idv ';
15085     schema-type-info: TypeInfo (null, null);
15086     specified: true;
15087     }
15088     }
15089     }
15090     @@XMLTest:
15091 wakaba 1.30 @@@QName: xp.xmlid.attrdef.test
15092     @@@DEnt:
15093     @@@@test:value:
15094     <!DOCTYPE p [
15095     <!ATTLIST p xml:id ID #IMPLIED>
15096     ]>
15097     <p/>
15098 wakaba 1.34 @@@cfg:xml-id: 1
15099     @@@test:domTree:
15100     document {
15101     document-type {
15102     element-type-definition {
15103     node-name: 'p';
15104     attribute-definition {
15105     node-name: 'xml:id';
15106     declared-type: const (ID_ATTR);
15107     default-type: const (IMPLIED_DEFAULT);
15108     }
15109     }
15110     }
15111     element { }
15112     }
15113     @@XMLTest:
15114     @@@QName: xp.xmlid.attrdef.disabled.test
15115     @@@DEnt:
15116     @@@@test:value:
15117     <!DOCTYPE p [
15118     <!ATTLIST p xml:id ID #IMPLIED>
15119     ]>
15120     <p/>
15121     @@@cfg:xml-id: 0
15122 wakaba 1.30 @@@test:domTree:
15123     document {
15124     document-type {
15125     element-type-definition {
15126     node-name: 'p';
15127     attribute-definition {
15128     node-name: 'xml:id';
15129     declared-type: const (ID_ATTR);
15130     default-type: const (IMPLIED_DEFAULT);
15131     }
15132     }
15133     }
15134     element { }
15135     }
15136     @@XMLTest:
15137     @@@QName: xp.xmlid.attrdef.defaultattr.test
15138     @@@DEnt:
15139     @@@@test:value:
15140     <!DOCTYPE p [
15141     <!ATTLIST p xml:id ID "idv"><!-- invalid -->
15142     ]>
15143     <p/>
15144 wakaba 1.34 @@@cfg:xml-id: 1
15145     @@@test:domTree:
15146     document {
15147     document-type {
15148     element-type-definition {
15149     node-name: 'p';
15150     attribute-definition {
15151     node-name: 'xml:id';
15152     declared-type: const (ID_ATTR);
15153     default-type: const (EXPLICIT_DEFAULT);
15154     node-value: 'idv';
15155     }
15156     }
15157     }
15158     element {
15159     attribute {
15160     node-name: 'xml:id';
15161     schema-type-info: TypeInfo ('http://www.w3.org/TR/REC-xml',
15162     'ID');
15163     value: 'idv';
15164     specified: false;
15165     }
15166     }
15167     }
15168     @@XMLTest:
15169     @@@QName: xp.xmlid.attrdef.defaultattr.disabled.test
15170     @@@DEnt:
15171     @@@@test:value:
15172     <!DOCTYPE p [
15173     <!ATTLIST p xml:id ID "idv"><!-- invalid -->
15174     ]>
15175     <p/>
15176     @@@cfg:xml-id: 0
15177 wakaba 1.30 @@@test:domTree:
15178     document {
15179     document-type {
15180     element-type-definition {
15181     node-name: 'p';
15182     attribute-definition {
15183     node-name: 'xml:id';
15184     declared-type: const (ID_ATTR);
15185     default-type: const (EXPLICIT_DEFAULT);
15186     node-value: 'idv';
15187     }
15188     }
15189     }
15190     element {
15191     attribute {
15192     node-name: 'xml:id';
15193     schema-type-info: TypeInfo ('http://www.w3.org/TR/REC-xml',
15194     'ID');
15195     value: 'idv';
15196     specified: false;
15197     }
15198     }
15199     }
15200    
15201 wakaba 1.34 @@XMLTest:
15202     @@@QName: xp.general.entity.unused.1.test
15203     @@@DEnt:
15204     @@@@test:value:
15205     <!DOCTYPE p [
15206     <!ENTITY mylt "<">
15207     ]>
15208     <p/>
15209     @@@cfg:entity-replacement-tree: 0
15210     @@@test:domTree:
15211     document {
15212     document-type {
15213     general-entity {
15214     node-name: 'mylt';
15215     }
15216     }
15217     element { }
15218     }
15219     @@XMLTest:
15220     @@@QName: xp.general.entity.unused.2.test
15221     @@@DEnt:
15222     @@@@test:value:
15223     <!DOCTYPE p [
15224     <!ENTITY mylt "<">
15225     ]>
15226     <p/>
15227     @@@cfg:entity-replacement-tree: 1
15228     @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 1)..(1, 2); }
15229    
15230 wakaba 1.35 @@XMLTest:
15231     @@@QName: xp.dtdecl.readonly.test
15232     @@@DEnt:
15233     @@@@test:value:
15234     <!DOCTYPE p>
15235     <p/>
15236     @@@test:domTree:
15237     document {
15238     document-type {
15239     manakai-read-only: true;
15240     }
15241     element {
15242     manakai-read-only: false;
15243     }
15244     manakai-read-only: false;
15245     }
15246     @@XMLTest:
15247     @@@QName: xp.entity.decl.readonly.1.test
15248     @@@DEnt:
15249     @@@@test:value:
15250     <!DOCTYPE p [
15251     <!ENTITY ent "val">
15252     ]>
15253     <p/>
15254     @@@cfg:entity-replacement-tree: 1
15255     @@@test:domTree:
15256     document {
15257     document-type {
15258     general-entity {
15259     node-name: 'ent';
15260     manakai-read-only: true;
15261     has-replacement-tree: true;
15262     }
15263     manakai-read-only: true;
15264     }
15265     element {
15266     manakai-read-only: false;
15267     }
15268     manakai-read-only: false;
15269     }
15270     @@XMLTest:
15271     @@@QName: xp.entity.decl.readonly.2.test
15272     @@@DEnt:
15273     @@@@test:value:
15274     <!DOCTYPE p [
15275     <!ENTITY ent "val">
15276     ]>
15277     <p/>
15278     @@@test:domTree:
15279     document {
15280     document-type {
15281     general-entity {
15282     node-name: 'ent';
15283     manakai-read-only: true;
15284     }
15285     manakai-read-only: true;
15286     }
15287     element {
15288     manakai-read-only: false;
15289     }
15290     manakai-read-only: false;
15291     }
15292     @@XMLTest:
15293     @@@QName: xp.notation.decl.readonly.test
15294     @@@DEnt:
15295     @@@@test:value:
15296     <!DOCTYPE p [
15297     <!NOTATION ent SYSTEM "val">
15298     ]>
15299     <p/>
15300     @@@test:domTree:
15301     document {
15302     document-type {
15303     notation {
15304     node-name: 'ent';
15305     manakai-read-only: true;
15306     }
15307     manakai-read-only: true;
15308     }
15309     element {
15310     manakai-read-only: false;
15311     }
15312     manakai-read-only: false;
15313     }
15314     @@XMLTest:
15315     @@@QName: xp.dtd.pi.readonly.test
15316     @@@DEnt:
15317     @@@@test:value:
15318     <!DOCTYPE p [
15319     <?pi content?>
15320     ]>
15321     <p/>
15322     @@@test:domTree:
15323     document {
15324     document-type {
15325     pi {
15326     node-name: 'pi';
15327     manakai-read-only: true;
15328     }
15329     manakai-read-only: true;
15330     }
15331     element {
15332     manakai-read-only: false;
15333     }
15334     manakai-read-only: false;
15335     }
15336     @@XMLTest:
15337     @@@QName: xp.dtd.attlist.decl.readonly.test
15338     @@@DEnt:
15339     @@@@test:value:
15340     <!DOCTYPE p [
15341     <!ATTLIST p
15342     attr CDATA #IMPLIED
15343     >
15344     ]>
15345     <p/>
15346     @@@test:domTree:
15347     document {
15348     document-type {
15349     element-type-definition {
15350     node-name: 'p';
15351     attribute-definition {
15352     node-name: 'attr';
15353     manakai-read-only: true;
15354     }
15355     manakai-read-only: true;
15356     }
15357     manakai-read-only: true;
15358     }
15359     element {
15360     manakai-read-only: false;
15361     }
15362     manakai-read-only: false;
15363     }
15364     @@XMLTest:
15365     @@@QName: xp.general.entity.reference.readonly.1.test
15366     @@@DEnt:
15367     @@@@test:value:
15368     <!DOCTYPE p [
15369     <!ENTITY ent "val">
15370     ]>
15371     <p>&ent;</p>
15372     @@@test:domTree:
15373     document {
15374     document-type {
15375     general-entity {
15376     node-name: 'ent';
15377     manakai-read-only: true;
15378     }
15379     manakai-read-only: true;
15380     }
15381     element {
15382     general-entity-reference {
15383     text {
15384     manakai-read-only: true;
15385     }
15386     manakai-read-only: true;
15387     }
15388     manakai-read-only: false;
15389     }
15390     manakai-read-only: false;
15391     }
15392     @@XMLTest:
15393     @@@QName: xp.general.entity.reference.readonly.2.test
15394     @@@DEnt:
15395     @@@@test:value:
15396     <!DOCTYPE p [
15397     <!ENTITY ent "val">
15398     ]>
15399     <p attr="&ent;"/>
15400     @@@test:domTree:
15401     document {
15402     document-type {
15403     general-entity {
15404     node-name: 'ent';
15405     manakai-read-only: true;
15406     }
15407     manakai-read-only: true;
15408     }
15409     element {
15410     attribute {
15411     node-name: 'attr';
15412     general-entity-reference {
15413     text {
15414     manakai-read-only: true;
15415     }
15416     manakai-read-only: true;
15417     }
15418     manakai-read-only: false;
15419     }
15420     manakai-read-only: false;
15421     }
15422     manakai-read-only: false;
15423     }
15424     @@XMLTest:
15425     @@@QName: xp.general.entity.reference.readonly.3.test
15426     @@@DEnt:
15427     @@@@test:value:
15428     <!DOCTYPE p [
15429     <!ENTITY ent1 "val">
15430     <!ENTITY ent2 "&ent1;">
15431     ]>
15432     <p>&ent2;</p>
15433     @@@test:domTree:
15434     document {
15435     document-type {
15436     general-entity {
15437     node-name: 'ent1';
15438     manakai-read-only: true;
15439     }
15440     general-entity {
15441     node-name: 'ent2';
15442     manakai-read-only: true;
15443     }
15444     manakai-read-only: true;
15445     }
15446     element {
15447     general-entity-reference {
15448     general-entity-reference {
15449     text {
15450     manakai-read-only: true;
15451     }
15452     manakai-read-only: true;
15453     }
15454     manakai-read-only: true;
15455     }
15456     manakai-read-only: false;
15457     }
15458     manakai-read-only: false;
15459     }
15460    
15461 wakaba 1.26 @@PerlDef:
15462     my $impl = $Message::DOM::ImplementationRegistry->get_implementation ({
15463     'Core' => '3.0',
15464     'XML' => '3.0',
15465     'XMLVersion' => ['1.0', '1.1'],
15466     });
15467    
15468     for my $test_data (@$TestData) {
15469 wakaba 1.34 my $parser = <Class::ManakaiXMLParser>->new ($impl);
15470    
15471 wakaba 1.26 $test->start_new_test ($test_data->{uri});
15472     my $doc_ent = $test_data->{entity}->{$test_data->{root_uri}};
15473     my $not_ok;
15474    
15475 wakaba 1.34 ## -- DOM Configuration Parameters
15476    
15477     my $pcfg = $parser->dom_config;
15478     for (keys %{$test_data->{dom_config}}) {
15479     $pcfg->set_parameter ($_ => $test_data->{dom_config}->{$_});
15480     }
15481    
15482     $pcfg->set_parameter ('error-handler' => sub ($$) {
15483 wakaba 1.26 my (undef, $err) = @_;
15484     my $err_type = $err->type;
15485     if ($test_data->{dom_error}->{$err_type}) {
15486     $test->assert_error_equals
15487     (actual_value => $err,
15488     expected_hash => shift @{$test_data->{dom_error}
15489     ->{$err_type}});
15490     } else { # Uncatched error
15491     warn $err;
15492     unless ($err->severity == <C::c|DOMError.SEVERITY_WARNING>) {
15493     $test->failure_comment ('Unexpected error |'.$err->type.'|');
15494     $not_ok = true;
15495     }
15496     }
15497     return true; # continue as far as possible
15498     });
15499    
15500 wakaba 1.34 ## -- Input Data
15501    
15502 wakaba 1.27 my $input = {string_data => \$doc_ent->{<Q::test:value>},
15503     system_id => $doc_ent->{<Q::test:uri>},
15504     base_uri => $doc_ent->{<Q::test:baseURI>}};
15505 wakaba 1.34
15506     ## -- Test and Result
15507    
15508 wakaba 1.26 if ($test_data->{dom_tree}) { # Successful test
15509 wakaba 1.31 my $doc;
15510 wakaba 1.26 try {
15511 wakaba 1.31 $doc = $parser->parse ($input);
15512 wakaba 1.26 $test->assert_dom_tree_equals
15513     (actual_value => $doc,
15514     expected_hash => $test_data->{dom_tree});
15515     for (values %{$test_data->{dom_error}||{}}) {
15516     if (@$_) {
15517     $test->failure_comment
15518     (@$_.' |DOMError|s of type |'.
15519     $_->[0]->{type}->{value}.'| are not reported');
15520     $not_ok = true;
15521     }
15522     }
15523     $not_ok ? $test->not_ok : $test->ok;
15524 wakaba 1.31 undef $doc;
15525 wakaba 1.26 } catch Message::Util::IF::DTException with {
15526 wakaba 1.31 require 'manakai/mndebug.pl';
15527     manakai::mndebug::dump ($doc);
15528 wakaba 1.26 } catch Message::DOM::IF::LSException with {
15529     # not_ok
15530     } otherwise {
15531     my $err = shift;
15532     warn $err;
15533     $test->not_ok;
15534     };
15535     } else {
15536 wakaba 1.31 my $doc;
15537 wakaba 1.26 try {
15538 wakaba 1.31 $doc = $parser->parse ($input);
15539 wakaba 1.26 } catch Message::Util::IF::DTException with {
15540 wakaba 1.31 require 'manakai/mndebug.pl';
15541     manakai::mndebug::dump ($doc);
15542 wakaba 1.26 } catch Message::DOM::IF::LSException with {
15543     #
15544     } otherwise {
15545     my $err = shift;
15546     warn $err;
15547     $test->not_ok;
15548     };
15549     for (values %{$test_data->{dom_error}||{}}) {
15550     if (@$_) {
15551     $test->failure_comment
15552     (@$_.' |DOMError|s of type |'.
15553     $_->[0]->{type}->{value}.'| are not reported');
15554     $not_ok = true;
15555     }
15556     }
15557     $not_ok ? $test->not_ok : $test->ok;
15558 wakaba 1.12 }
15559 wakaba 1.5 }
15560 wakaba 1.6
15561     @ResourceDef:
15562 wakaba 1.19 @@QName: getEmptyEntityState
15563     @@rdf:type: DISPerl|InlineCode
15564     @@ForCheck: ManakaiDOM|ForClass
15565     @@PerlDef:
15566     {reptxt => \'', line => 1, column => 1, pos => 0,
15567 wakaba 1.27 is_externally_declared => true, name => $name,
15568     fh => do {
15569     open my $empty, '<', \'';
15570     $empty;
15571     },
15572     close_file => sub { }}
15573 wakaba 1.19
15574     @ResourceDef:
15575 wakaba 1.6 @@QName: getCopyOfEntityState
15576     @@rdf:type: DISPerl|InlineCode
15577     @@ForCheck: ManakaiDOM|ForClass
15578     @@PerlDef:
15579     {%{$self->{$entity_type}->{$entity_name}},
15580 wakaba 1.27 line => 1, column => 1, pos => 0,
15581     fh => do {
15582     require IO::String;
15583     IO::String->new
15584     (${$self->{$entity_type}->{$entity_name}->{reptxt}});
15585     ## TODO: External entities.
15586     },
15587     close_file => sub { }}
15588 wakaba 1.1 ##ManakaiXMLParser
15589 wakaba 1.5
15590     ElementTypeBinding:
15591 wakaba 1.27 @Name: Test
15592     @ElementType:
15593     dis:ResourceDef
15594     @ShadowContent:
15595     @@ForCheck: ManakaiDOM|ForClass
15596     @@rdf:type: test|StandaloneTest
15597    
15598     ElementTypeBinding:
15599 wakaba 1.5 @Name: XMLTests
15600     @ElementType:
15601     dis:ResourceDef
15602     @ShadowContent:
15603     @@ForCheck: ManakaiDOM|ForClass
15604     @@rdf:type: test|ParserTestSet
15605    
15606     ElementTypeBinding:
15607     @Name: XMLTest
15608     @ElementType:
15609     dis:ResourceDef
15610     @ShadowContent:
15611     @@ForCheck: ManakaiDOM|ForClass
15612     @@rdf:type: test|ParserTest
15613    
15614     ElementTypeBinding:
15615     @Name: DEnt
15616     @ElementType:
15617     dis:ResourceDef
15618     @ShadowContent:
15619     @@rdf:type: test|RootEntity
15620    
15621     ElementTypeBinding:
15622     @Name: Ent
15623     @ElementType:
15624     dis:ResourceDef
15625     @ShadowContent:
15626     @@rdf:type: test|Entity
15627 wakaba 1.1
15628 wakaba 1.3 ResourceDef:
15629     @QName: xp|get-location-from-token
15630     @rdf:type: DISPerl|BlockCode
15631     @enDesc:
15632     Creates a <IF::DOMCore:DOMLocator> object from a token.
15633     @PerlDef:
15634 wakaba 1.14 my $__d = $token->{type} ne '#EOF'
15635     ? $token->{location}->{char_d}
15636     : 0;
15637 wakaba 1.15 $__d -= $token->{location_d} if $token->{location_d};
15638 wakaba 1.3 $result = {
15639 wakaba 1.14 utf32_offset => $token->{location}->{pos} - $__d,
15640     line_number => $token->{location}->{line},
15641     column_number => $token->{location}->{column} - $__d,
15642 wakaba 1.3 };
15643 wakaba 1.14 $result->{utf32_offset} = 0 if $result->{utf32_offset} < 0;
15644     $result->{column_number} = 0 if $result->{column_number} < 0;
15645     ## 0 or 1, which should be?
15646 wakaba 1.3 @For: ManakaiDOM|ManakaiDOM3
15647 wakaba 1.1
15648     ElementTypeBinding:
15649     @Name: RuleDef
15650     @ElementType:
15651     dis:ResourceDef
15652     @ShadowContent:
15653     @@ForCheck: ManakaiDOM|ForClass
15654     @@rdf:type: Muf2003|RuleDefClass
15655    
15656     ElementTypeBinding:
15657     @Name: RuleParam
15658     @ElementType:
15659     dis:ResourceDef
15660     @ShadowContent:
15661     @@rdf:type: Muf2003|RuleParameter
15662    
15663     ElementTypeBinding:
15664     @Name: enImplNote
15665     @ElementType:
15666     dis:ImplNote
15667     @ShadowContent:
15668     @@lang:en
15669    
15670     ElementTypeBinding:
15671 wakaba 1.24 @Name: WFErrDef
15672 wakaba 1.1 @ElementType:
15673     dis:ResourceDef
15674     @ShadowContent:
15675     @@rdf:type: DOMCore|DOMErrorType
15676     @@For: ManakaiDOM|DOM3
15677     @@ecore:textFormatter: ManakaiXMLParserExceptionFormatter
15678 wakaba 1.24 @@c:severity: c|SEVERITY_FATAL_ERROR
15679 wakaba 1.1
15680 wakaba 1.3 ElementTypeBinding:
15681 wakaba 1.24 @Name: FatalErrDef
15682 wakaba 1.3 @ElementType:
15683     dis:ResourceDef
15684     @ShadowContent:
15685     @@rdf:type: DOMCore|DOMErrorType
15686     @@For: ManakaiDOM|DOM3
15687     @@ecore:textFormatter: ManakaiXMLParserExceptionFormatter
15688 wakaba 1.24 @@c:severity: c|SEVERITY_FATAL_ERROR
15689    
15690     ElementTypeBinding:
15691 wakaba 1.26 @Name: NSFatalErrDef
15692     @ElementType:
15693     dis:ResourceDef
15694     @ShadowContent:
15695     @@rdf:type: c|DOMErrorType
15696     @@For: ManakaiDOM|DOM3
15697     @@ecore:textFormatter: ManakaiXMLParserExceptionFormatter
15698     @@c:severity: c|SEVERITY_FATAL_ERROR
15699    
15700     ElementTypeBinding:
15701     @Name: NSCErrDef
15702     @ElementType:
15703     dis:ResourceDef
15704     @ShadowContent:
15705     @@rdf:type: c|DOMErrorType
15706     @@For: ManakaiDOM|DOM3
15707     @@ecore:textFormatter: ManakaiXMLParserExceptionFormatter
15708     @@c:severity: c|SEVERITY_FATAL_ERROR
15709    
15710     ElementTypeBinding:
15711 wakaba 1.24 @Name: VCErrDef
15712     @ElementType:
15713     dis:ResourceDef
15714     @ShadowContent:
15715     @@rdf:type: c|DOMErrorType
15716     @@For: ManakaiDOM|DOM3
15717     @@ecore:textFormatter: ManakaiXMLParserExceptionFormatter
15718     @@c:severity: c|SEVERITY_ERROR
15719    
15720     ElementTypeBinding:
15721     @Name: ErrDef
15722     @ElementType:
15723     dis:ResourceDef
15724     @ShadowContent:
15725     @@rdf:type: c|DOMErrorType
15726     @@For: ManakaiDOM|DOM3
15727     @@ecore:textFormatter: ManakaiXMLParserExceptionFormatter
15728     @@c:severity: c|SEVERITY_ERROR
15729 wakaba 1.3
15730 wakaba 1.16 ElementTypeBinding:
15731 wakaba 1.24 @Name: WarnDef
15732 wakaba 1.16 @ElementType:
15733     dis:ResourceDef
15734     @ShadowContent:
15735 wakaba 1.24 @@rdf:type: c|DOMErrorType
15736 wakaba 1.16 @@For: ManakaiDOM|DOM3
15737     @@ecore:textFormatter: ManakaiXMLParserExceptionFormatter
15738 wakaba 1.24 @@c:severity: c|SEVERITY_WARNING
15739 wakaba 1.16
15740 wakaba 1.3 WFErrDef:
15741     @QName: xp|wf-syntax-error
15742     @enDesc:
15743     The entity does not match to the production rule; it is not
15744     well-formed.
15745     @enMufDef:
15746     |%xp-error-token-type;|%xp-error-token-value
15747     (prefix => { (|}, suffix => {|)}); is not
15748     allowed%xp-error-lines (prefix => { (|}, suffix => {|)});
15749     @ecore:hasParameter:
15750     @@@: xp|error-token
15751     @@enDesc:
15752     The token that is not allowed.
15753    
15754     WFErrDef:
15755     @QName: xp|wf-pi-target-is-xml
15756     @enDesc:
15757     A processing instruction has its <CODE::PITarget> of
15758     <XML::xml> (in any case) which is not allowed.
15759     @enMufDef:
15760     Processing instruction target name cannot be |%p
15761     (name => {<Q::xp|name>});|
15762     @ecore:hasParameter:
15763     @@@: xp|error-token
15764     @@enDesc:
15765     The token that contains the name.
15766     @ecore:hasParameter:
15767     @@@: xp|name
15768     @@enDesc:
15769     A string that is specified as target name of the
15770     processing instruction.
15771     @ecore:hasParameter: xp|parent
15772    
15773     WFErrDef:
15774     @QName: xp|wf-no-end-tag
15775     @enDesc:
15776     An end-tag is not found.
15777     @enMufDef:
15778     End-tag |</%p (name => {<Q::xp|expected-element-type>});>| is required
15779     @ecore:hasParameter: xp|error-token
15780     @ecore:hasParameter:
15781     @@@: xp|node
15782     @@enDesc:
15783     The element node that is not closed.
15784     @ecore:hasParameter:
15785     @@@: xp|expected-element-type
15786     @@enDesc:
15787     The element type name of the element that is not closed.
15788    
15789     WFErrDef:
15790     @QName: xp|wf-unsupported-xml-version
15791     @enDesc:
15792     The XML version specified in the version declaration is not supported.
15793     @enMufDef:
15794     XML version |%p (name => {<Q::infoset|version>});| is not supported
15795     @ecore:hasParameter: xp|bad-token
15796     @ecore:hasParameter:
15797     @@@: xp|parent
15798     @@enDesc:
15799     The document node.
15800     @ecore:hasParameter:
15801     @@@: infoset|version
15802     @@enDesc:
15803     The specified XML version.
15804    
15805     WFErrDef:
15806     @QName: xp|wf-malformed-enc-name
15807     @enDesc:
15808     An <XA::encoding> pseudo-attribute value does not match
15809     to the procduction rule <CODE::EncName>.
15810     @enMufDef:
15811     Encoding name |%p (name => {<Q::xp|name>});| is not allowed
15812     @ecore:hasParameter: xp|error-token
15813     @ecore:hasParameter:
15814     @@@: xp|parent
15815     @@enDesc: The document node.
15816     @ecore:hasParameter:
15817     @@@: xp|name
15818     @@enDesc:
15819     The <XA::encoding> value.
15820    
15821     WFErrDef:
15822     @QName: xp|wf-malformed-xml-standalone
15823     @enDesc:
15824     An <XA::standalone> pseudo-attribute value is neither <XML::yes>
15825     or <XML::no>.
15826     @enMufDef:
15827     |standalone| pseudo-attribute value |%p (name => {<Q::xp|name>});|
15828     is not allowed
15829     @ecore:hasParameter: xp|error-token
15830     @ecore:hasParameter:
15831     @@@: xp|parent
15832     @@enDesc: The document node.
15833     @ecore:hasParameter:
15834     @@@: xp|name
15835     @@enDesc:
15836     The <XA::standalone> value.
15837    
15838     WFErrDef:
15839     @QName: xp|wf-legal-literal-character
15840     @enDesc:
15841     Each character in XML entity must match to the production
15842     rule <CODE::Char - RestrictedChar>.
15843     @enMufDef:
15844     Character %character-code-point
15845     (v => {<Q::xp|character-number>}); is not allowed
15846     @ecore:hasParameter:
15847     @@@: xp|character-number
15848     @@enDesc:
15849     The code position of the character being referred.
15850    
15851     WFErrDef:
15852 wakaba 1.26 @QName: xp|wf-invalid-character-in-node-name
15853     @c:errorType:
15854     @@@: wf-invalid-character-in-node-name
15855     @@ContentType: DISCore|String
15856     @enDesc:
15857     If a name contains a character that is not a name character
15858     in the XML version in use, or if the first character of a name
15859     is not a name start character in the XML version in use.
15860    
15861     {NOTE::
15862     When an invalid character is encountered in an entity
15863     where a <CODE::Name> is expected, what type of error
15864     is issued is implementation dependent: <Q::xp|wf-syntax-error>,
15865     <Q::xp|wf-pi-target-is-xml> or other error might be reported.
15866     }
15867    
15868     {NOTE::
15869     This error type is defined in DOM Level 3 Core and Load and Save
15870     modules and redefined herein for the purpose of XML parser.
15871     }
15872     @enMufDef:
15873     Character %character-code-point
15874     (v => {<Q::xp|character-number>}); is not allowed in name
15875     @ecore:hasParameter: xp|error-token
15876     @ecore:hasParameter:
15877     @@@: xp|character-number
15878     @@enDesc:
15879     The code position of the character being referred.
15880     @ecore:hasParameter:
15881     @@@: infoset|version
15882     @@enDesc:
15883     The version of XML in use.
15884    
15885     WFErrDef:
15886 wakaba 1.25 @QName: xp|wf-pes-in-internal-subset
15887     @enDesc:
15888     In the internal subset of the DTD, parameter entity references
15889     <kwd:MUST-NOT> occur within markup declarations.
15890     @enMufDef:
15891     Parameter entity reference |%percent;%param (name => {<Q::xp|name>});;|
15892     cannot occur within a markup declaration
15893     @ecore:hasParameter: xp|error-token
15894     @ecore:hasParameter:
15895     @@@: xp|name
15896     @@enDesc:
15897     The name of the parameter entity.
15898    
15899     WFErrDef:
15900 wakaba 1.3 @QName: xp|wf-element-type-match
15901 wakaba 1.1 @enDesc:
15902 wakaba 1.3 The <CODE::Name> in an element's end-tag must match the element type
15903     in the start-tag.
15904     @enMufDef:
15905     End-tag |</%p (name => {<Q::xp|actual-element-type>});>| does
15906     not match to start-tag |<%p (name => {<Q::xp|expected-element-type>});>|
15907     @ecore:hasParameter: xp|error-token
15908     @ecore:hasParameter:
15909     @@@: xp|node
15910     @@enDesc:
15911     The current opening element node.
15912     @ecore:hasParameter:
15913     @@@: xp|expected-element-type
15914     @@enDesc:
15915     The element type name of the current element.
15916     @ecore:hasParameter:
15917     @@@: xp|actual-element-type
15918     @@enDesc:
15919     The <CODE::Name> occurs in the end-tag.
15920    
15921     WFErrDef:
15922     @QName: xp|wf-unique-att-spec
15923     @enDesc:
15924     An attribute name <kwd:MUST-NOT> appear more than once in
15925     the same start-tag or empty-element tag.
15926 wakaba 1.1 @enMufDef:
15927 wakaba 1.3 Attribute |%p (name => {<Q::xp|name>});| is specified more
15928     than once in the same tag
15929     @ecore:hasParameter: xp|error-token
15930     @ecore:hasParameter:
15931     @@@: xp|name
15932     @@enDesc:
15933     The name of the attribute.
15934 wakaba 1.18
15935     WFErrDef:
15936     @QName: xp|wf-no-external-entity-references
15937     @enDesc:
15938     Attribute values <kwd:MUST-NOT> contain direct or indirect
15939     entity references to external entities.
15940     @enMufDef:
15941     External entity |%p (name => {<Q::xp|name>});| is referenced
15942     in an attribute value literal
15943     @ecore:hasParameter: xp|error-token
15944     @ecore:hasParameter:
15945     @@@: xp|name
15946     @@enDesc:
15947     The name of the entity.
15948    
15949     WFErrDef:
15950     @QName: xp|wf-no-lt-in-attribute-values
15951     @enDesc:
15952     The replacement text of any entity referred to directly or indirectly
15953     in an attribute value literal <kwd:MUST-NOT> contain a
15954     <CHAR::LESS-THAN SIGN>.
15955     @enMufDef:
15956     Entity replacement text cannot contain a
15957     |LESS-THAN SIGN| since it is referenced from an attribute
15958     value literal
15959     @ecore:hasParameter: xp|error-token
15960 wakaba 1.3
15961 wakaba 1.25 WarnDef:
15962     @QName: xp|warning-attribute-definition-ignored
15963     @enDesc:
15964     An attribute definition is ignored because the same attribute
15965     is declared before.
15966     @enMufDef:
15967     Attribute definition for |%p (name => {<Q::xp|name>});| is ignored
15968     @ecore:hasParameter: xp|error-token
15969     @ecore:hasParameter:
15970     @@@: xp|name
15971     @@enDesc:
15972     The name of the attribute.
15973    
15974 wakaba 1.3 WFErrDef:
15975     @QName: xp|wf-legal-character
15976     @enDesc:
15977     Characters referred to using character references <kwd:MUST>
15978     match the production for <CODE::Char>.
15979     @enMufDef:
15980     Reference to character %character-code-point
15981     (v => {<Q::xp|character-number>}); is not allowed
15982     @ecore:hasParameter: xp|error-token
15983     @ecore:hasParameter:
15984     @@@: xp|character-number
15985     @@enDesc:
15986     The code position of the character being referred.
15987     @ecore:hasParameter:
15988     @@@: xp|parent
15989     @@enDesc:
15990     The parent node in which the character reference has
15991     occurred, if available.
15992 wakaba 1.19
15993     WFErrDef:
15994     @QName: xp|wf-entity-declared
15995     @enDesc:
15996     {P:: In a document
15997    
15998     - without any DTD,
15999    
16000     - with only an internal DTD subset that contains no parameter
16001     entity references, or
16002    
16003     - with <XML::standalone="yes">,
16004    
16005     for an entity reference that does not occur within the external
16006     subset or a parameter entity, the <CODE::Name> given in the
16007     entity reference <kwd:MUST> match the <CODE::Name> does not
16008     occur within the external subset or a parameter entity,
16009     except that five predefined character entities need not
16010     be declared. The declaration of a general entity <kwd:MUST>
16011     precede any reference to it which appears in a default value
16012     in an attribute list declaration.
16013     @enMufDef:
16014     Entity |%p (name => {<Q::xp|name>});| must be declared
16015     in the internal subset
16016 wakaba 1.23 @ecore:hasParameter: xp|error-token
16017     @ecore:hasParameter:
16018     @@@: xp|name
16019     @@enDesc:
16020     The name of the entity.
16021    
16022     WFErrDef:
16023     @QName: xp|wf-parsed-entity
16024     @enDesc:
16025     An entity reference <kwd:MUST-NOT> contain the name of an
16026     unparsed entity.
16027     @enMufDef:
16028     Entity |%p (name => {<Q::xp|name>});| is an unparsed entity
16029     @ecore:hasParameter: xp|error-token
16030     @ecore:hasParameter:
16031     @@@: xp|name
16032     @@enDesc:
16033     The name of the entity.
16034    
16035     WFErrDef:
16036     @QName: xp|wf-no-recursion
16037     @enDesc:
16038     A parsed entity <kwd:MUST-NOT> contain a recursive reference
16039     to itself, either directly or indirectly.
16040     @enMufDef:
16041     Entity |%p (name => {<Q::xp|name>});| is recursively referenced
16042 wakaba 1.19 @ecore:hasParameter: xp|error-token
16043     @ecore:hasParameter:
16044     @@@: xp|name
16045     @@enDesc:
16046     The name of the entity.
16047 wakaba 1.16
16048     FatalErrDef:
16049     @QName: xp|fatal-xml11-end-of-line-in-xml-declaration
16050     @enDesc:
16051     An end-of-line character <CODE::U+0085> or <CODE::U+2028> is appeared
16052     within an XML declaration or text declaration.
16053     @enMufDef:
16054     End-of-line character %character-code-point
16055     (v => {<Q::xp|character-number>}); cannot be used within the
16056     XML or text declaration
16057     @ecore:hasParameter:
16058     @@@: xp|character-number
16059     @@enDesc:
16060     The code position of the end-of-line character.
16061 wakaba 1.24
16062     ErrDef:
16063     @QName: xp|error-internal-predefined-entity
16064     @enDesc:
16065     A general entity declaration whose <CODE::Name> equals to one
16066     of predefined entities <kwd:MUST> declare it as an internal entity.
16067     @enMufDef:
16068     Entity |%p (name => {<Q::xp|name>});| must be declared as an
16069     internal entity
16070     @ecore:hasParameter: xp|error-token
16071     @ecore:hasParameter:
16072     @@@: xp|name
16073     @@enDesc:
16074     The name of the entity.
16075    
16076     ErrDef:
16077     @QName: xp|error-malformed-predefined-entity
16078     @enDesc:
16079     A general entity declaration whose <CODE::Name> equals to one
16080     of predefined entities <kwd:MUST> declare it as a data
16081     character for the entity.
16082     @enMufDef:
16083     Entity declaration for |%p (name => {<Q::xp|name>});|
16084     (replacement text |%p (name => {<Q::xp|replacement-text>});|) is malformed
16085     @ecore:hasParameter: xp|error-token
16086     @ecore:hasParameter:
16087     @@@: xp|name
16088     @@enDesc:
16089     The name of the entity.
16090     @ecore:hasParameter:
16091     @@@: xp|replacement-text
16092     @@enDesc:
16093     The replacement text of the entity declaration.
16094    
16095     WarnDef:
16096     @QName: xp|warning-entity-declaration-ignored
16097     @enDesc:
16098     An entity declaration is ignored because the same entity
16099     is declared before.
16100     @enMufDef:
16101     Entity declaration for |%p (name => {<Q::xp|name>});| is ignored
16102     @ecore:hasParameter: xp|error-token
16103     @ecore:hasParameter:
16104     @@@: xp|name
16105     @@enDesc:
16106     The name of the entity.
16107    
16108     VCErrDef:
16109     @QName: xp|vc-unique-notation-name
16110     @enDesc:
16111     A <CODE::Name> <kwd:MUST-NOT> be declared in more than
16112     one notation declaration.
16113     @enMufDef:
16114     Notation |%p (name => {<Q::xp|name>});| is already declared
16115     @ecore:hasParameter: xp|error-token
16116     @ecore:hasParameter:
16117     @@@: xp|name
16118     @@enDesc:
16119     The name of the notation.
16120 wakaba 1.25
16121     WarnDef:
16122     @QName: xp|warning-entity-declaration-not-processed
16123     @enDesc:
16124     An entity declaration is not processed because there
16125     is a reference to parameter entity before the declaration
16126     and the entity is not read.
16127     @enMufDef:
16128     Entity declaration for |%p (name => {<Q::xp|name>});| is not processed
16129     @ecore:hasParameter: xp|error-token
16130     @ecore:hasParameter:
16131     @@@: xp|name
16132     @@enDesc:
16133     The name of the entity.
16134    
16135     WarnDef:
16136     @QName: xp|warning-attribute-definition-not-processed
16137     @enDesc:
16138     An attribute definition is not processed because there
16139     is a reference to parameter entity before the declaration
16140     and the entity is not read.
16141     @enMufDef:
16142     Attribute definition for |%p (name => {<Q::xp|name>});| is not processed
16143     @ecore:hasParameter: xp|error-token
16144     @ecore:hasParameter:
16145     @@@: xp|name
16146     @@enDesc:
16147     The name of the attribute.
16148 wakaba 1.26
16149     NSFatalErrDef:
16150     @QName: xp|nswf-legal-ncname
16151     @enDesc:
16152     <CODE::Name>s other than element type names and attribute names
16153     <kwd:MUST> be <CODE::NCName>s.
16154     @enMufDef:
16155     <CODE::Name> |%p (name => {<Q::xp|name>});| is not an <CODE::NCName>
16156     @ecore:hasParameter: xp|error-token
16157     @ecore:hasParameter:
16158     @@@: xp|name
16159     @@enDesc:
16160     The name.
16161     @ecore:hasParameter:
16162     @@@: infoset|version
16163     @@enDesc:
16164     The version of XML in use.
16165    
16166     NSFatalErrDef:
16167     @QName: xp|nswf-legal-qname
16168     @enDesc:
16169     An element type name or an attribute name <kwd:MUST> be a
16170     <CODE::QName>.
16171     @enMufDef:
16172     <CODE::Name> |%p (name => {<Q::xp|name>});| is not a <CODE::QName>
16173     @ecore:hasParameter: xp|error-token
16174     @ecore:hasParameter:
16175     @@@: xp|name
16176     @@enDesc:
16177     The name.
16178     @ecore:hasParameter:
16179     @@@: infoset|version
16180     @@enDesc:
16181     The version of XML in use.
16182    
16183     NSCErrDef:
16184     @QName: xp|nsc-reserved-prefix-xml
16185     @enDesc:
16186     The prefix <XML::xml> <kwd:MUST-NOT> be undeclared or bound
16187     to any namespace name other than <URI::http://www.w3.org/XML/1998/namespace>.
16188     @enMufDef:
16189     Namespace prefix |xml| cannot be bound to namespace
16190     name |%p (name => {<Q::infoset|namespaceName>});|
16191     @ecore:hasParameter: xp|error-token
16192     @ecore:hasParameter:
16193     @@@: infoset|prefix
16194     @@enDesc:
16195     The namespace prefix.
16196     @ecore:hasParameter:
16197     @@@: infoset|namespaceName
16198     @@enDesc:
16199     The namespace name bound to or an empty string for undeclaring.
16200    
16201     NSCErrDef:
16202     @QName: xp|nsc-reserved-namespace-name-xml
16203     @enDesc:
16204     Namespace prefixes other than <XML::xml> <kwd:MUST-NOT> be bound
16205     to the namespace name <URI::http://www.w3.org/XML/1998/namespace>.
16206     @enMufDef:
16207     Namespace prefix |%p (name => {<Q::infoset|prefix>});| cannot be
16208     bound to namespace name |http://www.w3.org/XML/1998/namespace|
16209     @enImplNote:
16210     The XMLNames spec does not prohibit the URI bound to
16211     the default namespace (!)
16212     @ecore:hasParameter: xp|error-token
16213     @ecore:hasParameter:
16214     @@@: infoset|prefix
16215     @@enDesc:
16216     The namespace prefix or <DOM::null> for default namespace.
16217     @ecore:hasParameter:
16218     @@@: infoset|namespaceName
16219     @@enDesc:
16220     The namespace name bound to.
16221    
16222     NSCErrDef:
16223     @QName: xp|nsc-reserved-prefix-xmlns
16224     @enDesc:
16225     The prefix <XML::xmlns> <kwd:MUST-NOT> be declared or undeclared.
16226     @enMufDef:
16227     Namespace prefix |xmlns| cannot be declared or undeclared
16228     @ecore:hasParameter: xp|error-token
16229     @ecore:hasParameter:
16230     @@@: infoset|prefix
16231     @@enDesc:
16232     The namespace prefix.
16233     @ecore:hasParameter:
16234     @@@: infoset|namespaceName
16235     @@enDesc:
16236     The namespace name bound to or an empty string for undeclaring.
16237    
16238     NSCErrDef:
16239     @QName: xp|nsc-reserved-namespace-name-xmlns
16240     @enDesc:
16241     Namespace prefixes <kwd:MUST-NOT> be bound
16242     to the namespace name <URI::http://www.w3.org/2000/xmlns/>.
16243     @enMufDef:
16244     Namespace prefix |%p (name => {<Q::infoset|prefix>});| cannot be
16245     bound to namespace name |http://www.w3.org/2000/xmlns/|
16246     @enImplNote:
16247     The XMLNames spec does not prohibit the URI bound to
16248     the default namespace (!)
16249     @ecore:hasParameter: xp|error-token
16250     @ecore:hasParameter:
16251     @@@: infoset|prefix
16252     @@enDesc:
16253     The namespace prefix or <DOM::null> for default namespace.
16254     @ecore:hasParameter:
16255     @@@: infoset|namespaceName
16256     @@enDesc:
16257     The namespace name bound to.
16258    
16259     NSCErrDef:
16260     @QName: xp|nsc-prefix-declared
16261     @enDesc:
16262     A namespace prefix other than <XML::xml> or <XML::xmlns>
16263     <kwd:MUST> have been declared in a namespace declaration
16264     attribute in either the start or empty element tag of the
16265     element where the prefix is used or in an ancestor
16266     element. Furthermore, the attribute value in the innermost
16267     such declaration <kwd:MUST-NOT> be an empty string.
16268     @enMufDef:
16269     Namespace prefix |%p (name => {<Q::infoset|prefix>});| in
16270     qualified name |%p (name => {<Q::xp|name>});| is not declared
16271     @ecore:hasParameter: xp|error-token
16272     @ecore:hasParameter:
16273     @@@: infoset|prefix
16274     @@enDesc:
16275     The namespace prefix.
16276     @ecore:hasParameter:
16277     @@@: xp|name
16278     @@enDesc:
16279     The qualified name.
16280    
16281     NSFatalErrDef:
16282     @QName: xp|nswf-empty-namespace-name
16283     @enDesc:
16284     If the XML version of the document is 1.0 and the
16285     normalized value of the prefixed namespace declaration attribute is empty.
16286     @enMufDef:
16287     Namespace |%p (name => {<Q::infoset|prefix>});| cannot be
16288     undeclared in XML 1.0
16289     @ecore:hasParameter: xp|error-token
16290     @ecore:hasParameter:
16291     @@@: infoset|prefix
16292     @@enDesc:
16293     The namespace prefix.
16294     @ecore:hasParameter:
16295     @@@: infoset|namespaceName
16296     @@enDesc:
16297     An empty string.
16298    
16299     NSFatalErrDef:
16300     @QName: xp|nswf-unique-att-spec-expanded-name
16301     @enDesc:
16302     No element may have two attributes that have qualified name
16303     with the same local part and with namespace prefixes
16304     that have been bound to namespace names that are identical.
16305     @enMufDef:
16306     Attribute |%p (name => {<Q::infoset|localName>});| in
16307     namespace |%p (name => {<Q::infoset|namespaceName>});| is
16308     attached to the same element more than once (as
16309     |%p (name => {<Q::xp|name>});| and
16310     |%p (name => {<Q::xp|another-attribute-name>});|)
16311     @enImplNote:
16312     The XMLNames spec doesn't mention default attributes
16313     for this constraint...
16314     @ecore:hasParameter: xp|error-token
16315     @ecore:hasParameter:
16316     @@@: infoset|localName
16317     @@enDesc:
16318     The local part of the attribute.
16319     @ecore:hasParameter:
16320     @@@: infoset|namespaceName
16321     @@enDesc:
16322     The namespace URI of the attribute.
16323     @ecore:hasParameter:
16324     @@@: xp|name
16325     @@enDesc:
16326     The name, i.e. a qualified name consist of <Q::infoset:localName>
16327     and <Q::infoset:namespaceName> parameter values.
16328     @ecore:hasParameter:
16329     @@@: xp|another-attribute-name
16330     @@enDesc:
16331     Another attribute qualified name expanded to the same expanded name
16332     as <Q::xp|name>.
16333    
16334     XWParam:
16335     @QName: xp|another-attribute-name
16336 wakaba 1.24
16337     XWParam:
16338     @QName: xp|replacement-text
16339     @enDesc:
16340     The replacement text.
16341 wakaba 1.1
16342 wakaba 1.3 XWParam:
16343 wakaba 1.1 @QName: xp|error-token
16344     @enDesc:
16345     The token where the parser found an error.
16346    
16347 wakaba 1.3 XWParam:
16348     @QName: xp|name
16349     @enDesc:
16350     A name.
16351    
16352     XWParam:
16353     @QName: xp|parent
16354     @enDesc:
16355     The parent node in which the error occurs.
16356    
16357     XWParam:
16358     @QName: xp|node
16359     @enDesc:
16360     The current node.
16361    
16362     XWParam:
16363     @QName: xp|actual-element-type
16364     @enDesc:
16365     The actual element type name occured in the source.
16366    
16367     XWParam:
16368     @QName: xp|expected-element-type
16369 wakaba 1.1 @enDesc:
16370 wakaba 1.3 The element type name expected.
16371    
16372     XWParam:
16373     @QName: xp|character-number
16374     @enDesc:
16375     The character code position.
16376    
16377     ElementTypeBinding:
16378     @Name: XWParam
16379     @ElementType:
16380     dis:ResourceDef
16381     @ShadowContent:
16382     @@For: =ManakaiDOM|all
16383     @@rdf:type: ecore|Parameter
16384 wakaba 1.1
16385     ElementTypeBinding:
16386     @Name:enMufDef
16387     @ElementType:
16388     ecore:defaultMessage
16389     @ShadowContent:
16390     @@lang:en
16391     @@ContentType:
16392     lang:muf
16393    
16394     ResourceDef:
16395     @QName: DOMImpl
16396     @AliasFor: DOMCore|DOMImplementation
16397     @For: ManakaiDOM|DOM
16398    
16399 wakaba 1.27 ResourceDef:
16400     @QName: LSInput
16401     @AliasFor: DOMLS|LSInput
16402     @For: ManakaiDOM|DOM
16403    
16404     ResourceDef:
16405     @QName: LSParser
16406     @AliasFor: DOMLS|LSParser
16407     @For: ManakaiDOM|DOM
16408    
16409 wakaba 1.1 ElementTypeBinding:
16410     @Name: Attr
16411     @ElementType:
16412     dis:ResourceDef
16413     @ShadowContent:
16414     @@rdf:type: DISLang|Attribute
16415     @@ForCheck: !=ManakaiDOM|ManakaiDOM
16416    
16417     ElementTypeBinding:
16418     @Name: Get
16419     @ElementType:
16420     dis:ResourceDef
16421     @ShadowContent:
16422     @@rdf:type: DISLang|AttributeGet
16423    
16424     ElementTypeBinding:
16425     @Name: Set
16426     @ElementType:
16427     dis:ResourceDef
16428     @ShadowContent:
16429     @@rdf:type: DISLang|AttributeSet
16430    
16431     ElementTypeBinding:
16432     @Name: enDesc
16433     @ElementType:
16434     dis:Description
16435     @ShadowContent:
16436     @@lang:en
16437    
16438     ElementTypeBinding:
16439     @Name: Method
16440     @ElementType:
16441     dis:ResourceDef
16442     @ShadowContent:
16443     @@rdf:type: DISLang|Method
16444     @@For: !=ManakaiDOM|ManakaiDOM
16445    
16446     ElementTypeBinding:
16447     @Name: Return
16448     @ElementType:
16449     dis:ResourceDef
16450     @ShadowContent:
16451     @@rdf:type: DISLang|MethodReturn
16452    
16453     ElementTypeBinding:
16454     @Name: Param
16455     @ElementType:
16456     dis:ResourceDef
16457     @ShadowContent:
16458     @@rdf:type: DISLang|MethodParameter
16459    
16460     ElementTypeBinding:
16461     @Name: PerlDef
16462     @ElementType:
16463     dis:Def
16464     @ShadowContent:
16465     @@ContentType: lang|Perl
16466    
16467     ElementTypeBinding:
16468 wakaba 1.27 @Name: PerlDefC
16469     @ElementType:
16470     dis:Def
16471     @ShadowContent:
16472     @@ContentType: lang|Perl
16473    
16474     ElementTypeBinding:
16475 wakaba 1.1 @Name: PropDef
16476     @ElementType:
16477     dis:ResourceDef
16478     @ShadowContent:
16479     @@rdf:type: rdf|Property
16480    
16481     ClsDef:
16482     @ClsQName: ManakaiXMLParserExceptionFormatter
16483    
16484     @ClsISA: ecore|MUErrorFormatter||ManakaiDOM|Perl
16485    
16486     @RuleDef:
16487     @@Name: xp-error-token-type
16488     @@enDesc:
16489     The type of the token the parser is encountered.
16490    
16491     @@Method:
16492     @@@Name: after
16493     @@@Param:
16494     @@@@Name: name
16495     @@@@Type: DOMString
16496     @@@@enDesc: The name of the method.
16497     @@@Param:
16498     @@@@Name: p
16499     @@@@Type: DISPerl|HASH
16500     @@@@enDesc: The set of the parameters to the method.
16501     @@@Param:
16502     @@@@Name: o
16503     @@@@Type: DISPerl|HASH
16504     @@@@enDesc: The option value.
16505     @@@Return:
16506     @@@@PerlDef:
16507     $p->{-result} = $o->{<H::xp|error-token>}->{type}
16508     if defined $o->{<H::xp|error-token>}->{type};
16509    
16510     @RuleDef:
16511     @@Name: xp-error-token-value
16512     @@enDesc:
16513     The value of the token the parser is encountered, if any.
16514    
16515     @@Method:
16516     @@@Name: after
16517     @@@Param:
16518     @@@@Name: name
16519     @@@@Type: DOMString
16520     @@@@enDesc: The name of the method.
16521     @@@Param:
16522     @@@@Name: p
16523     @@@@Type: DISPerl|HASH
16524     @@@@enDesc: The set of the parameters to the method.
16525     @@@Param:
16526     @@@@Name: o
16527     @@@@Type: DISPerl|HASH
16528     @@@@enDesc: The option value.
16529     @@@Return:
16530     @@@@PerlDef:
16531     $p->{-result} = $o->{<H::xp|error-token>}->{value}
16532     if defined $o->{<H::xp|error-token>}->{value};
16533    
16534     @RuleDef:
16535     @@Name: xp-error-lines
16536     @@enDesc:
16537     A copy of fragment of the source text that contains the line
16538     where the error occurred, if available.
16539    
16540     @@Method:
16541     @@@Name: after
16542     @@@Param:
16543     @@@@Name: name
16544     @@@@Type: DOMString
16545     @@@@enDesc: The name of the method.
16546     @@@Param:
16547     @@@@Name: p
16548     @@@@Type: DISPerl|HASH
16549     @@@@enDesc: The set of the parameters to the method.
16550     @@@Param:
16551     @@@@Name: o
16552     @@@@Type: DISPerl|HASH
16553     @@@@enDesc: The option value.
16554     @@@Return:
16555     @@@@PerlDef:
16556     my $pos = $o-><AG::DOMCore|DOMError.location>
16557     -><AG::DOMCore|DOMLocator.utf32Offset>;
16558 wakaba 1.27 my $src = $o->{<H::ecore|object>}->{entity}->[-1]->{reptxt};
16559     if (defined $src and $pos > -1) {
16560 wakaba 1.1 my $start = $pos;
16561     $start = rindex ($$src, "\x0A", $start - 1) for 0..2;
16562     $start++;
16563     my $end = $pos;
16564     $end = index ($$src, "\x0A", $end + 1) for 0..2;
16565     $end = length $$src if $end < 0;
16566     $p->{-result} = substr $$src, $start, $end - $start;
16567     }
16568 wakaba 1.3
16569     @RuleDef:
16570     @@Name: character-code-point
16571     @@enDesc:
16572     The character code position, in <CODE::U+<VAR::HHHH>> notation.
16573    
16574     @@Method:
16575     @@@Name: after
16576     @@@Param:
16577     @@@@Name: name
16578     @@@@Type: DOMString
16579     @@@@enDesc: The name of the method.
16580     @@@Param:
16581     @@@@Name: p
16582     @@@@Type: DISPerl|HASH
16583     @@@@enDesc: The set of the parameters to the method.
16584     @@@Param:
16585     @@@@Name: o
16586     @@@@Type: DISPerl|HASH
16587     @@@@enDesc: The option value.
16588     @@@RuleParam:
16589     @@@@Name: v
16590     @@@@Type: DISPerl|Number
16591     @@@@enDesc:
16592     The name of the error parameter that contains the character code.
16593     @@@Return:
16594     @@@@PerlDef:
16595     $p->{-result} = sprintf 'U+%04X', $o->{$p->{v}};
16596 wakaba 1.1 ##XMLParserExceptionFormatter
16597 wakaba 1.27
16598     ElementTypeBinding:
16599     @Name: CParam
16600     @ElementType:
16601     dis:ResourceDef
16602     @ShadowContent:
16603     @@rdf:type:
16604     @@@@: c|DOMConfigurationParameter
16605     @@@For: ManakaiDOM|DOM
16606     @@rdf:type:
16607 wakaba 1.33 @@@@: DISSource|ResourceProperty
16608 wakaba 1.27 @@@For: =ManakaiDOM|all
16609     @@For: ManakaiDOM|DOM3
16610     @@For: =ManakaiDOM|all
16611 wakaba 1.33 @@subsetOf:
16612     @@@@: c|anyDOMConfigurationParameter
16613     @@@For: =ManakaiDOM|all
16614 wakaba 1.34 @@multipleProperties:
16615     @@@@: DISCore|Single
16616     @@@For: =ManakaiDOM|all
16617 wakaba 1.27
16618     ElementTypeBinding:
16619     @Name: CParamApp
16620     @ElementType:
16621     dis:ResourceDef
16622     @ShadowContent:
16623     @@rdf:type:
16624     @@@@: c|DOMConfigurationParameterApplication
16625     @@@For: ManakaiDOM|DOM
16626     @@For: ManakaiDOM|DOM3
16627 wakaba 1.30
16628 wakaba 1.34 ElementTypeBinding:
16629     @Name: boolCParam
16630     @ElementType:
16631     dis:ResourceDef
16632     @ShadowContent:
16633     @@DISCore:resourceType:
16634     @@@@: c|DOMConfigurationParameter
16635     @@@For: ManakaiDOM|DOM
16636     @@DISCore:resourceType:
16637     @@@@: DISSource|ResourceProperty
16638     @@@For: =ManakaiDOM|all
16639     @@For: ManakaiDOM|DOM3
16640     @@For: =ManakaiDOM|all
16641     @@Type: idl|boolean||ManakaiDOM|all
16642     @@subsetOf:
16643     @@@@: c|anyDOMConfigurationParameter
16644     @@@For: =ManakaiDOM|all
16645     @@multipleProperties:
16646     @@@@: DISCore|Single
16647     @@@For: =ManakaiDOM|all
16648     @@dataType:
16649     @@@@: DISCore|Boolean
16650     @@@For: =ManakaiDOM|all
16651    
16652 wakaba 1.30 CParamApp:
16653     @QName: xml-id
16654     @c:domConfigurationParameter: cfg|xml-id
16655     @c:targetType: xp|ManakaiXMLParser
16656 wakaba 1.34 @TrueCase:
16657     @@c:isSupported: 1
16658     @FalseCase:
16659     @@c:isSupported: 1
16660 wakaba 1.27
16661     CParamApp:
16662     @QName: error-handler
16663     @c:domConfigurationParameter: c|error-handler
16664     @c:targetType: xp|ManakaiXMLParser
16665 wakaba 1.34
16666     boolCParam:
16667     @QName: cfg|entity-replacement-tree
16668     @DOMLS:lsKey:
16669     @@@: erep
16670     @@For: =ManakaiDOM|all
16671     @Type: idl|boolean||ManakaiDOM|all
16672     @c:targetType: xp|ManakaiXMLParser
16673     @IsSupportRequired: 1
16674     @c:isSupported: 1
16675     @TrueCase:
16676     @@c:isSupported: 1
16677     @@enDesc:
16678     The parser <kwd:MUST> cnstruct the replacement subtree of
16679 wakaba 1.35 a general parsed <IF::tx|Entity> node if the replacement text
16680 wakaba 1.34 for the node is available.
16681    
16682     If this value is set to the parameter, then a fatal error
16683     might be reported even if the entire document is well-formed
16684     in case a general parsed entity has replacement text that is
16685     not well-formed when evaluated as if it has been referenced
16686     in the content of an element, except that undeclared namespace prefixes
16687     do not result in namespace well-formedness error.
16688     @FalseCase:
16689     @@IsDefault: 1
16690     @@c:isSupported: 1
16691     @@IsSupportRequired: 1
16692     @@enDesc:
16693 wakaba 1.35 The parser don't have to construct <IF::tx|Entity> replacement
16694 wakaba 1.34 subtrees.
16695    
16696     @Test:
16697     @@QName: cfg.entity-replacement-tree.test
16698     @@PerlDef:
16699     my $xp;
16700     __CODE{createParserForTest:: $xp => $xp}__;
16701     my $cfg = $xp-><AG::LSInput.domConfig>;
16702    
16703     my $pname = <Q::cfg|entity-replacement-tree>;
16704    
16705     $test->id ('default.false');
16706     $test->assert_false ($cfg-><M::c|DOMConfiguration.getParameter> ($pname));
16707    
16708     $test->id ('false.to.true');
16709     $cfg-><M::c|DOMConfiguration.setParameter> ($pname => true);
16710     $test->assert_false ($cfg-><M::c|DOMConfiguration.getParameter> ($pname));
16711    
16712     $test->id ('true.to.false');
16713     $cfg-><M::c|DOMConfiguration.setParameter> ($pname => false);
16714     $test->assert_false ($cfg-><M::c|DOMConfiguration.getParameter> ($pname));
16715    
16716     $test->id ('reset');
16717     $cfg-><M::c|DOMConfiguration.setParameter> ($pname => true);
16718     $cfg-><M::c|DOMConfiguration.setParameter> ($pname => null);
16719     $test->assert_false ($cfg-><M::c|DOMConfiguration.getParameter> ($pname));
16720 wakaba 1.27
16721     CParam:
16722     @QName: xp|ls-input-to-input-file
16723     @DOMLS:lsKey:
16724     @@@: i2i
16725     @@For: =ManakaiDOM|all
16726     @Type: ManakaiDOMLSInputToInputFile
16727     @c:targetType: xp|ManakaiXMLParser
16728     @IsSupportRequired: 1
16729     @c:isSupported: 1
16730     @enDesc:
16731     An <IF::LSInput> to Perl filehandle converter.
16732    
16733     @Method:
16734     @@rdf:type: c|DOMConfigurationParameterDefaultGetter
16735     @@Param:
16736     @@@Name: name
16737     @@@Type: DOMString
16738     @@@dis:actualType: c|DOMConfigurationParameterName
16739     @@@enDesc: The parameter name.
16740     @@Return:
16741     @@@Type: ManakaiDOMLSInputToInputFile
16742     @@@enDesc:
16743     The default resolver.
16744     @@@PerlDefC:
16745     $r = sub {
16746     my ($self, $input, $errorHandler) = @_;
16747     ## As defined in DOM Level 3 LS |LSInput| interface
16748    
16749     my $r = {};
16750    
16751     __DEEP{
16752    
16753     FH: {
16754     ## 1. |characterStream|
16755     my $v = $input-><AG::LSInput.characterStream>;
16756     if (defined $v) {
16757     $r->{filehandle} = $v;
16758     last FH;
16759     }
16760    
16761     ## 2. |byteStream|
16762     $v = $input-><AG::LSInput.byteStream>;
16763     if (defined $v) {
16764     ## TODO: Support byte filehandle
16765     ## |encoding|
16766     ## TODO: How to guess?
16767     return null;
16768     }
16769    
16770     ## 3. |stringData|
16771     $v = $input-><AG::LSInput.stringData>;
16772     if (defined $v) {
16773     require IO::String;
16774     $r->{filehandle} = IO::String->new ($v);
16775     last FH;
16776     }
16777    
16778     ## 4. |systemId|
16779     ## TODO:
16780     ## resolve relative URI
16781     ## open
16782     ## set document_uri
16783    
16784     ## 5. |publicId|
16785     ## The default resolver does not support only-|publicId| input.
16786    
16787     return null;
16788     } # FH
16789    
16790     DURI: {
16791     last DURI if defined $r->{document_uri};
16792    
16793     my $v = $input-><AG::LSInput.systemId>;
16794     if (defined $v) {
16795 wakaba 1.29 $r->{base_uri} = $input-><AG::LSInput.baseURI>
16796     unless defined $r->{base_uri};
16797     if (defined $r->{base_uri}) {
16798     $r->{document_uri}
16799     = <ClassM::urigen|ManakaiURIReference.new> (\$v)
16800     -><M::urigen|URIReference.getAbsoluteReference>
16801     ($r->{base_uri})
16802     -><AG::urigen|URIReference.uriReference>;
16803     } else {
16804     $r->{document_uri} = $v;
16805     }
16806 wakaba 1.27 last DURI;
16807     }
16808    
16809     ## TODO: pubid -> pubid URN -> document_uri
16810     } # DURI
16811    
16812     BURI: {
16813     last BURI if defined $r->{base_uri};
16814    
16815     my $v = $input-><AG::LSInput.baseURI>;
16816     if (defined $v) {
16817     $r->{base_uri} = $v;
16818     last BURI;
16819     }
16820    
16821     if (defined $r->{document_uri}) {
16822     $r->{base_uri} = $r->{document_uri};
16823     }
16824     } # BURI
16825    
16826     }__;
16827    
16828     ## ISSUE: Is |certifiedText| required by parsers?
16829    
16830     return $r;
16831     };
16832     @Method:
16833     @@rdf:type: c|DOMConfigurationParameterSetter
16834     @@Param:
16835     @@@Name: name
16836     @@@Type: DOMString
16837     @@@dis:actualType: c|DOMConfigurationParameterName
16838     @@@enDesc: The parameter name.
16839     @@Param:
16840     @@@Name: value
16841     @@@Type: DOMMain|DOMUserData
16842     @@@dis:actualType: ManakaiDOMLSInputToInputFile
16843     @@@enDesc: The new value.
16844     @@Return:
16845     @@@Type: idl|void||ManakaiDOM|all
16846     @@@PerlDefC:
16847     $self->[1]->{<H::xp|ls-input-to-input-file>} = $value;
16848     @@enImplNote:
16849     Implied input processor converts non-blessed code references
16850     into a <Class::ManakaiDOMLSInputToInputFile> object.
16851     @Method:
16852     @@rdf:type: c|DOMConfigurationParameterChecker
16853     @@Param:
16854     @@@Name: name
16855     @@@Type: DOMString
16856     @@@dis:actualType: c|DOMConfigurationParameterName
16857     @@@enDesc: The parameter name.
16858     @@Param:
16859     @@@Name: value
16860     @@@Type: DOMMain|DOMUserData
16861     #@@@dis:actualType: ManakaiDOMLSInputToInputFile
16862     @@@enDesc: The new value.
16863     @@Return:
16864     @@@Type: idl|boolean||ManakaiDOM|all
16865     @@@PerlDefC:
16866     $r = UNIVERSAL::isa ($value, 'CODE') or
16867     UNIVERSAL::isa ($value, <ClassName::ManakaiDOMLSInputToInputFile>);
16868    
16869     @@Test:
16870     @@@QName: cp.ls-input-to-input-file.test
16871     @@@PerlDefC:
16872     my $xp;
16873     __CODE{createParserForTest:: $xp => $xp}__;
16874     my $cfg = $xp-><AG::LSInput.domConfig>;
16875    
16876     my $cp = <Q::xp|ls-input-to-input-file>;
16877    
16878     $test->id ('default');
16879     my $default = $cfg-><M::c|DOMConfiguration.getParameter> ($cp);
16880     $test->assert_isa ($default,
16881     <ClassName::ManakaiDOMLSInputToInputFile>);
16882    
16883     $test->id ('set');
16884     my $sub1 = sub { };
16885     $cfg-><M::c|DOMConfiguration.setParameter> ($cp => $sub1);
16886     my $sub2 = $cfg-><M::c|DOMConfiguration.getParameter> ($cp);
16887     $test->assert_isa ($sub2, <ClassName::ManakaiDOMLSInputToInputFile>);
16888     $test->assert_equals ($sub2, $sub1);
16889    
16890     $test->id ('reset');
16891     $cfg-><M::c|DOMConfiguration.setParameter> ($cp => null);
16892     my $sub3 = $cfg-><M::c|DOMConfiguration.getParameter> ($cp);
16893     $test->assert_isa ($sub3, <ClassName::ManakaiDOMLSInputToInputFile>);
16894     $test->assert_equals ($sub3, $default);
16895 wakaba 1.29
16896     @@Test:
16897     @@@QName: cp.ls-input-to-input-file.default.test
16898     @@@PerlDefC:
16899     my $xp;
16900     __CODE{createParserForTest:: $xp => $xp}__;
16901     my $cfg = $xp-><AG::LSInput.domConfig>;
16902     my $cp = <Q::xp|ls-input-to-input-file>;
16903     my $default = $cfg-><M::c|DOMConfiguration.getParameter> ($cp);
16904    
16905     my $err = sub {}; # dummy error handler
16906    
16907     my $cs = \*STDOUT; # dummy input
16908    
16909     $test->id ('cs.sysid');
16910     my $r1 = $default->resolve_ls_input ({
16911     character_stream => $cs,
16912     system_id => q<http://example.com/sysid>,
16913     }, $err);
16914     $test->assert_equals
16915     ($r1->document_uri, q<http://example.com/sysid>);
16916     $test->assert_equals
16917     ($r1->base_uri, q<http://example.com/sysid>);
16918    
16919     $test->id ('cs.baseuri.sysid');
16920     my $r1 = $default->resolve_ls_input ({
16921     character_stream => $cs,
16922     system_id => q<sysid>,
16923     base_uri => q<http://example.com/>,
16924     }, $err);
16925     $test->assert_equals
16926     ($r1->document_uri, q<http://example.com/sysid>);
16927     $test->assert_equals
16928     ($r1->base_uri, q<http://example.com/>);
16929 wakaba 1.27 ##ls-input-to-input-file
16930    
16931     ClsDef:
16932     @ClsQName: ManakaiDOMLSInputToInputFile
16933     @enDesc:
16934     An <Class::ManakaiDOMLSInputToInputFile> object is used to covert
16935     a <IF::LSInput> object into a Perl filehandle.
16936    
16937     {ISSUE::
16938     In which module this class should be placed?
16939    
16940     Better interface name?
16941     }
16942    
16943     @enDesc:
16944     @@ddid: perl
16945     @@ForCheck: ManakaiDOM|ManakaiDOM
16946     @@@:
16947     For Perl binding, any parameter that accepts
16948     a <Class::ManakaiDOMLSInputToInputFile> would also accept a Perl code
16949     reference (subroutine reference). The code reference
16950     will be blessed as a <Class::ManakaiDOMLSInputToInputFile> whose
16951     <M::ManakaiDOMLSInputToInputFile.resolveLSInput> method invokes the code.
16952    
16953     @ResourceDef:
16954     @@rdf:type: DISLang|InputProcessor
16955     @@rdf:type: DISLang|OutputProcessor
16956     @@PerlDef:
16957     $INPUT = bless $INPUT, <ClassName::ManakaiDOMLSInputToInputFile>
16958     if ref $INPUT eq 'CODE';
16959    
16960     @Method:
16961     @@Name: resolveLSInput
16962     @@enDesc:
16963     Converts a <IF::LSInput> into a Perl filehandle.
16964     @@Param:
16965     @@@Name: input
16966     @@@Type: LSInput
16967     @@@enDesc:
16968     The input.
16969     @@Param:
16970     @@@Name: errorHandler
16971     @@@Type: c|DOMErrorHandler
16972     @@@enDesc:
16973     An error handler. If the method encounters an error
16974     or warning, it <kwd:MAY> notify it to application
16975     via this handler.
16976     @@Return:
16977     @@@Type: ManakaiDOMInputFile
16978     @@@enDesc:
16979     A <Class::ManakaiDOMInputFile> object created from <P::input>.
16980     @@@nullCase:
16981     @@@@enDesc:
16982     If the method was unable to resolve the <P::input>.
16983    
16984     {ISSUE::
16985     Should we allow the method to throw exceptions?
16986     }
16987     @@@PerlDef:
16988     __DEEP{
16989     $r = $self->($self, $input, $errorHandler);
16990     }__;
16991     @@@enImplNote:
16992     Notet that the input / output processor for <CODE::$input>
16993     and return value might or might not be inserted in
16994     the <Perl::$self> code.
16995     ##LSInputToInputFile
16996    
16997     ClsDef:
16998     @ClsQName: ManakaiDOMInputFile
16999     @enDesc:
17000     A set of information on the input, including filehandle.
17001    
17002     @enDesc:
17003     @@ddid: perl
17004     @@ForCheck: ManakaiDOM|ManakaiDOM
17005     @@@:
17006     For Perl binding, any parameter that accepts
17007     a <Class::ManakaiDOMInputFile> would also accept a Perl hash reference.
17008     If a hash reference is given to parameter that expects
17009     a <Class::ManakaiDOMInputFile> object, then it
17010     bless the hash with the class.
17011    
17012     Each attributes defined
17013     in the class is associated to the hash value with the
17014     key equals to the attribut name. Each method defined in
17015     the class will invoke the code reference retrieved
17016     from the hash by the key equals to the method name.
17017    
17018     If there is no value in the hash for an attribute,
17019     then its value is <DOM::null>.
17020    
17021     @ResourceDef:
17022     @@rdf:type: DISLang|InputProcessor
17023     @@rdf:type: DISLang|OutputProcessor
17024     @@PerlDef:
17025     $INPUT = bless $INPUT, <ClassName::ManakaiDOMInputFile>
17026     if ref $INPUT eq 'HASH';
17027    
17028     @Attr:
17029     @@Name: filehandle
17030     @@Type: DISPerl|filehandle||ManakaiDOM|all
17031     @@enDesc:
17032     The input filehandle.
17033    
17034     It <kwd:MUST> be an <Perl::open>ed (and not <Perl::close>d)
17035     filehandle. Note that
17036     it does not have to be associated with an actual file
17037     in the local file system.
17038    
17039     It <kwd:MUST> return a character (rather than byte)
17040     by <Perl::getc>.
17041     @@Get:
17042     @@@PerlDef: $r = $self->{filehandle};
17043     @@Set:
17044     @@@PerlDef: $self->{filehandle} = $given;
17045    
17046     @Attr:
17047     @@Name: baseURI
17048     @@enDesc:
17049     The base URI of the input.
17050    
17051     It <kwd:MUST> be an absolute DOM URI or <DOM::null>.
17052     Otherwise, the result is undefined.
17053     @@Type: DOMString
17054     @@nullCase:
17055     @@@enDesc:
17056     If the base URI is not available.
17057     @@Get:
17058     @@@PerlDef: $r = $self->{base_uri};
17059     @@Set:
17060     @@@PerlDef: $self->{base_uri} = $given;
17061    
17062     @Attr:
17063     @@Name: documentURI
17064     @@enDesc:
17065     The URI of the document.
17066    
17067     It <kwd:MUST> be an absolute DOM URI or <DOM::null>.
17068     Otherwise, the result is undefined.
17069     @@Type: DOMString
17070     @@nullCase:
17071     @@@enDesc:
17072     If the document URI is not available.
17073     @@Get:
17074     @@@PerlDef: $r = $self->{document_uri};
17075     @@Set:
17076     @@@PerlDef: $self->{document_uri} = $given;
17077    
17078     @Method:
17079     @@Name: close
17080     @@enDesc:
17081     Closes the file.
17082    
17083     Since when the Perl's destructor is invoked is unreliable,
17084     this method is explicitly called when the file is no longer
17085     in use.
17086    
17087     If the <Class::ManakaiDOMInputFile> is given as a hash
17088     reference and whose value for <CODE::close> is not defined,
17089     then the statement <Perl::close $filehandle> is done
17090     (where <Perl::$filehandle> is the <A::ManakaiDOMInputFile.filehandle>
17091     value).
17092     @@Return:
17093     @@@PerlDef:
17094     __DEEP{
17095     if ($self->{close}) {
17096     $self->{close}->($self);
17097     } else {
17098     close $self->{filehandle};
17099     }
17100     }__;
17101     ##ManakaiDOMInputFile
17102    
17103    
17104    

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24