#!/usr/bin/perl ## This file is automatically generated ## at 2006-04-04T11:33:35+00:00, ## from file "../lib/Message/DOM/Document.dis", ## module , ## for . ## Don't edit by hand! use strict; require Message::DOM::DOMCore; require Message::DOM::Element; require Message::DOM::TreeCore; require Message::Util::Error::DOMException; package Message::DOM::Document; our $VERSION = 20060404.1133; package Message::DOM::IFLatest::Document; our $VERSION = 20060404.1133; package Message::DOM::Document::ManakaiDOMDocument; our $VERSION = 20060404.1133; push our @ISA, 'Message::DOM::TreeCore::ManakaiDOMNode', 'Message::DOM::IF::Document', 'Message::DOM::IF::Node', 'Message::DOM::IFLatest::Document', 'Message::DOM::IFLatest::Node', 'Message::DOM::IFLevel1::Document', 'Message::DOM::IFLevel1::Node', 'Message::DOM::IFLevel2::Document', 'Message::DOM::IFLevel2::Node', 'Message::DOM::IFLevel3::Document', 'Message::DOM::IFLevel3::Node'; use Char::Class::XML 'InXMLNCNameChar10', 'InXMLNCNameChar11', 'InXMLNCNameStartChar11', 'InXMLNameChar10', 'InXMLNameChar11', 'InXMLNameStartChar11', 'InXML_NCNameStartChar10', 'InXML_NameStartChar10'; sub ___create_node_stem ($$$$) { my ($self, $bag, $obj, $opt) = @_; my $r = {}; { $obj->{ 'child' } = []; $obj->{ 'do' } = {}; $obj->{ 'http://www.w3.org/2001/04/infoset#version' } = '1.0'; { $obj->{'impl'} = $opt->{'impl'}->{ 'id' }; $bag->{${$opt->{'impl'}->{ 'id' }}} ->{'lpmi'}->{${$obj->{ 'id' }}} = $obj->{ 'id' }; } ; $r = $obj; } $r} sub ___create_node_ref ($$$) { my ($self, $obj, $opt) = @_; my $r; { my $class; CLS: { if (defined $opt->{ 'nrcls' }) { $class = $opt->{ 'nrcls' }; IFCHK: { for (@{$opt->{ 'nrifs' } or []}) { last IFCHK unless $$class->isa ($_); } last CLS; } # IFCHK } { $class = $obj->{ 'b' }->{${$obj->{ 'id' }}} ->{'dnrcls'}; } ; if (defined $class) { IFCHK: { for (@{$opt->{ 'nrifs' } or []}) { last IFCHK unless $$class->isa ($_); } last CLS; } # IFCHK } my $cns; { $cns = $obj->{ 'b' }->{${$obj->{ 'id' }}} ->{'child'}; } ; my $bag = $obj->{'b'} ; my $deh; DC: for my $cnid (@$cns) { my $cnh = { 'id' => $cnid, 'b' => $bag, } ; my $cncls; { $cncls = $cnh->{ 'b' }->{${$cnh->{ 'id' }}} ->{'cls'}; } ; if ($$cncls eq 'Message::DOM::Element::ManakaiDOMElement' ) { $deh = $cnh; last DC; } } # DC my $dens; my $deln; if (defined $deh) { { $dens = $deh->{ 'b' }->{${$deh->{ 'id' }}} ->{'ns'}; } ; $dens = \'' unless defined $dens; { $deln = $deh->{ 'b' }->{${$deh->{ 'id' }}} ->{'ln'}; } ; } else { $dens = \'*'; $deln = \'*'; } A: { ## Use cases: ## - Document element is |html5:html| ## - Document element is |NULL:rfc| for my $nm ( [$dens, $deln], [$dens, \'*'], ) { for my $__class (sort { $Message::DOM::ClassPoint{$b} <=> $Message::DOM::ClassPoint{$a} } grep { $Message::DOM::DOMFeature::ClassInfo ->{ 'Message::DOM::Document::ManakaiDOMDocument' } ->{compat_class_by_type} ->{${$nm->[0]}}->{${$nm->[1]}}->{$_} } keys %{$Message::DOM::DOMFeature::ClassInfo ->{ 'Message::DOM::Document::ManakaiDOMDocument' } ->{compat_class_by_type} ->{${$nm->[0]}}->{${$nm->[1]}} or {}}) { if ($Message::DOM::DOMFeature::ClassInfo->{$__class} ->{has_feature}->{xml}->{'3.0'}) { $class = \$__class; IFCHK: { for (@{$opt->{ 'nrifs' } or []}) { last IFCHK unless $$class->isa ($_); } last A; } # IFCHK } } } ## Generic CLASS: for my $__class (sort { $Message::DOM::ClassPoint{$b} <=> $Message::DOM::ClassPoint{$a} } grep { $Message::DOM::DOMFeature::ClassInfo ->{ 'Message::DOM::Document::ManakaiDOMDocument' } ->{compat_class}->{$_} } keys %{$Message::DOM::DOMFeature::ClassInfo ->{ 'Message::DOM::Document::ManakaiDOMDocument' } ->{compat_class} or {}}) { if ($Message::DOM::DOMFeature::ClassInfo->{$__class} ->{has_feature}->{xml}->{'3.0'}) { $class = \$__class; IFCHK: { for (@{$opt->{ 'nrifs' } or []}) { last IFCHK unless $$class->isa ($_); } last A; } # IFCHK } } ## Default $class = \$self; } # A if (defined $deh) { { $obj->{ 'b' }->{${$obj->{ 'id' }}} ->{'dnrcls'} = $class; } ; } } # CLS $r = bless $obj, $$class; } $r} sub node_type ($;$) { if (@_ == 1) {my ($self) = @_; my $r; $r = '9'; $r; } else {my ($self) = @_; report Message::Util::Error::DOMException::CoreException -object => $self, '-type' => 'NO_MODIFICATION_ALLOWED_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#on' => 'get', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2005/manakai/Util/Error/DOMException#READ_ONLY_ATTRIBUTE_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#class' => 'Message::DOM::Document::ManakaiDOMDocument', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#attr' => 'node_type'; } } sub append_child ($$) { my ($self, $newChild) = @_; my $r; { my $strictc = $self-> dom_config -> get_parameter ( 'http://suika.fam.cx/www/2006/dom-config/strict-document-children' ); my $child_od = $newChild-> owner_document || $self; my $child_nt = $newChild-> node_type ; if ($strictc and $self-> strict_error_checking ) { { local $Error::Depth = $Error::Depth + 1; { my $has_el; my $has_dt; if ($child_nt == '1' ) { $has_el = 1 ; } elsif ($child_nt == '10' ) { $has_dt = 1 ; } elsif ($child_nt == '11' ) { for my $cn (@{$newChild-> child_nodes }) { my $cnt = $cn-> node_type ; if ($cnt == '1' ) { if ($has_el) { { local $Error::Depth = $Error::Depth - 1; { report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'HIERARCHY_REQUEST_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#method' => 'append_child', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#MDOM_SECOND_DOC_ELEMENT', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#class' => 'Message::DOM::Document::ManakaiDOMDocument', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#param-name' => 'newChild', 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#node' => $newChild; } ;} ; } $has_el = 1 ; } # DocumentType node cannot be contained in DocumentFragments } } if ($has_el) { my $anode = $self-> last_child ; while (defined $anode) { if ($anode-> node_type == '1' ) { { local $Error::Depth = $Error::Depth - 1; { report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'HIERARCHY_REQUEST_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#method' => 'append_child', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#MDOM_SECOND_DOC_ELEMENT', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#class' => 'Message::DOM::Document::ManakaiDOMDocument', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#param-name' => 'newChild', 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#node' => $newChild; } ;} ; } $anode = $anode-> previous_sibling ; } } # has_el if ($has_dt) { my $anode = $self-> last_child ; while (defined $anode) { my $ant = $anode-> node_type ; if ($ant == '1' ) { { local $Error::Depth = $Error::Depth - 1; { report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'HIERARCHY_REQUEST_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#method' => 'append_child', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#HIERARCHY_WRONG_DOCTYPE_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#class' => 'Message::DOM::Document::ManakaiDOMDocument', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#param-name' => 'newChild', 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#node' => $newChild; } ;} ; } elsif ($ant == '10' ) { { local $Error::Depth = $Error::Depth - 1; { report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'HIERARCHY_REQUEST_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#method' => 'append_child', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#MDOM_SECOND_DOCTYPE', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#class' => 'Message::DOM::Document::ManakaiDOMDocument', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#param-name' => 'newChild', 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#node' => $newChild; } ;} ; } $anode = $anode-> previous_sibling ; } } # has_dt } ;} ; } { { local $Error::Depth = $Error::Depth + 1; { my $strict = $self-> strict_error_checking ; ## -- Node Type check my @new_child; if ({ '3' => (not $strictc), '5' => (not $strictc), '1' => 1, '4' => (not $strictc), '7' => 1, '8' => 1, '10' => 1, }->{$child_nt}) { push @new_child, $newChild; } elsif ($child_nt == '11' ) { for my $cn (@{$newChild-> child_nodes }) { unless ({ '3' => (not $strictc), '5' => (not $strictc), '1' => 1, '4' => (not $strictc), '7' => 1, '8' => 1, '10' => 1, }->{$cn-> node_type }) { { local $Error::Depth = $Error::Depth - 1; { report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'HIERARCHY_REQUEST_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#HIERARCHY_BAD_TYPE', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#resourceURI' => 'tag:suika.fam.cx,2005-09:http://suika.fam.cx/~wakaba/archive/2005/manakai/DOM/TreeCore/appendChildImpl1+http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom%23ManakaiDOMLatest', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#param-name' => 'newChild', 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#node' => $newChild; } ;} ; } push @new_child, $cn; } } else { { local $Error::Depth = $Error::Depth - 1; { report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'HIERARCHY_REQUEST_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#HIERARCHY_BAD_TYPE', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#resourceURI' => 'tag:suika.fam.cx,2005-09:http://suika.fam.cx/~wakaba/archive/2005/manakai/DOM/TreeCore/appendChildImpl1+http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom%23ManakaiDOMLatest', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#param-name' => 'newChild', 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#node' => $newChild; } ;} ; } my $nc_parent = @new_child ? $new_child[0]-> parent_node : undef ; if ($strict) { ## -- Wrong-document check unless ($self eq $child_od) { { local $Error::Depth = $Error::Depth - 1; { report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'WRONG_DOCUMENT_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#DIFFERENT_DOCUMENT_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#resourceURI' => 'tag:suika.fam.cx,2005-09:http://suika.fam.cx/~wakaba/archive/2005/manakai/DOM/TreeCore/appendChildImpl1+http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom%23ManakaiDOMLatest', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#param-name' => 'newChild', 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#node' => $newChild; } ;} ; } ## -- Read-onlyness check if ($self-> manakai_read_only ) { { local $Error::Depth = $Error::Depth - 1; { report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'NO_MODIFICATION_ALLOWED_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#NOMOD_THIS', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#resourceURI' => 'tag:suika.fam.cx,2005-09:http://suika.fam.cx/~wakaba/archive/2005/manakai/DOM/TreeCore/appendChildImpl1+http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom%23ManakaiDOMLatest'; } ;} ; } if (@new_child) { if ($nc_parent and $nc_parent-> manakai_read_only ) { { local $Error::Depth = $Error::Depth - 1; { report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'NO_MODIFICATION_ALLOWED_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#NOMOD_SRC_PARENT', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#resourceURI' => 'tag:suika.fam.cx,2005-09:http://suika.fam.cx/~wakaba/archive/2005/manakai/DOM/TreeCore/appendChildImpl1+http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom%23ManakaiDOMLatest'; } ;} ; } } } ## -- Insert at... my $index = -1; # last ; # FOR !tc:ForAppendChild ## -- Removes from parent if ($nc_parent) { if ($child_nt == '11' ) { { $newChild->{ 'b' }->{${$newChild->{ 'id' }}} ->{'child'} = []; } ; } else { my $v; { $v = $nc_parent->{ 'b' }->{${$nc_parent->{ 'id' }}} ->{'child'}; } ; RP: for my $i (0..$#$v) { my $nodeid = $v->[$i]; if ( (${$new_child[0]->{'id'}} eq ${$nodeid}) ) { splice @$v, $i, 1, (); last RP; } } # RP } } ## -- Rewrite the |parentNode| properties for my $nc (@new_child) { { $nc->{ 'b' }->{${$nc->{ 'id' }}} ->{'parent'} = $self->{ 'id' }; } ; } my $children; { $children = $self->{ 'b' }->{${$self->{ 'id' }}} ->{'child'}; } ; { ## -- Adds to children list push @$children, map { $_->{'id'} } @new_child; $r = $newChild; } ; ; ; } ;} ; } ; if ($child_nt == '10' and not defined $newChild-> owner_document ) { my $bag = $self->{'b'} ; { CORE::delete $bag->{${$bag->{${$newChild->{ 'id' }}} ->{'impl'} or \''}} ->{'lpmi'}; $bag->{ 'm' }++; CORE::delete $bag->{${$newChild->{ 'id' }}} ->{'impl'}; } ; { $bag->{${$newChild->{ 'id' }}}->{'od'} = $self->{ 'id' }; $bag->{${$self->{ 'id' }}} ->{'do'}->{${$newChild->{ 'id' }}} = $newChild->{ 'id' }; } ; } } $r} sub insert_before ($$;$) { my ($self, $newChild, $refChild) = @_; my $r; { my $strictc = $self-> dom_config -> get_parameter ( 'http://suika.fam.cx/www/2006/dom-config/strict-document-children' ); my $child_od = $newChild-> owner_document || $self; my $child_nt = $newChild-> node_type ; if ($strictc and $self-> strict_error_checking ) { { local $Error::Depth = $Error::Depth + 1; { my $has_el; my $has_dt; if ($child_nt == '1' ) { $has_el = 1 ; } elsif ($child_nt == '10' ) { $has_dt = 1 ; } elsif ($child_nt == '11' ) { for my $cn (@{$newChild-> child_nodes }) { my $cnt = $cn-> node_type ; if ($cnt == '1' ) { if ($has_el) { { local $Error::Depth = $Error::Depth - 1; { report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'HIERARCHY_REQUEST_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#method' => 'insert_before', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#MDOM_SECOND_DOC_ELEMENT', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#class' => 'Message::DOM::Document::ManakaiDOMDocument', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#param-name' => 'newChild', 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#node' => $newChild; } ;} ; } $has_el = 1 ; } # DocumentType node cannot be contained in DocumentFragments } } if ($has_el) { my $anode = $refChild ? $refChild-> previous_sibling : $self-> last_child ; while (defined $anode) { if ($anode-> node_type == '1' ) { { local $Error::Depth = $Error::Depth - 1; { report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'HIERARCHY_REQUEST_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#method' => 'insert_before', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#MDOM_SECOND_DOC_ELEMENT', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#class' => 'Message::DOM::Document::ManakaiDOMDocument', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#param-name' => 'newChild', 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#node' => $newChild; } ;} ; } $anode = $anode-> previous_sibling ; } $anode = $refChild; while (defined $anode) { my $ant = $anode-> node_type ; if ($ant == '1' ) { { local $Error::Depth = $Error::Depth - 1; { report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'HIERARCHY_REQUEST_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#method' => 'insert_before', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#MDOM_SECOND_DOC_ELEMENT', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#class' => 'Message::DOM::Document::ManakaiDOMDocument', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#param-name' => 'newChild', 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#node' => $newChild; } ;} ; } elsif ($ant == '10' ) { { local $Error::Depth = $Error::Depth - 1; { report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'HIERARCHY_REQUEST_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#method' => 'insert_before', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#HIERARCHY_WRONG_DOCTYPE_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#class' => 'Message::DOM::Document::ManakaiDOMDocument', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#param-name' => 'newChild', 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#node' => $newChild; } ;} ; } $anode = $anode-> next_sibling ; } } # has_el if ($has_dt) { my $anode = $refChild ? $refChild-> previous_sibling : $self-> last_child ; while (defined $anode) { my $ant = $anode-> node_type ; if ($ant == '1' ) { { local $Error::Depth = $Error::Depth - 1; { report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'HIERARCHY_REQUEST_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#method' => 'insert_before', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#HIERARCHY_WRONG_DOCTYPE_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#class' => 'Message::DOM::Document::ManakaiDOMDocument', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#param-name' => 'newChild', 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#node' => $newChild; } ;} ; } elsif ($ant == '10' ) { { local $Error::Depth = $Error::Depth - 1; { report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'HIERARCHY_REQUEST_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#method' => 'insert_before', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#MDOM_SECOND_DOCTYPE', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#class' => 'Message::DOM::Document::ManakaiDOMDocument', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#param-name' => 'newChild', 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#node' => $newChild; } ;} ; } $anode = $anode-> previous_sibling ; } $anode = $refChild; while (defined $anode) { if ($anode-> node_type == '10' ) { { local $Error::Depth = $Error::Depth - 1; { report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'HIERARCHY_REQUEST_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#method' => 'insert_before', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#MDOM_SECOND_DOCTYPE', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#class' => 'Message::DOM::Document::ManakaiDOMDocument', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#param-name' => 'newChild', 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#node' => $newChild; } ;} ; } $anode = $anode-> next_sibling ; } } # has_dt } ;} ; } { { local $Error::Depth = $Error::Depth + 1; { my $strict = $self-> strict_error_checking ; ## -- Node Type check my @new_child; if ({ '3' => (not $strictc), '5' => (not $strictc), '1' => 1, '4' => (not $strictc), '7' => 1, '8' => 1, '10' => 1, }->{$child_nt}) { push @new_child, $newChild; } elsif ($child_nt == '11' ) { for my $cn (@{$newChild-> child_nodes }) { unless ({ '3' => (not $strictc), '5' => (not $strictc), '1' => 1, '4' => (not $strictc), '7' => 1, '8' => 1, '10' => 1, }->{$cn-> node_type }) { { local $Error::Depth = $Error::Depth - 1; { report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'HIERARCHY_REQUEST_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#HIERARCHY_BAD_TYPE', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#resourceURI' => 'tag:suika.fam.cx,2005-09:http://suika.fam.cx/~wakaba/archive/2005/manakai/DOM/TreeCore/insertBeforeImpl1+http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom%23ManakaiDOMLatest', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#param-name' => 'newChild', 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#node' => $newChild; } ;} ; } push @new_child, $cn; } } else { { local $Error::Depth = $Error::Depth - 1; { report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'HIERARCHY_REQUEST_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#HIERARCHY_BAD_TYPE', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#resourceURI' => 'tag:suika.fam.cx,2005-09:http://suika.fam.cx/~wakaba/archive/2005/manakai/DOM/TreeCore/insertBeforeImpl1+http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom%23ManakaiDOMLatest', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#param-name' => 'newChild', 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#node' => $newChild; } ;} ; } my $nc_parent = @new_child ? $new_child[0]-> parent_node : undef ; if ($strict) { ## -- Wrong-document check unless ($self eq $child_od) { { local $Error::Depth = $Error::Depth - 1; { report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'WRONG_DOCUMENT_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#DIFFERENT_DOCUMENT_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#resourceURI' => 'tag:suika.fam.cx,2005-09:http://suika.fam.cx/~wakaba/archive/2005/manakai/DOM/TreeCore/insertBeforeImpl1+http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom%23ManakaiDOMLatest', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#param-name' => 'newChild', 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#node' => $newChild; } ;} ; } ## -- Read-onlyness check if ($self-> manakai_read_only ) { { local $Error::Depth = $Error::Depth - 1; { report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'NO_MODIFICATION_ALLOWED_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#NOMOD_THIS', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#resourceURI' => 'tag:suika.fam.cx,2005-09:http://suika.fam.cx/~wakaba/archive/2005/manakai/DOM/TreeCore/insertBeforeImpl1+http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom%23ManakaiDOMLatest'; } ;} ; } if (@new_child) { if ($nc_parent and $nc_parent-> manakai_read_only ) { { local $Error::Depth = $Error::Depth - 1; { report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'NO_MODIFICATION_ALLOWED_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#NOMOD_SRC_PARENT', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#resourceURI' => 'tag:suika.fam.cx,2005-09:http://suika.fam.cx/~wakaba/archive/2005/manakai/DOM/TreeCore/insertBeforeImpl1+http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom%23ManakaiDOMLatest'; } ;} ; } } } ## -- Insert at... my $index = -1; # last { # tc:ForAppendChild & tc:ForReplaceChild if (defined $refChild) { if ($refChild eq $newChild) { { { local $Error::Depth = $Error::Depth - 1; { report Message::DOM::DOMCore::ManakaiDOMError -object => $self, '-type' => 'http://suika.fam.cx/~wakaba/archive/2004/dom/tree#insert-before-itself', 'rdata' => $refChild, 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#resourceURI' => 'tag:suika.fam.cx,2005-09:http://suika.fam.cx/~wakaba/archive/2005/manakai/DOM/TreeCore/insertBeforeImpl1+http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom%23ManakaiDOMLatest'; } ;} ; } ; ; } my $cns = $self-> child_nodes ; my $cnsl = @$cns; C: { $index = 0; for my $i (0..($cnsl-1)) { my $cn = $cns->[$i]; if ($cn eq $refChild) { $index += $i; last C; } elsif ($cn eq $newChild) { $index = -1; # offset } } { { local $Error::Depth = $Error::Depth - 1; { report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'NOT_FOUND_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#NOT_CHILD_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#resourceURI' => 'tag:suika.fam.cx,2005-09:http://suika.fam.cx/~wakaba/archive/2005/manakai/DOM/TreeCore/insertBeforeImpl1+http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom%23ManakaiDOMLatest', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#param-name' => 'refChild', 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#node' => $refChild; } ;} ; } ; ; } # C } else { # |oldChild| is not defined ; } } ; # FOR !tc:ForAppendChild ## -- Removes from parent if ($nc_parent) { if ($child_nt == '11' ) { { $newChild->{ 'b' }->{${$newChild->{ 'id' }}} ->{'child'} = []; } ; } else { my $v; { $v = $nc_parent->{ 'b' }->{${$nc_parent->{ 'id' }}} ->{'child'}; } ; RP: for my $i (0..$#$v) { my $nodeid = $v->[$i]; if ( (${$new_child[0]->{'id'}} eq ${$nodeid}) ) { splice @$v, $i, 1, (); last RP; } } # RP } } ## -- Rewrite the |parentNode| properties for my $nc (@new_child) { { $nc->{ 'b' }->{${$nc->{ 'id' }}} ->{'parent'} = $self->{ 'id' }; } ; } my $children; { $children = $self->{ 'b' }->{${$self->{ 'id' }}} ->{'child'}; } ; ; { ## -- Adds to children list if ($index == -1) { push @$children, map { $_->{'id'} } @new_child; } else { splice @$children, $index, 0, map { $_->{'id'} } @new_child; } $r = $newChild; } ; ; } ;} ; } ; if ($child_nt == '10' and not defined $newChild-> owner_document ) { my $bag = $self->{'b'} ; { CORE::delete $bag->{${$bag->{${$newChild->{ 'id' }}} ->{'impl'} or \''}} ->{'lpmi'}; $bag->{ 'm' }++; CORE::delete $bag->{${$newChild->{ 'id' }}} ->{'impl'}; } ; { $bag->{${$newChild->{ 'id' }}}->{'od'} = $self->{ 'id' }; $bag->{${$self->{ 'id' }}} ->{'do'}->{${$newChild->{ 'id' }}} = $newChild->{ 'id' }; } ; } } $r} sub replace_child ($$$) { my ($self, $newChild, $oldChild) = @_; my $r; { my $strictc = $self-> dom_config -> get_parameter ( 'http://suika.fam.cx/www/2006/dom-config/strict-document-children' ); my $child_od = $newChild-> owner_document || $self; my $child_nt = $newChild-> node_type ; if ($strictc and $self-> strict_error_checking ) { { local $Error::Depth = $Error::Depth + 1; { my $has_el; my $has_dt; if ($child_nt == '1' ) { $has_el = 1 ; } elsif ($child_nt == '10' ) { $has_dt = 1 ; } elsif ($child_nt == '11' ) { for my $cn (@{$newChild-> child_nodes }) { my $cnt = $cn-> node_type ; if ($cnt == '1' ) { if ($has_el) { { local $Error::Depth = $Error::Depth - 1; { report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'HIERARCHY_REQUEST_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#method' => 'replace_child', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#MDOM_SECOND_DOC_ELEMENT', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#class' => 'Message::DOM::Document::ManakaiDOMDocument', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#param-name' => 'newChild', 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#node' => $newChild; } ;} ; } $has_el = 1 ; } # DocumentType node cannot be contained in DocumentFragments } } if ($has_el) { my $anode = $oldChild-> previous_sibling ; while (defined $anode) { if ($anode-> node_type == '1' ) { { local $Error::Depth = $Error::Depth - 1; { report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'HIERARCHY_REQUEST_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#method' => 'replace_child', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#MDOM_SECOND_DOC_ELEMENT', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#class' => 'Message::DOM::Document::ManakaiDOMDocument', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#param-name' => 'newChild', 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#node' => $newChild; } ;} ; } $anode = $anode-> previous_sibling ; } $anode = $oldChild-> next_sibling ; while (defined $anode) { my $ant = $anode-> node_type ; if ($ant == '1' ) { { local $Error::Depth = $Error::Depth - 1; { report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'HIERARCHY_REQUEST_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#method' => 'replace_child', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#MDOM_SECOND_DOC_ELEMENT', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#class' => 'Message::DOM::Document::ManakaiDOMDocument', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#param-name' => 'newChild', 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#node' => $newChild; } ;} ; } elsif ($ant == '10' ) { { local $Error::Depth = $Error::Depth - 1; { report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'HIERARCHY_REQUEST_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#method' => 'replace_child', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#HIERARCHY_WRONG_DOCTYPE_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#class' => 'Message::DOM::Document::ManakaiDOMDocument', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#param-name' => 'newChild', 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#node' => $newChild; } ;} ; } $anode = $anode-> next_sibling ; } } # has_el if ($has_dt) { my $anode = $oldChild-> previous_sibling ; while (defined $anode) { my $ant = $anode-> node_type ; if ($ant == '1' ) { { local $Error::Depth = $Error::Depth - 1; { report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'HIERARCHY_REQUEST_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#method' => 'replace_child', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#HIERARCHY_WRONG_DOCTYPE_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#class' => 'Message::DOM::Document::ManakaiDOMDocument', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#param-name' => 'newChild', 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#node' => $newChild; } ;} ; } elsif ($ant == '10' ) { { local $Error::Depth = $Error::Depth - 1; { report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'HIERARCHY_REQUEST_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#method' => 'replace_child', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#MDOM_SECOND_DOCTYPE', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#class' => 'Message::DOM::Document::ManakaiDOMDocument', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#param-name' => 'newChild', 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#node' => $newChild; } ;} ; } $anode = $anode-> previous_sibling ; } $anode = $oldChild-> next_sibling ; while (defined $anode) { if ($anode-> node_type == '10' ) { { local $Error::Depth = $Error::Depth - 1; { report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'HIERARCHY_REQUEST_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#method' => 'replace_child', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#MDOM_SECOND_DOCTYPE', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#class' => 'Message::DOM::Document::ManakaiDOMDocument', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#param-name' => 'newChild', 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#node' => $newChild; } ;} ; } $anode = $anode-> next_sibling ; } } # has_dt } ;} ; } { { local $Error::Depth = $Error::Depth + 1; { my $strict = $self-> strict_error_checking ; ## -- Node Type check my @new_child; if ({ '3' => (not $strictc), '5' => (not $strictc), '1' => 1, '4' => (not $strictc), '7' => 1, '8' => 1, '10' => 1, }->{$child_nt}) { push @new_child, $newChild; } elsif ($child_nt == '11' ) { for my $cn (@{$newChild-> child_nodes }) { unless ({ '3' => (not $strictc), '5' => (not $strictc), '1' => 1, '4' => (not $strictc), '7' => 1, '8' => 1, '10' => 1, }->{$cn-> node_type }) { { local $Error::Depth = $Error::Depth - 1; { report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'HIERARCHY_REQUEST_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#HIERARCHY_BAD_TYPE', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#resourceURI' => 'tag:suika.fam.cx,2005-09:http://suika.fam.cx/~wakaba/archive/2005/manakai/DOM/TreeCore/replaceChildImpl1+http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom%23ManakaiDOMLatest', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#param-name' => 'newChild', 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#node' => $newChild; } ;} ; } push @new_child, $cn; } } else { { local $Error::Depth = $Error::Depth - 1; { report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'HIERARCHY_REQUEST_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#HIERARCHY_BAD_TYPE', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#resourceURI' => 'tag:suika.fam.cx,2005-09:http://suika.fam.cx/~wakaba/archive/2005/manakai/DOM/TreeCore/replaceChildImpl1+http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom%23ManakaiDOMLatest', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#param-name' => 'newChild', 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#node' => $newChild; } ;} ; } my $nc_parent = @new_child ? $new_child[0]-> parent_node : undef ; if ($strict) { ## -- Wrong-document check unless ($self eq $child_od) { { local $Error::Depth = $Error::Depth - 1; { report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'WRONG_DOCUMENT_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#DIFFERENT_DOCUMENT_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#resourceURI' => 'tag:suika.fam.cx,2005-09:http://suika.fam.cx/~wakaba/archive/2005/manakai/DOM/TreeCore/replaceChildImpl1+http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom%23ManakaiDOMLatest', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#param-name' => 'newChild', 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#node' => $newChild; } ;} ; } ## -- Read-onlyness check if ($self-> manakai_read_only ) { { local $Error::Depth = $Error::Depth - 1; { report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'NO_MODIFICATION_ALLOWED_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#NOMOD_THIS', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#resourceURI' => 'tag:suika.fam.cx,2005-09:http://suika.fam.cx/~wakaba/archive/2005/manakai/DOM/TreeCore/replaceChildImpl1+http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom%23ManakaiDOMLatest'; } ;} ; } if (@new_child) { if ($nc_parent and $nc_parent-> manakai_read_only ) { { local $Error::Depth = $Error::Depth - 1; { report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'NO_MODIFICATION_ALLOWED_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#NOMOD_SRC_PARENT', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#resourceURI' => 'tag:suika.fam.cx,2005-09:http://suika.fam.cx/~wakaba/archive/2005/manakai/DOM/TreeCore/replaceChildImpl1+http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom%23ManakaiDOMLatest'; } ;} ; } } } ## -- Insert at... my $index = -1; # last { # tc:ForAppendChild & tc:ForReplaceChild if (defined $oldChild) { if ($oldChild eq $newChild) { ; { { local $Error::Depth = $Error::Depth - 1; { report Message::DOM::DOMCore::ManakaiDOMError -object => $self, '-type' => 'http://suika.fam.cx/~wakaba/archive/2004/dom/tree#replace-by-itself', 'rdata' => $oldChild, 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#resourceURI' => 'tag:suika.fam.cx,2005-09:http://suika.fam.cx/~wakaba/archive/2005/manakai/DOM/TreeCore/replaceChildImpl1+http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom%23ManakaiDOMLatest'; } ;} ; } ; } my $cns = $self-> child_nodes ; my $cnsl = @$cns; C: { $index = 0; for my $i (0..($cnsl-1)) { my $cn = $cns->[$i]; if ($cn eq $oldChild) { $index += $i; last C; } elsif ($cn eq $newChild) { $index = -1; # offset } } ; { { local $Error::Depth = $Error::Depth - 1; { report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'NOT_FOUND_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#NOT_CHILD_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#resourceURI' => 'tag:suika.fam.cx,2005-09:http://suika.fam.cx/~wakaba/archive/2005/manakai/DOM/TreeCore/replaceChildImpl1+http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom%23ManakaiDOMLatest', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#param-name' => 'oldChild', 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#node' => $oldChild; } ;} ; } ; } # C } else { # |oldChild| is not defined { { local $Error::Depth = $Error::Depth - 1; { report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'NOT_FOUND_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#NOT_CHILD_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#resourceURI' => 'tag:suika.fam.cx,2005-09:http://suika.fam.cx/~wakaba/archive/2005/manakai/DOM/TreeCore/replaceChildImpl1+http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom%23ManakaiDOMLatest', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#param-name' => 'oldChild', 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#node' => $oldChild; } ;} ; } ; } } ; # FOR !tc:ForAppendChild ## -- Removes from parent if ($nc_parent) { if ($child_nt == '11' ) { { $newChild->{ 'b' }->{${$newChild->{ 'id' }}} ->{'child'} = []; } ; } else { my $v; { $v = $nc_parent->{ 'b' }->{${$nc_parent->{ 'id' }}} ->{'child'}; } ; RP: for my $i (0..$#$v) { my $nodeid = $v->[$i]; if ( (${$new_child[0]->{'id'}} eq ${$nodeid}) ) { splice @$v, $i, 1, (); last RP; } } # RP } } ## -- Rewrite the |parentNode| properties for my $nc (@new_child) { { $nc->{ 'b' }->{${$nc->{ 'id' }}} ->{'parent'} = $self->{ 'id' }; } ; } my $children; { $children = $self->{ 'b' }->{${$self->{ 'id' }}} ->{'child'}; } ; ; ; { ## -- Replaces the node splice @$children, $index, 1, map { $_->{'id'} } @new_child; { CORE::delete $oldChild->{ 'b' }->{${$oldChild->{ 'id' }}} ->{'parent'}; } ; $r = $oldChild; } ; } ;} ; } ; if ($child_nt == '10' and not defined $newChild-> owner_document ) { my $bag = $self->{'b'} ; { CORE::delete $bag->{${$bag->{${$newChild->{ 'id' }}} ->{'impl'} or \''}} ->{'lpmi'}; $bag->{ 'm' }++; CORE::delete $bag->{${$newChild->{ 'id' }}} ->{'impl'}; } ; { $bag->{${$newChild->{ 'id' }}}->{'od'} = $self->{ 'id' }; $bag->{${$self->{ 'id' }}} ->{'do'}->{${$newChild->{ 'id' }}} = $newChild->{ 'id' }; } ; } } $r} sub manakai_append_text ($$) { my ($self, $string) = @_; my $r; { { local $Error::Depth = $Error::Depth + 1; { unless ($self-> dom_config -> get_parameter ( 'http://suika.fam.cx/www/2006/dom-config/strict-document-children' )) { my $lc = $self-> last_child ; if (defined $lc and $lc-> node_type == '3' ) { $lc-> manakai_append_text (ref $string eq 'SCALAR' ? $string : \$string); } else { my $text = $self-> create_text_node (ref $string eq 'SCALAR' ? $$string : $string); $self-> append_child ($text); } } $r = $self; } ;} ; } $r} sub remove_child ($$) { my ($self, $oldChild) = @_; my $r; { if ($self-> strict_error_checking and $self-> manakai_read_only ) { report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'NO_MODIFICATION_ALLOWED_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#method' => 'remove_child', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#NOMOD_THIS', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#class' => 'Message::DOM::Document::ManakaiDOMDocument'; ; } { F: { my $i = -1; for my $cld (@{$self-> child_nodes }) { $i++; if ($cld eq $oldChild) { my $v; { $v = $self->{ 'b' }->{${$self->{ 'id' }}} ->{'child'}; } ; splice @$v, $i, 1, (); { CORE::delete $oldChild->{ 'b' }->{${$oldChild->{ 'id' }}} ->{'parent'}; } ; $r = $oldChild; last F; } } report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'NOT_FOUND_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#NOT_CHILD_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#resourceURI' => 'tag:suika.fam.cx,2005-09:http://suika.fam.cx/~wakaba/archive/2005/manakai/DOM/TreeCore/removeChildImpl+http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom%23ManakaiDOMLatest', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#param-name' => 'oldChild', 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#node' => $oldChild; ; } # F } ; } $r} sub node_name ($;$) { if (@_ == 1) {my ($self) = @_; my $r = ''; $r = '#document'; $r; } else {my ($self) = @_; report Message::Util::Error::DOMException::CoreException -object => $self, '-type' => 'NO_MODIFICATION_ALLOWED_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#on' => 'get', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2005/manakai/Util/Error/DOMException#READ_ONLY_ATTRIBUTE_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#class' => 'Message::DOM::Document::ManakaiDOMDocument', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#attr' => 'node_name'; } } sub text_content ($;$) { if (@_ == 1) {my ($self) = @_; my $r = ''; { { local $Error::Depth = $Error::Depth + 1; { if ($self-> dom_config -> get_parameter ( 'http://suika.fam.cx/www/2006/dom-config/strict-document-children' )) { $r = undef ; } else { $r = ''; my @target = @{$self-> child_nodes }; C: for my $node (@target) { my $nt = $node-> node_type ; if ($nt == '3' or $nt == '4' ) { $r .= $node-> data unless $node-> is_element_content_whitespace ; } elsif ($nt == '1' or $nt == '5' ) { unshift @target, @{$node-> child_nodes }; } } } } ;} ; } $r; } else {my ($self, $given) = @_; { if ($self-> dom_config -> get_parameter ( 'http://suika.fam.cx/www/2006/dom-config/strict-document-children' )) { report Message::DOM::DOMCore::ManakaiDOMError -object => $self, '-type' => 'http://suika.fam.cx/~wakaba/archive/2004/dom/tree#setting-node-value-no-effect', 'rdata' => $self, 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#on' => 'set', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#class' => 'Message::DOM::Document::ManakaiDOMDocument', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#attr' => 'text_content'; ; } else { { { if ($self-> manakai_read_only ) { report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'NO_MODIFICATION_ALLOWED_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#NOMOD_THIS', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#resourceURI' => 'tag:suika.fam.cx,2005-09:http://suika.fam.cx/~wakaba/archive/2005/manakai/DOM/TreeCore/NodeReadOnlyError+http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom%23ManakaiDOMLatest'; ; } } ; my @__old_children = @{$self-> child_nodes }; for my $__old_child (@__old_children) { { CORE::delete $__old_child->{ 'b' }->{${$__old_child->{ 'id' }}} ->{'parent'}; } ; } my @__new_children; if (defined $given and length $given) { my $__text = $self-> create_text_node ($given); push @__new_children, $__text->{'id'} ; { $__text->{ 'b' }->{${$__text->{ 'id' }}} ->{'parent'} = $self->{ 'id' }; } ; } { $self->{ 'b' }->{${$self->{ 'id' }}} ->{'child'} = \@__new_children; } ; } ; } } } } sub get_feature ($$$) { my ($self, $feature, $version) = @_; { $feature = lc $feature; } { $version = '' unless defined $version; } my $r; { $feature =~ s/^\+//; ## TODO: Remove this code and implement autoload if ($feature eq 'http://suika.fam.cx/www/2006/feature/xdoctype' ) { require Message::DOM::XDoctype; } { if ($Message::DOM::DOMFeature::ClassInfo->{ref $self} ->{has_feature}->{$feature}->{$version}) { $r = $self; } else { CLASS: for my $__class (sort { $Message::DOM::ClassPoint{$b} <=> $Message::DOM::ClassPoint{$a} } grep { $Message::DOM::DOMFeature::ClassInfo->{'Message::DOM::Document::ManakaiDOMDocument'} ->{compat_class}->{$_} } keys %{$Message::DOM::DOMFeature::ClassInfo->{'Message::DOM::Document::ManakaiDOMDocument'} ->{compat_class} or {}}) { if ($Message::DOM::DOMFeature::ClassInfo->{$__class} ->{has_feature}->{$feature}->{$version}) { { $r = ${($self->{'b'})->{${($self->{'id'})}}->{ 'cls' }}->___create_node_ref ({ 'id' => ($self->{'id'}), 'b' => ($self->{'b'}), }, { 'nrcls' => \$__class, }); ($self->{'b'})->{${($self->{'id'})}}->{ 'rc' }++; } ; last CLASS; } } # CLASS } } ; unless (defined $r) { { local $Error::Depth = $Error::Depth + 1; { $r = $self->SUPER::get_feature ($feature, $version); } ;} ; } } $r} sub base_uri ($;$) { if (@_ == 1) {my ($self) = @_; my $r = ''; { { $r = $self->{ 'b' }->{${$self->{ 'id' }}} ->{'buri'}; } ; unless (defined $r) { { $r = $self->{ 'b' }->{${$self->{ 'id' }}} ->{'duri'}; } ; } } $r; } else {my ($self) = @_; report Message::Util::Error::DOMException::CoreException -object => $self, '-type' => 'NO_MODIFICATION_ALLOWED_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#on' => 'get', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2005/manakai/Util/Error/DOMException#READ_ONLY_ATTRIBUTE_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#class' => 'Message::DOM::Document::ManakaiDOMDocument', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#attr' => 'base_uri'; } } sub create_element ($$) { my ($self, $tagName) = @_; my $r; { my $strict = $self-> strict_error_checking ; if ($strict) { my $version = $self-> xml_version ; { if (defined $tagName) { { if (((not defined $version or $version eq '1.0') and not ($tagName =~ /\A\p{InXML_NameStartChar10}\p{InXMLNameChar10}*\z/) ) or (defined $version and $version eq '1.1' and not ($tagName =~ /\A\p{InXMLNameStartChar11}\p{InXMLNameChar11}*\z/) )) { report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'INVALID_CHARACTER_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#MDOM_BAD_NAME', 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#name' => $tagName, 'http://www.w3.org/2001/04/infoset#version' => $version, 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#resourceURI' => 'tag:suika.fam.cx,2005-09:http://suika.fam.cx/~wakaba/archive/2004/dom/main%23ensureXMLName+http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom%23ManakaiDOMLatest', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#param-name' => '$INPUT_PARAM_NAME'; ; } } ; ; } } ; } { local $Error::Depth = $Error::Depth + 1; { $self-> strict_error_checking ( 0 ); $r = $self-> create_element_ns ( undef , [ undef , $tagName]); $self-> strict_error_checking ($strict); } ;} ; } $r} sub create_element_ns ($$$) { my ($self, $namespaceURI, $qualifiedName) = @_; { if (CORE::defined $namespaceURI and CORE::length $namespaceURI == 0) { report Message::DOM::DOMCore::ManakaiDOMError -object => $self, '-type' => 'http://suika.fam.cx/~wakaba/archive/2004/dom/main#empty-namespace-uri', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#resourceURI' => 'tag:suika.fam.cx,2005-09:tag:suika.fam.cx,2005-09:1144080824:30455:ZO0D78781+http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom%23ManakaiDOMLatest'; ; { $namespaceURI = undef; } ; } } my $r; { require Message::DOM::Element; my ($prefix, $lname) = ref $qualifiedName eq 'ARRAY' ? @$qualifiedName : split /:/, $qualifiedName, 2; ($prefix, $lname) = ( undef , $prefix) unless defined $lname; $qualifiedName = defined $prefix ? $prefix.':'.$lname : $lname; if ($self-> strict_error_checking ) { my $version = $self-> xml_version ; { if (defined $version and $version eq '1.1') { unless ( ($qualifiedName =~ /\A\p{InXMLNameStartChar11}\p{InXMLNameChar11}*\z/) ) { report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'INVALID_CHARACTER_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#MDOM_BAD_NAME', 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#name' => $qualifiedName, 'http://www.w3.org/2001/04/infoset#version' => '1.1', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#resourceURI' => 'tag:suika.fam.cx,2005-09:http://suika.fam.cx/~wakaba/archive/2004/dom/main%23ensureXMLQName+http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom%23ManakaiDOMLatest', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#param-name' => '$INPUT_NAME'; ; } unless ( ($qualifiedName =~ /\A\p{InXMLNCNameStartChar11}\p{InXMLNCNameChar11}*(?::\p{InXMLNCNameStartChar11}\p{InXMLNCNameChar11}*)?\z/) ) { report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'NAMESPACE_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#MDOM_NS_MALFORMED_QNAME', 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#name' => $qualifiedName, 'http://www.w3.org/2001/04/infoset#version' => '1.1', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#resourceURI' => 'tag:suika.fam.cx,2005-09:http://suika.fam.cx/~wakaba/archive/2004/dom/main%23ensureXMLQName+http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom%23ManakaiDOMLatest', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#param-name' => '$INPUT_NAME'; ; } } else { unless ( ($qualifiedName =~ /\A\p{InXML_NameStartChar10}\p{InXMLNameChar10}*\z/) ) { report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'INVALID_CHARACTER_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#MDOM_BAD_NAME', 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#name' => $qualifiedName, 'http://www.w3.org/2001/04/infoset#version' => $version, 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#resourceURI' => 'tag:suika.fam.cx,2005-09:http://suika.fam.cx/~wakaba/archive/2004/dom/main%23ensureXMLQName+http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom%23ManakaiDOMLatest', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#param-name' => '$INPUT_NAME'; ; } unless ( ($qualifiedName =~ /\A\p{InXML_NCNameStartChar10}\p{InXMLNCNameChar10}*(?::\p{InXML_NCNameStartChar10}\p{InXMLNCNameChar10}*)?\z/) ) { report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'NAMESPACE_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#MDOM_NS_MALFORMED_QNAME', 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#name' => $qualifiedName, 'http://www.w3.org/2001/04/infoset#version' => $version, 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#resourceURI' => 'tag:suika.fam.cx,2005-09:http://suika.fam.cx/~wakaba/archive/2004/dom/main%23ensureXMLQName+http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom%23ManakaiDOMLatest', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#param-name' => '$INPUT_NAME'; ; } } } ; { if (defined $prefix) { if (not defined $namespaceURI) { report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'NAMESPACE_ERR', 'http://www.w3.org/2001/04/infoset#prefix' => $prefix, 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#MDOM_NS_PREFIX_WITH_NULL_URI', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#resourceURI' => 'tag:suika.fam.cx,2005-09:http://suika.fam.cx/~wakaba/archive/2004/dom/main%23checkXMLNamesQName+http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom%23ManakaiDOMLatest'; ; } elsif ($prefix eq 'xml' and $namespaceURI ne 'http://www.w3.org/XML/1998/namespace' ) { report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'NAMESPACE_ERR', 'http://www.w3.org/2001/04/infoset#namespaceName' => $namespaceURI, 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#MDOM_NS_XML_WITH_OTHER_URI', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#resourceURI' => 'tag:suika.fam.cx,2005-09:http://suika.fam.cx/~wakaba/archive/2004/dom/main%23checkXMLNamesQName+http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom%23ManakaiDOMLatest'; ; } elsif ($prefix eq 'xmlns' and $namespaceURI ne 'http://www.w3.org/2000/xmlns/' ) { report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'NAMESPACE_ERR', 'http://www.w3.org/2001/04/infoset#namespaceName' => $namespaceURI, 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#MDOM_NS_XMLNS_WITH_OTHER_URI', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#resourceURI' => 'tag:suika.fam.cx,2005-09:http://suika.fam.cx/~wakaba/archive/2004/dom/main%23checkXMLNamesQName+http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom%23ManakaiDOMLatest'; ; } elsif ($namespaceURI eq 'http://www.w3.org/XML/1998/namespace' and $prefix ne 'xml') { report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'NAMESPACE_ERR', 'http://www.w3.org/2001/04/infoset#prefix' => $prefix, 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#MDOM_NS_OTHER_WITH_XML_URI', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#resourceURI' => 'tag:suika.fam.cx,2005-09:http://suika.fam.cx/~wakaba/archive/2004/dom/main%23checkXMLNamesQName+http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom%23ManakaiDOMLatest'; ; } elsif ($namespaceURI eq 'http://www.w3.org/2000/xmlns/' and $prefix ne 'xmlns') { report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'NAMESPACE_ERR', 'http://www.w3.org/2001/04/infoset#prefix' => $prefix, 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#MDOM_NS_OTHER_WITH_XMLNS_URI', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#resourceURI' => 'tag:suika.fam.cx,2005-09:http://suika.fam.cx/~wakaba/archive/2004/dom/main%23checkXMLNamesQName+http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom%23ManakaiDOMLatest'; ; } } else { ## No prefix if (not defined $namespaceURI) { # } elsif ($namespaceURI eq 'http://www.w3.org/2000/xmlns/' and $lname ne 'xmlns') { report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'NAMESPACE_ERR', 'http://www.w3.org/2001/04/infoset#prefix' => undef, 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#MDOM_NS_OTHER_WITH_XMLNS_URI', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#resourceURI' => 'tag:suika.fam.cx,2005-09:http://suika.fam.cx/~wakaba/archive/2004/dom/main%23checkXMLNamesQName+http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom%23ManakaiDOMLatest'; ; } } } ; if (defined $namespaceURI and $namespaceURI eq 'http://www.w3.org/2000/xmlns/' and ($qualifiedName eq 'xmlns' or (defined $prefix and $prefix eq 'xmlns'))) { report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'NAMESPACE_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#method' => 'create_element_ns', 'http://www.w3.org/2001/04/infoset#prefix' => $prefix, 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#class' => 'Message::DOM::Document::ManakaiDOMDocument', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#param-name' => 'qualifiedName', 'http://www.w3.org/2001/04/infoset#localName' => $lname, 'http://www.w3.org/2001/04/infoset#namespaceName' => $namespaceURI, 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#MDOM_NS_OTHER_WITH_XMLNS_URI'; ; } } my $bag = $self->{'b'} ; my $stem; { $stem = 'Message::DOM::Element::ManakaiDOMElement'->___create_node_stem ($bag, { 'rc' => 0, 'id' => \ ( 'tag:suika.fam.cx,2005-09:' . time . ':' . $$ . ':' . ($Message::Util::ManakaiNode::UniqueIDR ||= [qw/A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9/]->[rand 62] . [qw/A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9/]->[rand 62] . [qw/A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9/]->[rand 62] . [qw/A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9/]->[rand 62] . [qw/A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9/]->[rand 62]) . (++$Message::Util::ManakaiNode::UniqueIDN) ) , }, { 'od' => $self, 'ns' => \$namespaceURI, 'pfx' => \$prefix, 'ln' => \$lname, }); { if (defined 'Message::DOM::Element::ManakaiDOMElement') { if (ref 'Message::DOM::Element::ManakaiDOMElement' eq 'SCALAR') { $stem->{'cls'} = 'Message::DOM::Element::ManakaiDOMElement'; } elsif (defined $Message::Util::ManakaiStringRef::Value{'Message::DOM::Element::ManakaiDOMElement'}) { $stem->{'cls'} = $Message::Util::ManakaiStringRef::Value{'Message::DOM::Element::ManakaiDOMElement'}; } else { require Scalar::Util; $stem->{'cls'} = $Message::Util::ManakaiStringRef::Value{'Message::DOM::Element::ManakaiDOMElement'} = \('Message::DOM::Element::ManakaiDOMElement'); Scalar::Util::weaken ($Message::Util::ManakaiStringRef::Value{'Message::DOM::Element::ManakaiDOMElement'}); } } else { CORE::delete $stem->{'cls'}; } } ; $bag->{${$stem->{ 'id' }}} = $stem; } ; { $r = ${$stem->{ 'cls' }}->___create_node_ref ({ 'id' => $stem->{ 'id' }, 'b' => $bag, }, { }); $stem->{ 'rc' }++; } ; ## Default attributes { { local $Error::Depth = $Error::Depth + 1; { XDA: { my $__cfg = $self-> dom_config ; last XDA unless $__cfg-> get_parameter ( 'http://suika.fam.cx/www/2006/dom-config/dtd-default-attribute' ); my $__doctype = $self-> doctype ; last XDA unless defined $__doctype; $__doctype = $__doctype-> get_feature ( 'http://suika.fam.cx/www/2006/feature/XDoctype' => '3.0'); last XDA unless defined $__doctype; my $__et = $__doctype-> get_element_type_definition_node ($qualifiedName); if ($__et) { my $__orig_strict = $self-> strict_error_checking ; $self-> strict_error_checking ( 0 ); my %__gattr; my %__has_attr; my %__pfx_to_uri; my $__copy_asis = $__cfg-> get_parameter ( 'http://suika.fam.cx/www/2006/dom-config/clone-entity-reference-subtree' ); $__cfg-> set_parameter ( 'http://suika.fam.cx/www/2006/dom-config/clone-entity-reference-subtree' => 1 ); for my $__at (@{$__et-> attribute_definitions }) { my $__at_default = $__at-> default_type ; if ($__at_default == '4' or $__at_default == '1' ) { my ($__nn1, $__nn2) = split /:/, $__at-> node_name ; if (defined $__nn2) { # prefixed if ($__nn1 eq 'xmlns') { ## TODO: NCName check, prefix check and NSURI check my $__attr = $self-> create_attribute_ns ( 'http://www.w3.org/2000/xmlns/' , [$__nn1, $__nn2]); for my $__at_child (@{$__at-> child_nodes }) { $__attr-> append_child ($__at_child-> clone_node ( 1 )); } $__attr-> manakai_attribute_type ($__at-> declared_type ); my $__nsuri = $__attr-> value ; ## TODO: Namespace well-formedness check (NSURI), v1.1 chk $__pfx_to_uri{$__nn2} = $__nsuri; $r-> set_attribute_node_ns ($__attr); ## This method changes |specified| flag $__attr-> specified ( 0 ); $__has_attr{ 'http://www.w3.org/2000/xmlns/' }->{$__nn2} = 1 ; } else { ## TODO: NCName check $__gattr{$__nn1}->{$__nn2} = $__at; } } else { # no prefixed my $__attr; if ($__nn1 eq 'xmlns') { $__attr = $self-> create_attribute_ns ( 'http://www.w3.org/2000/xmlns/' , 'xmlns'); $__has_attr{ 'http://www.w3.org/2000/xmlns/' }->{xmlns} = 1 ; } else { $__attr = $self-> create_attribute_ns ( undef , $__nn1); ## TODO: NCName check } for my $__at_child (@{$__at-> child_nodes }) { $__attr-> append_child ($__at_child-> clone_node ( 1 )); } $__attr-> manakai_attribute_type ($__at-> declared_type ); ## TODO: Namespace well-formedness check (NSURI) $r-> set_attribute_node_ns ($__attr); ## This method changes |specified| flag $__attr-> specified ( 0 ); } } } # attrdefs for my $__pfx (keys %__gattr) { my $__nsuri = $__pfx_to_uri{$__pfx}; unless (defined $__nsuri) { ## TODO: Namespace well-formedness error } LN: for my $__ln (keys %{$__gattr{$__pfx}}) { if ($__has_attr{defined $__nsuri ? $__nsuri : ''}->{$__ln}) { ## TODO: Namespace well-formedness error next LN; } ## TODO: NCName check, prefix check and NSURI check my $__at = $__gattr{$__pfx}->{$__ln}; my $__attr = $self-> create_attribute_ns ($__nsuri, [$__pfx, $__ln]); for my $__at_child (@{$__at-> child_nodes }) { $__attr-> append_child ($__at_child-> clone_node ( 1 )); } $__attr-> manakai_attribute_type ($__at-> declared_type ); $r-> set_attribute_node_ns ($__attr); ## This method changes |specified| flag $__attr-> specified ( 0 ); $__has_attr{defined $__nsuri ? $__nsuri : ''}->{$__ln} = 1 ; } # LN } # pfx $__cfg-> set_parameter ( 'http://suika.fam.cx/www/2006/dom-config/clone-entity-reference-subtree' => $__copy_asis); $self-> strict_error_checking ($__orig_strict); } } # XDA } ;} ; } ; } $r} sub create_attribute ($$) { my ($self, $name) = @_; my $r; { my $strict = $self-> strict_error_checking ; if ($strict) { my $version = $self-> xml_version ; { if (defined $name) { { if (((not defined $version or $version eq '1.0') and not ($name =~ /\A\p{InXML_NameStartChar10}\p{InXMLNameChar10}*\z/) ) or (defined $version and $version eq '1.1' and not ($name =~ /\A\p{InXMLNameStartChar11}\p{InXMLNameChar11}*\z/) )) { report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'INVALID_CHARACTER_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#MDOM_BAD_NAME', 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#name' => $name, 'http://www.w3.org/2001/04/infoset#version' => $version, 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#resourceURI' => 'tag:suika.fam.cx,2005-09:http://suika.fam.cx/~wakaba/archive/2004/dom/main%23ensureXMLName+http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom%23ManakaiDOMLatest', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#param-name' => '$INPUT_PARAM_NAME'; ; } } ; ; } } ; } { local $Error::Depth = $Error::Depth + 1; { $self-> strict_error_checking ( 0 ); $r = $self-> create_attribute_ns ( undef , [ undef , $name]); $self-> strict_error_checking ($strict); } ;} ; } $r} sub create_attribute_ns ($$$) { my ($self, $namespaceURI, $qualifiedName) = @_; { if (CORE::defined $namespaceURI and CORE::length $namespaceURI == 0) { report Message::DOM::DOMCore::ManakaiDOMError -object => $self, '-type' => 'http://suika.fam.cx/~wakaba/archive/2004/dom/main#empty-namespace-uri', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#resourceURI' => 'tag:suika.fam.cx,2005-09:tag:suika.fam.cx,2005-09:1144080824:30455:ZO0D78781+http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom%23ManakaiDOMLatest'; ; { $namespaceURI = undef; } ; } } my $r; { require Message::DOM::Element; my ($prefix, $lname) = ref $qualifiedName eq 'ARRAY' ? @$qualifiedName : split /:/, $qualifiedName, 2; ($prefix, $lname) = ( undef , $prefix) unless defined $lname; ## TODO: autoload if ((defined $namespaceURI and $namespaceURI eq 'http://www.w3.org/XML/1998/namespace' ) or ($lname =~ /^xml:/)) { require Message::DOM::XML; } if ($self-> strict_error_checking ) { my $version = $self-> xml_version ; $qualifiedName = defined $prefix ? $prefix.':'.$lname : $lname; { if (defined $version and $version eq '1.1') { unless ( ($qualifiedName =~ /\A\p{InXMLNameStartChar11}\p{InXMLNameChar11}*\z/) ) { report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'INVALID_CHARACTER_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#MDOM_BAD_NAME', 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#name' => $qualifiedName, 'http://www.w3.org/2001/04/infoset#version' => '1.1', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#resourceURI' => 'tag:suika.fam.cx,2005-09:http://suika.fam.cx/~wakaba/archive/2004/dom/main%23ensureXMLQName+http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom%23ManakaiDOMLatest', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#param-name' => '$INPUT_NAME'; ; } unless ( ($qualifiedName =~ /\A\p{InXMLNCNameStartChar11}\p{InXMLNCNameChar11}*(?::\p{InXMLNCNameStartChar11}\p{InXMLNCNameChar11}*)?\z/) ) { report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'NAMESPACE_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#MDOM_NS_MALFORMED_QNAME', 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#name' => $qualifiedName, 'http://www.w3.org/2001/04/infoset#version' => '1.1', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#resourceURI' => 'tag:suika.fam.cx,2005-09:http://suika.fam.cx/~wakaba/archive/2004/dom/main%23ensureXMLQName+http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom%23ManakaiDOMLatest', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#param-name' => '$INPUT_NAME'; ; } } else { unless ( ($qualifiedName =~ /\A\p{InXML_NameStartChar10}\p{InXMLNameChar10}*\z/) ) { report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'INVALID_CHARACTER_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#MDOM_BAD_NAME', 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#name' => $qualifiedName, 'http://www.w3.org/2001/04/infoset#version' => $version, 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#resourceURI' => 'tag:suika.fam.cx,2005-09:http://suika.fam.cx/~wakaba/archive/2004/dom/main%23ensureXMLQName+http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom%23ManakaiDOMLatest', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#param-name' => '$INPUT_NAME'; ; } unless ( ($qualifiedName =~ /\A\p{InXML_NCNameStartChar10}\p{InXMLNCNameChar10}*(?::\p{InXML_NCNameStartChar10}\p{InXMLNCNameChar10}*)?\z/) ) { report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'NAMESPACE_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#MDOM_NS_MALFORMED_QNAME', 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#name' => $qualifiedName, 'http://www.w3.org/2001/04/infoset#version' => $version, 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#resourceURI' => 'tag:suika.fam.cx,2005-09:http://suika.fam.cx/~wakaba/archive/2004/dom/main%23ensureXMLQName+http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom%23ManakaiDOMLatest', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#param-name' => '$INPUT_NAME'; ; } } } ; { if (defined $prefix) { if (not defined $namespaceURI) { report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'NAMESPACE_ERR', 'http://www.w3.org/2001/04/infoset#prefix' => $prefix, 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#MDOM_NS_PREFIX_WITH_NULL_URI', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#resourceURI' => 'tag:suika.fam.cx,2005-09:http://suika.fam.cx/~wakaba/archive/2004/dom/main%23checkXMLNamesQName+http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom%23ManakaiDOMLatest'; ; } elsif ($prefix eq 'xml' and $namespaceURI ne 'http://www.w3.org/XML/1998/namespace' ) { report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'NAMESPACE_ERR', 'http://www.w3.org/2001/04/infoset#namespaceName' => $namespaceURI, 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#MDOM_NS_XML_WITH_OTHER_URI', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#resourceURI' => 'tag:suika.fam.cx,2005-09:http://suika.fam.cx/~wakaba/archive/2004/dom/main%23checkXMLNamesQName+http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom%23ManakaiDOMLatest'; ; } elsif ($prefix eq 'xmlns' and $namespaceURI ne 'http://www.w3.org/2000/xmlns/' ) { report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'NAMESPACE_ERR', 'http://www.w3.org/2001/04/infoset#namespaceName' => $namespaceURI, 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#MDOM_NS_XMLNS_WITH_OTHER_URI', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#resourceURI' => 'tag:suika.fam.cx,2005-09:http://suika.fam.cx/~wakaba/archive/2004/dom/main%23checkXMLNamesQName+http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom%23ManakaiDOMLatest'; ; } elsif ($namespaceURI eq 'http://www.w3.org/XML/1998/namespace' and $prefix ne 'xml') { report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'NAMESPACE_ERR', 'http://www.w3.org/2001/04/infoset#prefix' => $prefix, 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#MDOM_NS_OTHER_WITH_XML_URI', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#resourceURI' => 'tag:suika.fam.cx,2005-09:http://suika.fam.cx/~wakaba/archive/2004/dom/main%23checkXMLNamesQName+http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom%23ManakaiDOMLatest'; ; } elsif ($namespaceURI eq 'http://www.w3.org/2000/xmlns/' and $prefix ne 'xmlns') { report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'NAMESPACE_ERR', 'http://www.w3.org/2001/04/infoset#prefix' => $prefix, 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#MDOM_NS_OTHER_WITH_XMLNS_URI', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#resourceURI' => 'tag:suika.fam.cx,2005-09:http://suika.fam.cx/~wakaba/archive/2004/dom/main%23checkXMLNamesQName+http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom%23ManakaiDOMLatest'; ; } } else { ## No prefix if (not defined $namespaceURI) { # } elsif ($namespaceURI eq 'http://www.w3.org/2000/xmlns/' and $lname ne 'xmlns') { report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'NAMESPACE_ERR', 'http://www.w3.org/2001/04/infoset#prefix' => undef, 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#MDOM_NS_OTHER_WITH_XMLNS_URI', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#resourceURI' => 'tag:suika.fam.cx,2005-09:http://suika.fam.cx/~wakaba/archive/2004/dom/main%23checkXMLNamesQName+http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom%23ManakaiDOMLatest'; ; } } } ; } my $bag = $self->{'b'} ; my $stem; { $stem = 'Message::DOM::Element::ManakaiDOMAttr'->___create_node_stem ($bag, { 'rc' => 0, 'id' => \ ( 'tag:suika.fam.cx,2005-09:' . time . ':' . $$ . ':' . ($Message::Util::ManakaiNode::UniqueIDR ||= [qw/A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9/]->[rand 62] . [qw/A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9/]->[rand 62] . [qw/A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9/]->[rand 62] . [qw/A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9/]->[rand 62] . [qw/A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9/]->[rand 62]) . (++$Message::Util::ManakaiNode::UniqueIDN) ) , }, { 'od' => $self, 'ns' => \$namespaceURI, 'pfx' => \$prefix, 'ln' => \$lname, 'specified' => 1, }); { if (defined 'Message::DOM::Element::ManakaiDOMAttr') { if (ref 'Message::DOM::Element::ManakaiDOMAttr' eq 'SCALAR') { $stem->{'cls'} = 'Message::DOM::Element::ManakaiDOMAttr'; } elsif (defined $Message::Util::ManakaiStringRef::Value{'Message::DOM::Element::ManakaiDOMAttr'}) { $stem->{'cls'} = $Message::Util::ManakaiStringRef::Value{'Message::DOM::Element::ManakaiDOMAttr'}; } else { require Scalar::Util; $stem->{'cls'} = $Message::Util::ManakaiStringRef::Value{'Message::DOM::Element::ManakaiDOMAttr'} = \('Message::DOM::Element::ManakaiDOMAttr'); Scalar::Util::weaken ($Message::Util::ManakaiStringRef::Value{'Message::DOM::Element::ManakaiDOMAttr'}); } } else { CORE::delete $stem->{'cls'}; } } ; $bag->{${$stem->{ 'id' }}} = $stem; } ; { $r = ${$stem->{ 'cls' }}->___create_node_ref ({ 'id' => $stem->{ 'id' }, 'b' => $bag, }, { }); $stem->{ 'rc' }++; } ; ## Attribute type information if ((defined $namespaceURI and $namespaceURI eq 'http://www.w3.org/XML/1998/namespace' and $lname eq 'id') or (not defined $namespaceURI and $lname eq 'xml:id')) { { local $Error::Depth = $Error::Depth + 1; { if ($self-> dom_config -> get_parameter ( 'http://suika.fam.cx/www/2006/dom-config/xml-id' )) { $r-> manakai_attribute_type ( '2' ); } } ;} ; } } $r} sub create_text_node ($$) { my ($self, $data) = @_; my $r; { my $bag = $self->{'b'} ; my $stem; { $stem = 'Message::DOM::TreeCore::ManakaiDOMText'->___create_node_stem ($bag, { 'rc' => 0, 'id' => \ ( 'tag:suika.fam.cx,2005-09:' . time . ':' . $$ . ':' . ($Message::Util::ManakaiNode::UniqueIDR ||= [qw/A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9/]->[rand 62] . [qw/A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9/]->[rand 62] . [qw/A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9/]->[rand 62] . [qw/A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9/]->[rand 62] . [qw/A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9/]->[rand 62]) . (++$Message::Util::ManakaiNode::UniqueIDN) ) , }, { 'od' => $self, 'con' => \$data, }); { if (defined 'Message::DOM::TreeCore::ManakaiDOMText') { if (ref 'Message::DOM::TreeCore::ManakaiDOMText' eq 'SCALAR') { $stem->{'cls'} = 'Message::DOM::TreeCore::ManakaiDOMText'; } elsif (defined $Message::Util::ManakaiStringRef::Value{'Message::DOM::TreeCore::ManakaiDOMText'}) { $stem->{'cls'} = $Message::Util::ManakaiStringRef::Value{'Message::DOM::TreeCore::ManakaiDOMText'}; } else { require Scalar::Util; $stem->{'cls'} = $Message::Util::ManakaiStringRef::Value{'Message::DOM::TreeCore::ManakaiDOMText'} = \('Message::DOM::TreeCore::ManakaiDOMText'); Scalar::Util::weaken ($Message::Util::ManakaiStringRef::Value{'Message::DOM::TreeCore::ManakaiDOMText'}); } } else { CORE::delete $stem->{'cls'}; } } ; $bag->{${$stem->{ 'id' }}} = $stem; } ; { $r = ${$stem->{ 'cls' }}->___create_node_ref ({ 'id' => $stem->{ 'id' }, 'b' => $bag, }, { }); $stem->{ 'rc' }++; } ; } $r} sub create_cdata_section ($$) { my ($self, $data) = @_; my $r; { require Message::DOM::XML; my $bag = $self->{'b'} ; my $stem; { $stem = 'Message::DOM::XML::ManakaiDOMCDATASection'->___create_node_stem ($bag, { 'rc' => 0, 'id' => \ ( 'tag:suika.fam.cx,2005-09:' . time . ':' . $$ . ':' . ($Message::Util::ManakaiNode::UniqueIDR ||= [qw/A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9/]->[rand 62] . [qw/A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9/]->[rand 62] . [qw/A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9/]->[rand 62] . [qw/A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9/]->[rand 62] . [qw/A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9/]->[rand 62]) . (++$Message::Util::ManakaiNode::UniqueIDN) ) , }, { 'od' => $self, 'con' => \$data, }); { if (defined 'Message::DOM::XML::ManakaiDOMCDATASection') { if (ref 'Message::DOM::XML::ManakaiDOMCDATASection' eq 'SCALAR') { $stem->{'cls'} = 'Message::DOM::XML::ManakaiDOMCDATASection'; } elsif (defined $Message::Util::ManakaiStringRef::Value{'Message::DOM::XML::ManakaiDOMCDATASection'}) { $stem->{'cls'} = $Message::Util::ManakaiStringRef::Value{'Message::DOM::XML::ManakaiDOMCDATASection'}; } else { require Scalar::Util; $stem->{'cls'} = $Message::Util::ManakaiStringRef::Value{'Message::DOM::XML::ManakaiDOMCDATASection'} = \('Message::DOM::XML::ManakaiDOMCDATASection'); Scalar::Util::weaken ($Message::Util::ManakaiStringRef::Value{'Message::DOM::XML::ManakaiDOMCDATASection'}); } } else { CORE::delete $stem->{'cls'}; } } ; $bag->{${$stem->{ 'id' }}} = $stem; } ; { $r = ${$stem->{ 'cls' }}->___create_node_ref ({ 'id' => $stem->{ 'id' }, 'b' => $bag, }, { }); $stem->{ 'rc' }++; } ; } $r} sub create_comment ($$) { my ($self, $data) = @_; my $r; { my $bag = $self->{'b'} ; my $stem; { $stem = 'Message::DOM::TreeCore::ManakaiDOMComment'->___create_node_stem ($bag, { 'rc' => 0, 'id' => \ ( 'tag:suika.fam.cx,2005-09:' . time . ':' . $$ . ':' . ($Message::Util::ManakaiNode::UniqueIDR ||= [qw/A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9/]->[rand 62] . [qw/A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9/]->[rand 62] . [qw/A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9/]->[rand 62] . [qw/A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9/]->[rand 62] . [qw/A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9/]->[rand 62]) . (++$Message::Util::ManakaiNode::UniqueIDN) ) , }, { 'od' => $self, 'con' => \$data, }); { if (defined 'Message::DOM::TreeCore::ManakaiDOMComment') { if (ref 'Message::DOM::TreeCore::ManakaiDOMComment' eq 'SCALAR') { $stem->{'cls'} = 'Message::DOM::TreeCore::ManakaiDOMComment'; } elsif (defined $Message::Util::ManakaiStringRef::Value{'Message::DOM::TreeCore::ManakaiDOMComment'}) { $stem->{'cls'} = $Message::Util::ManakaiStringRef::Value{'Message::DOM::TreeCore::ManakaiDOMComment'}; } else { require Scalar::Util; $stem->{'cls'} = $Message::Util::ManakaiStringRef::Value{'Message::DOM::TreeCore::ManakaiDOMComment'} = \('Message::DOM::TreeCore::ManakaiDOMComment'); Scalar::Util::weaken ($Message::Util::ManakaiStringRef::Value{'Message::DOM::TreeCore::ManakaiDOMComment'}); } } else { CORE::delete $stem->{'cls'}; } } ; $bag->{${$stem->{ 'id' }}} = $stem; } ; { $r = ${$stem->{ 'cls' }}->___create_node_ref ({ 'id' => $stem->{ 'id' }, 'b' => $bag, }, { }); $stem->{ 'rc' }++; } ; } $r} sub create_document_fragment ($) { my ($self) = @_; my $r; { my $bag = $self->{'b'} ; my $stem; { $stem = 'Message::DOM::Document::ManakaiDOMDocumentFragment'->___create_node_stem ($bag, { 'rc' => 0, 'id' => \ ( 'tag:suika.fam.cx,2005-09:' . time . ':' . $$ . ':' . ($Message::Util::ManakaiNode::UniqueIDR ||= [qw/A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9/]->[rand 62] . [qw/A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9/]->[rand 62] . [qw/A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9/]->[rand 62] . [qw/A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9/]->[rand 62] . [qw/A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9/]->[rand 62]) . (++$Message::Util::ManakaiNode::UniqueIDN) ) , }, { 'od' => $self, }); { if (defined 'Message::DOM::Document::ManakaiDOMDocumentFragment') { if (ref 'Message::DOM::Document::ManakaiDOMDocumentFragment' eq 'SCALAR') { $stem->{'cls'} = 'Message::DOM::Document::ManakaiDOMDocumentFragment'; } elsif (defined $Message::Util::ManakaiStringRef::Value{'Message::DOM::Document::ManakaiDOMDocumentFragment'}) { $stem->{'cls'} = $Message::Util::ManakaiStringRef::Value{'Message::DOM::Document::ManakaiDOMDocumentFragment'}; } else { require Scalar::Util; $stem->{'cls'} = $Message::Util::ManakaiStringRef::Value{'Message::DOM::Document::ManakaiDOMDocumentFragment'} = \('Message::DOM::Document::ManakaiDOMDocumentFragment'); Scalar::Util::weaken ($Message::Util::ManakaiStringRef::Value{'Message::DOM::Document::ManakaiDOMDocumentFragment'}); } } else { CORE::delete $stem->{'cls'}; } } ; $bag->{${$stem->{ 'id' }}} = $stem; } ; { $r = ${$stem->{ 'cls' }}->___create_node_ref ({ 'id' => $stem->{ 'id' }, 'b' => $bag, }, { }); $stem->{ 'rc' }++; } ; } $r} sub create_entity_reference ($$) { my ($self, $name) = @_; my $r; { require Message::DOM::XML; our $CreateEntityReference_OpenEntity; ## NOTE: Multithread unsafe my $orig_strict = $self-> strict_error_checking ; if ($orig_strict) { my $version = $self-> xml_version ; { if (defined $name) { { if (((not defined $version or $version eq '1.0') and not ($name =~ /\A\p{InXML_NameStartChar10}\p{InXMLNameChar10}*\z/) ) or (defined $version and $version eq '1.1' and not ($name =~ /\A\p{InXMLNameStartChar11}\p{InXMLNameChar11}*\z/) )) { report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'INVALID_CHARACTER_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#MDOM_BAD_NAME', 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#name' => $name, 'http://www.w3.org/2001/04/infoset#version' => $version, 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#resourceURI' => 'tag:suika.fam.cx,2005-09:http://suika.fam.cx/~wakaba/archive/2004/dom/main%23ensureXMLName+http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom%23ManakaiDOMLatest', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#param-name' => '$INPUT_PARAM_NAME'; ; } } ; ; } } ; } my $bag = $self->{'b'} ; my $stem; { $stem = 'Message::DOM::XML::ManakaiDOMEntityReference'->___create_node_stem ($bag, { 'rc' => 0, 'id' => \ ( 'tag:suika.fam.cx,2005-09:' . time . ':' . $$ . ':' . ($Message::Util::ManakaiNode::UniqueIDR ||= [qw/A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9/]->[rand 62] . [qw/A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9/]->[rand 62] . [qw/A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9/]->[rand 62] . [qw/A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9/]->[rand 62] . [qw/A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9/]->[rand 62]) . (++$Message::Util::ManakaiNode::UniqueIDN) ) , }, { 'xname' => \$name, 'od' => $self, }); { if (defined 'Message::DOM::XML::ManakaiDOMEntityReference') { if (ref 'Message::DOM::XML::ManakaiDOMEntityReference' eq 'SCALAR') { $stem->{'cls'} = 'Message::DOM::XML::ManakaiDOMEntityReference'; } elsif (defined $Message::Util::ManakaiStringRef::Value{'Message::DOM::XML::ManakaiDOMEntityReference'}) { $stem->{'cls'} = $Message::Util::ManakaiStringRef::Value{'Message::DOM::XML::ManakaiDOMEntityReference'}; } else { require Scalar::Util; $stem->{'cls'} = $Message::Util::ManakaiStringRef::Value{'Message::DOM::XML::ManakaiDOMEntityReference'} = \('Message::DOM::XML::ManakaiDOMEntityReference'); Scalar::Util::weaken ($Message::Util::ManakaiStringRef::Value{'Message::DOM::XML::ManakaiDOMEntityReference'}); } } else { CORE::delete $stem->{'cls'}; } } ; $bag->{${$stem->{ 'id' }}} = $stem; } ; { $r = ${$stem->{ 'cls' }}->___create_node_ref ({ 'id' => $stem->{ 'id' }, 'b' => $bag, }, { }); $stem->{ 'rc' }++; } ; ## Expansion { local $Error::Depth = $Error::Depth + 1; { unless ($CreateEntityReference_OpenEntity->{$name}) { local $CreateEntityReference_OpenEntity->{$name} = 1 ; my $__doctype = $self-> doctype ; $__doctype = $__doctype-> get_feature ( 'http://suika.fam.cx/www/2006/feature/XDoctype' => '3.0') if $__doctype; if ($__doctype) { my $__et = $__doctype-> get_general_entity_node ($name); if ($__et) { $self-> strict_error_checking ( 0 ); my @node; for my $c (@{$__et-> child_nodes }) { my $clone = $c-> clone_node ( 1 ); $r-> append_child ($clone); push @node, $clone; } $r-> manakai_expanded ($__et-> has_replacement_tree ); $self-> strict_error_checking ($orig_strict); } # entity } # doctype } $r-> manakai_set_read_only ( 1 , 1 ); } ;} ; } $r} sub create_processing_instruction ($$$) { my ($self, $target, $data) = @_; my $r; { require Message::DOM::XML; if ($self-> strict_error_checking ) { my $version = $self-> xml_version ; { if (defined $target) { { if (((not defined $version or $version eq '1.0') and not ($target =~ /\A\p{InXML_NameStartChar10}\p{InXMLNameChar10}*\z/) ) or (defined $version and $version eq '1.1' and not ($target =~ /\A\p{InXMLNameStartChar11}\p{InXMLNameChar11}*\z/) )) { report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'INVALID_CHARACTER_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#MDOM_BAD_NAME', 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#name' => $target, 'http://www.w3.org/2001/04/infoset#version' => $version, 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#resourceURI' => 'tag:suika.fam.cx,2005-09:http://suika.fam.cx/~wakaba/archive/2004/dom/main%23ensureXMLName+http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom%23ManakaiDOMLatest', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#param-name' => '$INPUT_PARAM_NAME'; ; } } ; ; } } ; } my $bag = $self->{'b'} ; $data = '' unless defined $data; my $stem; { $stem = 'Message::DOM::XML::ManakaiDOMProcessingInstruction'->___create_node_stem ($bag, { 'rc' => 0, 'id' => \ ( 'tag:suika.fam.cx,2005-09:' . time . ':' . $$ . ':' . ($Message::Util::ManakaiNode::UniqueIDR ||= [qw/A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9/]->[rand 62] . [qw/A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9/]->[rand 62] . [qw/A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9/]->[rand 62] . [qw/A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9/]->[rand 62] . [qw/A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9/]->[rand 62]) . (++$Message::Util::ManakaiNode::UniqueIDN) ) , }, { 'target' => \$target, 'con' => \$data, 'od' => $self, }); { if (defined 'Message::DOM::XML::ManakaiDOMProcessingInstruction') { if (ref 'Message::DOM::XML::ManakaiDOMProcessingInstruction' eq 'SCALAR') { $stem->{'cls'} = 'Message::DOM::XML::ManakaiDOMProcessingInstruction'; } elsif (defined $Message::Util::ManakaiStringRef::Value{'Message::DOM::XML::ManakaiDOMProcessingInstruction'}) { $stem->{'cls'} = $Message::Util::ManakaiStringRef::Value{'Message::DOM::XML::ManakaiDOMProcessingInstruction'}; } else { require Scalar::Util; $stem->{'cls'} = $Message::Util::ManakaiStringRef::Value{'Message::DOM::XML::ManakaiDOMProcessingInstruction'} = \('Message::DOM::XML::ManakaiDOMProcessingInstruction'); Scalar::Util::weaken ($Message::Util::ManakaiStringRef::Value{'Message::DOM::XML::ManakaiDOMProcessingInstruction'}); } } else { CORE::delete $stem->{'cls'}; } } ; $bag->{${$stem->{ 'id' }}} = $stem; } ; { $r = ${$stem->{ 'cls' }}->___create_node_ref ({ 'id' => $stem->{ 'id' }, 'b' => $bag, }, { }); $stem->{ 'rc' }++; } ; } $r} sub strict_error_checking ($;$) { if (@_ == 1) {my ($self) = @_; my $r = 0; { { $r = $self->{ 'b' }->{${$self->{ 'id' }}} ->{'chk'}; } ; $r = 1 unless defined $r; } $r; } else {my ($self, $given) = @_; { { $self->{ 'b' }->{${$self->{ 'id' }}} ->{'chk'} = $given ? 1 : 0; } ; } } } sub dom_config ($;$) { if (@_ == 1) {my ($self) = @_; my $r; { { $r = bless [$self, ($self->{'b'}->{${$self->{'id'}}}), 'Message::DOM::IFLatest::Document'], 'Message::DOM::DOMCore::ManakaiDOMConfiguration' ; } ; } $r; } else {my ($self) = @_; report Message::Util::Error::DOMException::CoreException -object => $self, '-type' => 'NO_MODIFICATION_ALLOWED_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#on' => 'get', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2005/manakai/Util/Error/DOMException#READ_ONLY_ATTRIBUTE_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#class' => 'Message::DOM::Document::ManakaiDOMDocument', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#attr' => 'dom_config'; } } sub document_element ($;$) { if (@_ == 1) {my ($self) = @_; my $r; { { local $Error::Depth = $Error::Depth + 1; { F: for my $child (@{$self-> child_nodes }) { if ($child-> node_type == '1' ) { $r = $child; last F; } } # F } ;} ; } $r; } else {my ($self) = @_; report Message::Util::Error::DOMException::CoreException -object => $self, '-type' => 'NO_MODIFICATION_ALLOWED_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#on' => 'get', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2005/manakai/Util/Error/DOMException#READ_ONLY_ATTRIBUTE_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#class' => 'Message::DOM::Document::ManakaiDOMDocument', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#attr' => 'document_element'; } } sub implementation ($;$) { if (@_ == 1) {my ($self) = @_; my $r; { { my $__v = $self->{ 'b' }->{${$self->{ 'id' }}} ->{'impl'}; if (defined $__v) { { $r = ${$self->{'b'}->{${$__v}}->{ 'cls' }}->___create_node_ref ({ 'id' => $__v, 'b' => $self->{'b'}, }, { 'nrifs' => ['Message::DOM::IFLatest::DOMImplementation'], }); $self->{'b'}->{${$__v}}->{ 'rc' }++; } ; } } ; } $r; } else {my ($self) = @_; report Message::Util::Error::DOMException::CoreException -object => $self, '-type' => 'NO_MODIFICATION_ALLOWED_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#on' => 'get', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2005/manakai/Util/Error/DOMException#READ_ONLY_ATTRIBUTE_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#class' => 'Message::DOM::Document::ManakaiDOMDocument', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#attr' => 'implementation'; } } sub xml_version ($;$) { if (@_ == 1) {my ($self) = @_; my $r = ''; { { $r = $self->{ 'b' }->{${$self->{ 'id' }}} ->{'http://www.w3.org/2001/04/infoset#version'}; } ; $r = '1.0' unless defined $r; } $r; } else {my ($self, $given) = @_; { { if ($self-> manakai_read_only ) { report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'NO_MODIFICATION_ALLOWED_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#NOMOD_THIS', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#resourceURI' => 'tag:suika.fam.cx,2005-09:http://suika.fam.cx/~wakaba/archive/2005/manakai/DOM/TreeCore/NodeReadOnlyError+http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom%23ManakaiDOMLatest'; ; } } ; if (defined $given and ($given eq '1.0' or $given eq '1.1' or not $self-> strict_error_checking )) { { $self->{ 'b' }->{${$self->{ 'id' }}} ->{'http://www.w3.org/2001/04/infoset#version'} = $given; } ; } else { report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'NOT_SUPPORTED_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#on' => 'set', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#MDOM_IMPL_NOSUPPORT_XMLVER', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#class' => 'Message::DOM::Document::ManakaiDOMDocument', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#attr' => 'xml_version', 'http://www.w3.org/2001/04/infoset#version' => $given; ; } } } } sub doctype ($;$) { if (@_ == 1) {my ($self) = @_; my $r; { { local $Error::Depth = $Error::Depth + 1; { F: for my $child (@{$self-> child_nodes }) { my $nt = $child-> node_type ; if ($nt == '10' ) { $r = $child; last F; } elsif ($nt == '1' ) { # document element last F; } } # F } ;} ; } $r; } else {my ($self) = @_; report Message::Util::Error::DOMException::CoreException -object => $self, '-type' => 'NO_MODIFICATION_ALLOWED_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#on' => 'get', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2005/manakai/Util/Error/DOMException#READ_ONLY_ATTRIBUTE_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#class' => 'Message::DOM::Document::ManakaiDOMDocument', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#attr' => 'doctype'; } } sub document_uri ($;$) { if (@_ == 1) {my ($self) = @_; my $r = ''; { { $r = $self->{ 'b' }->{${$self->{ 'id' }}} ->{'duri'}; } ; } $r; } else {my ($self, $given) = @_; { { if ($self-> manakai_read_only ) { report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'NO_MODIFICATION_ALLOWED_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#NOMOD_THIS', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#resourceURI' => 'tag:suika.fam.cx,2005-09:http://suika.fam.cx/~wakaba/archive/2005/manakai/DOM/TreeCore/NodeReadOnlyError+http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom%23ManakaiDOMLatest'; ; } } ; { $self->{ 'b' }->{${$self->{ 'id' }}} ->{'duri'} = $given; } ; } } } sub input_encoding ($;$) { if (@_ == 1) {my ($self) = @_; my $r = ''; { { $r = $self->{ 'b' }->{${$self->{ 'id' }}} ->{'ces'}; } ; } $r; } else {my ($self, $given) = @_; { { if ($self-> manakai_read_only ) { report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'NO_MODIFICATION_ALLOWED_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#NOMOD_THIS', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#resourceURI' => 'tag:suika.fam.cx,2005-09:http://suika.fam.cx/~wakaba/archive/2005/manakai/DOM/TreeCore/NodeReadOnlyError+http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom%23ManakaiDOMLatest'; ; } } ; { $self->{ 'b' }->{${$self->{ 'id' }}} ->{'ces'} = $given; } ; } } } sub xml_encoding ($;$) { if (@_ == 1) {my ($self) = @_; my $r = ''; { { $r = $self->{ 'b' }->{${$self->{ 'id' }}} ->{'xcs'}; } ; } $r; } else {my ($self, $given) = @_; { { if ($self-> manakai_read_only ) { report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'NO_MODIFICATION_ALLOWED_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#NOMOD_THIS', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#resourceURI' => 'tag:suika.fam.cx,2005-09:http://suika.fam.cx/~wakaba/archive/2005/manakai/DOM/TreeCore/NodeReadOnlyError+http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom%23ManakaiDOMLatest'; ; } } ; { $self->{ 'b' }->{${$self->{ 'id' }}} ->{'xcs'} = $given; } ; } } } sub xml_standalone ($;$) { if (@_ == 1) {my ($self) = @_; my $r = 0; { { $r = $self->{ 'b' }->{${$self->{ 'id' }}} ->{'http://www.w3.org/2001/04/infoset#standalone'}; } ; } $r; } else {my ($self, $given) = @_; { { if ($self-> manakai_read_only ) { report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'NO_MODIFICATION_ALLOWED_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#NOMOD_THIS', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#resourceURI' => 'tag:suika.fam.cx,2005-09:http://suika.fam.cx/~wakaba/archive/2005/manakai/DOM/TreeCore/NodeReadOnlyError+http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom%23ManakaiDOMLatest'; ; } } ; { $self->{ 'b' }->{${$self->{ 'id' }}} ->{'http://www.w3.org/2001/04/infoset#standalone'} = $given; } ; } } } sub adopt_node ($$) { my ($self, $source) = @_; my $r; { ADOPT: { last ADOPT unless $source->isa ( 'Message::DOM::TreeCore::ManakaiDOMNode' ) and $self->{'b'} eq $source->{'b'} ; my $strict = $self-> strict_error_checking ; if ($strict and $self-> manakai_read_only ) { report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'NO_MODIFICATION_ALLOWED_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#method' => 'adopt_node', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#NOMOD_THIS', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#class' => 'Message::DOM::Document::ManakaiDOMDocument', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#param-name' => 'source', 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#node' => 'source'; ; } my $parent = $source-> parent_node ; if ($strict and defined $parent and $parent-> manakai_read_only ) { report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'NO_MODIFICATION_ALLOWED_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#method' => 'adopt_node', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#NOMOD_PARENT', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#class' => 'Message::DOM::Document::ManakaiDOMDocument', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#param-name' => 'source', 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#node' => 'parent'; ; } my $nt = $source-> node_type ; my $oe; if ($nt == '2' ) { $oe = $source-> owner_element ; if ($strict and defined $oe and $oe-> manakai_read_only ) { report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'NO_MODIFICATION_ALLOWED_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#method' => 'adopt_node', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#NOMOD_PARENT', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#class' => 'Message::DOM::Document::ManakaiDOMDocument', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#param-name' => 'source', 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#node' => 'oe'; ; } } elsif ($nt == '9' or $nt == '10' or $nt == '6' or $nt == '12' ) { report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'NOT_SUPPORTED_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#method' => 'adopt_node', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#ADOPT_NODE_TYPE_NOT_SUPPORTED_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#class' => 'Message::DOM::Document::ManakaiDOMDocument', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#param-name' => 'source', 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#node' => 'source'; ; } my @change_od; my @nodes = ($source); while (@nodes) { my $node = shift @nodes; my $nt = $node-> node_type ; if ($strict and $node-> manakai_read_only ) { report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'NO_MODIFICATION_ALLOWED_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#method' => 'adopt_node', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#NOMOD_DESCENDANT_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#class' => 'Message::DOM::Document::ManakaiDOMDocument', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#param-name' => 'source', 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#node' => $node; ; } if ($nt == '1' ) { push @change_od, $node; push @nodes, @{$node-> child_nodes }; my $attrs = $node-> attributes ; my $attrsLength = $attrs-> length ; for my $i (0..($attrsLength - 1)) { push @nodes, $attrs-> item ($i); } } elsif ($nt == '2' or $nt == '5' or $nt == '11' ) { push @change_od, $node; push @nodes, @{$node-> child_nodes }; } elsif ($nt == '3' or $nt == '8' or $nt == '7' or $nt == '4' ) { push @change_od, $node; } else { ## TODO: assertion } } # nodes { local $Error::Depth = $Error::Depth + 1; { if (defined $parent) { $parent-> remove_child ($source); } elsif (defined $oe) { $oe-> remove_attribute_node ($source); } } ;} ; $r = $source; my $old_od = $change_od[0]-> owner_document ; ## NOTE: The array must have more than zero ## nodes by definition. In addition, ## it cannot contain document or document ## type nodes in current implementation. if ($old_od eq $self) { last ADOPT; } my $old_od_list; { $old_od_list = $old_od->{ 'b' }->{${$old_od->{ 'id' }}} ->{'do'}; } ; my $new_od_list; { $new_od_list = $self->{ 'b' }->{${$self->{ 'id' }}} ->{'do'}; } ; for my $n (@change_od) { { $n->{ 'b' }->{${$n->{ 'id' }}} ->{'od'} = $self->{ 'id' }; } ; my $nid = $n->{'id'} ; CORE::delete $old_od_list->{$$nid}; $new_od_list->{$$nid} = $nid; } for my $src (@change_od) { my $src_ud; { $src_ud = $src->{ 'b' }->{${$src->{ 'id' }}} ->{'ud'}; } ; for my $key (keys %{$src_ud or {}}) { my $dh = $src_ud->{$key}->[1]; if ($dh) { $dh-> handle ( '5' , $key, $src_ud->{$key}->[0], $src, undef ); } } } } # ADOPT } $r} sub get_element_by_id ($$) { my ($self, $elementId) = @_; my $r; { { local $Error::Depth = $Error::Depth + 1; { my @nodes = @{$self-> child_nodes }; N: while (@nodes) { my $node = shift @nodes; next N unless $node-> node_type == '1' ; for my $attr (@{$node-> attributes }) { if ($attr-> is_id and $attr-> value eq $elementId) { $r = $attr; last N; } } unshift @nodes, @{$node-> child_nodes }; } # N } ;} ; } $r} sub get_elements_by_tag_name ($$) { my ($self, $name) = @_; my $r; { $name = "$name"; my $chk; if ($name eq '*') { $chk = sub { 1 }; } else { $chk = sub { my $node = shift; my $nodeName = $node-> node_name ; ($nodeName eq $name); }; } { $r = bless \[$self, $chk], 'Message::DOM::TreeCore::ManakaiDOMGetElementsNodeList' ; } ; } $r} sub get_elements_by_tag_name_ns ($$$) { my ($self, $namespaceURI, $localName) = @_; { if (CORE::defined $namespaceURI and CORE::length $namespaceURI == 0) { report Message::DOM::DOMCore::ManakaiDOMError -object => $self, '-type' => 'http://suika.fam.cx/~wakaba/archive/2004/dom/main#empty-namespace-uri', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#resourceURI' => 'tag:suika.fam.cx,2005-09:tag:suika.fam.cx,2005-09:1144080824:30455:ZO0D78781+http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom%23ManakaiDOMLatest'; ; { $namespaceURI = undef; } ; } } my $r; { $namespaceURI = "$namespaceURI" if defined $namespaceURI; $localName = "$localName"; my $chk; if (not defined $namespaceURI) { if ($localName eq '*') { $chk = sub { my $node = shift; (not defined $node-> namespace_uri ); }; } else { $chk = sub { my $node = shift; (not defined $node-> namespace_uri and $node-> local_name eq $localName); }; } } elsif ($namespaceURI eq '*') { if ($localName eq '*') { $chk = sub { 1 }; } else { $chk = sub { my $node = shift; ($node-> local_name eq $localName); }; } } else { if ($localName eq '*') { $chk = sub { my $node = shift; my $nsuri = $node-> namespace_uri ; (defined $nsuri and $nsuri eq $namespaceURI); }; } else { $chk = sub { my $node = shift; my $nsuri = $node-> namespace_uri ; (defined $nsuri and $nsuri eq $namespaceURI and $node-> local_name eq $localName); }; } } { $r = bless \[$self, $chk], 'Message::DOM::TreeCore::ManakaiDOMGetElementsNodeList' ; } ; } $r} sub import_node ($$;$) { my ($self, $importedNode, $deep) = @_; my $r; report Message::Util::Error::DOMException::CoreException -object => $self, '-type' => 'NOT_SUPPORTED_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#method' => 'import_node', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#MDOM_IMPL_METHOD_NOT_IMPLEMENTED', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#class' => 'Message::DOM::Document::ManakaiDOMDocument'; $r} sub normalize_document ($) { my ($self) = @_; report Message::Util::Error::DOMException::CoreException -object => $self, '-type' => 'NOT_SUPPORTED_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#method' => 'normalize_document', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#MDOM_IMPL_METHOD_NOT_IMPLEMENTED', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#class' => 'Message::DOM::Document::ManakaiDOMDocument'; } sub rename_node ($$$$) { my ($self, $n, $namespaceURI, $qualifiedName) = @_; { if (CORE::defined $namespaceURI and CORE::length $namespaceURI == 0) { report Message::DOM::DOMCore::ManakaiDOMError -object => $self, '-type' => 'http://suika.fam.cx/~wakaba/archive/2004/dom/main#empty-namespace-uri', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#resourceURI' => 'tag:suika.fam.cx,2005-09:tag:suika.fam.cx,2005-09:1144080824:30455:ZO0D78781+http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom%23ManakaiDOMLatest'; ; { $namespaceURI = undef; } ; } } my $r; report Message::Util::Error::DOMException::CoreException -object => $self, '-type' => 'NOT_SUPPORTED_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#method' => 'rename_node', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#MDOM_IMPL_METHOD_NOT_IMPLEMENTED', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#class' => 'Message::DOM::Document::ManakaiDOMDocument'; $r} sub manakai_entity_base_uri ($;$) { if (@_ == 1) {my ($self) = @_; my $r = ''; { { $r = $self->{ 'b' }->{${$self->{ 'id' }}} ->{'buri'}; } ; unless (defined $r) { { $r = $self->{ 'b' }->{${$self->{ 'id' }}} ->{'duri'}; } ; } } $r; } else {my ($self, $given) = @_; { { if ($self-> manakai_read_only ) { report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'NO_MODIFICATION_ALLOWED_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#NOMOD_THIS', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#resourceURI' => 'tag:suika.fam.cx,2005-09:http://suika.fam.cx/~wakaba/archive/2005/manakai/DOM/TreeCore/NodeReadOnlyError+http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom%23ManakaiDOMLatest'; ; } } ; { $self->{ 'b' }->{${$self->{ 'id' }}} ->{'buri'} = $given; } ; } } } sub all_declarations_processed ($;$) { if (@_ == 1) {my ($self) = @_; my $r = 0; { { $r = $self->{ 'b' }->{${$self->{ 'id' }}} ->{'http://www.w3.org/2001/04/infoset#allDeclarationsProcessed'}; } ; } $r; } else {my ($self, $given) = @_; { { if ($self-> manakai_read_only ) { report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'NO_MODIFICATION_ALLOWED_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#NOMOD_THIS', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#resourceURI' => 'tag:suika.fam.cx,2005-09:http://suika.fam.cx/~wakaba/archive/2005/manakai/DOM/TreeCore/NodeReadOnlyError+http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom%23ManakaiDOMLatest'; ; } } ; { $self->{ 'b' }->{${$self->{ 'id' }}} ->{'http://www.w3.org/2001/04/infoset#allDeclarationsProcessed'} = $given; } ; } } } $Message::DOM::DOMFeature::ClassInfo->{q}->{has_feature} = {'core', {'', '1', '1.0', '1', '2.0', '1', '3.0', '1'}, 'xml', {'', '1', '1.0', '1', '2.0', '1', '3.0', '1'}, 'xmlversion', {'', '1', '1.0', '1', '1.1', '1'}}; $Message::DOM::ClassPoint{q} = 14.1; $Message::DOM::DOMFeature::ClassInfo->{q}->{compat_class}->{q} = 1; $Message::Util::Grove::ClassProp{q} = {'s1a', ['child'], 'v1h', ['do'], 'w0', ['impl']}; package Message::DOM::IFLatest::DocumentFragment; our $VERSION = 20060404.1133; package Message::DOM::Document::ManakaiDOMDocumentFragment; our $VERSION = 20060404.1133; push our @ISA, 'Message::DOM::TreeCore::ManakaiDOMNode', 'Message::DOM::IF::DocumentFragment', 'Message::DOM::IF::Node', 'Message::DOM::IFLatest::DocumentFragment', 'Message::DOM::IFLatest::Node', 'Message::DOM::IFLevel1::DocumentFragment', 'Message::DOM::IFLevel1::Node', 'Message::DOM::IFLevel2::DocumentFragment', 'Message::DOM::IFLevel2::Node', 'Message::DOM::IFLevel3::DocumentFragment', 'Message::DOM::IFLevel3::Node'; sub ___create_node_stem ($$$$) { my ($self, $bag, $obj, $opt) = @_; my $r = {}; { $obj->{ 'child' } = []; { $obj->{'od'} = $opt->{'od'}->{ 'id' }; $bag->{${$opt->{'od'}->{ 'id' }}} ->{'do'}->{${$obj->{ 'id' }}} = $obj->{ 'id' }; } ; $r = $obj; } $r} sub node_type ($;$) { if (@_ == 1) {my ($self) = @_; my $r; $r = '11'; $r; } else {my ($self) = @_; report Message::Util::Error::DOMException::CoreException -object => $self, '-type' => 'NO_MODIFICATION_ALLOWED_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#on' => 'get', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2005/manakai/Util/Error/DOMException#READ_ONLY_ATTRIBUTE_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#class' => 'Message::DOM::Document::ManakaiDOMDocumentFragment', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#attr' => 'node_type'; } } sub append_child ($$) { my ($self, $newChild) = @_; my $r; { if ($self eq $newChild) { report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'HIERARCHY_REQUEST_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#method' => 'append_child', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/dom/tree#HIERARCHY_DOCUMENT_FRAGMENT_ITSELF_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#class' => 'Message::DOM::Document::ManakaiDOMDocumentFragment', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#param-name' => 'newChild'; ; } my $self_od = $self-> owner_document ; my $child_od = $newChild-> owner_document ; my $child_nt = $newChild-> node_type ; { { local $Error::Depth = $Error::Depth + 1; { my $strict = $self_od-> strict_error_checking ; ## -- Node Type check my @new_child; if ({ '3' => 1, '5' => 1, '1' => 1, '7' => 1, '4' => 1, '8' => 1, }->{$child_nt}) { push @new_child, $newChild; } elsif ($child_nt == '11' ) { for my $cn (@{$newChild-> child_nodes }) { unless ({ '3' => 1, '5' => 1, '1' => 1, '7' => 1, '4' => 1, '8' => 1, }->{$cn-> node_type }) { { local $Error::Depth = $Error::Depth - 1; { report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'HIERARCHY_REQUEST_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#HIERARCHY_BAD_TYPE', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#resourceURI' => 'tag:suika.fam.cx,2005-09:http://suika.fam.cx/~wakaba/archive/2005/manakai/DOM/TreeCore/appendChildImpl1+http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom%23ManakaiDOMLatest', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#param-name' => 'newChild', 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#node' => $newChild; } ;} ; } push @new_child, $cn; } } else { { local $Error::Depth = $Error::Depth - 1; { report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'HIERARCHY_REQUEST_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#HIERARCHY_BAD_TYPE', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#resourceURI' => 'tag:suika.fam.cx,2005-09:http://suika.fam.cx/~wakaba/archive/2005/manakai/DOM/TreeCore/appendChildImpl1+http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom%23ManakaiDOMLatest', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#param-name' => 'newChild', 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#node' => $newChild; } ;} ; } my $nc_parent = @new_child ? $new_child[0]-> parent_node : undef ; if ($strict) { ## -- Wrong-document check unless ($self_od eq $child_od) { { local $Error::Depth = $Error::Depth - 1; { report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'WRONG_DOCUMENT_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#DIFFERENT_DOCUMENT_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#resourceURI' => 'tag:suika.fam.cx,2005-09:http://suika.fam.cx/~wakaba/archive/2005/manakai/DOM/TreeCore/appendChildImpl1+http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom%23ManakaiDOMLatest', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#param-name' => 'newChild', 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#node' => $newChild; } ;} ; } ## -- Read-onlyness check if ($self-> manakai_read_only ) { { local $Error::Depth = $Error::Depth - 1; { report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'NO_MODIFICATION_ALLOWED_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#NOMOD_THIS', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#resourceURI' => 'tag:suika.fam.cx,2005-09:http://suika.fam.cx/~wakaba/archive/2005/manakai/DOM/TreeCore/appendChildImpl1+http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom%23ManakaiDOMLatest'; } ;} ; } if (@new_child) { if ($nc_parent and $nc_parent-> manakai_read_only ) { { local $Error::Depth = $Error::Depth - 1; { report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'NO_MODIFICATION_ALLOWED_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#NOMOD_SRC_PARENT', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#resourceURI' => 'tag:suika.fam.cx,2005-09:http://suika.fam.cx/~wakaba/archive/2005/manakai/DOM/TreeCore/appendChildImpl1+http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom%23ManakaiDOMLatest'; } ;} ; } } } ## -- Insert at... my $index = -1; # last ; # FOR !tc:ForAppendChild ## -- Removes from parent if ($nc_parent) { if ($child_nt == '11' ) { { $newChild->{ 'b' }->{${$newChild->{ 'id' }}} ->{'child'} = []; } ; } else { my $v; { $v = $nc_parent->{ 'b' }->{${$nc_parent->{ 'id' }}} ->{'child'}; } ; RP: for my $i (0..$#$v) { my $nodeid = $v->[$i]; if ( (${$new_child[0]->{'id'}} eq ${$nodeid}) ) { splice @$v, $i, 1, (); last RP; } } # RP } } ## -- Rewrite the |parentNode| properties for my $nc (@new_child) { { $nc->{ 'b' }->{${$nc->{ 'id' }}} ->{'parent'} = $self->{ 'id' }; } ; } my $children; { $children = $self->{ 'b' }->{${$self->{ 'id' }}} ->{'child'}; } ; { ## -- Adds to children list push @$children, map { $_->{'id'} } @new_child; $r = $newChild; } ; ; ; } ;} ; } ; } $r} sub insert_before ($$;$) { my ($self, $newChild, $refChild) = @_; my $r; { if ($self eq $newChild) { report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'HIERARCHY_REQUEST_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#method' => 'insert_before', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/dom/tree#HIERARCHY_DOCUMENT_FRAGMENT_ITSELF_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#class' => 'Message::DOM::Document::ManakaiDOMDocumentFragment', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#param-name' => 'newChild'; ; } my $self_od = $self-> owner_document ; my $child_od = $newChild-> owner_document ; my $child_nt = $newChild-> node_type ; { { local $Error::Depth = $Error::Depth + 1; { my $strict = $self_od-> strict_error_checking ; ## -- Node Type check my @new_child; if ({ '3' => 1, '5' => 1, '1' => 1, '7' => 1, '4' => 1, '8' => 1, }->{$child_nt}) { push @new_child, $newChild; } elsif ($child_nt == '11' ) { for my $cn (@{$newChild-> child_nodes }) { unless ({ '3' => 1, '5' => 1, '1' => 1, '7' => 1, '4' => 1, '8' => 1, }->{$cn-> node_type }) { { local $Error::Depth = $Error::Depth - 1; { report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'HIERARCHY_REQUEST_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#HIERARCHY_BAD_TYPE', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#resourceURI' => 'tag:suika.fam.cx,2005-09:http://suika.fam.cx/~wakaba/archive/2005/manakai/DOM/TreeCore/insertBeforeImpl1+http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom%23ManakaiDOMLatest', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#param-name' => 'newChild', 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#node' => $newChild; } ;} ; } push @new_child, $cn; } } else { { local $Error::Depth = $Error::Depth - 1; { report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'HIERARCHY_REQUEST_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#HIERARCHY_BAD_TYPE', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#resourceURI' => 'tag:suika.fam.cx,2005-09:http://suika.fam.cx/~wakaba/archive/2005/manakai/DOM/TreeCore/insertBeforeImpl1+http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom%23ManakaiDOMLatest', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#param-name' => 'newChild', 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#node' => $newChild; } ;} ; } my $nc_parent = @new_child ? $new_child[0]-> parent_node : undef ; if ($strict) { ## -- Wrong-document check unless ($self_od eq $child_od) { { local $Error::Depth = $Error::Depth - 1; { report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'WRONG_DOCUMENT_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#DIFFERENT_DOCUMENT_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#resourceURI' => 'tag:suika.fam.cx,2005-09:http://suika.fam.cx/~wakaba/archive/2005/manakai/DOM/TreeCore/insertBeforeImpl1+http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom%23ManakaiDOMLatest', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#param-name' => 'newChild', 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#node' => $newChild; } ;} ; } ## -- Read-onlyness check if ($self-> manakai_read_only ) { { local $Error::Depth = $Error::Depth - 1; { report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'NO_MODIFICATION_ALLOWED_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#NOMOD_THIS', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#resourceURI' => 'tag:suika.fam.cx,2005-09:http://suika.fam.cx/~wakaba/archive/2005/manakai/DOM/TreeCore/insertBeforeImpl1+http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom%23ManakaiDOMLatest'; } ;} ; } if (@new_child) { if ($nc_parent and $nc_parent-> manakai_read_only ) { { local $Error::Depth = $Error::Depth - 1; { report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'NO_MODIFICATION_ALLOWED_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#NOMOD_SRC_PARENT', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#resourceURI' => 'tag:suika.fam.cx,2005-09:http://suika.fam.cx/~wakaba/archive/2005/manakai/DOM/TreeCore/insertBeforeImpl1+http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom%23ManakaiDOMLatest'; } ;} ; } } } ## -- Insert at... my $index = -1; # last { # tc:ForAppendChild & tc:ForReplaceChild if (defined $refChild) { if ($refChild eq $newChild) { { { local $Error::Depth = $Error::Depth - 1; { report Message::DOM::DOMCore::ManakaiDOMError -object => $self, '-type' => 'http://suika.fam.cx/~wakaba/archive/2004/dom/tree#insert-before-itself', 'rdata' => $refChild, 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#resourceURI' => 'tag:suika.fam.cx,2005-09:http://suika.fam.cx/~wakaba/archive/2005/manakai/DOM/TreeCore/insertBeforeImpl1+http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom%23ManakaiDOMLatest'; } ;} ; } ; ; } my $cns = $self-> child_nodes ; my $cnsl = @$cns; C: { $index = 0; for my $i (0..($cnsl-1)) { my $cn = $cns->[$i]; if ($cn eq $refChild) { $index += $i; last C; } elsif ($cn eq $newChild) { $index = -1; # offset } } { { local $Error::Depth = $Error::Depth - 1; { report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'NOT_FOUND_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#NOT_CHILD_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#resourceURI' => 'tag:suika.fam.cx,2005-09:http://suika.fam.cx/~wakaba/archive/2005/manakai/DOM/TreeCore/insertBeforeImpl1+http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom%23ManakaiDOMLatest', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#param-name' => 'refChild', 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#node' => $refChild; } ;} ; } ; ; } # C } else { # |oldChild| is not defined ; } } ; # FOR !tc:ForAppendChild ## -- Removes from parent if ($nc_parent) { if ($child_nt == '11' ) { { $newChild->{ 'b' }->{${$newChild->{ 'id' }}} ->{'child'} = []; } ; } else { my $v; { $v = $nc_parent->{ 'b' }->{${$nc_parent->{ 'id' }}} ->{'child'}; } ; RP: for my $i (0..$#$v) { my $nodeid = $v->[$i]; if ( (${$new_child[0]->{'id'}} eq ${$nodeid}) ) { splice @$v, $i, 1, (); last RP; } } # RP } } ## -- Rewrite the |parentNode| properties for my $nc (@new_child) { { $nc->{ 'b' }->{${$nc->{ 'id' }}} ->{'parent'} = $self->{ 'id' }; } ; } my $children; { $children = $self->{ 'b' }->{${$self->{ 'id' }}} ->{'child'}; } ; ; { ## -- Adds to children list if ($index == -1) { push @$children, map { $_->{'id'} } @new_child; } else { splice @$children, $index, 0, map { $_->{'id'} } @new_child; } $r = $newChild; } ; ; } ;} ; } ; } $r} sub replace_child ($$$) { my ($self, $newChild, $oldChild) = @_; my $r; { if ($self eq $newChild) { report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'HIERARCHY_REQUEST_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#method' => 'replace_child', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/dom/tree#HIERARCHY_DOCUMENT_FRAGMENT_ITSELF_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#class' => 'Message::DOM::Document::ManakaiDOMDocumentFragment', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#param-name' => 'newChild'; ; } my $self_od = $self-> owner_document ; my $child_od = $newChild-> owner_document ; my $child_nt = $newChild-> node_type ; { { local $Error::Depth = $Error::Depth + 1; { my $strict = $self_od-> strict_error_checking ; ## -- Node Type check my @new_child; if ({ '3' => 1, '5' => 1, '1' => 1, '7' => 1, '4' => 1, '8' => 1, }->{$child_nt}) { push @new_child, $newChild; } elsif ($child_nt == '11' ) { for my $cn (@{$newChild-> child_nodes }) { unless ({ '3' => 1, '5' => 1, '1' => 1, '7' => 1, '4' => 1, '8' => 1, }->{$cn-> node_type }) { { local $Error::Depth = $Error::Depth - 1; { report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'HIERARCHY_REQUEST_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#HIERARCHY_BAD_TYPE', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#resourceURI' => 'tag:suika.fam.cx,2005-09:http://suika.fam.cx/~wakaba/archive/2005/manakai/DOM/TreeCore/replaceChildImpl1+http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom%23ManakaiDOMLatest', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#param-name' => 'newChild', 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#node' => $newChild; } ;} ; } push @new_child, $cn; } } else { { local $Error::Depth = $Error::Depth - 1; { report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'HIERARCHY_REQUEST_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#HIERARCHY_BAD_TYPE', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#resourceURI' => 'tag:suika.fam.cx,2005-09:http://suika.fam.cx/~wakaba/archive/2005/manakai/DOM/TreeCore/replaceChildImpl1+http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom%23ManakaiDOMLatest', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#param-name' => 'newChild', 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#node' => $newChild; } ;} ; } my $nc_parent = @new_child ? $new_child[0]-> parent_node : undef ; if ($strict) { ## -- Wrong-document check unless ($self_od eq $child_od) { { local $Error::Depth = $Error::Depth - 1; { report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'WRONG_DOCUMENT_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#DIFFERENT_DOCUMENT_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#resourceURI' => 'tag:suika.fam.cx,2005-09:http://suika.fam.cx/~wakaba/archive/2005/manakai/DOM/TreeCore/replaceChildImpl1+http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom%23ManakaiDOMLatest', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#param-name' => 'newChild', 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#node' => $newChild; } ;} ; } ## -- Read-onlyness check if ($self-> manakai_read_only ) { { local $Error::Depth = $Error::Depth - 1; { report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'NO_MODIFICATION_ALLOWED_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#NOMOD_THIS', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#resourceURI' => 'tag:suika.fam.cx,2005-09:http://suika.fam.cx/~wakaba/archive/2005/manakai/DOM/TreeCore/replaceChildImpl1+http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom%23ManakaiDOMLatest'; } ;} ; } if (@new_child) { if ($nc_parent and $nc_parent-> manakai_read_only ) { { local $Error::Depth = $Error::Depth - 1; { report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'NO_MODIFICATION_ALLOWED_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#NOMOD_SRC_PARENT', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#resourceURI' => 'tag:suika.fam.cx,2005-09:http://suika.fam.cx/~wakaba/archive/2005/manakai/DOM/TreeCore/replaceChildImpl1+http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom%23ManakaiDOMLatest'; } ;} ; } } } ## -- Insert at... my $index = -1; # last { # tc:ForAppendChild & tc:ForReplaceChild if (defined $oldChild) { if ($oldChild eq $newChild) { ; { { local $Error::Depth = $Error::Depth - 1; { report Message::DOM::DOMCore::ManakaiDOMError -object => $self, '-type' => 'http://suika.fam.cx/~wakaba/archive/2004/dom/tree#replace-by-itself', 'rdata' => $oldChild, 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#resourceURI' => 'tag:suika.fam.cx,2005-09:http://suika.fam.cx/~wakaba/archive/2005/manakai/DOM/TreeCore/replaceChildImpl1+http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom%23ManakaiDOMLatest'; } ;} ; } ; } my $cns = $self-> child_nodes ; my $cnsl = @$cns; C: { $index = 0; for my $i (0..($cnsl-1)) { my $cn = $cns->[$i]; if ($cn eq $oldChild) { $index += $i; last C; } elsif ($cn eq $newChild) { $index = -1; # offset } } ; { { local $Error::Depth = $Error::Depth - 1; { report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'NOT_FOUND_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#NOT_CHILD_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#resourceURI' => 'tag:suika.fam.cx,2005-09:http://suika.fam.cx/~wakaba/archive/2005/manakai/DOM/TreeCore/replaceChildImpl1+http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom%23ManakaiDOMLatest', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#param-name' => 'oldChild', 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#node' => $oldChild; } ;} ; } ; } # C } else { # |oldChild| is not defined { { local $Error::Depth = $Error::Depth - 1; { report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'NOT_FOUND_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#NOT_CHILD_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#resourceURI' => 'tag:suika.fam.cx,2005-09:http://suika.fam.cx/~wakaba/archive/2005/manakai/DOM/TreeCore/replaceChildImpl1+http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom%23ManakaiDOMLatest', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#param-name' => 'oldChild', 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#node' => $oldChild; } ;} ; } ; } } ; # FOR !tc:ForAppendChild ## -- Removes from parent if ($nc_parent) { if ($child_nt == '11' ) { { $newChild->{ 'b' }->{${$newChild->{ 'id' }}} ->{'child'} = []; } ; } else { my $v; { $v = $nc_parent->{ 'b' }->{${$nc_parent->{ 'id' }}} ->{'child'}; } ; RP: for my $i (0..$#$v) { my $nodeid = $v->[$i]; if ( (${$new_child[0]->{'id'}} eq ${$nodeid}) ) { splice @$v, $i, 1, (); last RP; } } # RP } } ## -- Rewrite the |parentNode| properties for my $nc (@new_child) { { $nc->{ 'b' }->{${$nc->{ 'id' }}} ->{'parent'} = $self->{ 'id' }; } ; } my $children; { $children = $self->{ 'b' }->{${$self->{ 'id' }}} ->{'child'}; } ; ; ; { ## -- Replaces the node splice @$children, $index, 1, map { $_->{'id'} } @new_child; { CORE::delete $oldChild->{ 'b' }->{${$oldChild->{ 'id' }}} ->{'parent'}; } ; $r = $oldChild; } ; } ;} ; } ; } $r} sub node_name ($;$) { if (@_ == 1) {my ($self) = @_; my $r = ''; $r = '#document-fragment'; $r; } else {my ($self) = @_; report Message::Util::Error::DOMException::CoreException -object => $self, '-type' => 'NO_MODIFICATION_ALLOWED_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#on' => 'get', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2005/manakai/Util/Error/DOMException#READ_ONLY_ATTRIBUTE_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#class' => 'Message::DOM::Document::ManakaiDOMDocumentFragment', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#attr' => 'node_name'; } } sub manakai_append_text ($$) { my ($self, $string) = @_; my $r; { { local $Error::Depth = $Error::Depth + 1; { my $lc = $self-> last_child ; if (defined $lc and $lc-> node_type == '3' ) { $lc-> manakai_append_text (ref $string eq 'SCALAR' ? $string : \$string); } else { my $text = $self-> owner_document -> create_text_node (ref $string eq 'SCALAR' ? $$string : $string); $self-> append_child ($text); } $r = $self; } ;} ; } $r} sub get_feature ($$$) { my ($self, $feature, $version) = @_; { $feature = lc $feature; } { $version = '' unless defined $version; } my $r; { $feature =~ s/^\+//; { if ($Message::DOM::DOMFeature::ClassInfo->{ref $self} ->{has_feature}->{$feature}->{$version}) { $r = $self; } else { CLASS: for my $__class (sort { $Message::DOM::ClassPoint{$b} <=> $Message::DOM::ClassPoint{$a} } grep { $Message::DOM::DOMFeature::ClassInfo->{'Message::DOM::Document::ManakaiDOMDocumentFragment'} ->{compat_class}->{$_} } keys %{$Message::DOM::DOMFeature::ClassInfo->{'Message::DOM::Document::ManakaiDOMDocumentFragment'} ->{compat_class} or {}}) { if ($Message::DOM::DOMFeature::ClassInfo->{$__class} ->{has_feature}->{$feature}->{$version}) { { $r = ${($self->{'b'})->{${($self->{'id'})}}->{ 'cls' }}->___create_node_ref ({ 'id' => ($self->{'id'}), 'b' => ($self->{'b'}), }, { 'nrcls' => \$__class, }); ($self->{'b'})->{${($self->{'id'})}}->{ 'rc' }++; } ; last CLASS; } } # CLASS } } ; unless (defined $r) { { local $Error::Depth = $Error::Depth + 1; { $r = $self->SUPER::get_feature ($feature, $version); } ;} ; } } $r} sub base_uri ($;$) { if (@_ == 1) {my ($self) = @_; my $r = ''; { { local $Error::Depth = $Error::Depth + 1; { $r = $self-> owner_document -> base_uri ; } ;} ; } $r; } else {my ($self) = @_; report Message::Util::Error::DOMException::CoreException -object => $self, '-type' => 'NO_MODIFICATION_ALLOWED_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#on' => 'get', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2005/manakai/Util/Error/DOMException#READ_ONLY_ATTRIBUTE_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#class' => 'Message::DOM::Document::ManakaiDOMDocumentFragment', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#attr' => 'base_uri'; } } $Message::DOM::DOMFeature::ClassInfo->{q}->{has_feature} = {'core', {'', '1', '1.0', '1', '2.0', '1', '3.0', '1'}, 'xml', {'', '1', '1.0', '1', '2.0', '1', '3.0', '1'}, 'xmlversion', {'', '1', '1.0', '1', '1.1', '1'}}; $Message::DOM::ClassPoint{q} = 14.1; $Message::DOM::DOMFeature::ClassInfo->{q}->{compat_class}->{q} = 1; $Message::Util::Grove::ClassProp{q} = {'s1a', ['child'], 'w0', ['od']}; for ($Message::DOM::IF::Document::, $Message::DOM::IF::DocumentFragment::, $Message::DOM::IF::Node::, $Message::DOM::IFLatest::Node::, $Message::DOM::IFLevel1::Document::, $Message::DOM::IFLevel1::DocumentFragment::, $Message::DOM::IFLevel1::Node::, $Message::DOM::IFLevel2::Document::, $Message::DOM::IFLevel2::DocumentFragment::, $Message::DOM::IFLevel2::Node::, $Message::DOM::IFLevel3::Document::, $Message::DOM::IFLevel3::DocumentFragment::, $Message::DOM::IFLevel3::Node::){} ## License: 1;