/[suikacvs]/messaging/manakai/lib/Message/DOM/XMLParser.dis
Suika

Diff of /messaging/manakai/lib/Message/DOM/XMLParser.dis

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.30 by wakaba, Mon Mar 6 07:32:52 2006 UTC revision 1.40 by wakaba, Sat Nov 4 12:25:14 2006 UTC
# Line 19  Module: Line 19  Module:
19        @@@QName: MDOM|DOMLS        @@@QName: MDOM|DOMLS
20        @@@WithFor: ManakaiDOM|ManakaiDOMLatest        @@@WithFor: ManakaiDOM|ManakaiDOMLatest
21      @@Module:      @@Module:
22          @@@QName: MDOM|XML
23          @@@WithFor: ManakaiDOM|ManakaiDOMLatest
24        @@Module:
25        @@@QName: MDOM|XDoctype        @@@QName: MDOM|XDoctype
26        @@@WithFor: ManakaiDOM|ManakaiDOMLatest        @@@WithFor: ManakaiDOM|ManakaiDOMLatest
27        @@Module:
28          @@@QName: MCharset|Encode
29          @@@WithFor: ManakaiDOM|ManakaiDOMLatest
30    
31  Namespace:  Namespace:
32    @c:    @c:
33      http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#      http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#
34    @cfg:    @cfg:
35      http://suika.fam.cx/www/2006/dom-config/      http://suika.fam.cx/www/2006/dom-config/
36      @cs:
37        http://suika.fam.cx/~wakaba/archive/2004/dis/Charset/
38    @d:    @d:
39      http://suika.fam.cx/~wakaba/archive/2004/dom/xdt#      http://suika.fam.cx/~wakaba/archive/2004/dom/xdt#
40    @dis:    @dis:
# Line 57  Namespace: Line 65  Namespace:
65      http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom#      http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom#
66    @ManakaiDOMLS:    @ManakaiDOMLS:
67      http://suika.fam.cx/~wakaba/archive/2004/mdom-ls#      http://suika.fam.cx/~wakaba/archive/2004/mdom-ls#
68      @MCharset:
69        http://suika.fam.cx/~wakaba/archive/2005/manakai/Charset/
70      @mce:
71        http://suika.fam.cx/~wakaba/archive/2005/manakai/Charset/Encode/
72    @MDOM:    @MDOM:
73      http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom#ManakaiDOM.      http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom#ManakaiDOM.
74    @MDOMX:    @MDOMX:
# Line 69  Namespace: Line 81  Namespace:
81      http://www.w3.org/2000/01/rdf-schema#      http://www.w3.org/2000/01/rdf-schema#
82    @t:    @t:
83      http://suika.fam.cx/~wakaba/archive/2004/dom/tree#      http://suika.fam.cx/~wakaba/archive/2004/dom/tree#
84      @tc:
85        http://suika.fam.cx/~wakaba/archive/2005/manakai/DOM/TreeCore/
86      @td:
87        http://suika.fam.cx/~wakaba/archive/2005/manakai/DOM/Document/
88      @te:
89        http://suika.fam.cx/~wakaba/archive/2005/manakai/DOM/Element/
90    @test:    @test:
91      http://suika.fam.cx/~wakaba/archive/2004/dis/Test#      http://suika.fam.cx/~wakaba/archive/2004/dis/Test#
92      @tx:
93        http://suika.fam.cx/~wakaba/archive/2005/manakai/DOM/XML/
94    @urigen:    @urigen:
95      http://suika.fam.cx/~wakaba/archive/2005/manakai/URI/Generic/      http://suika.fam.cx/~wakaba/archive/2005/manakai/URI/Generic/
96    @x:    @x:
97      http://suika.fam.cx/~wakaba/archive/2004/dom/xml#      http://suika.fam.cx/~wakaba/archive/2004/dom/xml#
98    @xml:    @xml:
99      http://www.w3.org/XML/1998/namespace      http://www.w3.org/XML/1998/namespace
100      @xml-auto-charset:
101        http://suika.fam.cx/www/2006/03/xml-entity/
102    @xml-dtd:    @xml-dtd:
103      http://www.w3.org/TR/REC-xml      http://www.w3.org/TR/REC-xml
104    @xmlns:    @xmlns:
# Line 115  ResourceDef: Line 137  ResourceDef:
137    
138  ResourceDef:  ResourceDef:
139    @QName: Node    @QName: Node
140    @AliasFor: t|Node    @AliasFor: tc|Node
141    @For: ManakaiDOM|DOM    @For: ManakaiDOM|DOM
142    
143  ResourceDef:  ResourceDef:
144    @QName: Element    @QName: Element
145    @AliasFor: t|Element    @AliasFor: te|Element
146      @For: ManakaiDOM|DOM
147    
148    ResourceDef:
149      @QName: Attr
150      @AliasFor: te|Attr
151    @For: ManakaiDOM|DOM    @For: ManakaiDOM|DOM
152    
153  ResourceDef:  ResourceDef:
154    @QName: Document    @QName: Document
155    @AliasFor: t|Document    @AliasFor: td|Document
156    @For: ManakaiDOM|DOM    @For: ManakaiDOM|DOM
157    
158  ResourceDef:  ResourceDef:
# Line 148  ResourceDef: Line 175  ResourceDef:
175    @AliasFor: d|AttributeDefinition    @AliasFor: d|AttributeDefinition
176    @For: ManakaiDOM|DOM    @For: ManakaiDOM|DOM
177    
178    ResourceDef:
179      @QName: GE
180      @AliasFor: tx|Entity
181      @For: ManakaiDOM|DOM
182    
183    ResourceDef:
184      @QName: GERef
185      @AliasFor: tx|EntityReference
186      @For: ManakaiDOM|DOM
187    
188  ElementTypeBinding:  ElementTypeBinding:
189    @Name: ClsDef    @Name: ClsDef
190    @ElementType:    @ElementType:
# Line 445  ClsDef: Line 482  ClsDef:
482      @@PerlDef:      @@PerlDef:
483        require Message::DOM::GenericLS;        require Message::DOM::GenericLS;
484        $xp = <Class::ManakaiXMLParser>        $xp = <Class::ManakaiXMLParser>
485                ->new (<Class::gls|ManakaiGLSImplementation>->_new, '');                ->new (<Class::c|ManakaiDOMImplementation>->_new, '');
486    
487    @Method:    @Method:
488      @@ManakaiDOM:isForInternal:1      @@ManakaiDOM:isForInternal:1
# Line 471  ClsDef: Line 508  ClsDef:
508          The newly created parser.          The newly created parser.
509        @@@PerlDef:        @@@PerlDef:
510          $r = bless {          $r = bless {
511            <H::DOMCore:implementation> => $impl,            <H::f|implementation> => $impl,
512          }, $self;          }, $self;
513    
514    @Method:    @Method:
# Line 541  ClsDef: Line 578  ClsDef:
578                                  -><M::c|DOMConfiguration.getParameter>                                  -><M::c|DOMConfiguration.getParameter>
579                                      (<Q::xp|ls-input-to-input-file>);                                      (<Q::xp|ls-input-to-input-file>);
580            $in = $self->{in_in}-><M::ManakaiDOMLSInputToInputFile.resolveLSInput>            $in = $self->{in_in}-><M::ManakaiDOMLSInputToInputFile.resolveLSInput>
581                                    ($input,                                    ($self->{<H::f|implementation>}, $input,
582                                       $self,
583                                     $self->{parser_cfg}                                     $self->{parser_cfg}
584                                          -><M::c|DOMConfiguration.getParameter>                                          -><M::c|DOMConfiguration.getParameter>
585                                              ('error-handler'));                                              ('error-handler'));
# Line 561  ClsDef: Line 599  ClsDef:
599            fh => $in-><AG::ManakaiDOMInputFile.filehandle>,            fh => $in-><AG::ManakaiDOMInputFile.filehandle>,
600            base_uri => $in-><AG::ManakaiDOMInputFile.baseURI>,            base_uri => $in-><AG::ManakaiDOMInputFile.baseURI>,
601            doc_uri => $in-><AG::ManakaiDOMInputFile.documentURI>,            doc_uri => $in-><AG::ManakaiDOMInputFile.documentURI>,
602              in_enc => $in-><AG::ManakaiDOMInputFile.inputEncoding>,
603            line => 1,            line => 1,
604            column => 1,            column => 1,
605            pos => 0,            pos => 0,
# Line 599  ClsDef: Line 638  ClsDef:
638            ## Declared attributes.            ## Declared attributes.
639    
640          __DEEP{          __DEEP{
641            $r = $self->{<H::c|implementation>}-><M::DOMImpl.createDocument>;            $r = $self->{<H::f|implementation>}-><M::DOMImpl.createDocument>;
642            $self->{doc} = $r;            $self->{doc} = $r;
643              ## |Document| object.              ## |Document| object.
644            CORE::delete $self->{docx};            CORE::delete $self->{docx};
# Line 617  ClsDef: Line 656  ClsDef:
656              ##       in creating an ill-formed DOM tree when parser              ##       in creating an ill-formed DOM tree when parser
657              ##       errors are traped by |error-handler|.              ##       errors are traped by |error-handler|.
658            $self->{doc_cfg}-><M::c|DOMConfiguration.setParameter>            $self->{doc_cfg}-><M::c|DOMConfiguration.setParameter>
                               (<Q::cfg|entity-reference-read-only> => false);  
             ## NOTE: Turn this configuration parameter off is required  
             ##       because entity reference subtree is created by  
             ##       the parser rather than |createEntityReference|'s  
             ##       cloning.  Parser's |cfg:entity-reference-read-only|  
             ##       configuration parameter controls whether generated  
             ##       subtree is then marked as read-only or not.  
           $self->{doc_cfg}-><M::c|DOMConfiguration.setParameter>  
659                                (<Q::cfg|clone-entity-reference-subtree> => true);                                (<Q::cfg|clone-entity-reference-subtree> => true);
660              ## NOTE: Turn this configuration parameter on makes              ## NOTE: Turn this configuration parameter on makes
661              ##       entity reference subtrees in attribute default values              ##       entity reference subtrees in attribute default values
662              ##       cloned as is into default attribute node subtrees.              ##       cloned as is into default attribute node subtrees.
663            $self->{doc_cfg}-><M::c|DOMConfiguration.setParameter>            $self->{doc_cfg}-><M::c|DOMConfiguration.setParameter>
664                                (<Q::cfg|dtd-default-attributes> => false);                                (<Q::cfg|dtd-default-attribute> => false);
665              ## NOTE: Don't create DTD default attributes by              ## NOTE: Don't create DTD default attributes by
666              ##       |createElementNS| method.              ##       |createElementNS| method.
667            $self->{doc_cfg}-><M::c|DOMConfiguration.setParameter>            $self->{doc_cfg}-><M::c|DOMConfiguration.setParameter>
# Line 652  ClsDef: Line 683  ClsDef:
683            $r-><AS::Document.manakaiEntityBaseURI>            $r-><AS::Document.manakaiEntityBaseURI>
684                  ($self->{entity}->[0]->{base_uri});                  ($self->{entity}->[0]->{base_uri});
685    
686              ## Encoding name
687              $r-><AS::Document.inputEncoding> ($self->{entity}->[0]->{in_enc});
688    
689            ## Document entity -> |Document| node            ## Document entity -> |Document| node
690            $self->_parse_DocumentEntity;            $self->_parse_DocumentEntity;
691    
# Line 661  ClsDef: Line 695  ClsDef:
695            }            }
696    
697            ## Replacement tree for general |Entity| nodes            ## Replacement tree for general |Entity| nodes
698            my @ent = values %{$self->{general_entity}};            if ($self->{parser_cfg}-><M::c|DOMConfiguration.getParameter>
699            for my $ent (@ent) {                                       (<Q::cfg|entity-replacement-tree>)) {
700              if (exists $ent->{has_replacement_text}) {              my @ent = values %{$self->{general_entity}};
701                for my $ent (@ent) {
702                  if (exists $ent->{has_replacement_text}) {
703                  my $ent_name = $ent->{name};                  my $ent_name = $ent->{name};
704                  $self->{entity} = [<Code::getCopyOfEntityState::                  $self->{entity} = [<Code::getCopyOfEntityState::
705                                                $entity_type = 'general_entity',                                                $entity_type = 'general_entity',
# Line 673  ClsDef: Line 709  ClsDef:
709                  $self->{char} = [];                  $self->{char} = [];
710                  local $ent->{is_opened} = true;                  local $ent->{is_opened} = true;
711                  ## TODO: External entity support                  ## TODO: External entity support
712                    $ent->{node}-><M::Node.manakaiSetReadOnly> (false, true);
713                  $self->_parse_InternalGeneralParsedEntity ($ent->{node});                  $self->_parse_InternalGeneralParsedEntity ($ent->{node});
714                  $ent->{node}-><AS::x|Entity.hasReplacementTree> (true);                  $ent->{node}-><AS::GE.hasReplacementTree> (true);
715                    $ent->{node}-><M::Node.manakaiSetReadOnly> (true, true);
716                  $self->{entity}->[-1]->{close_file}->();                  $self->{entity}->[-1]->{close_file}->();
717                ## ISSUE: Should errors detected by this phase result                  ## ISSUE: Should errors detected by this phase result
718                ##        in |DOMLS:PARSE_ERR| exception thrown?                  ##        in |DOMLS:PARSE_ERR| exception thrown?
719                  }
720              }              }
721                ## TODO: Read-only if configuration (for all entities)            } # cfg|entity-replacement-tree
           }  
722    
723            ## Turns flags to their default value            ## Turns flags to their default value
724            $self->{doc_cfg}-><M::c|DOMConfiguration.setParameter>            $self->{doc_cfg}-><M::c|DOMConfiguration.setParameter>
                               (<Q::cfg|entity-reference-read-only> => null);  
           $self->{doc_cfg}-><M::c|DOMConfiguration.setParameter>  
725                                (<Q::cfg|clone-entity-reference-subtree> => null);                                (<Q::cfg|clone-entity-reference-subtree> => null);
726            $self->{doc_cfg}-><M::c|DOMConfiguration.setParameter>            $self->{doc_cfg}-><M::c|DOMConfiguration.setParameter>
727                                (<Q::cfg|dtd-default-attributes> => null);                                (<Q::cfg|dtd-default-attribute> => null);
728            $self->{doc_cfg}-><M::c|DOMConfiguration.setParameter>            $self->{doc_cfg}-><M::c|DOMConfiguration.setParameter>
729                                (<Q::cfg|xml-id> => null);                                (<Q::cfg|xml-id> => null);
730            $self->{doc_cfg}-><M::c|DOMConfiguration.setParameter>            $self->{doc_cfg}-><M::c|DOMConfiguration.setParameter>
# Line 714  ClsDef: Line 750  ClsDef:
750            GETCHAR: {            GETCHAR: {
751              no warnings 'closed'; # getc() on closed filehandle warning              no warnings 'closed'; # getc() on closed filehandle warning
752              my $ent = $self->{entity}->[-1];              my $ent = $self->{entity}->[-1];
753              my $char = getc $ent->{fh};              my $char = $ent->{fh}->getc;
754    
755              if (defined $char and length $char) {              if (defined $char and length $char) {
756                $ent->{pos}++;                $ent->{pos}++;
# Line 723  ClsDef: Line 759  ClsDef:
759                  $ent->{line}++;                  $ent->{line}++;
760                  $ent->{column} = 1;                  $ent->{column} = 1;
761                } elsif ($r == 0x000D) {                } elsif ($r == 0x000D) {
762                  my $next_char = getc $ent->{fh};                  my $next_char = $ent->{fh}->getc;
763                  if ($next_char eq "\x0A") {                  if ($next_char eq "\x0A") {
764                    if ($ent->{is_external_entity}) {                    if ($ent->{is_external_entity}) {
765                      $ent->{pos}++;                      $ent->{pos}++;
# Line 1421  ClsDef: Line 1457  ClsDef:
1457                        
1458            $pi = $doc-><M::Document.createProcessingInstruction>            $pi = $doc-><M::Document.createProcessingInstruction>
1459                          ($name);                          ($name);
1460            $pi-><AS::x|ProcessingInstruction.manakaiBaseURI>            $pi-><AS::tx|ProcessingInstruction.manakaiBaseURI>
1461                   ($self->{location}->{base_uri});                   ($self->{location}->{base_uri});
1462          }                }      
1463        } else {        } else {
# Line 1495  ClsDef: Line 1531  ClsDef:
1531        (CharData) {        (CharData) {
1532          // Character data          // Character data
1533          lang:Perl ($data => $token.value) {          lang:Perl ($data => $token.value) {
1534            $node-><M::Node.appendChild>            $node-><M::Node.manakaiAppendText> (\($data));
             ($doc-><M::Document.createTextNode> ($data));  
1535          }          }
1536        } (STAGO) {        } (STAGO) {
1537          // Start tag or empty element tag          // Start tag or empty element tag
# Line 1774  ClsDef: Line 1809  ClsDef:
1809                my $attr = $doc-><M::Document.createAttributeNS>                my $attr = $doc-><M::Document.createAttributeNS>
1810                                   (<Q::xmlns:>, 'xmlns');                                   (<Q::xmlns:>, 'xmlns');
1811                for (@{$attrs->{xmlns}->{nodes}}) {                for (@{$attrs->{xmlns}->{nodes}}) {
1812                  $attr-><M::Node.appendChild> ($_);                  if ($_-><AG::Node.nodeType> == <C::Node.TEXT_NODE>) {
1813                      $attr-><M::Node.manakaiAppendText>
1814                               (\($_-><AG::Node.textContent>));
1815                    } else {
1816                      $attr-><M::Node.appendChild> ($_);
1817                    }
1818                }                }
1819                if ($attrs->{xmlns}->{def}) {                if ($attrs->{xmlns}->{def}) {
1820                  __CODE{t|setAttrType::                  $attr-><AS::Attr.manakaiAttributeType>
1821                    $attr => $attr,                           ($attrs->{xmlns}->{def}-><AG::ATDef.declaredType>);
                   $type => {$attrs->{xmlns}->{def}-><AG::ATDef.declaredType>},  
                 }__;  
1822                }                }
1823                $el-><M::Element.setAttributeNodeNS> ($attr);                $el-><M::Element.setAttributeNodeNS> ($attr);
1824                $attr-><AS::t|Attr.specified> (false)                $attr-><AS::Attr.specified> (false)
1825                  if $attrs->{xmlns}->{is_default};                  if $attrs->{xmlns}->{is_default};
1826              }              }
1827                            
# Line 1791  ClsDef: Line 1829  ClsDef:
1829                my $attr = $doc-><M::Document.createAttributeNS>                my $attr = $doc-><M::Document.createAttributeNS>
1830                                   (null, $lname);                                   (null, $lname);
1831                for (@{$lattr{$lname}->{nodes}}) {                for (@{$lattr{$lname}->{nodes}}) {
1832                  $attr-><M::Node.appendChild> ($_);                  if ($_-><AG::Node.nodeType> == <C::Node.TEXT_NODE>) {
1833                      $attr-><M::Node.manakaiAppendText>
1834                               (\($_-><AG::Node.textContent>));
1835                    } else {
1836                      $attr-><M::Node.appendChild> ($_);
1837                    }
1838                }                }
1839                if ($attrs->{$lname}->{def}) {                if ($attrs->{$lname}->{def}) {
1840                  __CODE{t|setAttrType::                  $attr-><AS::Attr.manakaiAttributeType>
1841                    $attr => $attr,                           ($attrs->{$lname}->{def}-><AG::ATDef.declaredType>);
                   $type => {$attrs->{$lname}->{def}-><AG::ATDef.declaredType>},  
                 }__;  
1842                }                }
1843                $el-><M::Element.setAttributeNodeNS> ($attr);                $el-><M::Element.setAttributeNodeNS> ($attr);
1844                $attr-><AS::t|Attr.specified> (false)                $attr-><AS::Attr.specified> (false)
1845                  if $attrs->{$lname}->{is_default};                  if $attrs->{$lname}->{is_default};
1846              }              }
1847                            
# Line 1845  ClsDef: Line 1886  ClsDef:
1886                      unless ($continue) {                      unless ($continue) {
1887                        __CODE{ParseError}__;                        __CODE{ParseError}__;
1888                      }                      }
1889                      unless ($attr-><AG::t|Attr.specified>) {                      unless ($attr-><AG::Attr.specified>) {
1890                        ## It is a default attribute                        ## It is a default attribute
1891                        $attr = $doc-><M::Document.createAttributeNS>                        $attr = $doc-><M::Document.createAttributeNS>
1892                                        ($ns->{$pfx}, $name);                                        ($ns->{$pfx}, $name);
# Line 1862  ClsDef: Line 1903  ClsDef:
1903                                     ($ns->{$pfx}, $name);                                     ($ns->{$pfx}, $name);
1904                  }                  }
1905                  for (@{$gattr{$pfx}->{$lname}->{nodes}}) {                  for (@{$gattr{$pfx}->{$lname}->{nodes}}) {
1906                    $attr-><M::Node.appendChild> ($_);                    if ($_-><AG::Node.nodeType> == <C::Node.TEXT_NODE>) {
1907                        $attr-><M::Node.manakaiAppendText>
1908                                 (\($_-><AG::Node.textContent>));
1909                      } else {
1910                        $attr-><M::Node.appendChild> ($_);
1911                      }
1912                  }                  }
1913                  if ($gattr{$pfx}->{$lname}->{def}) {                  if ($gattr{$pfx}->{$lname}->{def}) {
1914                    __CODE{t|setAttrType::                    $attr-><AS::Attr.manakaiAttributeType>
1915                      $attr => $attr,                             ($gattr{$pfx}->{$lname}->{def}
1916                      $type => {$gattr{$pfx}->{$lname}                                          -><AG::ATDef.declaredType>);
                                     ->{def}-><AG::ATDef.declaredType>},  
                   }__;  
1917                  }                  }
1918                  $el-><M::Element.setAttributeNodeNS> ($attr);                  $el-><M::Element.setAttributeNodeNS> ($attr);
1919                  $attr-><AS::t|Attr.specified> (false)                  $attr-><AS::Attr.specified> (false)
1920                    if $gattr{$pfx}->{$lname}->{is_default};                    if $gattr{$pfx}->{$lname}->{is_default};
1921                } # PFX                } # PFX
1922              }              }
# Line 2044  ClsDef: Line 2088  ClsDef:
2088    
2089        ~* (CharData) {        ~* (CharData) {
2090          lang:Perl ($data => $token.value) {          lang:Perl ($data => $token.value) {
2091            $parent-><M::Node.appendChild>            $parent-><M::Node.manakaiAppendText> (\($data));
             ($self->{doc}-><M::Document.createTextNode> ($data));  
2092          }          }
2093        } (STAGO) {        } (STAGO) {
2094            &Element_ ($doc => $doc, $parent => $parent, $ns => $ns)            &Element_ ($doc => $doc, $parent => $parent, $ns => $ns)
# Line 2056  ClsDef: Line 2099  ClsDef:
2099              ?lexmode ElementContent;              ?lexmode ElementContent;
2100            }            }
2101          } (HCRO) {          } (HCRO) {
2102            &_HexadecimalCharacterReference_            &_HexadecimalCharacterReference_ ($parent => $parent);
             ($doc => $doc, $parent => $parent);  
2103    
2104            ~ (REFC) {            ~ (REFC) {
2105              ?lexmode 'ElementContent';              ?lexmode 'ElementContent';
# Line 2065  ClsDef: Line 2107  ClsDef:
2107              ?lexmode ElementContent;              ?lexmode ElementContent;
2108            }            }
2109          } (CRO) {          } (CRO) {
2110            &_NumericCharacterReference_            &_NumericCharacterReference_ ($parent => $parent);
             ($doc => $doc, $parent => $parent);  
2111    
2112            ~ (REFC) {            ~ (REFC) {
2113              ?lexmode 'ElementContent';              ?lexmode 'ElementContent';
# Line 2271  ClsDef: Line 2312  ClsDef:
2312        ~* (STRING) {        ~* (STRING) {
2313          lang:Perl ($value => $token.value) {          lang:Perl ($value => $token.value) {
2314            $value =~ s/[\x09\x0A\x0D]/ /g;            $value =~ s/[\x09\x0A\x0D]/ /g;
2315            my $text = $self->{doc}-><M::Document.createTextNode> ($value);            $parent-><M::Node.manakaiAppendText> (\($value));
           $parent-><M::Node.appendChild> ($text);  
2316            $vals->{value} .= $value;            $vals->{value} .= $value;
2317          }          }
2318        } (HCRO) {        } (HCRO) {
# Line 2316  ClsDef: Line 2356  ClsDef:
2356              __CODE{ParseError}__;              __CODE{ParseError}__;
2357            }            }
2358    
2359            my $text = $self->{doc}-><M::Document.createTextNode> ('<');            $parent-><M::Node.manakaiAppendText> ('<');
           $parent-><M::Node.appendChild> ($text);  
2360            $vals->{value} .= '<';            $vals->{value} .= '<';
2361          }          }
2362        }        }
# Line 2352  ClsDef: Line 2391  ClsDef:
2391        // ~ (MSE) { }        // ~ (MSE) { }
2392      } // _CDATASection_      } // _CDATASection_
2393            
2394      rule _NumericCharacterReference_ ($doc, $parent) {      rule _NumericCharacterReference_ ($parent) {
2395        ?lexmode 'NumericCharacterReference';        ?lexmode 'NumericCharacterReference';
2396                
2397        ~ (NUMBER) {        ~ (NUMBER) {
# Line 2384  ClsDef: Line 2423  ClsDef:
2423                __CODE{ParseError}__;                __CODE{ParseError}__;
2424              }              }
2425            }            }
2426            my $ncr = $doc-><M::Document.createTextNode> (chr $num);            $parent-><M::Node.manakaiAppendText> (chr $num);
           $parent-><M::Node.appendChild> ($ncr);  
2427          }          }
2428        }        }
2429                
# Line 2469  ClsDef: Line 2507  ClsDef:
2507                __CODE{ParseError}__;                __CODE{ParseError}__;
2508              }              }
2509            }            }
2510            my $ncr = $self->{doc}-><M::Document.createTextNode>            my $char = chr $num;
2511                              (my $char = chr $num);            $parent-><M::Node.manakaiAppendText> (\$char);
           $parent-><M::Node.appendChild> ($ncr);  
2512            $vals->{value} .= $char;            $vals->{value} .= $char;
2513          }          }
2514        }        }
# Line 2518  ClsDef: Line 2555  ClsDef:
2555        // ~ (REFC) { }        // ~ (REFC) { }
2556      } // _NumericCharacterReferenceEV_      } // _NumericCharacterReferenceEV_
2557            
2558      rule _HexadecimalCharacterReference_ ($doc, $parent) {      rule _HexadecimalCharacterReference_ ($parent) {
2559        ?lexmode 'HexadecimalCharacterReference';        ?lexmode 'HexadecimalCharacterReference';
2560                
2561        ~ (Hex) {        ~ (Hex) {
# Line 2550  ClsDef: Line 2587  ClsDef:
2587                __CODE{ParseError}__;                __CODE{ParseError}__;
2588              }              }
2589            }            }
2590            my $ncr = $doc-><M::Document.createTextNode>            $parent-><M::Node.manakaiAppendText> (chr $num);
                       (chr $num);  
           $parent-><M::Node.appendChild> ($ncr);  
2591          }          }
2592        }        }
2593                
# Line 2636  ClsDef: Line 2671  ClsDef:
2671                __CODE{ParseError}__;                __CODE{ParseError}__;
2672              }              }
2673            }            }
2674            my $ncr = $self->{doc}-><M::Document.createTextNode>            my $char = chr $num;
2675                        (my $char = chr $num);            $parent-><M::Node.manakaiAppendText> (\$char);
           $parent-><M::Node.appendChild> ($ncr);  
2676            $vals->{value} .= $char;            $vals->{value} .= $char;
2677          }          }
2678        }        }
# Line 2694  ClsDef: Line 2728  ClsDef:
2728                
2729        ~ (Name == 'lt') {        ~ (Name == 'lt') {
2730          lang:Perl {          lang:Perl {
2731            $parent-><M::Node.appendChild>            $parent-><M::Node.manakaiAppendText> ('<');
                      ($self->{doc}-><M::Document.createTextNode> ('<'));  
2732          }          }
2733        } (Name == 'gt') {        } (Name == 'gt') {
2734          lang:Perl {          lang:Perl {
2735            $parent-><M::Node.appendChild>            $parent-><M::Node.manakaiAppendText> ('>');
                      ($self->{doc}-><M::Document.createTextNode> ('>'));  
2736          }          }
2737        } (Name == 'amp') {        } (Name == 'amp') {
2738          lang:Perl {          lang:Perl {
2739            $parent-><M::Node.appendChild>            $parent-><M::Node.manakaiAppendText> ('&');
                      ($self->{doc}-><M::Document.createTextNode> ('&'));  
2740          }          }
2741        } (Name == 'quot') {        } (Name == 'quot') {
2742          lang:Perl {          lang:Perl {
2743            $parent-><M::Node.appendChild>            $parent-><M::Node.manakaiAppendText> ('"');
                      ($self->{doc}-><M::Document.createTextNode> ('"'));  
2744          }          }
2745        } (Name == 'apos') {        } (Name == 'apos') {
2746          lang:Perl {          lang:Perl {
2747            $parent-><M::Node.appendChild>            $parent-><M::Node.manakaiAppendText> ("'");
                      ($self->{doc}-><M::Document.createTextNode> ("'"));  
2748          }          }
2749        } (Name) {        } (Name) {
2750          my $er;          my $er;
# Line 2724  ClsDef: Line 2753  ClsDef:
2753                        
2754            $er = $doc-><M::Document.createEntityReference>            $er = $doc-><M::Document.createEntityReference>
2755                             ($name);                             ($name);
2756              $er-><M::Node.manakaiSetReadOnly> (false, true);
2757            $er-><AS::Node.textContent> ('');            $er-><AS::Node.textContent> ('');
2758              ## NOTE: When document entity (and entities referenced directly              ## NOTE: When document entity (and entities referenced directly
2759              ##       or indirectly from it) is parsed, no general entity              ##       or indirectly from it) is parsed, no general entity
# Line 2751  ClsDef: Line 2781  ClsDef:
2781              }                 # Otherwise VC error              }                 # Otherwise VC error
2782              push @{$self->{entity}}, <Code::getEmptyEntityState::              push @{$self->{entity}}, <Code::getEmptyEntityState::
2783                                                $name = $name>;                                                $name = $name>;
2784              $er-><AS::x|EntityReference.isExpanded> (false);              $er-><AS::GERef.manakaiExpanded> (false);
2785    
2786            } else {         # there IS entity declaration            } else {         # there IS entity declaration
2787              if (($self->{standalone} or not $self->{has_xref}) and              if (($self->{standalone} or not $self->{has_xref}) and
# Line 2771  ClsDef: Line 2801  ClsDef:
2801                  __CODE{ParseError}__;                  __CODE{ParseError}__;
2802                }                }
2803              }                        }          
2804              $er-><AS::x|EntityReference.isExpanded>              $er-><AS::GERef.manakaiExpanded>
2805                     ($ent->{has_replacement_text});                     ($ent->{has_replacement_text});
2806              push @{$self->{entity}}, <Code::getCopyOfEntityState::              push @{$self->{entity}}, <Code::getCopyOfEntityState::
2807                                              $entity_type = 'general_entity',                                              $entity_type = 'general_entity',
# Line 2809  ClsDef: Line 2839  ClsDef:
2839                }                }
2840                open my $empty, '<', \'';                open my $empty, '<', \'';
2841                $self->{entity}->[-1]->{fh} = $empty;                $self->{entity}->[-1]->{fh} = $empty;
2842                $er-><AS::x|EntityReference.isExpanded> (false);                $er-><AS::GERef.manakaiExpanded> (false);
2843              } # recursive              } # recursive
2844              $ent->{is_opened} = true;              $ent->{is_opened} = true;
2845            } # entity declared            } # entity declared
# Line 2831  ClsDef: Line 2861  ClsDef:
2861            $self->{char} = pop @{$self->{entity_char}};            $self->{char} = pop @{$self->{entity_char}};
2862            pop (@{$self->{entity}})->{close_file}->();            pop (@{$self->{entity}})->{close_file}->();
2863            $self->{location} = $self->{entity}->[-1];            $self->{location} = $self->{entity}->[-1];
         }  
2864    
2865          // TODO: Set read-only flag            $er-><M::Node.manakaiSetReadOnly> (true, true);
2866            }
2867    
2868          ?lexmode EntityReference;          ?lexmode EntityReference;
2869          ?requires-next-token;          ?requires-next-token;
# Line 2888  ClsDef: Line 2918  ClsDef:
2918            __CODE{checkNCName:: $name => $name}__;            __CODE{checkNCName:: $name => $name}__;
2919                        
2920            $er = $self->{doc}-><M::Document.createEntityReference> ($name);            $er = $self->{doc}-><M::Document.createEntityReference> ($name);
2921              $er-><M::Node.manakaiSetReadOnly> (false, true);
2922            $er-><AS::Node.textContent> ('');            $er-><AS::Node.textContent> ('');
2923              ## NOTE: When document entity (and entities referenced directly              ## NOTE: When document entity (and entities referenced directly
2924              ##       or indirectly from it) is parsed, no general entity              ##       or indirectly from it) is parsed, no general entity
# Line 2913  ClsDef: Line 2944  ClsDef:
2944              }                 # Otherwise VC error              }                 # Otherwise VC error
2945              push @{$self->{entity}}, <Code::getEmptyEntityState::              push @{$self->{entity}}, <Code::getEmptyEntityState::
2946                                                $name = $name>;                                                $name = $name>;
2947              $er-><AS::x|EntityReference.isExpanded> (false);              $er-><AS::GERef.manakaiExpanded> (false);
2948    
2949            } else {         # there IS entity declaration            } else {         # there IS entity declaration
2950              if (($self->{standalone} or not $self->{has_xref}) and              if (($self->{standalone} or not $self->{has_xref}) and
# Line 2951  ClsDef: Line 2982  ClsDef:
2982                ## NOTE: |xp:wf-parsed-entity| is not checked                ## NOTE: |xp:wf-parsed-entity| is not checked
2983              } # if external entity              } # if external entity
2984    
2985              $er-><AS::x|EntityReference.isExpanded>              $er-><AS::GERef.manakaiExpanded>
2986                     ($ent->{has_replacement_text});                     ($ent->{has_replacement_text});
2987              push @{$self->{entity}}, <Code::getCopyOfEntityState::              push @{$self->{entity}}, <Code::getCopyOfEntityState::
2988                                              $entity_type = 'general_entity',                                              $entity_type = 'general_entity',
# Line 2973  ClsDef: Line 3004  ClsDef:
3004                }                }
3005                open my $empty, '<', \'';                open my $empty, '<', \'';
3006                $self->{entity}->[-1]->{fh} = $empty;                $self->{entity}->[-1]->{fh} = $empty;
3007                $er-><AS::x|EntityReference.isExpanded> (false);                $er-><AS::GERef.manakaiExpanded> (false);
3008              } # recursive              } # recursive
3009              $ent->{is_opened} = true;              $ent->{is_opened} = true;
3010            }            }
# Line 2996  ClsDef: Line 3027  ClsDef:
3027            $self->{char} = pop @{$self->{entity_char}};            $self->{char} = pop @{$self->{entity_char}};
3028            pop (@{$self->{entity}})->{close_file}->();            pop (@{$self->{entity}})->{close_file}->();
3029            $self->{location} = $self->{entity}->[-1];            $self->{location} = $self->{entity}->[-1];
         }  
3030    
3031          // TODO: Set read-only flag            $er-><M::Node.manakaiSetReadOnly> (true, true);
3032            }
3033    
3034          ?lexmode EntityReference;          ?lexmode EntityReference;
3035          ?requires-next-token;          ?requires-next-token;
# Line 3017  ClsDef: Line 3048  ClsDef:
3048                
3049        ~ (Name == 'lt') {        ~ (Name == 'lt') {
3050          lang:Perl {          lang:Perl {
3051            $parent-><M::Node.appendChild>            $parent-><M::Node.manakaiAppendText> ('<');
                      ($self->{doc}-><M::Document.createTextNode> ('<'));  
3052            $vals->{value} .= '<';            $vals->{value} .= '<';
3053          }          }
3054        } (Name == 'gt') {        } (Name == 'gt') {
3055          lang:Perl {          lang:Perl {
3056            $parent-><M::Node.appendChild>            $parent-><M::Node.manakaiAppendText> ('>');
                      ($self->{doc}-><M::Document.createTextNode> ('>'));  
3057            $vals->{value} .= '>';            $vals->{value} .= '>';
3058          }          }
3059        } (Name == 'amp') {        } (Name == 'amp') {
3060          lang:Perl {          lang:Perl {
3061            $parent-><M::Node.appendChild>            $parent-><M::Node.manakaiAppendText> ('&');
                      ($self->{doc}-><M::Document.createTextNode> ('&'));  
3062            $vals->{value} .= '&';            $vals->{value} .= '&';
3063          }          }
3064        } (Name == 'quot') {        } (Name == 'quot') {
3065          lang:Perl {          lang:Perl {
3066            $parent-><M::Node.appendChild>            $parent-><M::Node.manakaiAppendText> ('"');
                      ($self->{doc}-><M::Document.createTextNode> ('"'));  
3067            $vals->{value} .= '"';            $vals->{value} .= '"';
3068          }          }
3069        } (Name == 'apos') {        } (Name == 'apos') {
3070          lang:Perl {          lang:Perl {
3071            $parent-><M::Node.appendChild>            $parent-><M::Node.manakaiAppendText> ("'");
                      ($self->{doc}-><M::Document.createTextNode> ("'"));  
3072            $vals->{value} .= "'";            $vals->{value} .= "'";
3073          }          }
3074        } (Name) {        } (Name) {
# Line 3051  ClsDef: Line 3077  ClsDef:
3077            __CODE{checkNCName:: $name => $name}__;            __CODE{checkNCName:: $name => $name}__;
3078    
3079            $er = $self->{doc}-><M::Document.createEntityReference> ($name);            $er = $self->{doc}-><M::Document.createEntityReference> ($name);
3080              $er-><M::Node.manakaiSetReadOnly> (false, true);
3081            $er-><AS::Node.textContent> ('');            $er-><AS::Node.textContent> ('');
3082              ## NOTE: When document entity (and entities referenced directly              ## NOTE: When document entity (and entities referenced directly
3083              ##       or indirectly from it) is parsed, no general entity              ##       or indirectly from it) is parsed, no general entity
# Line 3076  ClsDef: Line 3103  ClsDef:
3103              }                 # Otherwise VC error              }                 # Otherwise VC error
3104              push @{$self->{entity}}, <Code::getEmptyEntityState::              push @{$self->{entity}}, <Code::getEmptyEntityState::
3105                                                $name = $name>;                                                $name = $name>;
3106              $er-><AS::x|EntityReference.isExpanded> (false);              $er-><AS::GERef.manakaiExpanded> (false);
3107    
3108            } else {         # there IS entity declaration            } else {         # there IS entity declaration
3109              if (($self->{standalone} or not $self->{has_xref}) and              if (($self->{standalone} or not $self->{has_xref}) and
# Line 3114  ClsDef: Line 3141  ClsDef:
3141                ## NOTE: |xp:wf-parsed-entity| is not checked                ## NOTE: |xp:wf-parsed-entity| is not checked
3142              } # if external entity              } # if external entity
3143    
3144              $er-><AS::x|EntityReference.isExpanded>              $er-><AS::GERef.manakaiExpanded>
3145                     ($ent->{has_replacement_text});                     ($ent->{has_replacement_text});
3146              push @{$self->{entity}}, <Code::getCopyOfEntityState::              push @{$self->{entity}}, <Code::getCopyOfEntityState::
3147                                              $entity_type = 'general_entity',                                              $entity_type = 'general_entity',
# Line 3136  ClsDef: Line 3163  ClsDef:
3163                }                }
3164                open my $empty, '<', \'';                open my $empty, '<', \'';
3165                $self->{entity}->[-1]->{fh} = $empty;                $self->{entity}->[-1]->{fh} = $empty;
3166                $er-><AS::x|EntityReference.isExpanded> (false);                $er-><AS::GERef.manakaiExpanded> (false);
3167              } # recursive              } # recursive
3168              $ent->{is_opened} = true;              $ent->{is_opened} = true;
3169            }            }
# Line 3159  ClsDef: Line 3186  ClsDef:
3186            $self->{char} = pop @{$self->{entity_char}};            $self->{char} = pop @{$self->{entity_char}};
3187            pop (@{$self->{entity}})->{close_file}->();            pop (@{$self->{entity}})->{close_file}->();
3188            $self->{location} = $self->{entity}->[-1];            $self->{location} = $self->{entity}->[-1];
         }  
3189    
3190          // TODO: Set read-only flag            $er-><M::Node.manakaiSetReadOnly> (true, true);
3191            }
3192    
3193          ?lexmode EntityReference;          ?lexmode EntityReference;
3194          ?requires-next-token;          ?requires-next-token;
# Line 3280  ClsDef: Line 3307  ClsDef:
3307        // TODO: Read and process external subset if any.        // TODO: Read and process external subset if any.
3308        lang:Perl {        lang:Perl {
3309          $self->{dont_process} = true if $has_extid;          $self->{dont_process} = true if $has_extid;
3310            $node-><M::Node.manakaiSetReadOnly> (true, true);
3311        }        }
3312    
3313        // ~ (MDC) { }        // ~ (MDC) { }
# Line 3375  ClsDef: Line 3403  ClsDef:
3403    
3404        ~? (STRING) {        ~? (STRING) {
3405          lang:Perl ($v => $token.value) {          lang:Perl ($v => $token.value) {
3406            $decl-><AS::x|Entity.systemId> ($v);            $decl-><AS::GE.systemId> ($v);
3407            $decl-><AS::x|Entity.manakaiDeclarationBaseURI>            $decl-><AS::GE.manakaiDeclarationBaseURI>
3408                     ($self->{location}->{base_uri});                     ($self->{location}->{base_uri});
3409          }          }
3410        }        }
# Line 3965  ClsDef: Line 3993  ClsDef:
3993              lang:Perl ($v => $token.value) : has-error {              lang:Perl ($v => $token.value) : has-error {
3994                __CODE{checkNCName:: $name => $v}__;                __CODE{checkNCName:: $name => $v}__;
3995                $decl->{notation} = $v;                $decl->{notation} = $v;
3996                $decl->{node}-><AG::x|Entity.notationName> ($v);                $decl->{node}-><AG::GE.notationName> ($v);
3997              }              }
3998            }            }
3999    
# Line 5424  ClsDef: Line 5452  ClsDef:
5452            &#x10;&#x11;&#x12;&#x13;&#x14;&#x15;&#x16;&#x17;$            &#x10;&#x11;&#x12;&#x13;&#x14;&#x15;&#x16;&#x17;$
5453            &#x18;&#x19;&#x1A;&#x1B;&#x1C;&#x1D;&#x1E;&#x1F;">            &#x18;&#x19;&#x1A;&#x1B;&#x1C;&#x1D;&#x1E;&#x1F;">
5454            ]><a/>            ]><a/>
5455          @@@cfg:entity-replacement-tree: 1
5456        @@@test:domTree:        @@@test:domTree:
5457          document {          document {
5458            document-type {            document-type {
# Line 5450  ClsDef: Line 5479  ClsDef:
5479            &#x90;&#x91;&#x92;&#x93;&#x94;&#x95;&#x96;&#x97;$            &#x90;&#x91;&#x92;&#x93;&#x94;&#x95;&#x96;&#x97;$
5480            &#x98;&#x99;&#x9A;&#x9B;&#x9C;&#x9D;&#x9E;&#x9F;&#x7F;">            &#x98;&#x99;&#x9A;&#x9B;&#x9C;&#x9D;&#x9E;&#x9F;&#x7F;">
5481            ]><a/>            ]><a/>
5482          @@@cfg:entity-replacement-tree: 1
5483        @@@test:domTree:        @@@test:domTree:
5484          document {          document {
5485            document-type {            document-type {
# Line 6465  ClsDef: Line 6495  ClsDef:
6495              <!ENTITY cdata "<![CDATA[text]]>">              <!ENTITY cdata "<![CDATA[text]]>">
6496            ]>            ]>
6497            <p>&cdata;</p>            <p>&cdata;</p>
6498          @@@cfg:entity-replacement-tree: 1
6499        @@@test:domTree:        @@@test:domTree:
6500          document {          document {
6501            document-type {            document-type {
# Line 6478  ClsDef: Line 6509  ClsDef:
6509            element {            element {
6510              general-entity-reference {              general-entity-reference {
6511                node-name: 'cdata';                node-name: 'cdata';
6512                is-expanded: true;                manakai-expanded: true;
6513                cdata-section {                cdata-section {
6514                  data: 'text';                  data: 'text';
6515                }                }
# Line 7576  ClsDef: Line 7607  ClsDef:
7607            <!ENTITY e "&#x000D; &#x000A; &#x0085; &#x000D;&#x000A; $            <!ENTITY e "&#x000D; &#x000A; &#x0085; &#x000D;&#x000A; $
7608            &#x000D;&#x0085; &#x2028;">            &#x000D;&#x0085; &#x2028;">
7609            ]><a>&e;</a>            ]><a>&e;</a>
7610          @@@cfg:entity-replacement-tree: 1
7611        @@@test:domTree:        @@@test:domTree:
7612          document {          document {
7613            xml-version: '1.0';            xml-version: '1.0';
# Line 7600  ClsDef: Line 7632  ClsDef:
7632            <!ENTITY e "&#x000D; &#x000A; &#x0085; &#x000D;&#x000A; $            <!ENTITY e "&#x000D; &#x000A; &#x0085; &#x000D;&#x000A; $
7633            &#x000D;&#x0085; &#x2028;">            &#x000D;&#x0085; &#x2028;">
7634            ]><a>&e;</a>            ]><a>&e;</a>
7635          @@@cfg:entity-replacement-tree: 1
7636        @@@test:domTree:        @@@test:domTree:
7637          document {          document {
7638            xml-version: '1.1';            xml-version: '1.1';
# Line 8198  ClsDef: Line 8231  ClsDef:
8231              <!ENTITY ent2 "ddd&ent;">              <!ENTITY ent2 "ddd&ent;">
8232            ]>            ]>
8233            <a b="c&ent2;"/>            <a b="c&ent2;"/>
8234          @@@cfg:entity-replacement-tree: 1
8235        @@@c:erred: <[[xp|wf-no-external-entity-references]]> { (1, 4)..(1, 8); }        @@@c:erred: <[[xp|wf-no-external-entity-references]]> { (1, 4)..(1, 8); }
8236        @@@c:erred: <[[xp|wf-parsed-entity]]> { }        @@@c:erred: <[[xp|wf-parsed-entity]]> { }
8237      @@XMLTest:      @@XMLTest:
# Line 8208  ClsDef: Line 8242  ClsDef:
8242            <!ENTITY ent "aa<bb">            <!ENTITY ent "aa<bb">
8243            ]>            ]>
8244            <a b="c&ent;"/>            <a b="c&ent;"/>
8245          @@@cfg:entity-replacement-tree: 1
8246        @@@c:erred: <[[xp|wf-no-lt-in-attribute-values]]> { (1, 3); }        @@@c:erred: <[[xp|wf-no-lt-in-attribute-values]]> { (1, 3); }
8247        @@@c:erred:        @@@c:erred:
8248          @@@@@: <[[xp|wf-syntax-error]]> { (1, 3)..(1, 6); }          @@@@@: <[[xp|wf-syntax-error]]> { (1, 3)..(1, 6); }
8249          @@@@enImplNote: When entity node is created.          @@@@enImplNote: When entity node is created.
8250      @@XMLTest:      @@XMLTest:
8251          @@@QName: xp.no.lt.in.attr.value.1.2.test
8252          @@@DEnt:
8253            @@@@test:value:
8254              <!DOCTYPE a [
8255              <!ENTITY ent "aa<bb">
8256              ]>
8257              <a b="c&ent;"/>
8258          @@@cfg:entity-replacement-tree: 0
8259          @@@c:erred: <[[xp|wf-no-lt-in-attribute-values]]> { (1, 3); }
8260        @@XMLTest:
8261        @@@QName: xp.no.lt.in.attr.value.2.test        @@@QName: xp.no.lt.in.attr.value.2.test
8262        @@@DEnt:        @@@DEnt:
8263          @@@@test:value:          @@@@test:value:
# Line 8221  ClsDef: Line 8266  ClsDef:
8266            <!ENTITY ent2 "ccc&ent;">            <!ENTITY ent2 "ccc&ent;">
8267            ]>            ]>
8268            <a b="c&ent2;"/>            <a b="c&ent2;"/>
8269          @@@cfg:entity-replacement-tree: 1
8270        @@@c:erred: <[[xp|wf-no-lt-in-attribute-values]]> { (1, 3); }        @@@c:erred: <[[xp|wf-no-lt-in-attribute-values]]> { (1, 3); }
8271        @@@c:erred:        @@@c:erred:
8272          @@@@@: <[[xp|wf-syntax-error]]> { (1, 3)..(1, 6); }          @@@@@: <[[xp|wf-syntax-error]]> { (1, 3)..(1, 6); }
# Line 8233  ClsDef: Line 8279  ClsDef:
8279            <!ENTITY ent "aa&#x3C;bb">            <!ENTITY ent "aa&#x3C;bb">
8280            ]>            ]>
8281            <a b="c&ent;"/>            <a b="c&ent;"/>
8282          @@@cfg:entity-replacement-tree: 1
8283        @@@c:erred: <[[xp|wf-no-lt-in-attribute-values]]> { (1, 3); }        @@@c:erred: <[[xp|wf-no-lt-in-attribute-values]]> { (1, 3); }
8284        @@@c:erred:        @@@c:erred:
8285          @@@@@: <[[xp|wf-syntax-error]]> { (1, 3)..(1, 6); }          @@@@@: <[[xp|wf-syntax-error]]> { (1, 3)..(1, 6); }
# Line 8246  ClsDef: Line 8293  ClsDef:
8293            <!ENTITY ent2 "ccc&ent;">            <!ENTITY ent2 "ccc&ent;">
8294            ]>            ]>
8295            <a b="c&ent2;"/>            <a b="c&ent2;"/>
8296          @@@cfg:entity-replacement-tree: 1
8297        @@@c:erred: <[[xp|wf-no-lt-in-attribute-values]]> { (1, 3); }        @@@c:erred: <[[xp|wf-no-lt-in-attribute-values]]> { (1, 3); }
8298        @@@c:erred:        @@@c:erred:
8299          @@@@@: <[[xp|wf-syntax-error]]> { (1, 3)..(1, 6); }          @@@@@: <[[xp|wf-syntax-error]]> { (1, 3)..(1, 6); }
# Line 8258  ClsDef: Line 8306  ClsDef:
8306            <!ENTITY ent "aa&lt;bb">            <!ENTITY ent "aa&lt;bb">
8307            ]>            ]>
8308            <a b="c&ent;"/>            <a b="c&ent;"/>
8309          @@@cfg:entity-replacement-tree: 1
8310        @@@test:domTree:        @@@test:domTree:
8311          document {          document {
8312            document-type {            document-type {
# Line 8271  ClsDef: Line 8320  ClsDef:
8320                node-name: 'b';                node-name: 'b';
8321                text { data: 'c'; }                text { data: 'c'; }
8322                general-entity-reference {                general-entity-reference {
8323                  is-expanded: true;                  manakai-expanded: true;
8324                  node-name: 'ent';                  node-name: 'ent';
8325                  text-content: 'aa<bb';                  text-content: 'aa<bb';
8326                }                }
# Line 8287  ClsDef: Line 8336  ClsDef:
8336            <!ENTITY ent2 "ccc&ent;">            <!ENTITY ent2 "ccc&ent;">
8337            ]>            ]>
8338            <a b="c&ent2;"/>            <a b="c&ent2;"/>
8339          @@@cfg:entity-replacement-tree: 1
8340        @@@test:domTree:        @@@test:domTree:
8341          document {          document {
8342            document-type {            document-type {
# Line 8300  ClsDef: Line 8350  ClsDef:
8350                general-entity-reference {                general-entity-reference {
8351                  node-name: 'ent';                  node-name: 'ent';
8352                  text-content: 'aa<bb';                  text-content: 'aa<bb';
8353                  is-expanded: true;                  manakai-expanded: true;
8354                }                }
8355              }              }
8356            }            }
# Line 8314  ClsDef: Line 8364  ClsDef:
8364                  general-entity-reference {                  general-entity-reference {
8365                    node-name: 'ent';                    node-name: 'ent';
8366                    text-content: 'aa<bb';                    text-content: 'aa<bb';
8367                    is-expanded: true;                    manakai-expanded: true;
8368                  }                  }
8369                  is-expanded: true;                  manakai-expanded: true;
8370                }                }
8371              }              }
8372            }            }
# Line 8361  ClsDef: Line 8411  ClsDef:
8411              <!ENTITY entity "entity value">              <!ENTITY entity "entity value">
8412            ]>            ]>
8413            <a></a>            <a></a>
8414          @@@cfg:entity-replacement-tree: 1
8415        @@@test:domTree:        @@@test:domTree:
8416          document {          document {
8417            xml-version: '1.0';            xml-version: '1.0';
# Line 8413  ClsDef: Line 8464  ClsDef:
8464              <!ENTITY entity "entity value">              <!ENTITY entity "entity value">
8465            ]>            ]>
8466            <a>&entity;</a>            <a>&entity;</a>
8467          @@@cfg:entity-replacement-tree: 1
8468        @@@test:domTree:        @@@test:domTree:
8469          document {          document {
8470            xml-version: '1.0';            xml-version: '1.0';
# Line 8435  ClsDef: Line 8487  ClsDef:
8487                text {                text {
8488                  data: 'entity value';                  data: 'entity value';
8489                }                }
8490                is-expanded: true;                manakai-expanded: true;
8491              }              }
8492            }            }
8493          }          }
# Line 8447  ClsDef: Line 8499  ClsDef:
8499              <!ENTITY entity "entity value">              <!ENTITY entity "entity value">
8500            ]>            ]>
8501            <a>&entity; and &entity;</a>            <a>&entity; and &entity;</a>
8502          @@@cfg:entity-replacement-tree: 1
8503        @@@test:domTree:        @@@test:domTree:
8504          document {          document {
8505            xml-version: '1.0';            xml-version: '1.0';
# Line 8469  ClsDef: Line 8522  ClsDef:
8522                text {                text {
8523                  data: 'entity value';                  data: 'entity value';
8524                }                }
8525                is-expanded: true;                manakai-expanded: true;
8526              }              }
8527              text { data: ' and '; }              text { data: ' and '; }
8528              general-entity-reference {              general-entity-reference {
# Line 8477  ClsDef: Line 8530  ClsDef:
8530                text {                text {
8531                  data: 'entity value';                  data: 'entity value';
8532                }                }
8533                is-expanded: true;                manakai-expanded: true;
8534              }              }
8535            }            }
8536          }          }
# Line 8489  ClsDef: Line 8542  ClsDef:
8542              <!ENTITY entity "entity <p>value</p> with <e>element</e> ">              <!ENTITY entity "entity <p>value</p> with <e>element</e> ">
8543            ]>            ]>
8544            <a>&entity;</a>            <a>&entity;</a>
8545          @@@cfg:entity-replacement-tree: 1
8546        @@@test:domTree:        @@@test:domTree:
8547          document {          document {
8548            xml-version: '1.0';            xml-version: '1.0';
# Line 8518  ClsDef: Line 8572  ClsDef:
8572              local-name: 'a';              local-name: 'a';
8573              general-entity-reference {              general-entity-reference {
8574                node-name: 'entity';                node-name: 'entity';
8575                is-expanded: true;                manakai-expanded: true;
8576                text {                text {
8577                  data: 'entity ';                  data: 'entity ';
8578                }                }
# Line 8556  ClsDef: Line 8610  ClsDef:
8610              <!ENTITY entity2 "e&entity1;n">              <!ENTITY entity2 "e&entity1;n">
8611            ]>            ]>
8612            <a>&entity2;</a>            <a>&entity2;</a>
8613          @@@cfg:entity-replacement-tree: 1
8614        @@@test:domTree:        @@@test:domTree:
8615          document {          document {
8616            xml-version: '1.0';            xml-version: '1.0';
# Line 8573  ClsDef: Line 8628  ClsDef:
8628                general-entity-reference {                general-entity-reference {
8629                  node-name: 'entity1';                  node-name: 'entity1';
8630                  text-content: 'entity value';                  text-content: 'entity value';
8631                  is-expanded: true;                  manakai-expanded: true;
8632                }                }
8633                text { data: 'n'; }                text { data: 'n'; }
8634              }              }
# Line 8585  ClsDef: Line 8640  ClsDef:
8640              general-entity-reference {              general-entity-reference {
8641                node-name: 'entity2';                node-name: 'entity2';
8642                text { data: 'e'; }                text { data: 'e'; }
8643                is-expanded: true;                manakai-expanded: true;
8644                general-entity-reference {                general-entity-reference {
8645                  node-name: 'entity1';                  node-name: 'entity1';
8646                  text {                  text {
8647                    data: 'entity value';                    data: 'entity value';
8648                  }                  }
8649                  is-expanded: true;                  manakai-expanded: true;
8650                }                }
8651                text { data: 'n'; }                text { data: 'n'; }
8652              }              }
# Line 8607  ClsDef: Line 8662  ClsDef:
8662              <!ENTITY entity2 '&#x21;value&#35;'>              <!ENTITY entity2 '&#x21;value&#35;'>
8663            ]>            ]>
8664            <a></a>            <a></a>
8665          @@@cfg:entity-replacement-tree: 1
8666        @@@test:domTree:        @@@test:domTree:
8667          document {          document {
8668            document-type {            document-type {
# Line 8657  ClsDef: Line 8713  ClsDef:
8713              <!ENTITY ent "_&lt;_&gt;_&quot;_&apos;_&amp;_">              <!ENTITY ent "_&lt;_&gt;_&quot;_&apos;_&amp;_">
8714            ]>            ]>
8715            <a>&ent;</a>            <a>&ent;</a>
8716          @@@cfg:entity-replacement-tree: 1
8717        @@@test:domTree:        @@@test:domTree:
8718          document {          document {
8719            document-type {            document-type {
# Line 8682  ClsDef: Line 8739  ClsDef:
8739              <!ENTITY other "other">              <!ENTITY other "other">
8740            ]>            ]>
8741            <a>_&lt;_&gt;_&quot;_&apos;_&amp;_&other;_</a>            <a>_&lt;_&gt;_&quot;_&apos;_&amp;_&other;_</a>
8742          @@@cfg:entity-replacement-tree: 1
8743        @@@test:domTree:        @@@test:domTree:
8744          document {          document {
8745            document-type {            document-type {
# Line 9257  ClsDef: Line 9315  ClsDef:
9315            ]>            ]>
9316            <a at1 = "value&ent;value"            <a at1 = "value&ent;value"
9317               at2 = 'value&ent;value'></a>               at2 = 'value&ent;value'></a>
9318          @@@cfg:entity-replacement-tree: 1
9319        @@@test:domTree:        @@@test:domTree:
9320          document {          document {
9321            document-type {            document-type {
# Line 9286  ClsDef: Line 9345  ClsDef:
9345            ]>            ]>
9346            <a at1 = "value&ent2;value"            <a at1 = "value&ent2;value"
9347               at2 = 'value&ent2;value'></a>               at2 = 'value&ent2;value'></a>
9348          @@@cfg:entity-replacement-tree: 1
9349        @@@test:domTree:        @@@test:domTree:
9350          document {          document {
9351            document-type {            document-type {
# Line 9330  ClsDef: Line 9390  ClsDef:
9390          document {          document {
9391            element {            element {
9392              text-content: 'aaaa!bbbb';              text-content: 'aaaa!bbbb';
9393                text {
9394                  text-content: 'aaaa!bbbb';
9395                }
9396            }            }
9397          }          }
9398      @@XMLTest:      @@XMLTest:
# Line 9357  ClsDef: Line 9420  ClsDef:
9420              attribute {              attribute {
9421                node-name: 'a';                node-name: 'a';
9422                text-content: 'aaaaa!bbbbb';                text-content: 'aaaaa!bbbbb';
9423                  text {
9424                    text-content: 'aaaaa!bbbbb';
9425                  }
9426              }              }
9427            }            }
9428          }          }
# Line 9396  ClsDef: Line 9462  ClsDef:
9462              <!ENTITY ent "&#33;">              <!ENTITY ent "&#33;">
9463            ]>            ]>
9464            <e/>            <e/>
9465          @@@cfg:entity-replacement-tree: 1
9466        @@@test:domTree:        @@@test:domTree:
9467          document {          document {
9468            document-type {            document-type {
# Line 9414  ClsDef: Line 9481  ClsDef:
9481              <!ENTITY ent "aaaaa&#33;bbbbb">              <!ENTITY ent "aaaaa&#33;bbbbb">
9482            ]>            ]>
9483            <e/>            <e/>
9484          @@@cfg:entity-replacement-tree: 1
9485        @@@test:domTree:        @@@test:domTree:
9486          document {          document {
9487            document-type {            document-type {
# Line 9439  ClsDef: Line 9507  ClsDef:
9507              general-entity-reference {              general-entity-reference {
9508                node-name: 'ent';                node-name: 'ent';
9509                text-content: '!';                text-content: '!';
9510                is-expanded: true;                manakai-expanded: true;
9511              }              }
9512            }            }
9513          }          }
# Line 9458  ClsDef: Line 9526  ClsDef:
9526              general-entity-reference {              general-entity-reference {
9527                node-name: 'ent';                node-name: 'ent';
9528                text-content: 'aaaaa!bbbbb';                text-content: 'aaaaa!bbbbb';
9529                is-expanded: true;                manakai-expanded: true;
9530              }              }
9531            }            }
9532          }          }
# Line 9480  ClsDef: Line 9548  ClsDef:
9548                general-entity-reference {                general-entity-reference {
9549                  node-name: 'ent';                  node-name: 'ent';
9550                  text-content: '!';                  text-content: '!';
9551                  is-expanded: true;                  manakai-expanded: true;
9552                }                }
9553                is-expanded: true;                manakai-expanded: true;
9554              }              }
9555            }            }
9556          }          }
# Line 9504  ClsDef: Line 9572  ClsDef:
9572                general-entity-reference {                general-entity-reference {
9573                  node-name: 'ent';                  node-name: 'ent';
9574                  text-content: 'aa!bb';                  text-content: 'aa!bb';
9575                  is-expanded: true;                  manakai-expanded: true;
9576                    text {
9577                      text-content: 'aa!bb';
9578                    }
9579                }                }
9580                is-expanded: true;                manakai-expanded: true;
9581              }              }
9582            }            }
9583          }          }
# Line 9527  ClsDef: Line 9598  ClsDef:
9598                general-entity-reference {                general-entity-reference {
9599                  node-name: 'ent';                  node-name: 'ent';
9600                  text-content: '!';                  text-content: '!';
9601                  is-expanded: true;                  manakai-expanded: true;
9602                }                }
9603              }              }
9604            }            }
# Line 9549  ClsDef: Line 9620  ClsDef:
9620                general-entity-reference {                general-entity-reference {
9621                  node-name: 'ent';                  node-name: 'ent';
9622                  text-content: 'aaaaa!bbbbb';                  text-content: 'aaaaa!bbbbb';
9623                  is-expanded: true;                  manakai-expanded: true;
9624                    text {
9625                      text-content: 'aaaaa!bbbbb';
9626                    }
9627                }                }
9628              }              }
9629            }            }
# Line 9571  ClsDef: Line 9645  ClsDef:
9645                node-name: 'a';                node-name: 'a';
9646                general-entity-reference {                general-entity-reference {
9647                  node-name: 'ent2';                  node-name: 'ent2';
9648                  is-expanded: true;                  manakai-expanded: true;
9649                  general-entity-reference {                  general-entity-reference {
9650                    node-name: 'ent';                    node-name: 'ent';
9651                    text-content: '!';                    text-content: '!';
9652                    is-expanded: true;                    manakai-expanded: true;
9653                  }                  }
9654                }                }
9655              }              }
# Line 9598  ClsDef: Line 9672  ClsDef:
9672                node-name: 'a';                node-name: 'a';
9673                general-entity-reference {                general-entity-reference {
9674                  node-name: 'ent2';                  node-name: 'ent2';
9675                  is-expanded: true;                  manakai-expanded: true;
9676                  general-entity-reference {                  general-entity-reference {
9677                    node-name: 'ent';                    node-name: 'ent';
9678                    text-content: 'aa!bb';                    text-content: 'aa!bb';
9679                    is-expanded: true;                    manakai-expanded: true;
9680                  }                  }
9681                }                }
9682              }              }
# Line 9629  ClsDef: Line 9703  ClsDef:
9703          document {          document {
9704            element {            element {
9705              text-content: 'aaaa!bbbb';              text-content: 'aaaa!bbbb';
9706                text {
9707                  text-content: 'aaaa!bbbb';
9708                }
9709            }            }
9710          }          }
9711      @@XMLTest:      @@XMLTest:
# Line 9656  ClsDef: Line 9733  ClsDef:
9733              attribute {              attribute {
9734                node-name: 'a';                node-name: 'a';
9735                text-content: 'aaaaa!bbbbb';                text-content: 'aaaaa!bbbbb';
9736                  text {
9737                    text-content: 'aaaaa!bbbbb';
9738                  }
9739              }              }
9740            }            }
9741          }          }
# Line 9695  ClsDef: Line 9775  ClsDef:
9775              <!ENTITY ent "&#x21;">              <!ENTITY ent "&#x21;">
9776            ]>            ]>
9777            <e/>            <e/>
9778          @@@cfg:entity-replacement-tree: 1
9779        @@@test:domTree:        @@@test:domTree:
9780          document {          document {
9781            document-type {            document-type {
# Line 9713  ClsDef: Line 9794  ClsDef:
9794              <!ENTITY ent "aaaaa&#x21;bbbbb">              <!ENTITY ent "aaaaa&#x21;bbbbb">
9795            ]>            ]>
9796            <e/>            <e/>
9797          @@@cfg:entity-replacement-tree: 1
9798        @@@test:domTree:        @@@test:domTree:
9799          document {          document {
9800            document-type {            document-type {
9801              general-entity {              general-entity {
9802                node-name: 'ent';                node-name: 'ent';
9803                text-content: 'aaaaa!bbbbb';                text-content: 'aaaaa!bbbbb';
9804                  text {
9805                    text-content: 'aaaaa!bbbbb';
9806                  }
9807              }              }
9808            }            }
9809            element { }            element { }
# Line 9738  ClsDef: Line 9823  ClsDef:
9823              general-entity-reference {              general-entity-reference {
9824                node-name: 'ent';                node-name: 'ent';
9825                text-content: '!';                text-content: '!';
9826                is-expanded: true;                manakai-expanded: true;
9827              }              }
9828            }            }
9829          }          }
# Line 9757  ClsDef: Line 9842  ClsDef:
9842              general-entity-reference {              general-entity-reference {
9843                node-name: 'ent';                node-name: 'ent';
9844                text-content: 'aaaaa!bbbbb';                text-content: 'aaaaa!bbbbb';
9845                is-expanded: true;                manakai-expanded: true;
9846              }              }
9847            }            }
9848          }          }
# Line 9776  ClsDef: Line 9861  ClsDef:
9861            element {            element {
9862              general-entity-reference {              general-entity-reference {
9863                node-name: 'ent2';                node-name: 'ent2';
9864                is-expanded: true;                manakai-expanded: true;
9865                general-entity-reference {                general-entity-reference {
9866                  node-name: 'ent';                  node-name: 'ent';
9867                  text-content: '!';                  text-content: '!';
9868                  is-expanded: true;                  manakai-expanded: true;
9869                }                }
9870              }              }
9871            }            }
# Line 9800  ClsDef: Line 9885  ClsDef:
9885            element {            element {
9886              general-entity-reference {              general-entity-reference {
9887                node-name: 'ent2';                node-name: 'ent2';
9888                is-expanded: true;                manakai-expanded: true;
9889                general-entity-reference {                general-entity-reference {
9890                  node-name: 'ent';                  node-name: 'ent';
9891                  is-expanded: true;                  manakai-expanded: true;
9892                  text-content: 'aa!bb';                  text-content: 'aa!bb';
9893                }                }
9894              }              }
# Line 9825  ClsDef: Line 9910  ClsDef:
9910                node-name: 'a';                node-name: 'a';
9911                general-entity-reference {                general-entity-reference {
9912                  node-name: 'ent';                  node-name: 'ent';
9913                  is-expanded: true;                  manakai-expanded: true;
9914                  text-content: '!';                  text-content: '!';
9915                }                }
9916              }              }
# Line 9847  ClsDef: Line 9932  ClsDef:
9932                node-name: 'a';                node-name: 'a';
9933                general-entity-reference {                general-entity-reference {
9934                  node-name: 'ent';                  node-name: 'ent';
9935                  is-expanded: true;                  manakai-expanded: true;
9936                  text-content: 'aaaaa!bbbbb';                  text-content: 'aaaaa!bbbbb';
9937                    text {
9938                      text-content: 'aaaaa!bbbbb';
9939                    }
9940                }                }
9941              }              }
9942            }            }
# Line 9870  ClsDef: Line 9958  ClsDef:
9958                node-name: 'a';                node-name: 'a';
9959                general-entity-reference {                general-entity-reference {
9960                  node-name: 'ent2';                  node-name: 'ent2';
9961                  is-expanded: true;                  manakai-expanded: true;
9962                  general-entity-reference {                  general-entity-reference {
9963                    node-name: 'ent';                    node-name: 'ent';
9964                    is-expanded: true;                    manakai-expanded: true;
9965                    text-content: '!';                    text-content: '!';
9966                  }                  }
9967                }                }
# Line 9897  ClsDef: Line 9985  ClsDef:
9985                node-name: 'a';                node-name: 'a';
9986                general-entity-reference {                general-entity-reference {
9987                  node-name: 'ent2';                  node-name: 'ent2';
9988                  is-expanded: true;                  manakai-expanded: true;
9989                  general-entity-reference {                  general-entity-reference {
9990                    node-name: 'ent';                    node-name: 'ent';
9991                    is-expanded: true;                    manakai-expanded: true;
9992                    text-content: 'aa!bb';                    text-content: 'aa!bb';
9993                  }                  }
9994                }                }
# Line 10071  ClsDef: Line 10159  ClsDef:
10159              <!ENTITY entity "value">              <!ENTITY entity "value">
10160            ]>            ]>
10161            <p>&entity;</p>            <p>&entity;</p>
10162          @@@cfg:entity-replacement-tree: 1
10163        @@@test:domTree:        @@@test:domTree:
10164          document {          document {
10165            document-type {            document-type {
# Line 10082  ClsDef: Line 10171  ClsDef:
10171            element {            element {
10172              general-entity-reference {              general-entity-reference {
10173                node-name: 'entity';                node-name: 'entity';
10174                is-expanded: true;                manakai-expanded: true;
10175                text-content: 'value';                text-content: 'value';
10176              }              }
10177            }            }
# Line 10096  ClsDef: Line 10185  ClsDef:
10185              <!ENTITY another SYSTEM "another">              <!ENTITY another SYSTEM "another">
10186            ]>            ]>
10187            <p>&entity;</p>            <p>&entity;</p>
10188          @@@cfg:entity-replacement-tree: 1
10189        @@@test:domTree:        @@@test:domTree:
10190          document {          document {
10191            document-type {            document-type {
# Line 10112  ClsDef: Line 10202  ClsDef:
10202            element {            element {
10203              general-entity-reference {              general-entity-reference {
10204                node-name: 'entity';                node-name: 'entity';
10205                is-expanded: true;                manakai-expanded: true;
10206                text-content: 'value';                text-content: 'value';
10207              }              }
10208            }            }
# Line 10158  ClsDef: Line 10248  ClsDef:
10248            document-type { }            document-type { }
10249            element {            element {
10250              general-entity-reference {              general-entity-reference {
10251                is-expanded: false;                manakai-expanded: false;
10252              }              }
10253            }            }
10254          }          }
# Line 10176  ClsDef: Line 10266  ClsDef:
10266            document-type { }            document-type { }
10267            element {            element {
10268              general-entity-reference {              general-entity-reference {
10269                is-expanded: false;                manakai-expanded: false;
10270              }              }
10271            }            }
10272          }          }
# Line 10206  ClsDef: Line 10296  ClsDef:
10296            document-type { }            document-type { }
10297            element {            element {
10298              general-entity-reference {              general-entity-reference {
10299                is-expanded: false;                manakai-expanded: false;
10300              }              }
10301            }            }
10302          }          }
# Line 10224  ClsDef: Line 10314  ClsDef:
10314            document-type { }            document-type { }
10315            element {            element {
10316              general-entity-reference {              general-entity-reference {
10317                is-expanded: false;                manakai-expanded: false;
10318              }              }
10319            }            }
10320          }          }
# Line 10248  ClsDef: Line 10338  ClsDef:
10338            document-type { }            document-type { }
10339            element {            element {
10340              general-entity-reference {              general-entity-reference {
10341                is-expanded: false;                manakai-expanded: false;
10342              }              }
10343            }            }
10344          }          }
# Line 10263  ClsDef: Line 10353  ClsDef:
10353            document-type { }            document-type { }
10354            element {            element {
10355              general-entity-reference {              general-entity-reference {
10356                is-expanded: false;                manakai-expanded: false;
10357              }              }
10358            }            }
10359          }          }
# Line 10341  ClsDef: Line 10431  ClsDef:
10431            <!ENTITY c "&entity;">            <!ENTITY c "&entity;">
10432            ]>            ]>
10433            <p>&c;</p>            <p>&c;</p>
10434          @@@cfg:entity-replacement-tree: 1
10435        @@@test:domTree:        @@@test:domTree:
10436          document {          document {
10437            document-type {            document-type {
# Line 10376  ClsDef: Line 10467  ClsDef:
10467            <!ENTITY c "&entity;">            <!ENTITY c "&entity;">
10468            ]>            ]>
10469            <p>&c;</p>            <p>&c;</p>
10470          @@@cfg:entity-replacement-tree: 1
10471        @@@test:domTree:        @@@test:domTree:
10472          document {          document {
10473            document-type {            document-type {
# Line 10387  ClsDef: Line 10479  ClsDef:
10479                node-name: 'c';                node-name: 'c';
10480                general-entity-reference {                general-entity-reference {
10481                  node-name: 'entity';                  node-name: 'entity';
10482                  is-expanded: true;                  manakai-expanded: true;
10483                  text-content: 'value';                  text-content: 'value';
10484                }                }
10485              }              }
# Line 10401  ClsDef: Line 10493  ClsDef:
10493            element {            element {
10494              general-entity-reference {              general-entity-reference {
10495                node-name: 'c';                node-name: 'c';
10496                is-expanded: true;                manakai-expanded: true;
10497                general-entity-reference {                general-entity-reference {
10498                  node-name: 'entity';                  node-name: 'entity';
10499                  is-expanded: true;                  manakai-expanded: true;
10500                  text-content: 'value';                  text-content: 'value';
10501                }                }
10502              }              }
# Line 10443  ClsDef: Line 10535  ClsDef:
10535              %para;              %para;
10536            ]>            ]>
10537            <p>&c;</p>            <p>&c;</p>
10538          @@@cfg:entity-replacement-tree: 1
10539        @@@test:domTree:        @@@test:domTree:
10540          document {          document {
10541            document-type {            document-type {
# Line 10450  ClsDef: Line 10543  ClsDef:
10543                node-name: 'c';                node-name: 'c';
10544                general-entity-reference {                general-entity-reference {
10545                  node-name: 'entity';                  node-name: 'entity';
10546                  is-expanded: false;                  manakai-expanded: false;
10547                }                }
10548              }              }
10549            }            }
# Line 10459  ClsDef: Line 10552  ClsDef:
10552                node-name: 'c';                node-name: 'c';
10553                general-entity-reference {                general-entity-reference {
10554                  node-name: 'entity';                  node-name: 'entity';
10555                  is-expanded: false;                  manakai-expanded: false;
10556                }                }
10557              }              }
10558            }            }
# Line 10482  ClsDef: Line 10575  ClsDef:
10575            element {            element {
10576              general-entity-reference {              general-entity-reference {
10577                node-name: 'c';                node-name: 'c';
10578                is-expanded: false;                manakai-expanded: false;
10579              }              }
10580            }            }
10581          }          }
# Line 10502  ClsDef: Line 10595  ClsDef:
10595            element {            element {
10596              general-entity-reference {              general-entity-reference {
10597                node-name: 'c';                node-name: 'c';
10598                is-expanded: true;                manakai-expanded: true;
10599                general-entity-reference {                general-entity-reference {
10600                  node-name: 'entity';                  node-name: 'entity';
10601                  is-expanded: false;                  manakai-expanded: false;
10602                }                }
10603              }              }
10604            }            }
# Line 10527  ClsDef: Line 10620  ClsDef:
10620            element {            element {
10621              general-entity-reference {              general-entity-reference {
10622                node-name: 'c';                node-name: 'c';
10623                is-expanded: false;                manakai-expanded: false;
10624              }              }
10625            }            }
10626          }          }
# Line 10560  ClsDef: Line 10653  ClsDef:
10653            element {            element {
10654              general-entity-reference {              general-entity-reference {
10655                node-name: 'c';                node-name: 'c';
10656                is-expanded: true;                manakai-expanded: true;
10657                general-entity-reference {                general-entity-reference {
10658                  node-name: 'entity';                  node-name: 'entity';
10659                  is-expanded: false;                  manakai-expanded: false;
10660                }                }
10661              }              }
10662            }            }
# Line 10586  ClsDef: Line 10679  ClsDef:
10679            element {            element {
10680              general-entity-reference {              general-entity-reference {
10681                node-name: 'c';                node-name: 'c';
10682                is-expanded: false;                manakai-expanded: false;
10683              }              }
10684            }            }
10685          }          }
# Line 10606  ClsDef: Line 10699  ClsDef:
10699            element {            element {
10700              general-entity-reference {              general-entity-reference {
10701                node-name: 'c';                node-name: 'c';
10702                is-expanded: true;                manakai-expanded: true;
10703                general-entity-reference {                general-entity-reference {
10704                  node-name: 'entity';                  node-name: 'entity';
10705                  is-expanded: false;                  manakai-expanded: false;
10706                }                }
10707              }              }
10708            }            }
# Line 10631  ClsDef: Line 10724  ClsDef:
10724            element {            element {
10725              general-entity-reference {              general-entity-reference {
10726                node-name: 'c';                node-name: 'c';
10727                is-expanded: false;                manakai-expanded: false;
10728              }              }
10729            }            }
10730          }          }
# Line 10660  ClsDef: Line 10753  ClsDef:
10753            element {            element {
10754              general-entity-reference {              general-entity-reference {
10755                node-name: 'c';                node-name: 'c';
10756                is-expanded: true;                manakai-expanded: true;
10757                general-entity-reference {                general-entity-reference {
10758                  node-name: 'entity';                  node-name: 'entity';
10759                  is-expanded: false;                  manakai-expanded: false;
10760                }                }
10761              }              }
10762            }            }
# Line 10680  ClsDef: Line 10773  ClsDef:
10773            element {            element {
10774              general-entity-reference {              general-entity-reference {
10775                node-name: 'c';                node-name: 'c';
10776                is-expanded: true;                manakai-expanded: true;
10777                general-entity-reference {                general-entity-reference {
10778                  node-name: 'entity';                  node-name: 'entity';
10779                  is-expanded: false;                  manakai-expanded: false;
10780                }                }
10781              }              }
10782            }            }
# Line 10786  ClsDef: Line 10879  ClsDef:
10879              <!ENTITY entity "value">              <!ENTITY entity "value">
10880            ]>            ]>
10881            <p a="&entity;"/>            <p a="&entity;"/>
10882          @@@cfg:entity-replacement-tree: 1
10883        @@@test:domTree:        @@@test:domTree:
10884          document {          document {
10885            document-type {            document-type {
# Line 10799  ClsDef: Line 10893  ClsDef:
10893                node-name: 'a';                node-name: 'a';
10894                general-entity-reference {                general-entity-reference {
10895                  node-name: 'entity';                  node-name: 'entity';
10896                  is-expanded: true;                  manakai-expanded: true;
10897                  text-content: 'value';                  text-content: 'value';
10898                }                }
10899              }              }
# Line 10814  ClsDef: Line 10908  ClsDef:
10908              <!ENTITY another SYSTEM "another">              <!ENTITY another SYSTEM "another">
10909            ]>            ]>
10910            <p a="&entity;"/>            <p a="&entity;"/>
10911          @@@cfg:entity-replacement-tree: 1
10912        @@@test:domTree:        @@@test:domTree:
10913          document {          document {
10914            document-type {            document-type {
# Line 10834  ClsDef: Line 10929  ClsDef:
10929                node-name: 'a';                node-name: 'a';
10930                general-entity-reference {                general-entity-reference {
10931                  node-name: 'entity';                  node-name: 'entity';
10932                  is-expanded: true;                  manakai-expanded: true;
10933                  text-content: 'value';                  text-content: 'value';
10934                }                }
10935              }              }
# Line 10883  ClsDef: Line 10978  ClsDef:
10978              attribute {              attribute {
10979                node-name: 'a';                node-name: 'a';
10980                general-entity-reference {                general-entity-reference {
10981                  is-expanded: false;                  manakai-expanded: false;
10982                }                }
10983              }              }
10984            }            }
# Line 10904  ClsDef: Line 10999  ClsDef:
10999              attribute {              attribute {
11000                node-name: 'a';                node-name: 'a';
11001                general-entity-reference {                general-entity-reference {
11002                  is-expanded: false;                  manakai-expanded: false;
11003                }                }
11004              }              }
11005            }            }
# Line 10937  ClsDef: Line 11032  ClsDef:
11032              attribute {              attribute {
11033                node-name: 'a';                node-name: 'a';
11034                general-entity-reference {                general-entity-reference {
11035                  is-expanded: false;                  manakai-expanded: false;
11036                }                }
11037              }              }
11038            }            }
# Line 10958  ClsDef: Line 11053  ClsDef:
11053              attribute {              attribute {
11054                node-name: 'a';                node-name: 'a';
11055                general-entity-reference {                general-entity-reference {
11056                  is-expanded: false;                  manakai-expanded: false;
11057                }                }
11058              }              }
11059            }            }
# Line 10985  ClsDef: Line 11080  ClsDef:
11080              attribute {              attribute {
11081                node-name: 'a';                node-name: 'a';
11082                general-entity-reference {                general-entity-reference {
11083                  is-expanded: false;                  manakai-expanded: false;
11084                }                }
11085              }              }
11086            }            }
# Line 11003  ClsDef: Line 11098  ClsDef:
11098              attribute {              attribute {
11099                node-name: 'a';                node-name: 'a';
11100                general-entity-reference {                general-entity-reference {
11101                  is-expanded: false;                  manakai-expanded: false;
11102                }                }
11103              }              }
11104            }            }
# Line 11082  ClsDef: Line 11177  ClsDef:
11177            <!ENTITY c "&entity;">            <!ENTITY c "&entity;">
11178            ]>            ]>
11179            <p a="&c;"/>            <p a="&c;"/>
11180          @@@cfg:entity-replacement-tree: 1
11181        @@@test:domTree:        @@@test:domTree:
11182          document {          document {
11183            document-type {            document-type {
# Line 11120  ClsDef: Line 11216  ClsDef:
11216            <!ENTITY c "&entity;">            <!ENTITY c "&entity;">
11217            ]>            ]>
11218            <p a="&c;"/>            <p a="&c;"/>
11219          @@@cfg:entity-replacement-tree: 1
11220        @@@test:domTree:        @@@test:domTree:
11221          document {          document {
11222            document-type {            document-type {
# Line 11187  ClsDef: Line 11284  ClsDef:
11284              %para;              %para;
11285            ]>            ]>
11286            <p a="&c;"/>            <p a="&c;"/>
11287          @@@cfg:entity-replacement-tree: 1
11288        @@@test:domTree:        @@@test:domTree:
11289          document {          document {
11290            document-type {            document-type {
# Line 11194  ClsDef: Line 11292  ClsDef:
11292                node-name: 'c';                node-name: 'c';
11293                general-entity-reference {                general-entity-reference {
11294                  node-name: 'entity';                  node-name: 'entity';
11295                  is-expanded: false;                  manakai-expanded: false;
11296                }                }
11297              }              }
11298            }            }
# Line 11205  ClsDef: Line 11303  ClsDef:
11303                  node-name: 'c';                  node-name: 'c';
11304                  general-entity-reference {                  general-entity-reference {
11305                    node-name: 'entity';                    node-name: 'entity';
11306                    is-expanded: false;                    manakai-expanded: false;
11307                  }                  }
11308                }                }
11309              }              }
# Line 11231  ClsDef: Line 11329  ClsDef:
11329                node-name: 'a';                node-name: 'a';
11330                general-entity-reference {                general-entity-reference {
11331                  node-name: 'c';                  node-name: 'c';
11332                  is-expanded: false;                  manakai-expanded: false;
11333                }                }
11334              }              }
11335            }            }
# Line 11254  ClsDef: Line 11352  ClsDef:
11352                node-name: 'a';                node-name: 'a';
11353                general-entity-reference {                general-entity-reference {
11354                  node-name: 'c';                  node-name: 'c';
11355                  is-expanded: true;                  manakai-expanded: true;
11356                  general-entity-reference {                  general-entity-reference {
11357                    node-name: 'entity';                    node-name: 'entity';
11358                    is-expanded: false;                    manakai-expanded: false;
11359                  }                  }
11360                }                }
11361              }              }
# Line 11282  ClsDef: Line 11380  ClsDef:
11380                node-name: 'a';                node-name: 'a';
11381                general-entity-reference {                general-entity-reference {
11382                  node-name: 'c';                  node-name: 'c';
11383                  is-expanded: false;                  manakai-expanded: false;
11384                }                }
11385              }              }
11386            }            }
# Line 11318  ClsDef: Line 11416  ClsDef:
11416                node-name: 'a';                node-name: 'a';
11417                general-entity-reference {                general-entity-reference {
11418                  node-name: 'c';                  node-name: 'c';
11419                  is-expanded: true;                  manakai-expanded: true;
11420                  general-entity-reference {                  general-entity-reference {
11421                    node-name: 'entity';                    node-name: 'entity';
11422                    is-expanded: false;                    manakai-expanded: false;
11423                  }                  }
11424                }                }
11425              }              }
# Line 11347  ClsDef: Line 11445  ClsDef:
11445                node-name: 'a';                node-name: 'a';
11446                general-entity-reference {                general-entity-reference {
11447                  node-name: 'c';                  node-name: 'c';
11448                  is-expanded: false;                  manakai-expanded: false;
11449                }                }
11450              }              }
11451            }            }
# Line 11370  ClsDef: Line 11468  ClsDef:
11468                node-name: 'a';                node-name: 'a';
11469                general-entity-reference {                general-entity-reference {
11470                  node-name: 'c';                  node-name: 'c';
11471                  is-expanded: true;                  manakai-expanded: true;
11472                  general-entity-reference {                  general-entity-reference {
11473                    node-name: 'entity';                    node-name: 'entity';
11474                    is-expanded: false;                    manakai-expanded: false;
11475                  }                  }
11476                }                }
11477              }              }
# Line 11398  ClsDef: Line 11496  ClsDef:
11496                node-name: 'a';                node-name: 'a';
11497                general-entity-reference {                general-entity-reference {
11498                  node-name: 'c';                  node-name: 'c';
11499                  is-expanded: false;                  manakai-expanded: false;
11500                }                }
11501              }              }
11502            }            }
# Line 11430  ClsDef: Line 11528  ClsDef:
11528                node-name: 'a';                node-name: 'a';
11529                general-entity-reference {                general-entity-reference {
11530                  node-name: 'c';                  node-name: 'c';
11531                  is-expanded: true;                  manakai-expanded: true;
11532                  general-entity-reference {                  general-entity-reference {
11533                    node-name: 'entity';                    node-name: 'entity';
11534                    is-expanded: false;                    manakai-expanded: false;
11535                  }                  }
11536                }                }
11537              }              }
# Line 11453  ClsDef: Line 11551  ClsDef:
11551                node-name: 'a';                node-name: 'a';
11552                general-entity-reference {                general-entity-reference {
11553                  node-name: 'c';                  node-name: 'c';
11554                  is-expanded: true;                  manakai-expanded: true;
11555                  general-entity-reference {                  general-entity-reference {
11556                    node-name: 'entity';                    node-name: 'entity';
11557                    is-expanded: false;                    manakai-expanded: false;
11558                  }                  }
11559                }                }
11560              }              }
# Line 11582  ClsDef: Line 11680  ClsDef:
11680            <!ATTLIST p a CDATA "&c;">            <!ATTLIST p a CDATA "&c;">
11681            ]>            ]>
11682            <p/>            <p/>
11683          @@@cfg:entity-replacement-tree: 1
11684        @@@test:domTree:        @@@test:domTree:
11685          document {          document {
11686            document-type {            document-type {
# Line 11593  ClsDef: Line 11692  ClsDef:
11692                node-name: 'c';                node-name: 'c';
11693                general-entity-reference {                general-entity-reference {
11694                  node-name: 'entity';                  node-name: 'entity';
11695                  is-expanded: true;                  manakai-expanded: true;
11696                  text-content: 'value';                  text-content: 'value';
11697                }                }
11698              }              }
# Line 11603  ClsDef: Line 11702  ClsDef:
11702                  node-name: 'a';                  node-name: 'a';
11703                  general-entity-reference {                  general-entity-reference {
11704                    node-name: 'c';                    node-name: 'c';
11705                    is-expanded: true;                    manakai-expanded: true;
11706                    general-entity-reference {                    general-entity-reference {
11707                      node-name: 'entity';                      node-name: 'entity';
11708                      is-expanded: true;                      manakai-expanded: true;
11709                      text-content: 'value';                      text-content: 'value';
11710                    }                    }
11711                  }                  }
# Line 11638  ClsDef: Line 11737  ClsDef:
11737            <!ATTLIST p a CDATA "&c;">            <!ATTLIST p a CDATA "&c;">
11738            ]>            ]>
11739            <p/>            <p/>
11740          @@@cfg:entity-replacement-tree: 1
11741        @@@test:domTree:        @@@test:domTree:
11742          document {          document {
11743            document-type {            document-type {
# Line 11664  ClsDef: Line 11764  ClsDef:
11764                  node-name: 'a';                  node-name: 'a';
11765                  general-entity-reference {                  general-entity-reference {
11766                    node-name: 'c';                    node-name: 'c';
11767                    is-expanded: true;                    manakai-expanded: true;
11768                    general-entity-reference {                    general-entity-reference {
11769                      node-name: 'entity';                      node-name: 'entity';
11770                      is-expanded: true;                      manakai-expanded: true;
11771                      text-content: 'value';                      text-content: 'value';
11772                    }                    }
11773                  }                  }
# Line 11895  ClsDef: Line 11995  ClsDef:
11995                specified: false;                specified: false;
11996                general-entity-reference {                general-entity-reference {
11997                  node-name: 'c';                  node-name: 'c';
11998                  is-expanded: true;                  manakai-expanded: true;
11999                  general-entity-reference {                  general-entity-reference {
12000                    node-name: 'entity';                    node-name: 'entity';
12001                    is-expanded: false;                    manakai-expanded: false;
12002                  }                  }
12003                }                }
12004              }              }
# Line 11921  ClsDef: Line 12021  ClsDef:
12021                specified: false;                specified: false;
12022                general-entity-reference {                general-entity-reference {
12023                  node-name: 'c';                  node-name: 'c';
12024                  is-expanded: true;                  manakai-expanded: true;
12025                  general-entity-reference {                  general-entity-reference {
12026                    node-name: 'entity';                    node-name: 'entity';
12027                    is-expanded: false;                    manakai-expanded: false;
12028                  }                  }
12029                }                }
12030              }              }
# Line 12004  ClsDef: Line 12104  ClsDef:
12104            <!ATTLIST p a CDATA "&entity;">            <!ATTLIST p a CDATA "&entity;">
12105            ]>            ]>
12106            <p/>            <p/>
12107          @@@cfg:entity-replacement-tree: 1
12108        @@@test:domTree:        @@@test:domTree:
12109          document {          document {
12110            document-type {            document-type {
# Line 12017  ClsDef: Line 12118  ClsDef:
12118                  node-name: 'a';                  node-name: 'a';
12119                  general-entity-reference {                  general-entity-reference {
12120                    node-name: 'entity';                    node-name: 'entity';
12121                    is-expanded: true;                    manakai-expanded: true;
12122                    text-content: 'value';                    text-content: 'value';
12123                  }                  }
12124                }                }
# Line 12029  ClsDef: Line 12130  ClsDef:
12130                specified: false;                specified: false;
12131                general-entity-reference {                general-entity-reference {
12132                  node-name: 'entity';                  node-name: 'entity';
12133                  is-expanded: true;                  manakai-expanded: true;
12134                  text-content: 'value';                  text-content: 'value';
12135                }                }
12136              }              }
# Line 12055  ClsDef: Line 12156  ClsDef:
12156            <!ATTLIST p a CDATA "&entity;">            <!ATTLIST p a CDATA "&entity;">
12157            ]>            ]>
12158            <p/>            <p/>
12159          @@@cfg:entity-replacement-tree: 1
12160        @@@test:domTree:        @@@test:domTree:
12161          document {          document {
12162            document-type {            document-type {
# Line 12064  ClsDef: Line 12166  ClsDef:
12166                  node-name: 'a';                  node-name: 'a';
12167                  general-entity-reference {                  general-entity-reference {
12168                    node-name: 'entity';                    node-name: 'entity';
12169                    is-expanded: true;                    manakai-expanded: true;
12170                    text-content: 'value';                    text-content: 'value';
12171                  }                  }
12172                }                }
# Line 12087  ClsDef: Line 12189  ClsDef:
12189                specified: false;                specified: false;
12190                general-entity-reference {                general-entity-reference {
12191                  node-name: 'entity';                  node-name: 'entity';
12192                  is-expanded: true;                  manakai-expanded: true;
12193                  text-content: 'value';                  text-content: 'value';
12194                }                }
12195              }              }
# Line 12385  ClsDef: Line 12487  ClsDef:
12487                  node-name: 'a';                  node-name: 'a';
12488                  general-entity-reference {                  general-entity-reference {
12489                    node-name: 'entity';                    node-name: 'entity';
12490                    is-expanded: false;                    manakai-expanded: false;
12491                  }                  }
12492                }                }
12493              }              }
# Line 12396  ClsDef: Line 12498  ClsDef:
12498                specified: false;                specified: false;
12499                general-entity-reference {                general-entity-reference {
12500                  node-name: 'entity';                  node-name: 'entity';
12501                  is-expanded: false;                  manakai-expanded: false;
12502                }                }
12503              }              }
12504            }            }
# Line 12420  ClsDef: Line 12522  ClsDef:
12522                  node-name: 'a';                  node-name: 'a';
12523                  general-entity-reference {                  general-entity-reference {
12524                    node-name: 'entity';                    node-name: 'entity';
12525                    is-expanded: false;                    manakai-expanded: false;
12526                  }                  }
12527                }                }
12528              }              }
# Line 12431  ClsDef: Line 12533  ClsDef:
12533                specified: false;                specified: false;
12534                general-entity-reference {                general-entity-reference {
12535                  node-name: 'entity';                  node-name: 'entity';
12536                  is-expanded: false;                  manakai-expanded: false;
12537                }                }
12538              }              }
12539            }            }
# Line 12488  ClsDef: Line 12590  ClsDef:
12590            <!ENTITY c "&#x26;ext;">            <!ENTITY c "&#x26;ext;">
12591            ]>            ]>
12592            <p a="&c;"/>            <p a="&c;"/>
12593          @@@cfg:entity-replacement-tree: 0
12594          @@@c:erred: <[[xp|wf-no-external-entity-references]]> { (1, 1)..(1, 5); }
12595        @@XMLTest:
12596          @@@QName: xp.attval.reptxt.parsed.entity.reference.2.test
12597          @@@DEnt:
12598            @@@@test:value:
12599              <!DOCTYPE p [
12600              <!NOTATION n SYSTEM "notation">
12601              <!ENTITY ext SYSTEM "system" NDATA n>
12602              <!ENTITY c "&#x26;ext;">
12603              ]>
12604              <p a="&c;"/>
12605          @@@cfg:entity-replacement-tree: 1
12606        @@@c:erred: <[[xp|wf-no-external-entity-references]]> { (1, 1)..(1, 5); }        @@@c:erred: <[[xp|wf-no-external-entity-references]]> { (1, 1)..(1, 5); }
12607        @@@c:erred:        @@@c:erred:
12608          @@@@@: <[[xp|wf-parsed-entity]]> { }          @@@@@: <[[xp|wf-parsed-entity]]> { }
# Line 12513  ClsDef: Line 12628  ClsDef:
12628            <!ENTITY c "&ext;">            <!ENTITY c "&ext;">
12629            ]>            ]>
12630            <p a="&c;"/>            <p a="&c;"/>
12631          @@@cfg:entity-replacement-tree: 0
12632          @@@c:erred: <[[xp|wf-no-external-entity-references]]> { }
12633        @@XMLTest:
12634          @@@QName: xp.attval.entval.parsed.entity.reference.2.test
12635          @@@DEnt:
12636            @@@@test:value:
12637              <!DOCTYPE p [
12638              <!NOTATION n SYSTEM "notation">
12639              <!ENTITY ext SYSTEM "system" NDATA n>
12640              <!ENTITY c "&ext;">
12641              ]>
12642              <p a="&c;"/>
12643          @@@cfg:entity-replacement-tree: 1
12644        @@@c:erred: <[[xp|wf-no-external-entity-references]]> { }        @@@c:erred: <[[xp|wf-no-external-entity-references]]> { }
12645        @@@c:erred: <[[xp|wf-parsed-entity]]> { }        @@@c:erred: <[[xp|wf-parsed-entity]]> { }
12646    
# Line 12726  ClsDef: Line 12854  ClsDef:
12854            <!ENTITY e "a">            <!ENTITY e "a">
12855            <!ENTITY e "b">            <!ENTITY e "b">
12856            ]><a/>            ]><a/>
12857          @@@cfg:entity-replacement-tree: 1
12858        @@@test:domTree:        @@@test:domTree:
12859          document {          document {
12860            document-type {            document-type {
# Line 12763  ClsDef: Line 12892  ClsDef:
12892            <!ENTITY quot   "&#34;">            <!ENTITY quot   "&#34;">
12893            <!ENTITY e      "f">            <!ENTITY e      "f">
12894            ]><a>&lt;&gt;&amp;&apos;&quot;</a>            ]><a>&lt;&gt;&amp;&apos;&quot;</a>
12895          @@@cfg:entity-replacement-tree: 1
12896        @@@test:domTree:        @@@test:domTree:
12897          document {          document {
12898            document-type {            document-type {
# Line 12787  ClsDef: Line 12917  ClsDef:
12917            <!ENTITY quot   "&#x26;#34;">            <!ENTITY quot   "&#x26;#34;">
12918            <!ENTITY e      "f">            <!ENTITY e      "f">
12919            ]><a>&lt;&gt;&amp;&apos;&quot;</a>            ]><a>&lt;&gt;&amp;&apos;&quot;</a>
12920          @@@cfg:entity-replacement-tree: 1
12921        @@@test:domTree:        @@@test:domTree:
12922          document {          document {
12923            document-type {            document-type {
# Line 12811  ClsDef: Line 12942  ClsDef:
12942            <!ENTITY quot   "&#34;">            <!ENTITY quot   "&#34;">
12943            <!ENTITY e      "f">            <!ENTITY e      "f">
12944            ]><a>&lt;&gt;&amp;&apos;&quot;</a>            ]><a>&lt;&gt;&amp;&apos;&quot;</a>
12945          @@@cfg:entity-replacement-tree: 1
12946        @@@c:erred: <[[xp|error-malformed-predefined-entity]]> { (2, 1)..(2, 24); }        @@@c:erred: <[[xp|error-malformed-predefined-entity]]> { (2, 1)..(2, 24); }
12947        @@@c:erred: <[[xp|error-malformed-predefined-entity]]> { (4, 1)..(4, 24); }        @@@c:erred: <[[xp|error-malformed-predefined-entity]]> { (4, 1)..(4, 24); }
12948        @@@test:domTree:        @@@test:domTree:
# Line 12837  ClsDef: Line 12969  ClsDef:
12969            <!ENTITY quot   "5">            <!ENTITY quot   "5">
12970            <!ENTITY e      "f">            <!ENTITY e      "f">
12971            ]><a>&lt;&gt;&amp;&apos;&quot;</a>            ]><a>&lt;&gt;&amp;&apos;&quot;</a>
12972          @@@cfg:entity-replacement-tree: 1
12973        @@@c:erred: <[[xp|error-malformed-predefined-entity]]> { (2, 1)..(2, 24); }        @@@c:erred: <[[xp|error-malformed-predefined-entity]]> { (2, 1)..(2, 24); }
12974        @@@c:erred: <[[xp|error-malformed-predefined-entity]]> { (3, 1)..(3, 24); }        @@@c:erred: <[[xp|error-malformed-predefined-entity]]> { (3, 1)..(3, 24); }
12975        @@@c:erred: <[[xp|error-malformed-predefined-entity]]> { (4, 1)..(4, 24); }        @@@c:erred: <[[xp|error-malformed-predefined-entity]]> { (4, 1)..(4, 24); }
# Line 12866  ClsDef: Line 12999  ClsDef:
12999            <!ENTITY quot   SYSTEM "5">            <!ENTITY quot   SYSTEM "5">
13000            <!ENTITY e      "f">            <!ENTITY e      "f">
13001            ]><a>&lt;&gt;&amp;&apos;&quot;</a>            ]><a>&lt;&gt;&amp;&apos;&quot;</a>
13002          @@@cfg:entity-replacement-tree: 1
13003        @@@c:erred: <[[xp|error-internal-predefined-entity]]> { (2, 1)..(2, 27); }        @@@c:erred: <[[xp|error-internal-predefined-entity]]> { (2, 1)..(2, 27); }
13004        @@@c:erred: <[[xp|error-internal-predefined-entity]]> { (3, 1)..(3, 27); }        @@@c:erred: <[[xp|error-internal-predefined-entity]]> { (3, 1)..(3, 27); }
13005        @@@c:erred: <[[xp|error-internal-predefined-entity]]> { (4, 1)..(4, 27); }        @@@c:erred: <[[xp|error-internal-predefined-entity]]> { (4, 1)..(4, 27); }
# Line 12895  ClsDef: Line 13029  ClsDef:
13029            <!ENTITY % quot   SYSTEM "5">            <!ENTITY % quot   SYSTEM "5">
13030            <!ENTITY e      "f">            <!ENTITY e      "f">
13031            ]><a>&lt;&gt;&amp;&apos;&quot;</a>            ]><a>&lt;&gt;&amp;&apos;&quot;</a>
13032          @@@cfg:entity-replacement-tree: 1
13033        @@@test:domTree:        @@@test:domTree:
13034          document {          document {
13035            document-type {            document-type {
# Line 12919  ClsDef: Line 13054  ClsDef:
13054            <!ENTITY quot   "&#x22;">            <!ENTITY quot   "&#x22;">
13055            <!ENTITY e      "f">            <!ENTITY e      "f">
13056            ]><a>&lt;&gt;&amp;&apos;&quot;</a>            ]><a>&lt;&gt;&amp;&apos;&quot;</a>
13057          @@@cfg:entity-replacement-tree: 1
13058        @@@test:domTree:        @@@test:domTree:
13059          document {          document {
13060            document-type {            document-type {
# Line 12943  ClsDef: Line 13079  ClsDef:
13079            <!ENTITY quot   "&#x22;">            <!ENTITY quot   "&#x22;">
13080            <!ENTITY e      "f">            <!ENTITY e      "f">
13081            ]><a>&lt;&gt;&amp;&apos;&quot;</a>            ]><a>&lt;&gt;&amp;&apos;&quot;</a>
13082          @@@cfg:entity-replacement-tree: 1
13083        @@@test:domTree:        @@@test:domTree:
13084          document {          document {
13085            document-type {            document-type {
# Line 12967  ClsDef: Line 13104  ClsDef:
13104            <!ENTITY quot   "&#x0022;">            <!ENTITY quot   "&#x0022;">
13105            <!ENTITY e      "f">            <!ENTITY e      "f">
13106            ]><a>&lt;&gt;&amp;&apos;&quot;</a>            ]><a>&lt;&gt;&amp;&apos;&quot;</a>
13107          @@@cfg:entity-replacement-tree: 1
13108        @@@test:domTree:        @@@test:domTree:
13109          document {          document {
13110            document-type {            document-type {
# Line 12991  ClsDef: Line 13129  ClsDef:
13129            <!ENTITY quot   "&#0034;">            <!ENTITY quot   "&#0034;">
13130            <!ENTITY e      "f">            <!ENTITY e      "f">
13131            ]><a>&lt;&gt;&amp;&apos;&quot;</a>            ]><a>&lt;&gt;&amp;&apos;&quot;</a>
13132          @@@cfg:entity-replacement-tree: 1  
13133        @@@test:domTree:        @@@test:domTree:
13134          document {          document {
13135            document-type {            document-type {
# Line 13065  ClsDef: Line 13204  ClsDef:
13204              }              }
13205              general-entity-reference {              general-entity-reference {
13206                node-name: 'e';                node-name: 'e';
13207                is-expanded: false;                manakai-expanded: false;
13208              }              }
13209            }            }
13210          }          }
# Line 14899  ClsDef: Line 15038  ClsDef:
15038        @@@DEnt:        @@@DEnt:
15039          @@@@test:value:          @@@@test:value:
15040            <p xml:id="idv"/>            <p xml:id="idv"/>
15041          @@@cfg:xml-id: 1
15042        @@@test:domTree:        @@@test:domTree:
15043          document {          document {
15044            element {            element {
# Line 14912  ClsDef: Line 15052  ClsDef:
15052            }            }
15053          }          }
15054      @@XMLTest:      @@XMLTest:
15055          @@@QName: xp.xmlid.attr.disabled.test
15056          @@@DEnt:
15057            @@@@test:value:
15058              <p xml:id="idv"/>
15059          @@@cfg:xml-id: 0
15060          @@@test:domTree:
15061            document {
15062              element {
15063                attribute {
15064                  node-name: 'xml:id';
15065                  value: 'idv';
15066                  schema-type-info: TypeInfo (null, null);
15067                  specified: true;
15068                }
15069              }
15070            }
15071        @@XMLTest:
15072        @@@QName: xp.xmlid.attr.norm.test        @@@QName: xp.xmlid.attr.norm.test
15073        @@@DEnt:        @@@DEnt:
15074          @@@@test:value:          @@@@test:value:
15075            <p xml:id=" $u000Aidv  "/>            <p xml:id=" $u000Aidv  "/>
15076          @@@cfg:xml-id: 1
15077        @@@test:domTree:        @@@test:domTree:
15078          document {          document {
15079            element {            element {
# Line 14929  ClsDef: Line 15087  ClsDef:
15087            }            }
15088          }          }
15089      @@XMLTest:      @@XMLTest:
15090          @@@QName: xp.xmlid.attr.norm.disabled.test
15091          @@@DEnt:
15092            @@@@test:value:
15093              <p xml:id=" $u000Aidv  "/>
15094          @@@cfg:xml-id: 0
15095          @@@test:domTree:
15096            document {
15097              element {
15098                attribute {
15099                  node-name: 'xml:id';
15100                  value: '  idv  ';
15101                  schema-type-info: TypeInfo (null, null);
15102                  specified: true;
15103                }
15104              }
15105            }
15106        @@XMLTest:
15107        @@@QName: xp.xmlid.attrdef.test        @@@QName: xp.xmlid.attrdef.test
15108        @@@DEnt:        @@@DEnt:
15109          @@@@test:value:          @@@@test:value:
# Line 14936  ClsDef: Line 15111  ClsDef:
15111              <!ATTLIST p xml:id ID #IMPLIED>              <!ATTLIST p xml:id ID #IMPLIED>
15112            ]>            ]>
15113            <p/>            <p/>
15114          @@@cfg:xml-id: 1
15115          @@@test:domTree:
15116            document {
15117              document-type {
15118                element-type-definition {
15119                  node-name: 'p';
15120                  attribute-definition {
15121                    node-name: 'xml:id';
15122                    declared-type: const (ID_ATTR);
15123                    default-type: const (IMPLIED_DEFAULT);
15124                  }
15125                }
15126              }
15127              element { }
15128            }
15129        @@XMLTest:
15130          @@@QName: xp.xmlid.attrdef.disabled.test
15131          @@@DEnt:
15132            @@@@test:value:
15133              <!DOCTYPE p [
15134                <!ATTLIST p xml:id ID #IMPLIED>
15135              ]>
15136              <p/>
15137          @@@cfg:xml-id: 0
15138        @@@test:domTree:        @@@test:domTree:
15139          document {          document {
15140            document-type {            document-type {
# Line 14958  ClsDef: Line 15157  ClsDef:
15157              <!ATTLIST p xml:id ID "idv"><!-- invalid -->              <!ATTLIST p xml:id ID "idv"><!-- invalid -->
15158            ]>            ]>
15159            <p/>            <p/>
15160          @@@cfg:xml-id: 1
15161        @@@test:domTree:        @@@test:domTree:
15162          document {          document {
15163            document-type {            document-type {
# Line 14981  ClsDef: Line 15181  ClsDef:
15181              }              }
15182            }            }
15183          }          }
15184        @@XMLTest:
15185          @@@QName: xp.xmlid.attrdef.defaultattr.disabled.test
15186          @@@DEnt:
15187            @@@@test:value:
15188              <!DOCTYPE p [
15189                <!ATTLIST p xml:id ID "idv"><!-- invalid -->
15190              ]>
15191              <p/>
15192          @@@cfg:xml-id: 0
15193          @@@test:domTree:
15194            document {
15195              document-type {
15196                element-type-definition {
15197                  node-name: 'p';
15198                  attribute-definition {
15199                    node-name: 'xml:id';
15200                    declared-type: const (ID_ATTR);
15201                    default-type: const (EXPLICIT_DEFAULT);
15202                    node-value: 'idv';
15203                  }
15204                }
15205              }
15206              element {
15207                attribute {
15208                  node-name: 'xml:id';
15209                  schema-type-info: TypeInfo ('http://www.w3.org/TR/REC-xml',
15210                                              'ID');
15211                  value: 'idv';
15212                  specified: false;
15213                }
15214              }
15215            }
15216    
15217        @@XMLTest:
15218          @@@QName: xp.general.entity.unused.1.test
15219          @@@DEnt:
15220            @@@@test:value:
15221              <!DOCTYPE p [
15222                <!ENTITY mylt "<">
15223              ]>
15224              <p/>
15225          @@@cfg:entity-replacement-tree: 0
15226          @@@test:domTree:
15227            document {
15228              document-type {
15229                general-entity {
15230                  node-name: 'mylt';
15231                }
15232              }
15233              element { }
15234            }
15235        @@XMLTest:
15236          @@@QName: xp.general.entity.unused.2.test
15237          @@@DEnt:
15238            @@@@test:value:
15239              <!DOCTYPE p [
15240                <!ENTITY mylt "<">
15241              ]>
15242              <p/>
15243          @@@cfg:entity-replacement-tree: 1
15244          @@@c:erred: <[[xp|wf-syntax-error]]> { (1, 1)..(1, 2); }
15245    
15246        @@XMLTest:
15247          @@@QName: xp.dtdecl.readonly.test
15248          @@@DEnt:
15249            @@@@test:value:
15250              <!DOCTYPE p>
15251              <p/>
15252          @@@test:domTree:
15253            document {
15254              document-type {
15255                manakai-read-only: true;
15256              }
15257              element {
15258                manakai-read-only: false;
15259              }
15260              manakai-read-only: false;
15261            }
15262        @@XMLTest:
15263          @@@QName: xp.entity.decl.readonly.1.test
15264          @@@DEnt:
15265            @@@@test:value:
15266              <!DOCTYPE p [
15267                <!ENTITY ent "val">
15268              ]>
15269              <p/>
15270          @@@cfg:entity-replacement-tree: 1
15271          @@@test:domTree:
15272            document {
15273              document-type {
15274                general-entity {
15275                  node-name: 'ent';
15276                  manakai-read-only: true;
15277                  has-replacement-tree: true;
15278                }
15279                manakai-read-only: true;
15280              }
15281              element {
15282                manakai-read-only: false;
15283              }
15284              manakai-read-only: false;
15285            }
15286        @@XMLTest:
15287          @@@QName: xp.entity.decl.readonly.2.test
15288          @@@DEnt:
15289            @@@@test:value:
15290              <!DOCTYPE p [
15291                <!ENTITY ent "val">
15292              ]>
15293              <p/>
15294          @@@test:domTree:
15295            document {
15296              document-type {
15297                general-entity {
15298                  node-name: 'ent';
15299                  manakai-read-only: true;
15300                }
15301                manakai-read-only: true;
15302              }
15303              element {
15304                manakai-read-only: false;
15305              }
15306              manakai-read-only: false;
15307            }
15308        @@XMLTest:
15309          @@@QName: xp.notation.decl.readonly.test
15310          @@@DEnt:
15311            @@@@test:value:
15312              <!DOCTYPE p [
15313                <!NOTATION ent SYSTEM "val">
15314              ]>
15315              <p/>
15316          @@@test:domTree:
15317            document {
15318              document-type {
15319                notation {
15320                  node-name: 'ent';
15321                  manakai-read-only: true;
15322                }
15323                manakai-read-only: true;
15324              }
15325              element {
15326                manakai-read-only: false;
15327              }
15328              manakai-read-only: false;
15329            }
15330        @@XMLTest:
15331          @@@QName: xp.dtd.pi.readonly.test
15332          @@@DEnt:
15333            @@@@test:value:
15334              <!DOCTYPE p [
15335                <?pi content?>
15336              ]>
15337              <p/>
15338          @@@test:domTree:
15339            document {
15340              document-type {
15341                pi {
15342                  node-name: 'pi';
15343                  manakai-read-only: true;
15344                }
15345                manakai-read-only: true;
15346              }
15347              element {
15348                manakai-read-only: false;
15349              }
15350              manakai-read-only: false;
15351            }
15352        @@XMLTest:
15353          @@@QName: xp.dtd.attlist.decl.readonly.test
15354          @@@DEnt:
15355            @@@@test:value:
15356              <!DOCTYPE p [
15357                <!ATTLIST p
15358                  attr CDATA #IMPLIED
15359                >
15360              ]>
15361              <p/>
15362          @@@test:domTree:
15363            document {
15364              document-type {
15365                element-type-definition {
15366                  node-name: 'p';
15367                  attribute-definition {
15368                    node-name: 'attr';
15369                    manakai-read-only: true;
15370                  }
15371                  manakai-read-only: true;
15372                }
15373                manakai-read-only: true;
15374              }
15375              element {
15376                manakai-read-only: false;
15377              }
15378              manakai-read-only: false;
15379            }
15380        @@XMLTest:
15381          @@@QName: xp.general.entity.reference.readonly.1.test
15382          @@@DEnt:
15383            @@@@test:value:
15384              <!DOCTYPE p [
15385                <!ENTITY ent "val">
15386              ]>
15387              <p>&ent;</p>
15388          @@@test:domTree:
15389            document {
15390              document-type {
15391                general-entity {
15392                  node-name: 'ent';
15393                  manakai-read-only: true;
15394                }
15395                manakai-read-only: true;
15396              }
15397              element {
15398                general-entity-reference {
15399                  text {
15400                    manakai-read-only: true;
15401                  }
15402                  manakai-read-only: true;
15403                }
15404                manakai-read-only: false;
15405              }
15406              manakai-read-only: false;
15407            }
15408        @@XMLTest:
15409          @@@QName: xp.general.entity.reference.readonly.2.test
15410          @@@DEnt:
15411            @@@@test:value:
15412              <!DOCTYPE p [
15413                <!ENTITY ent "val">
15414              ]>
15415              <p attr="&ent;"/>
15416          @@@test:domTree:
15417            document {
15418              document-type {
15419                general-entity {
15420                  node-name: 'ent';
15421                  manakai-read-only: true;
15422                }
15423                manakai-read-only: true;
15424              }
15425              element {
15426                attribute {
15427                  node-name: 'attr';
15428                  general-entity-reference {
15429                    text {
15430                      manakai-read-only: true;
15431                    }
15432                    manakai-read-only: true;
15433                  }
15434                  manakai-read-only: false;
15435                }
15436                manakai-read-only: false;
15437              }
15438              manakai-read-only: false;
15439            }
15440        @@XMLTest:
15441          @@@QName: xp.general.entity.reference.readonly.3.test
15442          @@@DEnt:
15443            @@@@test:value:
15444              <!DOCTYPE p [
15445                <!ENTITY ent1 "val">
15446                <!ENTITY ent2 "&ent1;">
15447              ]>
15448              <p>&ent2;</p>
15449          @@@test:domTree:
15450            document {
15451              document-type {
15452                general-entity {
15453                  node-name: 'ent1';
15454                  manakai-read-only: true;
15455                }
15456                general-entity {
15457                  node-name: 'ent2';
15458                  manakai-read-only: true;
15459                }
15460                manakai-read-only: true;
15461              }
15462              element {
15463                general-entity-reference {
15464                  general-entity-reference {
15465                    text {
15466                      manakai-read-only: true;
15467                    }
15468                    manakai-read-only: true;
15469                  }
15470                  manakai-read-only: true;
15471                }
15472                manakai-read-only: false;
15473              }
15474              manakai-read-only: false;
15475            }
15476    
15477      @@PerlDef:      @@PerlDef:
15478        my $impl = $Message::DOM::ImplementationRegistry->get_implementation ({        my $impl = $Message::DOM::ImplementationRegistry->get_implementation ({
# Line 14988  ClsDef: Line 15480  ClsDef:
15480          'XML' => '3.0',          'XML' => '3.0',
15481          'XMLVersion' => ['1.0', '1.1'],          'XMLVersion' => ['1.0', '1.1'],
15482        });        });
       my $parser = <Class::ManakaiXMLParser>->new ($impl);  
15483    
15484        for my $test_data (@$TestData) {        for my $test_data (@$TestData) {
15485            my $parser = <Class::ManakaiXMLParser>->new ($impl);
15486    
15487          $test->start_new_test ($test_data->{uri});          $test->start_new_test ($test_data->{uri});
15488          my $doc_ent = $test_data->{entity}->{$test_data->{root_uri}};          my $doc_ent = $test_data->{entity}->{$test_data->{root_uri}};
15489          my $not_ok;          my $not_ok;
15490    
15491          $parser->dom_config->set_parameter ('error-handler' => sub ($$) {          ## -- DOM Configuration Parameters
15492    
15493            my $pcfg = $parser->dom_config;
15494            for (keys %{$test_data->{dom_config}}) {
15495              $pcfg->set_parameter ($_ => $test_data->{dom_config}->{$_});
15496            }
15497    
15498            $pcfg->set_parameter ('error-handler' => sub ($$) {
15499            my (undef, $err) = @_;            my (undef, $err) = @_;
15500            my $err_type = $err->type;            my $err_type = $err->type;
15501            if ($test_data->{dom_error}->{$err_type}) {            if ($test_data->{dom_error}->{$err_type}) {
# Line 15013  ClsDef: Line 15513  ClsDef:
15513            return true; # continue as far as possible            return true; # continue as far as possible
15514          });          });
15515    
15516            ## -- Input Data
15517    
15518          my $input = {string_data => \$doc_ent->{<Q::test:value>},          my $input = {string_data => \$doc_ent->{<Q::test:value>},
15519                       system_id => $doc_ent->{<Q::test:uri>},                       system_id => $doc_ent->{<Q::test:uri>},
15520                       base_uri => $doc_ent->{<Q::test:baseURI>}};                       base_uri => $doc_ent->{<Q::test:baseURI>}};
15521    
15522            ## -- Test and Result
15523    
15524          if ($test_data->{dom_tree}) { # Successful test          if ($test_data->{dom_tree}) { # Successful test
15525              my $doc;
15526            try {            try {
15527              my $doc = $parser->parse ($input);              $doc = $parser->parse ($input);
15528              $test->assert_dom_tree_equals              $test->assert_dom_tree_equals
15529                       (actual_value => $doc,                       (actual_value => $doc,
15530                        expected_hash => $test_data->{dom_tree});                        expected_hash => $test_data->{dom_tree});
# Line 15031  ClsDef: Line 15537  ClsDef:
15537                }                }
15538              }              }
15539              $not_ok ? $test->not_ok : $test->ok;              $not_ok ? $test->not_ok : $test->ok;
15540                undef $doc;
15541            } catch Message::Util::IF::DTException with {            } catch Message::Util::IF::DTException with {
15542              #              require 'manakai/mndebug.pl';
15543                manakai::mndebug::dump ($doc);
15544            } catch Message::DOM::IF::LSException with {            } catch Message::DOM::IF::LSException with {
15545              # not_ok              # not_ok
15546            } otherwise {            } otherwise {
# Line 15041  ClsDef: Line 15549  ClsDef:
15549              $test->not_ok;              $test->not_ok;
15550            };            };
15551          } else {          } else {
15552              my $doc;
15553            try {            try {
15554              my $doc = $parser->parse ($input);              $doc = $parser->parse ($input);
15555            } catch Message::Util::IF::DTException with {            } catch Message::Util::IF::DTException with {
15556                require 'manakai/mndebug.pl';
15557                manakai::mndebug::dump ($doc);
15558              } catch Message::DOM::IF::LSException with {
15559              #              #
15560              } otherwise {
15561                my $err = shift;
15562                warn $err;
15563                $test->not_ok;
15564              };
15565              for (values %{$test_data->{dom_error}||{}}) {
15566                if (@$_) {
15567                  $test->failure_comment
15568                           (@$_.' |DOMError|s of type |'.
15569                            $_->[0]->{type}->{value}.'| are not reported');
15570                  $not_ok = true;
15571                }
15572              }
15573              $not_ok ? $test->not_ok : $test->ok;
15574            }
15575          }
15576    
15577      @XMLTests:
15578        @@QName: xp.byteStream.tests
15579        
15580        @@XMLTest:
15581          @@@QName: xp.labeled.utf-8.test
15582          @@@DEnt:
15583            @@@@xp:encoding: utf-8
15584            @@@@test:value:
15585              <p/>
15586          @@@test:domTree:
15587            document {
15588              input-encoding: 'utf-8';
15589              xml-encoding: null;
15590              element {
15591                node-name: 'p';
15592              }
15593            }
15594        @@XMLTest:
15595          @@@QName: xp.labeled.utf-16.be.test
15596          @@@DEnt:
15597            @@@@xp:encoding: utf-16
15598            @@@@test:value:
15599              $u00FE$u00FF$u0000<$u0000p$u0000/$u0000>
15600          @@@test:domTree:
15601            document {
15602              xml-encoding: null;
15603              input-encoding: 'utf-16';
15604              element {
15605                node-name: 'p';
15606              }
15607            }
15608        @@XMLTest:
15609          @@@QName: xp.labeled.utf-16.le.test
15610          @@@DEnt:
15611            @@@@xp:encoding: utf-16
15612            @@@@test:value:
15613              $u00FF$u00FE<$u0000p$u0000/$u0000>$u0000
15614          @@@test:domTree:
15615            document {
15616              xml-encoding: null;
15617              input-encoding: 'utf-16';
15618              element {
15619                node-name: 'p';
15620              }
15621            }
15622        @@XMLTest:
15623          @@@QName: xp.labeled.utf-16.nobom.test
15624          @@@DEnt:
15625            @@@@xp:encoding: utf-16
15626            @@@@test:value:
15627              <$u0000p$u0000/$u0000>$u0000
15628          @@@c:erred: <[[xp|fatal-utf-16-no-bom]]> {}
15629        @@XMLTest:
15630          @@@QName: xp.labeled.unknown.test
15631          @@@DEnt:
15632            @@@@xp:encoding: x-unknown-encoding-name
15633            @@@@test:value:
15634              <p/>
15635          @@@c:erred: <[[xp|fatal-unprocessable-encoding]]> {}
15636        @@XMLTest:
15637          @@@QName: xp.unlabeled.encdecl.unknown.test
15638          @@@DEnt:
15639            @@@@test:value:
15640              <?xml version="1.0" encoding="x-unknown-encoding-name"?>
15641              <p/>
15642    #      @@@c:erred: <[[xp|fatal-unprocessable-encoding]]> {}
15643          @@@c:erred: <[[xp|fatal-encoding-mismatch]]> {}
15644        @@XMLTest:
15645          @@@QName: xp.labeled.utf-8.illegal.test
15646          @@@DEnt:
15647            @@@@xp:encoding: utf-8
15648            @@@@test:value:
15649              <p/$u00A0>
15650          @@@c:erred: <[[xp|fatal-illegal-byte-sequence]]> {}
15651        @@XMLTest:
15652          @@@QName: xp.unlabeled.encdecl.utf-8.illegal.test
15653          @@@DEnt:
15654            @@@@test:value:
15655              <?xml version="1.0" encoding="utf-8"?>
15656              <p/$u00A0>
15657          @@@c:erred: <[[xp|fatal-illegal-byte-sequence]]> {}
15658        @@XMLTest:
15659          @@@QName: xp.unlabeled.utf-8.illegal.test
15660          @@@DEnt:
15661            @@@@test:value:
15662              <p/$u00A0>
15663          @@@c:erred: <[[xp|fatal-illegal-byte-sequence]]> {}
15664        @@XMLTest:
15665          @@@QName: xp.mismatch.encdecl-as-utf-16.utf-8.test
15666          @@@DEnt:
15667            @@@@test:value:
15668              <?xml version="1.0" encoding="utf-16"?>
15669              <p/>
15670          @@@c:erred: <[[xp|fatal-encoding-mismatch]]> {}
15671        @@XMLTest:
15672          @@@QName: xp.mismatch.labeled-as-utf-16.utf-8.test
15673          @@@DEnt:
15674            @@@@xp:encoding: utf-16
15675            @@@@test:value:
15676              <p/>
15677          @@@c:erred: <[[xp|fatal-utf-16-no-bom]]> {}
15678        @@XMLTest:
15679          @@@QName: xp.labeled-as-utf-8.encdecl-utf-16.test
15680          @@@DEnt:
15681            @@@@xp:encoding: utf-8
15682            @@@@test:value:
15683              <?xml version="1.0" encoding="utf-16"?>
15684              <p/>
15685          @@@test:domTree:
15686            document {
15687              xml-encoding: 'utf-16';
15688              input-encoding: 'utf-8';
15689              element { }
15690            }
15691    
15692        @@PerlDef:
15693          my $impl = $Message::DOM::ImplementationRegistry->get_implementation ({
15694            'Core' => '3.0',
15695            'XML' => '3.0',
15696            'XMLVersion' => ['1.0', '1.1'],
15697          });
15698    
15699          for my $test_data (@$TestData) {
15700            my $parser = <Class::ManakaiXMLParser>->new ($impl);
15701    
15702            $test->start_new_test ($test_data->{uri});
15703            my $doc_ent = $test_data->{entity}->{$test_data->{root_uri}};
15704            my $not_ok;
15705    
15706            ## -- DOM Configuration Parameters
15707    
15708            my $pcfg = $parser->dom_config;
15709            for (keys %{$test_data->{dom_config}}) {
15710              $pcfg->set_parameter ($_ => $test_data->{dom_config}->{$_});
15711            }
15712    
15713            $pcfg->set_parameter ('error-handler' => sub ($$) {
15714              my (undef, $err) = @_;
15715              my $err_type = $err->type;
15716              if ($test_data->{dom_error}->{$err_type}) {
15717                $test->assert_error_equals
15718                         (actual_value => $err,
15719                          expected_hash => shift @{$test_data->{dom_error}
15720                                                             ->{$err_type}});
15721              } else { # Uncatched error
15722                warn $err;
15723                unless ($err->severity == <C::c|DOMError.SEVERITY_WARNING>) {
15724                  $test->failure_comment ('Unexpected error |'.$err->type.'|');
15725                  $not_ok = true;
15726                }
15727              }
15728              return false;
15729            });
15730    
15731            ## -- Input Data
15732    
15733            open my $byte, '<', \$doc_ent->{<Q::test|value>};
15734            my $input = {byte_stream => $byte,
15735                         system_id => $doc_ent->{<Q::test:uri>},
15736                         base_uri => $doc_ent->{<Q::test:baseURI>},
15737                         encoding => $doc_ent->{<Q::xp|encoding>}};
15738    
15739            ## -- Test and Result
15740    
15741            if ($test_data->{dom_tree}) { # Successful test
15742              my $doc;
15743              try {
15744                $doc = $parser->parse ($input);
15745                $test->assert_dom_tree_equals
15746                         (actual_value => $doc,
15747                          expected_hash => $test_data->{dom_tree});
15748                for (values %{$test_data->{dom_error}||{}}) {
15749                  if (@$_) {
15750                    $test->failure_comment
15751                             (@$_.' |DOMError|s of type |'.
15752                              $_->[0]->{type}->{value}.'| are not reported');
15753                    $not_ok = true;
15754                  }
15755                }
15756                $not_ok ? $test->not_ok : $test->ok;
15757                undef $doc;
15758              } catch Message::Util::IF::DTException with {
15759                require 'manakai/mndebug.pl';
15760                manakai::mndebug::dump ($doc);
15761              } catch Message::DOM::IF::LSException with {
15762                # not_ok
15763              } otherwise {
15764                my $err = shift;
15765                warn $err;
15766                $test->not_ok;
15767              };
15768            } else {
15769              my $doc;
15770              try {
15771                $doc = $parser->parse ($input);
15772              } catch Message::Util::IF::DTException with {
15773                require 'manakai/mndebug.pl';
15774                manakai::mndebug::dump ($doc);
15775            } catch Message::DOM::IF::LSException with {            } catch Message::DOM::IF::LSException with {
15776              #              #
15777            } otherwise {            } otherwise {
# Line 15064  ClsDef: Line 15791  ClsDef:
15791          }          }
15792        }        }
15793    
15794    
15795    @ResourceDef:    @ResourceDef:
15796      @@QName: getEmptyEntityState      @@QName: getEmptyEntityState
15797      @@rdf:type: DISPerl|InlineCode      @@rdf:type: DISPerl|InlineCode
# Line 15652  WarnDef: Line 16380  WarnDef:
16380      @@enDesc:      @@enDesc:
16381        The name of the attribute.        The name of the attribute.
16382    
16383    FatalErrDef:
16384      @QName: xp|fatal-illegal-byte-sequence
16385      @enDesc:
16386        An XML entity is determined to be in a certain encoding but
16387        contains byte sequences that are not legal in that encoding.
16388      @enMufDef:
16389        Illegal byte sequence
16390      @enImplNote: dump
16391      @ecore:hasParameter: xp|byte-sequence
16392      @ecore:hasParameter: xp|code-state
16393    
16394    XWParam:
16395      @QName: xp|byte-sequence
16396      @enDesc:
16397        A reference to the byte string that contains an error.
16398    
16399    XWParam:
16400      @QName: xp|code-state
16401      @enDesc:
16402        A string that identifies the state defined in the coded character set
16403        in which an error is encoutnered.
16404    
16405    WarnDef:
16406      @QName: xp|warning-unassigned-code-point
16407      @enDesc:
16408        If the entity contains an unassigned code point.
16409      @enMufDef:
16410        Unassigned code point found
16411      @enImplNote: dump
16412      @ecore:hasParameter: xp|byte-sequence
16413    
16414    FatalErrDef:
16415      @QName: xp|fatal-unprocessable-encoding
16416      @enDesc:
16417        When an XML processor encounters an entity with an encoding
16418        that is unable to process.
16419      @enMufDef:
16420        Encoding <%p (name => {<Q::xp|charset-uri>});>
16421        %p (name => {<Q::xp|encoding>}, prefix => {(}, suffix => {) });is
16422        not supported
16423      @ecore:hasParameter: xp|encoding
16424      @ecore:hasParameter: xp|charset-uri
16425    
16426    XWParam:
16427      @QName: xp|encoding
16428      @enDesc:
16429        The XML name of the encoding.
16430      @multipleProperties: DISCore|Single
16431      @dataType: DISCore|String
16432      @DISCore:resourceType: DISSource|ResourceProperty
16433    
16434    XWParam:
16435      @QName: xp|charset-uri
16436      @enDesc:
16437        The URI that identifies the encoding.
16438    
16439    FatalErrDef:
16440      @QName: xp|fatal-utf-16-no-bom
16441      @enDesc:
16442        If the encoding of an entity is UTF-16 but it does not
16443        contains <CHAR::BOM>.
16444      @enMufDef:
16445        The entity contains no BOM
16446    
16447    FatalErrDef:
16448      @QName: xp|fatal-encoding-mismatch
16449      @enDesc:
16450        If an entity including an encoding declaration
16451        in an encoding other than that named in the declaration.
16452      @enMufDef:
16453        The entity is labeled as <%p (name => {<Q::xp|charset-uri>});>
16454        %p (name => {<Q::xp|encoding>}, prefix => {(}, suffix => {) });but
16455        it is wrong
16456      @ecore:hasParameter: xp|encoding
16457      @ecore:hasParameter: xp|charset-uri
16458    
16459    WarnDef:
16460      @QName: xp|warn-unknown-decode-error
16461      @enDesc:
16462        Unknown message from the decoder.
16463      @enMufDef:
16464        Encoding decoder error: <%p (name => {<Q::xp|error-type>});>
16465      @ecore:hasParameter: xp|error-type
16466      @ecore:hasParameter: xp|error-param
16467    
16468    XWParam:
16469      @QName: xp|error-type
16470      @enDesc:
16471        A DOM URI that identifies the error type.
16472    
16473    XWParam:
16474      @QName: xp|error-param
16475      @enDesc:
16476        A <Q::xp|error-type>-dependent set of error descriptions.
16477    
16478  NSFatalErrDef:  NSFatalErrDef:
16479    @QName: xp|nswf-legal-ncname    @QName: xp|nswf-legal-ncname
16480    @enDesc:    @enDesc:
# Line 16110  ElementTypeBinding: Line 16933  ElementTypeBinding:
16933        @@@@: c|DOMConfigurationParameter        @@@@: c|DOMConfigurationParameter
16934        @@@For: ManakaiDOM|DOM        @@@For: ManakaiDOM|DOM
16935      @@rdf:type:      @@rdf:type:
16936        @@@@: DISCore|Property        @@@@: DISSource|ResourceProperty
16937        @@@For: =ManakaiDOM|all        @@@For: =ManakaiDOM|all
16938      @@For: ManakaiDOM|DOM3      @@For: ManakaiDOM|DOM3
16939      @@For: =ManakaiDOM|all      @@For: =ManakaiDOM|all
16940        @@subsetOf:
16941          @@@@: c|anyDOMConfigurationParameter
16942          @@@For: =ManakaiDOM|all
16943        @@multipleProperties:
16944          @@@@: DISCore|Single
16945          @@@For: =ManakaiDOM|all
16946    
16947  ElementTypeBinding:  ElementTypeBinding:
16948    @Name: CParamApp    @Name: CParamApp
# Line 16125  ElementTypeBinding: Line 16954  ElementTypeBinding:
16954        @@@For: ManakaiDOM|DOM        @@@For: ManakaiDOM|DOM
16955      @@For: ManakaiDOM|DOM3      @@For: ManakaiDOM|DOM3
16956    
16957    ElementTypeBinding:
16958      @Name: boolCParam
16959      @ElementType:
16960        dis:ResourceDef
16961      @ShadowContent:
16962        @@DISCore:resourceType:
16963          @@@@: c|DOMConfigurationParameter
16964          @@@For: ManakaiDOM|DOM
16965        @@DISCore:resourceType:
16966          @@@@: DISSource|ResourceProperty
16967          @@@For: =ManakaiDOM|all
16968        @@For: ManakaiDOM|DOM3
16969        @@For: =ManakaiDOM|all
16970        @@Type: idl|boolean||ManakaiDOM|all
16971        @@subsetOf:
16972          @@@@: c|anyDOMConfigurationParameter
16973          @@@For: =ManakaiDOM|all
16974        @@multipleProperties:
16975          @@@@: DISCore|Single
16976          @@@For: =ManakaiDOM|all
16977        @@dataType:
16978          @@@@: DISCore|Boolean
16979          @@@For: =ManakaiDOM|all
16980    
16981  CParamApp:  CParamApp:
16982    @QName: xml-id    @QName: xml-id
16983    @c:domConfigurationParameter: cfg|xml-id    @c:domConfigurationParameter: cfg|xml-id
16984    @c:targetType: xp|ManakaiXMLParser    @c:targetType: xp|ManakaiXMLParser
16985      @TrueCase:
16986        @@c:isSupported: 1
16987      @FalseCase:
16988        @@c:isSupported: 1
16989    
16990  CParamApp:  CParamApp:
16991    @QName: error-handler    @QName: error-handler
16992    @c:domConfigurationParameter: c|error-handler    @c:domConfigurationParameter: c|error-handler
16993    @c:targetType: xp|ManakaiXMLParser    @c:targetType: xp|ManakaiXMLParser
16994    
16995    boolCParam:
16996      @QName: cfg|entity-replacement-tree
16997      @DOMLS:lsKey:
16998        @@@: erep
16999        @@For: =ManakaiDOM|all
17000      @Type: idl|boolean||ManakaiDOM|all
17001      @c:targetType: xp|ManakaiXMLParser
17002      @IsSupportRequired: 1
17003      @c:isSupported: 1
17004      @TrueCase:
17005        @@c:isSupported: 1
17006        @@enDesc:
17007          The parser <kwd:MUST> cnstruct the replacement subtree of
17008          a general parsed <IF::tx|Entity> node if the replacement text
17009          for the node is available.
17010    
17011          If this value is set to the parameter, then a fatal error
17012          might be reported even if the entire document is well-formed
17013          in case a general parsed entity has replacement text that is
17014          not well-formed when evaluated as if it has been referenced
17015          in the content of an element, except that undeclared namespace prefixes
17016          do not result in namespace well-formedness error.
17017      @FalseCase:
17018        @@IsDefault: 1
17019        @@c:isSupported: 1
17020        @@IsSupportRequired: 1
17021        @@enDesc:
17022          The parser don't have to construct <IF::tx|Entity> replacement
17023          subtrees.
17024    
17025      @Test:
17026        @@QName: cfg.entity-replacement-tree.test
17027        @@PerlDef:
17028          my $xp;
17029          __CODE{createParserForTest:: $xp => $xp}__;
17030          my $cfg = $xp-><AG::LSInput.domConfig>;
17031    
17032          my $pname = <Q::cfg|entity-replacement-tree>;
17033    
17034          $test->id ('default.false');
17035          $test->assert_false ($cfg-><M::c|DOMConfiguration.getParameter> ($pname));
17036      
17037          $test->id ('false.to.true');
17038          $cfg-><M::c|DOMConfiguration.setParameter> ($pname => true);
17039          $test->assert_false ($cfg-><M::c|DOMConfiguration.getParameter> ($pname));
17040          
17041          $test->id ('true.to.false');
17042          $cfg-><M::c|DOMConfiguration.setParameter> ($pname => false);
17043          $test->assert_false ($cfg-><M::c|DOMConfiguration.getParameter> ($pname));
17044    
17045          $test->id ('reset');
17046          $cfg-><M::c|DOMConfiguration.setParameter> ($pname => true);
17047          $cfg-><M::c|DOMConfiguration.setParameter> ($pname => null);
17048          $test->assert_false ($cfg-><M::c|DOMConfiguration.getParameter> ($pname));
17049    
17050  CParam:  CParam:
17051    @QName: xp|ls-input-to-input-file    @QName: xp|ls-input-to-input-file
17052    @DOMLS:lsKey:    @DOMLS:lsKey:
# Line 16159  CParam: Line 17071  CParam:
17071        @@@enDesc:        @@@enDesc:
17072          The default resolver.          The default resolver.
17073        @@@PerlDefC:        @@@PerlDefC:
17074            # resolveLSInput
17075          $r = sub {          $r = sub {
17076            my ($self, $input, $errorHandler) = @_;            my ($self, $impl, $input, $parser, $errorHandler) = @_;
17077            ## As defined in DOM Level 3 LS |LSInput| interface            ## As defined in DOM Level 3 LS |LSInput| interface
17078    
17079            my $r = {};            my $r = {};
# Line 16178  CParam: Line 17091  CParam:
17091                ## 2. |byteStream|                ## 2. |byteStream|
17092                $v = $input-><AG::LSInput.byteStream>;                $v = $input-><AG::LSInput.byteStream>;
17093                if (defined $v) {                if (defined $v) {
17094                  ## TODO: Support byte filehandle                  require Message::Charset::Encode;
17095                    ## |encoding|                  my $mceimpl = $impl-><M::f|GetFeature.getFeature>
17096                    ## TODO: How to guess?                                         (<Q::fe|MCEncode>, '1.0');
17097                  return null;                  my $encode = $input-><AG::LSInput.encoding>;
17098                    my $encode_uri = defined $encode
17099                                       ? $mceimpl-><M::mce|MCEncodeImplementation
17100                                                       .getURIFromCharsetName>
17101                                                 (<Q::cs|xmlName>, $encode)
17102                                       : <Q::xml-auto-charset:>;
17103                    $r->{filehandle} = $mceimpl-><M::mce|MCEncodeImplementation
17104                                                      .createMCDecodeHandle>
17105                                                ($encode_uri, $v, sub {
17106                      my ($self, $fh, $type, %opt) = @_;
17107                      my $continue = true;
17108                      if ($type eq <Q::cs|illegal-octets-error>) {
17109                        $continue = __c|ERROR{xp|fatal-illegal-byte-sequence::
17110                          xp|byte-sequence => {$opt{octets}},
17111                          ecore|object => {$parser},
17112                        }__;
17113                      } elsif ($type eq <Q::cs|unassigned-code-point-error>) {
17114                        $continue = __c|ERROR{xp|warning-unassigned-code-point::
17115                          xp|byte-sequence => {$opt{octets}},
17116                          ecore|object => {$parser},
17117                        }__;
17118                        $opt{octets} = \"\x{FFFD}";
17119                      } elsif ($type eq <Q::cs|invalid-state-error>) {
17120                        $continue = __c|ERROR{xp|fatal-illegal-byte-sequence::
17121                          xp|code-state => {$opt{state}},
17122                          ecore|object => {$parser},
17123                        }__;
17124                      } elsif ($type eq <Q::cs|charset-not-supported-error>) {
17125                        $continue = __c|ERROR{xp|fatal-unprocessable-encoding::
17126                          xp|encoding => {$encode},
17127                          xp|charset-uri => {$opt{charset_uri}},
17128                          ecore|object => {$parser},
17129                        }__;
17130                      } elsif ($type eq <Q::cs|no-bom-error>) {
17131                        if ($opt{charset_uri} eq <Q::cs|XML.utf-16>) {
17132                          $continue = __c|ERROR{xp|fatal-utf-16-no-bom::
17133                            ecore|object => {$parser},
17134                          }__;
17135                        } else {
17136                          $continue = __c|ERROR{xp|fatal-illegal-byte-sequence::
17137                            xp|code-state => 'bom',
17138                            ecore|object => {$parser},
17139                          }__;
17140                        }
17141                      } elsif ($type eq <Q::cs|charset-name-mismatch-error>) {
17142                        $continue = __c|ERROR{xp|fatal-encoding-mismatch::
17143                          xp|encoding => {$encode},
17144                          xp|charset-uri => {$opt{charset_uri}},
17145                          ecore|object => {$parser},
17146                        }__;
17147                      } else {
17148                        $continue = __c|ERROR{xp|warn-unknown-decode-error::
17149                          xp|error-type => {$type},
17150                          xp|error-param => {\%opt},
17151                          ecore|object => {$parser},
17152                        }__;
17153                      }
17154                      unless ($continue) {
17155                        __EXCEPTION{DOMLS|PARSE_ERR::
17156                          ecore|object => {$parser},
17157                        }__;
17158                      }
17159                    });
17160                    $r->{input_encoding}
17161                        = $r->{filehandle}-><AG::mce|MCDecodeHandle.inputEncoding>
17162                            if defined $r->{filehandle};
17163                    last FH;
17164                }                }
17165    
17166                ## 3. |stringData|                ## 3. |stringData|
# Line 16240  CParam: Line 17219  CParam:
17219                }                }
17220              } # BURI              } # BURI
17221    
17222                $r->{input_encoding} = $input-><AG::LSInput.encoding>
17223                    unless defined $r->{input_encoding};
17224    
17225            }__;            }__;
17226    
17227            ## ISSUE: Is |certifiedText| required by parsers?            ## ISSUE: Is |certifiedText| required by parsers?
# Line 16379  ClsDef: Line 17361  ClsDef:
17361      @@enDesc:      @@enDesc:
17362        Converts a <IF::LSInput> into a Perl filehandle.        Converts a <IF::LSInput> into a Perl filehandle.
17363      @@Param:      @@Param:
17364          @@@Name: impl
17365          @@@Type: f|MinimumImplementation
17366          @@@enDesc:
17367            The implementation object.
17368        @@Param:
17369        @@@Name: input        @@@Name: input
17370        @@@Type: LSInput        @@@Type: LSInput
17371        @@@enDesc:        @@@enDesc:
17372          The input.          The input.
17373      @@Param:      @@Param:
17374          @@@Name: parser
17375          @@@Type: LSParser
17376          @@@enDesc:
17377            The parser.
17378        @@Param:
17379        @@@Name: errorHandler        @@@Name: errorHandler
17380        @@@Type: c|DOMErrorHandler        @@@Type: c|DOMErrorHandler
17381        @@@enDesc:        @@@enDesc:
# Line 16403  ClsDef: Line 17395  ClsDef:
17395            }            }
17396        @@@PerlDef:        @@@PerlDef:
17397          __DEEP{          __DEEP{
17398            $r = $self->($self, $input, $errorHandler);            $r = $self->($self, $impl, $input, $parser, $errorHandler);
17399          }__;          }__;
17400        @@@enImplNote:        @@@enImplNote:
17401          Notet that the input / output processor for <CODE::$input>          Notet that the input / output processor for <CODE::$input>
# Line 16492  ClsDef: Line 17484  ClsDef:
17484      @@Set:      @@Set:
17485        @@@PerlDef: $self->{document_uri} = $given;        @@@PerlDef: $self->{document_uri} = $given;
17486    
17487      @Attr:
17488        @@Name: inputEncoding
17489        @@enDesc:
17490          The input encoding name.
17491        @@Type: DOMString
17492        @@nullCase:
17493          @@@enDesc:
17494            If the input encoding name is not available.
17495        @@Get:
17496          @@@PerlDef: $r = $self->{input_encoding};
17497        @@Set:
17498          @@@PerlDef: $self->{input_encoding} = $given;
17499    
17500    @Method:    @Method:
17501      @@Name: close      @@Name: close
17502      @@enDesc:      @@enDesc:
# Line 16512  ClsDef: Line 17517  ClsDef:
17517            if ($self->{close}) {            if ($self->{close}) {
17518              $self->{close}->($self);              $self->{close}->($self);
17519            } else {            } else {
17520              close $self->{filehandle};              $self->{filehandle}->close;
17521            }            }
17522          }__;          }__;
17523  ##ManakaiDOMInputFile  ##ManakaiDOMInputFile

Legend:
Removed from v.1.30  
changed lines
  Added in v.1.40

[email protected]
ViewVC Help
Powered by ViewVC 1.1.24