/[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.48 - (hide annotations) (download)
Sun Dec 31 09:11:56 2006 UTC (17 years, 10 months ago) by wakaba
Branch: MAIN
Changes since 1.47: +494 -492 lines
++ manakai/bin/ChangeLog	31 Dec 2006 08:49:16 -0000
2006-12-31  Wakaba  <wakaba@suika.fam.cx>

	* daf.pl: Support for |For| is entirely removed.

++ manakai/lib/Message/Util/ChangeLog	31 Dec 2006 09:06:08 -0000
	* DIS.dis: Support for |for| is entirely removed.  |forArg|
	parameters are removed.
	(createDISDocument): Removed.
	(tfurisToURI): Removed.
	(tfpurisToURI): The |for| URI slot is
	fixed to |ManakaiDOM:all|.
	(tfqnamesToURI): Removed.
	(tfpqnamesToURI): The |defaultForURI| parameter
	is removed and the |for| URI slot is
	fixed to |ManakaiDOM:all|.
	(forURI): Removed.
	(forMatch): The first parameter, |forArg|, no
	longer takes effect.

	* PerlCode.dis (sourceFor): Removed.
	(stringify): Don't output comment with |sourceFor| URI.

2006-12-31  Wakaba  <wakaba@suika.fam.cx>

++ manakai/lib/Message/Util/Error/ChangeLog	31 Dec 2006 09:09:24 -0000
2006-12-31  Wakaba  <wakaba@suika.fam.cx>

	* Core.dis, DOMException.dis: |dis:dataType|
	of |DISCore:TFQNames| are replaced
	by |DISCore:QName|.

++ manakai/lib/Message/Util/DIS/ChangeLog	31 Dec 2006 09:08:40 -0000
	* DNLite.dis, Perl.dis: Support for |for| is entirely removed.

	* Test.dis (parseTDTErrorString): The |defaultTURI|
	and |defaultFURI| parameters are removed.
	(lexmode): |TFQNames| token type is removed.
	(tdterr): Accepts |QName| where |TFQNames| was accepted.

2006-12-31  Wakaba  <wakaba@suika.fam.cx>

++ manakai/lib/Message/DOM/ChangeLog	31 Dec 2006 08:50:54 -0000
	* |InputProcessor|s and |OutputProcessor|s are
	named so that |report| statements in Perl
	module outputs can be identified by name. |dis:dataType|s
	of |DISCore:TFQNames| are all replaced
	by |DISCore:QName|.

2006-12-31  Wakaba  <wakaba@suika.fam.cx>

++ manakai/lib/manakai/ChangeLog	31 Dec 2006 09:11:27 -0000
	* |dis:dataType| of |DISCore:TFQNames| are replaced
	by |DISCore:QName|.

	* DISCore.dis (DISCore:TFURI): Removed.
	(DISCore:ModuleTFQNames): Removed.

	* daf-dtd-modules.pl: Support for |for| is removed.

2006-12-31  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.48 $Date: 2006/12/30 12:00:40 $
14 wakaba 1.1
15     @Require:
16     @@Module:
17     @@@QName: MDOM|DOMLS
18 wakaba 1.6 @@Module:
19 wakaba 1.35 @@@QName: MDOM|XML
20     @@Module:
21 wakaba 1.6 @@@QName: MDOM|XDoctype
22 wakaba 1.37 @@Module:
23     @@@QName: MCharset|Encode
24 wakaba 1.1
25     Namespace:
26 wakaba 1.8 @c:
27     http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#
28 wakaba 1.11 @cfg:
29     http://suika.fam.cx/www/2006/dom-config/
30 wakaba 1.37 @cs:
31     http://suika.fam.cx/~wakaba/archive/2004/dis/Charset/
32 wakaba 1.6 @d:
33     http://suika.fam.cx/~wakaba/archive/2004/dom/xdt#
34 wakaba 1.1 @dis:
35     http://suika.fam.cx/~wakaba/archive/2004/8/18/lang#dis--
36 wakaba 1.5 @dtest:
37     http://suika.fam.cx/~wakaba/archive/2005/manakai/Util/DIS#Test/
38 wakaba 1.1 @dx:
39     http://suika.fam.cx/~wakaba/archive/2005/manakai/Util/Error/DOMException#
40     @ecore:
41     http://suika.fam.cx/~wakaba/archive/2005/manakai/Util/Error/Core/
42     @f:
43     http://suika.fam.cx/~wakaba/archive/2004/dom/feature#
44 wakaba 1.11 @fe:
45     http://suika.fam.cx/www/2006/feature/
46     @gls:
47     http://suika.fam.cx/~wakaba/archive/2004/dom/gls#
48 wakaba 1.1 @idl:
49     http://suika.fam.cx/~wakaba/archive/2004/dis/IDL#
50     @infoset:
51     http://www.w3.org/2001/04/infoset#
52     @lang:
53     http://suika.fam.cx/~wakaba/archive/2004/8/18/lang#
54     @license:
55     http://suika.fam.cx/~wakaba/archive/2004/8/18/license#
56     @LSEV:
57     http://www.w3.org/2002/DOMLS
58     @ManakaiDOM:
59     http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom#
60     @ManakaiDOMLS:
61     http://suika.fam.cx/~wakaba/archive/2004/mdom-ls#
62 wakaba 1.37 @MCharset:
63     http://suika.fam.cx/~wakaba/archive/2005/manakai/Charset/
64     @mce:
65     http://suika.fam.cx/~wakaba/archive/2005/manakai/Charset/Encode/
66 wakaba 1.1 @MDOM:
67     http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom#ManakaiDOM.
68     @MDOMX:
69     http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#
70     @rdf:
71     http://www.w3.org/1999/02/22-rdf-syntax-ns#
72     @rdfs:
73     http://www.w3.org/2000/01/rdf-schema#
74     @t:
75     http://suika.fam.cx/~wakaba/archive/2004/dom/tree#
76 wakaba 1.35 @tc:
77     http://suika.fam.cx/~wakaba/archive/2005/manakai/DOM/TreeCore/
78     @td:
79     http://suika.fam.cx/~wakaba/archive/2005/manakai/DOM/Document/
80     @te:
81     http://suika.fam.cx/~wakaba/archive/2005/manakai/DOM/Element/
82 wakaba 1.5 @test:
83     http://suika.fam.cx/~wakaba/archive/2004/dis/Test#
84 wakaba 1.35 @tx:
85     http://suika.fam.cx/~wakaba/archive/2005/manakai/DOM/XML/
86 wakaba 1.29 @urigen:
87     http://suika.fam.cx/~wakaba/archive/2005/manakai/URI/Generic/
88 wakaba 1.8 @x:
89     http://suika.fam.cx/~wakaba/archive/2004/dom/xml#
90 wakaba 1.1 @xml:
91     http://www.w3.org/XML/1998/namespace
92 wakaba 1.37 @xml-auto-charset:
93     http://suika.fam.cx/www/2006/03/xml-entity/
94 wakaba 1.9 @xml-dtd:
95     http://www.w3.org/TR/REC-xml
96 wakaba 1.1 @xmlns:
97     http://www.w3.org/2000/xmlns/
98     @xp:
99     http://suika.fam.cx/~wakaba/archive/2004/dom/xml-parser#
100    
101     ## -- Features
102    
103     ElementTypeBinding:
104     @Name: FeatureDef
105     @ElementType:
106     dis:ResourceDef
107     @ShadowContent:
108     @@rdf:type: f|Feature
109    
110     ElementTypeBinding:
111     @Name: FeatureVerDef
112     @ElementType:
113     dis:ResourceDef
114     @ShadowContent:
115     @@rdf:type: f|Feature
116    
117     ElementTypeBinding:
118     @Name: featureQName
119     @ElementType:
120     f:name
121     @ShadowContent:
122     @@ContentType: DISCore|QName
123    
124     ResourceDef:
125     @QName: DOMString
126     @AliasFor: DOMMain|DOMString
127    
128     ResourceDef:
129     @QName: Node
130 wakaba 1.35 @AliasFor: tc|Node
131 wakaba 1.1
132     ResourceDef:
133     @QName: Element
134 wakaba 1.35 @AliasFor: te|Element
135    
136     ResourceDef:
137     @QName: Attr
138     @AliasFor: te|Attr
139 wakaba 1.1
140     ResourceDef:
141     @QName: Document
142 wakaba 1.35 @AliasFor: td|Document
143 wakaba 1.1
144 wakaba 1.6 ResourceDef:
145     @QName: DocumentXDoctype
146     @AliasFor: d|DocumentXDoctype
147    
148 wakaba 1.8 ResourceDef:
149     @QName: DTDef
150     @AliasFor: d|DocumentTypeDefinition
151    
152     ResourceDef:
153     @QName: ETDef
154     @AliasFor: d|ElementTypeDefinition
155    
156     ResourceDef:
157     @QName: ATDef
158     @AliasFor: d|AttributeDefinition
159    
160 wakaba 1.35 ResourceDef:
161     @QName: GE
162     @AliasFor: tx|Entity
163    
164     ResourceDef:
165     @QName: GERef
166     @AliasFor: tx|EntityReference
167    
168 wakaba 1.1 ElementTypeBinding:
169     @Name: ClsDef
170     @ElementType:
171     dis:ResourceDef
172     @ShadowContent:
173     @@rdf:type:
174     @@@@: dis|MultipleResource
175     @@@ForCheck: !ManakaiDOM|ForIF !ManakaiDOM|ForClass
176     @@resourceFor:
177     @@@@: ManakaiDOM|ForClass
178    
179     @@rdf:type:
180     @@@@: DISLang|Class
181     @@@ForCheck: ManakaiDOM|ForClass
182    
183     ElementTypeBinding:
184     @Name: ClsQName
185     @ElementType:
186     dis:QName
187     @ShadowContent:
188     @@ForCheck: ManakaiDOM|ForClass
189    
190     ElementTypeBinding:
191     @Name: ClsISA
192     @ElementType:
193     dis:ISA
194     @ShadowContent:
195     @@ForCheck: ManakaiDOM|ForClass
196    
197     ElementTypeBinding:
198     @Name: nullCase
199     @ElementType:
200     dis:ResourceDef
201     @ShadowContent:
202     @@rdf:type: ManakaiDOM|InCase
203     @@Value:
204     @@@is-null:1
205    
206 wakaba 1.27 ElementTypeBinding:
207     @Name: TrueCase
208     @ElementType:
209     dis:ResourceDef
210     @ShadowContent:
211     @@rdf:type:
212     ManakaiDOM:InCase
213     @@Value:
214     @@@@: 1
215     @@@ContentType: DISCore|Boolean
216 wakaba 1.47 @@Type: idl|boolean
217 wakaba 1.27
218     ElementTypeBinding:
219     @Name: FalseCase
220     @ElementType:
221     dis:ResourceDef
222     @ShadowContent:
223     @@rdf:type:
224     ManakaiDOM:InCase
225     @@Value:
226     @@@@: 0
227     @@@ContentType: DISCore|Boolean
228 wakaba 1.47 @@Type: idl|boolean
229 wakaba 1.27
230 wakaba 1.1 ResourceDef:
231     @QName: LSParser
232     @AliasFor: DOMLS|LSParser
233    
234     ClsDef:
235     @ClsQName: ManakaiXMLParser
236    
237     @Implement: DOMLS|LSParser
238    
239 wakaba 1.28 @f:implements: DOMLS|LSFeature30
240     @f:implements: DOMLS|ParseString10
241     @enImplNote:
242     @@ddid: dtdfeature
243     @@@:
244     {TODO::
245     Once DTD validation is implemented, add <Q::f:implements>
246     for XML-DTD-feature.
247     }
248 wakaba 1.1
249 wakaba 1.11 @DISLang:role: gls|ParserRole
250 wakaba 1.1
251 wakaba 1.3 @enDesc:
252     Note that the <Class::ManakaiXMLParser> reports any XML errors
253     (syntax errors and / or well-formedness constraint errors)
254     via the <IF::DOMCore:error-handler> registered to
255     the <A::DOMLS:LSParser.domConfig> object. Each error has
256     its <A::DOMCore:DOMError.severity>, either <C::DOMCore:SEVERITY_ERROR>
257     or <C::DOMCore:SEVERITY_FATAL_ERROR>. However, their semantics
258     are slight different from the ones of <QUOTE::error> and
259     <QUOTE::fatal error> in XML; in this implemenetation,
260     <C::DOMCore:SEVERITY_ERROR> implies that the parsing process
261     can effectively be continued to detect more errors while
262     <C::DOMCore:SEVERITY_FATAL_ERROR> implies that the error
263     is serious so that the result document tree and any errors
264     might be far from the ones obtained when the error would not
265     be found.
266 wakaba 1.28
267     @Test:
268     @@QName: GLSImpl.createGLSParser.LS.test
269     @@enDesc:
270     Since there is at least one implementation of the feature (i.e.
271     this class), the <M::gls|GLSImplementation.createGLSParser>
272     must not throw an exception.
273     @@PerlDef:
274     my $impl;
275     __CODE{DOMLS|createImplForTest:: $impl => $impl}__;
276    
277     my $p = $impl-><M::gls|GLSImplementation.createGLSParser>
278     ({LS => '3.0'});
279    
280     $test->assert_isa ($p, <IFName::LSParser>);
281     @Test:
282     @@QName: GLSImpl.createGLSParser.ParseXMLString.test
283     @@enDesc:
284     Since there is at least one implementation of the feature (i.e.
285     this class), the <M::gls|GLSImplementation.createGLSParser>
286     must not throw an exception.
287     @@PerlDef:
288     my $impl;
289     __CODE{DOMLS|createImplForTest:: $impl => $impl}__;
290    
291     my $p = $impl-><M::gls|GLSImplementation.createGLSParser>
292     ({<Q::fe|ParseXMLString> => '1.0'});
293    
294     $test->assert_not_null ($p);
295     @Test:
296     @@QName: GLSImpl.createGLSParser.LS.ParseXMLString.test
297     @@enDesc:
298     Since there is at least one implementation of the feature (i.e.
299     this class), the <M::gls|GLSImplementation.createGLSParser>
300     must not throw an exception.
301     @@PerlDef:
302     my $impl;
303     __CODE{DOMLS|createImplForTest:: $impl => $impl}__;
304    
305     my $p = $impl-><M::gls|GLSImplementation.createGLSParser>
306     ({LS => '3.0', <Q::fe|ParseXMLString> => '1.0'});
307    
308     $test->assert_isa ($p, <IFName::LSParser>);
309    
310     @Test:
311     @@QName: DOMImplLS.createLSParser.1.test
312     @@enDesc:
313     Since there is at least one implementation of the feature (i.e.
314     this class), the <M::gls|GLSImplementation.createGLSParser>
315     must not throw an exception.
316     @@PerlDef:
317     my $impl;
318     __CODE{DOMLS|createImplForTest:: $impl => $impl}__;
319    
320     my $p = $impl-><M::DOMLS|DOMImplementationLS.createLSParser>
321     (<C::DOMLS|DOMImplementationLS.MODE_SYNCHRONOUS>);
322     $test->assert_isa ($p, <IFName::LSParser>);
323     @enImplNote:
324     @@ddid: lsparsertext
325     @@@:
326     Future version should add test:
327     @@QName: DOMImplLS.createLSParser.2.test
328     @@enDesc:
329     Since there is at least one implementation of the feature (i.e.
330     this class), the <M::gls|GLSImplementation.createGLSParser>
331     must not throw an exception.
332     @@PerlDef:
333     my $impl;
334     __CODE{DOMLS|createImplForTest:: $impl => $impl}__;
335    
336     my $p = $impl-><M::DOMLS|DOMImplementationLS.createLSParser>
337     (<C::DOMLS|DOMImplementationLS.MODE_SYNCHRONOUS>,
338     <Q::xml-dtd:>);
339     $test->assert_isa ($p, <IFName::LSParser>);
340 wakaba 1.3
341 wakaba 1.27 @Test:
342     @@QName: Perl.open.utf8.strref.1.test
343     @@enDesc:
344     Does PerlIO works as intended?
345     @@PerlDef:
346     my $s = qq<\x{3001}\x0A\x{10001}>;
347     #open my $a, '<'.':utf8', \$s;
348     require IO::String;
349     my $a = IO::String->new ($s);
350     $test->assert_num_equals
351     (actual_value => ord getc $a,
352     expected_value => 0x3001);
353     $test->assert_num_equals
354     (actual_value => ord getc $a,
355     expected_value => 0x000A);
356     $test->assert_num_equals
357     (actual_value => ord getc $a,
358     expected_value => 0x10001);
359     $a->ungetc (0x10001);
360     $test->assert_num_equals
361     (actual_value => ord getc $a,
362     expected_value => 0x10001);
363     $test->assert_null (getc $a);
364     close $a;
365     @Test:
366     @@QName: Perl.open.8859.strref.2.test
367     @@enDesc:
368     Does PerlIO works as intended?
369     @@PerlDef:
370     my $s = qq<\x{0080}\x0A\x{00A9}>;
371     #open my $a, '<', \$s;
372     require IO::String;
373     my $a = IO::String->new ($s);
374     $test->assert_num_equals
375     (actual_value => ord getc $a,
376     expected_value => 0x0080);
377     $test->assert_num_equals
378     (actual_value => ord getc $a,
379     expected_value => 0x000A);
380     $test->assert_num_equals
381     (actual_value => ord getc $a,
382     expected_value => 0x00A9);
383     $a->ungetc (0x00A9);
384     $test->assert_num_equals
385     (actual_value => ord getc $a,
386     expected_value => 0x00A9);
387     $test->assert_null (getc $a);
388     close $a;
389    
390 wakaba 1.1 @Attr:
391     @@Name: domConfig
392     @@enDesc:
393     The configuration of the parser.
394    
395     @@Get:
396     @@@Type: DOMCore|DOMConfiguration
397     @@@enDesc: The DOM configuration object.
398     @@@PerlDef:
399     __CODE{DOMCore|getConfigObject::
400     $target => $self,
401     $targetHash => $self,
402 wakaba 1.27 $targetType => {<ClassName::xp|ManakaiXMLParser>},
403 wakaba 1.1 $result => $r,
404     }__;
405    
406 wakaba 1.27 @Attr:
407     @@ForCheck: ManakaiDOM|ForClass
408     @@Name: async
409     @@enDesc:
410     Whether the parser is asynchronous or not.
411 wakaba 1.47 @@Type: idl|boolean
412 wakaba 1.27 @@Get:
413     @@@FalseCase:
414     @@@@enDesc:
415     The parser does not in asynchronous mode.
416     @@@PerlDef: \
417     @@Test:
418     @@@QName: XMLParser.async.test
419     @@@PerlDef:
420     my $xp;
421     __CODE{createParserForTest:: $xp => $xp}__;
422    
423     $test->assert_false ($xp-><AG::DOMLS|LSParser.async>);
424    
425     @Attr:
426     @@ForCheck: ManakaiDOM|ForClass
427     @@Name: busy
428     @@enDesc:
429     Whether the parser is currently busy loading a document or not.
430 wakaba 1.47 @@Type: idl|boolean
431 wakaba 1.27 @@Get:
432     @@@TrueCase:
433     @@@@enDesc:
434     The parser is currently busy.
435     @@@FalseCase:
436     @@@@enDesc:
437     The parser is not busy.
438     @@@PerlDef:
439     $r = $self->{<H::DOMLS|busy>};
440    
441     @enImplNote:
442     @@ddid: abort
443     @@@:
444     {ISSUE::
445     LSParser.abort:
446    
447     Is it required to support even in synchronous mode?
448     }
449    
450     {TODO::
451     LSParser.filter
452     }
453    
454     @ResourceDef:
455     @@QName: createParserForTest
456     @@ForCheck: ManakaiDOM|ForClass
457     @@rdf:type: DISPerl|BlockCode
458     @@PerlDef:
459     require Message::DOM::GenericLS;
460     $xp = <Class::ManakaiXMLParser>
461 wakaba 1.40 ->new (<Class::c|ManakaiDOMImplementation>->_new, '');
462 wakaba 1.27
463 wakaba 1.1 @Method:
464     @@ManakaiDOM:isForInternal:1
465     @@ForCheck: ManakaiDOM|ForClass
466     @@Operator: DISPerl|NewMethod
467     @@enDesc:
468     Creates a new instance of the object.
469     @@Param:
470     @@@Name: impl
471 wakaba 1.11 @@@Type: gls|GLSImplementation
472 wakaba 1.1 @@@enDesc:
473     The implementation from which the parser is created.
474     @@Param:
475     @@@Name: features
476     @@@Type: DOMString
477     @@@dis:actualType: f|FeaturesString
478     @@@enDesc:
479     The set of features requested for the parser.
480     @@Return:
481     @@@Type: DOMMain|DOMObject
482     @@@dis:actualType: LSParser
483     @@@enDesc:
484     The newly created parser.
485     @@@PerlDef:
486     $r = bless {
487 wakaba 1.35 <H::f|implementation> => $impl,
488 wakaba 1.1 }, $self;
489    
490     @Method:
491 wakaba 1.27 @@Name: parseURI
492     @@enDesc:
493     Parses an XML document identified by a DOM URI.
494 wakaba 1.1
495 wakaba 1.27 It is equivalent to <M::.parse> method with its <P::input>
496     parameter set to a <IF::LSInput> object whose
497     <A::LSInput.systemId> set to <P::uri>.
498 wakaba 1.1 @@Param:
499 wakaba 1.27 @@@Name: uri
500 wakaba 1.1 @@@Type: DOMString
501 wakaba 1.27 @@@enDesc:
502     The DOM URI of the XML document to be read.
503 wakaba 1.1 @@Return:
504     @@@Type: Document
505 wakaba 1.27 @@@enDesc:
506     The newly created and populated <IF::Document> node.
507     @@@dx:raises:
508     @@@@@: ManakaiDOMLS|MDOMLS_BUSY
509     @@@@enDesc:
510     If <A::LSParser.busy> is <DOM::true>.
511     @@@dx:raises:
512     @@@@@: DOMLS|PARSE_ERR
513     @@@@enDesc:
514     If the <IF::LSParser> was unable to load the document.
515     @@@PerlDef:
516     __DEEP{
517     $r = $self-><M::LSParser.parse> ({system_id => $uri});
518     }__;
519    
520     @Method:
521     @@Name: parse
522     @@enDesc:
523     Parses an XML document from a resource identified
524     by a <IF::LSInput>.
525     @@Param:
526     @@@Name: input
527     @@@Type: LSInput
528     @@@enDesc:
529     The <IF::LSInput> from which the source of the document
530     is to be read.
531     @@Return:
532     @@@Type: Document
533     @@@enDesc:
534     The newly created and populated <IF::Document> node.
535     @@@dx:raises:
536     @@@@@: ManakaiDOMLS|MDOMLS_BUSY
537     @@@@enDesc:
538     If the <A::LSParser.busy> is <DOM::true>.
539     @@@dx:raises:
540     @@@@@: DOMLS|PARSE_ERR
541     @@@@enDesc:
542     If the <IF::LSParser> was unable to load the document.
543 wakaba 1.1 @@@PerlDef:
544 wakaba 1.27 if ($self->{<H::DOMLS|busy>}) {
545     __EXCEPTION{ManakaiDOMLS|MDOMLS_BUSY}__;
546     }
547     local $self->{<H::DOMLS|busy>} = true;
548    
549     my $in;
550     __DEEP{
551     $self->{parser_cfg} = $self-><AG::LSParser.domConfig>;
552     ## Parser's |domConfig| object.
553     $self->{in_in} = $self->{parser_cfg}
554     -><M::c|DOMConfiguration.getParameter>
555     (<Q::xp|ls-input-to-input-file>);
556     $in = $self->{in_in}-><M::ManakaiDOMLSInputToInputFile.resolveLSInput>
557 wakaba 1.37 ($self->{<H::f|implementation>}, $input,
558     $self,
559 wakaba 1.27 $self->{parser_cfg}
560     -><M::c|DOMConfiguration.getParameter>
561     ('error-handler'));
562     }__;
563     unless (defined $in) {
564     __c|ERROR{DOMLS|no-input-specified::
565     MDOMX:param-name => 'input',
566     }__;
567     __CODE{ParseError}__;
568     }
569    
570     require IO::Handle;
571 wakaba 1.1
572     $self->{char} = [];
573     $self->{token} = [];
574 wakaba 1.6 $self->{entity} = [{
575 wakaba 1.27 fh => $in-><AG::ManakaiDOMInputFile.filehandle>,
576     base_uri => $in-><AG::ManakaiDOMInputFile.baseURI>,
577     doc_uri => $in-><AG::ManakaiDOMInputFile.documentURI>,
578 wakaba 1.37 in_enc => $in-><AG::ManakaiDOMInputFile.inputEncoding>,
579 wakaba 1.6 line => 1,
580     column => 1,
581     pos => 0,
582 wakaba 1.27 close_file => sub { $in-><M::ManakaiDOMInputFile.close> },
583     reptxt => \'',
584     is_external_entity => true,
585 wakaba 1.6 }];
586 wakaba 1.27 ## Entity stack.
587 wakaba 1.14 $self->{location} = $self->{entity}->[-1];
588 wakaba 1.27 ## Parsing location object as required by DPG.
589     ## It must always be equal to |{entity}->[-1]|.
590 wakaba 1.6 $self->{entity_char} = [];
591 wakaba 1.27 ## Stack for |{char}| stacks analog to |{entity}| stack.
592 wakaba 1.6 $self->{entity_token} = [];
593 wakaba 1.27 ## Stack for |{token}| stacks analog to |{entity}| stack.
594 wakaba 1.3 $self->{xml_version} = '1.0';
595 wakaba 1.27 ## Document XML version: either |1.0| or |1.1|.
596 wakaba 1.3 $self->{standalone} = false;
597 wakaba 1.27 ## True iff |standalone=yes| is explicitly specified.
598 wakaba 1.19 $self->{has_xref} = false;
599 wakaba 1.27 ## There is an unread external entity.
600     $self->{dont_process} = false;
601     ## So, don't process |ENTITY| and |ATTLIST| declarations.
602 wakaba 1.11 $self->{general_entity} = {
603     lt => {is_predefined => true},
604     gt => {is_predefined => true},
605     amp => {is_predefined => true},
606     quot => {is_predefined => true},
607     apos => {is_predefined => true},
608     };
609 wakaba 1.27 ## Declared general entities.
610 wakaba 1.6 $self->{param_entity} = {};
611 wakaba 1.27 ## Declared parameter entities.
612 wakaba 1.9 $self->{attr} = {};
613     # $self->{attr}->{$element_type_name}->{$attr_name} = $attr_def
614 wakaba 1.27 ## Declared attributes.
615 wakaba 1.1
616     __DEEP{
617 wakaba 1.35 $r = $self->{<H::f|implementation>}-><M::DOMImpl.createDocument>;
618 wakaba 1.11 $self->{doc} = $r;
619 wakaba 1.27 ## |Document| object.
620     CORE::delete $self->{docx};
621     ## |DocumentXDoctype| object (if necessary).
622 wakaba 1.21 $self->{doc_cfg} = $r-><AG::Document.domConfig>;
623 wakaba 1.27 ## |Document|'s configuration.
624 wakaba 1.11 CORE::delete $self->{dtdef};
625 wakaba 1.27 ## |DocumentTypeDefinition| object (if created).
626 wakaba 1.17 CORE::delete $self->{dtdecl};
627 wakaba 1.27 ## |DocumentTypeDeclaration| object (if created).
628 wakaba 1.21
629     $r-><AS::Document.strictErrorChecking> (false);
630     ## NOTE: Any checks such as |Name| validity done by
631     ## methods on DOM nodes are disabled. It might result
632     ## in creating an ill-formed DOM tree when parser
633     ## errors are traped by |error-handler|.
634     $self->{doc_cfg}-><M::c|DOMConfiguration.setParameter>
635     (<Q::cfg|clone-entity-reference-subtree> => true);
636     ## NOTE: Turn this configuration parameter on makes
637     ## entity reference subtrees in attribute default values
638     ## cloned as is into default attribute node subtrees.
639 wakaba 1.26 $self->{doc_cfg}-><M::c|DOMConfiguration.setParameter>
640 wakaba 1.36 (<Q::cfg|dtd-default-attribute> => false);
641 wakaba 1.26 ## NOTE: Don't create DTD default attributes by
642     ## |createElementNS| method.
643     $self->{doc_cfg}-><M::c|DOMConfiguration.setParameter>
644 wakaba 1.30 (<Q::cfg|xml-id> => $self->{parser_cfg}
645     -><M::c|DOMConfiguration.getParameter>
646     (<Q::cfg|xml-id>));
647     $self->{doc_cfg}-><M::c|DOMConfiguration.setParameter>
648 wakaba 1.26 ('error-handler' => sub {
649     my (undef, $err) = @_;
650     return ($err-><AG::c|DOMError.severity> !=
651     <C::c|DOMError.SEVERITY_FATAL_ERROR>);
652     })
653     unless $Message::DOM::XMLParser::DEBUG;
654 wakaba 1.29 ## NOTE: The default error handler in manakai |warn|s error
655 wakaba 1.26 ## description.
656 wakaba 1.11
657 wakaba 1.29 ## Document entity's URI and base URI
658     $r-><AS::Document.documentURI> ($self->{entity}->[0]->{doc_uri});
659     $r-><AS::Document.manakaiEntityBaseURI>
660     ($self->{entity}->[0]->{base_uri});
661    
662 wakaba 1.37 ## Encoding name
663     $r-><AS::Document.inputEncoding> ($self->{entity}->[0]->{in_enc});
664    
665 wakaba 1.11 ## Document entity -> |Document| node
666     $self->_parse_DocumentEntity;
667    
668 wakaba 1.27 for (@{$self->{entity}}) {
669     $_->{close_file}->();
670     ## NOTE: There should be only the document entity.
671     }
672    
673 wakaba 1.11 ## Replacement tree for general |Entity| nodes
674 wakaba 1.34 if ($self->{parser_cfg}-><M::c|DOMConfiguration.getParameter>
675     (<Q::cfg|entity-replacement-tree>)) {
676     my @ent = values %{$self->{general_entity}};
677     for my $ent (@ent) {
678     if (exists $ent->{has_replacement_text}) {
679 wakaba 1.11 my $ent_name = $ent->{name};
680     $self->{entity} = [<Code::getCopyOfEntityState::
681     $entity_type = 'general_entity',
682     $entity_name = $ent_name>];
683 wakaba 1.14 $self->{location} = $self->{entity}->[-1];
684 wakaba 1.11 $self->{token} = [];
685     $self->{char} = [];
686 wakaba 1.23 local $ent->{is_opened} = true;
687 wakaba 1.11 ## TODO: External entity support
688 wakaba 1.35 $ent->{node}-><M::Node.manakaiSetReadOnly> (false, true);
689 wakaba 1.11 $self->_parse_InternalGeneralParsedEntity ($ent->{node});
690 wakaba 1.35 $ent->{node}-><AS::GE.hasReplacementTree> (true);
691     $ent->{node}-><M::Node.manakaiSetReadOnly> (true, true);
692 wakaba 1.27 $self->{entity}->[-1]->{close_file}->();
693 wakaba 1.35 ## ISSUE: Should errors detected by this phase result
694     ## in |DOMLS:PARSE_ERR| exception thrown?
695     }
696 wakaba 1.34 }
697     } # cfg|entity-replacement-tree
698 wakaba 1.11
699 wakaba 1.21 ## Turns flags to their default value
700     $self->{doc_cfg}-><M::c|DOMConfiguration.setParameter>
701     (<Q::cfg|clone-entity-reference-subtree> => null);
702 wakaba 1.26 $self->{doc_cfg}-><M::c|DOMConfiguration.setParameter>
703 wakaba 1.36 (<Q::cfg|dtd-default-attribute> => null);
704 wakaba 1.26 $self->{doc_cfg}-><M::c|DOMConfiguration.setParameter>
705 wakaba 1.30 (<Q::cfg|xml-id> => null);
706     $self->{doc_cfg}-><M::c|DOMConfiguration.setParameter>
707 wakaba 1.26 ('error-handler' => null);
708 wakaba 1.11 $r-><AS::Document.strictErrorChecking> (true);
709 wakaba 1.1 }__;
710    
711     @Method:
712     @@Name: shiftChar
713     @@ManakaiDOM:isForInternal:1
714     @@ForCheck: ManakaiDOM|ForClass
715     @@enDesc:
716     Returns the next character.
717     @@Return:
718 wakaba 1.47 @@@Type: idl|long
719 wakaba 1.1 @@@enDesc:
720     The code position number of the next character, if any,
721 wakaba 1.6 or <CODE::-1>.
722 wakaba 1.1 @@@PerlDef:
723     if (@{$self->{char}}) {
724     $r = shift @{$self->{char}};
725     } else {
726 wakaba 1.6 GETCHAR: {
727 wakaba 1.27 no warnings 'closed'; # getc() on closed filehandle warning
728     my $ent = $self->{entity}->[-1];
729 wakaba 1.32 my $char = $ent->{fh}->getc;
730 wakaba 1.6
731 wakaba 1.7 if (defined $char and length $char) {
732 wakaba 1.27 $ent->{pos}++;
733 wakaba 1.6 $r = ord $char;
734     if ($r == 0x000A) {
735 wakaba 1.27 $ent->{line}++;
736     $ent->{column} = 1;
737 wakaba 1.6 } elsif ($r == 0x000D) {
738 wakaba 1.32 my $next_char = $ent->{fh}->getc;
739 wakaba 1.6 if ($next_char eq "\x0A") {
740 wakaba 1.27 if ($ent->{is_external_entity}) {
741     $ent->{pos}++;
742     $ent->{line}++;
743     $ent->{column} = 1;
744     $r = 0x000A; # ^ U+000D U+000A -> U+000A ^
745     } else { # Internal entity
746     $ent->{column}++;
747     ## Line number will be increased by next |shiftChar|.
748     $ent->{fh}->ungetc (0x000A);
749     #$r = 0x000D; # ^ U+000D U+000A -> U+000D ^ U+000A
750     # no change
751     }
752 wakaba 1.6 } elsif ($next_char eq "\x85") {
753     if ($self->{xml_version} eq '1.1') {
754 wakaba 1.27 if ($ent->{is_external_entity}) {
755     if ($ent->{no_xml11_eol}) {
756     my $location = {
757     utf32_offset => $ent->{pos} - 1,
758     line_number => $ent->{line},
759     column_number => $ent->{column},
760     };
761     my $continue = __c|ERROR{
762     xp|fatal-xml11-end-of-line-in-xml-declaration::
763     c|location => {$location},
764     xp|character-number => {$r},
765     }__;
766     unless ($continue) {
767     __CODE{ParseError}__;
768     }
769     } # no_xml11_eol
770     $ent->{pos}++;
771     $ent->{line}++;
772     $ent->{column} = 1;
773     $r = 0x000A; # ^ U+000D U+0085 -> U+000A ^
774     } else { # internal entity
775     $ent->{column}++;
776     ## Line number will be increased by next |shiftChar|.
777     $ent->{fh}->ungetc (0x0085);
778     #$r = 0x000D; # ^ U+000D U+0085 -> U+000D ^ U+0085
779     # no change
780     }
781     } else { # XML 1.0
782 wakaba 1.16 ## |no_xml11_eol| will be tested later.
783 wakaba 1.27 $ent->{column}++;
784     ## Line number will be increased by next |shiftChar|.
785     $ent->{fh}->ungetc (0x0085);
786     $r = 0x000A if $ent->{is_external_entity};
787     # external: ^ U+000D U+0085 -> U+000A ^ U+0085
788     # internal: ^ U+000D U+0085 -> U+000D ^ U+0085 (as is)
789 wakaba 1.6 }
790 wakaba 1.27 } else { # neither U+000A nor U+0085
791     $ent->{line}++;
792     $ent->{column} = 1;
793     $ent->{fh}->ungetc (ord $next_char);
794     $r = 0x000A if $ent->{is_external_entity};
795     # external: ^ U+000D _ -> U+000A ^ _
796     # internal: ^ U+000D _ -> U+000D ^ _ (as is)
797 wakaba 1.6 }
798 wakaba 1.27 } elsif ($r == 0x0085 or $r == 0x2028) {
799     if ($ent->{no_xml11_eol}) {
800     my $location = {
801     utf32_offset => $ent->{pos} - 1,
802     line_number => $ent->{line},
803     column_number => $ent->{column},
804     };
805     my $continue = __c|ERROR{
806     xp|fatal-xml11-end-of-line-in-xml-declaration::
807     c|location => {$location},
808     xp|character-number => {$r},
809     }__;
810     unless ($continue) {
811     __CODE{ParseError}__;
812     }
813     } # no_xml11_eol
814     $r = 0x000A if $self->{xml_version} eq '1.1' and
815     $ent->{is_external_entity};
816     ## Even in XML 1.0 it increases the line number.
817     $ent->{line}++;
818     $ent->{column} = 1;
819 wakaba 1.6 } elsif (
820     not ((0x0020 <= $r and $r <= 0x007E) or
821     (0x00A0 <= $r and $r <= 0xD7FF) or
822     (0xE000 <= $r and $r <= 0xFFFD) or
823     (0x10000 <= $r and $r <= 0x10FFFF)) and
824 wakaba 1.27 $r != 0x0009 and
825     not (($self->{xml_version} eq '1.0' or
826     not $ent->{is_external_entity}) and
827     (0x007F <= $r and $r <= 0x009F)) and
828     not ($self->{xml_version} eq '1.1' and
829     not $ent->{is_external_entity} and
830     0x0001 <= $r and $r <= 0x001F)
831 wakaba 1.6 ) {
832     my $location = {
833 wakaba 1.27 utf32_offset => $ent->{pos} - 1,
834     line_number => $ent->{line},
835     column_number => $ent->{column},
836 wakaba 1.6 };
837 wakaba 1.27 my $continue = __c|ERROR{xp|wf-legal-literal-character::
838     c|location => {$location},
839 wakaba 1.6 xp|character-number => {$r},
840     }__;
841     unless ($continue) {
842 wakaba 1.27 __CODE{ParseError}__;
843 wakaba 1.3 }
844 wakaba 1.27 $ent->{column}++;
845     } else { # XML |Char|
846     $ent->{column}++;
847 wakaba 1.3 }
848     } else {
849 wakaba 1.6 $r = -1;
850 wakaba 1.3 }
851 wakaba 1.6 } # GETCHAR
852 wakaba 1.1 }
853    
854     @Method:
855     @@ManakaiDOM:isForInternal: 1
856     @@Operator: ManakaiDOM|MUErrorHandler
857     @@enDesc:
858 wakaba 1.47 When a <IF::ecore|ErrorInterface> is <Perl::report>ed,
859 wakaba 1.1 then this method is invoked.
860    
861     The method calls the <cfg::DOMCore|error-handler> if the error is of
862     <IF::DOMCore|DOMError>. Otherwise, the error is re-thrown so that
863     corresponding <Perl::catch> clause, if any, can catch the error.
864     @@Param:
865     @@@Name: err
866 wakaba 1.47 @@@Type: ecore|ErrorInterface
867 wakaba 1.1 @@@enDesc:
868     The reported error object.
869     @@Return:
870     @@@Type: DISPerl|Any
871     @@@enDesc:
872     If the <P::err> is a <IF::DOMCore|DOMError>, then the return value
873     of the error handler.
874    
875     {NOTE:: If the error is thrown, the method never returns.
876     }
877     @@@nullCase:
878     @@@@enDesc:
879     No error handler.
880     @@@PerlDef:
881 wakaba 1.45 if ($err->isa (<IFName::DOMCore|DOMError>)) {
882 wakaba 1.1 __DEEP{
883     A: {
884     my $cfg = $self-><AG::LSParser.domConfig>;
885     my $h = $cfg-><M::DOMCore|DOMConfiguration.getParameter>
886     ('error-handler');
887     $r = $h-><M::DOMCore|DOMErrorHandler.handleError> ($err);
888     } # A
889     }__;
890     } else {
891 wakaba 1.47 $err-><M::ecore|ErrorInterface.throw>;
892 wakaba 1.1 }
893    
894     @DISPerl:dpgDef:
895    
896     /*
897     XML Document Entity
898    
899     document := prolog element *Misc
900     - *Char RestrictedChar *Char ;; [1]
901     */
902 wakaba 1.11 rule DocumentEntity : standalone {
903 wakaba 1.1 /*
904     prolog := XMLDecl? *Misc [doctypedecl *Misc] ;; [22]
905     */
906 wakaba 1.16 ?lexmode DocumentStart;
907 wakaba 1.11
908     my $doc;
909     lang:Perl {
910     $doc = $self->{doc};
911     }
912 wakaba 1.1
913 wakaba 1.3 ~? (XDO) {
914 wakaba 1.16 ?lexmode XMLDeclarationOrPI;
915     lang:Perl {
916     $self->{entity}->[-1]->{no_xml11_eol} = true;
917     }
918     ~ (S) { // XML declaration
919     &_XMLDeclaration_ ($doc => $doc);
920     ~ (PIC2) {
921     ?lexmode DocumentProlog;
922     } else {
923     ?lexmode DocumentProlog;
924     }
925     } (NameChar) { // Processing instruction whose target begins with |xml|
926     my $target_token;
927     lang:Perl ($v => $token.value) {
928     $target_token = $token;
929     $target_token->{value} = 'xml'.$target_token->{value};
930     $self->{entity}->[-1]->{no_xml11_eol} = false;
931     }
932     ?lexmode PINmtoken;
933     ~? (Nmtoken) {
934     lang:Perl ($v => $token.value) {
935     $target_token->{value} .= $v;
936     }
937     ?lexmode PIName;
938     }
939     lang:Perl {
940     $target_token->{type} = 'Name';
941     $target_token->{location_d} += 3; # 'xml'
942     unshift @{$self->{token}}, $token;
943     $token = $target_token;
944     }
945     &_ProcessingInstruction_ ($doc => $doc, $parent => $doc);
946     ~ (PIC) {
947     ?lexmode DocumentProlog;
948     } else {
949     ?lexmode DocumentProlog;
950     }
951 wakaba 1.3 } else {
952 wakaba 1.16 lang:Perl {
953     $self->{entity}->[-1]->{no_xml11_eol} = false;
954     }
955 wakaba 1.3 }
956     } else {
957     ?lexmode 'DocumentProlog';
958     }
959 wakaba 1.1
960     // *Misc
961 wakaba 1.2 ~* (CDO) {
962 wakaba 1.1 &_CommentDeclaration_ ($doc => $doc, $parent => $doc);
963    
964     ~ (MDC) {
965     ?lexmode DocumentProlog;
966     } else {
967     ?lexmode DocumentProlog;
968     }
969     } (PIO) {
970     &_ProcessingInstruction_ ($doc => $doc, $parent => $doc);
971    
972     ~ (PIC) {
973     ?lexmode 'DocumentProlog';
974     } else {
975     ?lexmode DocumentProlog;
976     }
977     } (S) {
978     //
979     }
980    
981     // doctypedecl
982     ~? (MDO) {
983     &_DocumentTypeDeclaration_ ($doc => $doc);
984    
985 wakaba 1.3 ~ (MDC) {
986     ?lexmode DocumentMisc;
987     } else {
988     ?lexmode DocumentMisc;
989     }
990     } else {
991     ?lexmode DocumentMisc;
992 wakaba 1.1 }
993 wakaba 1.25
994     lang:Perl {
995     $self->{doc}-><AS::Document.allDeclarationsProcessed> (true)
996     unless $self->{dont_process};
997     }
998 wakaba 1.1
999     // *Misc
1000 wakaba 1.2 ~* (CDO) {
1001 wakaba 1.1 &_CommentDeclaration_ ($doc => $doc, $parent => $doc);
1002    
1003     ~ (MDC) {
1004     ?lexmode DocumentMisc;
1005     } else {
1006     ?lexmode DocumentMisc;
1007     }
1008     } (PIO) {
1009     &_ProcessingInstruction_ ($doc => $doc, $parent => $doc);
1010    
1011     ~ (PIC) {
1012     ?lexmode 'DocumentMisc';
1013     } else {
1014     ?lexmode DocumentMisc;
1015     }
1016     } (S) {
1017     //
1018     }
1019    
1020     // Document element
1021     ~ (STAGO) {
1022     &Element_ ($doc => $doc, $parent => $doc)
1023     : unshift-current-token;
1024     ~ (TAGC) {
1025     ?lexmode DocumentEnd;
1026     } else {
1027     ?lexmode DocumentEnd;
1028     }
1029     } else {
1030     ?lexmode 'DocumentEnd';
1031     }
1032    
1033     // *Misc
1034 wakaba 1.2 ~* (CDO) {
1035 wakaba 1.1 &_CommentDeclaration_ ($doc => $doc, $parent => $doc);
1036    
1037     ~ (MDC) {
1038     ?lexmode DocumentEnd;
1039     } else {
1040     ?lexmode DocumentEnd;
1041     }
1042     } (PIO) {
1043     &_ProcessingInstruction_ ($doc => $doc, $parent => $doc);
1044     ~ (PIC) {
1045     ?lexmode 'DocumentEnd';
1046     } else {
1047     ?lexmode DocumentEnd;
1048     }
1049     } (S) {
1050     //
1051     }
1052    
1053     ~ (#EOF) { }
1054     } // DocumentEntity
1055 wakaba 1.11
1056     /*
1057     Internal General Parsed Entity
1058    
1059     An internal general parsed entity is well-formed if its
1060     replacement text matches the production labeled |content|.
1061     */
1062     rule InternalGeneralParsedEntity ($ent) : standalone {
1063     ?lexmode ElementContent;
1064    
1065     my $ns;
1066     lang:Perl {
1067     $ns = {
1068     xml => <Q::xml:>,
1069     xmlns => <Q::xmlns:>,
1070     };
1071     }
1072    
1073     &content ($parent => $ent, $ns => $ns);
1074    
1075     ~ (#EOF) { }
1076     } // InternalGeneralParsedEntity
1077    
1078 wakaba 1.1 /*
1079     XML Declaration
1080    
1081     XMLDecl := '<?xml' VersionInfo
1082     [EncodingDecl]
1083     [SDDecl]
1084     [S] '?>' ;; [23]
1085    
1086     NOTE: XML declaration is optional in XML 1.0
1087     while it is required in XML 1.1.
1088     */
1089 wakaba 1.16 rule _XMLDeclaration_ {
1090     // ~ (XDO) { }
1091 wakaba 1.3 ?lexmode XMLDeclaration;
1092 wakaba 1.16 //lang:Perl {
1093     // $self->{entity}->[-1]->{no_xml11_eol} = true;
1094     //}
1095     //~ (S) { }
1096 wakaba 1.3
1097     ~ (Name == 'version') {
1098     ~? (S) { }
1099     ~ (VI) { }
1100     ~? (S) { }
1101 wakaba 1.1
1102 wakaba 1.3 my $ver;
1103     my $bad_token;
1104    
1105     ~ (LIT) {
1106     ?lexmode AttributeValueLiteral;
1107    
1108     ~ (STRING) {
1109     lang:Perl ($version => $token.value) {
1110     $ver = $version;
1111     $bad_token = $token;
1112     }
1113     }
1114    
1115     ~ (LIT) {
1116     ?lexmode XMLDeclaration;
1117     }
1118     } (LITA) {
1119     ?lexmode AttributeValueLiteralA;
1120    
1121     ~ (STRING) {
1122     lang:Perl ($version => $token.value) {
1123     $ver = $version;
1124     $bad_token = $token;
1125     }
1126     }
1127    
1128     ~ (LITA) {
1129     ?lexmode XMLDeclaration;
1130     }
1131     }
1132    
1133     lang:Perl : has-error {
1134     unless ($ver eq '1.0' or $ver eq '1.1') {
1135     my $location;
1136     __CODE{xp|get-location-from-token::
1137     $token => {$bad_token},
1138     $result => {$location},
1139     }__;
1140     my $continue = __DOMCore:ERROR{xp|wf-unsupported-xml-version::
1141     DOMCore|location => {$location},
1142 wakaba 1.16 xp|parent => {$self->{doc}},
1143 wakaba 1.3 infoset|version => {$ver},
1144     xp|error-token => {$bad_token},
1145     }__;
1146     unless ($continue) {
1147 wakaba 1.27 __CODE{ParseError}__;
1148 wakaba 1.3 }
1149     }
1150 wakaba 1.16 $self->{doc}-><AS::Document.xmlVersion> ($ver);
1151 wakaba 1.3 $self->{xml_version} = $ver;
1152     }
1153    
1154     ~? (S) { }
1155 wakaba 1.1 }
1156    
1157 wakaba 1.3 ~? (Name == 'encoding') {
1158     ~? (S) { }
1159     ~ (VI) { }
1160     ~? (S) { }
1161    
1162     my $ver;
1163     my $bad_token;
1164    
1165     ~ (LIT) {
1166     ?lexmode AttributeValueLiteral;
1167    
1168     ~ (STRING) {
1169     lang:Perl ($version => $token.value) {
1170     $ver = $version;
1171     $bad_token = $token;
1172     }
1173     }
1174    
1175     ~ (LIT) {
1176     ?lexmode XMLDeclaration;
1177     }
1178     } (LITA) {
1179     ?lexmode AttributeValueLiteralA;
1180    
1181     ~ (STRING) {
1182     lang:Perl ($version => $token.value) {
1183     $ver = $version;
1184     $bad_token = $token;
1185     }
1186     }
1187    
1188     ~ (LITA) {
1189     ?lexmode XMLDeclaration;
1190     }
1191     }
1192    
1193     lang:Perl : has-error {
1194     unless ($ver =~ /\A[A-Za-z][A-Za-z0-9._-]*\z/) {
1195     my $location;
1196     __CODE{xp|get-location-from-token::
1197     $token => {$bad_token},
1198     $result => {$location},
1199     }__;
1200     my $continue = __DOMCore:ERROR{xp|wf-malformed-enc-name::
1201     DOMCore|location => {$location},
1202 wakaba 1.16 xp|parent => {$self->{doc}},
1203 wakaba 1.3 xp|name => {$ver},
1204     xp|error-token => {$bad_token},
1205     }__;
1206     unless ($continue) {
1207 wakaba 1.27 __CODE{ParseError}__;
1208 wakaba 1.3 }
1209     }
1210 wakaba 1.16 $self->{doc}-><AS::Document.xmlEncoding> ($ver);
1211 wakaba 1.3 }
1212    
1213     ~? (S) { }
1214 wakaba 1.1 }
1215 wakaba 1.3
1216     ~? (Name == 'standalone') {
1217     ~? (S) { }
1218     ~ (VI) { }
1219     ~? (S) { }
1220    
1221     my $ver;
1222     my $bad_token;
1223    
1224     ~ (LIT) {
1225     ?lexmode AttributeValueLiteral;
1226    
1227     ~ (STRING) {
1228     lang:Perl ($version => $token.value) {
1229     $ver = $version;
1230     $bad_token = $token;
1231     }
1232     }
1233    
1234     ~ (LIT) {
1235     ?lexmode XMLDeclaration;
1236     }
1237     } (LITA) {
1238     ?lexmode AttributeValueLiteralA;
1239    
1240     ~ (STRING) {
1241     lang:Perl ($version => $token.value) {
1242     $ver = $version;
1243     $bad_token = $token;
1244     }
1245     }
1246 wakaba 1.1
1247 wakaba 1.3 ~ (LITA) {
1248     ?lexmode XMLDeclaration;
1249     }
1250     }
1251    
1252     lang:Perl : has-error {
1253     unless ($ver eq 'yes' or $ver eq 'no') {
1254     my $location;
1255     __CODE{xp|get-location-from-token::
1256     $token => {$bad_token},
1257     $result => {$location},
1258     }__;
1259     my $continue = __DOMCore:ERROR{xp|wf-malformed-xml-standalone::
1260     DOMCore|location => {$location},
1261 wakaba 1.16 xp|parent => {$self->{doc}},
1262 wakaba 1.3 xp|name => {$ver},
1263     xp|error-token => {$bad_token},
1264     }__;
1265     unless ($continue) {
1266 wakaba 1.27 __CODE{ParseError}__;
1267 wakaba 1.3 }
1268     }
1269 wakaba 1.13 if ($ver eq 'yes') {
1270 wakaba 1.16 $self->{doc}-><AS::Document.xmlStandalone> (true);
1271 wakaba 1.13 $self->{standalone} = true;
1272     }
1273 wakaba 1.3 }
1274    
1275     ~? (S) { }
1276     }
1277    
1278 wakaba 1.16 ~ (PIC1) {
1279     lang:Perl {
1280     $self->{entity}->[-1]->{no_xml11_eol} = false;
1281     }
1282     } else {
1283     lang:Perl {
1284     $self->{entity}->[-1]->{no_xml11_eol} = false;
1285     }
1286     }
1287    
1288     // ~ (PIC2) { }
1289 wakaba 1.3 } // _XMLDeclaration_
1290 wakaba 1.1
1291     /*
1292     Comment Declaration
1293    
1294     Comment := '<!--' *(Char - '-' / '-' (Char - '-'))
1295     '-->' ;; [15]
1296 wakaba 1.4 */
1297 wakaba 1.1 rule _CommentDeclaration_ ($doc, $parent) {
1298     ?lexmode 'CommentDeclaration';
1299    
1300     ~? (STRING) {
1301     lang:Perl ($data => $token.value) {
1302     my $com = $doc-><M::Document.createComment> ($data);
1303     $parent-><M::Node.appendChild> ($com);
1304     }
1305     } else {
1306     lang:Perl {
1307     my $com = $doc-><M::Document.createComment> ('');
1308     $parent-><M::Node.appendChild> ($com);
1309     }
1310     }
1311    
1312     ~ (COM) {
1313     ?lexmode MarkupDeclaration;
1314     } else {
1315     ?lexmode MarkupDeclaration;
1316     }
1317    
1318     // ~ (MDC) { }
1319 wakaba 1.4 } // _CommentDeclaration
1320 wakaba 1.15
1321     rule _CommentDeclarationDTD {
1322     ?lexmode CommentDeclaration;
1323 wakaba 1.4
1324     ~? (STRING) {
1325     //
1326     }
1327    
1328     ~ (COM) {
1329     ?lexmode MarkupDeclaration;
1330     } else {
1331     ?lexmode MarkupDeclaration;
1332     }
1333    
1334     ~ (MDC) {
1335     ?lexmode DTD;
1336     } else {
1337     ?lexmode DTD;
1338     }
1339     } // _CommentDeclarationDTD
1340    
1341 wakaba 1.1 /*
1342     Processing Instruction
1343    
1344     PI := '<?' PITarget [S *Char - *Char '?>' *Char]
1345     '?>' ;; [16]
1346     */
1347     rule _ProcessingInstruction_ ($doc, $parent) {
1348     ?lexmode 'PIName';
1349    
1350     my $pi;
1351    
1352     ~ (Name) {
1353 wakaba 1.3 lang:Perl ($name => $token.value) : has-error {
1354 wakaba 1.1 if (lc $name eq 'xml') {
1355 wakaba 1.3 my $location;
1356     __CODE{xp|get-location-from-token::
1357     $token => {$token},
1358     $result => {$location},
1359     }__;
1360     my $continue = __DOMCore:ERROR{xp|wf-pi-target-is-xml::
1361     xp|name => {$name},
1362     DOMCore|location => {$location},
1363     xp|parent => {$parent},
1364     }__;
1365     unless ($continue) {
1366 wakaba 1.27 __CODE{ParseError}__;
1367 wakaba 1.3 }
1368 wakaba 1.1 }
1369 wakaba 1.26 __CODE{checkNCName:: $name => $name}__;
1370    
1371 wakaba 1.1 $pi = $doc-><M::Document.createProcessingInstruction>
1372     ($name);
1373     }
1374 wakaba 1.14 } else {
1375     lang:Perl {
1376     $pi = $doc-><M::Document.createProcessingInstruction> ('#INVALID');
1377     }
1378 wakaba 1.1 }
1379    
1380 wakaba 1.14 ~? (S) {
1381 wakaba 1.1 ?lexmode 'PIData';
1382    
1383     my $tdata;
1384    
1385     ~? (DATA) {
1386     lang:Perl ($data => $token.value) {
1387     $tdata = $data;
1388     }
1389     } else {
1390     lang:Perl {
1391     $tdata = '';
1392     }
1393     }
1394    
1395     lang:Perl {
1396     $pi-><AS::Node.nodeValue> ($tdata);
1397     }
1398     }
1399    
1400     lang:Perl {
1401     $parent-><M::Node.appendChild> ($pi);
1402     }
1403    
1404     // ~ (PIC) { }
1405     } // _ProcessingInstruction_
1406 wakaba 1.4
1407 wakaba 1.6 /*
1408     Processing instruction in DTD
1409     */
1410     rule _ProcessingInstructionDTD ($doc, $doctype) {
1411 wakaba 1.4 ?lexmode 'PIName';
1412 wakaba 1.6
1413     my $pi;
1414 wakaba 1.4
1415     ~ (Name) {
1416 wakaba 1.6 lang:Perl ($name => $token.value) : has-error {
1417     if (lc $name eq 'xml') {
1418     my $location;
1419     __CODE{xp|get-location-from-token::
1420     $token => {$token},
1421     $result => {$location},
1422     }__;
1423     my $continue = __DOMCore:ERROR{xp|wf-pi-target-is-xml::
1424     xp|name => {$name},
1425     DOMCore|location => {$location},
1426     xp|parent => {$doctype},
1427     }__;
1428     unless ($continue) {
1429 wakaba 1.27 __CODE{ParseError}__;
1430 wakaba 1.6 }
1431     }
1432 wakaba 1.26 __CODE{checkNCName:: $name => $name}__;
1433    
1434 wakaba 1.6 $pi = $doc-><M::Document.createProcessingInstruction>
1435     ($name);
1436 wakaba 1.35 $pi-><AS::tx|ProcessingInstruction.manakaiBaseURI>
1437 wakaba 1.29 ($self->{location}->{base_uri});
1438 wakaba 1.6 }
1439 wakaba 1.14 } else {
1440     lang:Perl {
1441     $pi = $doc-><M::Document.createProcessingInstruction> ('#INVALID');
1442     }
1443 wakaba 1.4 }
1444    
1445 wakaba 1.14 ~? (S) {
1446 wakaba 1.4 ?lexmode 'PIData';
1447    
1448 wakaba 1.6 my $tdata;
1449    
1450 wakaba 1.4 ~? (DATA) {
1451 wakaba 1.6 lang:Perl ($data => $token.value) {
1452     $tdata = $data;
1453     }
1454     } else {
1455     lang:Perl {
1456     $tdata = '';
1457     }
1458     }
1459    
1460     lang:Perl {
1461     $pi-><AS::Node.nodeValue> ($tdata);
1462 wakaba 1.4 }
1463     }
1464    
1465 wakaba 1.6 lang:Perl {
1466     $doctype-><M::Node.appendChild> ($pi);
1467     }
1468    
1469 wakaba 1.4 ~ (PIC) {
1470     ?lexmode DTD;
1471     } else {
1472     ?lexmode DTD;
1473     }
1474     } // _ProcessingInstructionDTD
1475 wakaba 1.1
1476     /*
1477     Element content parsing mode
1478    
1479     element := EmptyElemTag /
1480     STag content ETag ;; [39]
1481     content := (CharData / element / Reference / CDSect /
1482     PI / Comment) ;; [43]
1483     */
1484 wakaba 1.6 rule Element_ ($doc, $parent, $ns) : standalone {
1485 wakaba 1.1 ?lexmode 'ElementContent';
1486    
1487     my $node; // Current "parent" node
1488     my $nodes; // Node stack (w/o $current_node)
1489     my $type; // Current "parent" element type QName
1490     my $types; // Element type stack (w/o $current_type)
1491 wakaba 1.6 //my $ns; // Current in-scope namespace bindings
1492 wakaba 1.1 my $nses; // Namespace binding stack (w/o $current_ns)
1493    
1494     lang:Perl {
1495     $node = $parent;
1496     $nodes = [];
1497     $type = '';
1498     $types = [];
1499 wakaba 1.6 $ns ||= {
1500 wakaba 1.1 xml => <Q::xml:>,
1501     xmlns => <Q::xmlns:>,
1502     };
1503     $nses = [];
1504     }
1505    
1506     ~* : name => CONTENT
1507     (CharData) {
1508     // Character data
1509     lang:Perl ($data => $token.value) {
1510 wakaba 1.31 $node-><M::Node.manakaiAppendText> (\($data));
1511 wakaba 1.1 }
1512     } (STAGO) {
1513     // Start tag or empty element tag
1514    
1515     ?lexmode 'StartTag';
1516    
1517     ~ (Name) {
1518     my $attrs;
1519 wakaba 1.26 lang:Perl ($name => $token.value) : has-error {
1520     __CODE{checkQName:: $name => $name}__;
1521 wakaba 1.1 push @{$types}, $type;
1522     $type = $name;
1523     $attrs = {};
1524     }
1525    
1526     ~? (S) {
1527     &AttributeSpecificationList
1528     ($doc => $doc, $attrs => $attrs);
1529     }
1530    
1531     my $el;
1532 wakaba 1.9
1533     /*
1534     Note that this implementation does not perform
1535     attribute value tokenization (but does white space
1536     normalization common to attribute types) and
1537     construct the tree as is. DOM Level 3 Core spec
1538     is unclear on this point. With tokenization,
1539     entity references cannot be preserved.
1540    
1541     The manakai Node.nodeValue and Attr.value attributes
1542     do tokenization according to attribute types.
1543     */
1544    
1545     /*
1546     ISSUE: Should |xml:id| attribute be typed?
1547     */
1548 wakaba 1.1
1549     lang:Perl {
1550     push @{$nses}, $ns;
1551     $ns = {%$ns};
1552 wakaba 1.26
1553     ## Default attributes
1554     DA: for my $atqname (%{$self->{attr}->{$type}}) {
1555     next DA unless $self->{attr}->{$type}->{$atqname};
1556     next DA if exists $attrs->{$atqname}; # specified
1557     my $dtype = $self->{attr}->{$type}->{$atqname}
1558     -><AG::ATDef.defaultType>;
1559     next DA unless $dtype == <C::ATDef.EXPLICIT_DEFAULT> or
1560     $dtype == <C::ATDef.FIXED_DEFAULT>;
1561     $attrs->{$atqname} = {is_default => true, nodes => []};
1562     for (@{$self->{attr}->{$type}->{$atqname}
1563     -><AG::Node.childNodes>}) {
1564     push @{$attrs->{$atqname}->{nodes}},
1565     $_-><M::Node.cloneNode> (true);
1566     }
1567     }
1568 wakaba 1.1
1569     my %gattr;
1570     my %lattr;
1571     for my $atqname (keys %$attrs) {
1572     my ($pfx, $lname) = split /:/, $atqname;
1573 wakaba 1.9 $attrs->{$atqname}->{def} = $self->{attr}->{$type}->{$atqname};
1574 wakaba 1.1 if (defined $lname) { ## Global attribute
1575     if ($pfx eq 'xmlns') {
1576 wakaba 1.26 my $nsuri = $attrs->{$atqname}->{is_default}
1577     ? $attrs->{$atqname}->{def}-><AG::Node.nodeValue>
1578     : $attrs->{$atqname}->{value};
1579     if (not $attrs->{$atqname}->{is_default} and
1580     $attrs->{$atqname}->{def}) {
1581 wakaba 1.9 my $dt = $attrs->{$atqname}->{def}-><AG::ATDef.declaredType>;
1582     if ({
1583     <C::ATDef.ID_ATTR> => true,
1584     <C::ATDef.IDREF_ATTR> => true,
1585     <C::ATDef.IDREFS_ATTR> => true,
1586     <C::ATDef.ENTITY_ATTR> => true,
1587     <C::ATDef.ENTITIES_ATTR> => true,
1588     <C::ATDef.NMTOKEN_ATTR> => true,
1589     <C::ATDef.NMTOKENS_ATTR> => true,
1590     <C::ATDef.NOTATION_ATTR> => true,
1591     <C::ATDef.ENUMERATION_ATTR> => true,
1592     }->{$dt}) {
1593     ## Tokenization (XML 1 3.3.3)
1594 wakaba 1.26 for ($nsuri) {
1595 wakaba 1.9 s/^\x20+//;
1596     s/\x20+\z//;
1597     s/\x20+/ /g;
1598     }
1599     }
1600     }
1601 wakaba 1.26 if ($lname eq 'xml' and
1602     $nsuri ne <Q::xml:>) {
1603     my $location;
1604     __CODE{xp|get-location-from-token::
1605     $token => $token,
1606     $result => $location,
1607     }__;
1608     my $continue = __c|ERROR{xp|nsc-reserved-prefix-xml::
1609     c|location => {$location},
1610     xp|token => {$token},
1611     infoset|prefix => {$lname},
1612     infoset|namespaceName => {$nsuri},
1613     }__;
1614     unless ($continue) {
1615 wakaba 1.27 __CODE{ParseError}__;
1616 wakaba 1.26 }
1617     } elsif ($lname eq 'xmlns') {
1618     my $location;
1619     __CODE{xp|get-location-from-token::
1620     $token => $token,
1621     $result => $location,
1622     }__;
1623     my $continue = __c|ERROR{xp|nsc-reserved-prefix-xmlns::
1624     c|location => {$location},
1625     xp|token => {$token},
1626     infoset|prefix => {$lname},
1627     infoset|namespaceName => {$nsuri},
1628     }__;
1629     unless ($continue) {
1630 wakaba 1.27 __CODE{ParseError}__;
1631 wakaba 1.26 }
1632     }
1633     if ($nsuri eq '') {
1634     if ($self->{xml_version} eq '1.0') {
1635     my $location;
1636     __CODE{xp|get-location-from-token::
1637     $token => $token,
1638     $result => $location,
1639     }__;
1640     my $continue = __c|ERROR{xp|nswf-empty-namespace-name::
1641     c|location => {$location},
1642     xp|token => {$token},
1643     infoset|namespaceName => {$nsuri},
1644     infoset|prefix => {$lname},
1645     }__;
1646     unless ($continue) {
1647 wakaba 1.27 __CODE{ParseError}__;
1648 wakaba 1.26 }
1649     }
1650     } elsif ($nsuri eq <Q::xml:> and
1651     $lname ne 'xml') {
1652     my $location;
1653     __CODE{xp|get-location-from-token::
1654     $token => $token,
1655     $result => $location,
1656     }__;
1657     my $continue = __c|ERROR{
1658     xp|nsc-reserved-namespace-name-xml::
1659     c|location => {$location},
1660     xp|token => {$token},
1661     infoset|prefix => {$lname},
1662     infoset|namespaceName => {$nsuri},
1663     }__;
1664     unless ($continue) {
1665 wakaba 1.27 __CODE{ParseError}__;
1666 wakaba 1.26 }
1667     } elsif ($nsuri eq <Q::xmlns:>) {
1668     my $location;
1669     __CODE{xp|get-location-from-token::
1670     $token => $token,
1671     $result => $location,
1672     }__;
1673     my $continue = __c|ERROR{
1674     xp|nsc-reserved-namespace-name-xmlns::
1675     c|location => {$location},
1676     xp|token => {$token},
1677     infoset|prefix => {$lname},
1678     infoset|namespaceName => {$nsuri},
1679     }__;
1680     unless ($continue) {
1681 wakaba 1.27 __CODE{ParseError}__;
1682 wakaba 1.26 }
1683     }
1684     $ns->{$lname} = $nsuri;
1685 wakaba 1.1 delete $ns->{$lname} unless length $ns->{$lname};
1686     }
1687     $gattr{$pfx}->{$lname} = $attrs->{$atqname};
1688     } else { ## Local attribute
1689     if ($pfx eq 'xmlns') {
1690 wakaba 1.26 $ns->{''} = $attrs->{xmlns}->{is_default}
1691     ? $attrs->{xmlns}->{def}-><AG::Node.nodeValue>
1692     : $attrs->{xmlns}->{value};
1693     if (not $attrs->{$atqname}->{is_default} and
1694     $attrs->{$atqname}->{def}) {
1695 wakaba 1.9 my $dt = $attrs->{$atqname}->{def}-><AG::ATDef.declaredType>;
1696     if ({
1697     <C::ATDef.ID_ATTR> => true,
1698     <C::ATDef.IDREF_ATTR> => true,
1699     <C::ATDef.IDREFS_ATTR> => true,
1700     <C::ATDef.ENTITY_ATTR> => true,
1701     <C::ATDef.ENTITIES_ATTR> => true,
1702     <C::ATDef.NMTOKEN_ATTR> => true,
1703     <C::ATDef.NMTOKENS_ATTR> => true,
1704     <C::ATDef.NOTATION_ATTR> => true,
1705     <C::ATDef.ENUMERATION_ATTR> => true,
1706     }->{$dt}) {
1707     ## Tokenization (XML 1 3.3.3)
1708     for ($ns->{''}) {
1709     s/^\x20+//;
1710     s/\x20+\z//;
1711     s/\x20+/ /g;
1712     }
1713     }
1714     }
1715 wakaba 1.26 unless ($ns->{''}) {
1716     delete $ns->{''};
1717     } elsif ($ns->{''} eq <Q::xml:>) {
1718     my $location;
1719     __CODE{xp|get-location-from-token::
1720     $token => $token,
1721     $result => $location,
1722     }__;
1723     my $continue = __c|ERROR{
1724     xp|nsc-reserved-namespace-name-xml::
1725     c|location => {$location},
1726     xp|token => {$token},
1727     infoset|prefix => {null},
1728     infoset|namespaceName => {<Q::xml:>},
1729     }__;
1730     unless ($continue) {
1731 wakaba 1.27 __CODE{ParseError}__;
1732 wakaba 1.26 }
1733     } elsif ($ns->{''} eq <Q::xmlns:>) {
1734     my $location;
1735     __CODE{xp|get-location-from-token::
1736     $token => $token,
1737     $result => $location,
1738     }__;
1739     my $continue = __c|ERROR{
1740     xp|nsc-reserved-namespace-name-xmlns::
1741     c|location => {$location},
1742     xp|token => {$token},
1743     infoset|prefix => {null},
1744     infoset|namespaceName => {<Q::xmlns:>},
1745     }__;
1746     unless ($continue) {
1747 wakaba 1.27 __CODE{ParseError}__;
1748 wakaba 1.26 }
1749     }
1750 wakaba 1.1 } else {
1751     $lattr{$pfx} = $attrs->{$atqname};
1752     }
1753     }
1754     }
1755    
1756     my ($pfx, $lname) = split /:/, $type;
1757     my $nsuri;
1758     if (defined $lname) { ## Prefixed namespace
1759     if (defined $ns->{$pfx}) {
1760     $nsuri = $ns->{$pfx};
1761     } else {
1762 wakaba 1.26 my $location;
1763     __CODE{xp|get-location-from-token::
1764     $token => $token,
1765     $result => $location,
1766     }__;
1767     my $continue = __c|ERROR{xp|nsc-prefix-declared::
1768     c|location => {$location},
1769     xp|token => {$token},
1770     infoset|prefix => {$pfx},
1771     xp|name => {$type},
1772     }__;
1773     unless ($continue) {
1774 wakaba 1.27 __CODE{ParseError}__;
1775 wakaba 1.26 }
1776 wakaba 1.1 }
1777     } else { ## Default namespace
1778     $nsuri = $ns->{''};
1779     }
1780    
1781     $el = $doc-><M::Document.createElementNS>
1782     ($nsuri, $type);
1783    
1784     if ($attrs->{xmlns}) {
1785     my $attr = $doc-><M::Document.createAttributeNS>
1786     (<Q::xmlns:>, 'xmlns');
1787     for (@{$attrs->{xmlns}->{nodes}}) {
1788 wakaba 1.31 if ($_-><AG::Node.nodeType> == <C::Node.TEXT_NODE>) {
1789     $attr-><M::Node.manakaiAppendText>
1790     (\($_-><AG::Node.textContent>));
1791     } else {
1792     $attr-><M::Node.appendChild> ($_);
1793     }
1794 wakaba 1.1 }
1795 wakaba 1.9 if ($attrs->{xmlns}->{def}) {
1796 wakaba 1.35 $attr-><AS::Attr.manakaiAttributeType>
1797     ($attrs->{xmlns}->{def}-><AG::ATDef.declaredType>);
1798 wakaba 1.9 }
1799 wakaba 1.1 $el-><M::Element.setAttributeNodeNS> ($attr);
1800 wakaba 1.35 $attr-><AS::Attr.specified> (false)
1801 wakaba 1.26 if $attrs->{xmlns}->{is_default};
1802 wakaba 1.1 }
1803    
1804     for my $lname (keys %lattr) {
1805     my $attr = $doc-><M::Document.createAttributeNS>
1806     (null, $lname);
1807     for (@{$lattr{$lname}->{nodes}}) {
1808 wakaba 1.31 if ($_-><AG::Node.nodeType> == <C::Node.TEXT_NODE>) {
1809     $attr-><M::Node.manakaiAppendText>
1810     (\($_-><AG::Node.textContent>));
1811     } else {
1812     $attr-><M::Node.appendChild> ($_);
1813     }
1814 wakaba 1.1 }
1815 wakaba 1.9 if ($attrs->{$lname}->{def}) {
1816 wakaba 1.35 $attr-><AS::Attr.manakaiAttributeType>
1817     ($attrs->{$lname}->{def}-><AG::ATDef.declaredType>);
1818 wakaba 1.9 }
1819 wakaba 1.1 $el-><M::Element.setAttributeNodeNS> ($attr);
1820 wakaba 1.35 $attr-><AS::Attr.specified> (false)
1821 wakaba 1.26 if $attrs->{$lname}->{is_default};
1822 wakaba 1.1 }
1823    
1824     for my $pfx (keys %gattr) {
1825 wakaba 1.26 LN: for my $lname (keys %{$gattr{$pfx}}) {
1826     my $name = $pfx.':'.$lname;
1827     unless (defined $ns->{$pfx}) {
1828     my $location;
1829     __CODE{xp|get-location-from-token::
1830     $token => $token,
1831     $result => $location,
1832     }__;
1833     my $continue = __c|ERROR{xp|nsc-prefix-declared::
1834     c|location => {$location},
1835     xp|token => {$token},
1836     xp|name => {$name},
1837     infoset|prefix => {$pfx},
1838     }__;
1839     unless ($continue) {
1840 wakaba 1.27 __CODE{ParseError}__;
1841 wakaba 1.26 }
1842     }
1843     my $attr = $el-><M::Element.getAttributeNodeNS>
1844     ($ns->{$pfx}, $lname);
1845     if ($attr) {
1846     my $another_name = $attr-><AG::Node.nodeName>;
1847     if ($name ne $another_name) {
1848     my $location;
1849     __CODE{xp|get-location-from-token::
1850     $token => $token,
1851     $result => $location,
1852     }__;
1853     my $continue = __c|ERROR{
1854     xp|nswf-unique-att-spec-expanded-name::
1855     c|location => {$location},
1856     xp|token => {$token},
1857     xp|another-attribute-name => {$another_name},
1858     xp|name => {$name},
1859     infoset|namespaceName => {$ns->{$pfx}},
1860     infoset|localName => {$lname},
1861     }__;
1862     unless ($continue) {
1863 wakaba 1.27 __CODE{ParseError}__;
1864 wakaba 1.26 }
1865 wakaba 1.35 unless ($attr-><AG::Attr.specified>) {
1866 wakaba 1.26 ## It is a default attribute
1867     $attr = $doc-><M::Document.createAttributeNS>
1868     ($ns->{$pfx}, $name);
1869     } else {
1870     ## It is a specified attribute
1871     next LN;
1872     }
1873     } else { ## There is default attribute
1874     $attr = $doc-><M::Document.createAttributeNS>
1875     ($ns->{$pfx}, $name);
1876     }
1877     } else {
1878     $attr = $doc-><M::Document.createAttributeNS>
1879     ($ns->{$pfx}, $name);
1880     }
1881 wakaba 1.1 for (@{$gattr{$pfx}->{$lname}->{nodes}}) {
1882 wakaba 1.31 if ($_-><AG::Node.nodeType> == <C::Node.TEXT_NODE>) {
1883     $attr-><M::Node.manakaiAppendText>
1884     (\($_-><AG::Node.textContent>));
1885     } else {
1886     $attr-><M::Node.appendChild> ($_);
1887     }
1888 wakaba 1.1 }
1889 wakaba 1.26 if ($gattr{$pfx}->{$lname}->{def}) {
1890 wakaba 1.35 $attr-><AS::Attr.manakaiAttributeType>
1891     ($gattr{$pfx}->{$lname}->{def}
1892     -><AG::ATDef.declaredType>);
1893 wakaba 1.9 }
1894 wakaba 1.1 $el-><M::Element.setAttributeNodeNS> ($attr);
1895 wakaba 1.35 $attr-><AS::Attr.specified> (false)
1896 wakaba 1.26 if $gattr{$pfx}->{$lname}->{is_default};
1897     } # PFX
1898 wakaba 1.1 }
1899    
1900     $node-><M::Node.appendChild> ($el);
1901     }
1902    
1903     ~ (TAGC) {
1904     lang:Perl {
1905     push @{$nodes}, $node;
1906     $node = $el;
1907     }
1908     ?lexmode ElementContent;
1909 wakaba 1.6 } (NESTC) {
1910     my $is_docel;
1911 wakaba 1.1 lang:Perl {
1912     $ns = pop @{$nses};
1913     $type = pop @{$types};
1914 wakaba 1.6 $is_docel = (@{$types} == 0);
1915     }
1916    
1917     if-true ($is_docel) {
1918     return;
1919     }
1920    
1921     ~ (TAGC) {
1922     ?lexmode ElementContent;
1923     } else {
1924     ?lexmode ElementContent;
1925 wakaba 1.1 }
1926     } else {
1927     ?lexmode ElementContent;
1928     }
1929     } else {
1930     ?lexmode ElementContent;
1931     }
1932    
1933     } (ETAGO) {
1934     // End tag
1935    
1936     ?lexmode 'EndTag';
1937    
1938     my $is_docel;
1939    
1940     ~ (Name) {
1941 wakaba 1.26 // No NCName & QName check (it must match to start-tag)
1942 wakaba 1.3 lang:Perl ($name => $token.value) : has-error {
1943 wakaba 1.1 if ($name eq $type) {
1944     $type = pop @{$types};
1945     if ($type eq '') {
1946     $is_docel = true;
1947     }
1948     $node = pop @{$nodes};
1949     $ns = pop @{$nses};
1950     } else {
1951 wakaba 1.3 my $location;
1952     __CODE{xp|get-location-from-token::
1953     $token => $token,
1954     $result => $location,
1955     }__;
1956     my $continue = __DOMCore:ERROR{xp|wf-element-type-match::
1957     DOMCore:location => {$location},
1958     xp|token => {$token},
1959     xp|expected-element-type => {$type},
1960     xp|actual-element-type => {$name},
1961     xp|node => {$node},
1962     }__;
1963     unless ($continue) {
1964 wakaba 1.27 __CODE{ParseError}__;
1965 wakaba 1.3 }
1966 wakaba 1.1 }
1967     }
1968     }
1969    
1970     ~? (S) { }
1971    
1972     if-true ($is_docel) {
1973 wakaba 1.3 lang:Perl : has-error {
1974 wakaba 1.1 if (@{$types}) {
1975 wakaba 1.3 my $location;
1976     __CODE{xp|get-location-from-token::
1977     $token => $token,
1978     $result => $location,
1979     }__;
1980     for my $type (reverse @{$types}) {
1981     my $continue = __DOMCore:ERROR{xp|wf-no-end-tag::
1982     DOMCore:location => {$location},
1983     xp|token => {$token},
1984     xp|expected-element-type => {$type},
1985     xp|node => {$node},
1986     }__;
1987     unless ($continue) {
1988 wakaba 1.27 __CODE{ParseError}__;
1989 wakaba 1.3 }
1990     $node = shift @{$nodes};
1991     }
1992 wakaba 1.1 }
1993     }
1994     return;
1995     }
1996    
1997     ~ (TAGC) {
1998     ?lexmode ElementContent;
1999     } else {
2000     ?lexmode 'ElementContent';
2001     }
2002    
2003     } (HCRO) {
2004     &_HexadecimalCharacterReference_
2005     ($doc => $doc, $parent => $node);
2006    
2007     ~ (REFC) {
2008     ?lexmode 'ElementContent';
2009     } else {
2010     ?lexmode ElementContent;
2011     }
2012     } (CRO) {
2013     &_NumericCharacterReference_
2014     ($doc => $doc, $parent => $node);
2015    
2016     ~ (REFC) {
2017     ?lexmode 'ElementContent';
2018     } else {
2019     ?lexmode ElementContent;
2020     }
2021     } (ERO) {
2022 wakaba 1.6 &_GeneralEntityReferenceEC
2023     ($doc => $doc, $parent => $node, $ns => $ns);
2024 wakaba 1.1 } (CDO) {
2025     &_CommentDeclaration_ ($doc => $doc, $parent => $node);
2026    
2027     ~ (MDC) {
2028     ?lexmode ElementContent;
2029     } else {
2030     ?lexmode ElementContent;
2031     }
2032     } (CDSO) {
2033     &_CDATASection_ ($doc => $doc, $parent => $node);
2034    
2035     ~ (MSE) {
2036     ?lexmode 'ElementContent';
2037     } else {
2038     ?lexmode ElementContent;
2039     }
2040     } (PIO) {
2041     &_ProcessingInstruction_ ($doc => $doc, $parent => $node);
2042    
2043     ~ (PIC) {
2044     ?lexmode 'ElementContent';
2045     } else {
2046     ?lexmode ElementContent;
2047     }
2048     }
2049 wakaba 1.3
2050     ~ (#NONE) { }
2051 wakaba 1.1 } // Element_
2052 wakaba 1.11
2053     /*
2054     content := [CharData]
2055     *((element / Reference / CDSect / PI / Comment) [CharData])
2056     */
2057     rule content ($parent, $ns) {
2058     // ?lexmode ElementContent;
2059    
2060     my $doc;
2061     lang:Perl {
2062     $doc = $self->{doc};
2063     }
2064    
2065     ~* (CharData) {
2066     lang:Perl ($data => $token.value) {
2067 wakaba 1.31 $parent-><M::Node.manakaiAppendText> (\($data));
2068 wakaba 1.11 }
2069     } (STAGO) {
2070     &Element_ ($doc => $doc, $parent => $parent, $ns => $ns)
2071     : unshift-current-token;
2072     ~ (TAGC) {
2073     ?lexmode ElementContent;
2074     } else {
2075     ?lexmode ElementContent;
2076     }
2077     } (HCRO) {
2078 wakaba 1.31 &_HexadecimalCharacterReference_ ($parent => $parent);
2079 wakaba 1.11
2080     ~ (REFC) {
2081     ?lexmode 'ElementContent';
2082     } else {
2083     ?lexmode ElementContent;
2084     }
2085     } (CRO) {
2086 wakaba 1.31 &_NumericCharacterReference_ ($parent => $parent);
2087 wakaba 1.11
2088     ~ (REFC) {
2089     ?lexmode 'ElementContent';
2090     } else {
2091     ?lexmode ElementContent;
2092     }
2093     } (ERO) {
2094     &_GeneralEntityReferenceEC
2095     ($doc => $doc, $parent => $parent, $ns => $ns);
2096     } (CDO) {
2097     &_CommentDeclaration_ ($doc => $doc, $parent => $parent);
2098    
2099     ~ (MDC) {
2100     ?lexmode ElementContent;
2101     } else {
2102     ?lexmode ElementContent;
2103     }
2104     } (CDSO) {
2105     &_CDATASection_ ($doc => $doc, $parent => $parent);
2106    
2107     ~ (MSE) {
2108     ?lexmode 'ElementContent';
2109     } else {
2110     ?lexmode ElementContent;
2111     }
2112     } (PIO) {
2113     &_ProcessingInstruction_ ($doc => $doc, $parent => $parent);
2114    
2115     ~ (PIC) {
2116     ?lexmode 'ElementContent';
2117     } else {
2118     ?lexmode ElementContent;
2119     }
2120     }
2121     } // content
2122 wakaba 1.1
2123     rule AttributeSpecificationList ($doc, $attrs)
2124     : standalone
2125     {
2126     ?lexmode 'StartTag';
2127    
2128     my $i;
2129     lang:Perl {
2130     $i = 0;
2131     }
2132    
2133     ~* (Name) {
2134     my $atqname;
2135 wakaba 1.26 lang:Perl ($name => $token.value) : has-error {
2136     __CODE{checkQName:: $name => $name}__;
2137 wakaba 1.1 $atqname = $name;
2138     }
2139    
2140     my $vals;
2141 wakaba 1.18 lang:Perl : has-error {
2142 wakaba 1.1 if ($attrs->{$atqname}) {
2143 wakaba 1.3 my $location;
2144     __CODE{xp|get-location-from-token::
2145     $token => $token,
2146     $result => $location,
2147     }__;
2148     my $continue = __DOMCore:ERROR{xp|wf-unique-att-spec::
2149     DOMCore:location => {$location},
2150     xp|token => {$token},
2151     xp|name => {$atqname},
2152     }__;
2153     unless ($continue) {
2154 wakaba 1.27 __CODE{ParseError}__;
2155 wakaba 1.3 }
2156 wakaba 1.1 }
2157    
2158     $vals = $attrs->{$atqname} = {
2159     nodes => [],
2160     value => '',
2161     index => $i++,
2162     };
2163     }
2164 wakaba 1.3
2165     ~? (S) { }
2166     ~ (VI) { }
2167     ~? (S) { }
2168 wakaba 1.1
2169     ~ (LIT) {
2170     &_AttributeValueSpecification_
2171     ($doc => $doc, $vals => $vals);
2172    
2173     ~ (LIT) {
2174     ?lexmode StartTag;
2175     } else {
2176     ?lexmode StartTag;
2177     }
2178     } (LITA) {
2179     &_AttributeValueSpecificationA_
2180     ($doc => $doc, $vals => $vals);
2181    
2182     ~ (LITA) {
2183     ?lexmode StartTag;
2184     } else {
2185     ?lexmode StartTag;
2186     }
2187     }
2188     } (S) : separator : terminator? { }
2189     } // AttributeSpecificationList
2190    
2191     rule _AttributeValueSpecification_ ($doc, $vals) {
2192     // ~ (LIT) { }
2193     ?lexmode 'AttributeValueLiteral';
2194    
2195     ~* (STRING) {
2196     lang:Perl ($value => $token.value) {
2197     $value =~ s/[\x09\x0A\x0D]/ /g;
2198     my $text = $doc-><M::Document.createTextNode> ($value);
2199     push @{$vals->{nodes}}, $text;
2200     $vals->{value} .= $value;
2201     }
2202     } (HCRO) {
2203     &_HexadecimalCharacterReferenceV_
2204     ($doc => $doc, $vals => $vals);
2205    
2206     ~ (REFC) {
2207     ?lexmode AttributeValueLiteral;
2208     } else {
2209     ?lexmode AttributeValueLiteral;
2210     }
2211     } (CRO) {
2212     &_NumericCharacterReferenceV_
2213     ($doc => $doc, $vals => $vals);
2214    
2215     ~ (REFC) {
2216     ?lexmode AttributeValueLiteral;
2217     } else {
2218     ?lexmode AttributeValueLiteral;
2219     }
2220     } (ERO) {
2221     // TODO: Attribute value normalization
2222     &_GeneralEntityReferenceV_
2223     ($doc => $doc, $vals => $vals);
2224    
2225     ~ (REFC) {
2226     ?lexmode AttributeValueLiteral;
2227     } else {
2228     ?lexmode AttributeValueLiteral;
2229     }
2230     }
2231    
2232     // ~ (LIT) { } (LITA) { }
2233     } // _AttributeValueSpecification_
2234    
2235     rule _AttributeValueSpecificationA_ ($doc, $vals) {
2236     // ~ (LITA) { }
2237     ?lexmode 'AttributeValueLiteralA';
2238    
2239     ~* (STRING) {
2240     lang:Perl ($value => $token.value) {
2241     $value =~ s/[\x09\x0A\x0D]/ /g;
2242     my $text = $doc-><M::Document.createTextNode> ($value);
2243     push @{$vals->{nodes}}, $text;
2244     $vals->{value} .= $value;
2245     }
2246     } (HCRO) {
2247     &_HexadecimalCharacterReferenceV_
2248     ($doc => $doc, $vals => $vals);
2249    
2250     ~ (REFC) {
2251     ?lexmode AttributeValueLiteralA;
2252     } else {
2253     ?lexmode AttributeValueLiteralA;
2254     }
2255     } (CRO) {
2256     &_NumericCharacterReferenceV_
2257     ($doc => $doc, $vals => $vals);
2258    
2259     ~ (REFC) {
2260     ?lexmode AttributeValueLiteralA;
2261     } else {
2262     ?lexmode AttributeValueLiteralA;
2263     }
2264     } (ERO) {
2265     // TODO: Attribute value normalization
2266     &_GeneralEntityReferenceV_
2267     ($doc => $doc, $vals => $vals);
2268    
2269     ~ (REFC) {
2270     ?lexmode AttributeValueLiteralA;
2271     } else {
2272     ?lexmode AttributeValueLiteralA;
2273     }
2274     }
2275    
2276     // ~ (LITA) { }
2277     } // _AttributeValueSpecificationA_
2278    
2279     /*
2280 wakaba 1.11 Parsing replacement text of an entity referenced in
2281     an attribute value specification.
2282     */
2283     rule AttributeValueLiteralE_ ($parent, $vals)
2284     : recursive
2285     {
2286     // ?lexmode AttributeValueLiteralE;
2287    
2288     ~* (STRING) {
2289     lang:Perl ($value => $token.value) {
2290     $value =~ s/[\x09\x0A\x0D]/ /g;
2291 wakaba 1.31 $parent-><M::Node.manakaiAppendText> (\($value));
2292 wakaba 1.11 $vals->{value} .= $value;
2293     }
2294     } (HCRO) {
2295     &_HexadecimalCharacterReferenceAE_
2296     ($parent => $parent, $vals => $vals);
2297    
2298     ~ (REFC) {
2299     ?lexmode AttributeValueLiteralE;
2300     } else {
2301     ?lexmode AttributeValueLiteralE;
2302     }
2303     } (CRO) {
2304     &_NumericCharacterReferenceAE_
2305     ($parent => $parent, $vals => $vals);
2306    
2307     ~ (REFC) {
2308     ?lexmode AttributeValueLiteralE;
2309     } else {
2310     ?lexmode AttributeValueLiteralE;
2311     }
2312     } (ERO) {
2313     &_GeneralEntityReferenceAE_ ($parent => $parent, $vals => $vals);
2314    
2315     ~ (REFC) {
2316     ?lexmode AttributeValueLiteralE;
2317     } else {
2318     ?lexmode AttributeValueLiteralE;
2319     }
2320 wakaba 1.18 } (#INVALID == '<') {
2321     lang:Perl : has-error {
2322     my $location;
2323     __CODE{xp|get-location-from-token::
2324     $token => $token,
2325     $result => $location,
2326     }__;
2327     my $continue = __DOMCore:ERROR{xp|wf-no-lt-in-attribute-values::
2328     c|location => {$location},
2329     xp|token => {$token},
2330     }__;
2331     unless ($continue) {
2332 wakaba 1.27 __CODE{ParseError}__;
2333 wakaba 1.18 }
2334    
2335 wakaba 1.31 $parent-><M::Node.manakaiAppendText> ('<');
2336 wakaba 1.18 $vals->{value} .= '<';
2337     }
2338 wakaba 1.11 }
2339    
2340     // ~ (#EOF) { }
2341     } // AttributeValueLiteralE_
2342    
2343     /*
2344 wakaba 1.1 CDATA Section Content Parsing Mode
2345     */
2346     rule _CDATASection_ ($doc, $parent) {
2347     ?lexmode 'CDATASectionContent';
2348    
2349     my $cdata;
2350    
2351 wakaba 1.2 ~? (CData) {
2352 wakaba 1.1 lang:Perl ($data => $token.value) {
2353     $cdata = $data;
2354     }
2355     } else {
2356     lang:Perl {
2357     $cdata = '';
2358     }
2359     }
2360    
2361     lang:Perl {
2362     my $cdsect = $doc-><M::Document.createCDATASection>
2363     ($cdata);
2364     $parent-><M::Node.appendChild> ($cdsect);
2365     }
2366    
2367     // ~ (MSE) { }
2368     } // _CDATASection_
2369    
2370 wakaba 1.31 rule _NumericCharacterReference_ ($parent) {
2371 wakaba 1.1 ?lexmode 'NumericCharacterReference';
2372    
2373     ~ (NUMBER) {
2374 wakaba 1.3 lang:Perl ($num => $token.value) : has-error {
2375     $num += 0;
2376     unless (
2377     ($self->{xml_version} eq '1.0' and
2378     ((0x0020 <= $num and $num <= 0xD7FF) or
2379     (0xE000 <= $num and $num <= 0xFFFD) or
2380     (0x10000 <= $num and $num <= 0x10FFFF) or
2381     $num == 0x9 or $num == 0xA or $num == 0xD)) or
2382     ($self->{xml_version} eq '1.1' and
2383     ((0x0001 <= $num and $num <= 0xD7FF) or
2384     (0xE000 <= $num and $num <= 0xFFFD) or
2385     (0x10000 <= $num and $num <= 0x10FFFF)))
2386     ) {
2387     my $location;
2388     __CODE{xp|get-location-from-token::
2389     $token => $token,
2390     $result => $location,
2391     }__;
2392     my $continue = __DOMCore:ERROR{xp|wf-legal-character::
2393     DOMCore:location => {$location},
2394     xp|token => {$token},
2395     xp|character-number => {$num},
2396     xp|parent => {$parent},
2397     }__;
2398     unless ($continue) {
2399 wakaba 1.27 __CODE{ParseError}__;
2400 wakaba 1.3 }
2401     }
2402 wakaba 1.31 $parent-><M::Node.manakaiAppendText> (chr $num);
2403 wakaba 1.1 }
2404     }
2405    
2406     // ~ (REFC) { }
2407     } // _NumericCharacterReference_
2408    
2409     rule _NumericCharacterReferenceV_ ($doc, $vals) {
2410     ?lexmode 'NumericCharacterReference';
2411    
2412     ~ (NUMBER) {
2413 wakaba 1.3 lang:Perl ($num => $token.value) : has-error {
2414     $num += 0;
2415     unless (
2416     ($self->{xml_version} eq '1.0' and
2417     ((0x0020 <= $num and $num <= 0xD7FF) or
2418     (0xE000 <= $num and $num <= 0xFFFD) or
2419     (0x10000 <= $num and $num <= 0x10FFFF) or
2420     $num == 0x9 or $num == 0xA or $num == 0xD)) or
2421     ($self->{xml_version} eq '1.1' and
2422     ((0x0001 <= $num and $num <= 0xD7FF) or
2423     (0xE000 <= $num and $num <= 0xFFFD) or
2424     (0x10000 <= $num and $num <= 0x10FFFF)))
2425     ) {
2426     my $location;
2427     __CODE{xp|get-location-from-token::
2428     $token => $token,
2429     $result => $location,
2430     }__;
2431     my $continue = __DOMCore:ERROR{xp|wf-legal-character::
2432     DOMCore:location => {$location},
2433     xp|token => {$token},
2434     xp|character-number => {$num},
2435     }__;
2436     unless ($continue) {
2437 wakaba 1.27 __CODE{ParseError}__;
2438 wakaba 1.3 }
2439     }
2440 wakaba 1.1 my $ncr = $doc-><M::Document.createTextNode>
2441 wakaba 1.9 (my $char = chr $num);
2442 wakaba 1.1 push @{$vals->{nodes}}, $ncr;
2443     $vals->{value} .= $char;
2444     }
2445     }
2446    
2447     // ~ (REFC) { }
2448     } // _NumericCharacterReferenceV_
2449    
2450 wakaba 1.11 /*
2451     Numeric character reference in the replacement text
2452     of the entity referenced in an attribute value specification
2453     */
2454     rule _NumericCharacterReferenceAE_ ($parent, $vals)
2455     {
2456     ?lexmode NumericCharacterReference;
2457    
2458     ~ (NUMBER) {
2459     lang:Perl ($num => $token.value) : has-error {
2460     $num += 0;
2461     unless (
2462     ($self->{xml_version} eq '1.0' and
2463     ((0x0020 <= $num and $num <= 0xD7FF) or
2464     (0xE000 <= $num and $num <= 0xFFFD) or
2465     (0x10000 <= $num and $num <= 0x10FFFF) or
2466     $num == 0x9 or $num == 0xA or $num == 0xD)) or
2467     ($self->{xml_version} eq '1.1' and
2468     ((0x0001 <= $num and $num <= 0xD7FF) or
2469     (0xE000 <= $num and $num <= 0xFFFD) or
2470     (0x10000 <= $num and $num <= 0x10FFFF)))
2471     ) {
2472     my $location;
2473     __CODE{xp|get-location-from-token::
2474     $token => $token,
2475     $result => $location,
2476     }__;
2477     my $continue = __DOMCore:ERROR{xp|wf-legal-character::
2478     DOMCore:location => {$location},
2479     xp|token => {$token},
2480     xp|character-number => {$num},
2481     }__;
2482     unless ($continue) {
2483 wakaba 1.27 __CODE{ParseError}__;
2484 wakaba 1.11 }
2485     }
2486 wakaba 1.31 my $char = chr $num;
2487     $parent-><M::Node.manakaiAppendText> (\$char);
2488 wakaba 1.11 $vals->{value} .= $char;
2489     }
2490     }
2491    
2492     // ~ (REFC) { }
2493     } // _NumericCharacterReferenceAE_
2494    
2495     rule _NumericCharacterReferenceEV_ ($vals)
2496     {
2497     ?lexmode 'NumericCharacterReference';
2498    
2499     ~ (NUMBER) {
2500     lang:Perl ($num => $token.value) : has-error {
2501     $num += 0;
2502     unless (
2503     ($self->{xml_version} eq '1.0' and
2504     ((0x0020 <= $num and $num <= 0xD7FF) or
2505     (0xE000 <= $num and $num <= 0xFFFD) or
2506     (0x10000 <= $num and $num <= 0x10FFFF) or
2507     $num == 0x9 or $num == 0xA or $num == 0xD)) or
2508     ($self->{xml_version} eq '1.1' and
2509     ((0x0001 <= $num and $num <= 0xD7FF) or
2510     (0xE000 <= $num and $num <= 0xFFFD) or
2511     (0x10000 <= $num and $num <= 0x10FFFF)))
2512     ) {
2513     my $location;
2514     __CODE{xp|get-location-from-token::
2515     $token => $token,
2516     $result => $location,
2517     }__;
2518     my $continue = __DOMCore:ERROR{xp|wf-legal-character::
2519     DOMCore:location => {$location},
2520     xp|token => {$token},
2521     xp|character-number => {$num},
2522     }__;
2523     unless ($continue) {
2524 wakaba 1.27 __CODE{ParseError}__;
2525 wakaba 1.11 }
2526     }
2527     push @{$vals}, chr $num;
2528     }
2529     }
2530    
2531     // ~ (REFC) { }
2532     } // _NumericCharacterReferenceEV_
2533    
2534 wakaba 1.31 rule _HexadecimalCharacterReference_ ($parent) {
2535 wakaba 1.1 ?lexmode 'HexadecimalCharacterReference';
2536    
2537     ~ (Hex) {
2538 wakaba 1.9 lang:Perl ($v => $token.value) : has-error {
2539     my $num = hex $v;
2540 wakaba 1.3 unless (
2541     ($self->{xml_version} eq '1.0' and
2542     ((0x0020 <= $num and $num <= 0xD7FF) or
2543     (0xE000 <= $num and $num <= 0xFFFD) or
2544     (0x10000 <= $num and $num <= 0x10FFFF) or
2545     $num == 0x9 or $num == 0xA or $num == 0xD)) or
2546     ($self->{xml_version} eq '1.1' and
2547     ((0x0001 <= $num and $num <= 0xD7FF) or
2548     (0xE000 <= $num and $num <= 0xFFFD) or
2549     (0x10000 <= $num and $num <= 0x10FFFF)))
2550     ) {
2551     my $location;
2552     __CODE{xp|get-location-from-token::
2553     $token => $token,
2554     $result => $location,
2555     }__;
2556     my $continue = __DOMCore:ERROR{xp|wf-legal-character::
2557     DOMCore:location => {$location},
2558     xp|token => {$token},
2559     xp|character-number => {$num},
2560     xp|parent => {$parent},
2561     }__;
2562     unless ($continue) {
2563 wakaba 1.27 __CODE{ParseError}__;
2564 wakaba 1.3 }
2565     }
2566 wakaba 1.31 $parent-><M::Node.manakaiAppendText> (chr $num);
2567 wakaba 1.1 }
2568     }
2569    
2570     // ~ (REFC) { }
2571     } // _HexadecimalCharacterReference_
2572    
2573 wakaba 1.3 rule _HexadecimalCharacterReferenceV_ ($doc, $vals) {
2574 wakaba 1.1 ?lexmode 'HexadecimalCharacterReference';
2575    
2576     ~ (Hex) {
2577 wakaba 1.9 lang:Perl ($v => $token.value) : has-error {
2578     my $num = hex $v;
2579 wakaba 1.3 unless (
2580     ($self->{xml_version} eq '1.0' and
2581     ((0x0020 <= $num and $num <= 0xD7FF) or
2582     (0xE000 <= $num and $num <= 0xFFFD) or
2583     (0x10000 <= $num and $num <= 0x10FFFF) or
2584     $num == 0x9 or $num == 0xA or $num == 0xD)) or
2585     ($self->{xml_version} eq '1.1' and
2586     ((0x0001 <= $num and $num <= 0xD7FF) or
2587     (0xE000 <= $num and $num <= 0xFFFD) or
2588     (0x10000 <= $num and $num <= 0x10FFFF)))
2589     ) {
2590     my $location;
2591     __CODE{xp|get-location-from-token::
2592     $token => $token,
2593     $result => $location,
2594     }__;
2595     my $continue = __DOMCore:ERROR{xp|wf-legal-character::
2596     DOMCore:location => {$location},
2597     xp|token => {$token},
2598     xp|character-number => {$num},
2599     }__;
2600     unless ($continue) {
2601 wakaba 1.27 __CODE{ParseError}__;
2602 wakaba 1.3 }
2603     }
2604 wakaba 1.1 my $ncr = $doc-><M::Document.createTextNode>
2605 wakaba 1.9 (my $char = chr $num);
2606 wakaba 1.1 push @{$vals->{nodes}}, $ncr;
2607     $vals->{value} .= $char;
2608     }
2609     }
2610    
2611     // ~ (REFC) { }
2612 wakaba 1.11 } // _HexadecimalCharacterReferenceV_
2613    
2614     /*
2615     Hexadecimal character reference in the replacement text
2616     of the entity referenced in an attribute value literal
2617     */
2618     rule _HexadecimalCharacterReferenceAE_ ($parent, $vals)
2619     {
2620     ?lexmode HexadecimalCharacterReference;
2621    
2622     ~ (Hex) {
2623     lang:Perl ($v => $token.value) : has-error {
2624     my $num = hex $v;
2625     unless (
2626     ($self->{xml_version} eq '1.0' and
2627     ((0x0020 <= $num and $num <= 0xD7FF) or
2628     (0xE000 <= $num and $num <= 0xFFFD) or
2629     (0x10000 <= $num and $num <= 0x10FFFF) or
2630     $num == 0x9 or $num == 0xA or $num == 0xD)) or
2631     ($self->{xml_version} eq '1.1' and
2632     ((0x0001 <= $num and $num <= 0xD7FF) or
2633     (0xE000 <= $num and $num <= 0xFFFD) or
2634     (0x10000 <= $num and $num <= 0x10FFFF)))
2635     ) {
2636     my $location;
2637     __CODE{xp|get-location-from-token::
2638     $token => $token,
2639     $result => $location,
2640     }__;
2641     my $continue = __DOMCore:ERROR{xp|wf-legal-character::
2642     DOMCore:location => {$location},
2643     xp|token => {$token},
2644     xp|character-number => {$num},
2645     }__;
2646     unless ($continue) {
2647 wakaba 1.27 __CODE{ParseError}__;
2648 wakaba 1.11 }
2649     }
2650 wakaba 1.31 my $char = chr $num;
2651     $parent-><M::Node.manakaiAppendText> (\$char);
2652 wakaba 1.11 $vals->{value} .= $char;
2653     }
2654     }
2655    
2656     // ~ (REFC) { }
2657     } // _HexadecimalCharacterReferenceAE_
2658    
2659     rule _HexadecimalCharacterReferenceEV_ ($vals) {
2660     ?lexmode HexadecimalCharacterReference;
2661    
2662     ~ (Hex) {
2663     lang:Perl ($v => $token.value) : has-error {
2664     my $num = hex $v;
2665     unless (
2666     ($self->{xml_version} eq '1.0' and
2667     ((0x0020 <= $num and $num <= 0xD7FF) or
2668     (0xE000 <= $num and $num <= 0xFFFD) or
2669     (0x10000 <= $num and $num <= 0x10FFFF) or
2670     $num == 0x9 or $num == 0xA or $num == 0xD)) or
2671     ($self->{xml_version} eq '1.1' and
2672     ((0x0001 <= $num and $num <= 0xD7FF) or
2673     (0xE000 <= $num and $num <= 0xFFFD) or
2674     (0x10000 <= $num and $num <= 0x10FFFF)))
2675     ) {
2676     my $location;
2677     __CODE{xp|get-location-from-token::
2678     $token => $token,
2679     $result => $location,
2680     }__;
2681     my $continue = __DOMCore:ERROR{xp|wf-legal-character::
2682     DOMCore:location => {$location},
2683     xp|token => {$token},
2684     xp|character-number => {$num},
2685     }__;
2686     unless ($continue) {
2687 wakaba 1.27 __CODE{ParseError}__;
2688 wakaba 1.11 }
2689     }
2690     push @{$vals}, chr $num;
2691     }
2692     }
2693    
2694     // ~ (REFC) { }
2695     } // _HexadecimalCharacterReferenceEV_
2696    
2697     /*
2698     General entity reference in element's content
2699     */
2700     rule _GeneralEntityReferenceEC ($doc, $parent, $ns)
2701     : recursive
2702     {
2703     ?lexmode 'EntityReference';
2704    
2705     ~ (Name == 'lt') {
2706     lang:Perl {
2707 wakaba 1.31 $parent-><M::Node.manakaiAppendText> ('<');
2708 wakaba 1.11 }
2709     } (Name == 'gt') {
2710     lang:Perl {
2711 wakaba 1.31 $parent-><M::Node.manakaiAppendText> ('>');
2712 wakaba 1.11 }
2713     } (Name == 'amp') {
2714     lang:Perl {
2715 wakaba 1.31 $parent-><M::Node.manakaiAppendText> ('&');
2716 wakaba 1.11 }
2717     } (Name == 'quot') {
2718     lang:Perl {
2719 wakaba 1.31 $parent-><M::Node.manakaiAppendText> ('"');
2720 wakaba 1.11 }
2721     } (Name == 'apos') {
2722     lang:Perl {
2723 wakaba 1.31 $parent-><M::Node.manakaiAppendText> ("'");
2724 wakaba 1.11 }
2725     } (Name) {
2726     my $er;
2727 wakaba 1.19 lang:Perl ($name => $token.value) : has-error {
2728 wakaba 1.26 __CODE{checkNCName:: $name => $name}__;
2729    
2730 wakaba 1.11 $er = $doc-><M::Document.createEntityReference>
2731     ($name);
2732 wakaba 1.35 $er-><M::Node.manakaiSetReadOnly> (false, true);
2733 wakaba 1.20 $er-><AS::Node.textContent> ('');
2734     ## NOTE: When document entity (and entities referenced directly
2735     ## or indirectly from it) is parsed, no general entity
2736     ## node have its replacement tree. During general
2737     ## entity node collection construction, however,
2738     ## some entity node has replacement tree.
2739 wakaba 1.11 $parent-><M::Node.appendChild> ($er);
2740 wakaba 1.19
2741     my $ent = $self->{general_entity}->{$name};
2742     if (not $ent) { # no entity declaration
2743     if ($self->{standalone} or not $self->{has_xref}) { # WFC error
2744     my $location;
2745     __CODE{xp|get-location-from-token::
2746     $token => {$token},
2747     $result => {$location},
2748     }__;
2749     my $continue = __DOMCore:ERROR{xp|wf-entity-declared::
2750     xp|error-token => {$token},
2751     c|location => {$location},
2752     xp|name => {$name},
2753     }__;
2754     unless ($continue) {
2755 wakaba 1.27 __CODE{ParseError}__;
2756 wakaba 1.19 }
2757     } # Otherwise VC error
2758 wakaba 1.23 push @{$self->{entity}}, <Code::getEmptyEntityState::
2759     $name = $name>;
2760 wakaba 1.35 $er-><AS::GERef.manakaiExpanded> (false);
2761 wakaba 1.19
2762     } else { # there IS entity declaration
2763     if (($self->{standalone} or not $self->{has_xref}) and
2764     $ent->{is_externally_declared} and
2765     not $self->{entity}->[-1]->{is_externally_declared}) {
2766     my $location;
2767     __CODE{xp|get-location-from-token::
2768     $token => {$token},
2769     $result => {$location},
2770     }__;
2771     my $continue = __DOMCore:ERROR{xp|wf-entity-declared::
2772     xp|error-token => {$token},
2773     c|location => {$location},
2774     xp|name => {$name},
2775     }__;
2776     unless ($continue) {
2777 wakaba 1.27 __CODE{ParseError}__;
2778 wakaba 1.19 }
2779     }
2780 wakaba 1.35 $er-><AS::GERef.manakaiExpanded>
2781 wakaba 1.19 ($ent->{has_replacement_text});
2782     push @{$self->{entity}}, <Code::getCopyOfEntityState::
2783 wakaba 1.11 $entity_type = 'general_entity',
2784     $entity_name = $name>;
2785 wakaba 1.23
2786     if (defined $ent->{notation}) {
2787     my $location;
2788     __CODE{xp|get-location-from-token::
2789     $token => {$token},
2790     $result => {$location},
2791     }__;
2792     my $continue = __c|ERROR{xp|wf-parsed-entity::
2793     xp|error-token => {$token},
2794     c|location => {$location},
2795     xp|name => {$name},
2796     }__;
2797     unless ($continue) {
2798 wakaba 1.27 __CODE{ParseError}__;
2799 wakaba 1.23 }
2800     } # if unparsed entity
2801    
2802     if ($ent->{is_opened}) {
2803     my $location;
2804     __CODE{xp|get-location-from-token::
2805     $token => {$token},
2806     $result => {$location},
2807     }__;
2808     my $continue = __c|ERROR{xp|wf-no-recursion::
2809     xp|error-token => {$token},
2810     c|location => {$location},
2811     xp|name => {$name},
2812     }__;
2813     unless ($continue) {
2814 wakaba 1.27 __CODE{ParseError}__;
2815 wakaba 1.23 }
2816 wakaba 1.27 open my $empty, '<', \'';
2817     $self->{entity}->[-1]->{fh} = $empty;
2818 wakaba 1.35 $er-><AS::GERef.manakaiExpanded> (false);
2819 wakaba 1.23 } # recursive
2820     $ent->{is_opened} = true;
2821     } # entity declared
2822 wakaba 1.14 $self->{location} = $self->{entity}->[-1];
2823 wakaba 1.11 push @{$self->{entity_token}}, $self->{token};
2824     $self->{token} = [];
2825     push @{$self->{entity_char}}, $self->{char};
2826     $self->{char} = [];
2827     }
2828    
2829     ?lexmode ElementContent;
2830     &content ($doc => $doc, $parent => $er, $ns => $ns);
2831     ~ (#EOF) { }
2832     lang:Perl {
2833 wakaba 1.23 $self->{general_entity}->{$self->{entity}->[-1]->{name}}
2834     ->{is_opened} = false
2835     if $self->{general_entity}->{$self->{entity}->[-1]->{name}};
2836 wakaba 1.11 $self->{token} = pop @{$self->{entity_token}};
2837     $self->{char} = pop @{$self->{entity_char}};
2838 wakaba 1.27 pop (@{$self->{entity}})->{close_file}->();
2839 wakaba 1.14 $self->{location} = $self->{entity}->[-1];
2840 wakaba 1.35
2841     $er-><M::Node.manakaiSetReadOnly> (true, true);
2842 wakaba 1.11 }
2843    
2844     ?lexmode EntityReference;
2845     ?requires-next-token;
2846     }
2847    
2848     ~ (REFC) {
2849     ?lexmode ElementContent;
2850     } else {
2851     ?lexmode ElementContent;
2852     }
2853     } // _GeneralEntityReferenceEC
2854    
2855     /*
2856     General entity reference in an attribute value literal
2857     */
2858     rule _GeneralEntityReferenceV_ ($vals) {
2859     ?lexmode EntityReference;
2860    
2861     ~ (Name == 'lt') {
2862     lang:Perl {
2863     push @{$vals->{nodes}}, $self->{doc}-><M::Document.createTextNode>
2864     ('<');
2865     $vals->{value} .= '<';
2866     }
2867     } (Name == 'gt') {
2868     lang:Perl {
2869     push @{$vals->{nodes}}, $self->{doc}-><M::Document.createTextNode>
2870     ('>');
2871     $vals->{value} .= '>';
2872     }
2873     } (Name == 'amp') {
2874     lang:Perl {
2875     push @{$vals->{nodes}}, $self->{doc}-><M::Document.createTextNode>
2876     ('&');
2877     $vals->{value} .= '&';
2878     }
2879     } (Name == 'quot') {
2880     lang:Perl {
2881     push @{$vals->{nodes}}, $self->{doc}-><M::Document.createTextNode>
2882     ('"');
2883     $vals->{value} .= '"';
2884     }
2885     } (Name == 'apos') {
2886     lang:Perl {
2887     push @{$vals->{nodes}}, $self->{doc}-><M::Document.createTextNode>
2888     ("'");
2889     $vals->{value} .= "'";
2890     }
2891     } (Name) {
2892     my $er;
2893 wakaba 1.18 lang:Perl ($name => $token.value) : has-error {
2894 wakaba 1.26 __CODE{checkNCName:: $name => $name}__;
2895 wakaba 1.18
2896 wakaba 1.11 $er = $self->{doc}-><M::Document.createEntityReference> ($name);
2897 wakaba 1.35 $er-><M::Node.manakaiSetReadOnly> (false, true);
2898 wakaba 1.20 $er-><AS::Node.textContent> ('');
2899     ## NOTE: When document entity (and entities referenced directly
2900     ## or indirectly from it) is parsed, no general entity
2901     ## node have its replacement tree. During general
2902     ## entity node collection construction, however,
2903     ## some entity node has replacement tree.
2904 wakaba 1.19 my $ent = $self->{general_entity}->{$name};
2905 wakaba 1.20 if (not $ent) { # no entity declaration
2906     if ($self->{standalone} or not $self->{has_xref}) { # WFC error
2907     my $location;
2908     __CODE{xp|get-location-from-token::
2909     $token => {$token},
2910     $result => {$location},
2911     }__;
2912     my $continue = __DOMCore:ERROR{xp|wf-entity-declared::
2913     xp|error-token => {$token},
2914     c|location => {$location},
2915     xp|name => {$name},
2916     }__;
2917     unless ($continue) {
2918 wakaba 1.27 __CODE{ParseError}__;
2919 wakaba 1.20 }
2920     } # Otherwise VC error
2921 wakaba 1.23 push @{$self->{entity}}, <Code::getEmptyEntityState::
2922     $name = $name>;
2923 wakaba 1.35 $er-><AS::GERef.manakaiExpanded> (false);
2924 wakaba 1.20
2925     } else { # there IS entity declaration
2926     if (($self->{standalone} or not $self->{has_xref}) and
2927     $ent->{is_externally_declared} and
2928     not $self->{entity}->[-1]->{is_externally_declared}) {
2929     my $location;
2930     __CODE{xp|get-location-from-token::
2931     $token => {$token},
2932     $result => {$location},
2933     }__;
2934     my $continue = __DOMCore:ERROR{xp|wf-entity-declared::
2935     xp|error-token => {$token},
2936     c|location => {$location},
2937     xp|name => {$name},
2938     }__;
2939     unless ($continue) {
2940 wakaba 1.27 __CODE{ParseError}__;
2941 wakaba 1.20 }
2942     }
2943    
2944     if ($ent->{is_external_entity}) {
2945     my $location;
2946     __CODE{xp|get-location-from-token::
2947     $token => {$token},
2948     $result => {$location},
2949     }__;
2950     my $continue = __c|ERROR{xp|wf-no-external-entity-references::
2951     xp|error-token => {$token},
2952     c|location => {$location},
2953     xp|name => {$name},
2954     }__;
2955     unless ($continue) {
2956 wakaba 1.27 __CODE{ParseError}__;
2957 wakaba 1.20 }
2958 wakaba 1.23 ## NOTE: |xp:wf-parsed-entity| is not checked
2959 wakaba 1.20 } # if external entity
2960    
2961 wakaba 1.35 $er-><AS::GERef.manakaiExpanded>
2962 wakaba 1.19 ($ent->{has_replacement_text});
2963 wakaba 1.20 push @{$self->{entity}}, <Code::getCopyOfEntityState::
2964 wakaba 1.11 $entity_type = 'general_entity',
2965     $entity_name = $name>;
2966 wakaba 1.23
2967     if ($ent->{is_opened}) {
2968     my $location;
2969     __CODE{xp|get-location-from-token::
2970     $token => {$token},
2971     $result => {$location},
2972     }__;
2973     my $continue = __c|ERROR{xp|wf-no-recursion::
2974     xp|error-token => {$token},
2975     c|location => {$location},
2976     xp|name => {$name},
2977     }__;
2978     unless ($continue) {
2979 wakaba 1.27 __CODE{ParseError}__;
2980 wakaba 1.23 }
2981 wakaba 1.27 open my $empty, '<', \'';
2982     $self->{entity}->[-1]->{fh} = $empty;
2983 wakaba 1.35 $er-><AS::GERef.manakaiExpanded> (false);
2984 wakaba 1.23 } # recursive
2985     $ent->{is_opened} = true;
2986 wakaba 1.20 }
2987     push @{$vals->{nodes}}, $er;
2988 wakaba 1.14 $self->{location} = $self->{entity}->[-1];
2989 wakaba 1.11 push @{$self->{entity_token}}, $self->{token};
2990     $self->{token} = [];
2991     push @{$self->{entity_char}}, $self->{char};
2992     $self->{char} = [];
2993     }
2994    
2995     ?lexmode AttributeValueLiteralE;
2996     &AttributeValueLiteralE_ ($parent => $er, $vals => $vals);
2997     ~ (#EOF) { }
2998     lang:Perl {
2999 wakaba 1.23 $self->{general_entity}->{$self->{entity}->[-1]->{name}}
3000     ->{is_opened} = false
3001     if $self->{general_entity}->{$self->{entity}->[-1]->{name}};
3002 wakaba 1.11 $self->{token} = pop @{$self->{entity_token}};
3003     $self->{char} = pop @{$self->{entity_char}};
3004 wakaba 1.27 pop (@{$self->{entity}})->{close_file}->();
3005 wakaba 1.14 $self->{location} = $self->{entity}->[-1];
3006 wakaba 1.35
3007     $er-><M::Node.manakaiSetReadOnly> (true, true);
3008 wakaba 1.11 }
3009    
3010     ?lexmode EntityReference;
3011     ?requires-next-token;
3012     }
3013    
3014     // ~ (REFC) { }
3015     } // _GeneralEntityReferenceV_
3016 wakaba 1.1
3017 wakaba 1.6 /*
3018 wakaba 1.11 General entity reference in the replacement text
3019     of the entity referenced in an attribute value literal
3020 wakaba 1.6 */
3021 wakaba 1.11 rule _GeneralEntityReferenceAE_ ($parent, $vals)
3022 wakaba 1.6 {
3023 wakaba 1.11 ?lexmode EntityReference;
3024 wakaba 1.1
3025 wakaba 1.11 ~ (Name == 'lt') {
3026     lang:Perl {
3027 wakaba 1.31 $parent-><M::Node.manakaiAppendText> ('<');
3028 wakaba 1.11 $vals->{value} .= '<';
3029     }
3030     } (Name == 'gt') {
3031     lang:Perl {
3032 wakaba 1.31 $parent-><M::Node.manakaiAppendText> ('>');
3033 wakaba 1.11 $vals->{value} .= '>';
3034     }
3035     } (Name == 'amp') {
3036     lang:Perl {
3037 wakaba 1.31 $parent-><M::Node.manakaiAppendText> ('&');
3038 wakaba 1.11 $vals->{value} .= '&';
3039     }
3040     } (Name == 'quot') {
3041     lang:Perl {
3042 wakaba 1.31 $parent-><M::Node.manakaiAppendText> ('"');
3043 wakaba 1.11 $vals->{value} .= '"';
3044     }
3045     } (Name == 'apos') {
3046     lang:Perl {
3047 wakaba 1.31 $parent-><M::Node.manakaiAppendText> ("'");
3048 wakaba 1.11 $vals->{value} .= "'";
3049     }
3050     } (Name) {
3051 wakaba 1.6 my $er;
3052 wakaba 1.26 lang:Perl ($name => $token.value) : has-error {
3053     __CODE{checkNCName:: $name => $name}__;
3054 wakaba 1.18
3055 wakaba 1.11 $er = $self->{doc}-><M::Document.createEntityReference> ($name);
3056 wakaba 1.35 $er-><M::Node.manakaiSetReadOnly> (false, true);
3057 wakaba 1.20 $er-><AS::Node.textContent> ('');
3058     ## NOTE: When document entity (and entities referenced directly
3059     ## or indirectly from it) is parsed, no general entity
3060     ## node have its replacement tree. During general
3061     ## entity node collection construction, however,
3062     ## some entity node has replacement tree.
3063 wakaba 1.19 my $ent = $self->{general_entity}->{$name};
3064 wakaba 1.22 if (not $ent) { # no entity declaration
3065     if ($self->{standalone} or not $self->{has_xref}) { # WFC error
3066     my $location;
3067     __CODE{xp|get-location-from-token::
3068     $token => {$token},
3069     $result => {$location},
3070     }__;
3071     my $continue = __DOMCore:ERROR{xp|wf-entity-declared::
3072     xp|error-token => {$token},
3073     c|location => {$location},
3074     xp|name => {$name},
3075     }__;
3076     unless ($continue) {
3077 wakaba 1.27 __CODE{ParseError}__;
3078 wakaba 1.22 }
3079     } # Otherwise VC error
3080 wakaba 1.23 push @{$self->{entity}}, <Code::getEmptyEntityState::
3081     $name = $name>;
3082 wakaba 1.35 $er-><AS::GERef.manakaiExpanded> (false);
3083 wakaba 1.22
3084     } else { # there IS entity declaration
3085     if (($self->{standalone} or not $self->{has_xref}) and
3086     $ent->{is_externally_declared} and
3087     not $self->{entity}->[-1]->{is_externally_declared}) {
3088     my $location;
3089     __CODE{xp|get-location-from-token::
3090     $token => {$token},
3091     $result => {$location},
3092     }__;
3093     my $continue = __DOMCore:ERROR{xp|wf-entity-declared::
3094     xp|error-token => {$token},
3095     c|location => {$location},
3096     xp|name => {$name},
3097     }__;
3098     unless ($continue) {
3099 wakaba 1.27 __CODE{ParseError}__;
3100 wakaba 1.22 }
3101     }
3102    
3103     if ($ent->{is_external_entity}) {
3104     my $location;
3105     __CODE{xp|get-location-from-token::
3106     $token => {$token},
3107     $result => {$location},
3108     }__;
3109     my $continue = __c|ERROR{xp|wf-no-external-entity-references::
3110     xp|error-token => {$token},
3111     c|location => {$location},
3112     xp|name => {$name},
3113     }__;
3114     unless ($continue) {
3115 wakaba 1.27 __CODE{ParseError}__;
3116 wakaba 1.22 }
3117 wakaba 1.23 ## NOTE: |xp:wf-parsed-entity| is not checked
3118 wakaba 1.22 } # if external entity
3119    
3120 wakaba 1.35 $er-><AS::GERef.manakaiExpanded>
3121 wakaba 1.19 ($ent->{has_replacement_text});
3122 wakaba 1.22 push @{$self->{entity}}, <Code::getCopyOfEntityState::
3123 wakaba 1.6 $entity_type = 'general_entity',
3124     $entity_name = $name>;
3125 wakaba 1.23
3126     if ($ent->{is_opened}) {
3127     my $location;
3128     __CODE{xp|get-location-from-token::
3129     $token => {$token},
3130     $result => {$location},
3131     }__;
3132     my $continue = __c|ERROR{xp|wf-no-recursion::
3133     xp|error-token => {$token},
3134     c|location => {$location},
3135     xp|name => {$name},
3136     }__;
3137     unless ($continue) {
3138 wakaba 1.27 __CODE{ParseError}__;
3139 wakaba 1.23 }
3140 wakaba 1.27 open my $empty, '<', \'';
3141     $self->{entity}->[-1]->{fh} = $empty;
3142 wakaba 1.35 $er-><AS::GERef.manakaiExpanded> (false);
3143 wakaba 1.23 } # recursive
3144     $ent->{is_opened} = true;
3145 wakaba 1.22 }
3146     $parent-><M::Node.appendChild> ($er);
3147 wakaba 1.14 $self->{location} = $self->{entity}->[-1];
3148 wakaba 1.6 push @{$self->{entity_token}}, $self->{token};
3149     $self->{token} = [];
3150     push @{$self->{entity_char}}, $self->{char};
3151     $self->{char} = [];
3152     }
3153    
3154 wakaba 1.11 ?lexmode AttributeValueLiteralE;
3155     &AttributeValueLiteralE_ ($parent => $er, $vals => $vals);
3156 wakaba 1.6 ~ (#EOF) { }
3157     lang:Perl {
3158 wakaba 1.23 $self->{general_entity}->{$self->{entity}->[-1]->{name}}
3159     ->{is_opened} = false
3160     if $self->{general_entity}->{$self->{entity}->[-1]->{name}};
3161 wakaba 1.6 $self->{token} = pop @{$self->{entity_token}};
3162     $self->{char} = pop @{$self->{entity_char}};
3163 wakaba 1.27 pop (@{$self->{entity}})->{close_file}->();
3164 wakaba 1.14 $self->{location} = $self->{entity}->[-1];
3165 wakaba 1.35
3166     $er-><M::Node.manakaiSetReadOnly> (true, true);
3167 wakaba 1.6 }
3168    
3169     ?lexmode EntityReference;
3170     ?requires-next-token;
3171 wakaba 1.1 }
3172    
3173     // ~ (REFC) { }
3174 wakaba 1.11 } // _GeneralEntityReferenceAE_
3175 wakaba 1.6
3176     /*
3177 wakaba 1.24 General Entity Reference in Literal Entity Value in Entity Declaration
3178 wakaba 1.6 */
3179 wakaba 1.11 rule _GeneralEntityReferenceEV_ ($vals) {
3180 wakaba 1.6 ?lexmode 'EntityReference';
3181    
3182     ~ (Name) {
3183     lang:Perl ($name => $token.value) {
3184 wakaba 1.26 __CODE{checkNCName:: $name => $name}__;
3185 wakaba 1.6 push @$vals, $name;
3186     }
3187 wakaba 1.24 /*
3188     WFCs such as Entity Declared are not checked
3189     <http://www.w3.org/TR/xml11/#bypass>
3190    
3191     Note that violation to the Parsed Entity WFC is an error
3192     rather than fatal error here.
3193     */
3194 wakaba 1.6 }
3195 wakaba 1.11
3196     // No expansion
3197 wakaba 1.6
3198     // ~ (REFC) { }
3199     } // _GeneralEntityReferenceEV_
3200 wakaba 1.1
3201     /*
3202 wakaba 1.4 Document Type Declaration
3203 wakaba 1.1 */
3204 wakaba 1.4 rule _DocumentTypeDeclaration_ ($doc) {
3205     ?lexmode MarkupDeclaration;
3206    
3207     ~ (Name == 'DOCTYPE') { }
3208    
3209     ~ (S) { }
3210    
3211     // Document type name
3212 wakaba 1.6 my $name;
3213 wakaba 1.4 ~ (Name) {
3214 wakaba 1.6 lang:Perl ($v => $token.value) {
3215 wakaba 1.26 __CODE{checkQName:: $name => $v}__;
3216 wakaba 1.6 $name = $v;
3217     }
3218     }
3219 wakaba 1.17
3220     my $node;
3221     my $decl;
3222 wakaba 1.6 lang:Perl {
3223 wakaba 1.11 $self->{docx} = $self->{doc}
3224     -><M::Node.getFeature> (<Q::fe:XDoctype>, '3.0');
3225     $node = $self->{docx}-><M::DocumentXDoctype.createDocumentTypeDefinition>
3226     ($name);
3227 wakaba 1.17 $decl = $self->{dtdecl} = $node-><M::Node.getFeature>
3228     (<Q::fe:XDoctypeDeclaration>, '3.0');
3229 wakaba 1.4 }
3230    
3231 wakaba 1.25 my $has_extid;
3232 wakaba 1.4 ~? (S) {
3233     ~? (Name == 'PUBLIC') {
3234     ~ (S) { }
3235    
3236 wakaba 1.17 &PubidLiteral ($decl => $decl);
3237 wakaba 1.4
3238     ~ (S) { }
3239    
3240 wakaba 1.17 &SystemLiteral ($decl => $decl);
3241 wakaba 1.4
3242     ~? (S) { }
3243 wakaba 1.19
3244     lang:Perl {
3245     $self->{has_xref} = true;
3246 wakaba 1.25 $has_extid = true;
3247 wakaba 1.19 }
3248 wakaba 1.4 } (Name == 'SYSTEM') {
3249     ~ (S) { }
3250    
3251 wakaba 1.17 &SystemLiteral ($decl => $decl);
3252 wakaba 1.4
3253     ~? (S) { }
3254 wakaba 1.19
3255     lang:Perl {
3256     $self->{has_xref} = true;
3257 wakaba 1.25 $has_extid = true;
3258 wakaba 1.19 }
3259 wakaba 1.4 }
3260     }
3261 wakaba 1.17
3262 wakaba 1.11 lang:Perl {
3263     $self->{dtdef} = $node;
3264 wakaba 1.21 $self->{doc}-><M::Node.appendChild> ($node);
3265     $self->{doc_cfg}-><M::c|DOMConfiguration.setParameter>
3266     ('schema-type' => <Q::xml-dtd:>);
3267     ## ISSUE: Should default schema language information be
3268     ## preserved by some other flag?
3269 wakaba 1.11 }
3270    
3271 wakaba 1.4 ~? (DSO) {
3272 wakaba 1.6 &InternalSubset ($doc => $doc, $doctype => $node);
3273 wakaba 1.4
3274     ~ (DSC) {
3275     ?lexmode MarkupDeclaration;
3276     } else {
3277     ?lexmode MarkupDeclaration;
3278     }
3279    
3280     ~? (S) { }
3281     }
3282    
3283 wakaba 1.25 // TODO: Read and process external subset if any.
3284     lang:Perl {
3285     $self->{dont_process} = true if $has_extid;
3286 wakaba 1.35 $node-><M::Node.manakaiSetReadOnly> (true, true);
3287 wakaba 1.25 }
3288    
3289 wakaba 1.4 // ~ (MDC) { }
3290     } // _DocumentTypeDeclaration_
3291    
3292 wakaba 1.17 /*
3293     Public Identifier Literal
3294     */
3295     rule PubidLiteral ($decl) {
3296     my $pubid;
3297     my $pubid_token;
3298 wakaba 1.4 ~ (LIT) {
3299     ?lexmode SystemLiteral;
3300    
3301     ~? (STRING) {
3302 wakaba 1.17 lang:Perl ($v => $token.value) {
3303     $pubid = $v;
3304     $pubid_token = $token;
3305     }
3306 wakaba 1.4 }
3307    
3308     ~ (LIT) {
3309     ?lexmode MarkupDeclaration;
3310     } else {
3311     ?lexmode MarkupDeclaration;
3312     }
3313     } (LITA) {
3314     ?lexmode SystemLiteralA;
3315    
3316     ~? (STRING) {
3317 wakaba 1.17 lang:Perl ($v => $token.value) {
3318     $pubid = $v;
3319     $pubid_token = $token;
3320     }
3321 wakaba 1.4 }
3322    
3323     ~ (LITA) {
3324     ?lexmode MarkupDeclaration;
3325     } else {
3326     ?lexmode MarkupDeclaration;
3327     }
3328     }
3329 wakaba 1.17
3330     if-true ($pubid_token) {
3331     lang:Perl : has-error {
3332     if ($pubid =~ m{[^\x20\x0D\x0Aa-zA-Z0-9'()+,./:=?;!*#\@\$_%-]}s) {
3333     my $location;
3334     __CODE{xp|get-location-from-token::
3335     $token => {$pubid_token},
3336     $result => {$location},
3337     }__;
3338     ## Should this be other (new) error type?
3339     my $continue = __DOMCore:ERROR{xp|wf-syntax-error::
3340     xp|error-token => {$token},
3341     c|location => {$location},
3342     }__;
3343     unless ($continue) {
3344 wakaba 1.27 __CODE{ParseError}__;
3345 wakaba 1.17 }
3346     }
3347    
3348     ## NOTE: U+0009 is syntactically illegal.
3349 wakaba 1.23 $pubid =~ s/[\x09\x0A\x0D\x20]+/\x20/gs;
3350 wakaba 1.17 $pubid =~ s/\A\x20//s;
3351     $pubid =~ s/\x20\z//s;
3352     ## NOTE: Bare attribute name is written.
3353     $decl->public_id ($pubid);
3354     }
3355     }
3356 wakaba 1.4 } // PubidLiteral
3357    
3358 wakaba 1.17 /*
3359     System Identifier Literal
3360     */
3361     rule SystemLiteral ($decl) {
3362 wakaba 1.4 ~ (LIT) {
3363     ?lexmode SystemLiteral;
3364 wakaba 1.17 &_SystemLiteral ($decl => $decl);
3365 wakaba 1.4 } (LITA) {
3366     ?lexmode SystemLiteralA;
3367 wakaba 1.17 &_SystemLiteral ($decl => $decl);
3368 wakaba 1.4 }
3369     } // SystemLiteral
3370    
3371 wakaba 1.17 /*
3372     System Identifier Literal Content
3373 wakaba 1.29
3374     Used in document type declaration, entity declaration,
3375     and notation declaration.
3376 wakaba 1.17 */
3377     rule _SystemLiteral ($decl) {
3378     // LIT or LITA
3379    
3380 wakaba 1.4 ~? (STRING) {
3381 wakaba 1.17 lang:Perl ($v => $token.value) {
3382 wakaba 1.35 $decl-><AS::GE.systemId> ($v);
3383     $decl-><AS::GE.manakaiDeclarationBaseURI>
3384 wakaba 1.29 ($self->{location}->{base_uri});
3385 wakaba 1.17 }
3386 wakaba 1.4 }
3387    
3388     ~ (LIT) {
3389     ?lexmode MarkupDeclaration;
3390     } (LITA) {
3391     ?lexmode MarkupDeclaration;
3392     } else {
3393     ?lexmode MarkupDeclaration;
3394     }
3395     } // _SystemLiteral
3396    
3397     /*
3398     DTD Internal Subset
3399    
3400     intSubset := *(markupdecl / DeclSep) ;; [28b]
3401     */
3402 wakaba 1.6 rule InternalSubset ($doc, $doctype) {
3403 wakaba 1.4 ?lexmode DTD;
3404    
3405     ~* (MDO) {
3406     ?lexmode MarkupDeclaration;
3407    
3408     ~ (Name == 'ELEMENT') {
3409     &_ElementDeclaration ($doc => $doc);
3410     } (Name == 'ATTLIST') {
3411 wakaba 1.8 &_AttlistDeclaration ($doc => $doc, $doctype => $doctype);
3412 wakaba 1.4 } (Name == 'ENTITY') {
3413     &_EntityDeclaration ($doc => $doc);
3414     } (Name == 'NOTATION') {
3415     &_NotationDeclaration ($doc => $doc);
3416     }
3417     } (S) {
3418     //
3419     } (CDO) {
3420     &_CommentDeclarationDTD ($doc => $doc);
3421     } (PIO) {
3422 wakaba 1.6 &_ProcessingInstructionDTD ($doc => $doc, $doctype => $doctype);
3423 wakaba 1.4 } (PERO) {
3424     ?lexmode EntityReference;
3425    
3426 wakaba 1.19 lang:Perl {
3427     $self->{has_xref} = true;
3428 wakaba 1.25 $self->{dont_process} = true;
3429 wakaba 1.19 }
3430    
3431 wakaba 1.4 ~ (Name) {
3432 wakaba 1.26 // TODO: __CODE{checkNCName:: $name => $name}__;
3433 wakaba 1.4
3434     }
3435    
3436     ~ (REFC) {
3437     ?lexmode DTD;
3438     } else {
3439     ?lexmode DTD;
3440     }
3441     }
3442     } // InternalSubset
3443    
3444     rule _ElementDeclaration ($doc) {
3445     // ~ (MDO) { }
3446     // ?lexmode MarkupDeclaration
3447     // ~ (Name == 'Element') { }
3448    
3449     ~ (S) { }
3450    
3451     ~ (Name) {
3452 wakaba 1.26 // TODO: __CODE{checkQName:: $name => $name}__;
3453 wakaba 1.4
3454     }
3455    
3456     ?lexmode ElementDeclaration;
3457    
3458     ~ (S) { }
3459    
3460     // contentspec
3461     ~ (MGO) {
3462     &_ContentModel ($doc => $doc);
3463     } (Name == 'EMPTY') {
3464    
3465     } (Name == 'ANY') {
3466    
3467     }
3468    
3469     ~? (S) { }
3470    
3471     ~ (MDC) {
3472     ?lexmode DTD;
3473     } else {
3474     ?lexmode DTD;
3475     }
3476     } // _ElementDeclaration
3477    
3478     rule _ContentModel ($doc) {
3479     // ~ (MGO) { }
3480    
3481     ~? (S) { }
3482    
3483     ~ (Name) {
3484     // Element content model
3485     &_ModelGroup ($doc => $doc)
3486     : unshift-current-token;
3487    
3488     ~? (OPT) {
3489    
3490     } (REP) {
3491    
3492     } (PLUS) {
3493    
3494     }
3495    
3496     } (MDO) {
3497     &_ModelGroup ($doc => $doc)
3498     : unshift-current-token;
3499    
3500     ~? (OPT) {
3501    
3502     } (REP) {
3503    
3504     } (PLUS) {
3505    
3506     }
3507    
3508     } (PCDATA) {
3509     // Mixed content declaration
3510     ~? (S) { }
3511    
3512     ~* (OR) {
3513     ~? (S) { }
3514    
3515     ~ (Name) {
3516 wakaba 1.26 // TODO: Name & QName check
3517 wakaba 1.4
3518     }
3519    
3520     ~? (S) { }
3521     }
3522    
3523     ~ (MGC) { }
3524    
3525     ~? (REP) {
3526    
3527     } else {
3528     // TODO: error if |Name|
3529     }
3530    
3531    
3532     }
3533     } // _ContentModel
3534    
3535     rule _ModelGroup ($doc)
3536     : standalone
3537     : recursive
3538     {
3539     // ~ (MGO) { }
3540     // ~? (S) { }
3541    
3542     &ContentParticle ($doc => $doc);
3543    
3544     ~? (S) { }
3545    
3546     ~? (OR) {
3547     ~? (S) { }
3548    
3549     &ContentParticle ($doc => $doc);
3550    
3551     ~? (S) { }
3552    
3553     ~* (OR) {
3554     ~? (S) { }
3555    
3556     &ContentParticle ($doc => $doc);
3557    
3558     ~? (S) { }
3559     }
3560    
3561     } (SEQ) {
3562     ~? (S) { }
3563    
3564     &ContentParticle ($doc => $doc);
3565    
3566     ~? (S) { }
3567    
3568     ~* (SEQ) {
3569     ~? (S) { }
3570    
3571     &ContentParticle ($doc => $doc);
3572    
3573     ~? (S) { }
3574     }
3575    
3576     }
3577    
3578     ~ (MGC) { }
3579     } // _ModelGroup
3580    
3581     rule ContentParticle ($doc) {
3582     ~ (Name) {
3583 wakaba 1.26 // TODO: Name & QName check
3584 wakaba 1.4
3585     } (MGO) {
3586     ~? (S) { }
3587    
3588     &_ModelGroup ($doc => $doc);
3589     }
3590    
3591     ~? (OPT) {
3592    
3593     } (REP) {
3594    
3595     } (PLUS) {
3596    
3597     }
3598     } // ContentParticle
3599    
3600 wakaba 1.8 /*
3601     Attribute list declaration
3602     */
3603     rule _AttlistDeclaration ($doc, $doctype) {
3604 wakaba 1.4 // ~ (MDO) { }
3605     // ~ (Name == 'ATTLIST') { }
3606    
3607     ?lexmode AttlistDeclaration;
3608    
3609     ~ (S) { }
3610    
3611 wakaba 1.8 my $name;
3612 wakaba 1.4 ~ (Name) {
3613 wakaba 1.8 lang:Perl ($v => $token.value) {
3614 wakaba 1.26 __CODE{checkQName:: $name => $v}__;
3615 wakaba 1.8 $name = $v;
3616     }
3617     } else {
3618     lang:Perl { $name = '#ILLEGAL' }
3619     }
3620 wakaba 1.4
3621 wakaba 1.8 my $docxd;
3622     my $et;
3623     lang:Perl {
3624     $et = $doctype-><M::DTDef.getElementTypeDefinitionNode> ($name);
3625     unless ($et) {
3626 wakaba 1.11 $docxd = $doc-><M::Node.getFeature> (<Q::fe:XDoctype>, '3.0');
3627 wakaba 1.8 $et = $docxd-><M::DocumentXDoctype.createElementTypeDefinition>
3628     ($name);
3629     $doctype-><M::DTDef.setElementTypeDefinitionNode> ($et)
3630     unless $name eq '#ILLEGAL';
3631     }
3632 wakaba 1.4 }
3633    
3634     ~? (S) { }
3635    
3636     ~* (Name) {
3637 wakaba 1.8 my $at;
3638 wakaba 1.25 lang:Perl ($v => $token.value) : has-error {
3639 wakaba 1.26 __CODE{checkQName:: $name => $v}__;
3640 wakaba 1.8 $docxd ||= $doc-><M::Node.getFeature>
3641 wakaba 1.11 (<Q::fe:XDoctype>, '3.0');
3642 wakaba 1.8 $at = $docxd-><M::DocumentXDoctype.createAttributeDefinition> ($v);
3643 wakaba 1.25 if (exists $et-><AG::ETDef.attributeDefinitions>->{$v}) {
3644     my $location;
3645     __CODE{xp|get-location-from-token::
3646     $token => {$token},
3647     $result => {$location},
3648     }__;
3649     my $continue = __c|ERROR{xp|warning-attribute-definition-ignored::
3650     xp|error-token => {$token},
3651     c|location => {$location},
3652     xp|name => {$v},
3653     }__;
3654     unless ($continue) {
3655 wakaba 1.27 __CODE{ParseError}__;
3656 wakaba 1.25 }
3657     } elsif ($self->{dont_process} and not $self->{standalone}) {
3658     my $location;
3659     __CODE{xp|get-location-from-token::
3660     $token => {$token},
3661     $result => {$location},
3662     }__;
3663     my $continue = __c|ERROR{
3664     xp|warning-attribute-definition-not-processed::
3665     xp|error-token => {$token},
3666     c|location => {$location},
3667     xp|name => {$v},
3668     }__;
3669     unless ($continue) {
3670 wakaba 1.27 __CODE{ParseError}__;
3671 wakaba 1.25 }
3672     } else {
3673 wakaba 1.9 $et-><M::ETDef.setAttributeDefinitionNode> ($at);
3674     $self->{attr}->{$name}->{$v} = $at;
3675     }
3676 wakaba 1.8 }
3677 wakaba 1.4
3678     ~ (S) { }
3679    
3680     // AttType
3681     ~ (Name == 'NOTATION') {
3682     ~ (S) { }
3683    
3684 wakaba 1.8 my $kwd;
3685     lang:Perl {
3686     $at-><AS::ATDef.declaredType> (<C::ATDef.NOTATION_ATTR>);
3687     $kwd = $at-><AG::ATDef.allowedTokens>;
3688     }
3689    
3690 wakaba 1.4 ~ (EGO) {
3691     ~? (S) { }
3692    
3693 wakaba 1.8 ~+ (Name) {
3694 wakaba 1.26 lang:Perl ($v => $token.value) : has-error {
3695     __CODE{checkNCName:: $name => $v}__;
3696 wakaba 1.8 push @$kwd, $v;
3697     }
3698 wakaba 1.4
3699     ~? (S) { }
3700     } (OR) : separator {
3701     ~? (S) { }
3702     }
3703    
3704     ~ (EGC) { }
3705     }
3706 wakaba 1.8
3707 wakaba 1.4 } (Name) {
3708 wakaba 1.8 my $type;
3709     lang:Perl ($v => $token.value) : has-error {
3710     my $map = {
3711     CDATA => <C::ATDef.CDATA_ATTR>,
3712     ID => <C::ATDef.ID_ATTR>,
3713     IDREF => <C::ATDef.IDREF_ATTR>,
3714     IDREFS => <C::ATDef.IDREFS_ATTR>,
3715     ENTITY => <C::ATDef.ENTITY_ATTR>,
3716     ENTITIES => <C::ATDef.ENTITIES_ATTR>,
3717     NMTOKEN => <C::ATDef.NMTOKEN_ATTR>,
3718     NMTOKENS => <C::ATDef.NMTOKENS_ATTR>,
3719     };
3720     if ($map->{$v}) {
3721     $at-><AS::ATDef.declaredType> ($map->{$v});
3722     } else {
3723     ## TODO: Exception
3724     }
3725     }
3726 wakaba 1.4
3727     } (EGO) {
3728     ?lexmode Enumeration;
3729    
3730     ~? (S) { }
3731    
3732 wakaba 1.8 my $kwd;
3733     lang:Perl {
3734     $at-><AS::ATDef.declaredType> (<C::ATDef.ENUMERATION_ATTR>);
3735     $kwd = $at-><AG::ATDef.allowedTokens>;
3736     }
3737    
3738     ~+ (Nmtoken) {
3739     lang:Perl ($v => $token.value) {
3740     push @$kwd, $v;
3741     }
3742 wakaba 1.4
3743     ~? (S) { }
3744     } (OR) : separator {
3745     ~? (S) { }
3746     }
3747    
3748     ~ (EGC) {
3749     ?lexmode AttlistDeclaration;
3750     } else {
3751     ?lexmode AttlistDeclaration;
3752     }
3753    
3754     }
3755    
3756     ~ (S) { }
3757    
3758     // DefaultDecl
3759     ~ (RNI) {
3760     ~ (Name == 'REQUIRED') {
3761 wakaba 1.8 lang:Perl {
3762     $at-><AS::ATDef.defaultType> (<C::ATDef.REQUIRED_DEFAULT>);
3763     }
3764 wakaba 1.4 } (Name == 'IMPLIED') {
3765 wakaba 1.8 lang:Perl {
3766     $at-><AS::ATDef.defaultType> (<C::ATDef.IMPLIED_DEFAULT>);
3767     }
3768 wakaba 1.4 } (Name == 'FIXED') {
3769     ~ (S) { }
3770 wakaba 1.8
3771     lang:Perl {
3772     $at-><AS::ATDef.defaultType> (<C::ATDef.FIXED_DEFAULT>);
3773     }
3774 wakaba 1.4
3775     ~ (LIT) {
3776     my $vals;
3777     lang:Perl {
3778 wakaba 1.8 $vals = {nodes => [], value => ''};
3779 wakaba 1.4 }
3780    
3781     &_AttributeValueSpecification_ ($doc => $doc, $vals => $vals);
3782    
3783 wakaba 1.8 lang:Perl {
3784     for (@{$vals->{nodes}}) {
3785     $at-><M::Node.appendChild> ($_);
3786     }
3787     }
3788    
3789 wakaba 1.4 ~ (LIT) {
3790     ?lexmode AttlistDeclaration;
3791     } else {
3792     ?lexmode AttlistDeclaration;
3793     }
3794     } (LITA) {
3795     my $vals;
3796     lang:Perl {
3797 wakaba 1.8 $vals = {nodes => [], value => ''};
3798 wakaba 1.4 }
3799    
3800     &_AttributeValueSpecificationA_ ($doc => $doc, $vals => $vals);
3801    
3802 wakaba 1.8 lang:Perl {
3803     for (@{$vals->{nodes}}) {
3804     $at-><M::Node.appendChild> ($_);
3805     }
3806     }
3807    
3808     ~ (LITA) {
3809 wakaba 1.4 ?lexmode AttlistDeclaration;
3810     } else {
3811     ?lexmode AttlistDeclaration;
3812     }
3813     }
3814     }
3815    
3816     } (LIT) {
3817     my $vals;
3818     lang:Perl {
3819 wakaba 1.8 $at-><AS::ATDef.defaultType> (<C::ATDef.EXPLICIT_DEFAULT>);
3820     $vals = {nodes => [], value => ''};
3821 wakaba 1.4 }
3822    
3823     &_AttributeValueSpecification_ ($doc => $doc, $vals => $vals);
3824    
3825 wakaba 1.8 lang:Perl {
3826     for (@{$vals->{nodes}}) {
3827     $at-><M::Node.appendChild> ($_);
3828     }
3829     }
3830    
3831 wakaba 1.4 ~ (LIT) {
3832     ?lexmode AttlistDeclaration;
3833     } else {
3834     ?lexmode AttlistDeclaration;
3835     }
3836     } (LITA) {
3837     my $vals;
3838     lang:Perl {
3839 wakaba 1.8 $at-><AS::ATDef.defaultType> (<C::ATDef.EXPLICIT_DEFAULT>);
3840     $vals = {nodes => [], value => ''};
3841 wakaba 1.4 }
3842    
3843     &_AttributeValueSpecificationA_ ($doc => $doc, $vals => $vals);
3844    
3845 wakaba 1.8 lang:Perl {
3846     for (@{$vals->{nodes}}) {
3847     $at-><M::Node.appendChild> ($_);
3848     }
3849     }
3850    
3851 wakaba 1.4 ~ (LITA) {
3852     ?lexmode AttlistDeclaration;
3853     } else {
3854     ?lexmode AttlistDeclaration;
3855     }
3856     }
3857    
3858     } (S) : separator : terminator? {
3859     //
3860     }
3861    
3862     ~ (MDC) {
3863     ?lexmode DTD;
3864     } else {
3865     ?lexmode DTD;
3866     }
3867     } // _AttlistDeclaration
3868    
3869 wakaba 1.11 /*
3870 wakaba 1.26 Entity Declaration
3871 wakaba 1.11 */
3872 wakaba 1.4 rule _EntityDeclaration ($doc) {
3873     // ~ (MDO) { }
3874     // ~ (Name == ENTITY) { }
3875    
3876     ~ (S) { }
3877    
3878 wakaba 1.23 my $is_param_entity;
3879 wakaba 1.6 my $decl;
3880 wakaba 1.27 lang:Perl {
3881     $decl = {
3882     name => '#ILLEGAL',
3883     reptxt => \'',
3884     is_external_entity => false,
3885     document_uri => $self->{location}->{document_uri},
3886     base_uri => $self->{location}->{base_uri},
3887     };
3888     }
3889 wakaba 1.6
3890 wakaba 1.4 ~? (PERO) {
3891     ~ (S) { }
3892 wakaba 1.6 lang:Perl {
3893 wakaba 1.23 $is_param_entity = $decl->{is_param_entity} = true;
3894 wakaba 1.6 }
3895 wakaba 1.4 }
3896    
3897 wakaba 1.19 /*
3898     TODO: Set |$decl->{is_externally_declared}| flag
3899     and |Entity.isExternallyDeclared| attribute
3900     for entity declarations in external subset or
3901     in parameter entity.
3902     */
3903    
3904 wakaba 1.4 ~ (Name) {
3905 wakaba 1.6 lang:Perl ($v => $token.value) {
3906 wakaba 1.26 __CODE{checkNCName:: $name => $v}__;
3907 wakaba 1.6 $decl->{name} = $v;
3908     }
3909 wakaba 1.4 }
3910    
3911 wakaba 1.18 my $node;
3912 wakaba 1.11 lang:Perl {
3913 wakaba 1.18 $node =
3914 wakaba 1.11 $decl->{node} = $self->{docx}-><M::DocumentXDoctype.createGeneralEntity>
3915     ($decl->{name});
3916     ## TODO: Parameter entity...
3917     }
3918    
3919 wakaba 1.4 ~ (S) { }
3920    
3921     ~ (LIT) {
3922 wakaba 1.6 &_EntityValue ($doc => $doc, $decl => $decl);
3923 wakaba 1.4 } (LITA) {
3924 wakaba 1.6 &_EntityValueA ($doc => $doc, $decl => $decl);
3925 wakaba 1.4 } (Name == 'PUBLIC') {
3926     ~ (S) { }
3927    
3928 wakaba 1.18 &PubidLiteral ($decl => $node);
3929 wakaba 1.4
3930     ~ (S) { }
3931    
3932 wakaba 1.18 &SystemLiteral ($decl => $node);
3933    
3934     lang:Perl {
3935     $decl->{is_external_entity} = true;
3936     }
3937 wakaba 1.4 } (Name == 'SYSTEM') {
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 }
3946    
3947     ~? (S) {
3948     ~? (Name == 'NDATA') {
3949 wakaba 1.23 if-true ($is_param_entity) {
3950     lang:Perl : has-error {
3951     my $location;
3952     __CODE{xp|get-location-from-token::
3953     $token => {$token},
3954     $result => {$location},
3955     }__;
3956     my $continue = __DOMCore:ERROR{xp|wf-syntax-error::
3957     xp|error-token => {$token},
3958     c|location => {$location},
3959     }__;
3960     unless ($continue) {
3961 wakaba 1.27 __CODE{ParseError}__;
3962 wakaba 1.23 }
3963     }
3964     }
3965 wakaba 1.4
3966     ~ (S) { }
3967    
3968     ~ (Name) {
3969 wakaba 1.26 lang:Perl ($v => $token.value) : has-error {
3970     __CODE{checkNCName:: $name => $v}__;
3971 wakaba 1.6 $decl->{notation} = $v;
3972 wakaba 1.35 $decl->{node}-><AG::GE.notationName> ($v);
3973 wakaba 1.6 }
3974 wakaba 1.4 }
3975    
3976     ~? (S) { }
3977     }
3978     }
3979    
3980 wakaba 1.24 lang:Perl : has-error {
3981 wakaba 1.6 if ($self->{$decl->{is_param_entity} ? 'param_entity' : 'general_entity'}
3982     ->{$decl->{name}}) {
3983 wakaba 1.24 ## Predefined entity
3984     if (not $decl->{is_param_entity} and
3985     {lt => true, gt => true, amp => true,
3986     quot => true, apos => true}->{$decl->{name}}) {
3987     if ($decl->{is_external_entity}) {
3988     my $location;
3989     __CODE{xp|get-location-from-token::
3990     $token => {$token},
3991     $result => {$location},
3992     }__;
3993     my $continue = __c|ERROR{xp|error-internal-predefined-entity::
3994     xp|error-token => {$token},
3995     c|location => {$location},
3996     xp|name => {$decl->{name}},
3997     }__;
3998     unless ($continue) {
3999 wakaba 1.27 __CODE{ParseError}__;
4000 wakaba 1.24 }
4001     } elsif (
4002     not ({gt => true, apos => true, quot => true}->{$decl->{name}} and
4003     ${$decl->{reptxt}} eq {
4004     gt => '>', apos => "'", quot => '"',
4005     }->{$decl->{name}}) and
4006     not (${$decl->{reptxt}} =~ /\A&#0*@{[{
4007     lt => '60', gt => '62', amp => '38',
4008     apos => '39', quot => '34',
4009     }->{$decl->{name}}]};\z/) and
4010     not (${$decl->{reptxt}} =~ /\A&#x0*(?:(?i)@{[{
4011     lt => '3C', gt => '3E', amp => '26',
4012     apos => '27', quot => '22',
4013     }->{$decl->{name}}]});\z/)
4014     ) {
4015     ## NOTE: See "SuikaWiki - Predefined Entities"
4016     ## "http://suika.fam.cx/gate/2005/sw/%E5%AE%9A%E7%BE%A9%E6%B8%88%E5%AE%9F%E4%BD%93".
4017     my $location;
4018     __CODE{xp|get-location-from-token::
4019     $token => {$token},
4020     $result => {$location},
4021     }__;
4022     my $continue = __c|ERROR{xp|error-malformed-predefined-entity::
4023     xp|error-token => {$token},
4024     c|location => {$location},
4025     xp|name => {$decl->{name}},
4026     xp|replacement-text => {${$decl->{reptxt}}},
4027     }__;
4028     unless ($continue) {
4029 wakaba 1.27 __CODE{ParseError}__;
4030 wakaba 1.24 }
4031     }
4032 wakaba 1.44 ${$self->{dtdecl}}->{{
4033 wakaba 1.25 lt => <H::d|hasLtDeclaration>,
4034     gt => <H::d|hasGtDeclaration>,
4035     amp => <H::d|hasAmpDeclaration>,
4036     apos => <H::d|hasAposDeclaration>,
4037     quot => <H::d|hasQuotDeclaration>,
4038     }->{$decl->{name}}} = true;
4039 wakaba 1.24 } else { ## Dupulicating declaration
4040     my $location;
4041     __CODE{xp|get-location-from-token::
4042     $token => {$token},
4043     $result => {$location},
4044     }__;
4045     my $continue = __c|ERROR{xp|warning-entity-declaration-ignored::
4046     xp|error-token => {$token},
4047     c|location => {$location},
4048     xp|name => {$decl->{name}},
4049     }__;
4050     unless ($continue) {
4051 wakaba 1.27 __CODE{ParseError}__;
4052 wakaba 1.24 }
4053     }
4054 wakaba 1.25 } elsif ($self->{dont_process} and not $self->{standalone}) {
4055     ## TODO: |standalone| and parameter entities??
4056     my $location;
4057     __CODE{xp|get-location-from-token::
4058     $token => {$token},
4059     $result => {$location},
4060     }__;
4061     my $continue = __c|ERROR{xp|warning-entity-declaration-not-processed::
4062     xp|error-token => {$token},
4063     c|location => {$location},
4064     xp|name => {$decl->{name}},
4065     }__;
4066     unless ($continue) {
4067 wakaba 1.27 __CODE{ParseError}__;
4068 wakaba 1.25 }
4069 wakaba 1.6 } else {
4070     $self->{$decl->{is_param_entity} ? 'param_entity' : 'general_entity'}
4071     ->{$decl->{name}} = $decl;
4072 wakaba 1.11 $self->{dtdef}-><M::DTDef.setGeneralEntityNode> ($decl->{node})
4073     unless $decl->{is_param_entity};
4074 wakaba 1.6 }
4075     }
4076    
4077 wakaba 1.4 ~ (MDC) {
4078     ?lexmode DTD;
4079     } else {
4080     ?lexmode DTD;
4081     }
4082     } // _EntityDeclaration
4083    
4084 wakaba 1.26 /*
4085     Notation Declaration
4086     */
4087     rule _NotationDeclaration {
4088 wakaba 1.4 // ~ (MDO) { }
4089     // ~ (Name == NOTATION) { }
4090    
4091     ~ (S) { }
4092    
4093 wakaba 1.26 my $name;
4094 wakaba 1.4 ~ (Name) {
4095 wakaba 1.26 lang:Perl ($v => $token.value) : has-error {
4096     __CODE{checkNCName:: $name => $v}__;
4097     $name = $v;
4098     }
4099     } else {
4100     lang:Perl {
4101     $name = '#INVALID';
4102     }
4103     }
4104 wakaba 1.4
4105     ~ (S) { }
4106    
4107 wakaba 1.17 lang:Perl {
4108 wakaba 1.26 $decl = $self->{docx}-><M::DocumentXDoctype.createNotation> ($name);
4109 wakaba 1.17 }
4110    
4111 wakaba 1.4 ~ (Name == 'PUBLIC') {
4112     ~ (S) { }
4113    
4114 wakaba 1.17 &PubidLiteral ($decl => $decl);
4115 wakaba 1.4
4116     ~? (S) {
4117     ~? (LIT) {
4118     ?lexmode SystemLiteral;
4119 wakaba 1.17 &_SystemLiteral ($decl => $decl);
4120 wakaba 1.4
4121     ~? (S) { }
4122     } (LITA) {
4123     ?lexmode SystemLiteralA;
4124 wakaba 1.17 &_SystemLiteral ($decl => $decl);
4125 wakaba 1.4
4126     ~? (S) { }
4127     }
4128     }
4129     } (Name == 'SYSTEM') {
4130     ~ (S) { }
4131    
4132 wakaba 1.17 &SystemLiteral ($decl => $decl);
4133 wakaba 1.4
4134     ~? (S) { }
4135     }
4136    
4137 wakaba 1.26 lang:Perl : has-error {
4138     if ($self->{dtdef}-><M::DTDef.getNotationNode> ($name)) {
4139     ## Dupulication
4140     my $location;
4141     __CODE{xp|get-location-from-token::
4142     $token => {$token},
4143     $result => {$location},
4144     }__;
4145     my $continue = __c|ERROR{xp|vc-unique-notation-name::
4146     xp|error-token => {$token},
4147     c|location => {$location},
4148     xp|name => {$name},
4149     }__;
4150     unless ($continue) {
4151 wakaba 1.27 __CODE{ParseError}__;
4152 wakaba 1.26 }
4153     } else {
4154     $self->{dtdef}-><M::DTDef.setNotationNode> ($decl);
4155     }
4156     }
4157    
4158 wakaba 1.4 ~ (MDC) {
4159     ?lexmode DTD;
4160     } else {
4161     ?lexmode DTD;
4162     }
4163     } // _NotationDeclaration
4164    
4165 wakaba 1.11 rule _EntityValue ($decl) {
4166 wakaba 1.4 ?lexmode EntityValue;
4167    
4168     my $vals;
4169 wakaba 1.6 my $reptxt;
4170 wakaba 1.4 lang:Perl {
4171     $vals = [];
4172 wakaba 1.6 $reptxt = '';
4173 wakaba 1.4 }
4174    
4175     ~* (STRING) {
4176 wakaba 1.6 lang:Perl ($v => $token.value) {
4177     $reptxt .= $v;
4178     }
4179 wakaba 1.4 } (PERO) {
4180 wakaba 1.25 ?lexmode EntityReference;
4181 wakaba 1.19
4182     lang:Perl {
4183     $self->{has_xref} = true;
4184 wakaba 1.25 $self->{dont_process} = true;
4185 wakaba 1.19 }
4186 wakaba 1.6
4187     // TODO: Expand or wferror if internal subset
4188 wakaba 1.4
4189     ~ (Name) {
4190    
4191 wakaba 1.25 // Note that external subset and parameter entities are not supported
4192     lang:Perl ($name => $token.value) : has-error {
4193 wakaba 1.26 __CODE{checkNCName:: $name => $name}__;
4194 wakaba 1.25 my $location;
4195     __CODE{xp|get-location-from-token::
4196     $token => {$token},
4197     $result => {$location},
4198     }__;
4199     my $continue = __c|ERROR{xp|wf-pes-in-internal-subset::
4200     xp|error-token => {$token},
4201     c|location => {$location},
4202     xp|name => {$name},
4203     }__;
4204     unless ($continue) {
4205 wakaba 1.27 __CODE{ParseError}__;
4206 wakaba 1.25 }
4207     }
4208 wakaba 1.4 }
4209    
4210     ~ (REFC) {
4211     ?lexmode EntityValue;
4212     } else {
4213     ?lexmode EntityValue;
4214     }
4215     } (HCRO) {
4216 wakaba 1.11 &_HexadecimalCharacterReferenceEV_ ($vals => $vals);
4217 wakaba 1.4
4218 wakaba 1.6 lang:Perl {
4219 wakaba 1.11 $reptxt .= $vals->[-1];
4220 wakaba 1.6 }
4221    
4222 wakaba 1.4 ~ (REFC) {
4223     ?lexmode EntityValue;
4224     } else {
4225     ?lexmode EntityValue;
4226     }
4227     } (CRO) {
4228 wakaba 1.11 &_NumericCharacterReferenceEV_ ($vals => $vals);
4229 wakaba 1.6
4230     lang:Perl {
4231 wakaba 1.11 $reptxt .= $vals->[-1];
4232 wakaba 1.6 }
4233 wakaba 1.4
4234     ~ (REFC) {
4235     ?lexmode EntityValue;
4236     } else {
4237     ?lexmode EntityValue;
4238     }
4239     } (ERO) {
4240 wakaba 1.11 &_GeneralEntityReferenceEV_ ($vals => $vals);
4241 wakaba 1.4
4242 wakaba 1.6 lang:Perl {
4243 wakaba 1.11 $reptxt .= '&' . $vals->[-1] . ';';
4244 wakaba 1.6 }
4245    
4246 wakaba 1.4 ~ (REFC) {
4247     ?lexmode EntityValue;
4248     } else {
4249     ?lexmode EntityValue;
4250     }
4251     }
4252    
4253     ~ (LIT) {
4254     ?lexmode MarkupDeclaration;
4255     } (LITA) {
4256     ?lexmode MarkupDeclaration;
4257     } else {
4258     ?lexmode MarkupDeclaration;
4259     }
4260 wakaba 1.6
4261     lang:Perl {
4262     $decl->{reptxt} = \$reptxt;
4263 wakaba 1.19 $decl->{has_replacement_text} = true;
4264 wakaba 1.6 }
4265 wakaba 1.4 } // _EntityValue
4266    
4267 wakaba 1.11 rule _EntityValueA ($decl) {
4268 wakaba 1.4 ?lexmode EntityValueA;
4269    
4270     my $vals;
4271 wakaba 1.6 my $reptxt;
4272 wakaba 1.4 lang:Perl {
4273     $vals = [];
4274 wakaba 1.6 $reptxt = '';
4275 wakaba 1.4 }
4276    
4277     ~* (STRING) {
4278 wakaba 1.6 lang:Perl ($v => $token.value) {
4279     $reptxt .= $v;
4280     }
4281 wakaba 1.4 } (PERO) {
4282 wakaba 1.25 ?lexmode EntityReference;
4283 wakaba 1.4
4284 wakaba 1.19 lang:Perl {
4285     $self->{has_xref} = true;
4286 wakaba 1.25 $self->{dont_process} = true;
4287 wakaba 1.19 }
4288    
4289 wakaba 1.6 // TODO: implement this
4290 wakaba 1.4 ~ (Name) {
4291    
4292 wakaba 1.25 // Note that external subset and parameter entities are not supported
4293     lang:Perl ($name => $token.value) : has-error {
4294 wakaba 1.26 __CODE{checkNCName:: $name => $name}__;
4295 wakaba 1.25 my $location;
4296     __CODE{xp|get-location-from-token::
4297     $token => {$token},
4298     $result => {$location},
4299     }__;
4300     my $continue = __c|ERROR{xp|wf-pes-in-internal-subset::
4301     xp|error-token => {$token},
4302     c|location => {$location},
4303     xp|name => {$name},
4304     }__;
4305     unless ($continue) {
4306 wakaba 1.27 __CODE{ParseError}__;
4307 wakaba 1.25 }
4308     }
4309 wakaba 1.4 }
4310    
4311     ~ (REFC) {
4312     ?lexmode EntityValueA;
4313     } else {
4314     ?lexmode EntityValueA;
4315     }
4316     } (HCRO) {
4317 wakaba 1.11 &_HexadecimalCharacterReferenceEV_ ($vals => $vals);
4318 wakaba 1.4
4319 wakaba 1.6 lang:Perl {
4320 wakaba 1.11 $reptxt .= $vals->[-1];
4321 wakaba 1.6 }
4322    
4323    
4324 wakaba 1.4 ~ (REFC) {
4325     ?lexmode EntityValueA;
4326     } else {
4327     ?lexmode EntityValueA;
4328     }
4329     } (CRO) {
4330 wakaba 1.11 &_NumericCharacterReferenceEV_ ($vals => $vals);
4331 wakaba 1.4
4332 wakaba 1.6 lang:Perl {
4333 wakaba 1.11 $reptxt .= $vals->[-1];
4334 wakaba 1.6 }
4335    
4336 wakaba 1.4 ~ (REFC) {
4337     ?lexmode EntityValueA;
4338     } else {
4339     ?lexmode EntityValueA;
4340     }
4341     } (ERO) {
4342 wakaba 1.11 &_GeneralEntityReferenceEV_ ($vals => $vals);
4343 wakaba 1.4
4344 wakaba 1.6 lang:Perl {
4345 wakaba 1.11 $reptxt .= '&' . $vals->[-1] . ';';
4346 wakaba 1.6 }
4347    
4348 wakaba 1.4 ~ (REFC) {
4349     ?lexmode EntityValueA;
4350     } else {
4351     ?lexmode EntityValueA;
4352     }
4353     }
4354    
4355     ~ (LITA) {
4356     ?lexmode MarkupDeclaration;
4357     } else {
4358     ?lexmode MarkupDeclaration;
4359     }
4360 wakaba 1.6
4361     lang:Perl {
4362     $decl->{reptxt} = \$reptxt;
4363 wakaba 1.19 $decl->{has_replacement_text} = true;
4364 wakaba 1.6 }
4365 wakaba 1.4 } // _EntityValueA
4366    
4367    
4368     /*
4369     XML Name
4370     */
4371     lexmode NameChar {
4372     $NameStartChar10 := [
4373     '_' ':'
4374     // Letter
4375     // BaseChar
4376     U+0041..U+005A U+0061..U+007A U+00C0..U+00D6
4377     U+00D8..U+00F6 U+00F8..U+00FF U+0100..U+0131
4378     U+0134..U+013E U+0141..U+0148 U+014A..U+017E
4379     U+0180..U+01C3 U+01CD..U+01F0 U+01F4..U+01F5
4380     U+01FA..U+0217 U+0250..U+02A8 U+02BB..U+02C1
4381     U+0386 U+0388..U+038A U+038C U+038E..U+03A1
4382     U+03A3..U+03CE U+03D0..U+03D6 U+03DA U+03DC
4383     U+03DE U+03E0 U+03E2..U+03F3 U+0401..U+040C
4384     U+040E..U+044F U+0451..U+045C U+045E..U+0481
4385     U+0490..U+04C4 U+04C7..U+04C8 U+04CB..U+04CC
4386     U+04D0..U+04EB U+04EE..U+04F5 U+04F8..U+04F9
4387     U+0531..U+0556 U+0559 U+0561..U+0586
4388     U+05D0..U+05EA U+05F0..U+05F2 U+0621..U+063A
4389     U+0641..U+064A U+0671..U+06B7 U+06BA..U+06BE
4390     U+06C0..U+06CE U+06D0..U+06D3 U+06D5
4391     U+06E5..U+06E6 U+0905..U+0939 U+093D
4392     U+0958..U+0961 U+0985..U+098C U+098F..U+0990
4393     U+0993..U+09A8 U+09AA..U+09B0 U+09B2
4394     U+09B6..U+09B9 U+09DC..U+09DD U+09DF..U+09E1
4395     U+09F0..U+09F1 U+0A05..U+0A0A U+0A0F..U+0A10
4396     U+0A13..U+0A28 U+0A2A..U+0A30 U+0A32..U+0A33
4397     U+0A35..U+0A36 U+0A38..U+0A39 U+0A59..U+0A5C
4398     U+0A5E U+0A72..U+0A74 U+0A85..U+0A8B U+0A8D
4399     U+0A8F..U+0A91 U+0A93..U+0AA8 U+0AAA..U+0AB0
4400     U+0AB2..U+0AB3 U+0AB5..U+0AB9 U+0ABD U+0AE0
4401     U+0B05..U+0B0C U+0B0F..U+0B10 U+0B13..U+0B28
4402     U+0B2A..U+0B30 U+0B32..U+0B33 U+0B36..U+0B39
4403     U+0B3D U+0B5C..U+0B5D U+0B5F..U+0B61
4404     U+0B85..U+0B8A U+0B8E..U+0B90 U+0B92..U+0B95
4405     U+0B99..U+0B9A U+0B9C U+0B9E..U+0B9F
4406     U+0BA3..U+0BA4 U+0BA8..U+0BAA U+0BAE..U+0BB5
4407     U+0BB7..U+0BB9 U+0C05..U+0C0C U+0C0E..U+0C10
4408     U+0C12..U+0C28 U+0C2A..U+0C33 U+0C35..U+0C39
4409     U+0C60..U+0C61 U+0C85..U+0C8C U+0C8E..U+0C90
4410     U+0C92..U+0CA8 U+0CAA..U+0CB3 U+0CB5..U+0CB9
4411     U+0CDE U+0CE0..U+0CE1 U+0D05..U+0D0C
4412     U+0D0E..U+0D10 U+0D12..U+0D28 U+0D2A..U+0D39
4413     U+0D60..U+0D61 U+0E01..U+0E2E U+0E30
4414     U+0E32..U+0E33 U+0E40..U+0E45 U+0E81..U+0E82
4415     U+0E84 U+0E87..U+0E88 U+0E8A U+0E8D
4416     U+0E94..U+0E97 U+0E99..U+0E9F U+0EA1..U+0EA3
4417     U+0EA5 U+0EA7 U+0EAA..U+0EAB U+0EAD..U+0EAE
4418     U+0EB0 U+0EB2..U+0EB3 U+0EBD U+0EC0..U+0EC4
4419     U+0F40..U+0F47 U+0F49..U+0F69 U+10A0..U+10C5
4420     U+10D0..U+10F6 U+1100 U+1102..U+1103
4421     U+1105..U+1107 U+1109 U+110B..U+110C
4422     U+110E..U+1112 U+113C U+113E U+1140 U+114C
4423     U+114E U+1150 U+1154..U+1155 U+1159
4424     U+115F..U+1161 U+1163 U+1165 U+1167 U+1169
4425     U+116D..U+116E U+1172..U+1173 U+1175 U+119E
4426     U+11A8 U+11AB U+11AE..U+11AF U+11B7..U+11B8
4427     U+11BA U+11BC..U+11C2 U+11EB U+11F0 U+11F9
4428     U+1E00..U+1E9B U+1EA0..U+1EF9 U+1F00..U+1F15
4429     U+1F18..U+1F1D U+1F20..U+1F45 U+1F48..U+1F4D
4430     U+1F50..U+1F57 U+1F59 U+1F5B U+1F5D
4431     U+1F5F..U+1F7D U+1F80..U+1FB4 U+1FB6..U+1FBC
4432     U+1FBE U+1FC2..U+1FC4 U+1FC6..U+1FCC
4433     U+1FD0..U+1FD3 U+1FD6..U+1FDB U+1FE0..U+1FEC
4434     U+1FF2..U+1FF4 U+1FF6..U+1FFC U+2126
4435     U+212A..U+212B U+212E U+2180..U+2182
4436     U+3041..U+3094 U+30A1..U+30FA U+3105..U+312C
4437     U+AC00..U+D7A3
4438     // Ideographic
4439     U+4E00..U+9FA5 U+3007 U+3021..U+3029
4440     ];
4441     $NameChar10 := [
4442     '.' '-' '_' ':'
4443     // Letter
4444     // BaseChar
4445     U+0041..U+005A U+0061..U+007A U+00C0..U+00D6
4446     U+00D8..U+00F6 U+00F8..U+00FF U+0100..U+0131
4447     U+0134..U+013E U+0141..U+0148 U+014A..U+017E
4448     U+0180..U+01C3 U+01CD..U+01F0 U+01F4..U+01F5
4449     U+01FA..U+0217 U+0250..U+02A8 U+02BB..U+02C1
4450     U+0386 U+0388..U+038A U+038C U+038E..U+03A1
4451     U+03A3..U+03CE U+03D0..U+03D6 U+03DA U+03DC
4452     U+03DE U+03E0 U+03E2..U+03F3 U+0401..U+040C
4453     U+040E..U+044F U+0451..U+045C U+045E..U+0481
4454     U+0490..U+04C4 U+04C7..U+04C8 U+04CB..U+04CC
4455     U+04D0..U+04EB U+04EE..U+04F5 U+04F8..U+04F9
4456     U+0531..U+0556 U+0559 U+0561..U+0586
4457     U+05D0..U+05EA U+05F0..U+05F2 U+0621..U+063A
4458     U+0641..U+064A U+0671..U+06B7 U+06BA..U+06BE
4459     U+06C0..U+06CE U+06D0..U+06D3 U+06D5
4460     U+06E5..U+06E6 U+0905..U+0939 U+093D
4461     U+0958..U+0961 U+0985..U+098C U+098F..U+0990
4462     U+0993..U+09A8 U+09AA..U+09B0 U+09B2
4463     U+09B6..U+09B9 U+09DC..U+09DD U+09DF..U+09E1
4464     U+09F0..U+09F1 U+0A05..U+0A0A U+0A0F..U+0A10
4465     U+0A13..U+0A28 U+0A2A..U+0A30 U+0A32..U+0A33
4466     U+0A35..U+0A36 U+0A38..U+0A39 U+0A59..U+0A5C
4467     U+0A5E U+0A72..U+0A74 U+0A85..U+0A8B U+0A8D
4468     U+0A8F..U+0A91 U+0A93..U+0AA8 U+0AAA..U+0AB0
4469     U+0AB2..U+0AB3 U+0AB5..U+0AB9 U+0ABD U+0AE0
4470     U+0B05..U+0B0C U+0B0F..U+0B10 U+0B13..U+0B28
4471     U+0B2A..U+0B30 U+0B32..U+0B33 U+0B36..U+0B39
4472     U+0B3D U+0B5C..U+0B5D U+0B5F..U+0B61
4473     U+0B85..U+0B8A U+0B8E..U+0B90 U+0B92..U+0B95
4474     U+0B99..U+0B9A U+0B9C U+0B9E..U+0B9F
4475     U+0BA3..U+0BA4 U+0BA8..U+0BAA U+0BAE..U+0BB5
4476     U+0BB7..U+0BB9 U+0C05..U+0C0C U+0C0E..U+0C10
4477     U+0C12..U+0C28 U+0C2A..U+0C33 U+0C35..U+0C39
4478     U+0C60..U+0C61 U+0C85..U+0C8C U+0C8E..U+0C90
4479     U+0C92..U+0CA8 U+0CAA..U+0CB3 U+0CB5..U+0CB9
4480     U+0CDE U+0CE0..U+0CE1 U+0D05..U+0D0C
4481     U+0D0E..U+0D10 U+0D12..U+0D28 U+0D2A..U+0D39
4482     U+0D60..U+0D61 U+0E01..U+0E2E U+0E30
4483     U+0E32..U+0E33 U+0E40..U+0E45 U+0E81..U+0E82
4484     U+0E84 U+0E87..U+0E88 U+0E8A U+0E8D
4485     U+0E94..U+0E97 U+0E99..U+0E9F U+0EA1..U+0EA3
4486     U+0EA5 U+0EA7 U+0EAA..U+0EAB U+0EAD..U+0EAE
4487     U+0EB0 U+0EB2..U+0EB3 U+0EBD U+0EC0..U+0EC4
4488     U+0F40..U+0F47 U+0F49..U+0F69 U+10A0..U+10C5
4489     U+10D0..U+10F6 U+1100 U+1102..U+1103
4490     U+1105..U+1107 U+1109 U+110B..U+110C
4491     U+110E..U+1112 U+113C U+113E U+1140 U+114C
4492     U+114E U+1150 U+1154..U+1155 U+1159
4493     U+115F..U+1161 U+1163 U+1165 U+1167 U+1169
4494     U+116D..U+116E U+1172..U+1173 U+1175 U+119E
4495     U+11A8 U+11AB U+11AE..U+11AF U+11B7..U+11B8
4496     U+11BA U+11BC..U+11C2 U+11EB U+11F0 U+11F9
4497     U+1E00..U+1E9B U+1EA0..U+1EF9 U+1F00..U+1F15
4498     U+1F18..U+1F1D U+1F20..U+1F45 U+1F48..U+1F4D
4499     U+1F50..U+1F57 U+1F59 U+1F5B U+1F5D
4500     U+1F5F..U+1F7D U+1F80..U+1FB4 U+1FB6..U+1FBC
4501     U+1FBE U+1FC2..U+1FC4 U+1FC6..U+1FCC
4502     U+1FD0..U+1FD3 U+1FD6..U+1FDB U+1FE0..U+1FEC
4503     U+1FF2..U+1FF4 U+1FF6..U+1FFC U+2126
4504     U+212A..U+212B U+212E U+2180..U+2182
4505     U+3041..U+3094 U+30A1..U+30FA U+3105..U+312C
4506     U+AC00..U+D7A3
4507     // Ideographic
4508     U+4E00..U+9FA5 U+3007 U+3021..U+3029
4509     // Digit
4510     U+0030..U+0039 U+0660..U+0669 U+06F0..U+06F9
4511     U+0966..U+096F U+09E6..U+09EF U+0A66..U+0A6F
4512     U+0AE6..U+0AEF U+0B66..U+0B6F U+0BE7..U+0BEF
4513     U+0C66..U+0C6F U+0CE6..U+0CEF U+0D66..U+0D6F
4514     U+0E50..U+0E59 U+0ED0..U+0ED9 U+0F20..U+0F29
4515     // CombiningChar
4516     U+0300..U+0345 U+0360..U+0361 U+0483..U+0486
4517     U+0591..U+05A1 U+05A3..U+05B9 U+05BB..U+05BD
4518     U+05BF U+05C1..U+05C2 U+05C4 U+064B..U+0652
4519     U+0670 U+06D6..U+06DC U+06DD..U+06DF
4520     U+06E0..U+06E4 U+06E7..U+06E8 U+06EA..U+06ED
4521     U+0901..U+0903 U+093C U+093E..U+094C U+094D
4522     U+0951..U+0954 U+0962..U+0963 U+0981..U+0983
4523     U+09BC U+09BE U+09BF U+09C0..U+09C4
4524     U+09C7..U+09C8 U+09CB..U+09CD U+09D7
4525     U+09E2..U+09E3 U+0A02 U+0A3C U+0A3E U+0A3F
4526     U+0A40..U+0A42 U+0A47..U+0A48 U+0A4B..U+0A4D
4527     U+0A70..U+0A71 U+0A81..U+0A83 U+0ABC
4528     U+0ABE..U+0AC5 U+0AC7..U+0AC9 U+0ACB..U+0ACD
4529     U+0B01..U+0B03 U+0B3C U+0B3E..U+0B43
4530     U+0B47..U+0B48 U+0B4B..U+0B4D U+0B56..U+0B57
4531     U+0B82..U+0B83 U+0BBE..U+0BC2 U+0BC6..U+0BC8
4532     U+0BCA..U+0BCD U+0BD7 U+0C01..U+0C03
4533     U+0C3E..U+0C44 U+0C46..U+0C48 U+0C4A..U+0C4D
4534     U+0C55..U+0C56 U+0C82..U+0C83 U+0CBE..U+0CC4
4535     U+0CC6..U+0CC8 U+0CCA..U+0CCD U+0CD5..U+0CD6
4536     U+0D02..U+0D03 U+0D3E..U+0D43 U+0D46..U+0D48
4537     U+0D4A..U+0D4D U+0D57 U+0E31 U+0E34..U+0E3A
4538     U+0E47..U+0E4E U+0EB1 U+0EB4..U+0EB9
4539     U+0EBB..U+0EBC U+0EC8..U+0ECD U+0F18..U+0F19
4540     U+0F35 U+0F37 U+0F39 U+0F3E U+0F3F
4541     U+0F71..U+0F84 U+0F86..U+0F8B U+0F90..U+0F95
4542     U+0F97 U+0F99..U+0FAD U+0FB1..U+0FB7 U+0FB9
4543     U+20D0..U+20DC U+20E1 U+302A..U+302F U+3099
4544     U+309A
4545     // Extender
4546     U+00B7 U+02D0 U+02D1 U+0387 U+0640 U+0E46
4547     U+0EC6 U+3005 U+3031..U+3035 U+309D..U+309E
4548     U+30FC..U+30FE
4549     ];
4550 wakaba 1.1
4551     $NameStartChar11 := [
4552     ':' '_'
4553     'A' 'B' 'C' 'D' 'E' 'F' 'G' 'H' 'I' 'J' 'K' 'L' 'M'
4554     'N' 'O' 'P' 'Q' 'R' 'S' 'T' 'U' 'V' 'W' 'X' 'Y' 'Z'
4555     'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm'
4556     'n' 'o' 'p' 'q' 'r' 's' 't' 'u' 'v' 'w' 'x' 'y' 'z'
4557     U+00C0..U+00D6 U+00D8..U+00F6 U+00F8..U+02FF
4558     U+0370..U+037D U+037F..U+1FFF U+200C..U+200D
4559     U+2070..U+218F U+2C00..U+2FEF U+3001..U+D7FF
4560     U+F900..U+FDCF U+FDF0..U+FFFD U+10000..U+EFFFF
4561     ];
4562     $NameChar11 := [
4563     '-' '.' '0' '1' '2' '3' '4' '5' '6' '7' '8' '9'
4564     U+00B7 U+0300..U+036F U+203F..U+2040
4565     // NameStartChar
4566     ':' '_'
4567     'A' 'B' 'C' 'D' 'E' 'F' 'G' 'H' 'I' 'J' 'K' 'L' 'M'
4568     'N' 'O' 'P' 'Q' 'R' 'S' 'T' 'U' 'V' 'W' 'X' 'Y' 'Z'
4569     'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm'
4570     'n' 'o' 'p' 'q' 'r' 's' 't' 'u' 'v' 'w' 'x' 'y' 'z'
4571     U+00C0..U+00D6 U+00D8..U+00F6 U+00F8..U+02FF
4572     U+0370..U+037D U+037F..U+1FFF U+200C..U+200D
4573     U+2070..U+218F U+2C00..U+2FEF U+3001..U+D7FF
4574     U+F900..U+FDCF U+FDF0..U+FFFD U+10000..U+EFFFF
4575     ];
4576 wakaba 1.4 } // NameChar
4577    
4578     lexmode Name
4579     : extends => 'NameChar'
4580     {
4581 wakaba 1.1 Name : value := $NameStartChar11 $NameChar11*;
4582     } // Name
4583 wakaba 1.4
4584     lexmode Nmtoken
4585     : extends => 'NameChar'
4586     {
4587     Nmtoken : value := $NameChar11*;
4588     } // Nmtoken
4589 wakaba 1.1
4590     /*
4591 wakaba 1.14 S
4592 wakaba 1.1 */
4593     lexmode S {
4594 wakaba 1.14 $s := [U+0009 U+000A U+000D U+0020];
4595     S := $s+;
4596 wakaba 1.1 } // S
4597    
4598     /*
4599     Document end scanning mode
4600     */
4601     lexmode DocumentEnd
4602     : standalone
4603     : extends => 'S'
4604     {
4605     /*
4606     Processing instruction
4607     */
4608     PIO := ['<'] ['?'];
4609    
4610     /*
4611     Comment declaration
4612     */
4613     CDO := ['<'] ['!'] ['-'] ['-'];
4614     } // DocumentEnd
4615    
4616     /*
4617     Document misc scanning mode
4618    
4619     This mode scans |Misc| constructions as well
4620     as document element's start tag.
4621     */
4622     lexmode DocumentMisc
4623     : standalone
4624     : extends => 'DocumentEnd'
4625     {
4626     /*
4627     Document element start tag
4628     */
4629     STAGO := ['<'];
4630     } // DocumentMisc
4631    
4632     /*
4633     Document prolog scanning mode
4634     */
4635     lexmode DocumentProlog
4636     : standalone
4637     : extends => 'DocumentMisc'
4638     {
4639     /*
4640     |DOCTYPE| declaration
4641     */
4642     MDO := ['<'] ['!'];
4643     } // DocumentProlog
4644 wakaba 1.16
4645 wakaba 1.1 /*
4646 wakaba 1.16 Document Start Scanning Mode
4647 wakaba 1.1 */
4648     lexmode DocumentStart
4649     : standalone
4650     : extends => 'DocumentProlog'
4651     {
4652     /*
4653     XML declaration
4654     */
4655 wakaba 1.16 XDO := ['<'] ['?'] ['x'] ['m'] ['l'];
4656 wakaba 1.1 } // DocumentStart
4657    
4658     /*
4659     Comment declaration scanning mode
4660     */
4661     lexmode CommentDeclaration
4662     : standalone
4663     {
4664     /*
4665     Comment close
4666     */
4667     COM := ['-'] ['-'];
4668    
4669     /*
4670     Comment data
4671     */
4672 wakaba 1.15 ?default-token STRING : value;
4673 wakaba 1.1 } // CommentDeclaration
4674    
4675     /*
4676     Processing instruction name and |S| scanning mode
4677     */
4678     lexmode PIName
4679     : standalone
4680     : extends => 'Name'
4681     : extends => 'S'
4682     {
4683     /*
4684     Processing instruction close
4685     */
4686     PIC := ['?'] ['>'];
4687     } // PIName
4688    
4689     /*
4690 wakaba 1.16 Processing instruction name and |S| scanning mode
4691     */
4692     lexmode PINmtoken
4693     : standalone
4694     : extends => 'Nmtoken'
4695     : extends => 'S'
4696     {
4697     /*
4698     Processing instruction close
4699     */
4700     PIC := ['?'] ['>'];
4701     } // PINmtoken
4702    
4703     /*
4704 wakaba 1.1 Processing instruction data scanning mode
4705     */
4706     lexmode PIData
4707     : standalone
4708     {
4709     /*
4710     Processing instruction close
4711     */
4712     PIC := ['?'] ['>'];
4713    
4714     /*
4715     Processing instruction target data
4716     */
4717 wakaba 1.2 ?default-token DATA : value;
4718 wakaba 1.1 } // PIData
4719    
4720     /*
4721     Content of element scanning mode
4722     */
4723     lexmode ElementContent
4724     : standalone
4725     {
4726     /*
4727     Start tag open
4728     */
4729     STAGO := ['<'];
4730    
4731     /*
4732     End tag open
4733     */
4734     ETAGO := ['<'] ['/'];
4735    
4736     /*
4737     Hexadecimal character reference open
4738     */
4739     HCRO := ['&'] ['#'] ['x'];
4740    
4741     /*
4742     Numeric character reference open
4743     */
4744     CRO := ['&'] ['#'];
4745    
4746     /*
4747     General entity reference open
4748     */
4749     ERO := ['&'];
4750    
4751     /*
4752     Comment declaration open
4753     */
4754     CDO := ['<'] ['!'] ['-'] ['-'];
4755    
4756     /*
4757     CDATA section open
4758     */
4759     CDSO := ['<'] ['!'] ['[']
4760     ['C'] ['D'] ['A'] ['T'] ['A'] ['['];
4761    
4762     /*
4763     Processing instruction open
4764     */
4765     PIO := ['<'] ['?'];
4766 wakaba 1.2
4767     /*
4768     Markup section end
4769     */
4770     MSE := [']'] [']'] ['>'];
4771    
4772     /*
4773     Character data
4774     */
4775     /*
4776     Character data and/or |MSE|
4777     */
4778     ?default-token CharData : value;
4779 wakaba 1.1 } // ElementContent
4780    
4781     /*
4782     CDATA section content scanning mode
4783     */
4784     lexmode CDATASectionContent
4785     : standalone
4786     {
4787     /*
4788     Markup section end
4789     */
4790     MSE := [']'] [']'] ['>'];
4791    
4792     /*
4793     Character data
4794 wakaba 1.2 */
4795     ?default-token CData : value;
4796 wakaba 1.1 } // CDATASectionContent
4797    
4798     lexmode EntityReference
4799     : standalone
4800     : extends => 'Name'
4801     {
4802     /*
4803     Reference close
4804     */
4805     REFC := [';'];
4806     } // EntityReference
4807    
4808     lexmode NumericCharacterReference
4809     : standalone
4810     {
4811     /*
4812     Decimal number
4813     */
4814     $digit := ['0' '1' '2' '3' '4' '5' '6' '7' '8' '9'];
4815     NUMBER : value := $digit+;
4816    
4817     /*
4818     Reference close
4819     */
4820     REFC := [';'];
4821     } // NumericCharacterReference
4822    
4823     lexmode HexadecimalCharacterReference
4824     : standalone
4825     {
4826     /*
4827     Hexadecimal number
4828     */
4829     $hexdigit := ['0' '1' '2' '3' '4' '5' '6' '7' '8' '9'
4830     'A' 'B' 'C' 'D' 'E' 'F'
4831     'a' 'b' 'c' 'd' 'e' 'f'];
4832     Hex : value := $hexdigit+;
4833    
4834     /*
4835     Reference close
4836     */
4837     REFC := [';'];
4838     } // HexadecimalCharacterReference
4839    
4840 wakaba 1.16 /*
4841     The XML Declaration and Text Declaration Scanning Mode
4842     */
4843 wakaba 1.3 lexmode XMLDeclaration
4844     : standalone
4845     : extends => 'Name'
4846     : extends => 'S'
4847     {
4848    
4849     /*
4850     Value indicator
4851     */
4852     VI := ['='];
4853    
4854     /*
4855     Literal open
4856     */
4857     LIT := ['"'];
4858     LITA := [U+0027];
4859    
4860     /*
4861     Processing instruction close
4862 wakaba 1.16
4863     The |PIC|, i.e. |?>|, is split into two tokens |PIC1| and |PIC2|
4864     in this scanning mode to set |no_xml11_eol| flag in the
4865     |_XMLDeclaration_| |rule|.
4866 wakaba 1.3 */
4867 wakaba 1.16 PIC1 := ['?'];
4868     PIC2 := ['>'];
4869 wakaba 1.3 } // XMLDeclaration
4870 wakaba 1.16
4871     /*
4872     The XML Declaration or Processing Instruction Scanning Mode
4873    
4874     '<?xml' S ...
4875     (DocumentStart) (XMLDeclarationOrPI) (XMLDeclaration)
4876     '<?xml' '1' S ...
4877     (DocumentStart) (XMLDeclarationOrPI) (PINmtoken)(PIName) (PITarget)
4878     '<?xml' '-' 'stylesheet' S ...
4879     (DocumentStart) (XMLDeclarationOrPI) (PINmtoken) (PIName) (PITarget)
4880     */
4881     lexmode XMLDeclarationOrPI
4882     : standalone
4883     : extends => 'NameChar'
4884     : extends => 'S'
4885     {
4886     NameChar : value := $NameChar11;
4887     } // XMLDeclarationOrPI
4888 wakaba 1.3
4889 wakaba 1.1 lexmode StartTag
4890     : standalone
4891     : extends => 'Name'
4892     : extends => 'S'
4893     {
4894    
4895     /*
4896     Value indicator
4897     */
4898     VI := ['='];
4899    
4900     /*
4901     Literal open
4902     */
4903     LIT := ['"'];
4904     LITA := [U+0027];
4905    
4906     /*
4907     Tag close
4908     */
4909     TAGC := ['>'];
4910    
4911     /*
4912 wakaba 1.6 Null end-tag enabled start-tag close
4913 wakaba 1.1 */
4914 wakaba 1.6 NESTC := ['/'];
4915 wakaba 1.1 } // StartTag
4916    
4917     lexmode EndTag
4918     : standalone
4919     : extends => 'Name'
4920     : extends => 'S'
4921     {
4922     /*
4923     Tag close
4924     */
4925     TAGC := ['>'];
4926     } // EndTag
4927    
4928     lexmode AttributeValueLiteral_ {
4929     ERO := ['&'];
4930     CRO := ['&'] ['#'];
4931     HCRO := ['&'] ['#'] ['x'];
4932     } // AttributeValueLiteral_
4933    
4934     lexmode AttributeValueLiteral
4935     : standalone
4936     : extends => 'AttributeValueLiteral_'
4937     {
4938     LIT := ['"'];
4939 wakaba 1.3 STRING : value := [^'"' '&' '<']+;
4940 wakaba 1.1 } // AttributeValueLiteral
4941    
4942     lexmode AttributeValueLiteralA
4943     : standalone
4944     : extends => 'AttributeValueLiteral_'
4945     {
4946 wakaba 1.4 LITA := [U+0027];
4947 wakaba 1.3 STRING : value := [^U+0027 '&' '<']+;
4948 wakaba 1.1 } // AttributeValueLiteralA
4949 wakaba 1.11
4950     lexmode AttributeValueLiteralE
4951     : standalone
4952     : extends => 'AttributeValueLiteral_'
4953     {
4954     STRING : value := [^'&' '<']+;
4955     } // AttributeValueLiteralE
4956 wakaba 1.4
4957     lexmode EntityValue_ {
4958     PERO := ['%'];
4959     ERO := ['&'];
4960     CRO := ['&'] ['#'];
4961     HCRO := ['&'] ['#'] ['x'];
4962     } // EntityValue_
4963    
4964     lexmode EntityValue
4965     : standalone
4966     : extends => 'EntityValue_'
4967     {
4968     LIT := ['"'];
4969     STRING : value := [^'"' '&' '%']+;
4970     } // EntityValue
4971    
4972     lexmode EntityValueA
4973     : standalone
4974     : extends => 'EntityValue_'
4975     {
4976     LITA := [U+0027];
4977     STRING : value := [^U+0027 '&' '%']+;
4978     } // EntityValueA
4979    
4980     lexmode SystemLiteral
4981     : standalone
4982     {
4983     LIT := ['"'];
4984     ?default-token STRING : value;
4985     } // SystemLiteral
4986    
4987     lexmode SystemLiteralA
4988     : standalone
4989     {
4990     LITA := [U+0027];
4991     ?default-token STRING : value;
4992     } // SystemLiteralA
4993    
4994     lexmode DTD
4995     : standalone
4996     : extends => 'S'
4997     {
4998     /*
4999     Markup declaration open
5000     */
5001     MDO := ['<'] ['!'];
5002    
5003     /*
5004     Comment declaration open
5005     */
5006     CDO := ['<'] ['!'] ['-'] ['-'];
5007    
5008     /*
5009     Processing instruction open
5010     */
5011     PIO := ['<'] ['?'];
5012    
5013     /*
5014     Parameter entity reference open
5015     */
5016     PERO := ['%'];
5017    
5018     /*
5019     Declaration subset close
5020     */
5021     DSC := [']'];
5022    
5023     /*
5024     Contition section open
5025     */
5026     CSO := ['<'] ['!'] ['['];
5027     } // DTD
5028    
5029     /*
5030     Markup declaration scanning mode
5031    
5032     This mode is used to recognize |MDC| that terminates
5033     a comment declaration as well as the base |lexmode|
5034     for e.g. document type declaration scanning mode.
5035     */
5036     lexmode MarkupDeclaration
5037     : standalone
5038     : extends => 'Name'
5039     : extends => 'S'
5040     {
5041     /*
5042     Markup declaration close
5043     */
5044     MDC := ['>'];
5045    
5046     /*
5047     Literal open
5048     */
5049     LIT := ['"'];
5050    
5051     /*
5052     Alternative literal open
5053     */
5054     LITA := [U+0027];
5055    
5056     /*
5057     Parameter entity reference open
5058     */
5059     PERO := ['%'];
5060    
5061     /*
5062     Declaration subset open
5063     */
5064     DSO := ['['];
5065     } // MarkupDeclaration
5066    
5067     lexmode ElementDeclaration
5068     : standalone
5069     : extends => 'MarkupDeclaration'
5070     {
5071     /*
5072     Model group open
5073     */
5074     MGO := ['('];
5075    
5076     /*
5077     Model group close
5078     */
5079     MGC := [')'];
5080    
5081     /*
5082     Reserved name indicator
5083     */
5084     RNI := ['#'];
5085    
5086     /*
5087     Occurence indicators
5088     */
5089     OPT := ['?'];
5090     REP := ['*'];
5091     PLUS := ['+'];
5092    
5093     /*
5094     Connectors
5095     */
5096     OR := ['|'];
5097     SEQ := [','];
5098     } // ElementDeclaration
5099    
5100     lexmode AttlistDeclaration
5101     : standalone
5102     : extends => 'MarkupDeclaration'
5103     {
5104     /*
5105     Enumeration group open
5106     */
5107     EGO := ['('];
5108    
5109     /*
5110     Enumeration group close
5111     */
5112     EGC := [')'];
5113    
5114     /*
5115     Enumeration choice delimiter
5116     */
5117     OR := ['|'];
5118    
5119     /*
5120     Reserved name indicator
5121     */
5122     RNI := ['#'];
5123     } // AttlistDeclaration
5124    
5125     lexmode Enumeration
5126     : standalone
5127     : extends => 'Nmtoken'
5128     : extends => 'S'
5129     {
5130     /*
5131     Enumeration group close
5132     */
5133     EGC := [')'];
5134    
5135     /*
5136     Enumeration choice delimiter
5137     */
5138     OR := ['|'];
5139     } // Enumeration
5140    
5141 wakaba 1.1
5142     token-error default : default {
5143     lang:Perl {
5144 wakaba 1.3 my $location;
5145     __CODE{xp|get-location-from-token::
5146     $token => {$token},
5147     $result => {$location},
5148     }__;
5149     my $continue = __DOMCore:ERROR{xp|wf-syntax-error::
5150 wakaba 1.1 xp|error-token => {$token},
5151     DOMCore|location => {$location},
5152     }__;
5153     unless ($continue) {
5154 wakaba 1.27 __CODE{ParseError}__;
5155 wakaba 1.1 }
5156     }
5157     } // default
5158 wakaba 1.5
5159 wakaba 1.26 @ResourceDef:
5160     @@ForCheck: ManakaiDOM|ForClass
5161 wakaba 1.27 @@QName: ParseError
5162     @@rdf:type: DISPerl|BlockCode
5163     @@PerlDef:
5164     __DEEP{
5165     for (@{$self->{entity}}) {
5166     $_->{close_file}->();
5167     }
5168     }__;
5169     __EXCEPTION{DOMLS|PARSE_ERR}__;
5170    
5171     @ResourceDef:
5172     @@ForCheck: ManakaiDOM|ForClass
5173 wakaba 1.26 @@QName: checkNCName
5174     @@rdf:type: DISPerl|BlockCode
5175     @@PerlDef:
5176     if (($self->{xml_version} eq '1.0' and
5177     not <Code::DOMMain|testXML10Name:: $INPUT = $name>) or
5178     ($self->{xml_version} eq '1.1' and
5179     not <Code::DOMMain|testXML11Name:: $INPUT = $name>)) {
5180     my $__location;
5181     __CODE{xp|get-location-from-token::
5182     $token => {$token},
5183     $result => {$__location},
5184     }__;
5185     my $__continue = __c|ERROR{xp|wf-invalid-character-in-node-name::
5186     xp|error-token => {$token},
5187     c|location => {$__location},
5188     xp|name => {$name},
5189     infoset|version => {$self->{xml_version}},
5190     }__;
5191     unless ($__continue) {
5192 wakaba 1.27 __CODE{ParseError}__;
5193 wakaba 1.26 }
5194     } elsif (index ($name, ':') > -1) {
5195     my $__location;
5196     __CODE{xp|get-location-from-token::
5197     $token => {$token},
5198     $result => {$__location},
5199     }__;
5200     my $__continue = __c|ERROR{xp|nswf-legal-ncname::
5201     xp|error-token => {$token},
5202     c|location => {$__location},
5203     xp|name => {$name},
5204     infoset|version => {$self->{xml_version}},
5205     }__;
5206     unless ($__continue) {
5207 wakaba 1.27 __CODE{ParseError}__;
5208 wakaba 1.26 }
5209     }
5210    
5211     @ResourceDef:
5212     @@ForCheck: ManakaiDOM|ForClass
5213     @@QName: checkQName
5214     @@rdf:type: DISPerl|BlockCode
5215     @@PerlDef:
5216     if (($self->{xml_version} eq '1.0' and
5217     not <Code::DOMMain|testXML10Name:: $INPUT = $name>) or
5218     ($self->{xml_version} eq '1.1' and
5219     not <Code::DOMMain|testXML11Name:: $INPUT = $name>)) {
5220     my $__location;
5221     __CODE{xp|get-location-from-token::
5222     $token => {$token},
5223     $result => {$__location},
5224     }__;
5225     my $__continue = __c|ERROR{xp|wf-invalid-character-in-node-name::
5226     xp|error-token => {$token},
5227     c|location => {$__location},
5228     xp|name => {$name},
5229     infoset|version => {$self->{xml_version}},
5230     }__;
5231     unless ($__continue) {
5232 wakaba 1.27 __CODE{ParseError}__;
5233 wakaba 1.26 }
5234     } elsif (($self->{xml_version} eq '1.0' and
5235     not <Code::DOMMain|testXML10QName:: $INPUT = $name>) or
5236     ($self->{xml_version} eq '1.1' and
5237     not <Code::DOMMain|testXML11QName:: $INPUT = $name>)) {
5238     my $__location;
5239     __CODE{xp|get-location-from-token::
5240     $token => {$token},
5241     $result => {$__location},
5242     }__;
5243     my $__continue = __c|ERROR{xp|nswf-legal-qname::
5244     xp|error-token => {$token},
5245     c|location => {$__location},
5246     xp|name => {$name},
5247     infoset|version => {$self->{xml_version}},
5248     }__;
5249     unless ($__continue) {
5250 wakaba 1.27 __CODE{ParseError}__;
5251 wakaba 1.26 }
5252     }
5253    
5254    
5255 wakaba 1.5 @XMLTests:
5256     @@XMLTest:
5257 wakaba 1.15 @@@QName: xp.char.xml10.test
5258     @@@DEnt:
5259     @@@@test:value:
5260     <?xml version="1.0"?>
5261     <p>$u0009$u000A$u000D$u0020$uD7FF$uE000$uFFFD$U00010000$U0010FFFF</p>
5262     @@@test:domTree:
5263     document {
5264     xml-version: '1.0';
5265     element {
5266     text-content: U+0009 U+000A U+000A U+0020 U+D7FF
5267     U+E000 U+FFFD U+10000 U+10FFFF;
5268     }
5269     }
5270     @@XMLTest:
5271     @@@QName: xp.char.xml11.test
5272     @@@DEnt:
5273     @@@@test:value:
5274     <?xml version="1.1"?>
5275     <p>$u0009$u000A$u000D$u0020$uD7FF$uE000$uFFFD$U00010000$U0010FFFF</p>
5276     @@@test:domTree:
5277     document {
5278     xml-version: '1.1';
5279     element {
5280     text-content: U+0009 U+000A U+000A U+0020 U+D7FF
5281     U+E000 U+FFFD U+10000 U+10FFFF;
5282     }
5283     }
5284     @@XMLTest:
5285     @@@QName: xp.char.xml10.c0.test
5286     @@@DEnt:
5287     @@@@test:value:
5288     <?xml version="1.0"?>
5289     <p>$u0000$u0001$u0002$u0003$u0004$u0005$u0006$u0007$u0008$u000B$
5290     $u000C$u000E$u000F$u0010$u0011$u0012$u0013$u0014$u0015$u0016$
5291     $u0017$u0018$u0019$u001A$u001B$u001C$u001D$u001E$u001F</p>
5292 wakaba 1.48 @@@c:erred: <[xp|wf-legal-literal-character]> { (2, 4); } /* U+0000 */
5293     @@@c:erred: <[xp|wf-legal-literal-character]> { (2, 5); } /* U+0001 */
5294     @@@c:erred: <[xp|wf-legal-literal-character]> { (2, 6); } /* U+0002 */
5295     @@@c:erred: <[xp|wf-legal-literal-character]> { (2, 7); } /* U+0003 */
5296     @@@c:erred: <[xp|wf-legal-literal-character]> { (2, 8); } /* U+0004 */
5297     @@@c:erred: <[xp|wf-legal-literal-character]> { (2, 9); } /* U+0005 */
5298     @@@c:erred: <[xp|wf-legal-literal-character]> { (2, 10); } /* U+0006 */
5299     @@@c:erred: <[xp|wf-legal-literal-character]> { (2, 11); } /* U+0007 */
5300     @@@c:erred: <[xp|wf-legal-literal-character]> { (2, 12); } /* U+0008 */
5301     @@@c:erred: <[xp|wf-legal-literal-character]> { (2, 13); } /* U+000B */
5302     @@@c:erred: <[xp|wf-legal-literal-character]> { (2, 14); } /* U+000C */
5303     @@@c:erred: <[xp|wf-legal-literal-character]> { (2, 15); } /* U+000E */
5304     @@@c:erred: <[xp|wf-legal-literal-character]> { (2, 16); } /* U+000F */
5305     @@@c:erred: <[xp|wf-legal-literal-character]> { (2, 17); } /* U+0010 */
5306     @@@c:erred: <[xp|wf-legal-literal-character]> { (2, 18); } /* U+0011 */
5307     @@@c:erred: <[xp|wf-legal-literal-character]> { (2, 19); } /* U+0012 */
5308     @@@c:erred: <[xp|wf-legal-literal-character]> { (2, 20); } /* U+0013 */
5309     @@@c:erred: <[xp|wf-legal-literal-character]> { (2, 21); } /* U+0014 */
5310     @@@c:erred: <[xp|wf-legal-literal-character]> { (2, 22); } /* U+0015 */
5311     @@@c:erred: <[xp|wf-legal-literal-character]> { (2, 23); } /* U+0016 */
5312     @@@c:erred: <[xp|wf-legal-literal-character]> { (2, 24); } /* U+0017 */
5313     @@@c:erred: <[xp|wf-legal-literal-character]> { (2, 25); } /* U+0018 */
5314     @@@c:erred: <[xp|wf-legal-literal-character]> { (2, 26); } /* U+0019 */
5315     @@@c:erred: <[xp|wf-legal-literal-character]> { (2, 27); } /* U+001A */
5316     @@@c:erred: <[xp|wf-legal-literal-character]> { (2, 28); } /* U+001B */
5317     @@@c:erred: <[xp|wf-legal-literal-character]> { (2, 29); } /* U+001C */
5318     @@@c:erred: <[xp|wf-legal-literal-character]> { (2, 30); } /* U+001D */
5319     @@@c:erred: <[xp|wf-legal-literal-character]> { (2, 31); } /* U+001E */
5320     @@@c:erred: <[xp|wf-legal-literal-character]> { (2, 32); } /* U+001F */
5321 wakaba 1.15 @@XMLTest:
5322     @@@QName: xp.char.xml11.c0.test
5323     @@@DEnt:
5324     @@@@test:value:
5325     <?xml version="1.1"?>
5326     <p>$u0000$u0001$u0002$u0003$u0004$u0005$u0006$u0007$u0008$u000B$
5327     $u000C$u000E$u000F$u0010$u0011$u0012$u0013$u0014$u0015$u0016$
5328     $u0017$u0018$u0019$u001A$u001B$u001C$u001D$u001E$u001F</p>
5329 wakaba 1.48 @@@c:erred: <[xp|wf-legal-literal-character]> { (2, 4); } /* U+0000 */
5330     @@@c:erred: <[xp|wf-legal-literal-character]> { (2, 5); } /* U+0001 */
5331     @@@c:erred: <[xp|wf-legal-literal-character]> { (2, 6); } /* U+0002 */
5332     @@@c:erred: <[xp|wf-legal-literal-character]> { (2, 7); } /* U+0003 */
5333     @@@c:erred: <[xp|wf-legal-literal-character]> { (2, 8); } /* U+0004 */
5334     @@@c:erred: <[xp|wf-legal-literal-character]> { (2, 9); } /* U+0005 */
5335     @@@c:erred: <[xp|wf-legal-literal-character]> { (2, 10); } /* U+0006 */
5336     @@@c:erred: <[xp|wf-legal-literal-character]> { (2, 11); } /* U+0007 */
5337     @@@c:erred: <[xp|wf-legal-literal-character]> { (2, 12); } /* U+0008 */
5338     @@@c:erred: <[xp|wf-legal-literal-character]> { (2, 13); } /* U+000B */
5339     @@@c:erred: <[xp|wf-legal-literal-character]> { (2, 14); } /* U+000C */
5340     @@@c:erred: <[xp|wf-legal-literal-character]> { (2, 15); } /* U+000E */
5341     @@@c:erred: <[xp|wf-legal-literal-character]> { (2, 16); } /* U+000F */
5342     @@@c:erred: <[xp|wf-legal-literal-character]> { (2, 17); } /* U+0010 */
5343     @@@c:erred: <[xp|wf-legal-literal-character]> { (2, 18); } /* U+0011 */
5344     @@@c:erred: <[xp|wf-legal-literal-character]> { (2, 19); } /* U+0012 */
5345     @@@c:erred: <[xp|wf-legal-literal-character]> { (2, 20); } /* U+0013 */
5346     @@@c:erred: <[xp|wf-legal-literal-character]> { (2, 21); } /* U+0014 */
5347     @@@c:erred: <[xp|wf-legal-literal-character]> { (2, 22); } /* U+0015 */
5348     @@@c:erred: <[xp|wf-legal-literal-character]> { (2, 23); } /* U+0016 */
5349     @@@c:erred: <[xp|wf-legal-literal-character]> { (2, 24); } /* U+0017 */
5350     @@@c:erred: <[xp|wf-legal-literal-character]> { (2, 25); } /* U+0018 */
5351     @@@c:erred: <[xp|wf-legal-literal-character]> { (2, 26); } /* U+0019 */
5352     @@@c:erred: <[xp|wf-legal-literal-character]> { (2, 27); } /* U+001A */
5353     @@@c:erred: <[xp|wf-legal-literal-character]> { (2, 28); } /* U+001B */
5354     @@@c:erred: <[xp|wf-legal-literal-character]> { (2, 29); } /* U+001C */
5355     @@@c:erred: <[xp|wf-legal-literal-character]> { (2, 30); } /* U+001D */
5356     @@@c:erred: <[xp|wf-legal-literal-character]> { (2, 31); } /* U+001E */
5357     @@@c:erred: <[xp|wf-legal-literal-character]> { (2, 32); } /* U+001F */
5358 wakaba 1.15 @@XMLTest:
5359     @@@QName: xp.char.xml10.c1.test
5360     @@@DEnt:
5361     @@@@test:value:
5362     <?xml version="1.0"?>
5363     <p>$u007F$u0080$u0081$u0082$u0083$u0084$u0086$u0087$u0088$
5364     $u0089$u008A$u008B$u008C$
5365     $u008D$u008E$u008F$u0090$u0091$u0092$u0093$u0094$u0095$u0096$
5366     $u0097$u0098$u0099$u009A$u009B$u009C$u009D$u009E$u009F$u0085</p>
5367     @@@test:domTree:
5368     document {
5369     xml-version: '1.0';
5370     element {
5371     text-content: U+007F U+0080 U+0081 U+0082 U+0083 U+0084 U+0086
5372     U+0087 U+0088 U+0089 U+008A U+008B U+008C U+008D
5373     U+008E U+008F U+0090 U+0091 U+0092 U+0093 U+0094
5374     U+0095 U+0096 U+0097 U+0098 U+0099 U+009A U+009B
5375     U+009C U+009D U+009E U+009F U+0085;
5376     }
5377     }
5378     @@XMLTest:
5379     @@@QName: xp.char.xml11.c1.test
5380     @@@DEnt:
5381     @@@@test:value:
5382     <?xml version="1.1"?>
5383     <p>$u007F$u0080$u0081$u0082$u0083$u0084$u0086$u0087$u0088$
5384     $u0089$u008A$u008B$u008C$
5385     $u008D$u008E$u008F$u0090$u0091$u0092$u0093$u0094$u0095$u0096$
5386     $u0097$u0098$u0099$u009A$u009B$u009C$u009D$u009E$u009F$u0085</p>
5387 wakaba 1.48 @@@c:erred: <[xp|wf-legal-literal-character]> { (2, 4); } /* U+007F */
5388     @@@c:erred: <[xp|wf-legal-literal-character]> { (2, 5); } /* U+0080 */
5389     @@@c:erred: <[xp|wf-legal-literal-character]> { (2, 6); } /* U+0081 */
5390     @@@c:erred: <[xp|wf-legal-literal-character]> { (2, 7); } /* U+0082 */
5391     @@@c:erred: <[xp|wf-legal-literal-character]> { (2, 8); } /* U+0083 */
5392     @@@c:erred: <[xp|wf-legal-literal-character]> { (2, 9); } /* U+0084 */
5393     @@@c:erred: <[xp|wf-legal-literal-character]> { (2, 10); } /* U+0086 */
5394     @@@c:erred: <[xp|wf-legal-literal-character]> { (2, 11); } /* U+0087 */
5395     @@@c:erred: <[xp|wf-legal-literal-character]> { (2, 12); } /* U+0088 */
5396     @@@c:erred: <[xp|wf-legal-literal-character]> { (2, 13); } /* U+0089 */
5397     @@@c:erred: <[xp|wf-legal-literal-character]> { (2, 14); } /* U+008A */
5398     @@@c:erred: <[xp|wf-legal-literal-character]> { (2, 15); } /* U+008B */
5399     @@@c:erred: <[xp|wf-legal-literal-character]> { (2, 16); } /* U+008C */
5400     @@@c:erred: <[xp|wf-legal-literal-character]> { (2, 17); } /* U+008D */
5401     @@@c:erred: <[xp|wf-legal-literal-character]> { (2, 18); } /* U+008E */
5402     @@@c:erred: <[xp|wf-legal-literal-character]> { (2, 19); } /* U+008F */
5403     @@@c:erred: <[xp|wf-legal-literal-character]> { (2, 20); } /* U+0090 */
5404     @@@c:erred: <[xp|wf-legal-literal-character]> { (2, 21); } /* U+0091 */
5405     @@@c:erred: <[xp|wf-legal-literal-character]> { (2, 22); } /* U+0092 */
5406     @@@c:erred: <[xp|wf-legal-literal-character]> { (2, 23); } /* U+0093 */
5407     @@@c:erred: <[xp|wf-legal-literal-character]> { (2, 24); } /* U+0094 */
5408     @@@c:erred: <[xp|wf-legal-literal-character]> { (2, 25); } /* U+0095 */
5409     @@@c:erred: <[xp|wf-legal-literal-character]> { (2, 26); } /* U+0096 */
5410     @@@c:erred: <[xp|wf-legal-literal-character]> { (2, 27); } /* U+0097 */
5411     @@@c:erred: <[xp|wf-legal-literal-character]> { (2, 28); } /* U+0098 */
5412     @@@c:erred: <[xp|wf-legal-literal-character]> { (2, 29); } /* U+0099 */
5413     @@@c:erred: <[xp|wf-legal-literal-character]> { (2, 30); } /* U+009A */
5414     @@@c:erred: <[xp|wf-legal-literal-character]> { (2, 31); } /* U+009B */
5415     @@@c:erred: <[xp|wf-legal-literal-character]> { (2, 32); } /* U+009C */
5416     @@@c:erred: <[xp|wf-legal-literal-character]> { (2, 33); } /* U+009D */
5417     @@@c:erred: <[xp|wf-legal-literal-character]> { (2, 34); } /* U+009E */
5418     @@@c:erred: <[xp|wf-legal-literal-character]> { (2, 35); } /* U+009F */
5419 wakaba 1.15
5420     @@XMLTest:
5421 wakaba 1.27 @@@QName: xp.c0.internal.entity.xml11.1.test
5422     @@@DEnt:
5423     @@@@test:value:
5424     <?xml version="1.1"?>
5425     <!DOCTYPE a [
5426     <!ENTITY e "&#x01;&#x02;&#x03;&#x04;&#x05;&#x06;&#x07;$
5427     &#x08;&#x09;&#x0A;&#x0B;&#x0C;&#x0D;&#x0E;&#x0F;$
5428     &#x10;&#x11;&#x12;&#x13;&#x14;&#x15;&#x16;&#x17;$
5429     &#x18;&#x19;&#x1A;&#x1B;&#x1C;&#x1D;&#x1E;&#x1F;">
5430     ]><a/>
5431 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
5432 wakaba 1.27 @@@test:domTree:
5433     document {
5434     document-type {
5435     general-entity {
5436     node-name: 'e';
5437     text-content: U+0001 U+0002 U+0003 U+0004 U+0005
5438     U+0006 U+0007 U+0008 U+0009 U+000A U+000B
5439     U+000C U+000D U+000E U+000F
5440     U+0010 U+0011 U+0012 U+0013 U+0014 U+0015
5441     U+0016 U+0017 U+0018 U+0019 U+001A U+001B
5442     U+001C U+001D U+001E U+001F;
5443     }
5444     }
5445     element { }
5446     }
5447     @@XMLTest:
5448     @@@QName: xp.c1.internal.entity.xml11.1.test
5449     @@@DEnt:
5450     @@@@test:value:
5451     <?xml version="1.1"?>
5452     <!DOCTYPE a [
5453     <!ENTITY e "&#x80;&#x81;&#x82;&#x83;&#x84;&#x85;&#x86;&#x87;$
5454     &#x88;&#x89;&#x8A;&#x8B;&#x8C;&#x8D;&#x8E;&#x8F;$
5455     &#x90;&#x91;&#x92;&#x93;&#x94;&#x95;&#x96;&#x97;$
5456     &#x98;&#x99;&#x9A;&#x9B;&#x9C;&#x9D;&#x9E;&#x9F;&#x7F;">
5457     ]><a/>
5458 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
5459 wakaba 1.27 @@@test:domTree:
5460     document {
5461     document-type {
5462     general-entity {
5463     node-name: 'e';
5464     text-content: U+0080 U+0081 U+0082 U+0083 U+0084 U+0085
5465     U+0086 U+0087 U+0088 U+0089 U+008A U+008B
5466     U+008C U+008D U+008E U+008F
5467     U+0090 U+0091 U+0092 U+0093 U+0094 U+0095
5468     U+0096 U+0097 U+0098 U+0099 U+009A U+009B
5469     U+009C U+009D U+009E U+009F U+007F;
5470     }
5471     }
5472     element { }
5473     }
5474    
5475     @@XMLTest:
5476 wakaba 1.12 @@@QName: xp.syntax.empty.test
5477     @@@DEnt:
5478     @@@@test:value: \
5479     @@@c:erred:
5480 wakaba 1.48 <[xp:wf-syntax-error]> { (1, 1); }
5481 wakaba 1.12 @@XMLTest:
5482     @@@QName: xp.syntax.space.test
5483     @@@DEnt:
5484 wakaba 1.13 @@@@test:value: \
5485 wakaba 1.12 @@@c:erred:
5486 wakaba 1.48 <[xp:wf-syntax-error]> { (1, 4); }
5487 wakaba 1.12 @@XMLTest:
5488     @@@QName: xp.syntax.newlines.test
5489     @@@DEnt:
5490     @@@@test:value:
5491     \
5492     \
5493     \
5494     @@@c:erred:
5495 wakaba 1.48 <[xp:wf-syntax-error]> { (3, 1); }
5496 wakaba 1.12
5497     @@XMLTest:
5498 wakaba 1.6 @@@QName: xp.only.docel.test
5499 wakaba 1.5 @@@DEnt:
5500     @@@@test:value:
5501     <p></p>
5502     @@@test:domTree:
5503     document {
5504     xml-version: '1.0';
5505 wakaba 1.6 xml-encoding: null;
5506     xml-standalone: false;
5507     element {
5508     namespace-uri: null;
5509     prefix: null;
5510     local-name: 'p';
5511     text-content: '';
5512     }
5513     }
5514     @@XMLTest:
5515     @@@QName: xp.only.docel.emptyelemtag.test
5516     @@@DEnt:
5517     @@@@test:value:
5518     <p/>
5519     @@@test:domTree:
5520     document {
5521     xml-version: '1.0';
5522     xml-encoding: null;
5523     xml-standalone: false;
5524 wakaba 1.5 element {
5525     namespace-uri: null;
5526     prefix: null;
5527     local-name: 'p';
5528     text-content: '';
5529     }
5530     }
5531 wakaba 1.15 @@XMLTest:
5532     @@@QName: xp.root.s.1.test
5533     @@@DEnt:
5534     @@@@test:value:
5535     <?xml version="1.0"?>$u0020$u000D$u000A$u0009
5536     <p></p>
5537     @@@test:domTree:
5538     document {
5539     element { }
5540     }
5541    
5542     @@XMLTest:
5543     @@@QName: xp.Name.1.test
5544     @@@DEnt:
5545     @@@@test:value: <name/>
5546     @@@test:domTree:
5547     document {
5548     element {
5549     node-name: 'name';
5550     }
5551     }
5552     @@XMLTest:
5553     @@@QName: xp.Name.2.test
5554     @@@DEnt:
5555     @@@@test:value: <name0/>
5556     @@@test:domTree:
5557     document {
5558     element {
5559     node-name: 'name0';
5560     }
5561     }
5562     @@enImplNote:
5563     @@@ddid: xml11name
5564     @@@@:
5565     {TODO:: XML 1.1 Name tests required
5566     }
5567    
5568     @@XMLTest:
5569     @@@QName: xp.content.mse.1.test
5570     @@@DEnt:
5571     @@@@test:value:
5572     <p>]]></p>
5573     @@@c:erred:
5574 wakaba 1.48 <[xp|wf-syntax-error]> { (1, 4)..(1, 6); }
5575 wakaba 1.15 @@XMLTest:
5576     @@@QName: xp.content.mse.2.test
5577     @@@DEnt:
5578     @@@@test:value:
5579     <p>aaa]]>bbb</p>
5580     @@@c:erred:
5581 wakaba 1.48 <[xp|wf-syntax-error]> { (1, 7)..(1, 9); }
5582 wakaba 1.15
5583     @@XMLTest:
5584     @@@QName: xp.root.comment.1.test
5585     @@@DEnt:
5586     @@@@test:value:
5587     <!--comment data-->
5588     <p/>
5589     @@@test:domTree:
5590     document {
5591     comment {
5592     data: 'comment data';
5593     }
5594     element { }
5595     }
5596     @@XMLTest:
5597     @@@QName: xp.root.comment.2.test
5598     @@@DEnt:
5599     @@@@test:value:
5600     <!---->
5601     <p/>
5602     @@@test:domTree:
5603     document {
5604     comment {
5605     data: '';
5606     }
5607     element { }
5608     }
5609     @@XMLTest:
5610     @@@QName: xp.root.after.pi.comment.1.test
5611     @@@DEnt:
5612     @@@@test:value:
5613     <?pi?>
5614     <!--comment data-->
5615     <p/>
5616     @@@test:domTree:
5617     document {
5618     pi { }
5619     comment {
5620     data: 'comment data';
5621     }
5622     element { }
5623     }
5624     @@XMLTest:
5625     @@@QName: xp.root.after.pi.comment.2.test
5626     @@@DEnt:
5627     @@@@test:value:
5628     <?pi?>
5629     <!---->
5630     <p/>
5631     @@@test:domTree:
5632     document {
5633     pi { }
5634     comment {
5635     data: '';
5636     }
5637     element { }
5638     }
5639     @@XMLTest:
5640     @@@QName: xp.root.after.element.comment.1.test
5641     @@@DEnt:
5642     @@@@test:value:
5643     <p/>
5644     <!--comment data-->
5645     @@@test:domTree:
5646     document {
5647     element { }
5648     comment {
5649     data: 'comment data';
5650     }
5651     }
5652     @@XMLTest:
5653     @@@QName: xp.root.after.element.comment.2.test
5654     @@@DEnt:
5655     @@@@test:value:
5656     <p/>
5657     <!---->
5658     @@@test:domTree:
5659     document {
5660     element { }
5661     comment {
5662     data: '';
5663     }
5664     }
5665     @@XMLTest:
5666     @@@QName: xp.doctype.intsubset.comment.1.test
5667     @@@DEnt:
5668     @@@@test:value:
5669     <!DOCTYPE a [
5670     <!--comment data-->
5671     ]>
5672     <p/>
5673     @@@test:domTree:
5674     document {
5675     document-type { }
5676     element { }
5677     }
5678     @@XMLTest:
5679     @@@QName: xp.doctype.intsubset.comment.2.test
5680     @@@DEnt:
5681     @@@@test:value:
5682     <!DOCTYPE a [
5683     <!---->
5684     ]>
5685     <p/>
5686     @@@test:domTree:
5687     document {
5688     document-type { }
5689     element { }
5690     }
5691     @@XMLTest:
5692     @@@QName: xp.doctype.intsubset.comment.3.test
5693     @@@DEnt:
5694     @@@@test:value:
5695     <!DOCTYPE a [
5696     <?pi?>
5697     <!---->
5698     ]>
5699     <p/>
5700     @@@test:domTree:
5701     document {
5702     document-type {
5703     pi { }
5704     }
5705     element { }
5706     }
5707     @@XMLTest:
5708     @@@QName: xp.content.comment.1.test
5709     @@@DEnt:
5710     @@@@test:value:
5711     <p><!--comment data--></p>
5712     @@@test:domTree:
5713     document {
5714     element {
5715     comment {
5716     data: 'comment data';
5717     }
5718     }
5719     }
5720     @@XMLTest:
5721     @@@QName: xp.content.comment.2.test
5722     @@@DEnt:
5723     @@@@test:value:
5724     <p><!----></p>
5725     @@@test:domTree:
5726     document {
5727     element {
5728     comment {
5729     data: '';
5730     }
5731     }
5732     }
5733     @@XMLTest:
5734     @@@QName: xp.content.comment.3.test
5735     @@@DEnt:
5736     @@@@test:value:
5737     <p>aaaaa<!---->bbbbb</p>
5738     @@@test:domTree:
5739     document {
5740     element {
5741     text {
5742     data: 'aaaaa';
5743     }
5744     comment {
5745     data: '';
5746     }
5747     text {
5748     data: 'bbbbb';
5749     }
5750     }
5751     }
5752     @@XMLTest:
5753     @@@QName: xp.content.comment.--.1.test
5754     @@@DEnt:
5755     @@@@test:value:
5756     <p><!--data--data--></p>
5757 wakaba 1.48 @@@c:erred: <[xp|wf-syntax-error]> { (1, 12)..(1, 17); }
5758 wakaba 1.15 @@XMLTest:
5759     @@@QName: xp.content.comment.---gt.test
5760     @@@DEnt:
5761     @@@@test:value:
5762     <p><!--data---></p>
5763 wakaba 1.48 @@@c:erred: <[xp|wf-syntax-error]> { (1, 12)..(1, 15); }
5764 wakaba 1.13
5765     @@XMLTest:
5766     @@@QName: xp.xmldecl.version.1.0.test
5767     @@@DEnt:
5768     @@@@test:value:
5769     <?xml version="1.0"?>
5770     <p></p>
5771     @@@test:domTree:
5772     document {
5773     xml-version: '1.0';
5774     xml-encoding: null;
5775     xml-standalone: false;
5776     element { }
5777     }
5778     @@XMLTest:
5779     @@@QName: xp.xmldecl.version.1.0.lita.test
5780     @@@DEnt:
5781     @@@@test:value:
5782     <?xml version='1.0'?>
5783     <p></p>
5784     @@@test:domTree:
5785     document {
5786     xml-version: '1.0';
5787     xml-encoding: null;
5788     xml-standalone: false;
5789     element { }
5790     }
5791     @@XMLTest:
5792     @@@QName: xp.xmldecl.version.1.0.s.test
5793     @@@DEnt:
5794     @@@@test:value:
5795     <?xml version = "1.0" ?>
5796     <p></p>
5797     @@@test:domTree:
5798     document {
5799     xml-version: '1.0';
5800     xml-encoding: null;
5801     xml-standalone: false;
5802     element { }
5803     }
5804     @@XMLTest:
5805     @@@QName: xp.xmldecl.version.1.1.test
5806     @@@DEnt:
5807     @@@@test:value:
5808     <?xml version="1.1"?>
5809     <p></p>
5810     @@@test:domTree:
5811     document {
5812     xml-version: '1.1';
5813     xml-encoding: null;
5814     xml-standalone: false;
5815     element { }
5816     }
5817    
5818     @@XMLTest:
5819     @@@QName: xp.xmldecl.version.1.0.encoding.usascii.test
5820     @@@DEnt:
5821     @@@@test:value:
5822     <?xml version="1.0" encoding="US-ascii"?>
5823     <p></p>
5824     @@@test:domTree:
5825     document {
5826     xml-version: '1.0';
5827     xml-encoding: 'US-ascii';
5828     xml-standalone: false;
5829     element { }
5830     }
5831     @@XMLTest:
5832     @@@QName: xp.xmldecl.version.1.0.encoding.usascii.lita.test
5833     @@@DEnt:
5834     @@@@test:value:
5835     <?xml version="1.0" encoding='US-ascii'?>
5836     <p></p>
5837     @@@test:domTree:
5838     document {
5839     xml-version: '1.0';
5840     xml-encoding: 'US-ascii';
5841     xml-standalone: false;
5842     element { }
5843     }
5844     @@XMLTest:
5845     @@@QName: xp.xmldecl.version.1.0.encoding.usascii.s.test
5846     @@@DEnt:
5847     @@@@test:value:
5848     <?xml version="1.0" encoding = "US-ascii" ?>
5849     <p></p>
5850     @@@test:domTree:
5851     document {
5852     xml-version: '1.0';
5853     xml-encoding: 'US-ascii';
5854     xml-standalone: false;
5855     element { }
5856     }
5857    
5858     @@XMLTest:
5859     @@@QName: xp.xmldecl.version.1.0.encoding.usascii.standalone.yes.test
5860     @@@DEnt:
5861     @@@@test:value:
5862     <?xml version="1.0" encoding="us-ascii" standalone="yes"?>
5863     <p></p>
5864     @@@test:domTree:
5865     document {
5866     xml-version: '1.0';
5867     xml-encoding: 'us-ascii';
5868     xml-standalone: true;
5869     element { }
5870     }
5871     @@XMLTest:
5872     @@@QName: xp.xmldecl.version.1.0.encoding.usascii.standalone.no.test
5873     @@@DEnt:
5874     @@@@test:value:
5875     <?xml version="1.0" encoding="us-ascii" standalone="no"?>
5876     <p></p>
5877     @@@test:domTree:
5878     document {
5879     xml-version: '1.0';
5880     xml-encoding: 'us-ascii';
5881     xml-standalone: false;
5882     element { }
5883     }
5884     @@XMLTest:
5885     @@@QName: xp.xmldecl.version.1.0.encoding.usascii.standalone.yes.lita.test
5886     @@@DEnt:
5887     @@@@test:value:
5888     <?xml version="1.0" encoding="us-ascii" standalone='yes'?>
5889     <p></p>
5890     @@@test:domTree:
5891     document {
5892     xml-version: '1.0';
5893     xml-encoding: 'us-ascii';
5894     xml-standalone: true;
5895     element { }
5896     }
5897     @@XMLTest:
5898     @@@QName: xp.xmldecl.version.1.0.encoding.usascii.standalone.yes.s.test
5899     @@@DEnt:
5900     @@@@test:value:
5901     <?xml version="1.0" encoding="us-ascii" standalone = "yes" ?>
5902     <p></p>
5903     @@@test:domTree:
5904     document {
5905     xml-version: '1.0';
5906     xml-encoding: 'us-ascii';
5907     xml-standalone: true;
5908     element { }
5909     }
5910 wakaba 1.14 @@XMLTest:
5911     @@@QName: xp.xmldecl.no.encoding.but.standalone.attr.test
5912     @@@DEnt:
5913     @@@@test:value:
5914     <?xml version="1.0" standalone="yes"?>
5915     <p></p>
5916     @@@test:domTree:
5917     document {
5918     xml-version: '1.0';
5919     xml-encoding: null;
5920     xml-standalone: true;
5921     element { }
5922     }
5923     @@XMLTest:
5924     @@@QName: xp.xmldecl.encoding.encname.test
5925     @@@DEnt:
5926     @@@@test:value:
5927     <?xml version="1.0" encoding="a-._01-"?>
5928     <p></p>
5929     @@@test:domTree:
5930     document {
5931     xml-version: '1.0';
5932     xml-encoding: 'a-._01-';
5933     xml-standalone: false;
5934     element { }
5935     }
5936    
5937     @@XMLTest:
5938     @@@QName: xp.xmldecl.no.s.no.attr.test
5939     @@@DEnt:
5940     @@@@test:value:
5941     <?xml?>
5942     <p></p>
5943     @@@c:erred:
5944 wakaba 1.48 <[xp:wf-syntax-error]> { (1, 1)..(1, 7); }
5945 wakaba 1.14 @@XMLTest:
5946     @@@QName: xp.xmldecl.s.no.attr.test
5947     @@@DEnt:
5948     @@@@test:value:
5949     <?xml ?>
5950     <p></p>
5951     @@@c:erred:
5952 wakaba 1.48 <[xp:wf-syntax-error]> { (1, 8)..(1, 9); }
5953 wakaba 1.14 @@XMLTest:
5954     @@@QName: xp.xmldecl.unknown.attr.test
5955     @@@DEnt:
5956     @@@@test:value:
5957     <?xml unknown="value"?>
5958     <p></p>
5959     @@@c:erred:
5960 wakaba 1.48 <[xp:wf-syntax-error]> { (1, 8)..(1, 22); }
5961 wakaba 1.14 @@XMLTest:
5962     @@@QName: xp.xmldecl.version.unknown.attr.test
5963     @@@DEnt:
5964     @@@@test:value:
5965     <?xml version="1.0" unknown="value"?>
5966     <p></p>
5967     @@@c:erred:
5968 wakaba 1.48 <[xp:wf-syntax-error]> { (1, 21)..(1, 35); }
5969 wakaba 1.14 @@XMLTest:
5970     @@@QName: xp.xmldecl.version.encoding.unknown.attr.test
5971     @@@DEnt:
5972     @@@@test:value:
5973     <?xml version="1.0" encoding="us-ascii" unknown="value"?>
5974     <p></p>
5975     @@@c:erred:
5976 wakaba 1.48 <[xp:wf-syntax-error]> { (1, 41)..(1, 55); }
5977 wakaba 1.14 @@XMLTest:
5978     @@@QName: xp.xmldecl.version.encoding.standalone.unknown.attr.test
5979     @@@DEnt:
5980     @@@@test:value:
5981     <?xml version="1.0" encoding="us-ascii" standalone="yes"
5982     unknown="value"?>
5983     <p></p>
5984     @@@c:erred:
5985 wakaba 1.48 <[xp:wf-syntax-error]> { (2, 1)..(2, 15); }
5986 wakaba 1.14 @@XMLTest:
5987     @@@QName: xp.xmldecl.no.version.but.encoding.attr.test
5988     @@@DEnt:
5989     @@@@test:value:
5990     <?xml encoding="us-ascii"?>
5991     <p></p>
5992     @@@c:erred:
5993 wakaba 1.48 <[xp:wf-syntax-error]> { (1, 7)..(1, 25); }
5994 wakaba 1.14 @@XMLTest:
5995     @@@QName: xp.xmldecl.no.version.but.standalone.attr.test
5996     @@@DEnt:
5997     @@@@test:value:
5998     <?xml standalone="yes"?>
5999     <p></p>
6000     @@@c:erred:
6001 wakaba 1.48 <[xp:wf-syntax-error]> { (1, 7)..(1, 24); }
6002 wakaba 1.14 @@XMLTest:
6003     @@@QName: xp.xmldecl.version.unsupported.test
6004     @@@DEnt:
6005     @@@@test:value:
6006     <?xml version="1.2"?>
6007     <p></p>
6008     @@@c:erred:
6009 wakaba 1.48 <[xp:wf-unsupported-xml-version]> { (1, 7)..(1, 19); }
6010 wakaba 1.14 @@XMLTest:
6011     @@@QName: xp.xmldecl.version.unsupported.2.test
6012     @@@DEnt:
6013     @@@@test:value:
6014     <?xml version=" 1.0 "?>
6015     <p></p>
6016     @@@c:erred:
6017 wakaba 1.48 <[xp:wf-unsupported-xml-version]> { (1, 7)..(1, 21); }
6018 wakaba 1.14 @@XMLTest:
6019     @@@QName: xp.xmldecl.version.unsupported.3.test
6020     @@@DEnt:
6021     @@@@test:value:
6022     <?xml version="01.00"?>
6023     <p></p>
6024     @@@c:erred:
6025 wakaba 1.48 <[xp:wf-unsupported-xml-version]> { (1, 7)..(1, 21); }
6026 wakaba 1.14 @@XMLTest:
6027     @@@QName: xp.xmldecl.encoding.malformed.1.test
6028     @@@DEnt:
6029     @@@@test:value:
6030     <?xml version="1.0" encoding="0088"?>
6031     <p></p>
6032     @@@c:erred:
6033 wakaba 1.48 <[xp:wf-malformed-enc-name]> { (1, 21)..(1, 35); }
6034 wakaba 1.14 @@XMLTest:
6035     @@@QName: xp.xmldecl.encoding.malformed.2.test
6036     @@@DEnt:
6037     @@@@test:value:
6038     <?xml version="1.0" encoding="D.V.D!"?>
6039     <p></p>
6040     @@@c:erred:
6041 wakaba 1.48 <[xp:wf-malformed-enc-name]> { (1, 21)..(1, 38); }
6042 wakaba 1.14 @@XMLTest:
6043     @@@QName: xp.xmldecl.standalone.malformed.1.test
6044     @@@DEnt:
6045     @@@@test:value:
6046     <?xml version="1.0" standalone="true"?>
6047     <p></p>
6048     @@@c:erred:
6049 wakaba 1.48 <[xp:wf-malformed-xml-standalone]> { (1, 21)..(1, 38); }
6050 wakaba 1.14 @@XMLTest:
6051     @@@QName: xp.xmldecl.standalone.malformed.2.test
6052     @@@DEnt:
6053     @@@@test:value:
6054     <?xml version="1.0" standalone="YES"?>
6055     <p></p>
6056     @@@c:erred:
6057 wakaba 1.48 <[xp:wf-malformed-xml-standalone]> { (1, 21)..(1, 37); }
6058 wakaba 1.14 @@XMLTest:
6059     @@@QName: xp.xmldecl.standalone.malformed.3.test
6060     @@@DEnt:
6061     @@@@test:value:
6062     <?xml version="1.0" standalone="no "?>
6063     <p></p>
6064     @@@c:erred:
6065 wakaba 1.48 <[xp:wf-malformed-xml-standalone]> { (1, 21)..(1, 38); }
6066 wakaba 1.6
6067     @@XMLTest:
6068 wakaba 1.14 @@@QName: xp.no-xmldecl.xml...-pi.test
6069     @@@DEnt:
6070     @@@@test:value:
6071     <?xmldeclaration?>
6072     <a></a>
6073     @@@test:domTree:
6074     document {
6075     pi {
6076     node-name: 'xmldeclaration';
6077     node-value: '';
6078     }
6079     element { }
6080     }
6081     @@XMLTest:
6082     @@@QName: xp.no-xmldecl.xml...-pi.after.document.element.test
6083     @@@DEnt:
6084     @@@@test:value:
6085     <a></a>
6086     <?xmldeclaration?>
6087     @@@test:domTree:
6088     document {
6089     element { }
6090     pi {
6091     node-name: 'xmldeclaration';
6092     node-value: '';
6093     }
6094     }
6095     @@XMLTest:
6096     @@@QName: xp.no-xmldecl.xml...-pi.in.document.element.test
6097     @@@DEnt:
6098     @@@@test:value:
6099     <a>
6100     <?xmldeclaration?>
6101     </a>
6102     @@@test:domTree:
6103     document {
6104     element {
6105     text { }
6106     pi {
6107     node-name: 'xmldeclaration';
6108     node-value: '';
6109     }
6110     text { }
6111     }
6112     }
6113     @@XMLTest:
6114     @@@QName: xp.no-xmldecl.xml...-pi.in.doctype.test
6115     @@@DEnt:
6116     @@@@test:value:
6117     <!DOCTYPE a [
6118     <?xmldeclaration?>
6119     ]>
6120     <a></a>
6121     @@@test:domTree:
6122     document {
6123     document-type {
6124     pi {
6125     node-name: 'xmldeclaration';
6126     node-value: '';
6127     }
6128     }
6129     element { }
6130     }
6131    
6132     @@XMLTest:
6133     @@@QName: xp.XMLdecl.test
6134     @@@DEnt:
6135     @@@@test:value:
6136     <?XML version="1.0"?>
6137     <p></p>
6138     @@@c:erred:
6139 wakaba 1.48 <[xp:wf-pi-target-is-xml]> { (1, 1)..(1, 5); }
6140 wakaba 1.14 @@XMLTest:
6141     @@@QName: xp.Xmldecl.test
6142     @@@DEnt:
6143     @@@@test:value:
6144     <?Xml version="1.0"?>
6145     <p></p>
6146     @@@c:erred:
6147 wakaba 1.48 <[xp:wf-pi-target-is-xml]> { (1, 1)..(1, 5); }
6148 wakaba 1.14 @@XMLTest:
6149     @@@QName: xp.xmldecl.after.document.element.empty.test
6150     @@@DEnt:
6151     @@@@test:value:
6152     <p></p>
6153     <?xml?>
6154     @@@c:erred:
6155 wakaba 1.48 <[xp:wf-pi-target-is-xml]> { (2, 1)..(2, 5); }
6156 wakaba 1.14 @@XMLTest:
6157     @@@QName: xp.xmldecl.after.document.element.test
6158     @@@DEnt:
6159     @@@@test:value:
6160     <p></p>
6161     <?xml version="1.0"?>
6162     @@@c:erred:
6163 wakaba 1.48 <[xp:wf-pi-target-is-xml]> { (2, 1)..(2, 5); }
6164 wakaba 1.14 @@XMLTest:
6165     @@@QName: xp.xmldecl.in.element.empty.test
6166     @@@DEnt:
6167     @@@@test:value:
6168     <p>
6169     <?xml?>
6170     </p>
6171     @@@c:erred:
6172 wakaba 1.48 <[xp:wf-pi-target-is-xml]> { (2, 1)..(2, 5); }
6173 wakaba 1.14 @@XMLTest:
6174     @@@QName: xp.xmldecl.in.element.test
6175     @@@DEnt:
6176     @@@@test:value:
6177     <p>
6178     <?xml version="1.0"?>
6179     </p>
6180     @@@c:erred:
6181 wakaba 1.48 <[xp:wf-pi-target-is-xml]> { (2, 1)..(2, 5); }
6182 wakaba 1.14 @@XMLTest:
6183     @@@QName: xp.xmldecl.after.comment.test
6184     @@@DEnt:
6185     @@@@test:value:
6186     <!---->
6187     <?xml version="1.0"?>
6188     <p></p>
6189     @@@c:erred:
6190 wakaba 1.48 <[xp:wf-pi-target-is-xml]> { (2, 1)..(2, 5); }
6191 wakaba 1.14 @@XMLTest:
6192     @@@QName: xp.xmldecl.after.comment.empty.test
6193     @@@DEnt:
6194     @@@@test:value:
6195     <!---->
6196     <?xml?>
6197     <p></p>
6198     @@@c:erred:
6199 wakaba 1.48 <[xp:wf-pi-target-is-xml]> { (2, 1)..(2, 5); }
6200 wakaba 1.14 @@XMLTest:
6201     @@@QName: xp.xmldecl.after.pi.test
6202     @@@DEnt:
6203     @@@@test:value:
6204     <?xml-declaration?>
6205     <?xml version="1.0"?>
6206     <p></p>
6207     @@@c:erred:
6208 wakaba 1.48 <[xp:wf-pi-target-is-xml]> { (2, 1)..(2, 5); }
6209 wakaba 1.14 @@XMLTest:
6210     @@@QName: xp.xmldecl.after.pi.empty.test
6211     @@@DEnt:
6212     @@@@test:value:
6213     <?xml-declaration?>
6214     <?xml?>
6215     <p></p>
6216     @@@c:erred:
6217 wakaba 1.48 <[xp:wf-pi-target-is-xml]> { (2, 1)..(2, 5); }
6218 wakaba 1.14 @@XMLTest:
6219 wakaba 1.16 @@@QName: xp.xmldecl.after.pi.2.test
6220     @@@DEnt:
6221     @@@@test:value:
6222     <?declaration?>
6223     <?xml version="1.0"?>
6224     <p></p>
6225     @@@c:erred:
6226 wakaba 1.48 <[xp:wf-pi-target-is-xml]> { (2, 1)..(2, 5); }
6227 wakaba 1.16 @@XMLTest:
6228     @@@QName: xp.xmldecl.after.pi.empty.2.test
6229     @@@DEnt:
6230     @@@@test:value:
6231     <?declaration?>
6232     <?xml?>
6233     <p></p>
6234     @@@c:erred:
6235 wakaba 1.48 <[xp:wf-pi-target-is-xml]> { (2, 1)..(2, 5); }
6236 wakaba 1.16 @@XMLTest:
6237 wakaba 1.14 @@@QName: xp.xmldecl.after.doctype.test
6238     @@@DEnt:
6239     @@@@test:value:
6240     <!DOCTYPE a>
6241     <?xml version="1.0"?>
6242     <p></p>
6243     @@@c:erred:
6244 wakaba 1.48 <[xp:wf-pi-target-is-xml]> { (2, 1)..(2, 5); }
6245 wakaba 1.14 @@XMLTest:
6246     @@@QName: xp.xmldecl.after.doctype.empty.test
6247     @@@DEnt:
6248     @@@@test:value:
6249     <!DOCTYPE a>
6250     <?xml?>
6251     <p></p>
6252     @@@c:erred:
6253 wakaba 1.48 <[xp:wf-pi-target-is-xml]> { (2, 1)..(2, 5); }
6254 wakaba 1.14 @@XMLTest:
6255     @@@QName: xp.xmldecl.in.doctype.test
6256     @@@DEnt:
6257     @@@@test:value:
6258     <!DOCTYPE a [
6259     <?xml version="1.0"?>
6260     ]>
6261     <p></p>
6262     @@@c:erred:
6263 wakaba 1.48 <[xp:wf-pi-target-is-xml]> { (2, 1)..(2, 5); }
6264 wakaba 1.14 @@XMLTest:
6265     @@@QName: xp.xmldecl.in.doctype.empty.test
6266     @@@DEnt:
6267     @@@@test:value:
6268     <!DOCTYPE a [
6269     <?xml?>
6270     ]>
6271     <p></p>
6272     @@@c:erred:
6273 wakaba 1.48 <[xp:wf-pi-target-is-xml]> { (2, 1)..(2, 5); }
6274 wakaba 1.14
6275     @@XMLTest:
6276     @@@QName: xp.pi.before.element.empty.test
6277     @@@DEnt:
6278     @@@@test:value:
6279     <?target?>
6280     <a></a>
6281     @@@test:domTree:
6282     document {
6283     pi {
6284     node-name: 'target';
6285     node-value: '';
6286     }
6287     element { }
6288     }
6289     @@XMLTest:
6290     @@@QName: xp.pi.before.element.s.test
6291     @@@DEnt:
6292     @@@@test:value:
6293     <?target ?>
6294     <a></a>
6295     @@@test:domTree:
6296     document {
6297     pi {
6298     node-name: 'target';
6299     node-value: '';
6300     }
6301     element { }
6302     }
6303     @@XMLTest:
6304     @@@QName: xp.pi.before.element.string.test
6305     @@@DEnt:
6306     @@@@test:value:
6307     <?target string?>
6308     <a></a>
6309     @@@test:domTree:
6310     document {
6311     pi {
6312     node-name: 'target';
6313     node-value: 'string';
6314     }
6315     element { }
6316     }
6317     @@XMLTest:
6318     @@@QName: xp.pi.before.element.string.s.test
6319     @@@DEnt:
6320     @@@@test:value:
6321     <?target string ?>
6322     <a></a>
6323     @@@test:domTree:
6324     document {
6325     pi {
6326     node-name: 'target';
6327     node-value: 'string ';
6328     }
6329     element { }
6330     }
6331     @@XMLTest:
6332     @@@QName: xp.pi.before.element.gt.test
6333     @@@DEnt:
6334     @@@@test:value:
6335     <?target string>string?>
6336     <a></a>
6337     @@@test:domTree:
6338     document {
6339     pi {
6340     node-name: 'target';
6341     node-value: 'string>string';
6342     }
6343     element { }
6344     }
6345     @@XMLTest:
6346     @@@QName: xp.pi.doctype.empty.test
6347     @@@DEnt:
6348     @@@@test:value:
6349     <!DOCTYPE a [
6350     <?target?>
6351     ]>
6352     <a></a>
6353     @@@test:domTree:
6354     document {
6355     document-type {
6356     pi {
6357     node-name: 'target';
6358     node-value: '';
6359     }
6360     }
6361     element { }
6362     }
6363    
6364     @@XMLTest:
6365     @@@QName: xp.pi.no.target.test
6366     @@@DEnt:
6367     @@@@test:value:
6368     <??>
6369     <p></p>
6370     @@@c:erred:
6371 wakaba 1.48 <[xp:wf-syntax-error]> { (1, 3)..(1, 4); }
6372 wakaba 1.14 @@XMLTest:
6373     @@@QName: xp.pi.no.target.2.test
6374     @@@DEnt:
6375     @@@@test:value:
6376     <? ?>
6377     <p></p>
6378     @@@c:erred:
6379 wakaba 1.48 <[xp:wf-syntax-error]> { (1, 3)..(1, 4); }
6380 wakaba 1.14 @@XMLTest:
6381     @@@QName: xp.pi.bad.target.1.test
6382     @@@DEnt:
6383     @@@@test:value:
6384     <?target! ?>
6385     <p></p>
6386     @@@c:erred:
6387 wakaba 1.48 <[xp:wf-syntax-error]> { (1, 9)..(1, 9); }
6388 wakaba 1.14 @@XMLTest:
6389     @@@QName: xp.pi.bad.target.2.test
6390     @@@DEnt:
6391     @@@@test:value:
6392     <?0target ?>
6393     <p></p>
6394     @@@c:erred:
6395 wakaba 1.48 <[xp:wf-syntax-error]> { (1, 3)..(1, 3); }
6396 wakaba 1.14
6397     @@XMLTest:
6398 wakaba 1.15 @@@QName: xp.cdatasection.empty.1.test
6399     @@@DEnt:
6400     @@@@test:value:
6401     <p><![CDATA[]]></p>
6402     @@@test:domTree:
6403     document {
6404     element {
6405     cdata-section {
6406     data: '';
6407     }
6408     }
6409     }
6410     @@XMLTest:
6411     @@@QName: xp.cdatasection.empty.2.test
6412     @@@DEnt:
6413     @@@@test:value:
6414     <p>aa<![CDATA[]]>bb</p>
6415     @@@test:domTree:
6416     document {
6417     element {
6418     text { data: 'aa'; }
6419     cdata-section {
6420     data: '';
6421     }
6422     text { data: 'bb'; }
6423     }
6424     }
6425     @@XMLTest:
6426     @@@QName: xp.cdatasection.1.test
6427     @@@DEnt:
6428     @@@@test:value:
6429     <p><![CDATA[abcdefg]]></p>
6430     @@@test:domTree:
6431     document {
6432     element {
6433     cdata-section {
6434     data: 'abcdefg';
6435     }
6436     }
6437     }
6438     @@XMLTest:
6439     @@@QName: xp.cdatasection.2.test
6440     @@@DEnt:
6441     @@@@test:value:
6442     <p>aa<![CDATA[abcdefg]]>bb</p>
6443     @@@test:domTree:
6444     document {
6445     element {
6446     text { data: 'aa'; }
6447     cdata-section {
6448     data: 'abcdefg';
6449     }
6450     text { data: 'bb'; }
6451     }
6452     }
6453     @@XMLTest:
6454     @@@QName: xp.cdatasection.ref.1.test
6455     @@@DEnt:
6456     @@@@test:value:
6457     <p><![CDATA[a&amp;&#x32;&#32;%abc;&def;]]&gt;b]]></p>
6458     @@@test:domTree:
6459     document {
6460     element {
6461     cdata-section {
6462     data: 'a&amp;&#x32;&#32;%abc;&def;]]&gt;b';
6463     }
6464     }
6465     }
6466     @@XMLTest:
6467     @@@QName: xp.cdatasection.in.general.entity.test
6468     @@@DEnt:
6469     @@@@test:value:
6470     <!DOCTYPE p [
6471     <!ENTITY cdata "<![CDATA[text]]>">
6472     ]>
6473     <p>&cdata;</p>
6474 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
6475 wakaba 1.15 @@@test:domTree:
6476     document {
6477     document-type {
6478     general-entity {
6479     node-name: 'cdata';
6480     cdata-section {
6481     data: 'text';
6482     }
6483     }
6484     }
6485     element {
6486     general-entity-reference {
6487 wakaba 1.23 node-name: 'cdata';
6488 wakaba 1.34 manakai-expanded: true;
6489 wakaba 1.15 cdata-section {
6490     data: 'text';
6491     }
6492     }
6493     }
6494     }
6495     @@XMLTest:
6496     @@@QName: xp.cdatasection.no.mse.test
6497     @@@DEnt:
6498     @@@@test:value:
6499     <p><![CDATA[text</p>
6500 wakaba 1.48 @@@c:erred: <[xp|wf-syntax-error]> { (1, 21); }
6501 wakaba 1.15 @@XMLTest:
6502     @@@QName: xp.cdatasection.nest.test
6503     @@@DEnt:
6504     @@@@test:value:
6505     <p><![CDATA[text01<![CDATA[txt2]]>text3]]></p>
6506 wakaba 1.48 @@@c:erred: <[xp|wf-syntax-error]> { (1, 40)..(1, 42); }
6507 wakaba 1.15
6508     @@XMLTest:
6509 wakaba 1.6 @@@QName: xp.doctype.empty.test
6510     @@@DEnt:
6511     @@@@test:value:
6512     <!DOCTYPE a>
6513     <a></a>
6514     @@@test:domTree:
6515     document {
6516     xml-version: '1.0';
6517     xml-encoding: null;
6518     xml-standalone: false;
6519     document-type {
6520     node-name: 'a';
6521 wakaba 1.17 public-id: null;
6522     system-id: null;
6523 wakaba 1.6 }
6524     element {
6525     namespace-uri: null;
6526     prefix: null;
6527     local-name: 'a';
6528     text-content: '';
6529     }
6530     }
6531 wakaba 1.15 @@XMLTest:
6532     @@@QName: xp.doctype.empty.after.document.element.test
6533     @@@DEnt:
6534     @@@@test:value:
6535     <a></a>
6536     <!DOCTYPE a>
6537 wakaba 1.48 @@@c:erred: <[xp|wf-syntax-error]> { (2, 1)..(2, 12); }
6538 wakaba 1.15 @@XMLTest:
6539     @@@QName: xp.doctype.empty.in.element.test
6540     @@@DEnt:
6541     @@@@test:value:
6542     <a>
6543     <!DOCTYPE a>
6544     </a>
6545 wakaba 1.48 @@@c:erred: <[xp|wf-syntax-error]> { (2, 1)..(2, 12); }
6546 wakaba 1.15 @@XMLTest:
6547     @@@QName: xp.doctype.empty.dup.test
6548     @@@DEnt:
6549     @@@@test:value:
6550     <!DOCTYPE a>
6551     <!DOCTYPE a>
6552     <a></a>
6553 wakaba 1.48 @@@c:erred: <[xp|wf-syntax-error]> { (2, 1)..(2, 12); }
6554 wakaba 1.15 @@XMLTest:
6555     @@@QName: xp.doctype.empty.in.intsubset.test
6556     @@@DEnt:
6557     @@@@test:value:
6558     <!DOCTYPE a [
6559     <!DOCTYPE a>
6560     ]>
6561     <a></a>
6562 wakaba 1.48 @@@c:erred: <[xp|wf-syntax-error]> { (2, 1)..(2, 12); }
6563 wakaba 1.16 @@XMLTest:
6564     @@@QName: xp.doctype.no.s.no.name.test
6565     @@@DEnt:
6566     @@@@test:value:
6567     <!DOCTYPE>
6568     <a></a>
6569 wakaba 1.48 @@@c:erred: <[xp|wf-syntax-error]> { (1, 10); }
6570 wakaba 1.16 @@XMLTest:
6571     @@@QName: xp.doctype.no.name.test
6572     @@@DEnt:
6573     @@@@test:value:
6574     <!DOCTYPE >
6575     <a></a>
6576 wakaba 1.48 @@@c:erred: <[xp|wf-syntax-error]> { (1, 11); }
6577 wakaba 1.16 @@XMLTest:
6578     @@@QName: xp.doctype.name.s.test
6579     @@@DEnt:
6580     @@@@test:value:
6581     <!DOCTYPE aa >
6582     <aa></aa>
6583     @@@test:domTree:
6584     document {
6585     document-type {
6586     node-name: 'aa';
6587 wakaba 1.17 public-id: null;
6588     system-id: null;
6589 wakaba 1.16 }
6590     element { }
6591     }
6592     @@XMLTest:
6593     @@@QName: xp.doctype.no.mdc.test
6594     @@@DEnt:
6595     @@@@test:value:
6596     <!DOCTYPE aa
6597     <aa></aa>
6598 wakaba 1.48 @@@c:erred: <[xp|wf-syntax-error]> { (2, 1); }
6599 wakaba 1.6
6600     @@XMLTest:
6601 wakaba 1.16 @@@QName: xp.doctype.intsubset.empty.1.test
6602 wakaba 1.6 @@@DEnt:
6603     @@@@test:value:
6604 wakaba 1.16 <!DOCTYPE a []>
6605 wakaba 1.6 <a></a>
6606     @@@test:domTree:
6607     document {
6608     xml-version: '1.0';
6609     xml-encoding: null;
6610     xml-standalone: false;
6611     document-type {
6612     node-name: 'a';
6613 wakaba 1.17 public-id: null;
6614     system-id: null;
6615 wakaba 1.6 }
6616     element {
6617     namespace-uri: null;
6618     prefix: null;
6619     local-name: 'a';
6620     text-content: '';
6621     }
6622     }
6623     @@XMLTest:
6624 wakaba 1.16 @@@QName: xp.doctype.intsubset.empty.2.test
6625 wakaba 1.6 @@@DEnt:
6626     @@@@test:value:
6627     <!DOCTYPE a [
6628 wakaba 1.16
6629 wakaba 1.6 ]>
6630     <a></a>
6631     @@@test:domTree:
6632     document {
6633     xml-version: '1.0';
6634     xml-encoding: null;
6635     xml-standalone: false;
6636     document-type {
6637     node-name: 'a';
6638 wakaba 1.17 public-id: null;
6639     system-id: null;
6640 wakaba 1.6 }
6641     element {
6642     namespace-uri: null;
6643     prefix: null;
6644     local-name: 'a';
6645     text-content: '';
6646     }
6647     }
6648     @@XMLTest:
6649 wakaba 1.16 @@@QName: xp.doctype.intsubset.empty.3.test
6650 wakaba 1.6 @@@DEnt:
6651     @@@@test:value:
6652 wakaba 1.16 <!DOCTYPE a[]>
6653 wakaba 1.6 <a></a>
6654     @@@test:domTree:
6655     document {
6656     document-type {
6657     node-name: 'a';
6658 wakaba 1.17 public-id: null;
6659     system-id: null;
6660 wakaba 1.6 }
6661 wakaba 1.16 element { }
6662     }
6663     @@XMLTest:
6664     @@@QName: xp.doctype.intsubset.empty.4.test
6665     @@@DEnt:
6666     @@@@test:value:
6667     <!DOCTYPE a[] >
6668     <a></a>
6669     @@@test:domTree:
6670     document {
6671     document-type {
6672     node-name: 'a';
6673 wakaba 1.17 public-id: null;
6674     system-id: null;
6675 wakaba 1.6 }
6676 wakaba 1.16 element { }
6677 wakaba 1.6 }
6678     @@XMLTest:
6679 wakaba 1.16 @@@QName: xp.doctype.intsubset.no.dsc.1.test
6680     @@@DEnt:
6681     @@@@test:value:
6682     <!DOCTYPE a [>
6683     <a></a>
6684 wakaba 1.48 @@@c:erred: <[xp|wf-syntax-error]> { (1, 14); }
6685 wakaba 1.16 @@XMLTest:
6686     @@@QName: xp.doctype.intsubset.no.dsc.2.test
6687 wakaba 1.6 @@@DEnt:
6688     @@@@test:value:
6689     <!DOCTYPE a [
6690     <a></a>
6691 wakaba 1.48 @@@c:erred: <[xp|wf-syntax-error]> { (2, 1); }
6692 wakaba 1.16 @@XMLTest:
6693     @@@QName: xp.doctype.intsubset.no.dsc.3.test
6694     @@@DEnt:
6695     @@@@test:value:
6696     <!DOCTYPE a [
6697 wakaba 1.48 @@@c:erred: <[xp|wf-syntax-error]> { (1, 14); }
6698 wakaba 1.16 @@XMLTest:
6699     @@@QName: xp.doctype.intsubset.no.mdc.1.test
6700     @@@DEnt:
6701     @@@@test:value:
6702     <!DOCTYPE a []
6703     <a/>
6704 wakaba 1.48 @@@c:erred: <[xp|wf-syntax-error]> { (2, 1); }
6705 wakaba 1.16 @@XMLTest:
6706     @@@QName: xp.doctype.intsubset.no.mdc.2.test
6707     @@@DEnt:
6708     @@@@test:value:
6709     <!DOCTYPE a []]>
6710     <a/>
6711 wakaba 1.48 @@@c:erred: <[xp|wf-syntax-error]> { (1, 15); }
6712 wakaba 1.17 @@XMLTest:
6713     @@@QName: xp.doctype.pubid.sysid.1.test
6714     @@@DEnt:
6715     @@@@test:value:
6716     <!DOCTYPE a PUBLIC "pubid" "sysid">
6717     <a/>
6718     @@@test:domTree:
6719     document {
6720     document-type {
6721     node-name: 'a';
6722     public-id: 'pubid';
6723     system-id: 'sysid';
6724     }
6725     element { }
6726     }
6727     @@XMLTest:
6728     @@@QName: xp.doctype.pubid.sysid.2.test
6729     @@@DEnt:
6730     @@@@test:value:
6731     <!DOCTYPE a PUBLIC 'pubid' "sysid">
6732     <a/>
6733     @@@test:domTree:
6734     document {
6735     document-type {
6736     node-name: 'a';
6737     public-id: 'pubid';
6738     system-id: 'sysid';
6739     }
6740     element { }
6741     }
6742     @@XMLTest:
6743     @@@QName: xp.doctype.pubid.sysid.3.test
6744     @@@DEnt:
6745     @@@@test:value:
6746     <!DOCTYPE a PUBLIC "pubid" 'sysid'>
6747     <a/>
6748     @@@test:domTree:
6749     document {
6750     document-type {
6751     node-name: 'a';
6752     public-id: 'pubid';
6753     system-id: 'sysid';
6754     }
6755     element { }
6756     }
6757     @@XMLTest:
6758     @@@QName: xp.doctype.pubid.sysid.4.test
6759     @@@DEnt:
6760     @@@@test:value:
6761     <!DOCTYPE a PUBLIC 'pubid' 'sysid'>
6762     <a/>
6763     @@@test:domTree:
6764     document {
6765     document-type {
6766     node-name: 'a';
6767     public-id: 'pubid';
6768     system-id: 'sysid';
6769     }
6770     element { }
6771     }
6772     @@XMLTest:
6773     @@@QName: xp.doctype.pubid.sysid.5.test
6774     @@@DEnt:
6775     @@@@test:value:
6776     <!DOCTYPE a PUBLIC "pubid" "sysid" >
6777     <a/>
6778     @@@test:domTree:
6779     document {
6780     document-type {
6781     node-name: 'a';
6782     public-id: 'pubid';
6783     system-id: 'sysid';
6784     }
6785     element { }
6786     }
6787     @@XMLTest:
6788     @@@QName: xp.doctype.pubid.sysid.6.test
6789     @@@DEnt:
6790     @@@@test:value:
6791     <!DOCTYPE a PUBLIC 'pubid' 'sysid' >
6792     <a/>
6793     @@@test:domTree:
6794     document {
6795     document-type {
6796     node-name: 'a';
6797     public-id: 'pubid';
6798     system-id: 'sysid';
6799     }
6800     element { }
6801     }
6802     @@XMLTest:
6803     @@@QName: xp.doctype.pubid.sysid.intsubset.1.test
6804     @@@DEnt:
6805     @@@@test:value:
6806     <!DOCTYPE a PUBLIC "pubid" "sysid"[]>
6807     <a/>
6808     @@@test:domTree:
6809     document {
6810     document-type {
6811     node-name: 'a';
6812     public-id: 'pubid';
6813     system-id: 'sysid';
6814     }
6815     element { }
6816     }
6817     @@XMLTest:
6818     @@@QName: xp.doctype.pubid.sysid.intsubset.2.test
6819     @@@DEnt:
6820     @@@@test:value:
6821     <!DOCTYPE a PUBLIC "pubid" "sysid" []>
6822     <a/>
6823     @@@test:domTree:
6824     document {
6825     document-type {
6826     node-name: 'a';
6827     public-id: 'pubid';
6828     system-id: 'sysid';
6829     }
6830     element { }
6831     }
6832     @@XMLTest:
6833     @@@QName: xp.doctype.pubid.sysid.intsubset.3.test
6834     @@@DEnt:
6835     @@@@test:value:
6836     <!DOCTYPE a PUBLIC 'pubid' 'sysid'[]>
6837     <a/>
6838     @@@test:domTree:
6839     document {
6840     document-type {
6841     node-name: 'a';
6842     public-id: 'pubid';
6843     system-id: 'sysid';
6844     }
6845     element { }
6846     }
6847     @@XMLTest:
6848     @@@QName: xp.doctype.pubid.sysid.intsubset.4.test
6849     @@@DEnt:
6850     @@@@test:value:
6851     <!DOCTYPE a PUBLIC 'pubid' 'sysid' []>
6852     <a/>
6853     @@@test:domTree:
6854     document {
6855     document-type {
6856     node-name: 'a';
6857     public-id: 'pubid';
6858     system-id: 'sysid';
6859     }
6860     element { }
6861     }
6862     @@XMLTest:
6863     @@@QName: xp.doctype.sysid.1.test
6864     @@@DEnt:
6865     @@@@test:value:
6866     <!DOCTYPE a SYSTEM "sysid">
6867     <a/>
6868     @@@test:domTree:
6869     document {
6870     document-type {
6871     node-name: 'a';
6872     public-id: null;
6873     system-id: 'sysid';
6874     }
6875     element { }
6876     }
6877     @@XMLTest:
6878     @@@QName: xp.doctype.sysid.2.test
6879     @@@DEnt:
6880     @@@@test:value:
6881     <!DOCTYPE a SYSTEM 'sysid'>
6882     <a/>
6883     @@@test:domTree:
6884     document {
6885     document-type {
6886     node-name: 'a';
6887     public-id: null;
6888     system-id: 'sysid';
6889     }
6890     element { }
6891     }
6892     @@XMLTest:
6893     @@@QName: xp.doctype.sysid.3.test
6894     @@@DEnt:
6895     @@@@test:value:
6896     <!DOCTYPE a SYSTEM "sysid" >
6897     <a/>
6898     @@@test:domTree:
6899     document {
6900     document-type {
6901     node-name: 'a';
6902     public-id: null;
6903     system-id: 'sysid';
6904     }
6905     element { }
6906     }
6907     @@XMLTest:
6908     @@@QName: xp.doctype.sysid.4.test
6909     @@@DEnt:
6910     @@@@test:value:
6911     <!DOCTYPE a SYSTEM 'sysid' >
6912     <a/>
6913     @@@test:domTree:
6914     document {
6915     document-type {
6916     node-name: 'a';
6917     public-id: null;
6918     system-id: 'sysid';
6919     }
6920     element { }
6921     }
6922     @@XMLTest:
6923     @@@QName: xp.doctype.sysid.intsubset.1.test
6924     @@@DEnt:
6925     @@@@test:value:
6926     <!DOCTYPE a SYSTEM "sysid"[]>
6927     <a/>
6928     @@@test:domTree:
6929     document {
6930     document-type {
6931     node-name: 'a';
6932     public-id: null;
6933     system-id: 'sysid';
6934     }
6935     element { }
6936     }
6937     @@XMLTest:
6938     @@@QName: xp.doctype.sysid.intsubset.2.test
6939     @@@DEnt:
6940     @@@@test:value:
6941     <!DOCTYPE a SYSTEM "sysid" []>
6942     <a/>
6943     @@@test:domTree:
6944     document {
6945     document-type {
6946     node-name: 'a';
6947     public-id: null;
6948     system-id: 'sysid';
6949     }
6950     element { }
6951     }
6952     @@XMLTest:
6953     @@@QName: xp.doctype.sysid.intsubset.3.test
6954     @@@DEnt:
6955     @@@@test:value:
6956     <!DOCTYPE a SYSTEM 'sysid'[]>
6957     <a/>
6958     @@@test:domTree:
6959     document {
6960     document-type {
6961     node-name: 'a';
6962     public-id: null;
6963     system-id: 'sysid';
6964     }
6965     element { }
6966     }
6967     @@XMLTest:
6968     @@@QName: xp.doctype.sysid.intsubset.4.test
6969     @@@DEnt:
6970     @@@@test:value:
6971     <!DOCTYPE a SYSTEM 'sysid' []>
6972     <a/>
6973     @@@test:domTree:
6974     document {
6975     document-type {
6976     node-name: 'a';
6977     public-id: null;
6978     system-id: 'sysid';
6979     }
6980     element { }
6981     }
6982     @@XMLTest:
6983     @@@QName: xp.doctype.public.stago.test
6984     @@@DEnt:
6985     @@@@test:value:
6986     <!DOCTYPE a PUBLIC<a/>
6987 wakaba 1.48 @@@c:erred: <[xp|wf-syntax-error]> { (1, 19); }
6988 wakaba 1.17 @@XMLTest:
6989     @@@QName: xp.doctype.public.mdc.test
6990     @@@DEnt:
6991     @@@@test:value:
6992     <!DOCTYPE a PUBLIC>
6993     <a/>
6994 wakaba 1.48 @@@c:erred: <[xp|wf-syntax-error]> { (1, 19); }
6995 wakaba 1.17 @@XMLTest:
6996     @@@QName: xp.doctype.public.s.stago.test
6997     @@@DEnt:
6998     @@@@test:value:
6999     <!DOCTYPE a PUBLIC <a/>
7000 wakaba 1.48 @@@c:erred: <[xp|wf-syntax-error]> { (1, 20); }
7001 wakaba 1.17 @@XMLTest:
7002     @@@QName: xp.doctype.public.s.mdc.test
7003     @@@DEnt:
7004     @@@@test:value:
7005     <!DOCTYPE a PUBLIC >
7006     <a/>
7007 wakaba 1.48 @@@c:erred: <[xp|wf-syntax-error]> { (1, 20); }
7008 wakaba 1.17 @@XMLTest:
7009     @@@QName: xp.doctype.public.lit.test
7010     @@@DEnt:
7011     @@@@test:value:
7012     <!DOCTYPE a PUBLIC"p" "s">
7013     <a/>
7014 wakaba 1.48 @@@c:erred: <[xp|wf-syntax-error]> { (1, 19); }
7015 wakaba 1.17 @@XMLTest:
7016     @@@QName: xp.doctype.public.lita.test
7017     @@@DEnt:
7018     @@@@test:value:
7019     <!DOCTYPE a PUBLIC'p' "s">
7020     <a/>
7021 wakaba 1.48 @@@c:erred: <[xp|wf-syntax-error]> { (1, 19); }
7022 wakaba 1.17 @@XMLTest:
7023     @@@QName: xp.doctype.pubid.lit.lita.unmatched.1.test
7024     @@@DEnt:
7025     @@@@test:value:
7026     <!DOCTYPE a PUBLIC "p' "s">
7027     <a/>
7028 wakaba 1.48 @@@c:erred: <[xp|wf-syntax-error]> { (1, 25); }
7029 wakaba 1.17 @@XMLTest:
7030     @@@QName: xp.doctype.pubid.lit.lita.unmatched.2.test
7031     @@@DEnt:
7032     @@@@test:value:
7033     <!DOCTYPE a PUBLIC "p' 's'><a/>
7034 wakaba 1.48 @@@c:erred: <[xp|wf-syntax-error]> { (1, 32); }
7035 wakaba 1.17 @@XMLTest:
7036     @@@QName: xp.doctype.pubid.lita.lit.unmatched.1.test
7037     @@@DEnt:
7038     @@@@test:value:
7039     <!DOCTYPE a PUBLIC 'p" "s"><a/>
7040 wakaba 1.48 @@@c:erred: <[xp|wf-syntax-error]> { (1, 32); }
7041 wakaba 1.17 @@XMLTest:
7042     @@@QName: xp.doctype.pubid.lita.lit.unmatched.2.test
7043     @@@DEnt:
7044     @@@@test:value:
7045     <!DOCTYPE a PUBLIC 'p" 's'>
7046     <a/>
7047 wakaba 1.48 @@@c:erred: <[xp|wf-syntax-error]> { (1, 21)..(1, 25); }
7048 wakaba 1.17 @@XMLTest:
7049     @@@QName: xp.doctype.public.s.lit.mdc.test
7050     @@@DEnt:
7051     @@@@test:value:
7052     <!DOCTYPE a PUBLIC "><a/>
7053 wakaba 1.48 @@@c:erred: <[xp|wf-syntax-error]> { (1, 26); }
7054 wakaba 1.17 @@XMLTest:
7055     @@@QName: xp.doctype.public.s.lita.mdc.test
7056     @@@DEnt:
7057     @@@@test:value:
7058     <!DOCTYPE a PUBLIC '><a/>
7059 wakaba 1.48 @@@c:erred: <[xp|wf-syntax-error]> { (1, 26); }
7060 wakaba 1.17 @@XMLTest:
7061     @@@QName: xp.doctype.public.lit.pubid.lit.mdc.test
7062     @@@DEnt:
7063     @@@@test:value:
7064     <!DOCTYPE a PUBLIC "p">
7065     <a/>
7066 wakaba 1.48 @@@c:erred: <[xp|wf-syntax-error]> { (1, 23); }
7067 wakaba 1.17 @@XMLTest:
7068     @@@QName: xp.doctype.public.lita.pubid.lita.mdc.test
7069     @@@DEnt:
7070     @@@@test:value:
7071     <!DOCTYPE a PUBLIC 'p'>
7072     <a/>
7073 wakaba 1.48 @@@c:erred: <[xp|wf-syntax-error]> { (1, 23); }
7074 wakaba 1.17 @@XMLTest:
7075     @@@QName: xp.doctype.public.lit.pubid.lit.s.mdc.test
7076     @@@DEnt:
7077     @@@@test:value:
7078     <!DOCTYPE a PUBLIC "p" >
7079     <a/>
7080 wakaba 1.48 @@@c:erred: <[xp|wf-syntax-error]> { (1, 24); }
7081 wakaba 1.17 @@XMLTest:
7082     @@@QName: xp.doctype.public.lita.pubid.lita.s.mdc.test
7083     @@@DEnt:
7084     @@@@test:value:
7085     <!DOCTYPE a PUBLIC 'p' >
7086     <a/>
7087 wakaba 1.48 @@@c:erred: <[xp|wf-syntax-error]> { (1, 24); }
7088 wakaba 1.17 @@XMLTest:
7089     @@@QName: xp.doctype.public.lit.pubid.lit.s.lit.mdc.test
7090     @@@DEnt:
7091     @@@@test:value:
7092     <!DOCTYPE a PUBLIC "p" "><a/>
7093 wakaba 1.48 @@@c:erred: <[xp|wf-syntax-error]> { (1, 30); }
7094 wakaba 1.17 @@XMLTest:
7095     @@@QName: xp.doctype.public.lit.pubid.lit.s.lita.mdc.test
7096     @@@DEnt:
7097     @@@@test:value:
7098     <!DOCTYPE a PUBLIC "p" '><a/>
7099 wakaba 1.48 @@@c:erred: <[xp|wf-syntax-error]> { (1, 30); }
7100 wakaba 1.17 @@XMLTest:
7101     @@@QName: xp.doctype.public.lita.pubid.lita.s.lit.mdc.test
7102     @@@DEnt:
7103     @@@@test:value:
7104     <!DOCTYPE a PUBLIC 'p' "><a/>
7105 wakaba 1.48 @@@c:erred: <[xp|wf-syntax-error]> { (1, 30); }
7106 wakaba 1.17 @@XMLTest:
7107     @@@QName: xp.doctype.public.lita.pubid.lita.s.lita.mdc.test
7108     @@@DEnt:
7109     @@@@test:value:
7110     <!DOCTYPE a PUBLIC 'p' '><a/>
7111 wakaba 1.48 @@@c:erred: <[xp|wf-syntax-error]> { (1, 30); }
7112 wakaba 1.17 @@XMLTest:
7113     @@@QName: xp.doctype.public.lit.pubid.lit.lit.lita.unmatched.mdc.test
7114     @@@DEnt:
7115     @@@@test:value:
7116     <!DOCTYPE a PUBLIC "p" "s'><a/>
7117 wakaba 1.48 @@@c:erred: <[xp|wf-syntax-error]> { (1, 32); }
7118 wakaba 1.17 @@XMLTest:
7119     @@@QName: xp.doctype.public.lita.pubid.lita.lita.lit.unmatched.mdc.test
7120     @@@DEnt:
7121     @@@@test:value:
7122     <!DOCTYPE a PUBLIC 'p' 's"><a/>
7123 wakaba 1.48 @@@c:erred: <[xp|wf-syntax-error]> { (1, 32); }
7124 wakaba 1.17 @@XMLTest:
7125     @@@QName: xp.doctype.pubid.sysid.stago.1.test
7126     @@@DEnt:
7127     @@@@test:value:
7128     <!DOCTYPE a PUBLIC "p" "s"<a/>
7129 wakaba 1.48 @@@c:erred: <[xp|wf-syntax-error]> { (1, 27); }
7130 wakaba 1.17 @@XMLTest:
7131     @@@QName: xp.doctype.pubid.sysid.stago.2.test
7132     @@@DEnt:
7133     @@@@test:value:
7134     <!DOCTYPE a PUBLIC "p" 's'<a/>
7135 wakaba 1.48 @@@c:erred: <[xp|wf-syntax-error]> { (1, 27); }
7136 wakaba 1.17 @@XMLTest:
7137     @@@QName: xp.doctype.pubid.sysid.stago.s.1.test
7138     @@@DEnt:
7139     @@@@test:value:
7140     <!DOCTYPE a PUBLIC "p" "s" <a/>
7141 wakaba 1.48 @@@c:erred: <[xp|wf-syntax-error]> { (1, 28); }
7142 wakaba 1.17 @@XMLTest:
7143     @@@QName: xp.doctype.pubid.sysid.stago.s.2.test
7144     @@@DEnt:
7145     @@@@test:value:
7146     <!DOCTYPE a PUBLIC "p" 's' <a/>
7147 wakaba 1.48 @@@c:erred: <[xp|wf-syntax-error]> { (1, 28); }
7148 wakaba 1.16
7149     @@XMLTest:
7150     @@@QName: xp.endofline.1.0.crlf.test
7151     @@@DEnt:
7152     @@@@test:value:
7153     <?xml version="1.0"?>
7154     <p>aaa$u000D$u000Abbb</p>
7155 wakaba 1.6 @@@test:domTree:
7156     document {
7157     xml-version: '1.0';
7158 wakaba 1.16 element {
7159     text-content: 'aaa' U+000A 'bbb';
7160 wakaba 1.6 }
7161 wakaba 1.16 }
7162     @@XMLTest:
7163     @@@QName: xp.endofline.1.1.crlf.test
7164     @@@DEnt:
7165     @@@@test:value:
7166     <?xml version="1.1"?>
7167     <p>aaa$u000D$u000Abbb</p>
7168     @@@test:domTree:
7169     document {
7170     xml-version: '1.1';
7171 wakaba 1.6 element {
7172 wakaba 1.16 text-content: 'aaa' U+000A 'bbb';
7173 wakaba 1.6 }
7174     }
7175     @@XMLTest:
7176 wakaba 1.16 @@@QName: xp.endofline.1.0.crnl.test
7177 wakaba 1.6 @@@DEnt:
7178     @@@@test:value:
7179 wakaba 1.16 <?xml version="1.0"?>
7180     <p>aaa$u000D$u0085bbb</p>
7181 wakaba 1.6 @@@test:domTree:
7182     document {
7183     xml-version: '1.0';
7184 wakaba 1.16 element {
7185     text-content: 'aaa' U+000A U+0085 'bbb';
7186 wakaba 1.6 }
7187 wakaba 1.16 }
7188     @@XMLTest:
7189     @@@QName: xp.endofline.1.1.crnl.test
7190     @@@DEnt:
7191     @@@@test:value:
7192     <?xml version="1.1"?>
7193     <p>aaa$u000D$u0085bbb</p>
7194     @@@test:domTree:
7195     document {
7196     xml-version: '1.1';
7197 wakaba 1.6 element {
7198 wakaba 1.16 text-content: 'aaa' U+000A 'bbb';
7199 wakaba 1.6 }
7200     }
7201     @@XMLTest:
7202 wakaba 1.16 @@@QName: xp.endofline.1.0.nl.test
7203 wakaba 1.6 @@@DEnt:
7204     @@@@test:value:
7205 wakaba 1.16 <?xml version="1.0"?>
7206     <p>aaa$u0085bbb</p>
7207 wakaba 1.6 @@@test:domTree:
7208     document {
7209     xml-version: '1.0';
7210     element {
7211 wakaba 1.16 text-content: 'aaa' U+0085 'bbb';
7212 wakaba 1.6 }
7213     }
7214     @@XMLTest:
7215 wakaba 1.16 @@@QName: xp.endofline.1.1.nl.test
7216 wakaba 1.6 @@@DEnt:
7217     @@@@test:value:
7218 wakaba 1.16 <?xml version="1.1"?>
7219     <p>aaa$u0085bbb</p>
7220     @@@test:domTree:
7221     document {
7222     xml-version: '1.1';
7223     element {
7224     text-content: 'aaa' U+000A 'bbb';
7225     }
7226     }
7227     @@XMLTest:
7228     @@@QName: xp.endofline.1.0.ls.test
7229     @@@DEnt:
7230     @@@@test:value:
7231     <?xml version="1.0"?>
7232     <p>aaa$u2028bbb</p>
7233     @@@test:domTree:
7234     document {
7235     xml-version: '1.0';
7236     element {
7237     text-content: 'aaa' U+2028 'bbb';
7238     }
7239     }
7240     @@XMLTest:
7241     @@@QName: xp.endofline.1.1.ls.test
7242     @@@DEnt:
7243     @@@@test:value:
7244     <?xml version="1.1"?>
7245     <p>aaa$u2028bbb</p>
7246     @@@test:domTree:
7247     document {
7248     xml-version: '1.1';
7249     element {
7250     text-content: 'aaa' U+000A 'bbb';
7251     }
7252     }
7253     @@XMLTest:
7254     @@@QName: xp.endofline.1.0.cr.test
7255     @@@DEnt:
7256     @@@@test:value:
7257     <?xml version="1.0"?>
7258     <p>aaa$u000Dbbb</p>
7259     @@@test:domTree:
7260     document {
7261     xml-version: '1.0';
7262     element {
7263     text-content: 'aaa' U+000A 'bbb';
7264     }
7265     }
7266     @@XMLTest:
7267     @@@QName: xp.endofline.1.1.cr.test
7268     @@@DEnt:
7269     @@@@test:value:
7270     <?xml version="1.1"?>
7271     <p>aaa$u000Dbbb</p>
7272     @@@test:domTree:
7273     document {
7274     xml-version: '1.1';
7275     element {
7276     text-content: 'aaa' U+000A 'bbb';
7277     }
7278     }
7279     @@XMLTest:
7280     @@@QName: xp.endofline.1.0.lf.test
7281     @@@DEnt:
7282     @@@@test:value:
7283     <?xml version="1.0"?>
7284     <p>aaa$u000Abbb</p>
7285     @@@test:domTree:
7286     document {
7287     xml-version: '1.0';
7288     element {
7289     text-content: 'aaa' U+000A 'bbb';
7290     }
7291     }
7292     @@XMLTest:
7293     @@@QName: xp.endofline.1.1.lf.test
7294     @@@DEnt:
7295     @@@@test:value:
7296     <?xml version="1.1"?>
7297     <p>aaa$u000Abbb</p>
7298     @@@test:domTree:
7299     document {
7300     xml-version: '1.1';
7301     element {
7302     text-content: 'aaa' U+000A 'bbb';
7303     }
7304     }
7305     @@XMLTest:
7306     @@@QName: xp.xml10.endofline.nl.in.xmldecl.1.test
7307     @@@DEnt:
7308     @@@@test:value:
7309     <?xml$u0085version="1.0"?>
7310     <p/>
7311     @@@c:erred:
7312 wakaba 1.48 <[xp|fatal-xml11-end-of-line-in-xml-declaration]> { (1, 6)..(2, 0); }
7313     @@@c:erred: <[xp|wf-syntax-error]> { }
7314 wakaba 1.16 @@XMLTest:
7315     @@@QName: xp.xml11.endofline.nl.in.xmldecl.1.test
7316     @@@DEnt:
7317     @@@@test:value:
7318     <?xml$u0085version="1.1"?>
7319     (err)<p/>
7320     @@@c:erred:
7321 wakaba 1.48 <[xp|fatal-xml11-end-of-line-in-xml-declaration]> { (1, 6)..(2, 0); }
7322     @@@c:erred: <[xp|wf-syntax-error]> { }
7323 wakaba 1.16 @@XMLTest:
7324     @@@QName: xp.xml10.endofline.crnl.in.xmldecl.1.test
7325     @@@DEnt:
7326     @@@@test:value:
7327     <?xml$u000D$u0085version="1.0"?>
7328     <p/>
7329     @@@c:erred:
7330 wakaba 1.48 <[xp|fatal-xml11-end-of-line-in-xml-declaration]> { (1, 6)..(2, 0); }
7331     @@@c:erred: <[xp|wf-syntax-error]> { }
7332 wakaba 1.16 @@XMLTest:
7333     @@@QName: xp.xml11.endofline.crnl.in.xmldecl.1.test
7334     @@@DEnt:
7335     @@@@test:value:
7336     <?xml$u000D$u0085version="1.1"?>
7337     (err)<p/>
7338     @@@c:erred:
7339 wakaba 1.48 <[xp|fatal-xml11-end-of-line-in-xml-declaration]> { (1, 6)..(2, 0); }
7340     @@@c:erred: <[xp|wf-syntax-error]> { }
7341 wakaba 1.16 @@XMLTest:
7342     @@@QName: xp.xml10.endofline.ls.in.xmldecl.1.test
7343     @@@DEnt:
7344     @@@@test:value:
7345     <?xml$u2028version="1.0"?>
7346     <p/>
7347     @@@c:erred:
7348 wakaba 1.48 <[xp|fatal-xml11-end-of-line-in-xml-declaration]> { (1, 6)..(2, 0); }
7349     @@@c:erred: <[xp|wf-syntax-error]> { }
7350 wakaba 1.16 @@XMLTest:
7351     @@@QName: xp.xml11.endofline.ls.in.xmldecl.1.test
7352     @@@DEnt:
7353     @@@@test:value:
7354     <?xml$u2028version="1.1"?>
7355     (err)<p/>
7356     @@@c:erred:
7357 wakaba 1.48 <[xp|fatal-xml11-end-of-line-in-xml-declaration]> { (1, 6)..(2, 0); }
7358     @@@c:erred: <[xp|wf-syntax-error]> { }
7359 wakaba 1.16 @@XMLTest:
7360     @@@QName: xp.xml10.endofline.nl.in.xmldecl.2.test
7361     @@@DEnt:
7362     @@@@test:value:
7363     <?xml version="1.0"$u0085?>
7364     <p/>
7365     @@@c:erred:
7366 wakaba 1.48 <[xp|fatal-xml11-end-of-line-in-xml-declaration]> { (1, 20)..(2, 0); }
7367     @@@c:erred: <[xp|wf-syntax-error]> { }
7368 wakaba 1.16 @@XMLTest:
7369     @@@QName: xp.xml11.endofline.nl.in.xmldecl.2.test
7370     @@@DEnt:
7371     @@@@test:value:
7372     <?xml version="1.1"$u0085?>
7373     (err)<p/>
7374     @@@c:erred:
7375 wakaba 1.48 <[xp|fatal-xml11-end-of-line-in-xml-declaration]> { (1, 20)..(2, 0); }
7376     @@@c:erred: <[xp|wf-syntax-error]> { }
7377 wakaba 1.16 @@XMLTest:
7378     @@@QName: xp.xml10.endofline.crnl.in.xmldecl.2.test
7379     @@@DEnt:
7380     @@@@test:value:
7381     <?xml version="1.0"$u000D$u0085?>
7382     <p/>
7383     @@@c:erred:
7384 wakaba 1.48 <[xp|fatal-xml11-end-of-line-in-xml-declaration]> { (1, 20)..(2, 0); }
7385     @@@c:erred: <[xp|wf-syntax-error]> { }
7386 wakaba 1.16 @@XMLTest:
7387     @@@QName: xp.xml11.endofline.crnl.in.xmldecl.2.test
7388     @@@DEnt:
7389     @@@@test:value:
7390     <?xml version="1.1"$u000D$u0085?>
7391     (err)<p/>
7392     @@@c:erred:
7393 wakaba 1.48 <[xp|fatal-xml11-end-of-line-in-xml-declaration]> { (1, 20)..(2, 0); }
7394     @@@c:erred: <[xp|wf-syntax-error]> { }
7395 wakaba 1.16 @@XMLTest:
7396     @@@QName: xp.xml10.endofline.ls.in.xmldecl.2.test
7397     @@@DEnt:
7398     @@@@test:value:
7399     <?xml version="1.0"$u2028?>
7400     <p/>
7401     @@@c:erred:
7402 wakaba 1.48 <[xp|fatal-xml11-end-of-line-in-xml-declaration]> { (1, 20)..(2, 0); }
7403     @@@c:erred: <[xp|wf-syntax-error]> { }
7404 wakaba 1.16 @@XMLTest:
7405     @@@QName: xp.xml11.endofline.ls.in.xmldecl.2.test
7406     @@@DEnt:
7407     @@@@test:value:
7408     <?xml version="1.1"$u2028?>
7409     (err)<p/>
7410     @@@c:erred:
7411 wakaba 1.48 <[xp|fatal-xml11-end-of-line-in-xml-declaration]> { (1, 20)..(2, 0); }
7412     @@@c:erred: <[xp|wf-syntax-error]> { }
7413 wakaba 1.16 @@XMLTest:
7414     @@@QName: xp.xml10.endofline.nl.in.xmldecl.3.test
7415     @@@DEnt:
7416     @@@@test:value:
7417     <?xml $u0085version="1.0"?>
7418     <p/>
7419     @@@c:erred:
7420 wakaba 1.48 <[xp|fatal-xml11-end-of-line-in-xml-declaration]> { (1, 7)..(2, 0); }
7421     @@@c:erred: <[xp|wf-syntax-error]> { }
7422 wakaba 1.16 @@XMLTest:
7423     @@@QName: xp.xml11.endofline.nl.in.xmldecl.3.test
7424     @@@DEnt:
7425     @@@@test:value:
7426     <?xml $u0085version="1.1"?>
7427     (err)<p/>
7428     @@@c:erred:
7429 wakaba 1.48 <[xp|fatal-xml11-end-of-line-in-xml-declaration]> { (1, 7)..(2, 0); }
7430     @@@c:erred: <[xp|wf-syntax-error]> { }
7431 wakaba 1.16 @@XMLTest:
7432     @@@QName: xp.xml10.endofline.crnl.in.xmldecl.3.test
7433     @@@DEnt:
7434     @@@@test:value:
7435     <?xml $u000D$u0085version="1.0"?>
7436     <p/>
7437     @@@c:erred:
7438 wakaba 1.48 <[xp|fatal-xml11-end-of-line-in-xml-declaration]> { (1, 7)..(2, 0); }
7439     @@@c:erred: <[xp|wf-syntax-error]> { }
7440 wakaba 1.16 @@XMLTest:
7441     @@@QName: xp.xml11.endofline.crnl.in.xmldecl.3.test
7442     @@@DEnt:
7443     @@@@test:value:
7444     <?xml $u000D$u0085version="1.1"?>
7445     (err)<p/>
7446     @@@c:erred:
7447 wakaba 1.48 <[xp|fatal-xml11-end-of-line-in-xml-declaration]> { (1, 7)..(2, 0); }
7448     @@@c:erred: <[xp|wf-syntax-error]> { }
7449 wakaba 1.16 @@XMLTest:
7450     @@@QName: xp.xml10.endofline.ls.in.xmldecl.3.test
7451     @@@DEnt:
7452     @@@@test:value:
7453     <?xml $u2028version="1.0"?>
7454     <p/>
7455     @@@c:erred:
7456 wakaba 1.48 <[xp|fatal-xml11-end-of-line-in-xml-declaration]> { (1, 7)..(2, 0); }
7457     @@@c:erred: <[xp|wf-syntax-error]> { }
7458 wakaba 1.16 @@XMLTest:
7459     @@@QName: xp.xml11.endofline.ls.in.xmldecl.3.test
7460     @@@DEnt:
7461     @@@@test:value:
7462     <?xml $u2028version="1.1"?>
7463     (err)<p/>
7464     @@@c:erred:
7465 wakaba 1.48 <[xp|fatal-xml11-end-of-line-in-xml-declaration]> { (1, 7)..(2, 0); }
7466     @@@c:erred: <[xp|wf-syntax-error]> { }
7467 wakaba 1.16 @@XMLTest:
7468     @@@QName: xp.xml10implied.endofline.nl.in.pi.1.test
7469     @@@DEnt:
7470     @@@@test:value:
7471     <?xml-$u0085?>
7472     <p/>
7473 wakaba 1.48 @@@c:erred: <[xp|wf-syntax-error]> { (1, 7)..(2, 0); }
7474 wakaba 1.16 @@XMLTest:
7475     @@@QName: xp.xml10.endofline.nl.in.pi.1.test
7476     @@@DEnt:
7477     @@@@test:value:
7478     <?xml version="1.0"?>
7479     <?xml-$u0085?>
7480     <p/>
7481 wakaba 1.48 @@@c:erred: <[xp|wf-syntax-error]> { (2, 7)..(3, 0); }
7482 wakaba 1.16 @@XMLTest:
7483     @@@QName: xp.xml11.endofline.nl.in.pi.1.test
7484     @@@DEnt:
7485     @@@@test:value:
7486     <?xml version="1.1"?>
7487     <?xml-$u0085?>
7488     <p/>
7489     @@@test:domTree:
7490     document {
7491     xml-version: '1.1';
7492     pi {
7493     node-name: 'xml-';
7494     node-value: '';
7495     }
7496     element { }
7497     }
7498     @@XMLTest:
7499     @@@QName: xp.xml10implied.endofline.crnl.in.pi.1.test
7500     @@@DEnt:
7501     @@@@test:value:
7502     <?xml-$u000D$u0085?>
7503     <p/>
7504     @@@test:domTree:
7505     document {
7506     xml-version: '1.0';
7507     pi {
7508     node-name: 'xml-';
7509     node-value: U+0085;
7510     }
7511     element { }
7512     }
7513     @@XMLTest:
7514     @@@QName: xp.xml10.endofline.crnl.in.pi.1.test
7515     @@@DEnt:
7516     @@@@test:value:
7517     <?xml version="1.0"?>
7518     <?xml-$u000D$u0085?>
7519     <p/>
7520     @@@test:domTree:
7521     document {
7522     xml-version: '1.0';
7523     pi {
7524     node-name: 'xml-';
7525     node-value: U+0085;
7526     }
7527     element { }
7528     }
7529     @@XMLTest:
7530     @@@QName: xp.xml11.endofline.crnl.in.pi.1.test
7531     @@@DEnt:
7532     @@@@test:value:
7533     <?xml version="1.1"?>
7534     <?xml-$u000D$u0085?>
7535     <p/>
7536     @@@test:domTree:
7537     document {
7538     xml-version: '1.1';
7539     pi {
7540     node-name: 'xml-';
7541     node-value: '';
7542     }
7543     element { }
7544     }
7545     @@XMLTest:
7546     @@@QName: xp.xml10implied.endofline.ls.in.pi.1.test
7547     @@@DEnt:
7548     @@@@test:value:
7549     <?xml-$u2028?>
7550     <p/>
7551 wakaba 1.48 @@@c:erred: <[xp|wf-syntax-error]> { (1, 7)..(2, 0); }
7552 wakaba 1.16 @@XMLTest:
7553     @@@QName: xp.xml10.endofline.ls.in.pi.1.test
7554     @@@DEnt:
7555     @@@@test:value:
7556     <?xml version="1.0"?>
7557     <?xml-$u2028?>
7558     <p/>
7559 wakaba 1.48 @@@c:erred: <[xp|wf-syntax-error]> { (2, 7)..(3, 0); }
7560 wakaba 1.16 @@XMLTest:
7561     @@@QName: xp.xml11.endofline.ls.in.pi.1.test
7562     @@@DEnt:
7563     @@@@test:value:
7564     <?xml version="1.1"?>
7565     <?xml-$u2028?>
7566     <p/>
7567     @@@test:domTree:
7568     document {
7569     xml-version: '1.1';
7570     pi {
7571     node-name: 'xml-';
7572     node-value: '';
7573     }
7574     element { }
7575     }
7576 wakaba 1.27
7577     @@XMLTest:
7578     @@@QName: xp.xml10.endofline.internal.1.test
7579     @@@DEnt:
7580     @@@@test:value:
7581     <?xml version="1.0"?>
7582     <!DOCTYPE a [
7583     <!ENTITY e "&#x000D; &#x000A; &#x0085; &#x000D;&#x000A; $
7584     &#x000D;&#x0085; &#x2028;">
7585     ]><a>&e;</a>
7586 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
7587 wakaba 1.27 @@@test:domTree:
7588     document {
7589     xml-version: '1.0';
7590     document-type {
7591     general-entity {
7592     node-name: 'e';
7593     text-content: U+000D ' ' U+000A ' ' U+0085 ' '
7594     U+000D U+000A ' ' U+000D U+0085 ' ' U+2028;
7595     }
7596     }
7597     element {
7598     text-content: U+000D ' ' U+000A ' ' U+0085 ' '
7599     U+000D U+000A ' ' U+000D U+0085 ' ' U+2028;
7600     }
7601     }
7602     @@XMLTest:
7603     @@@QName: xp.xml11.endofline.internal.1.test
7604     @@@DEnt:
7605     @@@@test:value:
7606     <?xml version="1.1"?>
7607     <!DOCTYPE a [
7608     <!ENTITY e "&#x000D; &#x000A; &#x0085; &#x000D;&#x000A; $
7609     &#x000D;&#x0085; &#x2028;">
7610     ]><a>&e;</a>
7611 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
7612 wakaba 1.27 @@@test:domTree:
7613     document {
7614     xml-version: '1.1';
7615     document-type {
7616     general-entity {
7617     node-name: 'e';
7618     text-content: U+000D ' ' U+000A ' ' U+0085 ' '
7619     U+000D U+000A ' ' U+000D U+0085 ' ' U+2028;
7620     }
7621     }
7622     element {
7623     text-content: U+000D ' ' U+000A ' ' U+0085 ' '
7624     U+000D U+000A ' ' U+000D U+0085 ' ' U+2028;
7625     }
7626     }
7627    
7628 wakaba 1.16 @@XMLTest:
7629     @@@QName: xp.noxmldecl.pi.pi.test
7630     @@@DEnt:
7631     @@@@test:value:
7632     <?noxml 1?><?noxml 2?><p/>
7633     @@@test:domTree:
7634     document {
7635     xml-version: '1.0';
7636     pi {
7637     node-name: 'noxml';
7638     node-value: '1';
7639     }
7640     pi {
7641     node-name: 'noxml';
7642     node-value: '2';
7643     }
7644     element { }
7645     }
7646     @@XMLTest:
7647     @@@QName: xp.noxmldecl.pi.pi.2.test
7648     @@@DEnt:
7649     @@@@test:value:
7650     <?xmlno 1?><?xmlno 2?><p/>
7651     @@@test:domTree:
7652     document {
7653     xml-version: '1.0';
7654     pi {
7655     node-name: 'xmlno';
7656     node-value: '1';
7657     }
7658     pi {
7659     node-name: 'xmlno';
7660     node-value: '2';
7661     }
7662     element { }
7663     }
7664     @@XMLTest:
7665     @@@QName: xp.noxmldecl.pi.pi.3.test
7666     @@@DEnt:
7667     @@@@test:value:
7668     <?xmln 1?><?xmln 2?><p/>
7669     @@@test:domTree:
7670     document {
7671     xml-version: '1.0';
7672     pi {
7673     node-name: 'xmln';
7674     node-value: '1';
7675     }
7676     pi {
7677     node-name: 'xmln';
7678     node-value: '2';
7679     }
7680     element { }
7681     }
7682     @@XMLTest:
7683     @@@QName: xp.noxml.s.nl.test
7684     @@@DEnt:
7685     @@@@test:value:
7686     $u0085<p/>
7687 wakaba 1.48 @@@c:erred: <[xp|wf-syntax-error]> { (1, 1)..(2, 0); }
7688 wakaba 1.16 @@XMLTest:
7689     @@@QName: xp.noxml.s.crnl.test
7690     @@@DEnt:
7691     @@@@test:value:
7692     $u000D$u0085<p/>
7693 wakaba 1.48 @@@c:erred: <[xp|wf-syntax-error]> { (1, 1)..(2, 0); }
7694 wakaba 1.16 @@XMLTest:
7695     @@@QName: xp.noxml.s.ls.test
7696     @@@DEnt:
7697     @@@@test:value:
7698     $u2028<p/>
7699 wakaba 1.48 @@@c:erred: <[xp|wf-syntax-error]> { (1, 1)..(2, 0); }
7700 wakaba 1.16 @@XMLTest:
7701     @@@QName: xp.xml10.decl.s.nl.test
7702     @@@DEnt:
7703     @@@@test:value:
7704     <?xml version="1.0"?>$u0085<p/>
7705 wakaba 1.48 @@@c:erred: <[xp|wf-syntax-error]> { (1, 22)..(2, 0); }
7706 wakaba 1.16 @@XMLTest:
7707     @@@QName: xp.xml10.decl.s.crnl.test
7708     @@@DEnt:
7709     @@@@test:value:
7710     <?xml version="1.0"?>$u000D$u0085<p/>
7711 wakaba 1.48 @@@c:erred: <[xp|wf-syntax-error]> { (2, 0)..(3, 0); }
7712 wakaba 1.16 @@XMLTest:
7713     @@@QName: xp.xml10.decl.s.ls.test
7714     @@@DEnt:
7715     @@@@test:value:
7716     <?xml version="1.0"?>$u2028<p/>
7717 wakaba 1.48 @@@c:erred: <[xp|wf-syntax-error]> { (1, 22)..(2, 0); }
7718 wakaba 1.16 @@XMLTest:
7719     @@@QName: xp.xml11.decl.s.nl.test
7720     @@@DEnt:
7721     @@@@test:value:
7722     <?xml version="1.1"?>$u0085<p/>
7723     @@@test:domTree:
7724     document {
7725     xml-version: '1.1';
7726     element { }
7727     }
7728     @@XMLTest:
7729     @@@QName: xp.xml11.decl.s.crnl.test
7730     @@@DEnt:
7731     @@@@test:value:
7732     <?xml version="1.1"?>$u000D$u0085<p/>
7733     @@@test:domTree:
7734     document {
7735     xml-version: '1.1';
7736     element { }
7737     }
7738     @@XMLTest:
7739     @@@QName: xp.xml11.decl.s.ls.test
7740     @@@DEnt:
7741     @@@@test:value:
7742     <?xml version="1.1"?>$u2028<p/>
7743     @@@test:domTree:
7744     document {
7745     xml-version: '1.1';
7746     element { }
7747     }
7748    
7749     @@XMLTest:
7750 wakaba 1.18 @@@QName: xp.element.type.match.1.test
7751     @@@DEnt:
7752     @@@@test:value:
7753     <p></pa>(err)
7754 wakaba 1.48 @@@c:erred: <[xp|wf-element-type-match]> { (1, 4)..(1, 8); }
7755     @@@c:erred: <[xp|wf-syntax-error]> { }
7756 wakaba 1.18 @@XMLTest:
7757     @@@QName: xp.element.type.match.2.test
7758     @@@DEnt:
7759     @@@@test:value:
7760     <p><pa></pa></pa>(err)
7761 wakaba 1.48 @@@c:erred: <[xp|wf-element-type-match]> { (1, 13)..(1, 17); }
7762     @@@c:erred: <[xp|wf-syntax-error]> { }
7763 wakaba 1.18 @@XMLTest:
7764     @@@QName: xp.element.type.match.3.test
7765     @@@DEnt:
7766     @@@@test:value:
7767     <p><pa></p></p>(err)
7768 wakaba 1.48 @@@c:erred: <[xp|wf-element-type-match]> { (1, 8)..(1, 11); }
7769     @@@c:erred: <[xp|wf-syntax-error]> { }
7770 wakaba 1.18 @@XMLTest:
7771     @@@QName: xp.element.type.match.4.test
7772     @@@DEnt:
7773     @@@@test:value:
7774     <a:p xmlns:a="about:1"></p>(err)
7775 wakaba 1.48 @@@c:erred: <[xp|wf-element-type-match]> { (1, 24)..(1, 27); }
7776     @@@c:erred: <[xp|wf-syntax-error]> { }
7777 wakaba 1.18 @@XMLTest:
7778     @@@QName: xp.element.type.match.5.test
7779     @@@DEnt:
7780     @@@@test:value:
7781     <a:p xmlns:a="about:1" xmlns:b="about:1"></b:p>(err)
7782 wakaba 1.48 @@@c:erred: <[xp|wf-element-type-match]> { (1, 42)..(1, 47); }
7783     @@@c:erred: <[xp|wf-syntax-error]> { }
7784 wakaba 1.18
7785     @@XMLTest:
7786     @@@QName: xp.stag.stago.name.etago.test
7787     @@@DEnt:
7788     @@@@test:value:
7789     <a</a>
7790 wakaba 1.48 @@@c:erred: <[xp|wf-syntax-error]> { (1, 3); }
7791 wakaba 1.18 @@XMLTest:
7792     @@@QName: xp.stag.stago.name.s.etago.test
7793     @@@DEnt:
7794     @@@@test:value:
7795     <a </a>
7796 wakaba 1.48 @@@c:erred: <[xp|wf-syntax-error]> { (1, 4); }
7797 wakaba 1.18 @@XMLTest:
7798     @@@QName: xp.stag.stago.name.s.attr.etago.test
7799     @@@DEnt:
7800     @@@@test:value:
7801     <a a="b"</a>
7802 wakaba 1.48 @@@c:erred: <[xp|wf-syntax-error]> { (1, 9); }
7803 wakaba 1.18 @@XMLTest:
7804     @@@QName: xp.stag.stago.name.s.attr.s.attr.etago.test
7805     @@@DEnt:
7806     @@@@test:value:
7807     <a a="b" c="d"</a>
7808 wakaba 1.48 @@@c:erred: <[xp|wf-syntax-error]> { (1, 15); }
7809 wakaba 1.18 @@XMLTest:
7810     @@@QName: xp.stag.stago.name.s.attr.s.etago.test
7811     @@@DEnt:
7812     @@@@test:value:
7813     <a a="b" </a>
7814 wakaba 1.48 @@@c:erred: <[xp|wf-syntax-error]> { (1, 10); }
7815 wakaba 1.18 @@XMLTest:
7816     @@@QName: xp.stag.etag.1.test
7817 wakaba 1.16 @@@DEnt:
7818     @@@@test:value:
7819 wakaba 1.18 <root><a></a></root>
7820 wakaba 1.16 @@@test:domTree:
7821     document {
7822 wakaba 1.18 element {
7823     element {
7824     node-name: 'a';
7825 wakaba 1.16 }
7826     }
7827 wakaba 1.18 }
7828     @@XMLTest:
7829     @@@QName: xp.stag.etag.2.test
7830     @@@DEnt:
7831     @@@@test:value:
7832     <root><ab></ab></root>
7833     @@@test:domTree:
7834     document {
7835 wakaba 1.16 element {
7836 wakaba 1.18 element {
7837     node-name: 'ab';
7838     }
7839 wakaba 1.16 }
7840 wakaba 1.18 }
7841 wakaba 1.16 @@XMLTest:
7842 wakaba 1.18 @@@QName: xp.stag.etag.s.1.test
7843 wakaba 1.16 @@@DEnt:
7844     @@@@test:value:
7845 wakaba 1.18 <root><a ></a ></root>
7846 wakaba 1.16 @@@test:domTree:
7847     document {
7848 wakaba 1.18 element {
7849     element {
7850     node-name: 'a';
7851 wakaba 1.16 }
7852     }
7853 wakaba 1.18 }
7854     @@XMLTest:
7855     @@@QName: xp.etag.1.test
7856     @@@DEnt:
7857     @@@@test:value:
7858     <root><a/></root>
7859     @@@test:domTree:
7860     document {
7861 wakaba 1.16 element {
7862 wakaba 1.18 element {
7863     node-name: 'a';
7864     }
7865 wakaba 1.16 }
7866 wakaba 1.18 }
7867 wakaba 1.16 @@XMLTest:
7868 wakaba 1.18 @@@QName: xp.etag.2.test
7869 wakaba 1.16 @@@DEnt:
7870     @@@@test:value:
7871 wakaba 1.18 <root><a /></root>
7872 wakaba 1.16 @@@test:domTree:
7873     document {
7874     element {
7875 wakaba 1.18 element {
7876     node-name: 'a';
7877     }
7878 wakaba 1.16 }
7879 wakaba 1.18 }
7880 wakaba 1.16 @@XMLTest:
7881 wakaba 1.18 @@@QName: xp.stag.etag.attr.1.test
7882 wakaba 1.16 @@@DEnt:
7883     @@@@test:value:
7884 wakaba 1.18 <root><a at="v"></a></root>
7885 wakaba 1.16 @@@test:domTree:
7886     document {
7887 wakaba 1.18 element {
7888     element {
7889     node-name: 'a';
7890     attribute {
7891     node-name: 'at';
7892     value: 'v';
7893     }
7894 wakaba 1.16 }
7895     }
7896 wakaba 1.18 }
7897     @@XMLTest:
7898     @@@QName: xp.stag.etag.attr.2.test
7899     @@@DEnt:
7900     @@@@test:value:
7901     <root><a at="v" ></a></root>
7902     @@@test:domTree:
7903     document {
7904 wakaba 1.16 element {
7905 wakaba 1.18 element {
7906     node-name: 'a';
7907     attribute {
7908     node-name: 'at';
7909     value: 'v';
7910 wakaba 1.16 }
7911     }
7912     }
7913 wakaba 1.18 }
7914 wakaba 1.16 @@XMLTest:
7915 wakaba 1.18 @@@QName: xp.stag.etag.attr.3.test
7916 wakaba 1.16 @@@DEnt:
7917     @@@@test:value:
7918 wakaba 1.18 <root><a at ="v"></a></root>
7919 wakaba 1.16 @@@test:domTree:
7920     document {
7921 wakaba 1.18 element {
7922     element {
7923     node-name: 'a';
7924     attribute {
7925     node-name: 'at';
7926     value: 'v';
7927     }
7928 wakaba 1.16 }
7929     }
7930 wakaba 1.18 }
7931     @@XMLTest:
7932     @@@QName: xp.stag.etag.attr.4.test
7933     @@@DEnt:
7934     @@@@test:value:
7935     <root><a at= "v"></a></root>
7936     @@@test:domTree:
7937     document {
7938 wakaba 1.16 element {
7939 wakaba 1.18 element {
7940     node-name: 'a';
7941     attribute {
7942     node-name: 'at';
7943     value: 'v';
7944 wakaba 1.16 }
7945     }
7946 wakaba 1.18 }
7947     }
7948     @@XMLTest:
7949     @@@QName: xp.stag.etag.attr.5.test
7950     @@@DEnt:
7951     @@@@test:value:
7952     <root><a at='v'></a></root>
7953     @@@test:domTree:
7954     document {
7955     element {
7956     element {
7957     node-name: 'a';
7958     attribute {
7959     node-name: 'at';
7960     value: 'v';
7961 wakaba 1.16 }
7962     }
7963     }
7964 wakaba 1.18 }
7965 wakaba 1.16 @@XMLTest:
7966 wakaba 1.18 @@@QName: xp.stag.etag.attr.6.test
7967 wakaba 1.16 @@@DEnt:
7968     @@@@test:value:
7969 wakaba 1.18 <root><a at= 'v' ></a></root>
7970 wakaba 1.6 @@@test:domTree:
7971     document {
7972 wakaba 1.18 element {
7973     element {
7974     node-name: 'a';
7975     attribute {
7976     node-name: 'at';
7977     value: 'v';
7978     }
7979 wakaba 1.11 }
7980 wakaba 1.6 }
7981 wakaba 1.18 }
7982     @@XMLTest:
7983     @@@QName: xp.stag.etag.attr.attr.1.test
7984     @@@DEnt:
7985     @@@@test:value:
7986     <root><a at="v" tr="w"></a></root>
7987     @@@test:domTree:
7988     document {
7989 wakaba 1.6 element {
7990 wakaba 1.18 element {
7991     node-name: 'a';
7992     attribute {
7993     node-name: 'at';
7994     value: 'v';
7995 wakaba 1.6 }
7996 wakaba 1.18 attribute {
7997     node-name: 'tr';
7998     value: 'w';
7999 wakaba 1.6 }
8000     }
8001     }
8002 wakaba 1.18 }
8003 wakaba 1.6 @@XMLTest:
8004 wakaba 1.18 @@@QName: xp.stag.etag.attr.attr.2.test
8005 wakaba 1.6 @@@DEnt:
8006     @@@@test:value:
8007 wakaba 1.18 <root><a tr="w" at="v"></a></root>
8008 wakaba 1.6 @@@test:domTree:
8009     document {
8010 wakaba 1.18 element {
8011     element {
8012     node-name: 'a';
8013     attribute {
8014     node-name: 'at';
8015     value: 'v';
8016     }
8017     attribute {
8018     node-name: 'tr';
8019     value: 'w';
8020 wakaba 1.11 }
8021     }
8022 wakaba 1.6 }
8023 wakaba 1.18 }
8024     @@XMLTest:
8025     @@@QName: xp.stag.etag.attr.no.s.attr.test
8026     @@@DEnt:
8027     @@@@test:value:
8028     <root><a at="v"tr="w"></a></root>
8029 wakaba 1.48 @@@c:erred: <[xp|wf-syntax-error]> { (1, 16)..(1, 17); }
8030 wakaba 1.18 @@XMLTest:
8031     @@@QName: xp.etag.attr.1.test
8032     @@@DEnt:
8033     @@@@test:value:
8034     <root><a at="v" tr="w"></a b="c"></root>
8035 wakaba 1.48 @@@c:erred: <[xp|wf-syntax-error]> { (1, 28); }
8036 wakaba 1.18 @@XMLTest:
8037     @@@QName: xp.etag.no.etagc.1.test
8038     @@@DEnt:
8039     @@@@test:value:
8040     <root><a at="v" tr="w"></a</root>
8041 wakaba 1.48 @@@c:erred: <[xp|wf-syntax-error]> { (1, 27)..(1, 28); }
8042 wakaba 1.18 @@XMLTest:
8043     @@@QName: xp.etag.no.etagc.2.test
8044     @@@DEnt:
8045     @@@@test:value:
8046     <root><a at="v" tr="w"></a </root>
8047 wakaba 1.48 @@@c:erred: <[xp|wf-syntax-error]> { (1, 29)..(1, 30); }
8048 wakaba 1.18 @@XMLTest:
8049     @@@QName: xp.mtag.attr.1.test
8050     @@@DEnt:
8051     @@@@test:value:
8052     <root><a b="c"/></root>
8053     @@@test:domTree:
8054     document {
8055 wakaba 1.6 element {
8056 wakaba 1.18 element {
8057     node-name: 'a';
8058     attribute {
8059     node-name: 'b';
8060     value: 'c';
8061 wakaba 1.6 }
8062     }
8063 wakaba 1.8 }
8064 wakaba 1.18 }
8065 wakaba 1.11 @@XMLTest:
8066 wakaba 1.18 @@@QName: xp.mtag.attr.2.test
8067 wakaba 1.11 @@@DEnt:
8068     @@@@test:value:
8069 wakaba 1.18 <root><a b="c" /></root>
8070 wakaba 1.11 @@@test:domTree:
8071     document {
8072 wakaba 1.18 element {
8073     element {
8074     node-name: 'a';
8075     attribute {
8076     node-name: 'b';
8077     value: 'c';
8078     }
8079 wakaba 1.11 }
8080     }
8081 wakaba 1.18 }
8082 wakaba 1.11 @@XMLTest:
8083 wakaba 1.18 @@@QName: xp.mtag.attr.3.test
8084 wakaba 1.11 @@@DEnt:
8085     @@@@test:value:
8086 wakaba 1.18 <root><a b='c'/></root>
8087 wakaba 1.11 @@@test:domTree:
8088     document {
8089     element {
8090 wakaba 1.18 element {
8091     node-name: 'a';
8092     attribute {
8093     node-name: 'b';
8094     value: 'c';
8095     }
8096     }
8097 wakaba 1.11 }
8098 wakaba 1.18 }
8099 wakaba 1.11 @@XMLTest:
8100 wakaba 1.18 @@@QName: xp.mtag.attr.4.test
8101 wakaba 1.11 @@@DEnt:
8102     @@@@test:value:
8103 wakaba 1.18 <root><a b="c" d="e"/></root>
8104 wakaba 1.11 @@@test:domTree:
8105     document {
8106     element {
8107 wakaba 1.18 element {
8108     node-name: 'a';
8109     attribute {
8110     node-name: 'b';
8111     value: 'c';
8112     }
8113     attribute {
8114     node-name: 'd';
8115     value: 'e';
8116     }
8117 wakaba 1.11 }
8118     }
8119 wakaba 1.18 }
8120    
8121     @@XMLTest:
8122     @@@QName: xp.attvalue.lt.1.test
8123     @@@DEnt:
8124     @@@@test:value:
8125     <a b="aa<dd"/>
8126 wakaba 1.48 @@@c:erred: <[xp|wf-syntax-error]> { (1, 9); }
8127 wakaba 1.18 @@XMLTest:
8128     @@@QName: xp.attvalue.lt.2.test
8129     @@@DEnt:
8130     @@@@test:value:
8131     <a b='aa<dd'/>
8132 wakaba 1.48 @@@c:erred: <[xp|wf-syntax-error]> { (1, 9); }
8133 wakaba 1.18 @@XMLTest:
8134     @@@QName: xp.attvalue.amp.1.test
8135     @@@DEnt:
8136     @@@@test:value:
8137     <a b="aa& dd"/>
8138 wakaba 1.48 @@@c:erred: <[xp|wf-syntax-error]> { (1, 9)..(1, 12); }
8139 wakaba 1.18 @@XMLTest:
8140     @@@QName: xp.attvalue.amp.2.test
8141     @@@DEnt:
8142     @@@@test:value:
8143     <a b='aa& dd'/>
8144 wakaba 1.48 @@@c:erred: <[xp|wf-syntax-error]> { (1, 9)..(1, 12); }
8145 wakaba 1.18 @@XMLTest:
8146     @@@QName: xp.attvalue.amp.3.test
8147     @@@DEnt:
8148     @@@@test:value:
8149     <a b="aa&# dd"/>
8150 wakaba 1.48 @@@c:erred: <[xp|wf-syntax-error]> { (1, 9)..(1, 13); }
8151 wakaba 1.18 @@XMLTest:
8152     @@@QName: xp.attvalue.amp.4.test
8153     @@@DEnt:
8154     @@@@test:value:
8155     <a b="aa&#x dd"/>
8156 wakaba 1.48 @@@c:erred: <[xp|wf-syntax-error]> { (1, 9)..(1, 14); }
8157 wakaba 1.18
8158     @@XMLTest:
8159     @@@QName: xp.unique.att.spec.1.test
8160     @@@DEnt:
8161     @@@@test:value:
8162     <a b="c" b="d"/>
8163 wakaba 1.48 @@@c:erred: <[xp|wf-unique-att-spec]> { (1, 4)..(1, 14); }
8164 wakaba 1.18 @@XMLTest:
8165     @@@QName: xp.unique.att.spec.2.test
8166     @@@DEnt:
8167     @@@@test:value:
8168     <a d:b="c" d:b="d" xmlns:d="about:2"/>
8169 wakaba 1.48 @@@c:erred: <[xp|wf-unique-att-spec]> { (1, 4)..(1, 18); }
8170 wakaba 1.18
8171     @@XMLTest:
8172     @@@QName: xp.no.external.entity.references.1.test
8173     @@@DEnt:
8174     @@@@test:value:
8175     <!DOCTYPE a [
8176     <!ENTITY ent SYSTEM "something">
8177     ]>
8178     <a b="c&ent;"/>
8179 wakaba 1.48 @@@c:erred: <[xp|wf-no-external-entity-references]> { (4, 8)..(4, 12); }
8180 wakaba 1.18 @@XMLTest:
8181     @@@QName: xp.no.external.entity.references.2.test
8182     @@@DEnt:
8183     @@@@test:value:
8184     <!DOCTYPE a [
8185     <!NOTATION n SYSTEM "notation">
8186     <!ENTITY ent SYSTEM "something" NDATA n>
8187     ]>
8188     <a b="c&ent;"/>
8189 wakaba 1.48 @@@c:erred: <[xp|wf-no-external-entity-references]> { (5, 8)..(5, 12); }
8190 wakaba 1.18 @@XMLTest:
8191     @@@QName: xp.no.external.entity.references.3.test
8192     @@@DEnt:
8193     @@@@test:value:
8194     <!DOCTYPE a [
8195     <!ENTITY ent SYSTEM "something">
8196     <!ENTITY ent2 "ddd&ent;">
8197     ]>
8198     <a b="c&ent2;"/>
8199 wakaba 1.48 @@@c:erred: <[xp|wf-no-external-entity-references]> { (1, 4)..(1, 8); }
8200 wakaba 1.18 @@XMLTest:
8201     @@@QName: xp.no.external.entity.references.4.test
8202     @@@DEnt:
8203     @@@@test:value:
8204     <!DOCTYPE a [
8205     <!NOTATION n SYSTEM "notation">
8206     <!ENTITY ent SYSTEM "something" NDATA n>
8207     <!ENTITY ent2 "ddd&ent;">
8208     ]>
8209     <a b="c&ent2;"/>
8210 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
8211 wakaba 1.48 @@@c:erred: <[xp|wf-no-external-entity-references]> { (1, 4)..(1, 8); }
8212     @@@c:erred: <[xp|wf-parsed-entity]> { }
8213 wakaba 1.18 @@XMLTest:
8214     @@@QName: xp.no.lt.in.attr.value.1.test
8215     @@@DEnt:
8216     @@@@test:value:
8217     <!DOCTYPE a [
8218     <!ENTITY ent "aa<bb">
8219     ]>
8220     <a b="c&ent;"/>
8221 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
8222 wakaba 1.48 @@@c:erred: <[xp|wf-no-lt-in-attribute-values]> { (1, 3); }
8223 wakaba 1.20 @@@c:erred:
8224 wakaba 1.48 @@@@@: <[xp|wf-syntax-error]> { (1, 3)..(1, 6); }
8225 wakaba 1.20 @@@@enImplNote: When entity node is created.
8226 wakaba 1.18 @@XMLTest:
8227 wakaba 1.34 @@@QName: xp.no.lt.in.attr.value.1.2.test
8228     @@@DEnt:
8229     @@@@test:value:
8230     <!DOCTYPE a [
8231     <!ENTITY ent "aa<bb">
8232     ]>
8233     <a b="c&ent;"/>
8234     @@@cfg:entity-replacement-tree: 0
8235 wakaba 1.48 @@@c:erred: <[xp|wf-no-lt-in-attribute-values]> { (1, 3); }
8236 wakaba 1.34 @@XMLTest:
8237 wakaba 1.18 @@@QName: xp.no.lt.in.attr.value.2.test
8238     @@@DEnt:
8239     @@@@test:value:
8240     <!DOCTYPE a [
8241     <!ENTITY ent "aa<bb">
8242     <!ENTITY ent2 "ccc&ent;">
8243     ]>
8244     <a b="c&ent2;"/>
8245 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
8246 wakaba 1.48 @@@c:erred: <[xp|wf-no-lt-in-attribute-values]> { (1, 3); }
8247 wakaba 1.20 @@@c:erred:
8248 wakaba 1.48 @@@@@: <[xp|wf-syntax-error]> { (1, 3)..(1, 6); }
8249 wakaba 1.20 @@@@enImplNote: When entity node is created.
8250 wakaba 1.18 @@XMLTest:
8251     @@@QName: xp.no.lt.in.attr.value.3.test
8252     @@@DEnt:
8253     @@@@test:value:
8254     <!DOCTYPE a [
8255     <!ENTITY ent "aa&#x3C;bb">
8256     ]>
8257     <a b="c&ent;"/>
8258 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
8259 wakaba 1.48 @@@c:erred: <[xp|wf-no-lt-in-attribute-values]> { (1, 3); }
8260 wakaba 1.20 @@@c:erred:
8261 wakaba 1.48 @@@@@: <[xp|wf-syntax-error]> { (1, 3)..(1, 6); }
8262 wakaba 1.20 @@@@enImplNote: When entity node is created.
8263 wakaba 1.18 @@XMLTest:
8264     @@@QName: xp.no.lt.in.attr.value.4.test
8265     @@@DEnt:
8266     @@@@test:value:
8267     <!DOCTYPE a [
8268     <!ENTITY ent "aa&#x3C;bb">
8269     <!ENTITY ent2 "ccc&ent;">
8270     ]>
8271     <a b="c&ent2;"/>
8272 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
8273 wakaba 1.48 @@@c:erred: <[xp|wf-no-lt-in-attribute-values]> { (1, 3); }
8274 wakaba 1.20 @@@c:erred:
8275 wakaba 1.48 @@@@@: <[xp|wf-syntax-error]> { (1, 3)..(1, 6); }
8276 wakaba 1.20 @@@@enImplNote: When entity node is created.
8277 wakaba 1.11 @@XMLTest:
8278 wakaba 1.18 @@@QName: xp.ger.lt.in.attr.value.1.test
8279 wakaba 1.11 @@@DEnt:
8280     @@@@test:value:
8281     <!DOCTYPE a [
8282 wakaba 1.18 <!ENTITY ent "aa&lt;bb">
8283 wakaba 1.11 ]>
8284 wakaba 1.18 <a b="c&ent;"/>
8285 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
8286 wakaba 1.11 @@@test:domTree:
8287     document {
8288     document-type {
8289     general-entity {
8290     node-name: 'ent';
8291 wakaba 1.18 text-content: 'aa<bb';
8292 wakaba 1.11 }
8293     }
8294     element {
8295 wakaba 1.18 attribute {
8296     node-name: 'b';
8297     text { data: 'c'; }
8298     general-entity-reference {
8299 wakaba 1.34 manakai-expanded: true;
8300 wakaba 1.18 node-name: 'ent';
8301     text-content: 'aa<bb';
8302     }
8303     }
8304 wakaba 1.11 }
8305     }
8306     @@XMLTest:
8307 wakaba 1.18 @@@QName: xp.ger.lt.in.attr.value.2.test
8308 wakaba 1.11 @@@DEnt:
8309     @@@@test:value:
8310     <!DOCTYPE a [
8311 wakaba 1.18 <!ENTITY ent "aa&lt;bb">
8312     <!ENTITY ent2 "ccc&ent;">
8313 wakaba 1.11 ]>
8314 wakaba 1.18 <a b="c&ent2;"/>
8315 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
8316 wakaba 1.11 @@@test:domTree:
8317     document {
8318     document-type {
8319     general-entity {
8320 wakaba 1.18 node-name: 'ent';
8321     text-content: 'aa<bb';
8322     }
8323     general-entity {
8324     node-name: 'ent2';
8325     text { data: 'ccc'; }
8326     general-entity-reference {
8327     node-name: 'ent';
8328     text-content: 'aa<bb';
8329 wakaba 1.34 manakai-expanded: true;
8330 wakaba 1.18 }
8331 wakaba 1.11 }
8332     }
8333     element {
8334 wakaba 1.18 attribute {
8335     node-name: 'b';
8336     text { data: 'c'; }
8337     general-entity-reference {
8338     node-name: 'ent2';
8339     text { data: 'ccc'; }
8340     general-entity-reference {
8341     node-name: 'ent';
8342     text-content: 'aa<bb';
8343 wakaba 1.34 manakai-expanded: true;
8344 wakaba 1.18 }
8345 wakaba 1.34 manakai-expanded: true;
8346 wakaba 1.18 }
8347     }
8348 wakaba 1.11 }
8349     }
8350    
8351 wakaba 1.8 @@XMLTest:
8352 wakaba 1.18 @@@QName: xp.doctype.intsubset.pi.test
8353 wakaba 1.8 @@@DEnt:
8354     @@@@test:value:
8355     <!DOCTYPE a [
8356 wakaba 1.18 <?pi data ?>
8357 wakaba 1.8 ]>
8358     <a></a>
8359     @@@test:domTree:
8360     document {
8361     xml-version: '1.0';
8362     xml-encoding: null;
8363     xml-standalone: false;
8364     document-type {
8365     node-name: 'a';
8366 wakaba 1.18 pi {
8367     target: 'pi';
8368     data: 'data ';
8369 wakaba 1.8 }
8370     }
8371     element {
8372     namespace-uri: null;
8373 wakaba 1.18 prefix: null;
8374 wakaba 1.8 local-name: 'a';
8375 wakaba 1.18 text-content: '';
8376 wakaba 1.8 }
8377     }
8378 wakaba 1.18 @@@enImplNote:
8379     A DOM PI node in doctype node is a manakai extension.
8380    
8381    
8382 wakaba 1.8 @@XMLTest:
8383 wakaba 1.18 @@@QName: xp.doctype.intsubset.entity.general.internal.test
8384 wakaba 1.8 @@@DEnt:
8385     @@@@test:value:
8386     <!DOCTYPE a [
8387 wakaba 1.18 <!ENTITY entity "entity value">
8388 wakaba 1.8 ]>
8389     <a></a>
8390 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
8391 wakaba 1.8 @@@test:domTree:
8392     document {
8393     xml-version: '1.0';
8394     xml-encoding: null;
8395     xml-standalone: false;
8396     document-type {
8397     node-name: 'a';
8398 wakaba 1.18 general-entity {
8399     node-name: 'entity';
8400     text-content: 'entity value';
8401     has-replacement-tree: true;
8402 wakaba 1.8 }
8403     }
8404     element {
8405     namespace-uri: null;
8406 wakaba 1.18 prefix: null;
8407 wakaba 1.8 local-name: 'a';
8408 wakaba 1.18 text-content: '';
8409 wakaba 1.8 }
8410     }
8411     @@XMLTest:
8412 wakaba 1.18 @@@QName: xp.doctype.intsubset.entity.parameter.internal.test
8413 wakaba 1.8 @@@DEnt:
8414     @@@@test:value:
8415     <!DOCTYPE a [
8416 wakaba 1.18 <!ENTITY % entity "entity value">
8417 wakaba 1.8 ]>
8418     <a></a>
8419     @@@test:domTree:
8420     document {
8421     xml-version: '1.0';
8422     xml-encoding: null;
8423     xml-standalone: false;
8424     document-type {
8425     node-name: 'a';
8426     }
8427     element {
8428     namespace-uri: null;
8429 wakaba 1.18 prefix: null;
8430 wakaba 1.8 local-name: 'a';
8431 wakaba 1.18 text-content: '';
8432 wakaba 1.8 }
8433     }
8434 wakaba 1.18
8435 wakaba 1.8 @@XMLTest:
8436 wakaba 1.18 @@@QName: xp.doctype.internal.entity.root.element.text.only.test
8437 wakaba 1.8 @@@DEnt:
8438     @@@@test:value:
8439     <!DOCTYPE a [
8440 wakaba 1.18 <!ENTITY entity "entity value">
8441 wakaba 1.8 ]>
8442 wakaba 1.18 <a>&entity;</a>
8443 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
8444 wakaba 1.8 @@@test:domTree:
8445     document {
8446     xml-version: '1.0';
8447     xml-encoding: null;
8448     xml-standalone: false;
8449     document-type {
8450     node-name: 'a';
8451 wakaba 1.18 general-entity {
8452     node-name: 'entity';
8453     text-content: 'entity value';
8454     has-replacement-tree: true;
8455 wakaba 1.8 }
8456     }
8457     element {
8458     namespace-uri: null;
8459 wakaba 1.18 prefix: null;
8460 wakaba 1.8 local-name: 'a';
8461 wakaba 1.18 general-entity-reference {
8462     node-name: 'entity';
8463     text {
8464     data: 'entity value';
8465     }
8466 wakaba 1.34 manakai-expanded: true;
8467 wakaba 1.10 }
8468 wakaba 1.9 }
8469     }
8470     @@XMLTest:
8471 wakaba 1.18 @@@QName: xp.doctype.internal.entity.root.element.text.mult.test
8472 wakaba 1.9 @@@DEnt:
8473     @@@@test:value:
8474     <!DOCTYPE a [
8475 wakaba 1.18 <!ENTITY entity "entity value">
8476 wakaba 1.9 ]>
8477 wakaba 1.18 <a>&entity; and &entity;</a>
8478 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
8479 wakaba 1.9 @@@test:domTree:
8480     document {
8481     xml-version: '1.0';
8482     xml-encoding: null;
8483     xml-standalone: false;
8484     document-type {
8485     node-name: 'a';
8486 wakaba 1.18 general-entity {
8487     node-name: 'entity';
8488     text-content: 'entity value';
8489     has-replacement-tree: true;
8490 wakaba 1.9 }
8491     }
8492     element {
8493     namespace-uri: null;
8494 wakaba 1.18 prefix: null;
8495 wakaba 1.9 local-name: 'a';
8496 wakaba 1.18 general-entity-reference {
8497     node-name: 'entity';
8498     text {
8499     data: 'entity value';
8500     }
8501 wakaba 1.34 manakai-expanded: true;
8502 wakaba 1.18 }
8503     text { data: ' and '; }
8504     general-entity-reference {
8505     node-name: 'entity';
8506     text {
8507     data: 'entity value';
8508     }
8509 wakaba 1.34 manakai-expanded: true;
8510 wakaba 1.10 }
8511 wakaba 1.9 }
8512     }
8513     @@XMLTest:
8514 wakaba 1.18 @@@QName: xp.doctype.internal.entity.root.element.text.element.test
8515 wakaba 1.9 @@@DEnt:
8516     @@@@test:value:
8517     <!DOCTYPE a [
8518 wakaba 1.18 <!ENTITY entity "entity <p>value</p> with <e>element</e> ">
8519 wakaba 1.9 ]>
8520 wakaba 1.18 <a>&entity;</a>
8521 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
8522 wakaba 1.18 @@@test:domTree:
8523     document {
8524     xml-version: '1.0';
8525     xml-encoding: null;
8526     xml-standalone: false;
8527     document-type {
8528     node-name: 'a';
8529     general-entity {
8530     node-name: 'entity';
8531     has-replacement-tree: true;
8532     text { data: 'entity '; }
8533     element {
8534     node-name: 'p';
8535     text-content: 'value';
8536     }
8537     text { data: ' with '; }
8538     element {
8539     node-name: 'e';
8540     text-content: 'element';
8541     }
8542 wakaba 1.20 text { data: ' '; }
8543 wakaba 1.18 }
8544     }
8545     element {
8546     namespace-uri: null;
8547     prefix: null;
8548     local-name: 'a';
8549     general-entity-reference {
8550     node-name: 'entity';
8551 wakaba 1.34 manakai-expanded: true;
8552 wakaba 1.18 text {
8553     data: 'entity ';
8554     }
8555     element {
8556     namespace-uri: null;
8557     prefix: null;
8558     local-name: 'p';
8559     text {
8560     data: 'value';
8561     }
8562     }
8563     text {
8564     data: ' with ';
8565     }
8566     element {
8567     namespace-uri: null;
8568     prefix: null;
8569     local-name: 'e';
8570     text {
8571     data: 'element';
8572     }
8573     }
8574     text {
8575     data: ' ';
8576     }
8577     }
8578     }
8579     }
8580     @@XMLTest:
8581     @@@QName: xp.doctype.internal.entity.root.element.text.in.ent.test
8582     @@@DEnt:
8583     @@@@test:value:
8584     <!DOCTYPE a [
8585     <!ENTITY entity1 "entity value">
8586     <!ENTITY entity2 "e&entity1;n">
8587     ]>
8588     <a>&entity2;</a>
8589 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
8590 wakaba 1.18 @@@test:domTree:
8591     document {
8592     xml-version: '1.0';
8593     xml-encoding: null;
8594     xml-standalone: false;
8595     document-type {
8596     node-name: 'a';
8597     general-entity {
8598     node-name: 'entity1';
8599     text-content: 'entity value';
8600     }
8601     general-entity {
8602     node-name: 'entity2';
8603     text { data: 'e'; }
8604     general-entity-reference {
8605     node-name: 'entity1';
8606     text-content: 'entity value';
8607 wakaba 1.34 manakai-expanded: true;
8608 wakaba 1.18 }
8609     text { data: 'n'; }
8610     }
8611     }
8612     element {
8613     namespace-uri: null;
8614     prefix: null;
8615     local-name: 'a';
8616     general-entity-reference {
8617     node-name: 'entity2';
8618     text { data: 'e'; }
8619 wakaba 1.34 manakai-expanded: true;
8620 wakaba 1.18 general-entity-reference {
8621     node-name: 'entity1';
8622     text {
8623     data: 'entity value';
8624     }
8625 wakaba 1.34 manakai-expanded: true;
8626 wakaba 1.18 }
8627     text { data: 'n'; }
8628     }
8629     }
8630     }
8631    
8632     @@XMLTest:
8633     @@@QName: xp.doctype.entity.value.charref.test
8634     @@@DEnt:
8635     @@@@test:value:
8636     <!DOCTYPE a [
8637     <!ENTITY entity1 "entity &#x21;value&#35;">
8638     <!ENTITY entity2 '&#x21;value&#35;'>
8639     ]>
8640     <a></a>
8641 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
8642 wakaba 1.18 @@@test:domTree:
8643     document {
8644     document-type {
8645     general-entity {
8646     node-name: 'entity1';
8647     text-content: 'entity !value#';
8648     has-replacement-tree: true;
8649     }
8650     general-entity {
8651     node-name: 'entity2';
8652     text-content: '!value#';
8653     has-replacement-tree: true;
8654     }
8655     }
8656     element { }
8657     }
8658    
8659     @@XMLTest:
8660     @@@QName: xp.predefined.in.content.test
8661     @@@DEnt:
8662     @@@@test:value:
8663     <a>_&lt;_&gt;_&quot;_&apos;_&amp;_</a>
8664     @@@test:domTree:
8665     document {
8666     element {
8667     text-content: '_<_>_"_' U+0027 '_&_';
8668     }
8669     }
8670     @@XMLTest:
8671     @@@QName: xp.predefined.in.attr.test
8672     @@@DEnt:
8673     @@@@test:value:
8674     <a at="_&lt;_&gt;_&quot;_&apos;_&amp;_"></a>
8675     @@@test:domTree:
8676     document {
8677     element {
8678     attribute {
8679     node-name: 'at';
8680     text-content: '_<_>_"_' U+0027 '_&_';
8681     }
8682     }
8683     }
8684     @@XMLTest:
8685     @@@QName: xp.predefined.in.content.in.entity.test
8686     @@@DEnt:
8687     @@@@test:value:
8688     <!DOCTYPE a [
8689     <!ENTITY ent "_&lt;_&gt;_&quot;_&apos;_&amp;_">
8690     ]>
8691     <a>&ent;</a>
8692 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
8693 wakaba 1.18 @@@test:domTree:
8694     document {
8695     document-type {
8696     general-entity {
8697     node-name: 'ent';
8698     text-content: '_<_>_"_' U+0027 '_&_';
8699     }
8700     }
8701     element {
8702     text-content: '_<_>_"_' U+0027 '_&_';
8703     }
8704     }
8705     @@XMLTest:
8706     @@@QName: xp.predefined.decl.ignore.test
8707     @@@DEnt:
8708     @@@@test:value:
8709     <!DOCTYPE a [
8710     <!ENTITY lt "&#x26;#x3C;">
8711     <!ENTITY gt "&#x3E;">
8712     <!ENTITY amp "&#x26;#x26;">
8713     <!ENTITY quot "&#x22;">
8714     <!ENTITY apos "&#x27;">
8715     <!ENTITY other "other">
8716     ]>
8717     <a>_&lt;_&gt;_&quot;_&apos;_&amp;_&other;_</a>
8718 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
8719 wakaba 1.18 @@@test:domTree:
8720     document {
8721     document-type {
8722     general-entity {
8723     node-name: 'other';
8724     text-content: 'other';
8725     }
8726     }
8727     element {
8728     text-content: '_<_>_"_' U+0027 '_&_other_';
8729     }
8730     }
8731    
8732     @@XMLTest:
8733     @@@QName: xp.doctype.internal.attr.empty.test
8734     @@@DEnt:
8735     @@@@test:value:
8736     <!DOCTYPE a [
8737     <!ATTLIST a>
8738     ]>
8739     <a></a>
8740     @@@test:domTree:
8741     document {
8742     xml-version: '1.0';
8743     xml-encoding: null;
8744     xml-standalone: false;
8745     document-type {
8746     node-name: 'a';
8747     element-type-definition {
8748     node-name: 'a';
8749     }
8750     }
8751     element {
8752     namespace-uri: null;
8753     local-name: 'a';
8754     }
8755     }
8756     @@XMLTest:
8757     @@@QName: xp.doctype.internal.attr.cdata.implied.test
8758     @@@DEnt:
8759     @@@@test:value:
8760     <!DOCTYPE a [
8761     <!ATTLIST a
8762     at CDATA #IMPLIED
8763     >
8764     ]>
8765     <a></a>
8766 wakaba 1.9 @@@test:domTree:
8767     document {
8768     xml-version: '1.0';
8769     xml-encoding: null;
8770     xml-standalone: false;
8771     document-type {
8772     node-name: 'a';
8773     element-type-definition {
8774     node-name: 'a';
8775     attribute-definition {
8776     node-name: 'at';
8777 wakaba 1.18 declared-type: const (CDATA_ATTR);
8778 wakaba 1.9 allowed-tokens: DOMStringList ();
8779 wakaba 1.18 default-type: const (IMPLIED_DEFAULT);
8780     text-content: '';
8781 wakaba 1.9 }
8782     }
8783     }
8784     element {
8785     namespace-uri: null;
8786     local-name: 'a';
8787 wakaba 1.18 }
8788     }
8789     @@XMLTest:
8790     @@@QName: xp.doctype.internal.attr.types.implied.test
8791     @@@DEnt:
8792     @@@@test:value:
8793     <!DOCTYPE a [
8794     <!ATTLIST a
8795     at1 ID #IMPLIED
8796     at2 IDREF #IMPLIED
8797     at3 IDREFS #IMPLIED
8798     at4 ENTITY #IMPLIED
8799     at5 ENTITIES #IMPLIED
8800     at6 NMTOKEN #IMPLIED
8801     at7 NMTOKENS #IMPLIED
8802     at8 NOTATION (n1 | n2|n3) #IMPLIED
8803     at9 (e1| e2| e3 ) #IMPLIED
8804     >
8805     ]>
8806     <a></a>
8807     @@@test:domTree:
8808     document {
8809     xml-version: '1.0';
8810     xml-encoding: null;
8811     xml-standalone: false;
8812     document-type {
8813     node-name: 'a';
8814     element-type-definition {
8815     node-name: 'a';
8816     attribute-definition {
8817     node-name: 'at1';
8818     declared-type: const (ID_ATTR);
8819     allowed-tokens: DOMStringList ();
8820     default-type: const (IMPLIED_DEFAULT);
8821     text-content: '';
8822     }
8823     attribute-definition {
8824     node-name: 'at2';
8825     declared-type: const (IDREF_ATTR);
8826     allowed-tokens: DOMStringList ();
8827     default-type: const (IMPLIED_DEFAULT);
8828     text-content: '';
8829     }
8830     attribute-definition {
8831     node-name: 'at3';
8832     declared-type: const (IDREFS_ATTR);
8833     allowed-tokens: DOMStringList ();
8834     default-type: const (IMPLIED_DEFAULT);
8835     text-content: '';
8836     }
8837     attribute-definition {
8838     node-name: 'at4';
8839     declared-type: const (ENTITY_ATTR);
8840     allowed-tokens: DOMStringList ();
8841     default-type: const (IMPLIED_DEFAULT);
8842     text-content: '';
8843     }
8844     attribute-definition {
8845     node-name: 'at5';
8846     declared-type: const (ENTITIES_ATTR);
8847     allowed-tokens: DOMStringList ();
8848     default-type: const (IMPLIED_DEFAULT);
8849     text-content: '';
8850     }
8851     attribute-definition {
8852     node-name: 'at6';
8853     declared-type: const (NMTOKEN_ATTR);
8854     allowed-tokens: DOMStringList ();
8855     default-type: const (IMPLIED_DEFAULT);
8856     text-content: '';
8857     }
8858     attribute-definition {
8859     node-name: 'at7';
8860     declared-type: const (NMTOKENS_ATTR);
8861     allowed-tokens: DOMStringList ();
8862     default-type: const (IMPLIED_DEFAULT);
8863     text-content: '';
8864     }
8865     attribute-definition {
8866     node-name: 'at8';
8867     declared-type: const (NOTATION_ATTR);
8868     allowed-tokens: DOMStringList ('n1', 'n2', 'n3');
8869     default-type: const (IMPLIED_DEFAULT);
8870     text-content: '';
8871     }
8872     attribute-definition {
8873     node-name: 'at9';
8874     declared-type: const (ENUMERATION_ATTR);
8875     allowed-tokens: DOMStringList ('e1', 'e2', 'e3');
8876     default-type: const (IMPLIED_DEFAULT);
8877     text-content: '';
8878     }
8879     }
8880     }
8881     element {
8882     namespace-uri: null;
8883     local-name: 'a';
8884     }
8885     }
8886     @@XMLTest:
8887     @@@QName: xp.doctype.internal.attr.cdata.defaults.test
8888     @@@DEnt:
8889     @@@@test:value:
8890     <!DOCTYPE a [
8891     <!ATTLIST a
8892     at1 CDATA #IMPLIED
8893     at2 CDATA #REQUIRED
8894     at3 CDATA #FIXED "value3"
8895     at4 CDATA "value4"
8896     at5 CDATA #FIXED 'value5'
8897     at6 CDATA 'value6'
8898     >
8899     ]>
8900     <a></a>
8901     @@@test:domTree:
8902     document {
8903     xml-version: '1.0';
8904     xml-encoding: null;
8905     xml-standalone: false;
8906     document-type {
8907     node-name: 'a';
8908     element-type-definition {
8909     node-name: 'a';
8910     attribute-definition {
8911     node-name: 'at1';
8912     declared-type: const (CDATA_ATTR);
8913     allowed-tokens: DOMStringList ();
8914     default-type: const (IMPLIED_DEFAULT);
8915     text-content: '';
8916     }
8917     attribute-definition {
8918     node-name: 'at2';
8919     declared-type: const (CDATA_ATTR);
8920     allowed-tokens: DOMStringList ();
8921     default-type: const (REQUIRED_DEFAULT);
8922     text-content: '';
8923     }
8924     attribute-definition {
8925     node-name: 'at3';
8926     declared-type: const (CDATA_ATTR);
8927     allowed-tokens: DOMStringList ();
8928     default-type: const (FIXED_DEFAULT);
8929     text-content: 'value3';
8930     }
8931     attribute-definition {
8932     node-name: 'at4';
8933     declared-type: const (CDATA_ATTR);
8934     allowed-tokens: DOMStringList ();
8935     default-type: const (EXPLICIT_DEFAULT);
8936     text-content: 'value4';
8937     }
8938     attribute-definition {
8939     node-name: 'at5';
8940     declared-type: const (CDATA_ATTR);
8941     allowed-tokens: DOMStringList ();
8942     default-type: const (FIXED_DEFAULT);
8943     text-content: 'value5';
8944     }
8945     attribute-definition {
8946     node-name: 'at6';
8947     declared-type: const (CDATA_ATTR);
8948     allowed-tokens: DOMStringList ();
8949     default-type: const (EXPLICIT_DEFAULT);
8950     text-content: 'value6';
8951     }
8952     }
8953     }
8954     element {
8955     namespace-uri: null;
8956     local-name: 'a';
8957     attribute {
8958     node-name: 'at3';
8959     text-content: 'value3';
8960     specified: false;
8961     }
8962     attribute {
8963     node-name: 'at4';
8964     text-content: 'value4';
8965     specified: false;
8966     }
8967     attribute {
8968     node-name: 'at5';
8969     text-content: 'value5';
8970     specified: false;
8971     }
8972     attribute {
8973     node-name: 'at6';
8974     text-content: 'value6';
8975     specified: false;
8976     }
8977     }
8978     }
8979    
8980     @@XMLTest:
8981     @@@QName: xp.doctype.internal.attr.cdata.default.normalize.test
8982     @@@DEnt:
8983     @@@@test:value:
8984     <!DOCTYPE a [
8985     <!ATTLIST a
8986     at CDATA " default &#x0A;value "
8987     >
8988     ]>
8989     <a></a>
8990     @@@test:domTree:
8991     document {
8992     xml-version: '1.0';
8993     xml-encoding: null;
8994     xml-standalone: false;
8995     document-type {
8996     node-name: 'a';
8997     element-type-definition {
8998     node-name: 'a';
8999     attribute-definition {
9000     node-name: 'at';
9001     declared-type: const (CDATA_ATTR);
9002     allowed-tokens: DOMStringList ();
9003     default-type: const (EXPLICIT_DEFAULT);
9004     text-content: ' default ' U+000A 'value ';
9005     }
9006     }
9007     }
9008     element {
9009     namespace-uri: null;
9010     local-name: 'a';
9011     attribute {
9012     node-name: 'at';
9013     text-content: ' default ' U+000A 'value ';
9014     specified: false;
9015     }
9016     }
9017     }
9018     @@XMLTest:
9019     @@@QName: xp.doctype.internal.attr.nmtoken.default.normalize.test
9020     @@@DEnt:
9021     @@@@test:value:
9022     <!DOCTYPE a [
9023     <!ATTLIST a
9024     at NMTOKEN " default &#x0A;value "
9025     >
9026     ]>
9027     <a></a>
9028     @@@test:domTree:
9029     document {
9030     xml-version: '1.0';
9031     xml-encoding: null;
9032     xml-standalone: false;
9033     document-type {
9034     node-name: 'a';
9035     element-type-definition {
9036     node-name: 'a';
9037     attribute-definition {
9038     node-name: 'at';
9039     declared-type: const (NMTOKEN_ATTR);
9040     allowed-tokens: DOMStringList ();
9041     default-type: const (EXPLICIT_DEFAULT);
9042     text-content: ' default ' U+000A 'value ';
9043     }
9044     }
9045     }
9046     element {
9047     namespace-uri: null;
9048     local-name: 'a';
9049     attribute {
9050     node-name: 'at';
9051     text-content: ' default ' U+000A 'value ';
9052     specified: false;
9053     }
9054     }
9055     }
9056    
9057     @@XMLTest:
9058     @@@QName: xp.doctype.attrtype.no-value.test
9059     @@@DEnt:
9060     @@@@test:value:
9061     <!DOCTYPE a>
9062     <a at=" at value "></a>
9063     @@@test:domTree:
9064     document {
9065     xml-version: '1.0';
9066     xml-encoding: null;
9067     xml-standalone: false;
9068     document-type { }
9069     element {
9070     namespace-uri: null;
9071     local-name: 'a';
9072     attribute {
9073     namespace-uri: null;
9074     local-name: 'at';
9075     value: ' at value ';
9076     text {
9077     data: ' at value ';
9078     }
9079     schema-type-info: TypeInfo (null, null);
9080     specified: true;
9081     }
9082     }
9083     }
9084     @@XMLTest:
9085     @@@QName: xp.doctype.attrtype.cdata.test
9086     @@@DEnt:
9087     @@@@test:value:
9088     <!DOCTYPE a [
9089     <!ATTLIST a
9090     at CDATA #IMPLIED
9091     >
9092     ]>
9093     <a at=" at value "></a>
9094     @@@test:domTree:
9095     document {
9096     xml-version: '1.0';
9097     xml-encoding: null;
9098     xml-standalone: false;
9099     document-type { }
9100     element {
9101     namespace-uri: null;
9102     local-name: 'a';
9103     attribute {
9104     namespace-uri: null;
9105     local-name: 'at';
9106     value: ' at value ';
9107     text {
9108     data: ' at value ';
9109     }
9110     schema-type-info:
9111     TypeInfo ('http://www.w3.org/TR/REC-xml', 'CDATA');
9112     specified: true;
9113     }
9114     }
9115     }
9116     @@XMLTest:
9117     @@@QName: xp.doctype.attrtype.nmtoken.test
9118     @@@DEnt:
9119     @@@@test:value:
9120     <!DOCTYPE a [
9121     <!ATTLIST a
9122     at NMTOKEN #IMPLIED
9123     >
9124     ]>
9125     <a at=" at value "></a>
9126     @@@test:domTree:
9127     document {
9128     xml-version: '1.0';
9129     xml-encoding: null;
9130     xml-standalone: false;
9131     document-type { }
9132     element {
9133     namespace-uri: null;
9134     local-name: 'a';
9135     attribute {
9136     namespace-uri: null;
9137     local-name: 'at';
9138     value: 'at value';
9139     text {
9140     data: ' at value ';
9141     }
9142     schema-type-info:
9143     TypeInfo ('http://www.w3.org/TR/REC-xml', 'NMTOKEN');
9144     specified: true;
9145     }
9146     }
9147     }
9148    
9149     @@XMLTest:
9150     @@@QName: xp.doctype.attr.normalization.1.test
9151     @@@DEnt:
9152     @@@@test:value:
9153     <a at=" at &#xA;value "></a>
9154     @@@test:domTree:
9155     document {
9156     element {
9157     attribute {
9158     node-name: 'at';
9159     value: ' at ' U+000A 'value ';
9160     schema-type-info: TypeInfo (null, null);
9161     specified: true;
9162     }
9163     }
9164     }
9165     @@XMLTest:
9166     @@@QName: xp.doctype.attr.normalization.2.test
9167     @@@DEnt:
9168     @@@@test:value:
9169     <a at=" at &#xD;value "></a>
9170     @@@test:domTree:
9171     document {
9172     element {
9173     attribute {
9174     value: ' at ' U+000D 'value ';
9175     schema-type-info: TypeInfo (null, null);
9176     specified: true;
9177     }
9178     }
9179     }
9180     @@XMLTest:
9181     @@@QName: xp.doctype.attr.normalization.3.test
9182     @@@DEnt:
9183     @@@@test:value:
9184     <a at=" at &#x9;value "></a>
9185     @@@test:domTree:
9186     document {
9187     element {
9188     attribute {
9189     node-name: 'at';
9190     value: ' at ' U+0009 'value ';
9191     schema-type-info: TypeInfo (null, null);
9192     specified: true;
9193     }
9194     }
9195     }
9196    
9197     @@XMLTest:
9198     @@@QName: xp.doctype.attr.specified.1.test
9199     @@@DEnt:
9200     @@@@test:value:
9201     <!DOCTYPE a [
9202     <!ATTLIST a
9203     at CDATA "default"
9204     >
9205     ]>
9206     <a></a>
9207     @@@test:domTree:
9208     document {
9209     document-type { }
9210     element {
9211     attribute {
9212     node-name: 'at';
9213     value: 'default';
9214     specified: false;
9215     }
9216     }
9217     }
9218     @@XMLTest:
9219     @@@QName: xp.doctype.attr.specified.2.test
9220     @@@DEnt:
9221     @@@@test:value:
9222     <!DOCTYPE a [
9223     <!ATTLIST a
9224     at CDATA "default"
9225     >
9226     ]>
9227     <a at2="specified"></a>
9228     @@@test:domTree:
9229     document {
9230     document-type { }
9231     element {
9232     attribute {
9233     node-name: 'at';
9234     value: 'default';
9235     specified: false;
9236     }
9237     attribute {
9238     node-name: 'at2';
9239     value: 'specified';
9240     specified: true;
9241     }
9242     }
9243     }
9244     @@XMLTest:
9245     @@@QName: xp.doctype.attr.specified.3.test
9246     @@@DEnt:
9247     @@@@test:value:
9248     <!DOCTYPE a [
9249     <!ATTLIST a
9250     at CDATA "default"
9251     >
9252     ]>
9253     <a at="specified"></a>
9254     @@@test:domTree:
9255     document {
9256     document-type { }
9257     element {
9258     attribute {
9259     node-name: 'at';
9260     value: 'specified';
9261     specified: true;
9262     }
9263     }
9264     }
9265    
9266     @@XMLTest:
9267     @@@QName: xp.attr.literal.charref.test
9268     @@@DEnt:
9269     @@@@test:value:
9270     <a at1 = "value&#33;_&#x25;value"
9271     at2 = 'value&#x25;_&#33;value'></a>
9272     @@@test:domTree:
9273     document {
9274     element {
9275     attribute {
9276     node-name: 'at1';
9277     text-content: 'value!_%value';
9278     }
9279     attribute {
9280     node-name: 'at2';
9281     text-content: 'value%_!value';
9282     }
9283     }
9284     }
9285     @@XMLTest:
9286     @@@QName: xp.attr.literal.entref.test
9287     @@@DEnt:
9288     @@@@test:value:
9289     <!DOCTYPE a [
9290     <!ENTITY ent "entity&#x26;#33;_&#x26;#x29;value">
9291     ]>
9292     <a at1 = "value&ent;value"
9293     at2 = 'value&ent;value'></a>
9294 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
9295 wakaba 1.18 @@@test:domTree:
9296     document {
9297     document-type {
9298     general-entity {
9299     node-name: 'ent';
9300     text-content: 'entity!_)value';
9301     }
9302     }
9303     element {
9304     attribute {
9305     node-name: 'at1';
9306     text-content: 'valueentity!_)valuevalue';
9307     }
9308     attribute {
9309     node-name: 'at2';
9310     text-content: 'valueentity!_)valuevalue';
9311     }
9312     }
9313     }
9314     @@XMLTest:
9315     @@@QName: xp.attr.literal.entref.nest.test
9316     @@@DEnt:
9317     @@@@test:value:
9318     <!DOCTYPE a [
9319     <!ENTITY ent1 "entity&#x26;#33;_&#x26;#x29;value">
9320     <!ENTITY ent2 "@&ent1;@">
9321     ]>
9322     <a at1 = "value&ent2;value"
9323     at2 = 'value&ent2;value'></a>
9324 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
9325 wakaba 1.18 @@@test:domTree:
9326     document {
9327     document-type {
9328     general-entity {
9329     node-name: 'ent1';
9330     text-content: 'entity!_)value';
9331     }
9332     general-entity {
9333     node-name: 'ent2';
9334     text-content: '@entity!_)value@';
9335     }
9336     }
9337     element {
9338     attribute {
9339     node-name: 'at1';
9340     text-content: 'value@entity!_)value@value';
9341     }
9342     attribute {
9343     node-name: 'at2';
9344     text-content: 'value@entity!_)value@value';
9345     }
9346     }
9347     }
9348    
9349     @@XMLTest:
9350     @@@QName: xp.element.content.ncr.1.test
9351     @@@DEnt:
9352     @@@@test:value:
9353     <e>&#33;</e>
9354     @@@test:domTree:
9355     document {
9356     element {
9357     text-content: '!';
9358     }
9359     }
9360     @@XMLTest:
9361     @@@QName: xp.element.content.ncr.2.test
9362     @@@DEnt:
9363     @@@@test:value:
9364     <e>aaaa&#33;bbbb</e>
9365     @@@test:domTree:
9366     document {
9367     element {
9368     text-content: 'aaaa!bbbb';
9369 wakaba 1.31 text {
9370     text-content: 'aaaa!bbbb';
9371     }
9372 wakaba 1.18 }
9373     }
9374     @@XMLTest:
9375     @@@QName: xp.attrval.ncr.1.test
9376     @@@DEnt:
9377     @@@@test:value:
9378     <e a="&#33;"/>
9379     @@@test:domTree:
9380     document {
9381     element {
9382     attribute {
9383     node-name: 'a';
9384     text-content: '!';
9385     }
9386     }
9387     }
9388     @@XMLTest:
9389     @@@QName: xp.attrval.ncr.2.test
9390     @@@DEnt:
9391     @@@@test:value:
9392     <e a="aaaaa&#33;bbbbb"/>
9393     @@@test:domTree:
9394     document {
9395     element {
9396     attribute {
9397     node-name: 'a';
9398     text-content: 'aaaaa!bbbbb';
9399 wakaba 1.31 text {
9400     text-content: 'aaaaa!bbbbb';
9401     }
9402 wakaba 1.18 }
9403     }
9404     }
9405     @@XMLTest:
9406     @@@QName: xp.attrval.ncr.3.test
9407     @@@DEnt:
9408     @@@@test:value:
9409     <e a='&#33;'/>
9410     @@@test:domTree:
9411     document {
9412     element {
9413     attribute {
9414     node-name: 'a';
9415     text-content: '!';
9416     }
9417     }
9418     }
9419     @@XMLTest:
9420     @@@QName: xp.attrval.ncr.4.test
9421     @@@DEnt:
9422     @@@@test:value:
9423     <e a='aaaaa&#33;bbbbb'/>
9424     @@@test:domTree:
9425     document {
9426     element {
9427     attribute {
9428     node-name: 'a';
9429     text-content: 'aaaaa!bbbbb';
9430     }
9431     }
9432     }
9433     @@XMLTest:
9434     @@@QName: xp.entval.ncr.1.test
9435     @@@DEnt:
9436     @@@@test:value:
9437     <!DOCTYPE e [
9438     <!ENTITY ent "&#33;">
9439     ]>
9440     <e/>
9441 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
9442 wakaba 1.18 @@@test:domTree:
9443     document {
9444     document-type {
9445     general-entity {
9446     node-name: 'ent';
9447     text-content: '!';
9448     }
9449     }
9450     element { }
9451     }
9452     @@XMLTest:
9453     @@@QName: xp.entval.ncr.2.test
9454     @@@DEnt:
9455     @@@@test:value:
9456     <!DOCTYPE e [
9457     <!ENTITY ent "aaaaa&#33;bbbbb">
9458     ]>
9459     <e/>
9460 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
9461 wakaba 1.18 @@@test:domTree:
9462     document {
9463     document-type {
9464     general-entity {
9465     node-name: 'ent';
9466     text-content: 'aaaaa!bbbbb';
9467     }
9468     }
9469     element { }
9470     }
9471     @@XMLTest:
9472     @@@QName: xp.element.content.reptxt.ncr.1.test
9473     @@@DEnt:
9474     @@@@test:value:
9475     <!DOCTYPE e [
9476     <!ENTITY ent "&#38;#33;">
9477     ]>
9478     <e>&ent;</e>
9479     @@@test:domTree:
9480     document {
9481     document-type { }
9482     element {
9483     general-entity-reference {
9484     node-name: 'ent';
9485     text-content: '!';
9486 wakaba 1.34 manakai-expanded: true;
9487 wakaba 1.18 }
9488     }
9489     }
9490     @@XMLTest:
9491     @@@QName: xp.element.content.reptxt.ncr.2.test
9492     @@@DEnt:
9493     @@@@test:value:
9494     <!DOCTYPE e [
9495     <!ENTITY ent "aaaaa&#38;#33;bbbbb">
9496     ]>
9497     <e>&ent;</e>
9498     @@@test:domTree:
9499     document {
9500     document-type { }
9501     element {
9502     general-entity-reference {
9503     node-name: 'ent';
9504     text-content: 'aaaaa!bbbbb';
9505 wakaba 1.34 manakai-expanded: true;
9506 wakaba 1.18 }
9507     }
9508     }
9509     @@XMLTest:
9510     @@@QName: xp.element.content.reptxt.reptxt.ncr.1.test
9511     @@@DEnt:
9512     @@@@test:value:
9513     <!DOCTYPE e [
9514     <!ENTITY ent "&#38;#33;">
9515     <!ENTITY ent2 "&ent;">
9516     ]>
9517     <e>&ent2;</e>
9518     @@@test:domTree:
9519     document {
9520     document-type { }
9521     element {
9522     general-entity-reference {
9523     node-name: 'ent2';
9524     general-entity-reference {
9525     node-name: 'ent';
9526     text-content: '!';
9527 wakaba 1.34 manakai-expanded: true;
9528 wakaba 1.18 }
9529 wakaba 1.34 manakai-expanded: true;
9530 wakaba 1.18 }
9531     }
9532     }
9533     @@XMLTest:
9534     @@@QName: xp.element.content.reptxt.reptxt.ncr.2.test
9535     @@@DEnt:
9536     @@@@test:value:
9537     <!DOCTYPE e [
9538     <!ENTITY ent "aa&#38;#33;bb">
9539     <!ENTITY ent2 "&ent;">
9540     ]>
9541     <e>&ent2;</e>
9542     @@@test:domTree:
9543     document {
9544     document-type { }
9545     element {
9546     general-entity-reference {
9547     node-name: 'ent2';
9548     general-entity-reference {
9549     node-name: 'ent';
9550     text-content: 'aa!bb';
9551 wakaba 1.34 manakai-expanded: true;
9552 wakaba 1.31 text {
9553     text-content: 'aa!bb';
9554     }
9555 wakaba 1.18 }
9556 wakaba 1.34 manakai-expanded: true;
9557 wakaba 1.18 }
9558     }
9559     }
9560     @@XMLTest:
9561     @@@QName: xp.attval.reptxt.ncr.1.test
9562     @@@DEnt:
9563     @@@@test:value:
9564     <!DOCTYPE e [
9565     <!ENTITY ent "&#38;#33;">
9566     ]>
9567     <e a="&ent;"/>
9568     @@@test:domTree:
9569     document {
9570     document-type { }
9571     element {
9572     attribute {
9573     node-name: 'a';
9574     general-entity-reference {
9575     node-name: 'ent';
9576     text-content: '!';
9577 wakaba 1.34 manakai-expanded: true;
9578 wakaba 1.18 }
9579     }
9580     }
9581     }
9582     @@XMLTest:
9583     @@@QName: xp.attval.reptxt.ncr.2.test
9584     @@@DEnt:
9585     @@@@test:value:
9586     <!DOCTYPE e [
9587     <!ENTITY ent "aaaaa&#38;#33;bbbbb">
9588     ]>
9589     <e a="&ent;"/>
9590     @@@test:domTree:
9591     document {
9592     document-type { }
9593     element {
9594     attribute {
9595     node-name: 'a';
9596     general-entity-reference {
9597     node-name: 'ent';
9598     text-content: 'aaaaa!bbbbb';
9599 wakaba 1.34 manakai-expanded: true;
9600 wakaba 1.31 text {
9601     text-content: 'aaaaa!bbbbb';
9602     }
9603 wakaba 1.18 }
9604     }
9605     }
9606     }
9607     @@XMLTest:
9608     @@@QName: xp.attval.reptxt.reptxt.ncr.1.test
9609     @@@DEnt:
9610     @@@@test:value:
9611     <!DOCTYPE e [
9612     <!ENTITY ent "&#38;#33;">
9613     <!ENTITY ent2 "&ent;">
9614     ]>
9615     <e a="&ent2;"/>
9616     @@@test:domTree:
9617     document {
9618     document-type { }
9619     element {
9620     attribute {
9621     node-name: 'a';
9622     general-entity-reference {
9623     node-name: 'ent2';
9624 wakaba 1.34 manakai-expanded: true;
9625 wakaba 1.18 general-entity-reference {
9626     node-name: 'ent';
9627     text-content: '!';
9628 wakaba 1.34 manakai-expanded: true;
9629 wakaba 1.18 }
9630     }
9631     }
9632     }
9633     }
9634     @@XMLTest:
9635     @@@QName: xp.attval.reptxt.reptxt.ncr.2.test
9636     @@@DEnt:
9637     @@@@test:value:
9638     <!DOCTYPE e [
9639     <!ENTITY ent "aa&#38;#33;bb">
9640     <!ENTITY ent2 "&ent;">
9641     ]>
9642     <e a="&ent2;"/>
9643     @@@test:domTree:
9644     document {
9645     document-type { }
9646     element {
9647     attribute {
9648     node-name: 'a';
9649     general-entity-reference {
9650     node-name: 'ent2';
9651 wakaba 1.34 manakai-expanded: true;
9652 wakaba 1.18 general-entity-reference {
9653     node-name: 'ent';
9654     text-content: 'aa!bb';
9655 wakaba 1.34 manakai-expanded: true;
9656 wakaba 1.18 }
9657     }
9658     }
9659     }
9660     }
9661    
9662     @@XMLTest:
9663     @@@QName: xp.element.content.hcr.1.test
9664     @@@DEnt:
9665     @@@@test:value:
9666     <e>&#x21;</e>
9667     @@@test:domTree:
9668     document {
9669     element {
9670     text-content: '!';
9671     }
9672     }
9673     @@XMLTest:
9674     @@@QName: xp.element.content.hcr.2.test
9675     @@@DEnt:
9676     @@@@test:value:
9677     <e>aaaa&#x21;bbbb</e>
9678     @@@test:domTree:
9679     document {
9680     element {
9681     text-content: 'aaaa!bbbb';
9682 wakaba 1.31 text {
9683     text-content: 'aaaa!bbbb';
9684     }
9685 wakaba 1.18 }
9686     }
9687     @@XMLTest:
9688     @@@QName: xp.attrval.hcr.1.test
9689     @@@DEnt:
9690     @@@@test:value:
9691     <e a="&#x21;"/>
9692     @@@test:domTree:
9693     document {
9694     element {
9695     attribute {
9696     node-name: 'a';
9697     text-content: '!';
9698     }
9699     }
9700     }
9701     @@XMLTest:
9702     @@@QName: xp.attrval.hcr.2.test
9703     @@@DEnt:
9704     @@@@test:value:
9705     <e a="aaaaa&#x21;bbbbb"/>
9706     @@@test:domTree:
9707     document {
9708     element {
9709     attribute {
9710     node-name: 'a';
9711     text-content: 'aaaaa!bbbbb';
9712 wakaba 1.31 text {
9713     text-content: 'aaaaa!bbbbb';
9714     }
9715 wakaba 1.18 }
9716     }
9717     }
9718     @@XMLTest:
9719     @@@QName: xp.attrval.hcr.3.test
9720     @@@DEnt:
9721     @@@@test:value:
9722     <e a='&#x21;'/>
9723     @@@test:domTree:
9724     document {
9725     element {
9726     attribute {
9727     node-name: 'a';
9728     text-content: '!';
9729     }
9730     }
9731     }
9732     @@XMLTest:
9733     @@@QName: xp.attrval.hcr.4.test
9734     @@@DEnt:
9735     @@@@test:value:
9736     <e a='aaaaa&#x21;bbbbb'/>
9737     @@@test:domTree:
9738     document {
9739     element {
9740     attribute {
9741     node-name: 'a';
9742     text-content: 'aaaaa!bbbbb';
9743     }
9744     }
9745     }
9746     @@XMLTest:
9747     @@@QName: xp.entval.hcr.1.test
9748     @@@DEnt:
9749     @@@@test:value:
9750     <!DOCTYPE e [
9751     <!ENTITY ent "&#x21;">
9752     ]>
9753     <e/>
9754 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
9755 wakaba 1.18 @@@test:domTree:
9756     document {
9757     document-type {
9758     general-entity {
9759     node-name: 'ent';
9760     text-content: '!';
9761 wakaba 1.10 }
9762 wakaba 1.9 }
9763 wakaba 1.18 element { }
9764 wakaba 1.9 }
9765     @@XMLTest:
9766 wakaba 1.18 @@@QName: xp.entval.hcr.2.test
9767 wakaba 1.9 @@@DEnt:
9768     @@@@test:value:
9769 wakaba 1.18 <!DOCTYPE e [
9770     <!ENTITY ent "aaaaa&#x21;bbbbb">
9771     ]>
9772     <e/>
9773 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
9774 wakaba 1.9 @@@test:domTree:
9775     document {
9776 wakaba 1.18 document-type {
9777     general-entity {
9778     node-name: 'ent';
9779     text-content: 'aaaaa!bbbbb';
9780 wakaba 1.31 text {
9781     text-content: 'aaaaa!bbbbb';
9782     }
9783 wakaba 1.9 }
9784     }
9785 wakaba 1.18 element { }
9786 wakaba 1.9 }
9787     @@XMLTest:
9788 wakaba 1.18 @@@QName: xp.element.content.reptxt.hcr.1.test
9789 wakaba 1.9 @@@DEnt:
9790     @@@@test:value:
9791 wakaba 1.18 <!DOCTYPE e [
9792     <!ENTITY ent "&#38;#x21;">
9793 wakaba 1.9 ]>
9794 wakaba 1.18 <e>&ent;</e>
9795 wakaba 1.9 @@@test:domTree:
9796     document {
9797     document-type { }
9798     element {
9799 wakaba 1.18 general-entity-reference {
9800     node-name: 'ent';
9801     text-content: '!';
9802 wakaba 1.34 manakai-expanded: true;
9803 wakaba 1.9 }
9804     }
9805     }
9806     @@XMLTest:
9807 wakaba 1.18 @@@QName: xp.element.content.reptxt.hcr.2.test
9808 wakaba 1.9 @@@DEnt:
9809     @@@@test:value:
9810 wakaba 1.18 <!DOCTYPE e [
9811     <!ENTITY ent "aaaaa&#38;#x21;bbbbb">
9812 wakaba 1.9 ]>
9813 wakaba 1.18 <e>&ent;</e>
9814 wakaba 1.9 @@@test:domTree:
9815     document {
9816     document-type { }
9817     element {
9818 wakaba 1.18 general-entity-reference {
9819     node-name: 'ent';
9820     text-content: 'aaaaa!bbbbb';
9821 wakaba 1.34 manakai-expanded: true;
9822 wakaba 1.9 }
9823     }
9824     }
9825     @@XMLTest:
9826 wakaba 1.18 @@@QName: xp.element.content.reptxt.reptxt.hcr.1.test
9827 wakaba 1.9 @@@DEnt:
9828     @@@@test:value:
9829 wakaba 1.18 <!DOCTYPE e [
9830     <!ENTITY ent "&#38;#x21;">
9831     <!ENTITY ent2 "&ent;">
9832     ]>
9833     <e>&ent2;</e>
9834 wakaba 1.9 @@@test:domTree:
9835     document {
9836 wakaba 1.18 document-type { }
9837 wakaba 1.9 element {
9838 wakaba 1.18 general-entity-reference {
9839     node-name: 'ent2';
9840 wakaba 1.34 manakai-expanded: true;
9841 wakaba 1.18 general-entity-reference {
9842     node-name: 'ent';
9843     text-content: '!';
9844 wakaba 1.34 manakai-expanded: true;
9845 wakaba 1.18 }
9846 wakaba 1.9 }
9847     }
9848     }
9849     @@XMLTest:
9850 wakaba 1.18 @@@QName: xp.element.content.reptxt.reptxt.hcr.2.test
9851 wakaba 1.9 @@@DEnt:
9852     @@@@test:value:
9853 wakaba 1.18 <!DOCTYPE e [
9854     <!ENTITY ent "aa&#38;#x21;bb">
9855     <!ENTITY ent2 "&ent;">
9856     ]>
9857     <e>&ent2;</e>
9858 wakaba 1.9 @@@test:domTree:
9859     document {
9860 wakaba 1.18 document-type { }
9861 wakaba 1.9 element {
9862 wakaba 1.18 general-entity-reference {
9863     node-name: 'ent2';
9864 wakaba 1.34 manakai-expanded: true;
9865 wakaba 1.18 general-entity-reference {
9866     node-name: 'ent';
9867 wakaba 1.34 manakai-expanded: true;
9868 wakaba 1.18 text-content: 'aa!bb';
9869     }
9870 wakaba 1.9 }
9871     }
9872     }
9873     @@XMLTest:
9874 wakaba 1.18 @@@QName: xp.attval.reptxt.hcr.1.test
9875 wakaba 1.9 @@@DEnt:
9876     @@@@test:value:
9877 wakaba 1.18 <!DOCTYPE e [
9878     <!ENTITY ent "&#38;#x21;">
9879     ]>
9880     <e a="&ent;"/>
9881 wakaba 1.9 @@@test:domTree:
9882     document {
9883 wakaba 1.18 document-type { }
9884 wakaba 1.9 element {
9885     attribute {
9886 wakaba 1.18 node-name: 'a';
9887     general-entity-reference {
9888     node-name: 'ent';
9889 wakaba 1.34 manakai-expanded: true;
9890 wakaba 1.18 text-content: '!';
9891     }
9892 wakaba 1.10 }
9893     }
9894     }
9895     @@XMLTest:
9896 wakaba 1.18 @@@QName: xp.attval.reptxt.hcr.2.test
9897 wakaba 1.10 @@@DEnt:
9898     @@@@test:value:
9899 wakaba 1.18 <!DOCTYPE e [
9900     <!ENTITY ent "aaaaa&#38;#x21;bbbbb">
9901 wakaba 1.10 ]>
9902 wakaba 1.18 <e a="&ent;"/>
9903 wakaba 1.10 @@@test:domTree:
9904     document {
9905     document-type { }
9906     element {
9907     attribute {
9908 wakaba 1.18 node-name: 'a';
9909     general-entity-reference {
9910     node-name: 'ent';
9911 wakaba 1.34 manakai-expanded: true;
9912 wakaba 1.18 text-content: 'aaaaa!bbbbb';
9913 wakaba 1.31 text {
9914     text-content: 'aaaaa!bbbbb';
9915     }
9916 wakaba 1.18 }
9917 wakaba 1.10 }
9918     }
9919     }
9920     @@XMLTest:
9921 wakaba 1.18 @@@QName: xp.attval.reptxt.reptxt.hcr.1.test
9922 wakaba 1.10 @@@DEnt:
9923     @@@@test:value:
9924 wakaba 1.18 <!DOCTYPE e [
9925     <!ENTITY ent "&#38;#x21;">
9926     <!ENTITY ent2 "&ent;">
9927 wakaba 1.10 ]>
9928 wakaba 1.18 <e a="&ent2;"/>
9929 wakaba 1.10 @@@test:domTree:
9930     document {
9931     document-type { }
9932     element {
9933     attribute {
9934 wakaba 1.18 node-name: 'a';
9935     general-entity-reference {
9936     node-name: 'ent2';
9937 wakaba 1.34 manakai-expanded: true;
9938 wakaba 1.18 general-entity-reference {
9939     node-name: 'ent';
9940 wakaba 1.34 manakai-expanded: true;
9941 wakaba 1.18 text-content: '!';
9942     }
9943     }
9944 wakaba 1.10 }
9945     }
9946     }
9947     @@XMLTest:
9948 wakaba 1.18 @@@QName: xp.attval.reptxt.reptxt.hcr.2.test
9949 wakaba 1.10 @@@DEnt:
9950     @@@@test:value:
9951 wakaba 1.18 <!DOCTYPE e [
9952     <!ENTITY ent "aa&#38;#x21;bb">
9953     <!ENTITY ent2 "&ent;">
9954 wakaba 1.10 ]>
9955 wakaba 1.18 <e a="&ent2;"/>
9956 wakaba 1.10 @@@test:domTree:
9957     document {
9958     document-type { }
9959     element {
9960     attribute {
9961 wakaba 1.18 node-name: 'a';
9962     general-entity-reference {
9963     node-name: 'ent2';
9964 wakaba 1.34 manakai-expanded: true;
9965 wakaba 1.18 general-entity-reference {
9966     node-name: 'ent';
9967 wakaba 1.34 manakai-expanded: true;
9968 wakaba 1.18 text-content: 'aa!bb';
9969     }
9970     }
9971 wakaba 1.11 }
9972     }
9973     }
9974    
9975     @@XMLTest:
9976 wakaba 1.18 @@@QName: xp.element.content.ncr.legal.char.1.0.1.test
9977     @@@DEnt:
9978     @@@@test:value:
9979     <?xml version="1.0"?>
9980     <e>&#0;</e>
9981 wakaba 1.48 @@@c:erred: <[xp|wf-legal-character]> { (2, 4)..(2, 7); }
9982 wakaba 1.18 @@XMLTest:
9983     @@@QName: xp.element.content.ncr.legal.char.1.1.1.test
9984     @@@DEnt:
9985     @@@@test:value:
9986     <?xml version="1.1"?>
9987     <e>&#0;</e>
9988 wakaba 1.48 @@@c:erred: <[xp|wf-legal-character]> { (2, 4)..(2, 7); }
9989 wakaba 1.18 @@XMLTest:
9990     @@@QName: xp.element.content.ncr.legal.char.1.0.2.test
9991     @@@DEnt:
9992     @@@@test:value:
9993     <?xml version="1.0"?>
9994     <e>&#1;</e>
9995 wakaba 1.48 @@@c:erred: <[xp|wf-legal-character]> { (2, 4)..(2, 7); }
9996 wakaba 1.18 @@XMLTest:
9997     @@@QName: xp.element.content.ncr.legal.char.1.1.2.test
9998 wakaba 1.11 @@@DEnt:
9999     @@@@test:value:
10000 wakaba 1.18 <?xml version="1.1"?>
10001     <e>&#1;</e>
10002 wakaba 1.11 @@@test:domTree:
10003     document {
10004 wakaba 1.18 xml-version: '1.1';
10005 wakaba 1.11 element {
10006 wakaba 1.18 text-content: U+0001;
10007 wakaba 1.11 }
10008     }
10009     @@XMLTest:
10010 wakaba 1.18 @@@QName: xp.element.content.hcr.legal.char.1.0.1.test
10011     @@@DEnt:
10012     @@@@test:value:
10013     <?xml version="1.0"?>
10014     <e>&#x0;</e>
10015 wakaba 1.48 @@@c:erred: <[xp|wf-legal-character]> { (2, 4)..(2, 8); }
10016 wakaba 1.18 @@XMLTest:
10017     @@@QName: xp.element.content.hcr.legal.char.1.1.1.test
10018     @@@DEnt:
10019     @@@@test:value:
10020     <?xml version="1.1"?>
10021     <e>&#x0;</e>
10022 wakaba 1.48 @@@c:erred: <[xp|wf-legal-character]> { (2, 4)..(2, 8); }
10023 wakaba 1.18 @@XMLTest:
10024     @@@QName: xp.element.content.hcr.legal.char.1.0.2.test
10025 wakaba 1.11 @@@DEnt:
10026     @@@@test:value:
10027 wakaba 1.18 <?xml version="1.0"?>
10028     <e>&#x1;</e>
10029 wakaba 1.48 @@@c:erred: <[xp|wf-legal-character]> { (2, 4)..(2, 8); }
10030 wakaba 1.11 @@XMLTest:
10031 wakaba 1.18 @@@QName: xp.element.content.hcr.legal.char.1.1.2.test
10032 wakaba 1.11 @@@DEnt:
10033     @@@@test:value:
10034 wakaba 1.18 <?xml version="1.1"?>
10035     <e>&#x1;</e>
10036 wakaba 1.11 @@@test:domTree:
10037     document {
10038 wakaba 1.18 xml-version: '1.1';
10039 wakaba 1.11 element {
10040 wakaba 1.18 text-content: U+0001;
10041 wakaba 1.6 }
10042     }
10043    
10044 wakaba 1.19 @@XMLTest:
10045     @@@QName: xp.element.content.ger.entity.declared.nodtd.1.test
10046     @@@DEnt:
10047     @@@@test:value:
10048     <p>&entity;</p>
10049 wakaba 1.48 @@@c:erred: <[xp|wf-entity-declared]> { (1, 4)..(1, 11); }
10050 wakaba 1.19 @@XMLTest:
10051     @@@QName: xp.element.content.ger.entity.declared.nodtd.2.test
10052     @@@DEnt:
10053     @@@@test:value:
10054     <?xml version="1.0" standalone="yes"?>
10055     <p>&entity;</p>
10056 wakaba 1.48 @@@c:erred: <[xp|wf-entity-declared]> { (2, 4)..(2, 11); }
10057 wakaba 1.19 @@XMLTest:
10058     @@@QName: xp.element.content.ger.entity.declared.nodtd.3.test
10059     @@@DEnt:
10060     @@@@test:value:
10061     <?xml version="1.0" standalone="no"?>
10062     <p>&entity;</p>
10063 wakaba 1.48 @@@c:erred: <[xp|wf-entity-declared]> { (2, 4)..(2, 11); }
10064 wakaba 1.19 @@XMLTest:
10065     @@@QName: xp.element.content.ger.entity.declared.nodtd.-1.test
10066     @@@DEnt:
10067     @@@@test:value:
10068     <p>&lt;&gt;&amp;&quot;&apos;</p>
10069     @@@test:domTree:
10070     document {
10071     element {
10072     text-content: '<>&"' U+0027;
10073     }
10074     }
10075     @@XMLTest:
10076     @@@QName: xp.element.content.ger.entity.declared.nopref.1.test
10077     @@@DEnt:
10078     @@@@test:value:
10079     <!DOCTYPE p []>
10080     <p>&entity;</p>
10081 wakaba 1.48 @@@c:erred: <[xp|wf-entity-declared]> { (2, 4)..(2, 11); }
10082 wakaba 1.19 @@XMLTest:
10083     @@@QName: xp.element.content.ger.entity.declared.nopref.2.test
10084     @@@DEnt:
10085     @@@@test:value:
10086     <!DOCTYPE p [
10087     <!ENTITY other "aa">
10088     <!ENTITY % another "aa">
10089     ]>
10090     <p>&entity;</p>
10091 wakaba 1.48 @@@c:erred: <[xp|wf-entity-declared]> { (5, 4)..(5, 11); }
10092 wakaba 1.19 @@XMLTest:
10093     @@@QName: xp.element.content.ger.entity.declared.nopref.3.test
10094     @@@DEnt:
10095     @@@@test:value:
10096     <?xml version="1.0" standalone="yes"?>
10097     <!DOCTYPE p []>
10098     <p>&entity;</p>
10099 wakaba 1.48 @@@c:erred: <[xp|wf-entity-declared]> { (3, 4)..(3, 11); }
10100 wakaba 1.19 @@XMLTest:
10101     @@@QName: xp.element.content.ger.entity.declared.nopref.4.test
10102     @@@DEnt:
10103     @@@@test:value:
10104     <?xml version="1.0" standalone="no"?>
10105     <!DOCTYPE p []>
10106     <p>&entity;</p>
10107 wakaba 1.48 @@@c:erred: <[xp|wf-entity-declared]> { (3, 4)..(3, 11); }
10108 wakaba 1.19 @@XMLTest:
10109     @@@QName: xp.element.content.ger.entity.declared.nopref.5.test
10110     @@@DEnt:
10111     @@@@test:value:
10112     <?xml version="1.0" standalone="yes"?>
10113     <!DOCTYPE p [
10114     <!ENTITY other "aa">
10115     <!ENTITY % another "aa">
10116     ]>
10117     <p>&entity;</p>
10118 wakaba 1.48 @@@c:erred: <[xp|wf-entity-declared]> { (6, 4)..(6, 11); }
10119 wakaba 1.19 @@XMLTest:
10120     @@@QName: xp.element.content.ger.entity.declared.nopref.6.test
10121     @@@DEnt:
10122     @@@@test:value:
10123     <?xml version="1.0" standalone="no"?>
10124     <!DOCTYPE p [
10125     <!ENTITY other "aa">
10126     <!ENTITY % another "aa">
10127     ]>
10128     <p>&entity;</p>
10129 wakaba 1.48 @@@c:erred: <[xp|wf-entity-declared]> { (6, 4)..(6, 11); }
10130 wakaba 1.19 @@XMLTest:
10131     @@@QName: xp.element.content.ger.entity.declared.nopref.-1.test
10132     @@@DEnt:
10133     @@@@test:value:
10134     <!DOCTYPE p [
10135     <!ENTITY entity "value">
10136     ]>
10137     <p>&entity;</p>
10138 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
10139 wakaba 1.19 @@@test:domTree:
10140     document {
10141     document-type {
10142     general-entity {
10143     node-name: 'entity';
10144     text-content: 'value';
10145     }
10146     }
10147     element {
10148 wakaba 1.20 general-entity-reference {
10149 wakaba 1.19 node-name: 'entity';
10150 wakaba 1.34 manakai-expanded: true;
10151 wakaba 1.19 text-content: 'value';
10152     }
10153     }
10154     }
10155     @@XMLTest:
10156     @@@QName: xp.element.content.ger.entity.declared.nopref.-2.test
10157     @@@DEnt:
10158     @@@@test:value:
10159     <!DOCTYPE p [
10160     <!ENTITY entity "value">
10161     <!ENTITY another SYSTEM "another">
10162     ]>
10163     <p>&entity;</p>
10164 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
10165 wakaba 1.19 @@@test:domTree:
10166     document {
10167     document-type {
10168     general-entity {
10169     node-name: 'entity';
10170     text-content: 'value';
10171     }
10172 wakaba 1.20 general-entity {
10173     node-name: 'another';
10174     public-id: null;
10175     system-id: 'another';
10176     }
10177 wakaba 1.19 }
10178     element {
10179 wakaba 1.20 general-entity-reference {
10180 wakaba 1.19 node-name: 'entity';
10181 wakaba 1.34 manakai-expanded: true;
10182 wakaba 1.19 text-content: 'value';
10183     }
10184     }
10185     }
10186     @@XMLTest:
10187     @@@QName: xp.element.content.ger.entity.declared.standalone.1.test
10188     @@@DEnt:
10189     @@@@test:value:
10190     <?xml version="1.0" standalone="yes"?>
10191     <p>&entity;</p>
10192 wakaba 1.48 @@@c:erred: <[xp|wf-entity-declared]> { (2, 4)..(2, 11); }
10193 wakaba 1.19 @@XMLTest:
10194     @@@QName: xp.element.content.ger.entity.declared.standalone.2.test
10195     @@@DEnt:
10196     @@@@test:value:
10197     <?xml version="1.0" standalone="yes"?>
10198     <!DOCTYPE p []>
10199     <p>&entity;</p>
10200 wakaba 1.48 @@@c:erred: <[xp|wf-entity-declared]> { (3, 4)..(3, 11); }
10201 wakaba 1.19 @@XMLTest:
10202     @@@QName: xp.element.content.ger.entity.declared.standalone.3.test
10203     @@@DEnt:
10204     @@@@test:value:
10205     <?xml version="1.0" standalone="yes"?>
10206     <!DOCTYPE p [
10207     <!ENTITY % para "<!-- -->">
10208     %para;
10209     ]>
10210     <p>&entity;</p>
10211 wakaba 1.48 @@@c:erred: <[xp|wf-entity-declared]> { (6, 4)..(6, 11); }
10212 wakaba 1.19 @@XMLTest:
10213     @@@QName: xp.element.content.ger.entity.declared.standalone.-1.test
10214     @@@DEnt:
10215     @@@@test:value:
10216     <?xml version="1.0" standalone="no"?>
10217     <!DOCTYPE p [
10218     <!ENTITY % para "<!-- -->">
10219     %para;
10220     ]>
10221     <p>&entity;</p>
10222     @@@test:domTree:
10223     document {
10224     document-type { }
10225     element {
10226     general-entity-reference {
10227 wakaba 1.34 manakai-expanded: false;
10228 wakaba 1.19 }
10229     }
10230     }
10231     @@XMLTest:
10232     @@@QName: xp.element.content.ger.entity.declared.standalone.-2.test
10233     @@@DEnt:
10234     @@@@test:value:
10235     <!DOCTYPE p [
10236     <!ENTITY % para "<!-- -->">
10237     %para;
10238     ]>
10239     <p>&entity;</p>
10240     @@@test:domTree:
10241     document {
10242     document-type { }
10243     element {
10244     general-entity-reference {
10245 wakaba 1.34 manakai-expanded: false;
10246 wakaba 1.19 }
10247     }
10248     }
10249     @@XMLTest:
10250     @@@QName: xp.element.content.ger.entity.declared.standalone.4.test
10251     @@@DEnt:
10252     @@@@test:value:
10253     <?xml version="1.0" standalone="yes"?>
10254     <!DOCTYPE p [
10255     <!ENTITY % para SYSTEM "para">
10256     %para;
10257     ]>
10258     <p>&entity;</p>
10259 wakaba 1.48 @@@c:erred: <[xp|wf-entity-declared]> { (6, 4)..(6, 11); }
10260 wakaba 1.19 @@XMLTest:
10261     @@@QName: xp.element.content.ger.entity.declared.standalone.-3.test
10262     @@@DEnt:
10263     @@@@test:value:
10264     <?xml version="1.0" standalone="no"?>
10265     <!DOCTYPE p [
10266     <!ENTITY % para SYSTEM "para">
10267     %para;
10268     ]>
10269     <p>&entity;</p>
10270     @@@test:domTree:
10271     document {
10272     document-type { }
10273     element {
10274     general-entity-reference {
10275 wakaba 1.34 manakai-expanded: false;
10276 wakaba 1.19 }
10277     }
10278     }
10279     @@XMLTest:
10280     @@@QName: xp.element.content.ger.entity.declared.standalone.-4.test
10281     @@@DEnt:
10282     @@@@test:value:
10283     <!DOCTYPE p [
10284     <!ENTITY % para SYSTEM "para">
10285     %para;
10286     ]>
10287     <p>&entity;</p>
10288     @@@test:domTree:
10289     document {
10290     document-type { }
10291     element {
10292     general-entity-reference {
10293 wakaba 1.34 manakai-expanded: false;
10294 wakaba 1.19 }
10295     }
10296     }
10297     @@XMLTest:
10298     @@@QName: xp.element.content.ger.entity.declared.standalone.5.test
10299     @@@DEnt:
10300     @@@@test:value:
10301     <?xml version="1.0" standalone="yes"?>
10302     <!DOCTYPE p SYSTEM "dtd">
10303     <p>&entity;</p>
10304 wakaba 1.48 @@@c:erred: <[xp|wf-entity-declared]> { (3, 4)..(3, 11); }
10305 wakaba 1.19 @@XMLTest:
10306     @@@QName: xp.element.content.ger.entity.declared.standalone.-5.test
10307     @@@DEnt:
10308     @@@@test:value:
10309     <?xml version="1.0" standalone="no"?>
10310     <!DOCTYPE p SYSTEM "dtd">
10311     <p>&entity;</p>
10312     @@@test:domTree:
10313     document {
10314     document-type { }
10315     element {
10316     general-entity-reference {
10317 wakaba 1.34 manakai-expanded: false;
10318 wakaba 1.19 }
10319     }
10320     }
10321     @@XMLTest:
10322     @@@QName: xp.element.content.ger.entity.declared.standalone.-6.test
10323     @@@DEnt:
10324     @@@@test:value:
10325     <!DOCTYPE p SYSTEM "dtd">
10326     <p>&entity;</p>
10327     @@@test:domTree:
10328     document {
10329     document-type { }
10330     element {
10331     general-entity-reference {
10332 wakaba 1.34 manakai-expanded: false;
10333 wakaba 1.19 }
10334     }
10335     }
10336    
10337 wakaba 1.20 @@XMLTest:
10338     @@@QName: xp.reptxt.element.content.ger.entity.declared.nopref.1.test
10339     @@@DEnt:
10340     @@@@test:value:
10341     <!DOCTYPE p [
10342     <!ENTITY c "&entity;">
10343     ]>
10344     <p>&c;</p>
10345 wakaba 1.48 @@@c:erred: <[xp|wf-entity-declared]> { (1, 1)..(1, 8); }
10346 wakaba 1.20 @@XMLTest:
10347     @@@QName: xp.reptxt.element.content.ger.entity.declared.nopref.2.test
10348     @@@DEnt:
10349     @@@@test:value:
10350     <!DOCTYPE p [
10351     <!ENTITY other "aa">
10352     <!ENTITY % another "aa">
10353     <!ENTITY c "&entity;">
10354     ]>
10355     <p>&c;</p>
10356 wakaba 1.48 @@@c:erred: <[xp|wf-entity-declared]> { (1, 1)..(1, 8); }
10357 wakaba 1.20 @@XMLTest:
10358     @@@QName: xp.reptxt.element.content.ger.entity.declared.nopref.3.test
10359     @@@DEnt:
10360     @@@@test:value:
10361     <?xml version="1.0" standalone="yes"?>
10362     <!DOCTYPE p [
10363     <!ENTITY c "&entity;">
10364     ]>
10365     <p>&c;</p>
10366 wakaba 1.48 @@@c:erred: <[xp|wf-entity-declared]> { (1, 1)..(1, 8); }
10367 wakaba 1.20 @@XMLTest:
10368     @@@QName: xp.reptxt.element.content.ger.entity.declared.nopref.4.test
10369     @@@DEnt:
10370     @@@@test:value:
10371     <?xml version="1.0" standalone="no"?>
10372     <!DOCTYPE p [
10373     <!ENTITY c "&entity;">
10374     ]>
10375     <p>&c;</p>
10376 wakaba 1.48 @@@c:erred: <[xp|wf-entity-declared]> { (1, 1)..(1, 8); }
10377 wakaba 1.20 @@XMLTest:
10378     @@@QName: xp.reptxt.element.content.ger.entity.declared.nopref.5.test
10379     @@@DEnt:
10380     @@@@test:value:
10381     <?xml version="1.0" standalone="yes"?>
10382     <!DOCTYPE p [
10383     <!ENTITY other "aa">
10384     <!ENTITY % another "aa">
10385     <!ENTITY c "&entity;">
10386     ]>
10387     <p>&c;</p>
10388 wakaba 1.48 @@@c:erred: <[xp|wf-entity-declared]> { (1, 1)..(1, 8); }
10389 wakaba 1.20 @@XMLTest:
10390     @@@QName: xp.reptxt.element.content.ger.entity.declared.nopref.6.test
10391     @@@DEnt:
10392     @@@@test:value:
10393     <?xml version="1.0" standalone="no"?>
10394     <!DOCTYPE p [
10395     <!ENTITY other "aa">
10396     <!ENTITY % another "aa">
10397     <!ENTITY c "&entity;">
10398     ]>
10399     <p>&c;</p>
10400 wakaba 1.48 @@@c:erred: <[xp|wf-entity-declared]> { (1, 1)..(1, 8); }
10401 wakaba 1.20 @@XMLTest:
10402     @@@QName: xp.reptxt.element.content.ger.entity.declared.nopref.-1.test
10403     @@@DEnt:
10404     @@@@test:value:
10405     <!DOCTYPE p [
10406     <!ENTITY entity "value">
10407     <!ENTITY c "&entity;">
10408     ]>
10409     <p>&c;</p>
10410 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
10411 wakaba 1.20 @@@test:domTree:
10412     document {
10413     document-type {
10414     general-entity {
10415     node-name: 'entity';
10416     text-content: 'value';
10417     }
10418     general-entity {
10419     node-name: 'c';
10420     general-entity-reference {
10421     node-name: 'entity';
10422     text-content: 'value';
10423     }
10424     }
10425     }
10426     element {
10427     general-entity-reference {
10428     node-name: 'c';
10429     general-entity-reference {
10430     node-name: 'entity';
10431     text-content: 'value';
10432     }
10433     }
10434     }
10435     }
10436     @@XMLTest:
10437     @@@QName: xp.reptxt.element.content.ger.entity.declared.nopref.-2.test
10438     @@@DEnt:
10439     @@@@test:value:
10440     <!DOCTYPE p [
10441     <!ENTITY entity "value">
10442     <!ENTITY another SYSTEM "another">
10443     <!ENTITY c "&entity;">
10444     ]>
10445     <p>&c;</p>
10446 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
10447 wakaba 1.20 @@@test:domTree:
10448     document {
10449     document-type {
10450     general-entity {
10451     node-name: 'entity';
10452     text-content: 'value';
10453     }
10454     general-entity {
10455     node-name: 'c';
10456     general-entity-reference {
10457     node-name: 'entity';
10458 wakaba 1.34 manakai-expanded: true;
10459 wakaba 1.20 text-content: 'value';
10460     }
10461     }
10462     general-entity {
10463     node-name: 'another';
10464     public-id: null;
10465     system-id: 'another';
10466     has-replacement-tree: false;
10467     }
10468     }
10469     element {
10470     general-entity-reference {
10471     node-name: 'c';
10472 wakaba 1.34 manakai-expanded: true;
10473 wakaba 1.20 general-entity-reference {
10474     node-name: 'entity';
10475 wakaba 1.34 manakai-expanded: true;
10476 wakaba 1.20 text-content: 'value';
10477     }
10478     }
10479     }
10480     }
10481     @@XMLTest:
10482     @@@QName: xp.reptxt.element.content.ger.entity.declared.standalone.2.test
10483     @@@DEnt:
10484     @@@@test:value:
10485     <?xml version="1.0" standalone="yes"?>
10486     <!DOCTYPE p [
10487     <!ENTITY c "&entity;">
10488     ]>
10489     <p>&c;</p>
10490 wakaba 1.48 @@@c:erred: <[xp|wf-entity-declared]> { (1, 1)..(1, 8); }
10491 wakaba 1.20 @@XMLTest:
10492     @@@QName: xp.reptxt.element.content.ger.entity.declared.standalone.3.test
10493     @@@DEnt:
10494     @@@@test:value:
10495     <?xml version="1.0" standalone="yes"?>
10496     <!DOCTYPE p [
10497     <!ENTITY % para "<!-- -->">
10498     %para;
10499     <!ENTITY c "&entity;">
10500     ]>
10501     <p>&c;</p>
10502 wakaba 1.48 @@@c:erred: <[xp|wf-entity-declared]> { (1, 1)..(1, 8); }
10503 wakaba 1.20 @@XMLTest:
10504     @@@QName: xp.reptxt.element.content.ger.entity.declared.standalone.-1.test
10505     @@@DEnt:
10506     @@@@test:value:
10507     <?xml version="1.0" standalone="no"?>
10508     <!DOCTYPE p [
10509     <!ENTITY c "&entity;">
10510     <!ENTITY % para "<!-- -->">
10511     %para;
10512     ]>
10513     <p>&c;</p>
10514 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
10515 wakaba 1.20 @@@test:domTree:
10516     document {
10517     document-type {
10518     general-entity {
10519     node-name: 'c';
10520     general-entity-reference {
10521     node-name: 'entity';
10522 wakaba 1.34 manakai-expanded: false;
10523 wakaba 1.20 }
10524     }
10525     }
10526     element {
10527     general-entity-reference {
10528     node-name: 'c';
10529     general-entity-reference {
10530     node-name: 'entity';
10531 wakaba 1.34 manakai-expanded: false;
10532 wakaba 1.20 }
10533     }
10534     }
10535     }
10536     @@XMLTest:
10537     @@@QName:
10538     xp.reptxt.element.content.ger.entity.declared.standalone.-1.2.test
10539     @@@DEnt:
10540     @@@@test:value:
10541     <?xml version="1.0" standalone="no"?>
10542     <!DOCTYPE p [
10543     <!ENTITY % para "<!-- -->">
10544     %para;
10545     <!ENTITY c "&entity;">
10546     ]>
10547     <p>&c;</p>
10548     @@@test:domTree:
10549     document {
10550     document-type { }
10551     element {
10552     general-entity-reference {
10553     node-name: 'c';
10554 wakaba 1.34 manakai-expanded: false;
10555 wakaba 1.20 }
10556     }
10557     }
10558     @@XMLTest:
10559     @@@QName: xp.reptxt.element.content.ger.entity.declared.standalone.-2.test
10560     @@@DEnt:
10561     @@@@test:value:
10562     <!DOCTYPE p [
10563     <!ENTITY c "&entity;">
10564     <!ENTITY % para "<!-- -->">
10565     %para;
10566     ]>
10567     <p>&c;</p>
10568     @@@test:domTree:
10569     document {
10570     document-type { }
10571     element {
10572     general-entity-reference {
10573     node-name: 'c';
10574 wakaba 1.34 manakai-expanded: true;
10575 wakaba 1.20 general-entity-reference {
10576     node-name: 'entity';
10577 wakaba 1.34 manakai-expanded: false;
10578 wakaba 1.20 }
10579     }
10580     }
10581     }
10582     @@XMLTest:
10583     @@@QName:
10584     xp.reptxt.element.content.ger.entity.declared.standalone.-2.2.test
10585     @@@DEnt:
10586     @@@@test:value:
10587     <!DOCTYPE p [
10588     <!ENTITY % para "<!-- -->">
10589     %para;
10590     <!ENTITY c "&entity;">
10591     ]>
10592     <p>&c;</p>
10593     @@@test:domTree:
10594     document {
10595     document-type { }
10596     element {
10597     general-entity-reference {
10598     node-name: 'c';
10599 wakaba 1.34 manakai-expanded: false;
10600 wakaba 1.20 }
10601     }
10602     }
10603     @@XMLTest:
10604     @@@QName: xp.reptxt.element.content.ger.entity.declared.standalone.4.test
10605     @@@DEnt:
10606     @@@@test:value:
10607     <?xml version="1.0" standalone="yes"?>
10608     <!DOCTYPE p [
10609     <!ENTITY % para SYSTEM "para">
10610     %para;
10611     <!ENTITY c "&entity;">
10612     ]>
10613     <p>&c;</p>
10614 wakaba 1.48 @@@c:erred: <[xp|wf-entity-declared]> { (1, 1)..(1, 8); }
10615 wakaba 1.20 @@XMLTest:
10616     @@@QName: xp.reptxt.element.content.ger.entity.declared.standalone.-3.test
10617     @@@DEnt:
10618     @@@@test:value:
10619     <?xml version="1.0" standalone="no"?>
10620     <!DOCTYPE p [
10621     <!ENTITY c "&entity;">
10622     <!ENTITY % para SYSTEM "para">
10623     %para;
10624     ]>
10625     <p>&c;</p>
10626     @@@test:domTree:
10627     document {
10628     document-type { }
10629     element {
10630     general-entity-reference {
10631     node-name: 'c';
10632 wakaba 1.34 manakai-expanded: true;
10633 wakaba 1.20 general-entity-reference {
10634     node-name: 'entity';
10635 wakaba 1.34 manakai-expanded: false;
10636 wakaba 1.20 }
10637     }
10638     }
10639     }
10640     @@XMLTest:
10641     @@@QName:
10642     xp.reptxt.element.content.ger.entity.declared.standalone.-3.2.test
10643     @@@DEnt:
10644     @@@@test:value:
10645     <?xml version="1.0" standalone="no"?>
10646     <!DOCTYPE p [
10647     <!ENTITY % para SYSTEM "para">
10648     %para;
10649     <!ENTITY c "&entity;">
10650     ]>
10651     <p>&c;</p>
10652     @@@test:domTree:
10653     document {
10654     document-type { }
10655     element {
10656     general-entity-reference {
10657     node-name: 'c';
10658 wakaba 1.34 manakai-expanded: false;
10659 wakaba 1.20 }
10660     }
10661     }
10662     @@XMLTest:
10663     @@@QName: xp.reptxt.element.content.ger.entity.declared.standalone.-4.test
10664     @@@DEnt:
10665     @@@@test:value:
10666     <!DOCTYPE p [
10667     <!ENTITY c "&entity;">
10668     <!ENTITY % para SYSTEM "para">
10669     %para;
10670     ]>
10671     <p>&c;</p>
10672     @@@test:domTree:
10673     document {
10674     document-type { }
10675     element {
10676     general-entity-reference {
10677     node-name: 'c';
10678 wakaba 1.34 manakai-expanded: true;
10679 wakaba 1.20 general-entity-reference {
10680     node-name: 'entity';
10681 wakaba 1.34 manakai-expanded: false;
10682 wakaba 1.20 }
10683     }
10684     }
10685     }
10686     @@XMLTest:
10687     @@@QName:
10688     xp.reptxt.element.content.ger.entity.declared.standalone.-4.2.test
10689     @@@DEnt:
10690     @@@@test:value:
10691     <!DOCTYPE p [
10692     <!ENTITY % para SYSTEM "para">
10693     %para;
10694     <!ENTITY c "&entity;">
10695     ]>
10696     <p>&c;</p>
10697     @@@test:domTree:
10698     document {
10699     document-type { }
10700     element {
10701     general-entity-reference {
10702     node-name: 'c';
10703 wakaba 1.34 manakai-expanded: false;
10704 wakaba 1.20 }
10705     }
10706     }
10707     @@XMLTest:
10708     @@@QName: xp.reptxt.element.content.ger.entity.declared.standalone.5.test
10709     @@@DEnt:
10710     @@@@test:value:
10711     <?xml version="1.0" standalone="yes"?>
10712     <!DOCTYPE p SYSTEM "dtd" [
10713     <!ENTITY c "&entity;">
10714     ]>
10715     <p>&c;</p>
10716 wakaba 1.48 @@@c:erred: <[xp|wf-entity-declared]> { (1, 1)..(1, 8); }
10717 wakaba 1.20 @@XMLTest:
10718     @@@QName: xp.reptxt.element.content.ger.entity.declared.standalone.-5.test
10719     @@@DEnt:
10720     @@@@test:value:
10721     <?xml version="1.0" standalone="no"?>
10722     <!DOCTYPE p SYSTEM "dtd" [
10723     <!ENTITY c "&entity;">
10724     ]>
10725     <p>&c;</p>
10726     @@@test:domTree:
10727     document {
10728     document-type { }
10729     element {
10730     general-entity-reference {
10731     node-name: 'c';
10732 wakaba 1.34 manakai-expanded: true;
10733 wakaba 1.20 general-entity-reference {
10734     node-name: 'entity';
10735 wakaba 1.34 manakai-expanded: false;
10736 wakaba 1.20 }
10737     }
10738     }
10739     }
10740     @@XMLTest:
10741     @@@QName: xp.reptxt.element.content.ger.entity.declared.standalone.-6.test
10742     @@@DEnt:
10743     @@@@test:value:
10744     <!DOCTYPE p SYSTEM "dtd" [<!ENTITY c "&entity;">]>
10745     <p>&c;</p>
10746     @@@test:domTree:
10747     document {
10748     document-type { }
10749     element {
10750     general-entity-reference {
10751     node-name: 'c';
10752 wakaba 1.34 manakai-expanded: true;
10753 wakaba 1.20 general-entity-reference {
10754     node-name: 'entity';
10755 wakaba 1.34 manakai-expanded: false;
10756 wakaba 1.20 }
10757     }
10758     }
10759     }
10760    
10761     @@XMLTest:
10762     @@@QName: xp.attval.ger.entity.declared.nodtd.1.test
10763     @@@DEnt:
10764     @@@@test:value:
10765     <p a="&entity;"/>
10766 wakaba 1.48 @@@c:erred: <[xp|wf-entity-declared]> { (1, 7)..(1, 14); }
10767 wakaba 1.20 @@XMLTest:
10768     @@@QName: xp.attval.ger.entity.declared.nodtd.2.test
10769     @@@DEnt:
10770     @@@@test:value:
10771     <?xml version="1.0" standalone="yes"?>
10772     <p a="&entity;"/>
10773 wakaba 1.48 @@@c:erred: <[xp|wf-entity-declared]> { (2, 7)..(2, 14); }
10774 wakaba 1.20 @@XMLTest:
10775     @@@QName: xp.attval.ger.entity.declared.nodtd.3.test
10776     @@@DEnt:
10777     @@@@test:value:
10778     <?xml version="1.0" standalone="no"?>
10779     <p a="&entity;"/>
10780 wakaba 1.48 @@@c:erred: <[xp|wf-entity-declared]> { (2, 7)..(2, 14); }
10781 wakaba 1.20 @@XMLTest:
10782     @@@QName: xp.attval.ger.entity.declared.nodtd.-1.test
10783     @@@DEnt:
10784     @@@@test:value:
10785     <p a="&lt;&gt;&amp;&quot;&apos;"/>
10786     @@@test:domTree:
10787     document {
10788     element {
10789     attribute {
10790     node-name: 'a';
10791     text-content: '<>&"' U+0027;
10792     }
10793     }
10794     }
10795     @@XMLTest:
10796     @@@QName: xp.attval.ger.entity.declared.nopref.1.test
10797     @@@DEnt:
10798     @@@@test:value:
10799     <!DOCTYPE p []>
10800     <p a="&entity;"/>
10801 wakaba 1.48 @@@c:erred: <[xp|wf-entity-declared]> { (2, 7)..(2, 14); }
10802 wakaba 1.20 @@XMLTest:
10803     @@@QName: xp.attval.ger.entity.declared.nopref.2.test
10804     @@@DEnt:
10805     @@@@test:value:
10806     <!DOCTYPE p [
10807     <!ENTITY other "aa">
10808     <!ENTITY % another "aa">
10809     ]>
10810     <p a="&entity;"/>
10811 wakaba 1.48 @@@c:erred: <[xp|wf-entity-declared]> { (5, 7)..(5, 14); }
10812 wakaba 1.20 @@XMLTest:
10813     @@@QName: xp.attval.ger.entity.declared.nopref.3.test
10814     @@@DEnt:
10815     @@@@test:value:
10816     <?xml version="1.0" standalone="yes"?>
10817     <!DOCTYPE p []>
10818     <p a="&entity;"/>
10819 wakaba 1.48 @@@c:erred: <[xp|wf-entity-declared]> { (3, 7)..(3, 14); }
10820 wakaba 1.20 @@XMLTest:
10821     @@@QName: xp.attval.ger.entity.declared.nopref.4.test
10822     @@@DEnt:
10823     @@@@test:value:
10824     <?xml version="1.0" standalone="no"?>
10825     <!DOCTYPE p []>
10826     <p a="&entity;"/>
10827 wakaba 1.48 @@@c:erred: <[xp|wf-entity-declared]> { (3, 7)..(3, 14); }
10828 wakaba 1.20 @@XMLTest:
10829     @@@QName: xp.attval.ger.entity.declared.nopref.5.test
10830     @@@DEnt:
10831     @@@@test:value:
10832     <?xml version="1.0" standalone="yes"?>
10833     <!DOCTYPE p [
10834     <!ENTITY other "aa">
10835     <!ENTITY % another "aa">
10836     ]>
10837     <p a="&entity;"/>
10838 wakaba 1.48 @@@c:erred: <[xp|wf-entity-declared]> { (6, 7)..(6, 14); }
10839 wakaba 1.20 @@XMLTest:
10840     @@@QName: xp.attval.ger.entity.declared.nopref.6.test
10841     @@@DEnt:
10842     @@@@test:value:
10843     <?xml version="1.0" standalone="no"?>
10844     <!DOCTYPE p [
10845     <!ENTITY other "aa">
10846     <!ENTITY % another "aa">
10847     ]>
10848     <p a="&entity;"/>
10849 wakaba 1.48 @@@c:erred: <[xp|wf-entity-declared]> { (6, 7)..(6, 14); }
10850 wakaba 1.20 @@XMLTest:
10851     @@@QName: xp.attval.ger.entity.declared.nopref.-1.test
10852     @@@DEnt:
10853     @@@@test:value:
10854     <!DOCTYPE p [
10855     <!ENTITY entity "value">
10856     ]>
10857     <p a="&entity;"/>
10858 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
10859 wakaba 1.20 @@@test:domTree:
10860     document {
10861     document-type {
10862     general-entity {
10863     node-name: 'entity';
10864     text-content: 'value';
10865     }
10866     }
10867     element {
10868     attribute {
10869     node-name: 'a';
10870     general-entity-reference {
10871     node-name: 'entity';
10872 wakaba 1.34 manakai-expanded: true;
10873 wakaba 1.20 text-content: 'value';
10874     }
10875     }
10876     }
10877     }
10878     @@XMLTest:
10879     @@@QName: xp.attval.ger.entity.declared.nopref.-2.test
10880     @@@DEnt:
10881     @@@@test:value:
10882     <!DOCTYPE p [
10883     <!ENTITY entity "value">
10884     <!ENTITY another SYSTEM "another">
10885     ]>
10886     <p a="&entity;"/>
10887 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
10888 wakaba 1.20 @@@test:domTree:
10889     document {
10890     document-type {
10891     general-entity {
10892     node-name: 'entity';
10893     text-content: 'value';
10894     has-replacement-tree: true;
10895     }
10896     general-entity {
10897     node-name: 'another';
10898     public-id: null;
10899     system-id: 'another';
10900     has-replacement-tree: false;
10901     }
10902     }
10903     element {
10904     attribute {
10905     node-name: 'a';
10906     general-entity-reference {
10907     node-name: 'entity';
10908 wakaba 1.34 manakai-expanded: true;
10909 wakaba 1.20 text-content: 'value';
10910     }
10911     }
10912     }
10913     }
10914     @@XMLTest:
10915     @@@QName: xp.attval.ger.entity.declared.standalone.1.test
10916     @@@DEnt:
10917     @@@@test:value:
10918     <?xml version="1.0" standalone="yes"?>
10919     <p a="&entity;"/>
10920 wakaba 1.48 @@@c:erred: <[xp|wf-entity-declared]> { (2, 7)..(2, 14); }
10921 wakaba 1.20 @@XMLTest:
10922     @@@QName: xp.attval.ger.entity.declared.standalone.2.test
10923     @@@DEnt:
10924     @@@@test:value:
10925     <?xml version="1.0" standalone="yes"?>
10926     <!DOCTYPE p []>
10927     <p a="&entity;"/>
10928 wakaba 1.48 @@@c:erred: <[xp|wf-entity-declared]> { (3, 7)..(3, 14); }
10929 wakaba 1.20 @@XMLTest:
10930     @@@QName: xp.attval.ger.entity.declared.standalone.3.test
10931     @@@DEnt:
10932     @@@@test:value:
10933     <?xml version="1.0" standalone="yes"?>
10934     <!DOCTYPE p [
10935     <!ENTITY % para "<!-- -->">
10936     %para;
10937     ]>
10938     <p a="&entity;"/>
10939 wakaba 1.48 @@@c:erred: <[xp|wf-entity-declared]> { (6, 7)..(6, 14); }
10940 wakaba 1.20 @@XMLTest:
10941     @@@QName: xp.attval.ger.entity.declared.standalone.-1.test
10942     @@@DEnt:
10943     @@@@test:value:
10944     <?xml version="1.0" standalone="no"?>
10945     <!DOCTYPE p [
10946     <!ENTITY % para "<!-- -->">
10947     %para;
10948     ]>
10949     <p a="&entity;"/>
10950     @@@test:domTree:
10951     document {
10952     document-type { }
10953     element {
10954     attribute {
10955     node-name: 'a';
10956     general-entity-reference {
10957 wakaba 1.34 manakai-expanded: false;
10958 wakaba 1.20 }
10959     }
10960     }
10961     }
10962     @@XMLTest:
10963     @@@QName: xp.attval.ger.entity.declared.standalone.-2.test
10964     @@@DEnt:
10965     @@@@test:value:
10966     <!DOCTYPE p [
10967     <!ENTITY % para "<!-- -->">
10968     %para;
10969     ]>
10970     <p a="&entity;"/>
10971     @@@test:domTree:
10972     document {
10973     document-type { }
10974     element {
10975     attribute {
10976     node-name: 'a';
10977     general-entity-reference {
10978 wakaba 1.34 manakai-expanded: false;
10979 wakaba 1.20 }
10980     }
10981     }
10982     }
10983     @@XMLTest:
10984     @@@QName: xp.attval.ger.entity.declared.standalone.4.test
10985     @@@DEnt:
10986     @@@@test:value:
10987     <?xml version="1.0" standalone="yes"?>
10988     <!DOCTYPE p [
10989     <!ENTITY % para SYSTEM "para">
10990     %para;
10991     ]>
10992     <p a="&entity;"/>
10993 wakaba 1.48 @@@c:erred: <[xp|wf-entity-declared]> { (6, 7)..(6, 14); }
10994 wakaba 1.20 @@XMLTest:
10995     @@@QName: xp.attval.ger.entity.declared.standalone.-3.test
10996     @@@DEnt:
10997     @@@@test:value:
10998     <?xml version="1.0" standalone="no"?>
10999     <!DOCTYPE p [
11000     <!ENTITY % para SYSTEM "para">
11001     %para;
11002     ]>
11003     <p a="&entity;"/>
11004     @@@test:domTree:
11005     document {
11006     document-type { }
11007     element {
11008     attribute {
11009     node-name: 'a';
11010     general-entity-reference {
11011 wakaba 1.34 manakai-expanded: false;
11012 wakaba 1.20 }
11013     }
11014     }
11015     }
11016     @@XMLTest:
11017     @@@QName: xp.attval.ger.entity.declared.standalone.-4.test
11018     @@@DEnt:
11019     @@@@test:value:
11020     <!DOCTYPE p [
11021     <!ENTITY % para SYSTEM "para">
11022     %para;
11023     ]>
11024     <p a="&entity;"/>
11025     @@@test:domTree:
11026     document {
11027     document-type { }
11028     element {
11029     attribute {
11030     node-name: 'a';
11031     general-entity-reference {
11032 wakaba 1.34 manakai-expanded: false;
11033 wakaba 1.20 }
11034     }
11035     }
11036     }
11037     @@XMLTest:
11038     @@@QName: xp.attval.ger.entity.declared.standalone.5.test
11039     @@@DEnt:
11040     @@@@test:value:
11041     <?xml version="1.0" standalone="yes"?>
11042     <!DOCTYPE p SYSTEM "dtd">
11043     <p a="&entity;"/>
11044 wakaba 1.48 @@@c:erred: <[xp|wf-entity-declared]> { (3, 7)..(3, 14); }
11045 wakaba 1.20 @@XMLTest:
11046     @@@QName: xp.attval.ger.entity.declared.standalone.-5.test
11047     @@@DEnt:
11048     @@@@test:value:
11049     <?xml version="1.0" standalone="no"?>
11050     <!DOCTYPE p SYSTEM "dtd">
11051     <p a="&entity;"/>
11052     @@@test:domTree:
11053     document {
11054     document-type { }
11055     element {
11056     attribute {
11057     node-name: 'a';
11058     general-entity-reference {
11059 wakaba 1.34 manakai-expanded: false;
11060 wakaba 1.20 }
11061     }
11062     }
11063     }
11064     @@XMLTest:
11065     @@@QName: xp.attval.ger.entity.declared.standalone.-6.test
11066     @@@DEnt:
11067     @@@@test:value:
11068     <!DOCTYPE p SYSTEM "dtd">
11069     <p a="&entity;"/>
11070     @@@test:domTree:
11071     document {
11072     document-type { }
11073     element {
11074     attribute {
11075     node-name: 'a';
11076     general-entity-reference {
11077 wakaba 1.34 manakai-expanded: false;
11078 wakaba 1.20 }
11079     }
11080     }
11081     }
11082    
11083 wakaba 1.21 @@XMLTest:
11084 wakaba 1.22 @@@QName: xp.reptxt.attval.ger.entity.declared.nopref.1.test
11085 wakaba 1.21 @@@DEnt:
11086     @@@@test:value:
11087     <!DOCTYPE p [
11088 wakaba 1.22 <!ENTITY c "&entity;">
11089 wakaba 1.21 ]>
11090 wakaba 1.22 <p a="&c;"/>
11091 wakaba 1.48 @@@c:erred: <[xp|wf-entity-declared]> { (1, 1)..(1, 8); }
11092 wakaba 1.21 @@XMLTest:
11093 wakaba 1.22 @@@QName: xp.reptxt.attval.ger.entity.declared.nopref.2.test
11094 wakaba 1.21 @@@DEnt:
11095     @@@@test:value:
11096     <!DOCTYPE p [
11097     <!ENTITY other "aa">
11098     <!ENTITY % another "aa">
11099 wakaba 1.22 <!ENTITY c "&entity;">
11100 wakaba 1.21 ]>
11101 wakaba 1.22 <p a="&c;"/>
11102 wakaba 1.48 @@@c:erred: <[xp|wf-entity-declared]> { (1, 1)..(1, 8); }
11103 wakaba 1.21 @@XMLTest:
11104 wakaba 1.22 @@@QName: xp.reptxt.attval.ger.entity.declared.nopref.3.test
11105 wakaba 1.21 @@@DEnt:
11106     @@@@test:value:
11107     <?xml version="1.0" standalone="yes"?>
11108     <!DOCTYPE p [
11109 wakaba 1.22 <!ENTITY c "&entity;">
11110 wakaba 1.21 ]>
11111 wakaba 1.22 <p a="&c;"/>
11112 wakaba 1.48 @@@c:erred: <[xp|wf-entity-declared]> { (1, 1)..(1, 8); }
11113 wakaba 1.21 @@XMLTest:
11114 wakaba 1.22 @@@QName: xp.reptxt.attval.ger.entity.declared.nopref.4.test
11115 wakaba 1.21 @@@DEnt:
11116     @@@@test:value:
11117     <?xml version="1.0" standalone="no"?>
11118     <!DOCTYPE p [
11119 wakaba 1.22 <!ENTITY c "&entity;">
11120 wakaba 1.21 ]>
11121 wakaba 1.22 <p a="&c;"/>
11122 wakaba 1.48 @@@c:erred: <[xp|wf-entity-declared]> { (1, 1)..(1, 8); }
11123 wakaba 1.21 @@XMLTest:
11124 wakaba 1.22 @@@QName: xp.reptxt.attval.ger.entity.declared.nopref.5.test
11125 wakaba 1.21 @@@DEnt:
11126     @@@@test:value:
11127     <?xml version="1.0" standalone="yes"?>
11128     <!DOCTYPE p [
11129     <!ENTITY other "aa">
11130     <!ENTITY % another "aa">
11131 wakaba 1.22 <!ENTITY c "&entity;">
11132 wakaba 1.21 ]>
11133 wakaba 1.22 <p a="&c;"/>
11134 wakaba 1.48 @@@c:erred: <[xp|wf-entity-declared]> { (1, 1)..(1, 8); }
11135 wakaba 1.21 @@XMLTest:
11136 wakaba 1.22 @@@QName: xp.reptxt.attval.ger.entity.declared.nopref.6.test
11137 wakaba 1.21 @@@DEnt:
11138     @@@@test:value:
11139     <?xml version="1.0" standalone="no"?>
11140     <!DOCTYPE p [
11141     <!ENTITY other "aa">
11142     <!ENTITY % another "aa">
11143 wakaba 1.22 <!ENTITY c "&entity;">
11144 wakaba 1.21 ]>
11145 wakaba 1.22 <p a="&c;"/>
11146 wakaba 1.48 @@@c:erred: <[xp|wf-entity-declared]> { (1, 1)..(1, 8); }
11147 wakaba 1.21 @@XMLTest:
11148 wakaba 1.22 @@@QName: xp.reptxt.attval.ger.entity.declared.nopref.-1.test
11149 wakaba 1.21 @@@DEnt:
11150     @@@@test:value:
11151     <!DOCTYPE p [
11152     <!ENTITY entity "value">
11153 wakaba 1.22 <!ENTITY c "&entity;">
11154 wakaba 1.21 ]>
11155 wakaba 1.22 <p a="&c;"/>
11156 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
11157 wakaba 1.21 @@@test:domTree:
11158     document {
11159     document-type {
11160     general-entity {
11161     node-name: 'entity';
11162     text-content: 'value';
11163     }
11164 wakaba 1.22 general-entity {
11165     node-name: 'c';
11166     general-entity-reference {
11167     node-name: 'entity';
11168     text-content: 'value';
11169 wakaba 1.21 }
11170     }
11171     }
11172     element {
11173     attribute {
11174     node-name: 'a';
11175     general-entity-reference {
11176 wakaba 1.22 node-name: 'c';
11177     general-entity-reference {
11178     node-name: 'entity';
11179     text-content: 'value';
11180     }
11181 wakaba 1.21 }
11182     }
11183     }
11184     }
11185     @@XMLTest:
11186 wakaba 1.22 @@@QName: xp.reptxt.attval.ger.entity.declared.nopref.-2.test
11187 wakaba 1.21 @@@DEnt:
11188     @@@@test:value:
11189     <!DOCTYPE p [
11190     <!ENTITY entity "value">
11191     <!ENTITY another SYSTEM "another">
11192 wakaba 1.22 <!ENTITY c "&entity;">
11193 wakaba 1.21 ]>
11194 wakaba 1.22 <p a="&c;"/>
11195 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
11196 wakaba 1.21 @@@test:domTree:
11197     document {
11198     document-type {
11199     general-entity {
11200     node-name: 'entity';
11201     text-content: 'value';
11202 wakaba 1.22 }
11203     general-entity {
11204     node-name: 'c';
11205     general-entity-reference {
11206     node-name: 'entity';
11207     text-content: 'value';
11208     }
11209 wakaba 1.21 }
11210     general-entity {
11211     node-name: 'another';
11212     public-id: null;
11213     system-id: 'another';
11214     has-replacement-tree: false;
11215     }
11216     }
11217     element {
11218     attribute {
11219     node-name: 'a';
11220     general-entity-reference {
11221 wakaba 1.22 node-name: 'c';
11222     general-entity-reference {
11223     node-name: 'entity';
11224     text-content: 'value';
11225     }
11226 wakaba 1.21 }
11227     }
11228     }
11229     }
11230     @@XMLTest:
11231 wakaba 1.22 @@@QName: xp.reptxt.attval.ger.entity.declared.standalone.2.test
11232 wakaba 1.21 @@@DEnt:
11233     @@@@test:value:
11234     <?xml version="1.0" standalone="yes"?>
11235     <!DOCTYPE p [
11236 wakaba 1.22 <!ENTITY c "&entity;">
11237 wakaba 1.21 ]>
11238 wakaba 1.22 <p a="&c;"/>
11239 wakaba 1.48 @@@c:erred: <[xp|wf-entity-declared]> { (1, 1)..(1, 8); }
11240 wakaba 1.21 @@XMLTest:
11241 wakaba 1.22 @@@QName: xp.reptxt.attval.ger.entity.declared.standalone.3.test
11242 wakaba 1.21 @@@DEnt:
11243     @@@@test:value:
11244     <?xml version="1.0" standalone="yes"?>
11245     <!DOCTYPE p [
11246     <!ENTITY % para "<!-- -->">
11247     %para;
11248 wakaba 1.22 <!ENTITY c "&entity;">
11249 wakaba 1.21 ]>
11250 wakaba 1.22 <p a="&c;"/>
11251 wakaba 1.48 @@@c:erred: <[xp|wf-entity-declared]> { (1, 1)..(1, 8); }
11252 wakaba 1.21 @@XMLTest:
11253 wakaba 1.22 @@@QName: xp.reptxt.attval.ger.entity.declared.standalone.-1.test
11254 wakaba 1.21 @@@DEnt:
11255     @@@@test:value:
11256 wakaba 1.22 <?xml version="1.0" standalone="no"?>
11257 wakaba 1.21 <!DOCTYPE p [
11258 wakaba 1.22 <!ENTITY c "&entity;">
11259 wakaba 1.21 <!ENTITY % para "<!-- -->">
11260     %para;
11261     ]>
11262 wakaba 1.22 <p a="&c;"/>
11263 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
11264 wakaba 1.22 @@@test:domTree:
11265     document {
11266     document-type {
11267     general-entity {
11268     node-name: 'c';
11269     general-entity-reference {
11270     node-name: 'entity';
11271 wakaba 1.34 manakai-expanded: false;
11272 wakaba 1.22 }
11273     }
11274     }
11275     element {
11276     attribute {
11277     node-name: 'a';
11278     general-entity-reference {
11279     node-name: 'c';
11280     general-entity-reference {
11281     node-name: 'entity';
11282 wakaba 1.34 manakai-expanded: false;
11283 wakaba 1.22 }
11284     }
11285     }
11286     }
11287     }
11288 wakaba 1.21 @@XMLTest:
11289 wakaba 1.22 @@@QName:
11290     xp.reptxt.attval.ger.entity.declared.standalone.-1.2.test
11291 wakaba 1.21 @@@DEnt:
11292     @@@@test:value:
11293     <?xml version="1.0" standalone="no"?>
11294     <!DOCTYPE p [
11295     <!ENTITY % para "<!-- -->">
11296     %para;
11297 wakaba 1.22 <!ENTITY c "&entity;">
11298 wakaba 1.21 ]>
11299 wakaba 1.22 <p a="&c;"/>
11300     @@@test:domTree:
11301     document {
11302     document-type { }
11303     element {
11304     attribute {
11305     node-name: 'a';
11306     general-entity-reference {
11307     node-name: 'c';
11308 wakaba 1.34 manakai-expanded: false;
11309 wakaba 1.22 }
11310     }
11311     }
11312     }
11313 wakaba 1.21 @@XMLTest:
11314 wakaba 1.22 @@@QName: xp.reptxt.attval.ger.entity.declared.standalone.-2.test
11315 wakaba 1.21 @@@DEnt:
11316     @@@@test:value:
11317     <!DOCTYPE p [
11318 wakaba 1.22 <!ENTITY c "&entity;">
11319     <!ENTITY % para "<!-- -->">
11320     %para;
11321     ]>
11322     <p a="&c;"/>
11323     @@@test:domTree:
11324     document {
11325     document-type { }
11326     element {
11327     attribute {
11328     node-name: 'a';
11329     general-entity-reference {
11330     node-name: 'c';
11331 wakaba 1.34 manakai-expanded: true;
11332 wakaba 1.22 general-entity-reference {
11333     node-name: 'entity';
11334 wakaba 1.34 manakai-expanded: false;
11335 wakaba 1.22 }
11336     }
11337     }
11338     }
11339     }
11340     @@XMLTest:
11341     @@@QName:
11342     xp.reptxt.attval.ger.entity.declared.standalone.-2.2.test
11343     @@@DEnt:
11344     @@@@test:value:
11345     <!DOCTYPE p [
11346     <!ENTITY % para "<!-- -->">
11347     %para;
11348     <!ENTITY c "&entity;">
11349     ]>
11350     <p a="&c;"/>
11351     @@@test:domTree:
11352     document {
11353     document-type { }
11354     element {
11355     attribute {
11356     node-name: 'a';
11357     general-entity-reference {
11358     node-name: 'c';
11359 wakaba 1.34 manakai-expanded: false;
11360 wakaba 1.22 }
11361     }
11362     }
11363     }
11364     @@XMLTest:
11365     @@@QName: xp.reptxt.attval.ger.entity.declared.standalone.4.test
11366     @@@DEnt:
11367     @@@@test:value:
11368     <?xml version="1.0" standalone="yes"?>
11369     <!DOCTYPE p [
11370     <!ENTITY % para SYSTEM "para">
11371     %para;
11372     <!ENTITY c "&entity;">
11373     ]>
11374     <p a="&c;"/>
11375 wakaba 1.48 @@@c:erred: <[xp|wf-entity-declared]> { (1, 1)..(1, 8); }
11376 wakaba 1.22 @@XMLTest:
11377     @@@QName: xp.reptxt.attval.ger.entity.declared.standalone.-3.test
11378     @@@DEnt:
11379     @@@@test:value:
11380     <?xml version="1.0" standalone="no"?>
11381     <!DOCTYPE p [
11382     <!ENTITY c "&entity;">
11383     <!ENTITY % para SYSTEM "para">
11384     %para;
11385     ]>
11386     <p a="&c;"/>
11387     @@@test:domTree:
11388     document {
11389     document-type { }
11390     element {
11391     attribute {
11392     node-name: 'a';
11393     general-entity-reference {
11394     node-name: 'c';
11395 wakaba 1.34 manakai-expanded: true;
11396 wakaba 1.22 general-entity-reference {
11397     node-name: 'entity';
11398 wakaba 1.34 manakai-expanded: false;
11399 wakaba 1.22 }
11400     }
11401     }
11402     }
11403     }
11404     @@XMLTest:
11405     @@@QName:
11406     xp.reptxt.attval.ger.entity.declared.standalone.-3.2.test
11407     @@@DEnt:
11408     @@@@test:value:
11409     <?xml version="1.0" standalone="no"?>
11410     <!DOCTYPE p [
11411     <!ENTITY % para SYSTEM "para">
11412     %para;
11413     <!ENTITY c "&entity;">
11414     ]>
11415     <p a="&c;"/>
11416     @@@test:domTree:
11417     document {
11418     document-type { }
11419     element {
11420     attribute {
11421     node-name: 'a';
11422     general-entity-reference {
11423     node-name: 'c';
11424 wakaba 1.34 manakai-expanded: false;
11425 wakaba 1.22 }
11426     }
11427     }
11428     }
11429     @@XMLTest:
11430     @@@QName: xp.reptxt.attval.ger.entity.declared.standalone.-4.test
11431     @@@DEnt:
11432     @@@@test:value:
11433     <!DOCTYPE p [
11434     <!ENTITY c "&entity;">
11435     <!ENTITY % para SYSTEM "para">
11436     %para;
11437     ]>
11438     <p a="&c;"/>
11439     @@@test:domTree:
11440     document {
11441     document-type { }
11442     element {
11443     attribute {
11444     node-name: 'a';
11445     general-entity-reference {
11446     node-name: 'c';
11447 wakaba 1.34 manakai-expanded: true;
11448 wakaba 1.22 general-entity-reference {
11449     node-name: 'entity';
11450 wakaba 1.34 manakai-expanded: false;
11451 wakaba 1.22 }
11452     }
11453     }
11454     }
11455     }
11456     @@XMLTest:
11457     @@@QName:
11458     xp.reptxt.attval.ger.entity.declared.standalone.-4.2.test
11459     @@@DEnt:
11460     @@@@test:value:
11461     <!DOCTYPE p [
11462     <!ENTITY % para SYSTEM "para">
11463     %para;
11464     <!ENTITY c "&entity;">
11465     ]>
11466     <p a="&c;"/>
11467     @@@test:domTree:
11468     document {
11469     document-type { }
11470     element {
11471     attribute {
11472     node-name: 'a';
11473     general-entity-reference {
11474     node-name: 'c';
11475 wakaba 1.34 manakai-expanded: false;
11476 wakaba 1.22 }
11477     }
11478     }
11479     }
11480     @@XMLTest:
11481     @@@QName: xp.reptxt.attval.ger.entity.declared.standalone.5.test
11482     @@@DEnt:
11483     @@@@test:value:
11484     <?xml version="1.0" standalone="yes"?>
11485     <!DOCTYPE p SYSTEM "dtd" [
11486     <!ENTITY c "&entity;">
11487     ]>
11488     <p a="&c;"/>
11489 wakaba 1.48 @@@c:erred: <[xp|wf-entity-declared]> { (1, 1)..(1, 8); }
11490 wakaba 1.22 @@XMLTest:
11491     @@@QName: xp.reptxt.attval.ger.entity.declared.standalone.-5.test
11492     @@@DEnt:
11493     @@@@test:value:
11494     <?xml version="1.0" standalone="no"?>
11495     <!DOCTYPE p SYSTEM "dtd" [
11496     <!ENTITY c "&entity;">
11497     ]>
11498     <p a="&c;"/>
11499     @@@test:domTree:
11500     document {
11501     document-type { }
11502     element {
11503     attribute {
11504     node-name: 'a';
11505     general-entity-reference {
11506     node-name: 'c';
11507 wakaba 1.34 manakai-expanded: true;
11508 wakaba 1.22 general-entity-reference {
11509     node-name: 'entity';
11510 wakaba 1.34 manakai-expanded: false;
11511 wakaba 1.22 }
11512     }
11513     }
11514     }
11515     }
11516     @@XMLTest:
11517     @@@QName: xp.reptxt.attval.ger.entity.declared.standalone.-6.test
11518     @@@DEnt:
11519     @@@@test:value:
11520     <!DOCTYPE p SYSTEM "dtd" [<!ENTITY c "&entity;">]>
11521     <p a="&c;"/>
11522     @@@test:domTree:
11523     document {
11524     document-type { }
11525     element {
11526     attribute {
11527     node-name: 'a';
11528     general-entity-reference {
11529     node-name: 'c';
11530 wakaba 1.34 manakai-expanded: true;
11531 wakaba 1.22 general-entity-reference {
11532     node-name: 'entity';
11533 wakaba 1.34 manakai-expanded: false;
11534 wakaba 1.22 }
11535     }
11536     }
11537     }
11538     }
11539    
11540     @@XMLTest:
11541     @@@QName: xp.attlist.dup.entity.declared.1.test
11542     @@@DEnt:
11543     @@@@test:value:
11544     <!DOCTYPE p [
11545     <!ATTLIST p a CDATA "no-entity">
11546     <!ATTLIST p a CDATA "&entity;">
11547     ]>
11548     <p/>
11549 wakaba 1.48 @@@c:erred: <[xp|wf-entity-declared]> { (3, 21)..(3, 29); }
11550 wakaba 1.22 @@XMLTest:
11551     @@@QName: xp.attlist.dup.entity.declared.2.test
11552     @@@DEnt:
11553     @@@@test:value:
11554     <!DOCTYPE p [
11555     <!ATTLIST p a CDATA "no-entity"
11556     a CDATA "&entity;">
11557     ]>
11558     <p/>
11559 wakaba 1.48 @@@c:erred: <[xp|wf-entity-declared]> { (3, 21)..(3, 29); }
11560 wakaba 1.22 @@XMLTest:
11561     @@@QName: xp.attlist.unused.entity.declared.1.test
11562     @@@DEnt:
11563     @@@@test:value:
11564     <!DOCTYPE p [
11565     <!ATTLIST q a CDATA "&entity;">
11566     ]>
11567     <p/>
11568 wakaba 1.48 @@@c:erred: <[xp|wf-entity-declared]> { (2, 21)..(2, 29); }
11569 wakaba 1.22 @@XMLTest:
11570     @@@QName: xp.attlist.unused.entity.declared.2.test
11571     @@@DEnt:
11572     @@@@test:value:
11573     <!DOCTYPE p [
11574     <!ATTLIST p a CDATA "&entity;">
11575     ]>
11576     <p a="bb"/>
11577 wakaba 1.48 @@@c:erred: <[xp|wf-entity-declared]> { (2, 21)..(2, 29); }
11578 wakaba 1.22
11579     @@XMLTest:
11580     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.nopref.1.test
11581     @@@DEnt:
11582     @@@@test:value:
11583     <!DOCTYPE p [
11584     <!ENTITY c "&entity;">
11585     <!ATTLIST p a CDATA "&c;">
11586     ]>
11587     <p/>
11588 wakaba 1.48 @@@c:erred: <[xp|wf-entity-declared]> { (1, 1)..(1, 8); }
11589 wakaba 1.22 @@XMLTest:
11590     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.nopref.2.test
11591     @@@DEnt:
11592     @@@@test:value:
11593     <!DOCTYPE p [
11594     <!ENTITY other "aa">
11595     <!ENTITY % another "aa">
11596     <!ENTITY c "&entity;">
11597     <!ATTLIST p a CDATA "&c;">
11598     ]>
11599     <p/>
11600 wakaba 1.48 @@@c:erred: <[xp|wf-entity-declared]> { (1, 1)..(1, 8); }
11601 wakaba 1.22 @@XMLTest:
11602     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.nopref.3.test
11603     @@@DEnt:
11604     @@@@test:value:
11605     <?xml version="1.0" standalone="yes"?>
11606     <!DOCTYPE p [
11607     <!ENTITY c "&entity;">
11608     <!ATTLIST p a CDATA "&c;">
11609     ]>
11610     <p/>
11611 wakaba 1.48 @@@c:erred: <[xp|wf-entity-declared]> { (1, 1)..(1, 8); }
11612 wakaba 1.22 @@XMLTest:
11613     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.nopref.4.test
11614     @@@DEnt:
11615     @@@@test:value:
11616     <?xml version="1.0" standalone="no"?>
11617     <!DOCTYPE p [
11618     <!ENTITY c "&entity;">
11619     <!ATTLIST p a CDATA "&c;">
11620     ]>
11621     <p/>
11622 wakaba 1.48 @@@c:erred: <[xp|wf-entity-declared]> { (1, 1)..(1, 8); }
11623 wakaba 1.22 @@XMLTest:
11624     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.nopref.5.test
11625     @@@DEnt:
11626     @@@@test:value:
11627     <?xml version="1.0" standalone="yes"?>
11628     <!DOCTYPE p [
11629     <!ENTITY other "aa">
11630     <!ENTITY % another "aa">
11631     <!ENTITY c "&entity;">
11632     <!ATTLIST p a CDATA "&c;">
11633     ]>
11634     <p/>
11635 wakaba 1.48 @@@c:erred: <[xp|wf-entity-declared]> { (1, 1)..(1, 8); }
11636 wakaba 1.22 @@XMLTest:
11637     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.nopref.6.test
11638     @@@DEnt:
11639     @@@@test:value:
11640     <?xml version="1.0" standalone="no"?>
11641     <!DOCTYPE p [
11642     <!ENTITY other "aa">
11643     <!ENTITY % another "aa">
11644     <!ENTITY c "&entity;">
11645     <!ATTLIST p a CDATA "&c;">
11646     ]>
11647     <p/>
11648 wakaba 1.48 @@@c:erred: <[xp|wf-entity-declared]> { (1, 1)..(1, 8); }
11649 wakaba 1.22 @@XMLTest:
11650     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.nopref.-1.test
11651     @@@DEnt:
11652     @@@@test:value:
11653     <!DOCTYPE p [
11654     <!ENTITY entity "value">
11655     <!ENTITY c "&entity;">
11656     <!ATTLIST p a CDATA "&c;">
11657     ]>
11658     <p/>
11659 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
11660 wakaba 1.22 @@@test:domTree:
11661     document {
11662     document-type {
11663     general-entity {
11664     node-name: 'entity';
11665     text-content: 'value';
11666     }
11667     general-entity {
11668     node-name: 'c';
11669     general-entity-reference {
11670     node-name: 'entity';
11671 wakaba 1.34 manakai-expanded: true;
11672 wakaba 1.22 text-content: 'value';
11673     }
11674     }
11675     element-type-definition {
11676     node-name: 'p';
11677     attribute-definition {
11678     node-name: 'a';
11679     general-entity-reference {
11680     node-name: 'c';
11681 wakaba 1.34 manakai-expanded: true;
11682 wakaba 1.22 general-entity-reference {
11683     node-name: 'entity';
11684 wakaba 1.34 manakai-expanded: true;
11685 wakaba 1.22 text-content: 'value';
11686     }
11687     }
11688     }
11689     }
11690     }
11691     element {
11692     attribute {
11693     node-name: 'a';
11694     specified: false;
11695     general-entity-reference {
11696     node-name: 'c';
11697     general-entity-reference {
11698     node-name: 'entity';
11699     text-content: 'value';
11700     }
11701     }
11702     }
11703     }
11704     }
11705     @@XMLTest:
11706     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.nopref.-2.test
11707     @@@DEnt:
11708     @@@@test:value:
11709     <!DOCTYPE p [
11710     <!ENTITY entity "value">
11711     <!ENTITY another SYSTEM "another">
11712     <!ENTITY c "&entity;">
11713     <!ATTLIST p a CDATA "&c;">
11714     ]>
11715     <p/>
11716 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
11717 wakaba 1.22 @@@test:domTree:
11718     document {
11719     document-type {
11720     general-entity {
11721     node-name: 'entity';
11722     text-content: 'value';
11723     }
11724     general-entity {
11725     node-name: 'c';
11726     general-entity-reference {
11727     node-name: 'entity';
11728     text-content: 'value';
11729     }
11730     }
11731     general-entity {
11732     node-name: 'another';
11733     public-id: null;
11734     system-id: 'another';
11735     has-replacement-tree: false;
11736     }
11737     element-type-definition {
11738     node-name: 'p';
11739     attribute-definition {
11740     node-name: 'a';
11741     general-entity-reference {
11742     node-name: 'c';
11743 wakaba 1.34 manakai-expanded: true;
11744 wakaba 1.22 general-entity-reference {
11745     node-name: 'entity';
11746 wakaba 1.34 manakai-expanded: true;
11747 wakaba 1.22 text-content: 'value';
11748     }
11749     }
11750     }
11751     }
11752     }
11753     element {
11754     attribute {
11755     node-name: 'a';
11756     specified: false;
11757     general-entity-reference {
11758     node-name: 'c';
11759     general-entity-reference {
11760     node-name: 'entity';
11761     text-content: 'value';
11762     }
11763     }
11764     }
11765     }
11766     }
11767     @@XMLTest:
11768     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.standalone.2.test
11769     @@@DEnt:
11770     @@@@test:value:
11771     <?xml version="1.0" standalone="yes"?>
11772     <!DOCTYPE p [
11773     <!ENTITY c "&entity;">
11774     <!ATTLIST p a CDATA "&c;">
11775     ]>
11776     <p/>
11777 wakaba 1.48 @@@c:erred: <[xp|wf-entity-declared]> { (1, 1)..(1, 8); }
11778 wakaba 1.22 @@XMLTest:
11779     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.standalone.3.test
11780     @@@DEnt:
11781     @@@@test:value:
11782     <?xml version="1.0" standalone="yes"?>
11783     <!DOCTYPE p [
11784     <!ENTITY % para "<!-- -->">
11785     %para;
11786     <!ENTITY c "&entity;">
11787     <!ATTLIST p a CDATA "&c;">
11788     ]>
11789     <p/>
11790 wakaba 1.48 @@@c:erred: <[xp|wf-entity-declared]> { (1, 1)..(1, 8); }
11791 wakaba 1.22 @@XMLTest:
11792     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.standalone.-1.test
11793     @@@DEnt:
11794     @@@@test:value:
11795     <?xml version="1.0" standalone="no"?>
11796     <!DOCTYPE p [
11797     <!ENTITY c "&entity;">
11798     <!ATTLIST p a CDATA "&c;">
11799     <!ENTITY % para "<!-- -->">
11800     %para;
11801     ]>
11802     <p/>
11803 wakaba 1.48 @@@c:erred: <[xp|wf-entity-declared]> { (1, 1)..(1, 8); }
11804 wakaba 1.22 @@XMLTest:
11805     @@@QName:
11806     xp.reptxt.attlist.attval.ger.entity.declared.standalone.-1.2.test
11807     @@@DEnt:
11808     @@@@test:value:
11809     <?xml version="1.0" standalone="no"?>
11810     <!DOCTYPE p [
11811     <!ENTITY % para "<!-- -->">
11812     %para;
11813     <!ENTITY c "&entity;">
11814     <!ATTLIST p a CDATA "&c;">
11815     ]>
11816     <p g="h"/>
11817     @@@test:domTree:
11818     document {
11819     document-type { }
11820     element {
11821     attribute {
11822     node-name: 'g';
11823     text-content: 'h';
11824     }
11825     }
11826     }
11827     @@XMLTest:
11828     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.standalone.-2.test
11829     @@@DEnt:
11830     @@@@test:value:
11831     <!DOCTYPE p [
11832     <!ENTITY c "&entity;">
11833     <!ATTLIST p a CDATA "&c;">
11834     <!ENTITY % para "<!-- -->">
11835     %para;
11836     ]>
11837     <p/>
11838 wakaba 1.48 @@@c:erred: <[xp|wf-entity-declared]> { (1, 1)..(1, 8); }
11839 wakaba 1.22 @@XMLTest:
11840     @@@QName:
11841     xp.reptxt.attlist.attval.ger.entity.declared.standalone.-2.2.test
11842     @@@DEnt:
11843     @@@@test:value:
11844     <!DOCTYPE p [
11845     <!ENTITY % para "<!-- -->">
11846     %para;
11847     <!ENTITY c "&entity;">
11848     <!ATTLIST p a CDATA "&c;">
11849     ]>
11850     <p g="h"/>
11851     @@@test:domTree:
11852     document {
11853     document-type { }
11854     element {
11855     attribute {
11856     node-name: 'g';
11857     text-content: 'h';
11858     }
11859     }
11860     }
11861     @@XMLTest:
11862     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.standalone.4.test
11863     @@@DEnt:
11864     @@@@test:value:
11865     <?xml version="1.0" standalone="yes"?>
11866     <!DOCTYPE p [
11867     <!ENTITY % para SYSTEM "para">
11868     %para;
11869     <!ENTITY c "&entity;">
11870     <!ATTLIST p a CDATA "&c;">
11871     ]>
11872     <p/>
11873 wakaba 1.48 @@@c:erred: <[xp|wf-entity-declared]> { (1, 1)..(1, 8); }
11874 wakaba 1.22 @@XMLTest:
11875     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.standalone.-3.test
11876     @@@DEnt:
11877     @@@@test:value:
11878     <?xml version="1.0" standalone="no"?>
11879     <!DOCTYPE p [
11880     <!ENTITY c "&entity;">
11881     <!ATTLIST p a CDATA "&c;">
11882     <!ENTITY % para SYSTEM "para">
11883     %para;
11884     ]>
11885     <p/>
11886 wakaba 1.48 @@@c:erred: <[xp|wf-entity-declared]> { (1, 1)..(1, 8); }
11887 wakaba 1.22 @@XMLTest:
11888     @@@QName:
11889     xp.reptxt.attlist.attval.ger.entity.declared.standalone.-3.2.test
11890     @@@DEnt:
11891     @@@@test:value:
11892     <?xml version="1.0" standalone="no"?>
11893     <!DOCTYPE p [
11894     <!ENTITY % para SYSTEM "para">
11895     %para;
11896     <!ENTITY c "&entity;">
11897     <!ATTLIST p a CDATA "&c;">
11898     ]>
11899     <p g="h"/>
11900     @@@test:domTree:
11901     document {
11902     document-type { }
11903     element {
11904     attribute {
11905     node-name: 'g';
11906     text-content: 'h';
11907     }
11908     }
11909     }
11910     @@XMLTest:
11911     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.standalone.-4.test
11912     @@@DEnt:
11913     @@@@test:value:
11914     <!DOCTYPE p [
11915     <!ENTITY c "&entity;">
11916     <!ATTLIST p a CDATA "&c;">
11917     <!ENTITY % para SYSTEM "para">
11918     %para;
11919     ]>
11920     <p/>
11921 wakaba 1.48 @@@c:erred: <[xp|wf-entity-declared]> { (1, 1)..(1, 8); }
11922 wakaba 1.22 @@XMLTest:
11923     @@@QName:
11924     xp.reptxt.attlist.attval.ger.entity.declared.standalone.-4.2.test
11925     @@@DEnt:
11926     @@@@test:value:
11927     <!DOCTYPE p [
11928     <!ENTITY % para SYSTEM "para">
11929     %para;
11930     <!ENTITY c "&entity;">
11931     <!ATTLIST p a CDATA "&c;">
11932     ]>
11933     <p g="h"/>
11934     @@@test:domTree:
11935     document {
11936     document-type { }
11937     element {
11938     attribute {
11939     node-name: 'g';
11940     text-content: 'h';
11941     }
11942     }
11943     }
11944     @@XMLTest:
11945     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.standalone.5.test
11946     @@@DEnt:
11947     @@@@test:value:
11948     <?xml version="1.0" standalone="yes"?>
11949     <!DOCTYPE p SYSTEM "dtd" [
11950     <!ENTITY c "&entity;">
11951     <!ATTLIST p a CDATA "&c;">
11952     ]>
11953     <p/>
11954 wakaba 1.48 @@@c:erred: <[xp|wf-entity-declared]> { (1, 1)..(1, 8); }
11955 wakaba 1.22 @@XMLTest:
11956     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.standalone.-5.test
11957     @@@DEnt:
11958     @@@@test:value:
11959     <?xml version="1.0" standalone="no"?>
11960     <!DOCTYPE p SYSTEM "dtd" [
11961     <!ENTITY c "&entity;">
11962     <!ATTLIST p a CDATA "&c;">
11963     ]>
11964     <p/>
11965     @@@test:domTree:
11966     document {
11967     document-type { }
11968     element {
11969     attribute {
11970     node-name: 'a';
11971     specified: false;
11972     general-entity-reference {
11973     node-name: 'c';
11974 wakaba 1.34 manakai-expanded: true;
11975 wakaba 1.22 general-entity-reference {
11976     node-name: 'entity';
11977 wakaba 1.34 manakai-expanded: false;
11978 wakaba 1.22 }
11979     }
11980     }
11981     }
11982     }
11983     @@XMLTest:
11984     @@@QName: xp.reptxt.attlist.attval.ger.entity.declared.standalone.-6.test
11985     @@@DEnt:
11986     @@@@test:value:
11987     <!DOCTYPE p SYSTEM "dtd" [<!ENTITY c "&entity;">
11988     <!ATTLIST p a CDATA "&c;">
11989     ]>
11990     <p/>
11991     @@@test:domTree:
11992     document {
11993     document-type { }
11994     element {
11995     attribute {
11996     node-name: 'a';
11997     specified: false;
11998     general-entity-reference {
11999     node-name: 'c';
12000 wakaba 1.34 manakai-expanded: true;
12001 wakaba 1.22 general-entity-reference {
12002     node-name: 'entity';
12003 wakaba 1.34 manakai-expanded: false;
12004 wakaba 1.22 }
12005     }
12006     }
12007     }
12008     }
12009    
12010     @@XMLTest:
12011     @@@QName: xp.attlist.attval.ger.entity.declared.nopref.1.test
12012     @@@DEnt:
12013     @@@@test:value:
12014     <!DOCTYPE p [
12015     <!ATTLIST p a CDATA "&entity;">
12016     ]>
12017     <p/>
12018 wakaba 1.48 @@@c:erred: <[xp|wf-entity-declared]> { (2, 22)..(2, 29); }
12019 wakaba 1.22 @@XMLTest:
12020     @@@QName: xp.attlist.attval.ger.entity.declared.nopref.2.test
12021     @@@DEnt:
12022     @@@@test:value:
12023     <!DOCTYPE p [
12024     <!ENTITY other "aa">
12025     <!ENTITY % another "aa">
12026     <!ATTLIST p a CDATA "&entity;">
12027     ]>
12028     <p/>
12029 wakaba 1.48 @@@c:erred: <[xp|wf-entity-declared]> { (4, 22)..(4, 29); }
12030 wakaba 1.22 @@XMLTest:
12031     @@@QName: xp.attlist.attval.ger.entity.declared.nopref.3.test
12032     @@@DEnt:
12033     @@@@test:value:
12034     <?xml version="1.0" standalone="yes"?>
12035     <!DOCTYPE p [
12036     <!ATTLIST p a CDATA "&entity;">
12037     ]>
12038     <p/>
12039 wakaba 1.48 @@@c:erred: <[xp|wf-entity-declared]> { (3, 22)..(3, 29); }
12040 wakaba 1.22 @@XMLTest:
12041     @@@QName: xp.attlist.attval.ger.entity.declared.nopref.4.test
12042     @@@DEnt:
12043     @@@@test:value:
12044     <?xml version="1.0" standalone="no"?>
12045     <!DOCTYPE p [
12046     <!ATTLIST p a CDATA "&entity;">
12047     ]>
12048     <p/>
12049 wakaba 1.48 @@@c:erred: <[xp|wf-entity-declared]> { (3, 22)..(3, 29); }
12050 wakaba 1.22 @@XMLTest:
12051     @@@QName: xp.attlist.attval.ger.entity.declared.nopref.5.test
12052     @@@DEnt:
12053     @@@@test:value:
12054     <?xml version="1.0" standalone="yes"?>
12055     <!DOCTYPE p [
12056     <!ENTITY other "aa">
12057     <!ENTITY % another "aa">
12058     <!ATTLIST p a CDATA "&entity;">
12059     ]>
12060     <p/>
12061 wakaba 1.48 @@@c:erred: <[xp|wf-entity-declared]> { (5, 22)..(5, 29); }
12062 wakaba 1.22 @@XMLTest:
12063     @@@QName: xp.attlist.attval.ger.entity.declared.nopref.6.test
12064     @@@DEnt:
12065     @@@@test:value:
12066     <?xml version="1.0" standalone="no"?>
12067     <!DOCTYPE p [
12068     <!ENTITY other "aa">
12069     <!ENTITY % another "aa">
12070     <!ATTLIST p a CDATA "&entity;">
12071     ]>
12072     <p/>
12073 wakaba 1.48 @@@c:erred: <[xp|wf-entity-declared]> { (5, 22)..(5, 29); }
12074 wakaba 1.22 @@XMLTest:
12075     @@@QName: xp.attlist.attval.ger.entity.declared.nopref.-1.test
12076     @@@DEnt:
12077     @@@@test:value:
12078     <!DOCTYPE p [
12079     <!ENTITY entity "value">
12080     <!ATTLIST p a CDATA "&entity;">
12081     ]>
12082     <p/>
12083 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
12084 wakaba 1.22 @@@test:domTree:
12085     document {
12086     document-type {
12087     general-entity {
12088     node-name: 'entity';
12089     text-content: 'value';
12090     }
12091     element-type-definition {
12092     node-name: 'p';
12093     attribute-definition {
12094     node-name: 'a';
12095     general-entity-reference {
12096     node-name: 'entity';
12097 wakaba 1.34 manakai-expanded: true;
12098 wakaba 1.22 text-content: 'value';
12099     }
12100     }
12101     }
12102     }
12103     element {
12104     attribute {
12105     node-name: 'a';
12106     specified: false;
12107     general-entity-reference {
12108     node-name: 'entity';
12109 wakaba 1.34 manakai-expanded: true;
12110 wakaba 1.22 text-content: 'value';
12111     }
12112     }
12113     }
12114     }
12115     @@XMLTest:
12116     @@@QName: xp.attlist.attval.ger.entity.declared.nopref.-1.2.test
12117     @@@DEnt:
12118     @@@@test:value:
12119     <!DOCTYPE p [
12120     <!ATTLIST p a CDATA "&entity;">
12121     <!ENTITY entity "value">
12122     ]>
12123     <p/>
12124 wakaba 1.48 @@@c:erred: <[xp|wf-entity-declared]> { (2, 22)..(2, 29); }
12125 wakaba 1.22 @@XMLTest:
12126     @@@QName: xp.attlist.attval.ger.entity.declared.nopref.-2.test
12127     @@@DEnt:
12128     @@@@test:value:
12129     <!DOCTYPE p [
12130     <!ENTITY entity "value">
12131     <!ENTITY another SYSTEM "another">
12132     <!ATTLIST p a CDATA "&entity;">
12133     ]>
12134     <p/>
12135 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
12136 wakaba 1.22 @@@test:domTree:
12137     document {
12138     document-type {
12139     element-type-definition {
12140     node-name: 'p';
12141     attribute-definition {
12142     node-name: 'a';
12143     general-entity-reference {
12144     node-name: 'entity';
12145 wakaba 1.34 manakai-expanded: true;
12146 wakaba 1.22 text-content: 'value';
12147     }
12148     }
12149     }
12150     general-entity {
12151     node-name: 'entity';
12152     text-content: 'value';
12153     has-replacement-tree: true;
12154     }
12155     general-entity {
12156     node-name: 'another';
12157     public-id: null;
12158     system-id: 'another';
12159     has-replacement-tree: false;
12160     }
12161     }
12162     element {
12163     attribute {
12164     node-name: 'a';
12165     specified: false;
12166     general-entity-reference {
12167     node-name: 'entity';
12168 wakaba 1.34 manakai-expanded: true;
12169 wakaba 1.22 text-content: 'value';
12170     }
12171     }
12172     }
12173     }
12174     @@XMLTest:
12175     @@@QName: xp.attlist.attval.ger.entity.declared.nopref.-2.2.test
12176     @@@DEnt:
12177     @@@@test:value:
12178     <!DOCTYPE p [
12179     <!ATTLIST p a CDATA "&entity;">
12180     <!ENTITY entity "value">
12181     <!ENTITY another SYSTEM "another">
12182     ]>
12183     <p/>
12184 wakaba 1.48 @@@c:erred: <[xp|wf-entity-declared]> { (2, 22)..(2, 29); }
12185 wakaba 1.22 @@XMLTest:
12186     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.2.test
12187     @@@DEnt:
12188     @@@@test:value:
12189     <?xml version="1.0" standalone="yes"?>
12190     <!DOCTYPE p [
12191     <!ATTLIST p a CDATA "&entity;">
12192     ]>
12193     <p/>
12194 wakaba 1.48 @@@c:erred: <[xp|wf-entity-declared]> { (3, 22)..(3, 29); }
12195 wakaba 1.22 @@XMLTest:
12196     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.3.test
12197     @@@DEnt:
12198     @@@@test:value:
12199     <?xml version="1.0" standalone="yes"?>
12200     <!DOCTYPE p [
12201     <!ATTLIST p a CDATA "&entity;">
12202     <!ENTITY % para "<!-- -->">
12203     %para;
12204     ]>
12205     <p/>
12206 wakaba 1.48 @@@c:erred: <[xp|wf-entity-declared]> { (3, 22)..(3, 29); }
12207 wakaba 1.22 @@XMLTest:
12208     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.3.2.test
12209     @@@DEnt:
12210     @@@@test:value:
12211     <?xml version="1.0" standalone="yes"?>
12212     <!DOCTYPE p [
12213     <!ENTITY % para "<!-- -->">
12214     %para;
12215     <!ATTLIST p a CDATA "&entity;">
12216     ]>
12217     <p/>
12218 wakaba 1.48 @@@c:erred: <[xp|wf-entity-declared]> { (5, 22)..(5, 29); }
12219 wakaba 1.22 @@@enImplNote:
12220     The <XML::ATTLIST> declaration is processed since
12221     it is a <XA::standalone> document.
12222     @@XMLTest:
12223     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.-1.test
12224     @@@DEnt:
12225     @@@@test:value:
12226     <?xml version="1.0" standalone="no"?>
12227     <!DOCTYPE p [
12228     <!ATTLIST p a CDATA "&entity;">
12229     <!ENTITY % para "<!-- -->">
12230     %para;
12231     ]>
12232     <p/>
12233 wakaba 1.48 @@@c:erred: <[xp|wf-entity-declared]> { (3, 22)..(3, 29); }
12234 wakaba 1.22 @@XMLTest:
12235     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.-1.2.test
12236     @@@DEnt:
12237     @@@@test:value:
12238     <?xml version="1.0" standalone="no"?>
12239     <!DOCTYPE p [
12240 wakaba 1.25 <!ATTLIST p b CDATA #IMPLIED>
12241 wakaba 1.21 <!ENTITY % para "<!-- -->">
12242     %para;
12243     <!ATTLIST p a CDATA "&entity;">
12244     ]>
12245     <p c="d"/>
12246 wakaba 1.25 @@@c:erred:
12247 wakaba 1.48 <[xp|warning-attribute-definition-not-processed]> { (6, 13)..(6, 30); }
12248 wakaba 1.21 @@@test:domTree:
12249     document {
12250     document-type {
12251     element-type-definition {
12252 wakaba 1.25 node-name: 'p';
12253 wakaba 1.21 attribute-definition {
12254     node-name: 'b';
12255     }
12256     }
12257     }
12258     element {
12259     attribute {
12260     node-name: 'c';
12261     text-content: 'd';
12262     }
12263     }
12264     }
12265     @@@enImplNote:
12266     The second <XML::ATTLIST> declaration is read but not processed
12267     and its <XML::&entity;> general entity reference violates
12268     entity declared validty constraint rather than well-formedness
12269     constraint.
12270     @@XMLTest:
12271     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.-2.test
12272     @@@DEnt:
12273     @@@@test:value:
12274     <!DOCTYPE p [
12275     <!ATTLIST p a CDATA "&entity;">
12276     <!ENTITY % para "<!-- -->">
12277     %para;
12278     ]>
12279     <p/>
12280 wakaba 1.48 @@@c:erred: <[xp|wf-entity-declared]> { (2, 22)..(2, 29); }
12281 wakaba 1.21 @@XMLTest:
12282     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.-2.2.test
12283     @@@DEnt:
12284     @@@@test:value:
12285     <!DOCTYPE p [
12286 wakaba 1.25 <!ATTLIST p b CDATA #IMPLIED>
12287 wakaba 1.21 <!ENTITY % para "<!-- -->">
12288     %para;
12289     <!ATTLIST p a CDATA "&entity;">
12290     ]>
12291     <p c="d"/>
12292 wakaba 1.25 @@@c:erred:
12293 wakaba 1.48 <[xp|warning-attribute-definition-not-processed]> { (5, 13)..(5, 30); }
12294 wakaba 1.21 @@@test:domTree:
12295     document {
12296     document-type {
12297     element-type-definition {
12298 wakaba 1.25 node-name: 'p';
12299 wakaba 1.21 attribute-definition {
12300     node-name: 'b';
12301     }
12302     }
12303     }
12304     element {
12305     attribute {
12306     node-name: 'c';
12307     text-content: 'd';
12308     }
12309     }
12310     }
12311     @@XMLTest:
12312     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.4.test
12313     @@@DEnt:
12314     @@@@test:value:
12315     <?xml version="1.0" standalone="yes"?>
12316     <!DOCTYPE p [
12317     <!ATTLIST p a CDATA "&entity;">
12318     <!ENTITY % para SYSTEM "p">
12319     %para;
12320     ]>
12321     <p/>
12322 wakaba 1.48 @@@c:erred: <[xp|wf-entity-declared]> { (3, 22)..(3, 29); }
12323 wakaba 1.21 @@XMLTest:
12324     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.4.2.test
12325     @@@DEnt:
12326     @@@@test:value:
12327     <?xml version="1.0" standalone="yes"?>
12328     <!DOCTYPE p [
12329     <!ENTITY % para SYSTEM "p">
12330     %para;
12331     <!ATTLIST p a CDATA "&entity;">
12332     ]>
12333     <p/>
12334 wakaba 1.48 @@@c:erred: <[xp|wf-entity-declared]> { (5, 22)..(5, 29); }
12335 wakaba 1.21 @@@enImplNote:
12336     The <XML::ATTLIST> declaration is processed since
12337     it is a <XA::standalone> document.
12338     @@XMLTest:
12339     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.-3.test
12340     @@@DEnt:
12341     @@@@test:value:
12342     <?xml version="1.0" standalone="no"?>
12343     <!DOCTYPE p [
12344     <!ATTLIST p a CDATA "&entity;">
12345     <!ENTITY % para SYSTEM "p">
12346     %para;
12347     ]>
12348     <p/>
12349 wakaba 1.48 @@@c:erred: <[xp|wf-entity-declared]> { (3, 22)..(3, 29); }
12350 wakaba 1.21 @@@enImplNote:
12351     Is this well-formed? It has a parameter entity reference,
12352     therefore, it does not violates Entity Declared WFC, isn't it?
12353    
12354     Note that Firefox 1.5 and Opera 9 TP1 reports that this document has a
12355     fatal error (also note that they does not support unexpanded).
12356    
12357     See also:
12358     <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>
12359     @@XMLTest:
12360     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.-3.2.test
12361     @@@DEnt:
12362     @@@@test:value:
12363     <?xml version="1.0" standalone="no"?>
12364     <!DOCTYPE p [
12365 wakaba 1.25 <!ATTLIST p b CDATA #IMPLIED>
12366 wakaba 1.21 <!ENTITY % para SYSTEM "p">
12367     %para;
12368     <!ATTLIST p a CDATA "&entity;">
12369     ]>
12370     <p c="d"/>
12371 wakaba 1.25 @@@c:erred:
12372 wakaba 1.48 <[xp|warning-attribute-definition-not-processed]> { (6, 13)..(6, 30); }
12373 wakaba 1.21 @@@test:domTree:
12374     document {
12375     document-type {
12376     element-type-definition {
12377 wakaba 1.25 node-name: 'p';
12378 wakaba 1.21 attribute-definition {
12379     node-name: 'b';
12380     }
12381     }
12382     }
12383     element {
12384     attribute {
12385     node-name: 'c';
12386     text-content: 'd';
12387     }
12388     }
12389     }
12390     @@@enImplNote:
12391     The second <XML::ATTLIST> declaration is read but not processed
12392     and its <XML::&entity;> general entity reference violates
12393     entity declared validty constraint rather than well-formedness
12394     constraint.
12395     @@XMLTest:
12396     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.-4.test
12397     @@@DEnt:
12398     @@@@test:value:
12399     <!DOCTYPE p [
12400     <!ATTLIST p a CDATA "&entity;">
12401     <!ENTITY % para SYSTEM "p">
12402     %para;
12403     ]>
12404     <p/>
12405 wakaba 1.48 @@@c:erred: <[xp|wf-entity-declared]> { (2, 22)..(2, 29); }
12406 wakaba 1.21 @@XMLTest:
12407     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.-4.2.test
12408     @@@DEnt:
12409     @@@@test:value:
12410     <!DOCTYPE p [
12411 wakaba 1.25 <!ATTLIST p b CDATA #IMPLIED>
12412 wakaba 1.21 <!ENTITY % para SYSTEM "p">
12413     %para;
12414     <!ATTLIST p a CDATA "&entity;">
12415     ]>
12416     <p c="d"/>
12417 wakaba 1.25 @@@c:erred:
12418 wakaba 1.48 <[xp|warning-attribute-definition-not-processed]> { (5, 13)..(5, 30); }
12419 wakaba 1.21 @@@test:domTree:
12420     document {
12421     document-type {
12422     element-type-definition {
12423 wakaba 1.25 node-name: 'p';
12424 wakaba 1.21 attribute-definition {
12425     node-name: 'b';
12426     }
12427     }
12428     }
12429     element {
12430     attribute {
12431     node-name: 'c';
12432     text-content: 'd';
12433     }
12434     }
12435     }
12436     @@XMLTest:
12437     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.5.test
12438     @@@DEnt:
12439     @@@@test:value:
12440     <?xml version="1.0" standalone="yes"?>
12441     <!DOCTYPE p SYSTEM "dtd" [
12442     <!ATTLIST p a CDATA "&entity;">
12443     ]>
12444     <p/>
12445 wakaba 1.48 @@@c:erred: <[xp|wf-entity-declared]> { (3, 22)..(3, 29); }
12446 wakaba 1.21 @@@enImplNote:
12447     This document has an error - result is implementation dependent.
12448     @@XMLTest:
12449     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.-5.test
12450     @@@DEnt:
12451     @@@@test:value:
12452     <?xml version="1.0" standalone="no"?>
12453     <!DOCTYPE p SYSTEM "dtd" [
12454     <!ATTLIST p a CDATA "&entity;">
12455     ]>
12456     <p/>
12457     @@@test:domTree:
12458     document {
12459     document-type {
12460     element-type-definition {
12461     node-name: 'p';
12462     attribute-definition {
12463     node-name: 'a';
12464     general-entity-reference {
12465     node-name: 'entity';
12466 wakaba 1.34 manakai-expanded: false;
12467 wakaba 1.21 }
12468     }
12469     }
12470     }
12471     element {
12472     attribute {
12473     node-name: 'a';
12474     specified: false;
12475     general-entity-reference {
12476     node-name: 'entity';
12477 wakaba 1.34 manakai-expanded: false;
12478 wakaba 1.21 }
12479     }
12480     }
12481     }
12482     @@@enImplNote:
12483     This document has an error - result is implementation dependent.
12484     @@XMLTest:
12485     @@@QName: xp.attlist.attval.ger.entity.declared.standalone.-6.test
12486     @@@DEnt:
12487     @@@@test:value:
12488     <!DOCTYPE p SYSTEM "dtd" [
12489     <!ATTLIST p a CDATA "&entity;">
12490     ]>
12491     <p/>
12492     @@@test:domTree:
12493     document {
12494     document-type {
12495     element-type-definition {
12496     node-name: 'p';
12497     attribute-definition {
12498     node-name: 'a';
12499     general-entity-reference {
12500     node-name: 'entity';
12501 wakaba 1.34 manakai-expanded: false;
12502 wakaba 1.21 }
12503     }
12504     }
12505     }
12506     element {
12507     attribute {
12508     node-name: 'a';
12509     specified: false;
12510     general-entity-reference {
12511     node-name: 'entity';
12512 wakaba 1.34 manakai-expanded: false;
12513 wakaba 1.21 }
12514     }
12515     }
12516     }
12517     @@@enImplNote:
12518     This document has an error - result is implementation dependent.
12519    
12520 wakaba 1.19 @@enImplNote:
12521     {TODO:: Entity declared WFC for
12522 wakaba 1.20
12523     - General entity references in entity value??
12524 wakaba 1.19
12525     }
12526    
12527 wakaba 1.23 @@XMLTest:
12528     @@@QName: xp.element.content.parsed.entity.reference.test
12529     @@@DEnt:
12530     @@@@test:value:
12531     <!DOCTYPE p [
12532     <!NOTATION n SYSTEM "notation">
12533     <!ENTITY ext SYSTEM "system" NDATA n>
12534     ]>
12535     <p>&ext;</p>
12536 wakaba 1.48 @@@c:erred: <[xp|wf-parsed-entity]> { (5, 4)..(5, 8); }
12537 wakaba 1.23 @@XMLTest:
12538     @@@QName: xp.attval.parsed.entity.reference.test
12539     @@@DEnt:
12540     @@@@test:value:
12541     <!DOCTYPE p [
12542     <!NOTATION n SYSTEM "notation">
12543     <!ENTITY ext SYSTEM "system" NDATA n>
12544     ]>
12545     <p a="&ext;"/>
12546 wakaba 1.48 # @@@c:erred: <[xp|wf-parsed-entity]> { (5, 7)..(5, 11); }
12547     @@@c:erred: <[xp|wf-no-external-entity-references]> { (5, 7)..(5, 11); }
12548 wakaba 1.23 @@XMLTest:
12549     @@@QName: xp.element.content.reptxt.parsed.entity.reference.test
12550     @@@DEnt:
12551     @@@@test:value:
12552     <!DOCTYPE p [
12553     <!NOTATION n SYSTEM "notation">
12554     <!ENTITY ext SYSTEM "system" NDATA n>
12555     <!ENTITY c "&#x26;ext;">
12556     ]>
12557     <p>&c;</p>
12558 wakaba 1.48 @@@c:erred: <[xp|wf-parsed-entity]> { (1, 1)..(1, 5); }
12559 wakaba 1.23 @@XMLTest:
12560     @@@QName: xp.attval.reptxt.parsed.entity.reference.test
12561     @@@DEnt:
12562     @@@@test:value:
12563     <!DOCTYPE p [
12564     <!NOTATION n SYSTEM "notation">
12565     <!ENTITY ext SYSTEM "system" NDATA n>
12566     <!ENTITY c "&#x26;ext;">
12567     ]>
12568     <p a="&c;"/>
12569 wakaba 1.34 @@@cfg:entity-replacement-tree: 0
12570 wakaba 1.48 @@@c:erred: <[xp|wf-no-external-entity-references]> { (1, 1)..(1, 5); }
12571 wakaba 1.34 @@XMLTest:
12572     @@@QName: xp.attval.reptxt.parsed.entity.reference.2.test
12573     @@@DEnt:
12574     @@@@test:value:
12575     <!DOCTYPE p [
12576     <!NOTATION n SYSTEM "notation">
12577     <!ENTITY ext SYSTEM "system" NDATA n>
12578     <!ENTITY c "&#x26;ext;">
12579     ]>
12580     <p a="&c;"/>
12581     @@@cfg:entity-replacement-tree: 1
12582 wakaba 1.48 @@@c:erred: <[xp|wf-no-external-entity-references]> { (1, 1)..(1, 5); }
12583 wakaba 1.23 @@@c:erred:
12584 wakaba 1.48 @@@@@: <[xp|wf-parsed-entity]> { }
12585 wakaba 1.23 @@@@enImplNote: During entity node construction.
12586     @@XMLTest:
12587     @@@QName: xp.element.content.entval.parsed.entity.reference.test
12588     @@@DEnt:
12589     @@@@test:value:
12590     <!DOCTYPE p [
12591     <!NOTATION n SYSTEM "notation">
12592     <!ENTITY ext SYSTEM "system" NDATA n>
12593     <!ENTITY c "&ext;">
12594     ]>
12595     <p>&c;</p>
12596 wakaba 1.48 @@@c:erred: <[xp|wf-parsed-entity]> { }
12597 wakaba 1.23 @@XMLTest:
12598     @@@QName: xp.attval.entval.parsed.entity.reference.test
12599     @@@DEnt:
12600     @@@@test:value:
12601     <!DOCTYPE p [
12602     <!NOTATION n SYSTEM "notation">
12603     <!ENTITY ext SYSTEM "system" NDATA n>
12604     <!ENTITY c "&ext;">
12605     ]>
12606     <p a="&c;"/>
12607 wakaba 1.34 @@@cfg:entity-replacement-tree: 0
12608 wakaba 1.48 @@@c:erred: <[xp|wf-no-external-entity-references]> { }
12609 wakaba 1.34 @@XMLTest:
12610     @@@QName: xp.attval.entval.parsed.entity.reference.2.test
12611     @@@DEnt:
12612     @@@@test:value:
12613     <!DOCTYPE p [
12614     <!NOTATION n SYSTEM "notation">
12615     <!ENTITY ext SYSTEM "system" NDATA n>
12616     <!ENTITY c "&ext;">
12617     ]>
12618     <p a="&c;"/>
12619     @@@cfg:entity-replacement-tree: 1
12620 wakaba 1.48 @@@c:erred: <[xp|wf-no-external-entity-references]> { }
12621     @@@c:erred: <[xp|wf-parsed-entity]> { }
12622 wakaba 1.23
12623     @@XMLTest:
12624     @@@QName: xp.element.content.no.recursion.direct.test
12625     @@@DEnt:
12626     @@@@test:value:
12627     <!DOCTYPE p [
12628     <!ENTITY c "&c;">
12629     ]>
12630     <p>&c;</p>
12631 wakaba 1.48 @@@c:erred: <[xp|wf-no-recursion]> { (1, 1)..(1, 3); }
12632 wakaba 1.23 @@XMLTest:
12633     @@@QName: xp.element.content.no.recursion.indirect.test
12634     @@@DEnt:
12635     @@@@test:value:
12636     <!DOCTYPE p [
12637     <!ENTITY d "&c;">
12638     <!ENTITY c "&d;">
12639     ]>
12640     <p>&c;</p>
12641 wakaba 1.48 @@@c:erred: <[xp|wf-no-recursion]> { /* |d| */ (1, 1)..(1, 3); }
12642 wakaba 1.23 @@XMLTest:
12643     @@@QName: xp.attval.no.recursion.direct.test
12644     @@@DEnt:
12645     @@@@test:value:
12646     <!DOCTYPE p [
12647     <!ENTITY c "&c;">
12648     ]>
12649     <p a="&c;"/>
12650 wakaba 1.48 @@@c:erred: <[xp|wf-no-recursion]> { (1, 1)..(1, 3); }
12651 wakaba 1.23 @@XMLTest:
12652     @@@QName: xp.attval.no.recursion.indirect.test
12653     @@@DEnt:
12654     @@@@test:value:
12655     <!DOCTYPE p [
12656     <!ENTITY d "&c;">
12657     <!ENTITY c "&d;">
12658     ]>
12659     <p a="&c;"/>
12660 wakaba 1.48 @@@c:erred: <[xp|wf-no-recursion]> { /* |d| */ (1, 1)..(1, 3); }
12661 wakaba 1.23 @@XMLTest:
12662     @@@QName: xp.reptxt.element.content.no.recursion.direct.test
12663     @@@DEnt:
12664     @@@@test:value:
12665     <!DOCTYPE p [
12666     <!ENTITY c "&c;">
12667     <!ENTITY e "&#x26;c;">
12668     ]>
12669     <p>&e;</p>
12670 wakaba 1.48 @@@c:erred: <[xp|wf-no-recursion]> { /* |e| */ (1, 1)..(1, 3); }
12671 wakaba 1.23 @@XMLTest:
12672     @@@QName: xp.reptxt.element.content.no.recursion.indirect.test
12673     @@@DEnt:
12674     @@@@test:value:
12675     <!DOCTYPE p [
12676     <!ENTITY d "&c;">
12677     <!ENTITY c "&d;">
12678     <!ENTITY e "&#x26;c;">
12679     ]>
12680     <p>&e;</p>
12681 wakaba 1.48 @@@c:erred: <[xp|wf-no-recursion]> { /* |d| */ (1, 1)..(1, 3); }
12682 wakaba 1.23 @@XMLTest:
12683     @@@QName: xp.reptxt.attval.no.recursion.direct.test
12684     @@@DEnt:
12685     @@@@test:value:
12686     <!DOCTYPE p [
12687     <!ENTITY c "&c;">
12688     <!ENTITY e "&#x26;c;">
12689     ]>
12690     <p a="&e;"/>
12691 wakaba 1.48 @@@c:erred: <[xp|wf-no-recursion]> { /* |e| */ (1, 1)..(1, 3); }
12692 wakaba 1.23 @@XMLTest:
12693     @@@QName: xp.reptxt.attval.no.recursion.indirect.test
12694     @@@DEnt:
12695     @@@@test:value:
12696     <!DOCTYPE p [
12697     <!ENTITY d "&c;">
12698     <!ENTITY c "&d;">
12699     <!ENTITY e "&#x26;c;">
12700     ]>
12701     <p a="&e;"/>
12702 wakaba 1.48 @@@c:erred: <[xp|wf-no-recursion]> { /* |d| */ (1, 1)..(1, 3); }
12703 wakaba 1.23
12704     @@XMLTest:
12705     @@@QName: xp.ENTITY.system.ndata.name.test
12706     @@@DEnt:
12707     @@@@test:value:
12708     <!DOCTYPE a [
12709     <!NOTATION n SYSTEM "n">
12710     <!ENTITY % e SYSTEM "sys" NDATA n>
12711     ]><a/>
12712 wakaba 1.48 @@@c:erred: <[xp|wf-syntax-error]> { (3, 26)..(3, 30); }
12713 wakaba 1.23 @@XMLTest:
12714     @@@QName: xp.ENTITY.public.ndata.name.test
12715     @@@DEnt:
12716     @@@@test:value:
12717     <!DOCTYPE a [
12718     <!NOTATION n SYSTEM "n">
12719     <!ENTITY % e PUBLIC "pub" "sys" NDATA n>
12720     ]><a/>
12721 wakaba 1.48 @@@c:erred: <[xp|wf-syntax-error]> { (3, 33)..(3, 37); }
12722 wakaba 1.23 @@XMLTest:
12723     @@@QName: xp.ENTITY.public.ndata.name.-1.test
12724     @@@DEnt:
12725     @@@@test:value:
12726     <!DOCTYPE a [
12727     <!NOTATION n SYSTEM "n">
12728     <!ENTITY % e PUBLIC "pub" "sys" >
12729     ]><a/>
12730     @@@test:domTree:
12731     document { }
12732    
12733     @@XMLTest:
12734     @@@QName: xp.ENTITY.pubid.1.test
12735     @@@DEnt:
12736     @@@@test:value:
12737     <!DOCTYPE a [
12738     <!ENTITY e PUBLIC "p" "s">
12739     ]><a/>
12740     @@@test:domTree:
12741     document {
12742     document-type {
12743     general-entity {
12744     node-name: 'e';
12745     public-id: 'p';
12746     system-id: 's';
12747     }
12748     }
12749     element { }
12750     }
12751     @@XMLTest:
12752     @@@QName: xp.ENTITY.pubid.2.test
12753     @@@DEnt:
12754     @@@@test:value:
12755     <!DOCTYPE a [
12756     <!ENTITY e PUBLIC " p " "s">
12757     ]><a/>
12758     @@@test:domTree:
12759     document {
12760     document-type {
12761     general-entity {
12762     node-name: 'e';
12763     public-id: 'p';
12764     system-id: 's';
12765     }
12766     }
12767     element { }
12768     }
12769     @@XMLTest:
12770     @@@QName: xp.ENTITY.pubid.3.test
12771     @@@DEnt:
12772     @@@@test:value:
12773     <!DOCTYPE a [
12774     <!ENTITY e PUBLIC " p $u000Aq$u000A " "s">
12775     ]><a/>
12776     @@@test:domTree:
12777     document {
12778     document-type {
12779     general-entity {
12780     node-name: 'e';
12781     public-id: 'p q';
12782     system-id: 's';
12783     }
12784     }
12785     element { }
12786     }
12787     @@XMLTest:
12788     @@@QName: xp.ENTITY.pubid.4.test
12789     @@@DEnt:
12790     @@@@test:value:
12791     <!DOCTYPE a [
12792     <!ENTITY e PUBLIC " p $u000D$u000Aq" "s">
12793     ]><a/>
12794     @@@test:domTree:
12795     document {
12796     document-type {
12797     general-entity {
12798     node-name: 'e';
12799     public-id: 'p q';
12800     system-id: 's';
12801     }
12802     }
12803     element { }
12804     }
12805     @@XMLTest:
12806     @@@QName: xp.ENTITY.pubid.5.test
12807     @@@DEnt:
12808     @@@@test:value:
12809     <?xml version="1.1"?>
12810     <!DOCTYPE a [
12811 wakaba 1.27 <!ENTITY e PUBLIC " p $u000D$u0085q" "s">
12812 wakaba 1.23 ]><a/>
12813     @@@test:domTree:
12814     document {
12815     document-type {
12816     general-entity {
12817     node-name: 'e';
12818     public-id: 'p q';
12819     system-id: 's';
12820     }
12821     }
12822     element { }
12823     }
12824    
12825 wakaba 1.24 @@XMLTest:
12826     @@@QName: xp.ENTITY.ignored.test
12827     @@@DEnt:
12828     @@@@test:value:
12829     <!DOCTYPE a [
12830     <!ENTITY e "a">
12831     <!ENTITY e "b">
12832     ]><a/>
12833 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
12834 wakaba 1.24 @@@test:domTree:
12835     document {
12836     document-type {
12837     general-entity {
12838     node-name: 'e';
12839     text-content: 'a';
12840     }
12841     }
12842     element { }
12843     }
12844     @@@c:erred:
12845 wakaba 1.48 <[xp|warning-entity-declaration-ignored]> { (3, 1)..(3, 15); }
12846 wakaba 1.24 @@XMLTest:
12847     @@@QName: xp.ENTITY.ignored.2.test
12848     @@@DEnt:
12849     @@@@test:value:
12850     <!DOCTYPE a [
12851     <!ENTITY % e "a">
12852     <!ENTITY % e "b">
12853     ]><a/>
12854     @@@test:domTree:
12855     document { }
12856     @@@c:erred:
12857 wakaba 1.48 <[xp|warning-entity-declaration-ignored]> { (3, 1)..(3, 17); }
12858 wakaba 1.24
12859     @@XMLTest:
12860     @@@QName: xp.ENTITY.predefined.1.test
12861     @@@DEnt:
12862     @@@@test:value:
12863     <!DOCTYPE a [
12864     <!ENTITY lt "&#38;#60;">
12865     <!ENTITY gt "&#62;">
12866     <!ENTITY amp "&#38;#38;">
12867     <!ENTITY apos "&#39;">
12868     <!ENTITY quot "&#34;">
12869     <!ENTITY e "f">
12870     ]><a>&lt;&gt;&amp;&apos;&quot;</a>
12871 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
12872 wakaba 1.24 @@@test:domTree:
12873     document {
12874     document-type {
12875     general-entity {
12876     node-name: 'e';
12877     text-content: 'f';
12878     }
12879     }
12880     element {
12881     text-content: '<>&' U+0027 '"';
12882     }
12883     }
12884     @@XMLTest:
12885     @@@QName: xp.ENTITY.predefined.2.test
12886     @@@DEnt:
12887     @@@@test:value:
12888     <!DOCTYPE a [
12889     <!ENTITY lt "&#38;#60;">
12890     <!ENTITY gt "&#x26;#62;">
12891     <!ENTITY amp "&#38;#38;">
12892     <!ENTITY apos "&#x26;#39;">
12893     <!ENTITY quot "&#x26;#34;">
12894     <!ENTITY e "f">
12895     ]><a>&lt;&gt;&amp;&apos;&quot;</a>
12896 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
12897 wakaba 1.24 @@@test:domTree:
12898     document {
12899     document-type {
12900     general-entity {
12901     node-name: 'e';
12902     text-content: 'f';
12903     }
12904     }
12905     element {
12906     text-content: '<>&' U+0027 '"';
12907     }
12908     }
12909     @@XMLTest:
12910     @@@QName: xp.ENTITY.predefined.3.test
12911     @@@DEnt:
12912     @@@@test:value:
12913     <!DOCTYPE a [
12914     <!ENTITY lt "&#60;">
12915     <!ENTITY gt "&#62;">
12916     <!ENTITY amp "&#38;">
12917     <!ENTITY apos "&#39;">
12918     <!ENTITY quot "&#34;">
12919     <!ENTITY e "f">
12920     ]><a>&lt;&gt;&amp;&apos;&quot;</a>
12921 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
12922 wakaba 1.48 @@@c:erred: <[xp|error-malformed-predefined-entity]> { (2, 1)..(2, 24); }
12923     @@@c:erred: <[xp|error-malformed-predefined-entity]> { (4, 1)..(4, 24); }
12924 wakaba 1.24 @@@test:domTree:
12925     document {
12926     document-type {
12927     general-entity {
12928     node-name: 'e';
12929     text-content: 'f';
12930     }
12931     }
12932     element {
12933     text-content: '<>&' U+0027 '"';
12934     }
12935     }
12936     @@XMLTest:
12937     @@@QName: xp.ENTITY.predefined.4.test
12938     @@@DEnt:
12939     @@@@test:value:
12940     <!DOCTYPE a [
12941     <!ENTITY lt "1">
12942     <!ENTITY gt "2">
12943     <!ENTITY amp "3">
12944     <!ENTITY apos "4">
12945     <!ENTITY quot "5">
12946     <!ENTITY e "f">
12947     ]><a>&lt;&gt;&amp;&apos;&quot;</a>
12948 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
12949 wakaba 1.48 @@@c:erred: <[xp|error-malformed-predefined-entity]> { (2, 1)..(2, 24); }
12950     @@@c:erred: <[xp|error-malformed-predefined-entity]> { (3, 1)..(3, 24); }
12951     @@@c:erred: <[xp|error-malformed-predefined-entity]> { (4, 1)..(4, 24); }
12952     @@@c:erred: <[xp|error-malformed-predefined-entity]> { (5, 1)..(5, 24); }
12953     @@@c:erred: <[xp|error-malformed-predefined-entity]> { (6, 1)..(6, 24); }
12954 wakaba 1.24 @@@test:domTree:
12955     document {
12956     document-type {
12957     general-entity {
12958     node-name: 'e';
12959     text-content: 'f';
12960     }
12961     }
12962     element {
12963     text-content: '<>&' U+0027 '"';
12964     }
12965     }
12966     @@XMLTest:
12967     @@@QName: xp.ENTITY.predefined.5.test
12968     @@@DEnt:
12969     @@@@test:value:
12970     <!DOCTYPE a [
12971     <!ENTITY lt SYSTEM "1">
12972     <!ENTITY gt SYSTEM "2">
12973     <!ENTITY amp SYSTEM "3">
12974     <!ENTITY apos SYSTEM "4">
12975     <!ENTITY quot SYSTEM "5">
12976     <!ENTITY e "f">
12977     ]><a>&lt;&gt;&amp;&apos;&quot;</a>
12978 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
12979 wakaba 1.48 @@@c:erred: <[xp|error-internal-predefined-entity]> { (2, 1)..(2, 27); }
12980     @@@c:erred: <[xp|error-internal-predefined-entity]> { (3, 1)..(3, 27); }
12981     @@@c:erred: <[xp|error-internal-predefined-entity]> { (4, 1)..(4, 27); }
12982     @@@c:erred: <[xp|error-internal-predefined-entity]> { (5, 1)..(5, 27); }
12983     @@@c:erred: <[xp|error-internal-predefined-entity]> { (6, 1)..(6, 27); }
12984 wakaba 1.24 @@@test:domTree:
12985     document {
12986     document-type {
12987     general-entity {
12988     node-name: 'e';
12989     text-content: 'f';
12990     }
12991     }
12992     element {
12993     text-content: '<>&' U+0027 '"';
12994     }
12995     }
12996     @@XMLTest:
12997     @@@QName: xp.ENTITY.predefined.6.test
12998     @@@DEnt:
12999     @@@@test:value:
13000     <!DOCTYPE a [
13001     <!ENTITY % lt SYSTEM "1">
13002     <!ENTITY % gt SYSTEM "2">
13003     <!ENTITY % amp SYSTEM "3">
13004     <!ENTITY % apos SYSTEM "4">
13005     <!ENTITY % quot SYSTEM "5">
13006     <!ENTITY e "f">
13007     ]><a>&lt;&gt;&amp;&apos;&quot;</a>
13008 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
13009 wakaba 1.24 @@@test:domTree:
13010     document {
13011     document-type {
13012     general-entity {
13013     node-name: 'e';
13014     text-content: 'f';
13015     }
13016     }
13017     element {
13018     text-content: '<>&' U+0027 '"';
13019     }
13020     }
13021     @@XMLTest:
13022     @@@QName: xp.ENTITY.predefined.7.test
13023     @@@DEnt:
13024     @@@@test:value:
13025     <!DOCTYPE a [
13026     <!ENTITY lt "&#38;#x3C;">
13027     <!ENTITY gt "&#x3E;">
13028     <!ENTITY amp "&#38;#x26;">
13029     <!ENTITY apos "&#x27;">
13030     <!ENTITY quot "&#x22;">
13031     <!ENTITY e "f">
13032     ]><a>&lt;&gt;&amp;&apos;&quot;</a>
13033 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
13034 wakaba 1.24 @@@test:domTree:
13035     document {
13036     document-type {
13037     general-entity {
13038     node-name: 'e';
13039     text-content: 'f';
13040     }
13041     }
13042     element {
13043     text-content: '<>&' U+0027 '"';
13044     }
13045     }
13046     @@XMLTest:
13047     @@@QName: xp.ENTITY.predefined.8.test
13048     @@@DEnt:
13049     @@@@test:value:
13050     <!DOCTYPE a [
13051     <!ENTITY lt "&#38;#x3c;">
13052     <!ENTITY gt "&#x3e;">
13053     <!ENTITY amp "&#38;#x26;">
13054     <!ENTITY apos "&#x27;">
13055     <!ENTITY quot "&#x22;">
13056     <!ENTITY e "f">
13057     ]><a>&lt;&gt;&amp;&apos;&quot;</a>
13058 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
13059 wakaba 1.24 @@@test:domTree:
13060     document {
13061     document-type {
13062     general-entity {
13063     node-name: 'e';
13064     text-content: 'f';
13065     }
13066     }
13067     element {
13068     text-content: '<>&' U+0027 '"';
13069     }
13070     }
13071     @@XMLTest:
13072     @@@QName: xp.ENTITY.predefined.9.test
13073     @@@DEnt:
13074     @@@@test:value:
13075     <!DOCTYPE a [
13076     <!ENTITY lt "&#38;#x00003C;">
13077     <!ENTITY gt "&#x0003E;">
13078     <!ENTITY amp "&#38;#x026;">
13079     <!ENTITY apos "&#x000027;">
13080     <!ENTITY quot "&#x0022;">
13081     <!ENTITY e "f">
13082     ]><a>&lt;&gt;&amp;&apos;&quot;</a>
13083 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
13084 wakaba 1.24 @@@test:domTree:
13085     document {
13086     document-type {
13087     general-entity {
13088     node-name: 'e';
13089     text-content: 'f';
13090     }
13091     }
13092     element {
13093     text-content: '<>&' U+0027 '"';
13094     }
13095     }
13096     @@XMLTest:
13097     @@@QName: xp.ENTITY.predefined.10.test
13098     @@@DEnt:
13099     @@@@test:value:
13100     <!DOCTYPE a [
13101     <!ENTITY lt "&#38;#00060;">
13102     <!ENTITY gt "&#062;">
13103     <!ENTITY amp "&#38;#000038;">
13104     <!ENTITY apos "&#0000039;">
13105     <!ENTITY quot "&#0034;">
13106     <!ENTITY e "f">
13107     ]><a>&lt;&gt;&amp;&apos;&quot;</a>
13108 wakaba 1.34 @@@cfg:entity-replacement-tree: 1
13109 wakaba 1.24 @@@test:domTree:
13110     document {
13111     document-type {
13112     general-entity {
13113     node-name: 'e';
13114     text-content: 'f';
13115     }
13116     }
13117     element {
13118     text-content: '<>&' U+0027 '"';
13119     }
13120     }
13121    
13122 wakaba 1.25 @@XMLTest:
13123     @@@QName: xp.processed.1.test
13124     @@@DEnt:
13125     @@@@test:value:
13126     <a/>
13127     @@@test:domTree:
13128     document {
13129     all-declarations-processed: true;
13130     element { }
13131     }
13132     @@XMLTest:
13133     @@@QName: xp.processed.2.test
13134     @@@DEnt:
13135     @@@@test:value:
13136     <!DOCTYPE a [
13137     <!ENTITY e "f">
13138     <!ATTLIST a b NMTOKEN " c ">
13139     ]><a>&e;</a>
13140     @@@test:domTree:
13141     document {
13142     document-type {
13143     general-entity {
13144     node-name: 'e';
13145     }
13146     element-type-definition {
13147     node-name: 'a';
13148     attribute-definition {
13149     node-name: 'b';
13150     }
13151     }
13152     }
13153     all-declarations-processed: true;
13154     element {
13155     attribute {
13156     node-name: 'b';
13157     node-value: 'c';
13158     }
13159     text-content: 'f';
13160     }
13161     }
13162     @@XMLTest:
13163     @@@QName: xp.processed.3.test
13164     @@@DEnt:
13165     @@@@test:value:
13166     <!DOCTYPE a [
13167     <!ENTITY % p SYSTEM "p">
13168     %p;
13169     <!ENTITY e "f">
13170     <!ATTLIST a b NMTOKEN " c ">
13171     ]><a d="e">&e;</a>
13172     @@@test:domTree:
13173     document {
13174     document-type { }
13175     all-declarations-processed: false;
13176     element {
13177     attribute {
13178     node-name: 'd';
13179     node-value: 'e';
13180     }
13181     general-entity-reference {
13182     node-name: 'e';
13183 wakaba 1.34 manakai-expanded: false;
13184 wakaba 1.25 }
13185     }
13186     }
13187     @@@c:erred:
13188 wakaba 1.48 <[xp|warning-entity-declaration-not-processed]> { (4, 1)..(4, 20); }
13189 wakaba 1.25 @@@c:erred:
13190 wakaba 1.48 <[xp|warning-attribute-definition-not-processed]> { (5, 13)..(5, 31); }
13191 wakaba 1.25 @@XMLTest:
13192     @@@QName: xp.processed.4.test
13193     @@@DEnt:
13194     @@@@test:value:
13195     <?xml version="1.1" standalone="yes"?>
13196     <!DOCTYPE a [
13197     <!ENTITY % p SYSTEM "p">
13198     %p;
13199     <!ENTITY e "f">
13200     <!ATTLIST a b NMTOKEN " c ">
13201     ]><a>&e;</a>
13202     @@@test:domTree:
13203     document {
13204     document-type {
13205     general-entity {
13206     node-name: 'e';
13207     }
13208     element-type-definition {
13209     node-name: 'a';
13210     attribute-definition {
13211     node-name: 'b';
13212     }
13213     }
13214     }
13215     all-declarations-processed: false;
13216     element {
13217     attribute {
13218     node-name: 'b';
13219     node-value: 'c';
13220     }
13221     text-content: 'f';
13222     }
13223     }
13224     @@XMLTest:
13225     @@@QName: xp.processed.5.test
13226     @@@DEnt:
13227     @@@@test:value:
13228     <!DOCTYPE a SYSTEM "p" [
13229     <!ENTITY e "f">
13230     <!ATTLIST a b NMTOKEN " c ">
13231     ]><a>&e;</a>
13232     @@@test:domTree:
13233     document {
13234     document-type {
13235     general-entity {
13236     node-name: 'e';
13237     }
13238     element-type-definition {
13239     node-name: 'a';
13240     attribute-definition {
13241     node-name: 'b';
13242     }
13243     }
13244     }
13245     all-declarations-processed: false;
13246     element {
13247     attribute {
13248     node-name: 'b';
13249     node-value: 'c';
13250     }
13251     text-content: 'f';
13252     }
13253     }
13254    
13255     @@XMLTest:
13256     @@@QName: xp.PEs.in.internal.subset.1.test
13257     @@@DEnt:
13258     @@@@test:value:
13259     <!DOCTYPE a [
13260     <!ENTITY % p " ">
13261 wakaba 1.26 <!ENTITY % q "%p;">
13262 wakaba 1.25 ]><a/>
13263 wakaba 1.48 @@@c:erred: <[xp|wf-pes-in-internal-subset]> { (3, 15)..(3, 17); }
13264 wakaba 1.25 @@XMLTest:
13265     @@@QName: xp.PEs.in.internal.subset.2.test
13266     @@@DEnt:
13267     @@@@test:value:
13268     <!DOCTYPE a [
13269     <!ENTITY % p " ">
13270 wakaba 1.26 <!ENTITY % q '%p;'>
13271 wakaba 1.25 ]><a/>
13272 wakaba 1.48 @@@c:erred: <[xp|wf-pes-in-internal-subset]> { (3, 15)..(3, 17); }
13273 wakaba 1.25
13274 wakaba 1.26 @@XMLTest:
13275     @@@QName: xp.name.pitarget.content.1.0.2.test
13276     @@@DEnt:
13277     @@@@test:value:
13278     <?xml version="1.0"?>
13279     <p>
13280     <?$u3001$u3002?>
13281     </p>
13282 wakaba 1.48 @@@c:erred: <[xp|wf-invalid-character-in-node-name]> { (3, 3)..(3, 4); }
13283 wakaba 1.26 @@XMLTest:
13284     @@@QName: xp.name.pitarget.content.1.1.2.test
13285     @@@DEnt:
13286     @@@@test:value:
13287     <?xml version="1.1"?>
13288     <p>$
13289     <?$u3001$u3002?>$
13290     </p>
13291     @@@test:domTree:
13292     document {
13293     xml-version: '1.1';
13294     element {
13295     pi {
13296     node-name: U+3001 U+3002;
13297 wakaba 1.14 }
13298 wakaba 1.12 }
13299 wakaba 1.26 }
13300     @@XMLTest:
13301     @@@QName: xp.name.pitarget.content.1.0.3.test
13302     @@@DEnt:
13303     @@@@test:value:
13304     <?xml version="1.0"?>
13305     <p>
13306     <?$u3005b?>
13307     </p>
13308 wakaba 1.48 @@@c:erred: <[xp|wf-invalid-character-in-node-name]> { (3, 3)..(3, 4); }
13309 wakaba 1.26 @@XMLTest:
13310     @@@QName: xp.name.pitarget.content.1.1.3.test
13311     @@@DEnt:
13312     @@@@test:value:
13313     <?xml version="1.1"?>
13314     <p>$
13315     <?$u3005b?>$
13316     </p>
13317     @@@test:domTree:
13318     document {
13319     xml-version: '1.1';
13320     element {
13321     pi {
13322     node-name: U+3005 'b';
13323 wakaba 1.12 }
13324     }
13325 wakaba 1.26 }
13326     @@XMLTest:
13327     @@@QName: xp.name.pitarget.content.names.1.0.1.test
13328     @@@DEnt:
13329     @@@@test:value:
13330     <?xml version="1.0"?>
13331     <p>
13332     <?a:b?>
13333     </p>
13334 wakaba 1.48 @@@c:erred: <[xp|nswf-legal-ncname]> { (3, 3)..(3, 5); }
13335 wakaba 1.26 @@XMLTest:
13336     @@@QName: xp.name.pitarget.content.names.1.1.1.test
13337     @@@DEnt:
13338     @@@@test:value:
13339     <?xml version="1.1"?>
13340     <p>
13341     <?a:b?>
13342     </p>
13343 wakaba 1.48 @@@c:erred: <[xp|nswf-legal-ncname]> { (3, 3)..(3, 5); }
13344 wakaba 1.26 @@XMLTest:
13345     @@@QName: xp.name.pitarget.intsubset.1.0.2.test
13346     @@@DEnt:
13347     @@@@test:value:
13348     <?xml version="1.0"?>
13349     <!DOCTYPE p [
13350     <?$u3001$u3002?>
13351     ]><p/>
13352 wakaba 1.48 @@@c:erred: <[xp|wf-invalid-character-in-node-name]> { (3, 3)..(3, 4); }
13353 wakaba 1.26 @@XMLTest:
13354     @@@QName: xp.name.pitarget.intsubset.1.1.2.test
13355     @@@DEnt:
13356     @@@@test:value:
13357     <?xml version="1.1"?>
13358     <!DOCTYPE p [
13359     <?$u3001$u3002?>
13360     ]><p/>
13361     @@@test:domTree:
13362     document {
13363     xml-version: '1.1';
13364     document-type {
13365     pi {
13366     node-name: U+3001 U+3002;
13367     }
13368     }
13369     element { }
13370     }
13371     @@XMLTest:
13372     @@@QName: xp.name.pitarget.intsubset.1.0.3.test
13373     @@@DEnt:
13374     @@@@test:value:
13375     <?xml version="1.0"?>
13376     <!DOCTYPE p [
13377     <?$u3005b?>
13378     ]><p/>
13379 wakaba 1.48 @@@c:erred: <[xp|wf-invalid-character-in-node-name]> { (3, 3)..(3, 4); }
13380 wakaba 1.26 @@XMLTest:
13381     @@@QName: xp.name.pitarget.intsubset.1.1.3.test
13382     @@@DEnt:
13383     @@@@test:value:
13384     <?xml version="1.1"?>
13385     <!DOCTYPE p [
13386     <?$u3005b?>
13387     ]><p/>
13388     @@@test:domTree:
13389     document {
13390     xml-version: '1.1';
13391     document-type {
13392     pi {
13393     node-name: U+3005 'b';
13394     }
13395     }
13396     element { }
13397     }
13398     @@XMLTest:
13399     @@@QName: xp.name.pitarget.intsubset.names.1.0.1.test
13400     @@@DEnt:
13401     @@@@test:value:
13402     <?xml version="1.0"?>
13403     <!DOCTYPE p [
13404     <?a:b?>
13405     ]><p/>
13406 wakaba 1.48 @@@c:erred: <[xp|nswf-legal-ncname]> { (3, 3)..(3, 5); }
13407 wakaba 1.26 @@XMLTest:
13408     @@@QName: xp.name.pitarget.intsubset.names.1.1.1.test
13409     @@@DEnt:
13410     @@@@test:value:
13411     <?xml version="1.1"?>
13412     <!DOCTYPE p [
13413     <?a:b?>
13414     ]><p/>
13415 wakaba 1.48 @@@c:erred: <[xp|nswf-legal-ncname]> { (3, 3)..(3, 5); }
13416 wakaba 1.26 @@XMLTest:
13417     @@@QName: xp.name.doctypedecl.stag.etag.1.0.2.test
13418     @@@DEnt:
13419     @@@@test:value:
13420     <?xml version="1.0"?>
13421     <!DOCTYPE $u3001$u3002>
13422     <$u3001$u3002>
13423     </$u3001$u3002>
13424 wakaba 1.48 @@@c:erred: <[xp|wf-invalid-character-in-node-name]> { (2, 11)..(2, 12); }
13425     @@@c:erred: <[xp|wf-invalid-character-in-node-name]> { (3, 2)..(3, 3); }
13426     # @@@c:erred: <[xp|wf-invalid-character-in-node-name]> { (4, 3)..(4, 4); }
13427 wakaba 1.26 @@XMLTest:
13428     @@@QName: xp.name.doctypedecl.stag.etag.1.1.2.test
13429     @@@DEnt:
13430     @@@@test:value:
13431     <?xml version="1.1"?>
13432     <!DOCTYPE $u3001$u3002>
13433     <$u3001$u3002>
13434     </$u3001$u3002>
13435     @@@test:domTree:
13436     document {
13437     xml-version: '1.1';
13438     document-type {
13439     node-name: U+3001 U+3002;
13440     }
13441     element {
13442     node-name: U+3001 U+3002;
13443     }
13444     }
13445     @@XMLTest:
13446     @@@QName: xp.name.doctypedecl.stag.etag.1.0.3.test
13447     @@@DEnt:
13448     @@@@test:value:
13449     <?xml version="1.0"?>
13450     <!DOCTYPE $u3005b>
13451     <$u3005b>
13452     </$u3005b>
13453 wakaba 1.48 @@@c:erred: <[xp|wf-invalid-character-in-node-name]> { (2, 11)..(2, 12); }
13454     @@@c:erred: <[xp|wf-invalid-character-in-node-name]> { (3, 2)..(3, 3); }
13455     # @@@c:erred: <[xp|wf-invalid-character-in-node-name]> { (4, 3)..(4, 4); }
13456 wakaba 1.26 @@XMLTest:
13457     @@@QName: xp.name.doctype.decl.stag.etag.1.1.3.test
13458     @@@DEnt:
13459     @@@@test:value:
13460     <?xml version="1.1"?>
13461     <!DOCTYPE $u3005b>
13462     <$u3005b>
13463     </$u3005b>
13464     @@@test:domTree:
13465     document {
13466     xml-version: '1.1';
13467     document-type {
13468     node-name: U+3005 'b';
13469     }
13470     element {
13471     node-name: U+3005 'b';
13472     }
13473     }
13474     @@XMLTest:
13475     @@@QName: xp.name.doctypedecl.stag.etag.names.1.0.1.test
13476     @@@DEnt:
13477     @@@@test:value:
13478     <?xml version="1.0"?>
13479     <!DOCTYPE a:b>
13480     <a:b xmlns:a="http://a.example/">
13481     </a:b>
13482     @@@test:domTree:
13483     document {
13484     xml-version: '1.0';
13485     document-type {
13486     node-name: 'a:b';
13487     }
13488     element {
13489     prefix: 'a';
13490     local-name: 'b';
13491     namespace-uri: 'http://a.example/';
13492     attribute {
13493     namespace-uri: 'http://www.w3.org/2000/xmlns/';
13494     prefix: 'xmlns';
13495     local-name: 'a';
13496     value: 'http://a.example/';
13497     specified: true;
13498     }
13499     }
13500     }
13501     @@XMLTest:
13502     @@@QName: xp.name.doctypedecl.stag.etag.names.1.1.1.test
13503     @@@DEnt:
13504     @@@@test:value:
13505     <?xml version="1.1"?>
13506     <!DOCTYPE a:b>
13507     <a:b xmlns:a="http://a.example/">
13508     </a:b>
13509     @@@test:domTree:
13510     document {
13511     xml-version: '1.1';
13512     document-type {
13513     node-name: 'a:b';
13514     }
13515     element {
13516     prefix: 'a';
13517     local-name: 'b';
13518     namespace-uri: 'http://a.example/';
13519     attribute {
13520     namespace-uri: 'http://www.w3.org/2000/xmlns/';
13521     prefix: 'xmlns';
13522     local-name: 'a';
13523     specified: true;
13524     }
13525     }
13526     }
13527     @@XMLTest:
13528     @@@QName: xp.name.doctypedecl.stag.etag.names.1.0.2.test
13529     @@@DEnt:
13530     @@@@test:value:
13531     <?xml version="1.0"?>
13532     <!DOCTYPE :ab>
13533     <:ab>
13534     </:ab>
13535 wakaba 1.48 @@@c:erred: <[xp|nswf-legal-qname]> { (2, 11)..(2, 13); }
13536     @@@c:erred: <[xp|nswf-legal-qname]> { (3, 2)..(3, 4); }
13537     @@@c:erred: <[xp|nsc-prefix-declared]> { /* prefix || */ }
13538 wakaba 1.26 @@XMLTest:
13539     @@@QName: xp.name.doctypedecl.stag.etag.names.1.1.2.test
13540     @@@DEnt:
13541     @@@@test:value:
13542     <?xml version="1.1"?>
13543     <!DOCTYPE :ab>
13544     <:ab>
13545     </:ab>
13546 wakaba 1.48 @@@c:erred: <[xp|nswf-legal-qname]> { (2, 11)..(2, 13); }
13547     @@@c:erred: <[xp|nswf-legal-qname]> { (3, 2)..(3, 4); }
13548     @@@c:erred: <[xp|nsc-prefix-declared]> { /* prefix || */ }
13549 wakaba 1.26 @@XMLTest:
13550     @@@QName: xp.name.doctypedecl.stag.etag.names.1.0.3.test
13551     @@@DEnt:
13552     @@@@test:value:
13553     <?xml version="1.0"?>
13554     <!DOCTYPE a:$u3005>
13555     <a:$u3005 xmlns:a="http://a.example/">
13556     </a:$u3005>
13557 wakaba 1.48 @@@c:erred: <[xp|nswf-legal-qname]> { (2, 11)..(2, 13); }
13558     @@@c:erred: <[xp|nswf-legal-qname]> { (3, 2)..(3, 4); }
13559 wakaba 1.26 @@XMLTest:
13560     @@@QName: xp.name.doctypedecl.stag.etag.names.1.1.3.test
13561     @@@DEnt:
13562     @@@@test:value:
13563     <?xml version="1.1"?>
13564     <!DOCTYPE a:$u3005>
13565     <a:$u3005 xmlns:a="http://a.example/">
13566     </a:$u3005>
13567     @@@test:domTree:
13568     document {
13569     xml-version: '1.1';
13570     document-type {
13571     node-name: 'a:' U+3005;
13572     }
13573     element {
13574     prefix: 'a';
13575     local-name: U+3005;
13576     namespace-uri: 'http://a.example/';
13577     attribute {
13578     namespace-uri: 'http://www.w3.org/2000/xmlns/';
13579     prefix: 'xmlns';
13580     local-name: 'a';
13581     value: 'http://a.example/';
13582     specified: true;
13583     }
13584     }
13585     }
13586     @@XMLTest:
13587     @@@QName: xp.name.doctypedecl.stag.etag.names.1.0.4.test
13588     @@@DEnt:
13589     @@@@test:value:
13590     <?xml version="1.0"?>
13591     <!DOCTYPE a:b>
13592     <a:b>
13593     </a:b>
13594 wakaba 1.48 @@@c:erred: <[xp|nsc-prefix-declared]> { (3, 1)..(3, 5); }
13595 wakaba 1.26 @@XMLTest:
13596     @@@QName: xp.name.doctypedecl.stag.etag.names.1.1.4.test
13597     @@@DEnt:
13598     @@@@test:value:
13599     <?xml version="1.1"?>
13600     <!DOCTYPE a:b>
13601     <a:b>
13602     </a:b>
13603 wakaba 1.48 @@@c:erred: <[xp|nsc-prefix-declared]> { (3, 1)..(3, 5); }
13604 wakaba 1.26 @@XMLTest:
13605     @@@QName: xp.name.emptyelemtag.1.0.2.test
13606     @@@DEnt:
13607     @@@@test:value:
13608     <?xml version="1.0"?>
13609     <$u3001$u3002/>
13610 wakaba 1.48 @@@c:erred: <[xp|wf-invalid-character-in-node-name]> { (2, 2)..(2, 3); }
13611 wakaba 1.26 @@XMLTest:
13612     @@@QName: xp.name.emptyelemtag.1.1.2.test
13613     @@@DEnt:
13614     @@@@test:value:
13615     <?xml version="1.1"?>
13616     <$u3001$u3002/>
13617     @@@test:domTree:
13618     document {
13619     xml-version: '1.1';
13620     element {
13621     node-name: U+3001 U+3002;
13622     }
13623     }
13624     @@XMLTest:
13625     @@@QName: xp.name.emptyelemtag.1.0.3.test
13626     @@@DEnt:
13627     @@@@test:value:
13628     <?xml version="1.0"?>
13629     <$u3005b/>
13630 wakaba 1.48 @@@c:erred: <[xp|wf-invalid-character-in-node-name]> { (2, 2)..(2, 3); }
13631 wakaba 1.26 @@XMLTest:
13632     @@@QName: xp.name.emptyelemtag.1.1.3.test
13633     @@@DEnt:
13634     @@@@test:value:
13635     <?xml version="1.1"?>
13636     <$u3005b/>
13637     @@@test:domTree:
13638     document {
13639     xml-version: '1.1';
13640     element {
13641     node-name: U+3005 'b';
13642     }
13643     }
13644     @@XMLTest:
13645     @@@QName: xp.name.emptyelemtag.names.1.0.1.test
13646     @@@DEnt:
13647     @@@@test:value:
13648     <?xml version="1.0"?>
13649     <a:b/>
13650 wakaba 1.48 @@@c:erred: <[xp|nsc-prefix-declared]> { (2, 1)..(2, 6); }
13651 wakaba 1.26 @@XMLTest:
13652     @@@QName: xp.name.emptyelemtag.names.1.1.1.test
13653     @@@DEnt:
13654     @@@@test:value:
13655     <?xml version="1.1"?>
13656     <a:b/>
13657 wakaba 1.48 @@@c:erred: <[xp|nsc-prefix-declared]> { (2, 1)..(2, 6); }
13658 wakaba 1.26 @@XMLTest:
13659     @@@QName: xp.name.attr.1.0.2.test
13660     @@@DEnt:
13661     @@@@test:value:
13662     <?xml version="1.0"?>
13663     <a $u3001$u3002=""/>
13664 wakaba 1.48 @@@c:erred: <[xp|wf-invalid-character-in-node-name]> { (2, 4)..(2, 5); }
13665 wakaba 1.26 @@XMLTest:
13666     @@@QName: xp.name.attr.1.1.2.test
13667     @@@DEnt:
13668     @@@@test:value:
13669     <?xml version="1.1"?>
13670     <a $u3001$u3002=""/>
13671     @@@test:domTree:
13672     document {
13673     xml-version: '1.1';
13674     element {
13675     attribute {
13676     node-name: U+3001 U+3002;
13677     }
13678     }
13679     }
13680     @@XMLTest:
13681     @@@QName: xp.name.attr.1.0.3.test
13682     @@@DEnt:
13683     @@@@test:value:
13684     <?xml version="1.0"?>
13685     <a $u3005b=""/>
13686 wakaba 1.48 @@@c:erred: <[xp|wf-invalid-character-in-node-name]> { (2, 4)..(2, 5); }
13687 wakaba 1.26 @@XMLTest:
13688     @@@QName: xp.name.attr.1.1.3.test
13689     @@@DEnt:
13690     @@@@test:value:
13691     <?xml version="1.1"?>
13692     <a $u3005b=""/>
13693     @@@test:domTree:
13694     document {
13695     xml-version: '1.1';
13696     element {
13697     attribute {
13698     node-name: U+3005 'b';
13699     }
13700     }
13701     }
13702     @@XMLTest:
13703     @@@QName: xp.name.attr.names.1.0.1.test
13704     @@@DEnt:
13705     @@@@test:value:
13706     <?xml version="1.0"?>
13707     <a a:b=""/>
13708 wakaba 1.48 @@@c:erred: <[xp|nsc-prefix-declared]> { (2, 1)..(2, 11); }
13709 wakaba 1.26 @@XMLTest:
13710     @@@QName: xp.name.attr.names.1.1.1.test
13711     @@@DEnt:
13712     @@@@test:value:
13713     <?xml version="1.1"?>
13714     <a a:b=""/>
13715 wakaba 1.48 @@@c:erred: <[xp|nsc-prefix-declared]> { (2, 1)..(2, 11); }
13716 wakaba 1.26 @@XMLTest:
13717     @@@QName: xp.name.attr.names.1.0.2.test
13718     @@@DEnt:
13719     @@@@test:value:
13720     <?xml version="1.0"?>
13721     <a :ab=""/>
13722 wakaba 1.48 @@@c:erred: <[xp|nswf-legal-qname]> { (2, 4)..(2, 6); }
13723     @@@c:erred: <[xp|nsc-prefix-declared]> { }
13724 wakaba 1.26 @@XMLTest:
13725     @@@QName: xp.name.attr.names.1.1.2.test
13726     @@@DEnt:
13727     @@@@test:value:
13728     <?xml version="1.1"?>
13729     <a :ab=""/>
13730 wakaba 1.48 @@@c:erred: <[xp|nswf-legal-qname]> { (2, 4)..(2, 6); }
13731     @@@c:erred: <[xp|nsc-prefix-declared]> { }
13732 wakaba 1.26 @@XMLTest:
13733     @@@QName: xp.name.attlist.1.0.2.test
13734     @@@DEnt:
13735     @@@@test:value:
13736     <?xml version="1.0"?>
13737     <!DOCTYPE p [
13738     <!NOTATION $u3001$u3002 SYSTEM "n">
13739     <!ATTLIST $u3001$u3002
13740     $u3001$u3002
13741     NOTATION
13742     ($u3001$u3002)
13743     #IMPLIED>
13744     ]><p/>
13745 wakaba 1.48 @@@c:erred: <[xp|wf-invalid-character-in-node-name]> { (3, 12)..(3, 13); }
13746     @@@c:erred: <[xp|wf-invalid-character-in-node-name]> { (4, 11)..(4, 12); }
13747     @@@c:erred: <[xp|wf-invalid-character-in-node-name]> { (5, 1)..(5, 2); }
13748     @@@c:erred: <[xp|wf-invalid-character-in-node-name]> { (7, 2)..(7, 3); }
13749 wakaba 1.26 @@XMLTest:
13750     @@@QName: xp.name.attlist.1.1.2.test
13751     @@@DEnt:
13752     @@@@test:value:
13753     <?xml version="1.1"?>
13754     <!DOCTYPE p [
13755     <!NOTATION $u3001$u3002 SYSTEM "n">
13756     <!ATTLIST $u3001$u3002
13757     $u3001$u3002
13758     NOTATION
13759     ($u3001$u3002)
13760     #IMPLIED>
13761     ]><p/>
13762     @@@test:domTree:
13763     document {
13764     xml-version: '1.1';
13765     document-type {
13766     notation {
13767     node-name: U+3001 U+3002;
13768     }
13769     element-type-definition {
13770     node-name: U+3001 U+3002;
13771     attribute-definition {
13772     node-name: U+3001 U+3002;
13773     allowed-tokens: DOMStringList (U+3001 U+3002);
13774     }
13775     }
13776     }
13777     element { }
13778     }
13779     @@XMLTest:
13780     @@@QName: xp.name.attlist.1.0.3.test
13781     @@@DEnt:
13782     @@@@test:value:
13783     <?xml version="1.0"?>
13784     <!DOCTYPE p [
13785     <!NOTATION $u3005b SYSTEM "n">
13786     <!ATTLIST $u3005b
13787     $u3005b
13788     NOTATION
13789     ($u3005b)
13790     #IMPLIED>
13791     ]><p/>
13792 wakaba 1.48 @@@c:erred: <[xp|wf-invalid-character-in-node-name]> { (3, 12)..(3, 13); }
13793     @@@c:erred: <[xp|wf-invalid-character-in-node-name]> { (4, 11)..(4, 12); }
13794     @@@c:erred: <[xp|wf-invalid-character-in-node-name]> { (5, 1)..(5, 2); }
13795     @@@c:erred: <[xp|wf-invalid-character-in-node-name]> { (7, 2)..(7, 3); }
13796 wakaba 1.26 @@XMLTest:
13797     @@@QName: xp.name.attlist.1.1.3.test
13798     @@@DEnt:
13799     @@@@test:value:
13800     <?xml version="1.1"?>
13801     <!DOCTYPE p [
13802     <!NOTATION $u3005b SYSTEM "n">
13803     <!ATTLIST $u3005b
13804     $u3005b
13805     NOTATION
13806     ($u3005b)
13807     #IMPLIED>
13808     ]><p/>
13809     @@@test:domTree:
13810     document {
13811     xml-version: '1.1';
13812     document-type {
13813     notation {
13814     node-name: U+3005 'b';
13815     }
13816     element-type-definition {
13817     node-name: U+3005 'b';
13818     attribute-definition {
13819     node-name: U+3005 'b';
13820     allowed-tokens: DOMStringList (U+3005 'b');
13821     }
13822     }
13823     }
13824     element { }
13825     }
13826     @@XMLTest:
13827     @@@QName: xp.name.attlist.names.1.0.1.test
13828     @@@DEnt:
13829     @@@@test:value:
13830     <?xml version="1.0"?>
13831     <!DOCTYPE p [
13832     <!NOTATION a:b SYSTEM "n">
13833     <!ATTLIST a:b
13834     a:b
13835     NOTATION
13836     (a:b)
13837     #IMPLIED>
13838     ]><p/>
13839 wakaba 1.48 @@@c:erred: <[xp|nswf-legal-ncname]> { (3, 12)..(3, 14); }
13840     @@@c:erred: <[xp|nswf-legal-ncname]> { (7, 2)..(7, 4); }
13841 wakaba 1.26 @@XMLTest:
13842     @@@QName: xp.name.attlist.names.1.1.1.test
13843     @@@DEnt:
13844     @@@@test:value:
13845     <?xml version="1.1"?>
13846     <!DOCTYPE p [
13847     <!NOTATION a:b SYSTEM "n">
13848     <!ATTLIST a:b
13849     a:b
13850     NOTATION
13851     (a:b)
13852     #IMPLIED>
13853     ]><p/>
13854 wakaba 1.48 @@@c:erred: <[xp|nswf-legal-ncname]> { (3, 12)..(3, 14); }
13855     @@@c:erred: <[xp|nswf-legal-ncname]> { (7, 2)..(7, 4); }
13856 wakaba 1.26 @@XMLTest:
13857     @@@QName: xp.name.attlist.names.1.0.2.test
13858     @@@DEnt:
13859     @@@@test:value:
13860     <?xml version="1.0"?>
13861     <!DOCTYPE p [
13862     <!NOTATION :ab SYSTEM "n">
13863     <!ATTLIST :ab
13864     :ab
13865     NOTATION
13866     (:ab)
13867     #IMPLIED>
13868     ]><p/>
13869 wakaba 1.48 @@@c:erred: <[xp|nswf-legal-ncname]> { (3, 12)..(3, 14); }
13870     @@@c:erred: <[xp|nswf-legal-qname]> { (4, 11)..(4, 13); }
13871     @@@c:erred: <[xp|nswf-legal-qname]> { (5, 1)..(5, 3); }
13872     @@@c:erred: <[xp|nswf-legal-ncname]> { (7, 2)..(7, 4); }
13873 wakaba 1.26 @@XMLTest:
13874     @@@QName: xp.name.attlist.names.1.1.2.test
13875     @@@DEnt:
13876     @@@@test:value:
13877     <?xml version="1.1"?>
13878     <!DOCTYPE p [
13879     <!NOTATION :ab SYSTEM "n">
13880     <!ATTLIST :ab
13881     :ab
13882     NOTATION
13883     (:ab)
13884     #IMPLIED>
13885     ]><p/>
13886 wakaba 1.48 @@@c:erred: <[xp|nswf-legal-ncname]> { (3, 12)..(3, 14); }
13887     @@@c:erred: <[xp|nswf-legal-qname]> { (4, 11)..(4, 13); }
13888     @@@c:erred: <[xp|nswf-legal-qname]> { (5, 1)..(5, 3); }
13889     @@@c:erred: <[xp|nswf-legal-ncname]> { (7, 2)..(7, 4); }
13890 wakaba 1.26 @@XMLTest:
13891     @@@QName: xp.name.gent.1.0.2.test
13892     @@@DEnt:
13893     @@@@test:value:
13894     <?xml version="1.0"?>
13895     <!DOCTYPE p [
13896     <!ENTITY $u3001$u3002 "n">
13897     ]>
13898     <p a="&$u3001$u3002;">
13899     &$u3001$u3002;
13900     </p>
13901 wakaba 1.48 @@@c:erred: <[xp|wf-invalid-character-in-node-name]> { (3, 10)..(3, 11); }
13902     @@@c:erred: <[xp|wf-invalid-character-in-node-name]> { (5, 8)..(5, 9); }
13903     @@@c:erred: <[xp|wf-invalid-character-in-node-name]> { (6, 2)..(6, 3); }
13904 wakaba 1.26 @@XMLTest:
13905     @@@QName: xp.name.ger.1.1.2.test
13906     @@@DEnt:
13907     @@@@test:value:
13908     <?xml version="1.1"?>
13909     <!DOCTYPE p [
13910     <!ENTITY $u3001$u3002 "n">
13911     ]>
13912     <p a="&$u3001$u3002;">$
13913     &$u3001$u3002;$
13914     </p>
13915     @@@test:domTree:
13916     document {
13917     xml-version: '1.1';
13918     document-type {
13919     general-entity {
13920     node-name: U+3001 U+3002;
13921     }
13922     }
13923     element {
13924     attribute {
13925     node-name: 'a';
13926     general-entity-reference {
13927     node-name: U+3001 U+3002;
13928     }
13929     }
13930     general-entity-reference {
13931     node-name: U+3001 U+3002;
13932     }
13933     }
13934     }
13935     @@XMLTest:
13936     @@@QName: xp.name.ger.1.0.3.test
13937     @@@DEnt:
13938     @@@@test:value:
13939     <?xml version="1.0"?>
13940     <!DOCTYPE p [
13941     <!ENTITY $u3005b "n">
13942     ]>
13943     <p a="&$u3005b;">
13944     &$u3005b;
13945     </p>
13946 wakaba 1.48 @@@c:erred: <[xp|wf-invalid-character-in-node-name]> { (3, 10)..(3, 11); }
13947     @@@c:erred: <[xp|wf-invalid-character-in-node-name]> { (5, 8)..(5, 9); }
13948     @@@c:erred: <[xp|wf-invalid-character-in-node-name]> { (6, 2)..(6, 3); }
13949 wakaba 1.26 @@XMLTest:
13950     @@@QName: xp.name.ger.1.1.3.test
13951     @@@DEnt:
13952     @@@@test:value:
13953     <?xml version="1.1"?>
13954     <!DOCTYPE p [
13955     <!ENTITY $u3005b "n">
13956     ]>
13957     <p a="&$u3005b;">$
13958     &$u3005b;$
13959     </p>
13960     @@@test:domTree:
13961     document {
13962     xml-version: '1.1';
13963     document-type {
13964     general-entity {
13965     node-name: U+3005 'b';
13966     }
13967     }
13968     element {
13969     attribute {
13970     node-name: 'a';
13971     general-entity-reference {
13972     node-name: U+3005 'b';
13973     }
13974     }
13975     general-entity-reference {
13976     node-name: U+3005 'b';
13977     }
13978     }
13979     }
13980     @@XMLTest:
13981     @@@QName: xp.name.ger.names.1.0.1.test
13982     @@@DEnt:
13983     @@@@test:value:
13984     <?xml version="1.0"?>
13985     <!DOCTYPE p [
13986     <!ENTITY a:b "n">
13987     ]>
13988     <p a="&a:b;">
13989     &a:b;
13990     </p>
13991 wakaba 1.48 @@@c:erred: <[xp|nswf-legal-ncname]> { (3, 10)..(3, 12); }
13992     @@@c:erred: <[xp|nswf-legal-ncname]> { (5, 8)..(5, 10); }
13993     @@@c:erred: <[xp|nswf-legal-ncname]> { (6, 2)..(6, 4); }
13994 wakaba 1.26 @@XMLTest:
13995     @@@QName: xp.name.ger.names.1.1.1.test
13996     @@@DEnt:
13997     @@@@test:value:
13998     <?xml version="1.1"?>
13999     <!DOCTYPE p [
14000     <!ENTITY a:b "n">
14001     ]>
14002     <p a="&a:b;">
14003     &a:b;
14004     </p>
14005 wakaba 1.48 @@@c:erred: <[xp|nswf-legal-ncname]> { (3, 10)..(3, 12); }
14006     @@@c:erred: <[xp|nswf-legal-ncname]> { (5, 8)..(5, 10); }
14007     @@@c:erred: <[xp|nswf-legal-ncname]> { (6, 2)..(6, 4); }
14008 wakaba 1.26 @@XMLTest:
14009     @@@QName: xp.name.ndata.1.0.2.test
14010     @@@DEnt:
14011     @@@@test:value:
14012     <?xml version="1.0"?>
14013     <!DOCTYPE p [
14014     <!NOTATION $u3001$u3002 SYSTEM "n">
14015     <!ENTITY e SYSTEM "s" NDATA $u3001$u3002>
14016     ]><p/>
14017 wakaba 1.48 @@@c:erred: <[xp|wf-invalid-character-in-node-name]> { (3, 12)..(3, 13); }
14018     @@@c:erred: <[xp|wf-invalid-character-in-node-name]> { (4, 29)..(4, 30); }
14019 wakaba 1.26 @@XMLTest:
14020     @@@QName: xp.name.ndata.1.1.2.test
14021     @@@DEnt:
14022     @@@@test:value:
14023     <?xml version="1.1"?>
14024     <!DOCTYPE p [
14025     <!NOTATION $u3001$u3002 SYSTEM "n">
14026     <!ENTITY e SYSTEM "s" NDATA $u3001$u3002>
14027     ]><p/>
14028     @@@test:domTree:
14029     document {
14030     xml-version: '1.1';
14031     document-type {
14032     notation {
14033     node-name: U+3001 U+3002;
14034     }
14035     general-entity {
14036     node-name: 'e';
14037     notation-name: U+3001 U+3002;
14038     }
14039     }
14040     element { }
14041     }
14042     @@XMLTest:
14043     @@@QName: xp.name.ndata.1.0.3.test
14044     @@@DEnt:
14045     @@@@test:value:
14046     <?xml version="1.0"?>
14047     <!DOCTYPE p [
14048     <!NOTATION $u3005b SYSTEM "n">
14049     <!ENTITY e SYSTEM "s" NDATA $u3005b>
14050     ]><p/>
14051 wakaba 1.48 @@@c:erred: <[xp|wf-invalid-character-in-node-name]> { (3, 12)..(3, 13); }
14052     @@@c:erred: <[xp|wf-invalid-character-in-node-name]> { (4, 29)..(4, 30); }
14053 wakaba 1.26 @@XMLTest:
14054     @@@QName: xp.name.ndata.1.1.3.test
14055     @@@DEnt:
14056     @@@@test:value:
14057     <?xml version="1.1"?>
14058     <!DOCTYPE p [
14059     <!NOTATION $u3005b SYSTEM "n">
14060     <!ENTITY e SYSTEM "s" NDATA $u3005b>
14061     ]><p/>
14062     @@@test:domTree:
14063     document {
14064     xml-version: '1.1';
14065     document-type {
14066     notation {
14067     node-name: U+3005 'b';
14068     }
14069     general-entity {
14070     node-name: 'e';
14071     notation-name: U+3005 'b';
14072     }
14073     }
14074     element { }
14075     }
14076     @@XMLTest:
14077     @@@QName: xp.name.ndata.names.1.0.1.test
14078     @@@DEnt:
14079     @@@@test:value:
14080     <?xml version="1.0"?>
14081     <!DOCTYPE p [
14082     <!NOTATION a:b SYSTEM "n">
14083     <!ENTITY e SYSTEM "s" NDATA a:b>
14084     ]><p/>
14085 wakaba 1.48 @@@c:erred: <[xp|nswf-legal-ncname]> { (3, 12)..(3, 14); }
14086     @@@c:erred: <[xp|nswf-legal-ncname]> { (4, 29)..(4, 31); }
14087 wakaba 1.26 @@XMLTest:
14088     @@@QName: xp.name.ndata.names.1.1.1.test
14089     @@@DEnt:
14090     @@@@test:value:
14091     <?xml version="1.1"?>
14092     <!DOCTYPE p [
14093     <!NOTATION a:b SYSTEM "n">
14094     <!ENTITY e SYSTEM "s" NDATA a:b>
14095     ]><p/>
14096 wakaba 1.48 @@@c:erred: <[xp|nswf-legal-ncname]> { (3, 12)..(3, 14); }
14097     @@@c:erred: <[xp|nswf-legal-ncname]> { (4, 29)..(4, 31); }
14098 wakaba 1.26
14099     @@enImplNote:
14100     @@@ddid: wf-invalid-character-in-node-name
14101     @@@@:
14102     {ISSUE::
14103     {P:: Tests required for:
14104    
14105     - <CODE::Name> in element type declaration
14106    
14107     - <CODE::Name> in model group
14108    
14109     - <CODE::Name> in parameter entity declaration
14110    
14111     - <CODE::Name> in parameter entity reference
14112    
14113     }
14114     }
14115    
14116     @@XMLTest:
14117     @@@QName: xp.NOTATION.1.test
14118     @@@DEnt:
14119     @@@@test:value:
14120     <!DOCTYPE p [
14121     <!NOTATION n SYSTEM "m">
14122     ]><p/>
14123     @@@test:domTree:
14124     document {
14125     document-type {
14126     notation {
14127     node-name: 'n';
14128     public-id: null;
14129     system-id: 'm';
14130     }
14131     }
14132     element { }
14133     }
14134     @@XMLTest:
14135     @@@QName: xp.NOTATION.2.test
14136     @@@DEnt:
14137     @@@@test:value:
14138     <!DOCTYPE p [
14139     <!NOTATION n PUBLIC "m">
14140     ]><p/>
14141     @@@test:domTree:
14142     document {
14143     document-type {
14144     notation {
14145     node-name: 'n';
14146     system-id: null;
14147     public-id: 'm';
14148     }
14149     }
14150     element { }
14151     }
14152     @@XMLTest:
14153     @@@QName: xp.NOTATION.3.test
14154     @@@DEnt:
14155     @@@@test:value:
14156     <!DOCTYPE p [
14157     <!NOTATION n PUBLIC "m" "l">
14158     ]><p/>
14159     @@@test:domTree:
14160     document {
14161     document-type {
14162     notation {
14163     node-name: 'n';
14164     public-id: 'm';
14165     system-id: 'l';
14166     }
14167     }
14168     element { }
14169     }
14170     @@XMLTest:
14171     @@@QName: xp.NOTATION.4.test
14172     @@@DEnt:
14173     @@@@test:value:
14174     <!DOCTYPE p [
14175     <!NOTATION n SYSTEM "m">
14176     <!NOTATION n SYSTEM "l">
14177     ]><p/>
14178 wakaba 1.48 @@@c:erred: <[xp|vc-unique-notation-name]> { (3, 1)..(3, 24); }
14179 wakaba 1.26 @@@test:domTree:
14180     document {
14181     document-type {
14182     notation {
14183     node-name: 'n';
14184     system-id: 'm';
14185     }
14186     }
14187     element { }
14188     }
14189    
14190     @@XMLTest:
14191     @@@QName: xp.names.1.test
14192     @@@DEnt:
14193     @@@@test:value:
14194     <p xmlns="http://1.example/" a="b"/>
14195     @@@test:domTree:
14196     document {
14197     element {
14198     prefix: null;
14199     local-name: 'p';
14200     namespace-uri: 'http://1.example/';
14201     attribute {
14202     prefix: null;
14203     local-name: 'xmlns';
14204     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14205     specified: true;
14206     }
14207     attribute {
14208     prefix: null;
14209     local-name: 'a';
14210     specified: true;
14211     }
14212     }
14213     }
14214     @@XMLTest:
14215     @@@QName: xp.names.2.test
14216     @@@DEnt:
14217     @@@@test:value:
14218     <p xmlns:a="http://1.example/" a="b" a:a="c"/>
14219     @@@test:domTree:
14220     document {
14221     element {
14222     prefix: null;
14223     local-name: 'p';
14224     namespace-uri: null;
14225     attribute {
14226     prefix: 'xmlns';
14227     local-name: 'a';
14228     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14229     specified: true;
14230     }
14231     attribute {
14232     prefix: null;
14233     local-name: 'a';
14234     specified: true;
14235     }
14236     attribute {
14237     prefix: 'a';
14238     local-name: 'a';
14239     namespace-uri: 'http://1.example/';
14240     specified: true;
14241     }
14242     }
14243     }
14244     @@XMLTest:
14245     @@@QName: xp.names.3.test
14246     @@@DEnt:
14247     @@@@test:value:
14248     <a:p xmlns:a="http://1.example/" a="b" a:a="c"/>
14249     @@@test:domTree:
14250     document {
14251     element {
14252     prefix: 'a';
14253     local-name: 'p';
14254     namespace-uri: 'http://1.example/';
14255     attribute {
14256     prefix: 'xmlns';
14257     local-name: 'a';
14258     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14259     specified: true;
14260     }
14261     attribute {
14262     prefix: null;
14263     local-name: 'a';
14264     specified: true;
14265     }
14266     attribute {
14267     prefix: 'a';
14268     local-name: 'a';
14269     namespace-uri: 'http://1.example/';
14270     specified: true;
14271     }
14272     }
14273     }
14274     @@XMLTest:
14275     @@@QName: xp.names.5.test
14276     @@@DEnt:
14277     @@@@test:value:
14278     <p xmlns:a="http://1.example/">$
14279     <a:q/>$
14280     </p>
14281     @@@test:domTree:
14282     document {
14283     element {
14284     prefix: null;
14285     local-name: 'p';
14286     namespace-uri: null;
14287     attribute {
14288     prefix: 'xmlns';
14289     local-name: 'a';
14290     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14291     specified: true;
14292     }
14293     element {
14294     prefix: 'a';
14295     local-name: 'q';
14296     namespace-uri: 'http://1.example/';
14297     }
14298     }
14299     }
14300     @@XMLTest:
14301     @@@QName: xp.names.6.test
14302     @@@DEnt:
14303     @@@@test:value:
14304     <p xmlns:a="http://1.example/">$
14305     <q a:b="c"/>$
14306     </p>
14307     @@@test:domTree:
14308     document {
14309     element {
14310     prefix: null;
14311     local-name: 'p';
14312     namespace-uri: null;
14313     attribute {
14314     prefix: 'xmlns';
14315     local-name: 'a';
14316     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14317     specified: true;
14318     }
14319     element {
14320     prefix: null;
14321     local-name: 'q';
14322     namespace-uri: null;
14323     attribute {
14324     prefix: 'a';
14325     local-name: 'b';
14326     namespace-uri: 'http://1.example/';
14327     specified: true;
14328     }
14329     }
14330     }
14331     }
14332     @@XMLTest:
14333     @@@QName: xp.names.7.test
14334     @@@DEnt:
14335     @@@@test:value:
14336     <p xmlns:a="http://1.example/">$
14337     <q a:b="c" xmlns:a="http://2.example/"/>$
14338     </p>
14339     @@@test:domTree:
14340     document {
14341     element {
14342     prefix: null;
14343     local-name: 'p';
14344     namespace-uri: null;
14345     attribute {
14346     prefix: 'xmlns';
14347     local-name: 'a';
14348     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14349     specified: true;
14350     }
14351     element {
14352     prefix: null;
14353     local-name: 'q';
14354     namespace-uri: null;
14355     attribute {
14356     prefix: 'a';
14357     local-name: 'b';
14358     namespace-uri: 'http://2.example/';
14359     specified: true;
14360     }
14361     attribute {
14362     prefix: 'xmlns';
14363     local-name: 'a';
14364     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14365     specified: true;
14366     }
14367     }
14368     }
14369     }
14370    
14371     @@XMLTest:
14372     @@@QName: xp.names.undeclare.1.test
14373     @@@DEnt:
14374     @@@@test:value:
14375     <p xmlns="http://1.example/">$
14376     <q xmlns="">$
14377     <r xmlns="http://2.example/"/>$
14378     </q>$
14379     </p>
14380     @@@test:domTree:
14381     document {
14382     element {
14383     prefix: null;
14384     local-name: 'p';
14385     namespace-uri: 'http://1.example/';
14386     attribute {
14387     prefix: null;
14388     local-name: 'xmlns';
14389     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14390     specified: true;
14391     }
14392     element {
14393     prefix: null;
14394     local-name: 'q';
14395     namespace-uri: null;
14396     attribute {
14397     prefix: null;
14398     local-name: 'xmlns';
14399     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14400     specified: true;
14401     }
14402     element {
14403     prefix: null;
14404     local-name: 'r';
14405     namespace-uri: 'http://2.example/';
14406     attribute {
14407     prefix: null;
14408     local-name: 'xmlns';
14409     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14410     specified: true;
14411     }
14412     }
14413     }
14414     }
14415     }
14416    
14417     @@XMLTest:
14418     @@@QName: xp.names.undeclare.1.0.1.test
14419     @@@DEnt:
14420     @@@@test:value:
14421     <?xml version="1.0"?>
14422     <a:p xmlns:a="http://1.example/">$
14423     <q xmlns:a="">$
14424     <a:r xmlns:a="http://2.example/"/>$
14425     </q>$
14426     </a:p>
14427 wakaba 1.48 @@@c:erred: <[xp|nswf-empty-namespace-name]> { (2, 34)..(2, 47); }
14428 wakaba 1.26 @@XMLTest:
14429     @@@QName: xp.names.undeclare.1.1.1.test
14430     @@@DEnt:
14431     @@@@test:value:
14432     <?xml version="1.1"?>
14433     <a:p xmlns:a="http://1.example/">$
14434     <q xmlns:a="">$
14435     <a:r xmlns:a="http://2.example/"/>$
14436     </q>$
14437     </a:p>
14438     @@@test:domTree:
14439     document {
14440     element {
14441     prefix: 'a';
14442     local-name: 'p';
14443     namespace-uri: 'http://1.example/';
14444     attribute {
14445     prefix: 'xmlns';
14446     local-name: 'a';
14447     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14448     specified: true;
14449     }
14450     element {
14451     prefix: null;
14452     local-name: 'q';
14453     namespace-uri: null;
14454     attribute {
14455     prefix: 'xmlns';
14456     local-name: 'a';
14457     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14458     specified: true;
14459     }
14460     element {
14461     prefix: 'a';
14462     local-name: 'r';
14463     namespace-uri: 'http://2.example/';
14464     attribute {
14465     prefix: 'xmlns';
14466     local-name: 'a';
14467     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14468     specified: true;
14469     }
14470     }
14471     }
14472     }
14473     }
14474     @@XMLTest:
14475     @@@QName: xp.names.undeclare.1.1.2.test
14476     @@@DEnt:
14477     @@@@test:value:
14478     <?xml version="1.1"?>
14479     <a:p xmlns:a="http://1.example/">$
14480     <q xmlns:a="">$
14481     <a:r/>$
14482     </q>$
14483     </a:p>
14484 wakaba 1.48 @@@c:erred: <[xp|nsc-prefix-declared]> { (2, 48)..(2, 53); }
14485 wakaba 1.26
14486     @@XMLTest:
14487     @@@QName: xp.names.xml.prefix.1.test
14488     @@@DEnt:
14489     @@@@test:value:
14490     <a xmlns:xml="http://www.w3.org/XML/1998/namespace"/>
14491     @@@test:domTree:
14492     document {
14493     element {
14494     attribute {
14495     prefix: 'xmlns';
14496     local-name: 'xml';
14497     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14498     }
14499     }
14500     }
14501     @@XMLTest:
14502     @@@QName: xp.names.xml.prefix.2.test
14503     @@@DEnt:
14504     @@@@test:value:
14505     <a xmlns:xml="a"/>
14506 wakaba 1.48 @@@c:erred: <[xp|nsc-reserved-prefix-xml]> { (1, 1)..(1, 18); }
14507 wakaba 1.26 @@XMLTest:
14508     @@@QName: xp.names.xml.prefix.3.test
14509     @@@DEnt:
14510     @@@@test:value:
14511     <a xmlns:a="http://www.w3.org/XML/1998/namespace"
14512     />
14513 wakaba 1.48 @@@c:erred: <[xp|nsc-reserved-namespace-name-xml]> { (1, 1)..(2, 2); }
14514 wakaba 1.26 @@XMLTest:
14515     @@@QName: xp.names.xml.prefix.4.test
14516     @@@DEnt:
14517     @@@@test:value:
14518     <a xml:lang="ja"/>
14519     @@@test:domTree:
14520     document {
14521     element {
14522     attribute {
14523     prefix: 'xml';
14524     local-name: 'lang';
14525     namespace-uri: 'http://www.w3.org/XML/1998/namespace';
14526     }
14527     }
14528     }
14529    
14530     @@XMLTest:
14531     @@@QName: xp.names.prefix.declared.1.test
14532     @@@DEnt:
14533     @@@@test:value:
14534     <!DOCTYPE a [
14535     <!ATTLIST a
14536     b:c CDATA "d"
14537     >
14538     ]>
14539     <a/>
14540 wakaba 1.48 @@@c:erred: <[xp|nsc-prefix-declared]> { (6, 1)..(6, 4); }
14541 wakaba 1.26
14542     @@XMLTest:
14543     @@@QName: xp.names.xmlns.reserved.1.test
14544     @@@DEnt:
14545     @@@@test:value:
14546     <a xmlns:xmlns="http://www.w3.org/2000/xmlns/"
14547     />
14548 wakaba 1.48 @@@c:erred: <[xp|nsc-reserved-prefix-xmlns]> { (1, 1)..(2, 2); }
14549     @@@c:erred: <[xp|nsc-reserved-namespace-name-xmlns]> { (1, 1)..(2, 2); }
14550 wakaba 1.26 @@XMLTest:
14551     @@@QName: xp.names.xmlns.reserved.2.test
14552     @@@DEnt:
14553     @@@@test:value:
14554     <a xmlns:xmlns="a"
14555     />
14556 wakaba 1.48 @@@c:erred: <[xp|nsc-reserved-prefix-xmlns]> { (1, 1)..(2, 2); }
14557 wakaba 1.26 @@XMLTest:
14558     @@@QName: xp.names.xmlns.reserved.3.test
14559     @@@DEnt:
14560     @@@@test:value:
14561     <a xmlns:a="http://www.w3.org/2000/xmlns/"
14562     />
14563 wakaba 1.48 @@@c:erred: <[xp|nsc-reserved-namespace-name-xmlns]> { (1, 1)..(2, 2); }
14564 wakaba 1.26
14565     @@XMLTest:
14566     @@@QName: xp.names.default.1.test
14567     @@@DEnt:
14568     @@@@test:value:
14569     <!DOCTYPE a [
14570     <!ATTLIST a
14571     xmlns CDATA "http://1.example/">
14572     ]>
14573     <a/>
14574     @@@test:domTree:
14575     document {
14576     document-type {
14577     element-type-definition {
14578     node-name: 'a';
14579     attribute-definition {
14580     node-name: 'xmlns';
14581     node-value: 'http://1.example/';
14582     }
14583     }
14584     }
14585     element {
14586     prefix: null;
14587     local-name: 'a';
14588     namespace-uri: 'http://1.example/';
14589     attribute {
14590     prefix: null;
14591     local-name: 'xmlns';
14592     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14593     value: 'http://1.example/';
14594     specified: false;
14595     }
14596     }
14597     }
14598     @@XMLTest:
14599     @@@QName: xp.names.default.2.test
14600     @@@DEnt:
14601     @@@@test:value:
14602     <!DOCTYPE a [
14603     <!ATTLIST a
14604     xmlns CDATA "http://1.example/">
14605     ]>
14606     <a xmlns="http://2.example/"/>
14607     @@@test:domTree:
14608     document {
14609     document-type {
14610     element-type-definition {
14611     node-name: 'a';
14612     attribute-definition {
14613     node-name: 'xmlns';
14614     node-value: 'http://1.example/';
14615     }
14616     }
14617     }
14618     element {
14619     prefix: null;
14620     local-name: 'a';
14621     namespace-uri: 'http://2.example/';
14622     attribute {
14623     prefix: null;
14624     local-name: 'xmlns';
14625     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14626     value: 'http://2.example/';
14627     specified: true;
14628     }
14629     }
14630     }
14631     @@XMLTest:
14632     @@@QName: xp.names.default.3.test
14633     @@@DEnt:
14634     @@@@test:value:
14635     <!DOCTYPE b:a [
14636     <!ATTLIST b:a
14637     xmlns:b CDATA "http://1.example/">
14638     ]>
14639     <b:a/>
14640     @@@test:domTree:
14641     document {
14642     document-type {
14643     element-type-definition {
14644     node-name: 'b:a';
14645     attribute-definition {
14646     node-name: 'xmlns:b';
14647     node-value: 'http://1.example/';
14648     }
14649     }
14650     }
14651     element {
14652     prefix: 'b';
14653     local-name: 'a';
14654     namespace-uri: 'http://1.example/';
14655     attribute {
14656     prefix: 'xmlns';
14657     local-name: 'b';
14658     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14659     value: 'http://1.example/';
14660     specified: false;
14661     }
14662     }
14663     }
14664     @@XMLTest:
14665     @@@QName: xp.names.default.4.test
14666     @@@DEnt:
14667     @@@@test:value:
14668     <!DOCTYPE b:a [
14669     <!ATTLIST b:a
14670     xmlns:b CDATA "http://1.example/">
14671     ]>
14672     <b:a xmlns:b="http://2.example/"/>
14673     @@@test:domTree:
14674     document {
14675     document-type {
14676     element-type-definition {
14677     node-name: 'b:a';
14678     attribute-definition {
14679     node-name: 'xmlns:b';
14680     node-value: 'http://1.example/';
14681     }
14682     }
14683     }
14684     element {
14685     prefix: 'b';
14686     local-name: 'a';
14687     namespace-uri: 'http://2.example/';
14688     attribute {
14689     prefix: 'xmlns';
14690     local-name: 'b';
14691     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14692     value: 'http://2.example/';
14693     specified: true;
14694     }
14695     }
14696     }
14697     @@XMLTest:
14698     @@@QName: xp.names.default.5.test
14699     @@@DEnt:
14700     @@@@test:value:
14701     <!DOCTYPE a [
14702     <!ATTLIST a
14703     xmlns:b CDATA "http://1.example/"
14704     b:c CDATA "http://1.example/">
14705     ]>
14706     <a xmlns:b="http://2.example/"/>
14707     @@@test:domTree:
14708     document {
14709     document-type {
14710     element-type-definition {
14711     node-name: 'a';
14712     attribute-definition {
14713     node-name: 'xmlns:b';
14714     text-content: 'http://1.example/';
14715     }
14716     attribute-definition {
14717     node-name: 'b:c';
14718     text-content: 'http://1.example/';
14719     }
14720     }
14721     }
14722     element {
14723     prefix: null;
14724     local-name: 'a';
14725     namespace-uri: null;
14726     attribute {
14727     prefix: 'xmlns';
14728     local-name: 'b';
14729     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14730     value: 'http://2.example/';
14731     specified: true;
14732     }
14733     attribute {
14734     prefix: 'b';
14735     local-name: 'c';
14736     namespace-uri: 'http://2.example/';
14737     specified: false;
14738     }
14739     }
14740     }
14741    
14742     @@XMLTest:
14743     @@@QName: xp.names.unique.1.test
14744     @@@DEnt:
14745     @@@@test:value:
14746     <a
14747     xmlns:b="http://2.example/"
14748     xmlns:c="http://2.example/"
14749     b:d=""
14750     c:d=""
14751     />
14752 wakaba 1.48 @@@c:erred: <[xp|nswf-unique-att-spec-expanded-name]> { (1, 1)..(6, 2); }
14753 wakaba 1.26 @@XMLTest:
14754     @@@QName: xp.names.unique.2.test
14755     @@@DEnt:
14756     @@@@test:value:
14757     <!DOCTYPE a [
14758     <!ATTLIST a
14759     c:d CDATA ""
14760     >
14761     ]>
14762     <a
14763     xmlns:b="http://2.example/"
14764     xmlns:c="http://2.example/"
14765     b:d=""
14766     />
14767 wakaba 1.48 @@@c:erred: <[xp|nswf-unique-att-spec-expanded-name]> { (6, 1)..(10, 2);}
14768 wakaba 1.26 @@XMLTest:
14769     @@@QName: xp.names.unique.3.test
14770     @@@DEnt:
14771     @@@@test:value:
14772     <!DOCTYPE a [
14773     <!ATTLIST a
14774     c:d CDATA "value1"
14775     >
14776     ]>
14777     <a
14778     xmlns:c="http://2.example/"
14779     c:d="value2"
14780     />
14781     @@@test:domTree:
14782     document {
14783     document-type { }
14784     element {
14785     attribute {
14786     prefix: 'xmlns';
14787     local-name: 'c';
14788     namespace-uri: 'http://www.w3.org/2000/xmlns/';
14789     specified: true;
14790     }
14791     attribute {
14792     prefix: 'c';
14793     local-name: 'd';
14794     namespace-uri: 'http://2.example/';
14795     value: 'value2';
14796     specified: true;
14797     }
14798     }
14799     }
14800    
14801     @@XMLTest:
14802     @@@QName: xp.names.normalize.1.test
14803     @@@DEnt:
14804     @@@@test:value:
14805     <!DOCTYPE a [
14806     <!ATTLIST a
14807     xmlns NMTOKEN #IMPLIED
14808     >
14809     ]>
14810     <a xmlns=" "/>
14811     @@@test:domTree:
14812     document {
14813     document-type { }
14814     element {
14815     namespace-uri: null;
14816     prefix: null;
14817     local-name: 'a';
14818     }
14819     }
14820     @@XMLTest:
14821     @@@QName: xp.names.normalize.2.test
14822     @@@DEnt:
14823     @@@@test:value:
14824     <!DOCTYPE a [
14825     <!ATTLIST a
14826     xmlns NMTOKEN #IMPLIED
14827     >
14828     ]>
14829     <a xmlns=" about:blank "/>
14830     @@@test:domTree:
14831     document {
14832     document-type { }
14833     element {
14834     namespace-uri: 'about:blank';
14835     prefix: null;
14836     local-name: 'a';
14837     }
14838     }
14839     @@XMLTest:
14840     @@@QName: xp.names.normalize.3.test
14841     @@@DEnt:
14842     @@@@test:value:
14843     <!DOCTYPE a:a [
14844     <!ATTLIST a:a
14845     xmlns:a NMTOKEN #IMPLIED
14846     >
14847     ]>
14848     <a:a xmlns:a=" about:blank "/>
14849     @@@test:domTree:
14850     document {
14851     document-type { }
14852     element {
14853     namespace-uri: 'about:blank';
14854     prefix: 'a';
14855     local-name: 'a';
14856     }
14857     }
14858    
14859 wakaba 1.29 @@XMLTest:
14860     @@@QName: xp.no.baseuri.test
14861     @@@DEnt:
14862     @@@@test:value:
14863     <p/>
14864     @@@test:domTree:
14865     document {
14866     document-uri: null;
14867     base-uri: null;
14868     element {
14869     node-name: 'p';
14870     base-uri: null;
14871     }
14872     }
14873     @@XMLTest:
14874     @@@QName: xp.docuri.no.baseuri.test
14875     @@@DEnt:
14876     @@@@test:uri:
14877     http://www.example.com/
14878     @@@@test:value:
14879     <p/>
14880     @@@test:domTree:
14881     document {
14882     document-uri: 'http://www.example.com/';
14883     base-uri: 'http://www.example.com/';
14884     element {
14885     node-name: 'p';
14886     base-uri: 'http://www.example.com/';
14887     }
14888     }
14889     @@XMLTest:
14890     @@@QName: xp.docuri.baseuri.test
14891     @@@DEnt:
14892     @@@@test:uri:
14893     http://www.example.com/
14894     @@@@test:baseURI:
14895     ftp://ftp.example.com/
14896     @@@@test:value:
14897     <p/>
14898     @@@test:domTree:
14899     document {
14900     document-uri: 'http://www.example.com/';
14901     base-uri: 'ftp://ftp.example.com/';
14902     element {
14903     node-name: 'p';
14904     base-uri: 'ftp://ftp.example.com/';
14905     }
14906     }
14907     @@XMLTest:
14908     @@@QName: xp.doctype.baseuri.test
14909     @@@DEnt:
14910     @@@@test:uri:
14911     http://www.example.com/
14912     @@@@test:baseURI:
14913     ftp://ftp.example.com/
14914     @@@@test:value:
14915     <!DOCTYPE p SYSTEM "sys">
14916     <p/>
14917     @@@test:domTree:
14918     document {
14919     document-uri: 'http://www.example.com/';
14920     base-uri: 'ftp://ftp.example.com/';
14921     document-type {
14922     system-id: 'sys';
14923     manakai-declaration-base-uri: 'ftp://ftp.example.com/';
14924     }
14925     element {
14926     node-name: 'p';
14927     base-uri: 'ftp://ftp.example.com/';
14928     }
14929     }
14930     @@XMLTest:
14931     @@@QName: xp.entdecl.baseuri.test
14932     @@@DEnt:
14933     @@@@test:uri:
14934     http://www.example.com/
14935     @@@@test:baseURI:
14936     ftp://ftp.example.com/
14937     @@@@test:value:
14938     <!DOCTYPE p [
14939     <!ENTITY ent SYSTEM "ent">
14940     ]>
14941     <p/>
14942     @@@test:domTree:
14943     document {
14944     document-uri: 'http://www.example.com/';
14945     base-uri: 'ftp://ftp.example.com/';
14946     document-type {
14947     general-entity {
14948     node-name: 'ent';
14949     manakai-declaration-base-uri: 'ftp://ftp.example.com/';
14950     }
14951     }
14952     element {
14953     node-name: 'p';
14954     base-uri: 'ftp://ftp.example.com/';
14955     }
14956     }
14957     @@XMLTest:
14958     @@@QName: xp.notdecl.baseuri.test
14959     @@@DEnt:
14960     @@@@test:uri:
14961     http://www.example.com/
14962     @@@@test:baseURI:
14963     ftp://ftp.example.com/
14964     @@@@test:value:
14965     <!DOCTYPE p [
14966     <!NOTATION not SYSTEM "not">
14967     ]>
14968     <p/>
14969     @@@test:domTree:
14970     document {
14971     document-uri: 'http://www.example.com/';
14972     base-uri: 'ftp://ftp.example.com/';
14973     document-type {
14974     notation {
14975     node-name: 'not';
14976     manakai-declaration-base-uri: 'ftp://ftp.example.com/';
14977     }
14978     }
14979     element {
14980     node-name: 'p';
14981     base-uri: 'ftp://ftp.example.com/';
14982     }
14983     }
14984     @@XMLTest:
14985     @@@QName: xp.doctype.intsubset.pi.baseuri.test
14986     @@@DEnt:
14987     @@@@test:uri:
14988     http://www.example.com/
14989     @@@@test:baseURI:
14990     ftp://ftp.example.com/
14991     @@@@test:value:
14992     <!DOCTYPE p [
14993     <?pi?>
14994     ]>
14995     <p/>
14996     @@@test:domTree:
14997     document {
14998     document-uri: 'http://www.example.com/';
14999     base-uri: 'ftp://ftp.example.com/';
15000     document-type {
15001     pi {
15002     node-name: 'pi';
15003     base-uri: 'ftp://ftp.example.com/';
15004     }
15005     }
15006     element {
15007     node-name: 'p';
15008     base-uri: 'ftp://ftp.example.com/';
15009     }
15010     }
15011    
15012 wakaba 1.30 @@XMLTest:
15013     @@@QName: xp.xmlid.attr.test
15014     @@@DEnt:
15015     @@@@test:value:
15016     <p xml:id="idv"/>
15017 wakaba 1.34 @@@cfg:xml-id: 1
15018 wakaba 1.30 @@@test:domTree:
15019     document {
15020     element {
15021     attribute {
15022     node-name: 'xml:id';
15023     value: 'idv';
15024     schema-type-info: TypeInfo ('http://www.w3.org/TR/REC-xml',
15025     'ID');
15026     specified: true;
15027     }
15028     }
15029     }
15030     @@XMLTest:
15031 wakaba 1.34 @@@QName: xp.xmlid.attr.disabled.test
15032     @@@DEnt:
15033     @@@@test:value:
15034     <p xml:id="idv"/>
15035     @@@cfg:xml-id: 0
15036     @@@test:domTree:
15037     document {
15038     element {
15039     attribute {
15040     node-name: 'xml:id';
15041     value: 'idv';
15042     schema-type-info: TypeInfo (null, null);
15043     specified: true;
15044     }
15045     }
15046     }
15047     @@XMLTest:
15048 wakaba 1.30 @@@QName: xp.xmlid.attr.norm.test
15049     @@@DEnt:
15050     @@@@test:value:
15051     <p xml:id=" $u000Aidv "/>
15052 wakaba 1.34 @@@cfg:xml-id: 1
15053 wakaba 1.30 @@@test:domTree:
15054     document {
15055     element {
15056     attribute {
15057     node-name: 'xml:id';
15058     value: 'idv';
15059     schema-type-info: TypeInfo ('http://www.w3.org/TR/REC-xml',
15060     'ID');
15061     specified: true;
15062     }
15063     }
15064     }
15065     @@XMLTest:
15066 wakaba 1.34 @@@QName: xp.xmlid.attr.norm.disabled.test
15067     @@@DEnt:
15068     @@@@test:value:
15069     <p xml:id=" $u000Aidv "/>
15070     @@@cfg:xml-id: 0
15071     @@@test:domTree:
15072     document {
15073     element {
15074     attribute {
15075     node-name: 'xml:id';
15076     value: ' idv ';
15077     schema-type-info: TypeInfo (null, null);
15078     specified: true;
15079     }
15080     }
15081     }
15082     @@XMLTest:
15083 wakaba 1.30 @@@QName: xp.xmlid.attrdef.test
15084     @@@DEnt:
15085     @@@@test:value:
15086     <!DOCTYPE p [
15087     <!ATTLIST p xml:id ID #IMPLIED>
15088     ]>
15089     <p/>
15090 wakaba 1.34 @@@cfg:xml-id: 1
15091     @@@test:domTree:
15092     document {
15093     document-type {
15094     element-type-definition {
15095     node-name: 'p';
15096     attribute-definition {
15097     node-name: 'xml:id';
15098     declared-type: const (ID_ATTR);
15099     default-type: const (IMPLIED_DEFAULT);
15100     }
15101     }
15102     }
15103     element { }
15104     }
15105     @@XMLTest:
15106     @@@QName: xp.xmlid.attrdef.disabled.test
15107     @@@DEnt:
15108     @@@@test:value:
15109     <!DOCTYPE p [
15110     <!ATTLIST p xml:id ID #IMPLIED>
15111     ]>
15112     <p/>
15113     @@@cfg:xml-id: 0
15114 wakaba 1.30 @@@test:domTree:
15115     document {
15116     document-type {
15117     element-type-definition {
15118     node-name: 'p';
15119     attribute-definition {
15120     node-name: 'xml:id';
15121     declared-type: const (ID_ATTR);
15122     default-type: const (IMPLIED_DEFAULT);
15123     }
15124     }
15125     }
15126     element { }
15127     }
15128     @@XMLTest:
15129     @@@QName: xp.xmlid.attrdef.defaultattr.test
15130     @@@DEnt:
15131     @@@@test:value:
15132     <!DOCTYPE p [
15133     <!ATTLIST p xml:id ID "idv"><!-- invalid -->
15134     ]>
15135     <p/>
15136 wakaba 1.34 @@@cfg:xml-id: 1
15137     @@@test:domTree:
15138     document {
15139     document-type {
15140     element-type-definition {
15141     node-name: 'p';
15142     attribute-definition {
15143     node-name: 'xml:id';
15144     declared-type: const (ID_ATTR);
15145     default-type: const (EXPLICIT_DEFAULT);
15146     node-value: 'idv';
15147     }
15148     }
15149     }
15150     element {
15151     attribute {
15152     node-name: 'xml:id';
15153     schema-type-info: TypeInfo ('http://www.w3.org/TR/REC-xml',
15154     'ID');
15155     value: 'idv';
15156     specified: false;
15157     }
15158     }
15159     }
15160     @@XMLTest:
15161     @@@QName: xp.xmlid.attrdef.defaultattr.disabled.test
15162     @@@DEnt:
15163     @@@@test:value:
15164     <!DOCTYPE p [
15165     <!ATTLIST p xml:id ID "idv"><!-- invalid -->
15166     ]>
15167     <p/>
15168     @@@cfg:xml-id: 0
15169 wakaba 1.30 @@@test:domTree:
15170     document {
15171     document-type {
15172     element-type-definition {
15173     node-name: 'p';
15174     attribute-definition {
15175     node-name: 'xml:id';
15176     declared-type: const (ID_ATTR);
15177     default-type: const (EXPLICIT_DEFAULT);
15178     node-value: 'idv';
15179     }
15180     }
15181     }
15182     element {
15183     attribute {
15184     node-name: 'xml:id';
15185     schema-type-info: TypeInfo ('http://www.w3.org/TR/REC-xml',
15186     'ID');
15187     value: 'idv';
15188     specified: false;
15189     }
15190     }
15191     }
15192    
15193 wakaba 1.34 @@XMLTest:
15194     @@@QName: xp.general.entity.unused.1.test
15195     @@@DEnt:
15196     @@@@test:value:
15197     <!DOCTYPE p [
15198     <!ENTITY mylt "<">
15199     ]>
15200     <p/>
15201     @@@cfg:entity-replacement-tree: 0
15202     @@@test:domTree:
15203     document {
15204     document-type {
15205     general-entity {
15206     node-name: 'mylt';
15207     }
15208     }
15209     element { }
15210     }
15211     @@XMLTest:
15212     @@@QName: xp.general.entity.unused.2.test
15213     @@@DEnt:
15214     @@@@test:value:
15215     <!DOCTYPE p [
15216     <!ENTITY mylt "<">
15217     ]>
15218     <p/>
15219     @@@cfg:entity-replacement-tree: 1
15220 wakaba 1.48 @@@c:erred: <[xp|wf-syntax-error]> { (1, 1)..(1, 2); }
15221 wakaba 1.34
15222 wakaba 1.35 @@XMLTest:
15223     @@@QName: xp.dtdecl.readonly.test
15224     @@@DEnt:
15225     @@@@test:value:
15226     <!DOCTYPE p>
15227     <p/>
15228     @@@test:domTree:
15229     document {
15230     document-type {
15231     manakai-read-only: true;
15232     }
15233     element {
15234     manakai-read-only: false;
15235     }
15236     manakai-read-only: false;
15237     }
15238     @@XMLTest:
15239     @@@QName: xp.entity.decl.readonly.1.test
15240     @@@DEnt:
15241     @@@@test:value:
15242     <!DOCTYPE p [
15243     <!ENTITY ent "val">
15244     ]>
15245     <p/>
15246     @@@cfg:entity-replacement-tree: 1
15247     @@@test:domTree:
15248     document {
15249     document-type {
15250     general-entity {
15251     node-name: 'ent';
15252     manakai-read-only: true;
15253     has-replacement-tree: true;
15254     }
15255     manakai-read-only: true;
15256     }
15257     element {
15258     manakai-read-only: false;
15259     }
15260     manakai-read-only: false;
15261     }
15262     @@XMLTest:
15263     @@@QName: xp.entity.decl.readonly.2.test
15264     @@@DEnt:
15265     @@@@test:value:
15266     <!DOCTYPE p [
15267     <!ENTITY ent "val">
15268     ]>
15269     <p/>
15270     @@@test:domTree:
15271     document {
15272     document-type {
15273     general-entity {
15274     node-name: 'ent';
15275     manakai-read-only: true;
15276     }
15277     manakai-read-only: true;
15278     }
15279     element {
15280     manakai-read-only: false;
15281     }
15282     manakai-read-only: false;
15283     }
15284     @@XMLTest:
15285     @@@QName: xp.notation.decl.readonly.test
15286     @@@DEnt:
15287     @@@@test:value:
15288     <!DOCTYPE p [
15289     <!NOTATION ent SYSTEM "val">
15290     ]>
15291     <p/>
15292     @@@test:domTree:
15293     document {
15294     document-type {
15295     notation {
15296     node-name: 'ent';
15297     manakai-read-only: true;
15298     }
15299     manakai-read-only: true;
15300     }
15301     element {
15302     manakai-read-only: false;
15303     }
15304     manakai-read-only: false;
15305     }
15306     @@XMLTest:
15307     @@@QName: xp.dtd.pi.readonly.test
15308     @@@DEnt:
15309     @@@@test:value:
15310     <!DOCTYPE p [
15311     <?pi content?>
15312     ]>
15313     <p/>
15314     @@@test:domTree:
15315     document {
15316     document-type {
15317     pi {
15318     node-name: 'pi';
15319     manakai-read-only: true;
15320     }
15321     manakai-read-only: true;
15322     }
15323     element {
15324     manakai-read-only: false;
15325     }
15326     manakai-read-only: false;
15327     }
15328     @@XMLTest:
15329     @@@QName: xp.dtd.attlist.decl.readonly.test
15330     @@@DEnt:
15331     @@@@test:value:
15332     <!DOCTYPE p [
15333     <!ATTLIST p
15334     attr CDATA #IMPLIED
15335     >
15336     ]>
15337     <p/>
15338     @@@test:domTree:
15339     document {
15340     document-type {
15341     element-type-definition {
15342     node-name: 'p';
15343     attribute-definition {
15344     node-name: 'attr';
15345     manakai-read-only: true;
15346     }
15347     manakai-read-only: true;
15348     }
15349     manakai-read-only: true;
15350     }
15351     element {
15352     manakai-read-only: false;
15353     }
15354     manakai-read-only: false;
15355     }
15356     @@XMLTest:
15357     @@@QName: xp.general.entity.reference.readonly.1.test
15358     @@@DEnt:
15359     @@@@test:value:
15360     <!DOCTYPE p [
15361     <!ENTITY ent "val">
15362     ]>
15363     <p>&ent;</p>
15364     @@@test:domTree:
15365     document {
15366     document-type {
15367     general-entity {
15368     node-name: 'ent';
15369     manakai-read-only: true;
15370     }
15371     manakai-read-only: true;
15372     }
15373     element {
15374     general-entity-reference {
15375     text {
15376     manakai-read-only: true;
15377     }
15378     manakai-read-only: true;
15379     }
15380     manakai-read-only: false;
15381     }
15382     manakai-read-only: false;
15383     }
15384     @@XMLTest:
15385     @@@QName: xp.general.entity.reference.readonly.2.test
15386     @@@DEnt:
15387     @@@@test:value:
15388     <!DOCTYPE p [
15389     <!ENTITY ent "val">
15390     ]>
15391     <p attr="&ent;"/>
15392     @@@test:domTree:
15393     document {
15394     document-type {
15395     general-entity {
15396     node-name: 'ent';
15397     manakai-read-only: true;
15398     }
15399     manakai-read-only: true;
15400     }
15401     element {
15402     attribute {
15403     node-name: 'attr';
15404     general-entity-reference {
15405     text {
15406     manakai-read-only: true;
15407     }
15408     manakai-read-only: true;
15409     }
15410     manakai-read-only: false;
15411     }
15412     manakai-read-only: false;
15413     }
15414     manakai-read-only: false;
15415     }
15416     @@XMLTest:
15417     @@@QName: xp.general.entity.reference.readonly.3.test
15418     @@@DEnt:
15419     @@@@test:value:
15420     <!DOCTYPE p [
15421     <!ENTITY ent1 "val">
15422     <!ENTITY ent2 "&ent1;">
15423     ]>
15424     <p>&ent2;</p>
15425     @@@test:domTree:
15426     document {
15427     document-type {
15428     general-entity {
15429     node-name: 'ent1';
15430     manakai-read-only: true;
15431     }
15432     general-entity {
15433     node-name: 'ent2';
15434     manakai-read-only: true;
15435     }
15436     manakai-read-only: true;
15437     }
15438     element {
15439     general-entity-reference {
15440     general-entity-reference {
15441     text {
15442     manakai-read-only: true;
15443     }
15444     manakai-read-only: true;
15445     }
15446     manakai-read-only: true;
15447     }
15448     manakai-read-only: false;
15449     }
15450     manakai-read-only: false;
15451     }
15452    
15453 wakaba 1.26 @@PerlDef:
15454 wakaba 1.42 my $impl = $Message::DOM::ImplementationRegistry->get_dom_implementation ({
15455 wakaba 1.26 'Core' => '3.0',
15456     'XML' => '3.0',
15457     'XMLVersion' => ['1.0', '1.1'],
15458     });
15459    
15460     for my $test_data (@$TestData) {
15461 wakaba 1.34 my $parser = <Class::ManakaiXMLParser>->new ($impl);
15462    
15463 wakaba 1.26 $test->start_new_test ($test_data->{uri});
15464     my $doc_ent = $test_data->{entity}->{$test_data->{root_uri}};
15465     my $not_ok;
15466    
15467 wakaba 1.34 ## -- DOM Configuration Parameters
15468    
15469     my $pcfg = $parser->dom_config;
15470     for (keys %{$test_data->{dom_config}}) {
15471     $pcfg->set_parameter ($_ => $test_data->{dom_config}->{$_});
15472     }
15473    
15474     $pcfg->set_parameter ('error-handler' => sub ($$) {
15475 wakaba 1.26 my (undef, $err) = @_;
15476     my $err_type = $err->type;
15477     if ($test_data->{dom_error}->{$err_type}) {
15478     $test->assert_error_equals
15479     (actual_value => $err,
15480     expected_hash => shift @{$test_data->{dom_error}
15481     ->{$err_type}});
15482     } else { # Uncatched error
15483     warn $err;
15484     unless ($err->severity == <C::c|DOMError.SEVERITY_WARNING>) {
15485     $test->failure_comment ('Unexpected error |'.$err->type.'|');
15486     $not_ok = true;
15487     }
15488     }
15489     return true; # continue as far as possible
15490     });
15491    
15492 wakaba 1.34 ## -- Input Data
15493    
15494 wakaba 1.27 my $input = {string_data => \$doc_ent->{<Q::test:value>},
15495     system_id => $doc_ent->{<Q::test:uri>},
15496     base_uri => $doc_ent->{<Q::test:baseURI>}};
15497 wakaba 1.34
15498     ## -- Test and Result
15499    
15500 wakaba 1.26 if ($test_data->{dom_tree}) { # Successful test
15501 wakaba 1.31 my $doc;
15502 wakaba 1.26 try {
15503 wakaba 1.31 $doc = $parser->parse ($input);
15504 wakaba 1.26 $test->assert_dom_tree_equals
15505     (actual_value => $doc,
15506     expected_hash => $test_data->{dom_tree});
15507     for (values %{$test_data->{dom_error}||{}}) {
15508     if (@$_) {
15509     $test->failure_comment
15510     (@$_.' |DOMError|s of type |'.
15511     $_->[0]->{type}->{value}.'| are not reported');
15512     $not_ok = true;
15513     }
15514     }
15515     $not_ok ? $test->not_ok : $test->ok;
15516 wakaba 1.31 undef $doc;
15517 wakaba 1.26 } catch Message::Util::IF::DTException with {
15518 wakaba 1.31 require 'manakai/mndebug.pl';
15519     manakai::mndebug::dump ($doc);
15520 wakaba 1.26 } catch Message::DOM::IF::LSException with {
15521     # not_ok
15522     } otherwise {
15523     my $err = shift;
15524     warn $err;
15525     $test->not_ok;
15526     };
15527     } else {
15528 wakaba 1.31 my $doc;
15529 wakaba 1.26 try {
15530 wakaba 1.31 $doc = $parser->parse ($input);
15531 wakaba 1.26 } catch Message::Util::IF::DTException with {
15532 wakaba 1.31 require 'manakai/mndebug.pl';
15533     manakai::mndebug::dump ($doc);
15534 wakaba 1.26 } catch Message::DOM::IF::LSException with {
15535     #
15536     } otherwise {
15537     my $err = shift;
15538     warn $err;
15539     $test->not_ok;
15540     };
15541     for (values %{$test_data->{dom_error}||{}}) {
15542     if (@$_) {
15543     $test->failure_comment
15544     (@$_.' |DOMError|s of type |'.
15545     $_->[0]->{type}->{value}.'| are not reported');
15546     $not_ok = true;
15547     }
15548     }
15549     $not_ok ? $test->not_ok : $test->ok;
15550 wakaba 1.12 }
15551 wakaba 1.5 }
15552 wakaba 1.6
15553 wakaba 1.37 @XMLTests:
15554     @@QName: xp.byteStream.tests
15555    
15556     @@XMLTest:
15557     @@@QName: xp.labeled.utf-8.test
15558     @@@DEnt:
15559     @@@@xp:encoding: utf-8
15560     @@@@test:value:
15561     <p/>
15562     @@@test:domTree:
15563     document {
15564     input-encoding: 'utf-8';
15565     xml-encoding: null;
15566     element {
15567     node-name: 'p';
15568     }
15569     }
15570     @@XMLTest:
15571     @@@QName: xp.labeled.utf-16.be.test
15572     @@@DEnt:
15573     @@@@xp:encoding: utf-16
15574     @@@@test:value:
15575     $u00FE$u00FF$u0000<$u0000p$u0000/$u0000>
15576     @@@test:domTree:
15577     document {
15578     xml-encoding: null;
15579     input-encoding: 'utf-16';
15580     element {
15581     node-name: 'p';
15582     }
15583     }
15584     @@XMLTest:
15585     @@@QName: xp.labeled.utf-16.le.test
15586     @@@DEnt:
15587     @@@@xp:encoding: utf-16
15588     @@@@test:value:
15589     $u00FF$u00FE<$u0000p$u0000/$u0000>$u0000
15590     @@@test:domTree:
15591     document {
15592     xml-encoding: null;
15593     input-encoding: 'utf-16';
15594     element {
15595     node-name: 'p';
15596     }
15597     }
15598     @@XMLTest:
15599     @@@QName: xp.labeled.utf-16.nobom.test
15600     @@@DEnt:
15601     @@@@xp:encoding: utf-16
15602     @@@@test:value:
15603     <$u0000p$u0000/$u0000>$u0000
15604 wakaba 1.48 @@@c:erred: <[xp|fatal-utf-16-no-bom]> {}
15605 wakaba 1.37 @@XMLTest:
15606     @@@QName: xp.labeled.unknown.test
15607     @@@DEnt:
15608     @@@@xp:encoding: x-unknown-encoding-name
15609     @@@@test:value:
15610     <p/>
15611 wakaba 1.48 @@@c:erred: <[xp|fatal-unprocessable-encoding]> {}
15612 wakaba 1.37 @@XMLTest:
15613     @@@QName: xp.unlabeled.encdecl.unknown.test
15614     @@@DEnt:
15615     @@@@test:value:
15616     <?xml version="1.0" encoding="x-unknown-encoding-name"?>
15617     <p/>
15618 wakaba 1.48 # @@@c:erred: <[xp|fatal-unprocessable-encoding]> {}
15619     @@@c:erred: <[xp|fatal-encoding-mismatch]> {}
15620 wakaba 1.37 @@XMLTest:
15621     @@@QName: xp.labeled.utf-8.illegal.test
15622     @@@DEnt:
15623     @@@@xp:encoding: utf-8
15624     @@@@test:value:
15625     <p/$u00A0>
15626 wakaba 1.48 @@@c:erred: <[xp|fatal-illegal-byte-sequence]> {}
15627 wakaba 1.37 @@XMLTest:
15628     @@@QName: xp.unlabeled.encdecl.utf-8.illegal.test
15629     @@@DEnt:
15630     @@@@test:value:
15631     <?xml version="1.0" encoding="utf-8"?>
15632     <p/$u00A0>
15633 wakaba 1.48 @@@c:erred: <[xp|fatal-illegal-byte-sequence]> {}
15634 wakaba 1.37 @@XMLTest:
15635     @@@QName: xp.unlabeled.utf-8.illegal.test
15636     @@@DEnt:
15637     @@@@test:value:
15638     <p/$u00A0>
15639 wakaba 1.48 @@@c:erred: <[xp|fatal-illegal-byte-sequence]> {}
15640 wakaba 1.37 @@XMLTest:
15641     @@@QName: xp.mismatch.encdecl-as-utf-16.utf-8.test
15642     @@@DEnt:
15643     @@@@test:value:
15644     <?xml version="1.0" encoding="utf-16"?>
15645     <p/>
15646 wakaba 1.48 @@@c:erred: <[xp|fatal-encoding-mismatch]> {}
15647 wakaba 1.37 @@XMLTest:
15648     @@@QName: xp.mismatch.labeled-as-utf-16.utf-8.test
15649     @@@DEnt:
15650     @@@@xp:encoding: utf-16
15651     @@@@test:value:
15652     <p/>
15653 wakaba 1.48 @@@c:erred: <[xp|fatal-utf-16-no-bom]> {}
15654 wakaba 1.37 @@XMLTest:
15655     @@@QName: xp.labeled-as-utf-8.encdecl-utf-16.test
15656     @@@DEnt:
15657     @@@@xp:encoding: utf-8
15658     @@@@test:value:
15659     <?xml version="1.0" encoding="utf-16"?>
15660     <p/>
15661     @@@test:domTree:
15662     document {
15663     xml-encoding: 'utf-16';
15664     input-encoding: 'utf-8';
15665     element { }
15666     }
15667    
15668     @@PerlDef:
15669 wakaba 1.42 my $impl = $Message::DOM::ImplementationRegistry->get_dom_implementation ({
15670 wakaba 1.37 'Core' => '3.0',
15671     'XML' => '3.0',
15672     'XMLVersion' => ['1.0', '1.1'],
15673     });
15674    
15675     for my $test_data (@$TestData) {
15676     my $parser = <Class::ManakaiXMLParser>->new ($impl);
15677    
15678     $test->start_new_test ($test_data->{uri});
15679     my $doc_ent = $test_data->{entity}->{$test_data->{root_uri}};
15680     my $not_ok;
15681    
15682     ## -- DOM Configuration Parameters
15683    
15684     my $pcfg = $parser->dom_config;
15685     for (keys %{$test_data->{dom_config}}) {
15686     $pcfg->set_parameter ($_ => $test_data->{dom_config}->{$_});
15687     }
15688    
15689     $pcfg->set_parameter ('error-handler' => sub ($$) {
15690     my (undef, $err) = @_;
15691     my $err_type = $err->type;
15692     if ($test_data->{dom_error}->{$err_type}) {
15693     $test->assert_error_equals
15694     (actual_value => $err,
15695     expected_hash => shift @{$test_data->{dom_error}
15696     ->{$err_type}});
15697     } else { # Uncatched error
15698     warn $err;
15699     unless ($err->severity == <C::c|DOMError.SEVERITY_WARNING>) {
15700     $test->failure_comment ('Unexpected error |'.$err->type.'|');
15701     $not_ok = true;
15702     }
15703     }
15704     return false;
15705     });
15706    
15707     ## -- Input Data
15708    
15709     open my $byte, '<', \$doc_ent->{<Q::test|value>};
15710     my $input = {byte_stream => $byte,
15711     system_id => $doc_ent->{<Q::test:uri>},
15712     base_uri => $doc_ent->{<Q::test:baseURI>},
15713     encoding => $doc_ent->{<Q::xp|encoding>}};
15714    
15715     ## -- Test and Result
15716    
15717     if ($test_data->{dom_tree}) { # Successful test
15718     my $doc;
15719     try {
15720     $doc = $parser->parse ($input);
15721     $test->assert_dom_tree_equals
15722     (actual_value => $doc,
15723     expected_hash => $test_data->{dom_tree});
15724     for (values %{$test_data->{dom_error}||{}}) {
15725     if (@$_) {
15726     $test->failure_comment
15727     (@$_.' |DOMError|s of type |'.
15728     $_->[0]->{type}->{value}.'| are not reported');
15729     $not_ok = true;
15730     }
15731     }
15732     $not_ok ? $test->not_ok : $test->ok;
15733     undef $doc;
15734     } catch Message::Util::IF::DTException with {
15735     require 'manakai/mndebug.pl';
15736     manakai::mndebug::dump ($doc);
15737     } catch Message::DOM::IF::LSException with {
15738     # not_ok
15739     } otherwise {
15740     my $err = shift;
15741     warn $err;
15742     $test->not_ok;
15743     };
15744     } else {
15745     my $doc;
15746     try {
15747     $doc = $parser->parse ($input);
15748     } catch Message::Util::IF::DTException with {
15749     require 'manakai/mndebug.pl';
15750     manakai::mndebug::dump ($doc);
15751     } catch Message::DOM::IF::LSException with {
15752     #
15753     } otherwise {
15754     my $err = shift;
15755     warn $err;
15756     $test->not_ok;
15757     };
15758     for (values %{$test_data->{dom_error}||{}}) {
15759     if (@$_) {
15760     $test->failure_comment
15761     (@$_.' |DOMError|s of type |'.
15762     $_->[0]->{type}->{value}.'| are not reported');
15763     $not_ok = true;
15764     }
15765     }
15766     $not_ok ? $test->not_ok : $test->ok;
15767     }
15768     }
15769    
15770    
15771 wakaba 1.6 @ResourceDef:
15772 wakaba 1.19 @@QName: getEmptyEntityState
15773     @@rdf:type: DISPerl|InlineCode
15774     @@ForCheck: ManakaiDOM|ForClass
15775     @@PerlDef:
15776     {reptxt => \'', line => 1, column => 1, pos => 0,
15777 wakaba 1.27 is_externally_declared => true, name => $name,
15778     fh => do {
15779     open my $empty, '<', \'';
15780     $empty;
15781     },
15782     close_file => sub { }}
15783 wakaba 1.19
15784     @ResourceDef:
15785 wakaba 1.6 @@QName: getCopyOfEntityState
15786     @@rdf:type: DISPerl|InlineCode
15787     @@ForCheck: ManakaiDOM|ForClass
15788     @@PerlDef:
15789     {%{$self->{$entity_type}->{$entity_name}},
15790 wakaba 1.27 line => 1, column => 1, pos => 0,
15791     fh => do {
15792     require IO::String;
15793     IO::String->new
15794     (${$self->{$entity_type}->{$entity_name}->{reptxt}});
15795     ## TODO: External entities.
15796     },
15797     close_file => sub { }}
15798 wakaba 1.1 ##ManakaiXMLParser
15799 wakaba 1.5
15800     ElementTypeBinding:
15801 wakaba 1.27 @Name: Test
15802     @ElementType:
15803     dis:ResourceDef
15804     @ShadowContent:
15805     @@ForCheck: ManakaiDOM|ForClass
15806     @@rdf:type: test|StandaloneTest
15807    
15808     ElementTypeBinding:
15809 wakaba 1.5 @Name: XMLTests
15810     @ElementType:
15811     dis:ResourceDef
15812     @ShadowContent:
15813     @@ForCheck: ManakaiDOM|ForClass
15814     @@rdf:type: test|ParserTestSet
15815    
15816     ElementTypeBinding:
15817     @Name: XMLTest
15818     @ElementType:
15819     dis:ResourceDef
15820     @ShadowContent:
15821     @@ForCheck: ManakaiDOM|ForClass
15822     @@rdf:type: test|ParserTest
15823    
15824     ElementTypeBinding:
15825     @Name: DEnt
15826     @ElementType:
15827     dis:ResourceDef
15828     @ShadowContent:
15829     @@rdf:type: test|RootEntity
15830    
15831     ElementTypeBinding:
15832     @Name: Ent
15833     @ElementType:
15834     dis:ResourceDef
15835     @ShadowContent:
15836     @@rdf:type: test|Entity
15837 wakaba 1.1
15838 wakaba 1.3 ResourceDef:
15839     @QName: xp|get-location-from-token
15840     @rdf:type: DISPerl|BlockCode
15841     @enDesc:
15842     Creates a <IF::DOMCore:DOMLocator> object from a token.
15843     @PerlDef:
15844 wakaba 1.14 my $__d = $token->{type} ne '#EOF'
15845     ? $token->{location}->{char_d}
15846     : 0;
15847 wakaba 1.15 $__d -= $token->{location_d} if $token->{location_d};
15848 wakaba 1.3 $result = {
15849 wakaba 1.14 utf32_offset => $token->{location}->{pos} - $__d,
15850     line_number => $token->{location}->{line},
15851     column_number => $token->{location}->{column} - $__d,
15852 wakaba 1.3 };
15853 wakaba 1.14 $result->{utf32_offset} = 0 if $result->{utf32_offset} < 0;
15854     $result->{column_number} = 0 if $result->{column_number} < 0;
15855     ## 0 or 1, which should be?
15856 wakaba 1.1
15857     ElementTypeBinding:
15858     @Name: RuleDef
15859     @ElementType:
15860     dis:ResourceDef
15861     @ShadowContent:
15862     @@ForCheck: ManakaiDOM|ForClass
15863     @@rdf:type: Muf2003|RuleDefClass
15864    
15865     ElementTypeBinding:
15866     @Name: RuleParam
15867     @ElementType:
15868     dis:ResourceDef
15869     @ShadowContent:
15870     @@rdf:type: Muf2003|RuleParameter
15871    
15872     ElementTypeBinding:
15873     @Name: enImplNote
15874     @ElementType:
15875     dis:ImplNote
15876     @ShadowContent:
15877     @@lang:en
15878    
15879     ElementTypeBinding:
15880 wakaba 1.24 @Name: WFErrDef
15881 wakaba 1.1 @ElementType:
15882     dis:ResourceDef
15883     @ShadowContent:
15884     @@rdf:type: DOMCore|DOMErrorType
15885     @@ecore:textFormatter: ManakaiXMLParserExceptionFormatter
15886 wakaba 1.24 @@c:severity: c|SEVERITY_FATAL_ERROR
15887 wakaba 1.1
15888 wakaba 1.3 ElementTypeBinding:
15889 wakaba 1.24 @Name: FatalErrDef
15890 wakaba 1.3 @ElementType:
15891     dis:ResourceDef
15892     @ShadowContent:
15893     @@rdf:type: DOMCore|DOMErrorType
15894     @@ecore:textFormatter: ManakaiXMLParserExceptionFormatter
15895 wakaba 1.24 @@c:severity: c|SEVERITY_FATAL_ERROR
15896    
15897     ElementTypeBinding:
15898 wakaba 1.26 @Name: NSFatalErrDef
15899     @ElementType:
15900     dis:ResourceDef
15901     @ShadowContent:
15902     @@rdf:type: c|DOMErrorType
15903     @@ecore:textFormatter: ManakaiXMLParserExceptionFormatter
15904     @@c:severity: c|SEVERITY_FATAL_ERROR
15905    
15906     ElementTypeBinding:
15907     @Name: NSCErrDef
15908     @ElementType:
15909     dis:ResourceDef
15910     @ShadowContent:
15911     @@rdf:type: c|DOMErrorType
15912     @@ecore:textFormatter: ManakaiXMLParserExceptionFormatter
15913     @@c:severity: c|SEVERITY_FATAL_ERROR
15914    
15915     ElementTypeBinding:
15916 wakaba 1.24 @Name: VCErrDef
15917     @ElementType:
15918     dis:ResourceDef
15919     @ShadowContent:
15920     @@rdf:type: c|DOMErrorType
15921     @@ecore:textFormatter: ManakaiXMLParserExceptionFormatter
15922     @@c:severity: c|SEVERITY_ERROR
15923    
15924     ElementTypeBinding:
15925     @Name: ErrDef
15926     @ElementType:
15927     dis:ResourceDef
15928     @ShadowContent:
15929     @@rdf:type: c|DOMErrorType
15930     @@ecore:textFormatter: ManakaiXMLParserExceptionFormatter
15931     @@c:severity: c|SEVERITY_ERROR
15932 wakaba 1.3
15933 wakaba 1.16 ElementTypeBinding:
15934 wakaba 1.24 @Name: WarnDef
15935 wakaba 1.16 @ElementType:
15936     dis:ResourceDef
15937     @ShadowContent:
15938 wakaba 1.24 @@rdf:type: c|DOMErrorType
15939 wakaba 1.16 @@ecore:textFormatter: ManakaiXMLParserExceptionFormatter
15940 wakaba 1.24 @@c:severity: c|SEVERITY_WARNING
15941 wakaba 1.16
15942 wakaba 1.3 WFErrDef:
15943     @QName: xp|wf-syntax-error
15944     @enDesc:
15945     The entity does not match to the production rule; it is not
15946     well-formed.
15947     @enMufDef:
15948     |%xp-error-token-type;|%xp-error-token-value
15949     (prefix => { (|}, suffix => {|)}); is not
15950     allowed%xp-error-lines (prefix => { (|}, suffix => {|)});
15951     @ecore:hasParameter:
15952     @@@: xp|error-token
15953     @@enDesc:
15954     The token that is not allowed.
15955    
15956     WFErrDef:
15957     @QName: xp|wf-pi-target-is-xml
15958     @enDesc:
15959     A processing instruction has its <CODE::PITarget> of
15960     <XML::xml> (in any case) which is not allowed.
15961     @enMufDef:
15962     Processing instruction target name cannot be |%p
15963     (name => {<Q::xp|name>});|
15964     @ecore:hasParameter:
15965     @@@: xp|error-token
15966     @@enDesc:
15967     The token that contains the name.
15968     @ecore:hasParameter:
15969     @@@: xp|name
15970     @@enDesc:
15971     A string that is specified as target name of the
15972     processing instruction.
15973     @ecore:hasParameter: xp|parent
15974    
15975     WFErrDef:
15976     @QName: xp|wf-no-end-tag
15977     @enDesc:
15978     An end-tag is not found.
15979     @enMufDef:
15980     End-tag |</%p (name => {<Q::xp|expected-element-type>});>| is required
15981     @ecore:hasParameter: xp|error-token
15982     @ecore:hasParameter:
15983     @@@: xp|node
15984     @@enDesc:
15985     The element node that is not closed.
15986     @ecore:hasParameter:
15987     @@@: xp|expected-element-type
15988     @@enDesc:
15989     The element type name of the element that is not closed.
15990    
15991     WFErrDef:
15992     @QName: xp|wf-unsupported-xml-version
15993     @enDesc:
15994     The XML version specified in the version declaration is not supported.
15995     @enMufDef:
15996     XML version |%p (name => {<Q::infoset|version>});| is not supported
15997     @ecore:hasParameter: xp|bad-token
15998     @ecore:hasParameter:
15999     @@@: xp|parent
16000     @@enDesc:
16001     The document node.
16002     @ecore:hasParameter:
16003     @@@: infoset|version
16004     @@enDesc:
16005     The specified XML version.
16006    
16007     WFErrDef:
16008     @QName: xp|wf-malformed-enc-name
16009     @enDesc:
16010     An <XA::encoding> pseudo-attribute value does not match
16011     to the procduction rule <CODE::EncName>.
16012     @enMufDef:
16013     Encoding name |%p (name => {<Q::xp|name>});| is not allowed
16014     @ecore:hasParameter: xp|error-token
16015     @ecore:hasParameter:
16016     @@@: xp|parent
16017     @@enDesc: The document node.
16018     @ecore:hasParameter:
16019     @@@: xp|name
16020     @@enDesc:
16021     The <XA::encoding> value.
16022    
16023     WFErrDef:
16024     @QName: xp|wf-malformed-xml-standalone
16025     @enDesc:
16026     An <XA::standalone> pseudo-attribute value is neither <XML::yes>
16027     or <XML::no>.
16028     @enMufDef:
16029     |standalone| pseudo-attribute value |%p (name => {<Q::xp|name>});|
16030     is not allowed
16031     @ecore:hasParameter: xp|error-token
16032     @ecore:hasParameter:
16033     @@@: xp|parent
16034     @@enDesc: The document node.
16035     @ecore:hasParameter:
16036     @@@: xp|name
16037     @@enDesc:
16038     The <XA::standalone> value.
16039    
16040     WFErrDef:
16041     @QName: xp|wf-legal-literal-character
16042     @enDesc:
16043     Each character in XML entity must match to the production
16044     rule <CODE::Char - RestrictedChar>.
16045     @enMufDef:
16046     Character %character-code-point
16047     (v => {<Q::xp|character-number>}); is not allowed
16048     @ecore:hasParameter:
16049     @@@: xp|character-number
16050     @@enDesc:
16051     The code position of the character being referred.
16052    
16053     WFErrDef:
16054 wakaba 1.26 @QName: xp|wf-invalid-character-in-node-name
16055     @c:errorType:
16056     @@@: wf-invalid-character-in-node-name
16057     @@ContentType: DISCore|String
16058     @enDesc:
16059     If a name contains a character that is not a name character
16060     in the XML version in use, or if the first character of a name
16061     is not a name start character in the XML version in use.
16062    
16063     {NOTE::
16064     When an invalid character is encountered in an entity
16065     where a <CODE::Name> is expected, what type of error
16066     is issued is implementation dependent: <Q::xp|wf-syntax-error>,
16067     <Q::xp|wf-pi-target-is-xml> or other error might be reported.
16068     }
16069    
16070     {NOTE::
16071     This error type is defined in DOM Level 3 Core and Load and Save
16072     modules and redefined herein for the purpose of XML parser.
16073     }
16074     @enMufDef:
16075     Character %character-code-point
16076     (v => {<Q::xp|character-number>}); is not allowed in name
16077     @ecore:hasParameter: xp|error-token
16078     @ecore:hasParameter:
16079     @@@: xp|character-number
16080     @@enDesc:
16081     The code position of the character being referred.
16082     @ecore:hasParameter:
16083     @@@: infoset|version
16084     @@enDesc:
16085     The version of XML in use.
16086    
16087     WFErrDef:
16088 wakaba 1.25 @QName: xp|wf-pes-in-internal-subset
16089     @enDesc:
16090     In the internal subset of the DTD, parameter entity references
16091     <kwd:MUST-NOT> occur within markup declarations.
16092     @enMufDef:
16093     Parameter entity reference |%percent;%param (name => {<Q::xp|name>});;|
16094     cannot occur within a markup declaration
16095     @ecore:hasParameter: xp|error-token
16096     @ecore:hasParameter:
16097     @@@: xp|name
16098     @@enDesc:
16099     The name of the parameter entity.
16100    
16101     WFErrDef:
16102 wakaba 1.3 @QName: xp|wf-element-type-match
16103 wakaba 1.1 @enDesc:
16104 wakaba 1.3 The <CODE::Name> in an element's end-tag must match the element type
16105     in the start-tag.
16106     @enMufDef:
16107     End-tag |</%p (name => {<Q::xp|actual-element-type>});>| does
16108     not match to start-tag |<%p (name => {<Q::xp|expected-element-type>});>|
16109     @ecore:hasParameter: xp|error-token
16110     @ecore:hasParameter:
16111     @@@: xp|node
16112     @@enDesc:
16113     The current opening element node.
16114     @ecore:hasParameter:
16115     @@@: xp|expected-element-type
16116     @@enDesc:
16117     The element type name of the current element.
16118     @ecore:hasParameter:
16119     @@@: xp|actual-element-type
16120     @@enDesc:
16121     The <CODE::Name> occurs in the end-tag.
16122    
16123     WFErrDef:
16124     @QName: xp|wf-unique-att-spec
16125     @enDesc:
16126     An attribute name <kwd:MUST-NOT> appear more than once in
16127     the same start-tag or empty-element tag.
16128 wakaba 1.1 @enMufDef:
16129 wakaba 1.3 Attribute |%p (name => {<Q::xp|name>});| is specified more
16130     than once in the same tag
16131     @ecore:hasParameter: xp|error-token
16132     @ecore:hasParameter:
16133     @@@: xp|name
16134     @@enDesc:
16135     The name of the attribute.
16136 wakaba 1.18
16137     WFErrDef:
16138     @QName: xp|wf-no-external-entity-references
16139     @enDesc:
16140     Attribute values <kwd:MUST-NOT> contain direct or indirect
16141     entity references to external entities.
16142     @enMufDef:
16143     External entity |%p (name => {<Q::xp|name>});| is referenced
16144     in an attribute value literal
16145     @ecore:hasParameter: xp|error-token
16146     @ecore:hasParameter:
16147     @@@: xp|name
16148     @@enDesc:
16149     The name of the entity.
16150    
16151     WFErrDef:
16152     @QName: xp|wf-no-lt-in-attribute-values
16153     @enDesc:
16154     The replacement text of any entity referred to directly or indirectly
16155     in an attribute value literal <kwd:MUST-NOT> contain a
16156     <CHAR::LESS-THAN SIGN>.
16157     @enMufDef:
16158     Entity replacement text cannot contain a
16159     |LESS-THAN SIGN| since it is referenced from an attribute
16160     value literal
16161     @ecore:hasParameter: xp|error-token
16162 wakaba 1.3
16163 wakaba 1.25 WarnDef:
16164     @QName: xp|warning-attribute-definition-ignored
16165     @enDesc:
16166     An attribute definition is ignored because the same attribute
16167     is declared before.
16168     @enMufDef:
16169     Attribute definition for |%p (name => {<Q::xp|name>});| is ignored
16170     @ecore:hasParameter: xp|error-token
16171     @ecore:hasParameter:
16172     @@@: xp|name
16173     @@enDesc:
16174     The name of the attribute.
16175    
16176 wakaba 1.3 WFErrDef:
16177     @QName: xp|wf-legal-character
16178     @enDesc:
16179     Characters referred to using character references <kwd:MUST>
16180     match the production for <CODE::Char>.
16181     @enMufDef:
16182     Reference to character %character-code-point
16183     (v => {<Q::xp|character-number>}); is not allowed
16184     @ecore:hasParameter: xp|error-token
16185     @ecore:hasParameter:
16186     @@@: xp|character-number
16187     @@enDesc:
16188     The code position of the character being referred.
16189     @ecore:hasParameter:
16190     @@@: xp|parent
16191     @@enDesc:
16192     The parent node in which the character reference has
16193     occurred, if available.
16194 wakaba 1.19
16195     WFErrDef:
16196     @QName: xp|wf-entity-declared
16197     @enDesc:
16198     {P:: In a document
16199    
16200     - without any DTD,
16201    
16202     - with only an internal DTD subset that contains no parameter
16203     entity references, or
16204    
16205     - with <XML::standalone="yes">,
16206    
16207     for an entity reference that does not occur within the external
16208     subset or a parameter entity, the <CODE::Name> given in the
16209     entity reference <kwd:MUST> match the <CODE::Name> does not
16210     occur within the external subset or a parameter entity,
16211     except that five predefined character entities need not
16212     be declared. The declaration of a general entity <kwd:MUST>
16213     precede any reference to it which appears in a default value
16214     in an attribute list declaration.
16215     @enMufDef:
16216     Entity |%p (name => {<Q::xp|name>});| must be declared
16217     in the internal subset
16218 wakaba 1.23 @ecore:hasParameter: xp|error-token
16219     @ecore:hasParameter:
16220     @@@: xp|name
16221     @@enDesc:
16222     The name of the entity.
16223    
16224     WFErrDef:
16225     @QName: xp|wf-parsed-entity
16226     @enDesc:
16227     An entity reference <kwd:MUST-NOT> contain the name of an
16228     unparsed entity.
16229     @enMufDef:
16230     Entity |%p (name => {<Q::xp|name>});| is an unparsed entity
16231     @ecore:hasParameter: xp|error-token
16232     @ecore:hasParameter:
16233     @@@: xp|name
16234     @@enDesc:
16235     The name of the entity.
16236    
16237     WFErrDef:
16238     @QName: xp|wf-no-recursion
16239     @enDesc:
16240     A parsed entity <kwd:MUST-NOT> contain a recursive reference
16241     to itself, either directly or indirectly.
16242     @enMufDef:
16243     Entity |%p (name => {<Q::xp|name>});| is recursively referenced
16244 wakaba 1.19 @ecore:hasParameter: xp|error-token
16245     @ecore:hasParameter:
16246     @@@: xp|name
16247     @@enDesc:
16248     The name of the entity.
16249 wakaba 1.16
16250     FatalErrDef:
16251     @QName: xp|fatal-xml11-end-of-line-in-xml-declaration
16252     @enDesc:
16253     An end-of-line character <CODE::U+0085> or <CODE::U+2028> is appeared
16254     within an XML declaration or text declaration.
16255     @enMufDef:
16256     End-of-line character %character-code-point
16257     (v => {<Q::xp|character-number>}); cannot be used within the
16258     XML or text declaration
16259     @ecore:hasParameter:
16260     @@@: xp|character-number
16261     @@enDesc:
16262     The code position of the end-of-line character.
16263 wakaba 1.24
16264     ErrDef:
16265     @QName: xp|error-internal-predefined-entity
16266     @enDesc:
16267     A general entity declaration whose <CODE::Name> equals to one
16268     of predefined entities <kwd:MUST> declare it as an internal entity.
16269     @enMufDef:
16270     Entity |%p (name => {<Q::xp|name>});| must be declared as an
16271     internal entity
16272     @ecore:hasParameter: xp|error-token
16273     @ecore:hasParameter:
16274     @@@: xp|name
16275     @@enDesc:
16276     The name of the entity.
16277    
16278     ErrDef:
16279     @QName: xp|error-malformed-predefined-entity
16280     @enDesc:
16281     A general entity declaration whose <CODE::Name> equals to one
16282     of predefined entities <kwd:MUST> declare it as a data
16283     character for the entity.
16284     @enMufDef:
16285     Entity declaration for |%p (name => {<Q::xp|name>});|
16286     (replacement text |%p (name => {<Q::xp|replacement-text>});|) is malformed
16287     @ecore:hasParameter: xp|error-token
16288     @ecore:hasParameter:
16289     @@@: xp|name
16290     @@enDesc:
16291     The name of the entity.
16292     @ecore:hasParameter:
16293     @@@: xp|replacement-text
16294     @@enDesc:
16295     The replacement text of the entity declaration.
16296    
16297     WarnDef:
16298     @QName: xp|warning-entity-declaration-ignored
16299     @enDesc:
16300     An entity declaration is ignored because the same entity
16301     is declared before.
16302     @enMufDef:
16303     Entity declaration for |%p (name => {<Q::xp|name>});| is ignored
16304     @ecore:hasParameter: xp|error-token
16305     @ecore:hasParameter:
16306     @@@: xp|name
16307     @@enDesc:
16308     The name of the entity.
16309    
16310     VCErrDef:
16311     @QName: xp|vc-unique-notation-name
16312     @enDesc:
16313     A <CODE::Name> <kwd:MUST-NOT> be declared in more than
16314     one notation declaration.
16315     @enMufDef:
16316     Notation |%p (name => {<Q::xp|name>});| is already declared
16317     @ecore:hasParameter: xp|error-token
16318     @ecore:hasParameter:
16319     @@@: xp|name
16320     @@enDesc:
16321     The name of the notation.
16322 wakaba 1.25
16323     WarnDef:
16324     @QName: xp|warning-entity-declaration-not-processed
16325     @enDesc:
16326     An entity declaration is not processed because there
16327     is a reference to parameter entity before the declaration
16328     and the entity is not read.
16329     @enMufDef:
16330     Entity declaration for |%p (name => {<Q::xp|name>});| is not processed
16331     @ecore:hasParameter: xp|error-token
16332     @ecore:hasParameter:
16333     @@@: xp|name
16334     @@enDesc:
16335     The name of the entity.
16336    
16337     WarnDef:
16338     @QName: xp|warning-attribute-definition-not-processed
16339     @enDesc:
16340     An attribute definition is not processed because there
16341     is a reference to parameter entity before the declaration
16342     and the entity is not read.
16343     @enMufDef:
16344     Attribute definition for |%p (name => {<Q::xp|name>});| is not processed
16345     @ecore:hasParameter: xp|error-token
16346     @ecore:hasParameter:
16347     @@@: xp|name
16348     @@enDesc:
16349     The name of the attribute.
16350 wakaba 1.26
16351 wakaba 1.37 FatalErrDef:
16352     @QName: xp|fatal-illegal-byte-sequence
16353     @enDesc:
16354     An XML entity is determined to be in a certain encoding but
16355     contains byte sequences that are not legal in that encoding.
16356     @enMufDef:
16357     Illegal byte sequence
16358     @enImplNote: dump
16359     @ecore:hasParameter: xp|byte-sequence
16360     @ecore:hasParameter: xp|code-state
16361    
16362     XWParam:
16363     @QName: xp|byte-sequence
16364     @enDesc:
16365     A reference to the byte string that contains an error.
16366    
16367     XWParam:
16368     @QName: xp|code-state
16369     @enDesc:
16370     A string that identifies the state defined in the coded character set
16371     in which an error is encoutnered.
16372    
16373     WarnDef:
16374     @QName: xp|warning-unassigned-code-point
16375     @enDesc:
16376     If the entity contains an unassigned code point.
16377     @enMufDef:
16378     Unassigned code point found
16379     @enImplNote: dump
16380     @ecore:hasParameter: xp|byte-sequence
16381    
16382     FatalErrDef:
16383     @QName: xp|fatal-unprocessable-encoding
16384     @enDesc:
16385     When an XML processor encounters an entity with an encoding
16386     that is unable to process.
16387     @enMufDef:
16388     Encoding <%p (name => {<Q::xp|charset-uri>});>
16389     %p (name => {<Q::xp|encoding>}, prefix => {(}, suffix => {) });is
16390     not supported
16391     @ecore:hasParameter: xp|encoding
16392     @ecore:hasParameter: xp|charset-uri
16393    
16394     XWParam:
16395     @QName: xp|encoding
16396     @enDesc:
16397     The XML name of the encoding.
16398     @multipleProperties: DISCore|Single
16399     @dataType: DISCore|String
16400     @DISCore:resourceType: DISSource|ResourceProperty
16401    
16402     XWParam:
16403     @QName: xp|charset-uri
16404     @enDesc:
16405     The URI that identifies the encoding.
16406    
16407     FatalErrDef:
16408     @QName: xp|fatal-utf-16-no-bom
16409     @enDesc:
16410     If the encoding of an entity is UTF-16 but it does not
16411     contains <CHAR::BOM>.
16412     @enMufDef:
16413     The entity contains no BOM
16414    
16415     FatalErrDef:
16416     @QName: xp|fatal-encoding-mismatch
16417     @enDesc:
16418     If an entity including an encoding declaration
16419     in an encoding other than that named in the declaration.
16420     @enMufDef:
16421     The entity is labeled as <%p (name => {<Q::xp|charset-uri>});>
16422     %p (name => {<Q::xp|encoding>}, prefix => {(}, suffix => {) });but
16423     it is wrong
16424     @ecore:hasParameter: xp|encoding
16425     @ecore:hasParameter: xp|charset-uri
16426    
16427     WarnDef:
16428     @QName: xp|warn-unknown-decode-error
16429     @enDesc:
16430     Unknown message from the decoder.
16431     @enMufDef:
16432     Encoding decoder error: <%p (name => {<Q::xp|error-type>});>
16433     @ecore:hasParameter: xp|error-type
16434     @ecore:hasParameter: xp|error-param
16435    
16436     XWParam:
16437     @QName: xp|error-type
16438     @enDesc:
16439     A DOM URI that identifies the error type.
16440    
16441     XWParam:
16442     @QName: xp|error-param
16443     @enDesc:
16444     A <Q::xp|error-type>-dependent set of error descriptions.
16445    
16446 wakaba 1.26 NSFatalErrDef:
16447     @QName: xp|nswf-legal-ncname
16448     @enDesc:
16449     <CODE::Name>s other than element type names and attribute names
16450     <kwd:MUST> be <CODE::NCName>s.
16451     @enMufDef:
16452     <CODE::Name> |%p (name => {<Q::xp|name>});| is not an <CODE::NCName>
16453     @ecore:hasParameter: xp|error-token
16454     @ecore:hasParameter:
16455     @@@: xp|name
16456     @@enDesc:
16457     The name.
16458     @ecore:hasParameter:
16459     @@@: infoset|version
16460     @@enDesc:
16461     The version of XML in use.
16462    
16463     NSFatalErrDef:
16464     @QName: xp|nswf-legal-qname
16465     @enDesc:
16466     An element type name or an attribute name <kwd:MUST> be a
16467     <CODE::QName>.
16468     @enMufDef:
16469     <CODE::Name> |%p (name => {<Q::xp|name>});| is not a <CODE::QName>
16470     @ecore:hasParameter: xp|error-token
16471     @ecore:hasParameter:
16472     @@@: xp|name
16473     @@enDesc:
16474     The name.
16475     @ecore:hasParameter:
16476     @@@: infoset|version
16477     @@enDesc:
16478     The version of XML in use.
16479    
16480     NSCErrDef:
16481     @QName: xp|nsc-reserved-prefix-xml
16482     @enDesc:
16483     The prefix <XML::xml> <kwd:MUST-NOT> be undeclared or bound
16484     to any namespace name other than <URI::http://www.w3.org/XML/1998/namespace>.
16485     @enMufDef:
16486     Namespace prefix |xml| cannot be bound to namespace
16487     name |%p (name => {<Q::infoset|namespaceName>});|
16488     @ecore:hasParameter: xp|error-token
16489     @ecore:hasParameter:
16490     @@@: infoset|prefix
16491     @@enDesc:
16492     The namespace prefix.
16493     @ecore:hasParameter:
16494     @@@: infoset|namespaceName
16495     @@enDesc:
16496     The namespace name bound to or an empty string for undeclaring.
16497    
16498     NSCErrDef:
16499     @QName: xp|nsc-reserved-namespace-name-xml
16500     @enDesc:
16501     Namespace prefixes other than <XML::xml> <kwd:MUST-NOT> be bound
16502     to the namespace name <URI::http://www.w3.org/XML/1998/namespace>.
16503     @enMufDef:
16504     Namespace prefix |%p (name => {<Q::infoset|prefix>});| cannot be
16505     bound to namespace name |http://www.w3.org/XML/1998/namespace|
16506     @enImplNote:
16507     The XMLNames spec does not prohibit the URI bound to
16508     the default namespace (!)
16509     @ecore:hasParameter: xp|error-token
16510     @ecore:hasParameter:
16511     @@@: infoset|prefix
16512     @@enDesc:
16513     The namespace prefix or <DOM::null> for default namespace.
16514     @ecore:hasParameter:
16515     @@@: infoset|namespaceName
16516     @@enDesc:
16517     The namespace name bound to.
16518    
16519     NSCErrDef:
16520     @QName: xp|nsc-reserved-prefix-xmlns
16521     @enDesc:
16522     The prefix <XML::xmlns> <kwd:MUST-NOT> be declared or undeclared.
16523     @enMufDef:
16524     Namespace prefix |xmlns| cannot be declared or undeclared
16525     @ecore:hasParameter: xp|error-token
16526     @ecore:hasParameter:
16527     @@@: infoset|prefix
16528     @@enDesc:
16529     The namespace prefix.
16530     @ecore:hasParameter:
16531     @@@: infoset|namespaceName
16532     @@enDesc:
16533     The namespace name bound to or an empty string for undeclaring.
16534    
16535     NSCErrDef:
16536     @QName: xp|nsc-reserved-namespace-name-xmlns
16537     @enDesc:
16538     Namespace prefixes <kwd:MUST-NOT> be bound
16539     to the namespace name <URI::http://www.w3.org/2000/xmlns/>.
16540     @enMufDef:
16541     Namespace prefix |%p (name => {<Q::infoset|prefix>});| cannot be
16542     bound to namespace name |http://www.w3.org/2000/xmlns/|
16543     @enImplNote:
16544     The XMLNames spec does not prohibit the URI bound to
16545     the default namespace (!)
16546     @ecore:hasParameter: xp|error-token
16547     @ecore:hasParameter:
16548     @@@: infoset|prefix
16549     @@enDesc:
16550     The namespace prefix or <DOM::null> for default namespace.
16551     @ecore:hasParameter:
16552     @@@: infoset|namespaceName
16553     @@enDesc:
16554     The namespace name bound to.
16555    
16556     NSCErrDef:
16557     @QName: xp|nsc-prefix-declared
16558     @enDesc:
16559     A namespace prefix other than <XML::xml> or <XML::xmlns>
16560     <kwd:MUST> have been declared in a namespace declaration
16561     attribute in either the start or empty element tag of the
16562     element where the prefix is used or in an ancestor
16563     element. Furthermore, the attribute value in the innermost
16564     such declaration <kwd:MUST-NOT> be an empty string.
16565     @enMufDef:
16566     Namespace prefix |%p (name => {<Q::infoset|prefix>});| in
16567     qualified name |%p (name => {<Q::xp|name>});| is not declared
16568     @ecore:hasParameter: xp|error-token
16569     @ecore:hasParameter:
16570     @@@: infoset|prefix
16571     @@enDesc:
16572     The namespace prefix.
16573     @ecore:hasParameter:
16574     @@@: xp|name
16575     @@enDesc:
16576     The qualified name.
16577    
16578     NSFatalErrDef:
16579     @QName: xp|nswf-empty-namespace-name
16580     @enDesc:
16581     If the XML version of the document is 1.0 and the
16582     normalized value of the prefixed namespace declaration attribute is empty.
16583     @enMufDef:
16584     Namespace |%p (name => {<Q::infoset|prefix>});| cannot be
16585     undeclared in XML 1.0
16586     @ecore:hasParameter: xp|error-token
16587     @ecore:hasParameter:
16588     @@@: infoset|prefix
16589     @@enDesc:
16590     The namespace prefix.
16591     @ecore:hasParameter:
16592     @@@: infoset|namespaceName
16593     @@enDesc:
16594     An empty string.
16595    
16596     NSFatalErrDef:
16597     @QName: xp|nswf-unique-att-spec-expanded-name
16598     @enDesc:
16599     No element may have two attributes that have qualified name
16600     with the same local part and with namespace prefixes
16601     that have been bound to namespace names that are identical.
16602     @enMufDef:
16603     Attribute |%p (name => {<Q::infoset|localName>});| in
16604     namespace |%p (name => {<Q::infoset|namespaceName>});| is
16605     attached to the same element more than once (as
16606     |%p (name => {<Q::xp|name>});| and
16607     |%p (name => {<Q::xp|another-attribute-name>});|)
16608     @enImplNote:
16609     The XMLNames spec doesn't mention default attributes
16610     for this constraint...
16611     @ecore:hasParameter: xp|error-token
16612     @ecore:hasParameter:
16613     @@@: infoset|localName
16614     @@enDesc:
16615     The local part of the attribute.
16616     @ecore:hasParameter:
16617     @@@: infoset|namespaceName
16618     @@enDesc:
16619     The namespace URI of the attribute.
16620     @ecore:hasParameter:
16621     @@@: xp|name
16622     @@enDesc:
16623     The name, i.e. a qualified name consist of <Q::infoset:localName>
16624     and <Q::infoset:namespaceName> parameter values.
16625     @ecore:hasParameter:
16626     @@@: xp|another-attribute-name
16627     @@enDesc:
16628     Another attribute qualified name expanded to the same expanded name
16629     as <Q::xp|name>.
16630    
16631     XWParam:
16632     @QName: xp|another-attribute-name
16633 wakaba 1.24
16634     XWParam:
16635     @QName: xp|replacement-text
16636     @enDesc:
16637     The replacement text.
16638 wakaba 1.1
16639 wakaba 1.3 XWParam:
16640 wakaba 1.1 @QName: xp|error-token
16641     @enDesc:
16642     The token where the parser found an error.
16643    
16644 wakaba 1.3 XWParam:
16645     @QName: xp|name
16646     @enDesc:
16647     A name.
16648    
16649     XWParam:
16650     @QName: xp|parent
16651     @enDesc:
16652     The parent node in which the error occurs.
16653    
16654     XWParam:
16655     @QName: xp|node
16656     @enDesc:
16657     The current node.
16658    
16659     XWParam:
16660     @QName: xp|actual-element-type
16661     @enDesc:
16662     The actual element type name occured in the source.
16663    
16664     XWParam:
16665     @QName: xp|expected-element-type
16666 wakaba 1.1 @enDesc:
16667 wakaba 1.3 The element type name expected.
16668    
16669     XWParam:
16670     @QName: xp|character-number
16671     @enDesc:
16672     The character code position.
16673    
16674     ElementTypeBinding:
16675     @Name: XWParam
16676     @ElementType:
16677     dis:ResourceDef
16678     @ShadowContent:
16679     @@rdf:type: ecore|Parameter
16680 wakaba 1.1
16681     ElementTypeBinding:
16682     @Name:enMufDef
16683     @ElementType:
16684     ecore:defaultMessage
16685     @ShadowContent:
16686     @@lang:en
16687     @@ContentType:
16688     lang:muf
16689    
16690     ResourceDef:
16691     @QName: DOMImpl
16692     @AliasFor: DOMCore|DOMImplementation
16693    
16694 wakaba 1.27 ResourceDef:
16695     @QName: LSInput
16696     @AliasFor: DOMLS|LSInput
16697    
16698     ResourceDef:
16699     @QName: LSParser
16700     @AliasFor: DOMLS|LSParser
16701    
16702 wakaba 1.1 ElementTypeBinding:
16703     @Name: Attr
16704     @ElementType:
16705     dis:ResourceDef
16706     @ShadowContent:
16707     @@rdf:type: DISLang|Attribute
16708    
16709     ElementTypeBinding:
16710     @Name: Get
16711     @ElementType:
16712     dis:ResourceDef
16713     @ShadowContent:
16714     @@rdf:type: DISLang|AttributeGet
16715    
16716     ElementTypeBinding:
16717     @Name: Set
16718     @ElementType:
16719     dis:ResourceDef
16720     @ShadowContent:
16721     @@rdf:type: DISLang|AttributeSet
16722    
16723     ElementTypeBinding:
16724     @Name: enDesc
16725     @ElementType:
16726     dis:Description
16727     @ShadowContent:
16728     @@lang:en
16729    
16730     ElementTypeBinding:
16731     @Name: Method
16732     @ElementType:
16733     dis:ResourceDef
16734     @ShadowContent:
16735     @@rdf:type: DISLang|Method
16736    
16737     ElementTypeBinding:
16738     @Name: Return
16739     @ElementType:
16740     dis:ResourceDef
16741     @ShadowContent:
16742     @@rdf:type: DISLang|MethodReturn
16743    
16744     ElementTypeBinding:
16745     @Name: Param
16746     @ElementType:
16747     dis:ResourceDef
16748     @ShadowContent:
16749     @@rdf:type: DISLang|MethodParameter
16750    
16751     ElementTypeBinding:
16752     @Name: PerlDef
16753     @ElementType:
16754     dis:Def
16755     @ShadowContent:
16756     @@ContentType: lang|Perl
16757    
16758     ElementTypeBinding:
16759 wakaba 1.27 @Name: PerlDefC
16760     @ElementType:
16761     dis:Def
16762     @ShadowContent:
16763     @@ContentType: lang|Perl
16764    
16765     ElementTypeBinding:
16766 wakaba 1.1 @Name: PropDef
16767     @ElementType:
16768     dis:ResourceDef
16769     @ShadowContent:
16770     @@rdf:type: rdf|Property
16771    
16772     ClsDef:
16773     @ClsQName: ManakaiXMLParserExceptionFormatter
16774    
16775 wakaba 1.47 @ClsISA: ecore|MUErrorFormatter
16776 wakaba 1.1
16777     @RuleDef:
16778     @@Name: xp-error-token-type
16779     @@enDesc:
16780     The type of the token the parser is encountered.
16781    
16782     @@Method:
16783     @@@Name: after
16784     @@@Param:
16785     @@@@Name: name
16786     @@@@Type: DOMString
16787     @@@@enDesc: The name of the method.
16788     @@@Param:
16789     @@@@Name: p
16790     @@@@Type: DISPerl|HASH
16791     @@@@enDesc: The set of the parameters to the method.
16792     @@@Param:
16793     @@@@Name: o
16794     @@@@Type: DISPerl|HASH
16795     @@@@enDesc: The option value.
16796     @@@Return:
16797     @@@@PerlDef:
16798     $p->{-result} = $o->{<H::xp|error-token>}->{type}
16799     if defined $o->{<H::xp|error-token>}->{type};
16800    
16801     @RuleDef:
16802     @@Name: xp-error-token-value
16803     @@enDesc:
16804     The value of the token the parser is encountered, if any.
16805    
16806     @@Method:
16807     @@@Name: after
16808     @@@Param:
16809     @@@@Name: name
16810     @@@@Type: DOMString
16811     @@@@enDesc: The name of the method.
16812     @@@Param:
16813     @@@@Name: p
16814     @@@@Type: DISPerl|HASH
16815     @@@@enDesc: The set of the parameters to the method.
16816     @@@Param:
16817     @@@@Name: o
16818     @@@@Type: DISPerl|HASH
16819     @@@@enDesc: The option value.
16820     @@@Return:
16821     @@@@PerlDef:
16822     $p->{-result} = $o->{<H::xp|error-token>}->{value}
16823     if defined $o->{<H::xp|error-token>}->{value};
16824    
16825     @RuleDef:
16826     @@Name: xp-error-lines
16827     @@enDesc:
16828     A copy of fragment of the source text that contains the line
16829     where the error occurred, if available.
16830    
16831     @@Method:
16832     @@@Name: after
16833     @@@Param:
16834     @@@@Name: name
16835     @@@@Type: DOMString
16836     @@@@enDesc: The name of the method.
16837     @@@Param:
16838     @@@@Name: p
16839     @@@@Type: DISPerl|HASH
16840     @@@@enDesc: The set of the parameters to the method.
16841     @@@Param:
16842     @@@@Name: o
16843     @@@@Type: DISPerl|HASH
16844     @@@@enDesc: The option value.
16845     @@@Return:
16846     @@@@PerlDef:
16847     my $pos = $o-><AG::DOMCore|DOMError.location>
16848     -><AG::DOMCore|DOMLocator.utf32Offset>;
16849 wakaba 1.27 my $src = $o->{<H::ecore|object>}->{entity}->[-1]->{reptxt};
16850     if (defined $src and $pos > -1) {
16851 wakaba 1.1 my $start = $pos;
16852     $start = rindex ($$src, "\x0A", $start - 1) for 0..2;
16853     $start++;
16854     my $end = $pos;
16855     $end = index ($$src, "\x0A", $end + 1) for 0..2;
16856     $end = length $$src if $end < 0;
16857     $p->{-result} = substr $$src, $start, $end - $start;
16858     }
16859 wakaba 1.3
16860     @RuleDef:
16861     @@Name: character-code-point
16862     @@enDesc:
16863     The character code position, in <CODE::U+<VAR::HHHH>> notation.
16864    
16865     @@Method:
16866     @@@Name: after
16867     @@@Param:
16868     @@@@Name: name
16869     @@@@Type: DOMString
16870     @@@@enDesc: The name of the method.
16871     @@@Param:
16872     @@@@Name: p
16873     @@@@Type: DISPerl|HASH
16874     @@@@enDesc: The set of the parameters to the method.
16875     @@@Param:
16876     @@@@Name: o
16877     @@@@Type: DISPerl|HASH
16878     @@@@enDesc: The option value.
16879     @@@RuleParam:
16880     @@@@Name: v
16881     @@@@Type: DISPerl|Number
16882     @@@@enDesc:
16883     The name of the error parameter that contains the character code.
16884     @@@Return:
16885     @@@@PerlDef:
16886     $p->{-result} = sprintf 'U+%04X', $o->{$p->{v}};
16887 wakaba 1.1 ##XMLParserExceptionFormatter
16888 wakaba 1.27
16889     ElementTypeBinding:
16890     @Name: CParam
16891     @ElementType:
16892     dis:ResourceDef
16893     @ShadowContent:
16894     @@rdf:type:
16895     @@@@: c|DOMConfigurationParameter
16896     @@rdf:type:
16897 wakaba 1.33 @@@@: DISSource|ResourceProperty
16898     @@subsetOf:
16899     @@@@: c|anyDOMConfigurationParameter
16900 wakaba 1.34 @@multipleProperties:
16901     @@@@: DISCore|Single
16902 wakaba 1.27
16903     ElementTypeBinding:
16904     @Name: CParamApp
16905     @ElementType:
16906     dis:ResourceDef
16907     @ShadowContent:
16908     @@rdf:type:
16909     @@@@: c|DOMConfigurationParameterApplication
16910 wakaba 1.30
16911 wakaba 1.34 ElementTypeBinding:
16912     @Name: boolCParam
16913     @ElementType:
16914     dis:ResourceDef
16915     @ShadowContent:
16916     @@DISCore:resourceType:
16917     @@@@: c|DOMConfigurationParameter
16918     @@DISCore:resourceType:
16919     @@@@: DISSource|ResourceProperty
16920 wakaba 1.47 @@Type: idl|boolean
16921 wakaba 1.34 @@subsetOf:
16922     @@@@: c|anyDOMConfigurationParameter
16923     @@multipleProperties:
16924     @@@@: DISCore|Single
16925     @@dataType:
16926     @@@@: DISCore|Boolean
16927    
16928 wakaba 1.30 CParamApp:
16929     @QName: xml-id
16930     @c:domConfigurationParameter: cfg|xml-id
16931     @c:targetType: xp|ManakaiXMLParser
16932 wakaba 1.34 @TrueCase:
16933     @@c:isSupported: 1
16934     @FalseCase:
16935     @@c:isSupported: 1
16936 wakaba 1.27
16937     CParamApp:
16938     @QName: error-handler
16939     @c:domConfigurationParameter: c|error-handler
16940     @c:targetType: xp|ManakaiXMLParser
16941 wakaba 1.34
16942     boolCParam:
16943     @QName: cfg|entity-replacement-tree
16944     @DOMLS:lsKey:
16945     @@@: erep
16946 wakaba 1.47 @Type: idl|boolean
16947 wakaba 1.34 @c:targetType: xp|ManakaiXMLParser
16948     @IsSupportRequired: 1
16949     @c:isSupported: 1
16950     @TrueCase:
16951     @@c:isSupported: 1
16952     @@enDesc:
16953     The parser <kwd:MUST> cnstruct the replacement subtree of
16954 wakaba 1.35 a general parsed <IF::tx|Entity> node if the replacement text
16955 wakaba 1.34 for the node is available.
16956    
16957     If this value is set to the parameter, then a fatal error
16958     might be reported even if the entire document is well-formed
16959     in case a general parsed entity has replacement text that is
16960     not well-formed when evaluated as if it has been referenced
16961     in the content of an element, except that undeclared namespace prefixes
16962     do not result in namespace well-formedness error.
16963     @FalseCase:
16964     @@IsDefault: 1
16965     @@c:isSupported: 1
16966     @@IsSupportRequired: 1
16967     @@enDesc:
16968 wakaba 1.35 The parser don't have to construct <IF::tx|Entity> replacement
16969 wakaba 1.34 subtrees.
16970    
16971     @Test:
16972     @@QName: cfg.entity-replacement-tree.test
16973     @@PerlDef:
16974     my $xp;
16975     __CODE{createParserForTest:: $xp => $xp}__;
16976     my $cfg = $xp-><AG::LSInput.domConfig>;
16977    
16978     my $pname = <Q::cfg|entity-replacement-tree>;
16979    
16980     $test->id ('default.false');
16981     $test->assert_false ($cfg-><M::c|DOMConfiguration.getParameter> ($pname));
16982    
16983     $test->id ('false.to.true');
16984     $cfg-><M::c|DOMConfiguration.setParameter> ($pname => true);
16985     $test->assert_false ($cfg-><M::c|DOMConfiguration.getParameter> ($pname));
16986    
16987     $test->id ('true.to.false');
16988     $cfg-><M::c|DOMConfiguration.setParameter> ($pname => false);
16989     $test->assert_false ($cfg-><M::c|DOMConfiguration.getParameter> ($pname));
16990    
16991     $test->id ('reset');
16992     $cfg-><M::c|DOMConfiguration.setParameter> ($pname => true);
16993     $cfg-><M::c|DOMConfiguration.setParameter> ($pname => null);
16994     $test->assert_false ($cfg-><M::c|DOMConfiguration.getParameter> ($pname));
16995 wakaba 1.27
16996     CParam:
16997     @QName: xp|ls-input-to-input-file
16998     @DOMLS:lsKey:
16999     @@@: i2i
17000     @Type: ManakaiDOMLSInputToInputFile
17001     @c:targetType: xp|ManakaiXMLParser
17002     @IsSupportRequired: 1
17003     @c:isSupported: 1
17004     @enDesc:
17005     An <IF::LSInput> to Perl filehandle converter.
17006    
17007     @Method:
17008     @@rdf:type: c|DOMConfigurationParameterDefaultGetter
17009     @@Param:
17010     @@@Name: name
17011     @@@Type: DOMString
17012     @@@dis:actualType: c|DOMConfigurationParameterName
17013     @@@enDesc: The parameter name.
17014     @@Return:
17015     @@@Type: ManakaiDOMLSInputToInputFile
17016     @@@enDesc:
17017     The default resolver.
17018     @@@PerlDefC:
17019 wakaba 1.37 # resolveLSInput
17020 wakaba 1.27 $r = sub {
17021 wakaba 1.37 my ($self, $impl, $input, $parser, $errorHandler) = @_;
17022 wakaba 1.27 ## As defined in DOM Level 3 LS |LSInput| interface
17023    
17024     my $r = {};
17025    
17026     __DEEP{
17027    
17028     FH: {
17029     ## 1. |characterStream|
17030     my $v = $input-><AG::LSInput.characterStream>;
17031     if (defined $v) {
17032     $r->{filehandle} = $v;
17033     last FH;
17034     }
17035    
17036     ## 2. |byteStream|
17037     $v = $input-><AG::LSInput.byteStream>;
17038     if (defined $v) {
17039 wakaba 1.37 require Message::Charset::Encode;
17040     my $mceimpl = $impl-><M::f|GetFeature.getFeature>
17041     (<Q::fe|MCEncode>, '1.0');
17042     my $encode = $input-><AG::LSInput.encoding>;
17043     my $encode_uri = defined $encode
17044     ? $mceimpl-><M::mce|MCEncodeImplementation
17045     .getURIFromCharsetName>
17046     (<Q::cs|xmlName>, $encode)
17047     : <Q::xml-auto-charset:>;
17048     $r->{filehandle} = $mceimpl-><M::mce|MCEncodeImplementation
17049     .createMCDecodeHandle>
17050     ($encode_uri, $v, sub {
17051     my ($self, $fh, $type, %opt) = @_;
17052     my $continue = true;
17053     if ($type eq <Q::cs|illegal-octets-error>) {
17054     $continue = __c|ERROR{xp|fatal-illegal-byte-sequence::
17055     xp|byte-sequence => {$opt{octets}},
17056     ecore|object => {$parser},
17057     }__;
17058     } elsif ($type eq <Q::cs|unassigned-code-point-error>) {
17059     $continue = __c|ERROR{xp|warning-unassigned-code-point::
17060     xp|byte-sequence => {$opt{octets}},
17061     ecore|object => {$parser},
17062     }__;
17063     $opt{octets} = \"\x{FFFD}";
17064     } elsif ($type eq <Q::cs|invalid-state-error>) {
17065     $continue = __c|ERROR{xp|fatal-illegal-byte-sequence::
17066     xp|code-state => {$opt{state}},
17067     ecore|object => {$parser},
17068     }__;
17069     } elsif ($type eq <Q::cs|charset-not-supported-error>) {
17070     $continue = __c|ERROR{xp|fatal-unprocessable-encoding::
17071     xp|encoding => {$encode},
17072     xp|charset-uri => {$opt{charset_uri}},
17073     ecore|object => {$parser},
17074     }__;
17075     } elsif ($type eq <Q::cs|no-bom-error>) {
17076     if ($opt{charset_uri} eq <Q::cs|XML.utf-16>) {
17077     $continue = __c|ERROR{xp|fatal-utf-16-no-bom::
17078     ecore|object => {$parser},
17079     }__;
17080     } else {
17081     $continue = __c|ERROR{xp|fatal-illegal-byte-sequence::
17082     xp|code-state => 'bom',
17083     ecore|object => {$parser},
17084     }__;
17085     }
17086     } elsif ($type eq <Q::cs|charset-name-mismatch-error>) {
17087     $continue = __c|ERROR{xp|fatal-encoding-mismatch::
17088     xp|encoding => {$encode},
17089     xp|charset-uri => {$opt{charset_uri}},
17090     ecore|object => {$parser},
17091     }__;
17092     } else {
17093     $continue = __c|ERROR{xp|warn-unknown-decode-error::
17094     xp|error-type => {$type},
17095     xp|error-param => {\%opt},
17096     ecore|object => {$parser},
17097     }__;
17098     }
17099     unless ($continue) {
17100     __EXCEPTION{DOMLS|PARSE_ERR::
17101     ecore|object => {$parser},
17102     }__;
17103     }
17104     });
17105     $r->{input_encoding}
17106     = $r->{filehandle}-><AG::mce|MCDecodeHandle.inputEncoding>
17107     if defined $r->{filehandle};
17108     last FH;
17109 wakaba 1.27 }
17110    
17111     ## 3. |stringData|
17112     $v = $input-><AG::LSInput.stringData>;
17113     if (defined $v) {
17114     require IO::String;
17115     $r->{filehandle} = IO::String->new ($v);
17116     last FH;
17117     }
17118    
17119     ## 4. |systemId|
17120     ## TODO:
17121     ## resolve relative URI
17122     ## open
17123     ## set document_uri
17124    
17125     ## 5. |publicId|
17126     ## The default resolver does not support only-|publicId| input.
17127    
17128     return null;
17129     } # FH
17130    
17131     DURI: {
17132     last DURI if defined $r->{document_uri};
17133    
17134     my $v = $input-><AG::LSInput.systemId>;
17135     if (defined $v) {
17136 wakaba 1.29 $r->{base_uri} = $input-><AG::LSInput.baseURI>
17137     unless defined $r->{base_uri};
17138     if (defined $r->{base_uri}) {
17139 wakaba 1.41 $r->{document_uri} = $impl->create_uri_reference (\$v)
17140 wakaba 1.29 -><M::urigen|URIReference.getAbsoluteReference>
17141     ($r->{base_uri})
17142     -><AG::urigen|URIReference.uriReference>;
17143     } else {
17144     $r->{document_uri} = $v;
17145     }
17146 wakaba 1.27 last DURI;
17147     }
17148    
17149     ## TODO: pubid -> pubid URN -> document_uri
17150     } # DURI
17151    
17152     BURI: {
17153     last BURI if defined $r->{base_uri};
17154    
17155     my $v = $input-><AG::LSInput.baseURI>;
17156     if (defined $v) {
17157     $r->{base_uri} = $v;
17158     last BURI;
17159     }
17160    
17161     if (defined $r->{document_uri}) {
17162     $r->{base_uri} = $r->{document_uri};
17163     }
17164     } # BURI
17165    
17166 wakaba 1.37 $r->{input_encoding} = $input-><AG::LSInput.encoding>
17167     unless defined $r->{input_encoding};
17168    
17169 wakaba 1.27 }__;
17170    
17171     ## ISSUE: Is |certifiedText| required by parsers?
17172    
17173     return $r;
17174     };
17175     @Method:
17176     @@rdf:type: c|DOMConfigurationParameterSetter
17177     @@Param:
17178     @@@Name: name
17179     @@@Type: DOMString
17180     @@@dis:actualType: c|DOMConfigurationParameterName
17181     @@@enDesc: The parameter name.
17182     @@Param:
17183     @@@Name: value
17184     @@@Type: DOMMain|DOMUserData
17185     @@@dis:actualType: ManakaiDOMLSInputToInputFile
17186     @@@enDesc: The new value.
17187     @@Return:
17188 wakaba 1.47 @@@Type: idl|void
17189 wakaba 1.27 @@@PerlDefC:
17190     $self->[1]->{<H::xp|ls-input-to-input-file>} = $value;
17191     @@enImplNote:
17192     Implied input processor converts non-blessed code references
17193     into a <Class::ManakaiDOMLSInputToInputFile> object.
17194     @Method:
17195     @@rdf:type: c|DOMConfigurationParameterChecker
17196     @@Param:
17197     @@@Name: name
17198     @@@Type: DOMString
17199     @@@dis:actualType: c|DOMConfigurationParameterName
17200     @@@enDesc: The parameter name.
17201     @@Param:
17202     @@@Name: value
17203     @@@Type: DOMMain|DOMUserData
17204     #@@@dis:actualType: ManakaiDOMLSInputToInputFile
17205     @@@enDesc: The new value.
17206     @@Return:
17207 wakaba 1.47 @@@Type: idl|boolean
17208 wakaba 1.27 @@@PerlDefC:
17209     $r = UNIVERSAL::isa ($value, 'CODE') or
17210     UNIVERSAL::isa ($value, <ClassName::ManakaiDOMLSInputToInputFile>);
17211    
17212     @@Test:
17213     @@@QName: cp.ls-input-to-input-file.test
17214     @@@PerlDefC:
17215     my $xp;
17216     __CODE{createParserForTest:: $xp => $xp}__;
17217     my $cfg = $xp-><AG::LSInput.domConfig>;
17218    
17219     my $cp = <Q::xp|ls-input-to-input-file>;
17220    
17221     $test->id ('default');
17222     my $default = $cfg-><M::c|DOMConfiguration.getParameter> ($cp);
17223     $test->assert_isa ($default,
17224     <ClassName::ManakaiDOMLSInputToInputFile>);
17225    
17226     $test->id ('set');
17227     my $sub1 = sub { };
17228     $cfg-><M::c|DOMConfiguration.setParameter> ($cp => $sub1);
17229     my $sub2 = $cfg-><M::c|DOMConfiguration.getParameter> ($cp);
17230     $test->assert_isa ($sub2, <ClassName::ManakaiDOMLSInputToInputFile>);
17231     $test->assert_equals ($sub2, $sub1);
17232    
17233     $test->id ('reset');
17234     $cfg-><M::c|DOMConfiguration.setParameter> ($cp => null);
17235     my $sub3 = $cfg-><M::c|DOMConfiguration.getParameter> ($cp);
17236     $test->assert_isa ($sub3, <ClassName::ManakaiDOMLSInputToInputFile>);
17237     $test->assert_equals ($sub3, $default);
17238 wakaba 1.29
17239     @@Test:
17240     @@@QName: cp.ls-input-to-input-file.default.test
17241     @@@PerlDefC:
17242     my $xp;
17243     __CODE{createParserForTest:: $xp => $xp}__;
17244     my $cfg = $xp-><AG::LSInput.domConfig>;
17245     my $cp = <Q::xp|ls-input-to-input-file>;
17246     my $default = $cfg-><M::c|DOMConfiguration.getParameter> ($cp);
17247    
17248     my $err = sub {}; # dummy error handler
17249    
17250     my $cs = \*STDOUT; # dummy input
17251    
17252     $test->id ('cs.sysid');
17253     my $r1 = $default->resolve_ls_input ({
17254     character_stream => $cs,
17255     system_id => q<http://example.com/sysid>,
17256     }, $err);
17257     $test->assert_equals
17258     ($r1->document_uri, q<http://example.com/sysid>);
17259     $test->assert_equals
17260     ($r1->base_uri, q<http://example.com/sysid>);
17261    
17262     $test->id ('cs.baseuri.sysid');
17263     my $r1 = $default->resolve_ls_input ({
17264     character_stream => $cs,
17265     system_id => q<sysid>,
17266     base_uri => q<http://example.com/>,
17267     }, $err);
17268     $test->assert_equals
17269     ($r1->document_uri, q<http://example.com/sysid>);
17270     $test->assert_equals
17271     ($r1->base_uri, q<http://example.com/>);
17272 wakaba 1.27 ##ls-input-to-input-file
17273    
17274     ClsDef:
17275     @ClsQName: ManakaiDOMLSInputToInputFile
17276     @enDesc:
17277     An <Class::ManakaiDOMLSInputToInputFile> object is used to covert
17278     a <IF::LSInput> object into a Perl filehandle.
17279    
17280     {ISSUE::
17281     In which module this class should be placed?
17282    
17283     Better interface name?
17284     }
17285    
17286     @enDesc:
17287     @@ddid: perl
17288     @@@:
17289     For Perl binding, any parameter that accepts
17290     a <Class::ManakaiDOMLSInputToInputFile> would also accept a Perl code
17291     reference (subroutine reference). The code reference
17292     will be blessed as a <Class::ManakaiDOMLSInputToInputFile> whose
17293     <M::ManakaiDOMLSInputToInputFile.resolveLSInput> method invokes the code.
17294    
17295     @ResourceDef:
17296 wakaba 1.48 @@QName: LSInputToInputFileIOProcessor
17297 wakaba 1.27 @@rdf:type: DISLang|InputProcessor
17298     @@rdf:type: DISLang|OutputProcessor
17299     @@PerlDef:
17300     $INPUT = bless $INPUT, <ClassName::ManakaiDOMLSInputToInputFile>
17301     if ref $INPUT eq 'CODE';
17302    
17303     @Method:
17304     @@Name: resolveLSInput
17305     @@enDesc:
17306     Converts a <IF::LSInput> into a Perl filehandle.
17307     @@Param:
17308 wakaba 1.37 @@@Name: impl
17309     @@@Type: f|MinimumImplementation
17310     @@@enDesc:
17311     The implementation object.
17312     @@Param:
17313 wakaba 1.27 @@@Name: input
17314     @@@Type: LSInput
17315     @@@enDesc:
17316     The input.
17317     @@Param:
17318 wakaba 1.37 @@@Name: parser
17319     @@@Type: LSParser
17320     @@@enDesc:
17321     The parser.
17322     @@Param:
17323 wakaba 1.27 @@@Name: errorHandler
17324     @@@Type: c|DOMErrorHandler
17325     @@@enDesc:
17326     An error handler. If the method encounters an error
17327     or warning, it <kwd:MAY> notify it to application
17328     via this handler.
17329     @@Return:
17330     @@@Type: ManakaiDOMInputFile
17331     @@@enDesc:
17332     A <Class::ManakaiDOMInputFile> object created from <P::input>.
17333     @@@nullCase:
17334     @@@@enDesc:
17335     If the method was unable to resolve the <P::input>.
17336    
17337     {ISSUE::
17338     Should we allow the method to throw exceptions?
17339     }
17340     @@@PerlDef:
17341     __DEEP{
17342 wakaba 1.37 $r = $self->($self, $impl, $input, $parser, $errorHandler);
17343 wakaba 1.27 }__;
17344     @@@enImplNote:
17345     Notet that the input / output processor for <CODE::$input>
17346     and return value might or might not be inserted in
17347     the <Perl::$self> code.
17348     ##LSInputToInputFile
17349    
17350     ClsDef:
17351     @ClsQName: ManakaiDOMInputFile
17352     @enDesc:
17353     A set of information on the input, including filehandle.
17354    
17355     @enDesc:
17356     @@ddid: perl
17357     @@@:
17358     For Perl binding, any parameter that accepts
17359     a <Class::ManakaiDOMInputFile> would also accept a Perl hash reference.
17360     If a hash reference is given to parameter that expects
17361     a <Class::ManakaiDOMInputFile> object, then it
17362     bless the hash with the class.
17363    
17364     Each attributes defined
17365     in the class is associated to the hash value with the
17366     key equals to the attribut name. Each method defined in
17367     the class will invoke the code reference retrieved
17368     from the hash by the key equals to the method name.
17369    
17370     If there is no value in the hash for an attribute,
17371     then its value is <DOM::null>.
17372    
17373     @ResourceDef:
17374 wakaba 1.48 @@QName: InputFileIOProcessor
17375 wakaba 1.27 @@rdf:type: DISLang|InputProcessor
17376     @@rdf:type: DISLang|OutputProcessor
17377     @@PerlDef:
17378     $INPUT = bless $INPUT, <ClassName::ManakaiDOMInputFile>
17379     if ref $INPUT eq 'HASH';
17380    
17381     @Attr:
17382     @@Name: filehandle
17383 wakaba 1.47 @@Type: DISPerl|filehandle
17384 wakaba 1.27 @@enDesc:
17385     The input filehandle.
17386    
17387     It <kwd:MUST> be an <Perl::open>ed (and not <Perl::close>d)
17388     filehandle. Note that
17389     it does not have to be associated with an actual file
17390     in the local file system.
17391    
17392     It <kwd:MUST> return a character (rather than byte)
17393     by <Perl::getc>.
17394     @@Get:
17395     @@@PerlDef: $r = $self->{filehandle};
17396     @@Set:
17397     @@@PerlDef: $self->{filehandle} = $given;
17398    
17399     @Attr:
17400     @@Name: baseURI
17401     @@enDesc:
17402     The base URI of the input.
17403    
17404     It <kwd:MUST> be an absolute DOM URI or <DOM::null>.
17405     Otherwise, the result is undefined.
17406     @@Type: DOMString
17407     @@nullCase:
17408     @@@enDesc:
17409     If the base URI is not available.
17410     @@Get:
17411     @@@PerlDef: $r = $self->{base_uri};
17412     @@Set:
17413     @@@PerlDef: $self->{base_uri} = $given;
17414    
17415     @Attr:
17416     @@Name: documentURI
17417     @@enDesc:
17418     The URI of the document.
17419    
17420     It <kwd:MUST> be an absolute DOM URI or <DOM::null>.
17421     Otherwise, the result is undefined.
17422     @@Type: DOMString
17423     @@nullCase:
17424     @@@enDesc:
17425     If the document URI is not available.
17426     @@Get:
17427     @@@PerlDef: $r = $self->{document_uri};
17428     @@Set:
17429     @@@PerlDef: $self->{document_uri} = $given;
17430 wakaba 1.37
17431     @Attr:
17432     @@Name: inputEncoding
17433     @@enDesc:
17434     The input encoding name.
17435     @@Type: DOMString
17436     @@nullCase:
17437     @@@enDesc:
17438     If the input encoding name is not available.
17439     @@Get:
17440     @@@PerlDef: $r = $self->{input_encoding};
17441     @@Set:
17442     @@@PerlDef: $self->{input_encoding} = $given;
17443 wakaba 1.27
17444     @Method:
17445     @@Name: close
17446     @@enDesc:
17447     Closes the file.
17448    
17449     Since when the Perl's destructor is invoked is unreliable,
17450     this method is explicitly called when the file is no longer
17451     in use.
17452    
17453     If the <Class::ManakaiDOMInputFile> is given as a hash
17454     reference and whose value for <CODE::close> is not defined,
17455     then the statement <Perl::close $filehandle> is done
17456     (where <Perl::$filehandle> is the <A::ManakaiDOMInputFile.filehandle>
17457     value).
17458     @@Return:
17459     @@@PerlDef:
17460     __DEEP{
17461     if ($self->{close}) {
17462     $self->{close}->($self);
17463     } else {
17464 wakaba 1.38 $self->{filehandle}->close;
17465 wakaba 1.27 }
17466     }__;
17467     ##ManakaiDOMInputFile
17468    
17469    
17470    

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24