1 |
#!/usr/bin/perl |
#!/usr/bin/perl |
2 |
## This file is automatically generated |
## This file is automatically generated |
3 |
## at 2006-04-04T09:22:34+00:00, |
## at 2006-12-02T09:40:02+00:00, |
4 |
## from file "Document.dis", |
## from file "../lib/Message/DOM/Document.dis", |
5 |
## module <http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom#ManakaiDOM.Document>, |
## module <http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom#ManakaiDOM.Document>, |
6 |
## for <http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom#ManakaiDOMLatest>. |
## for <http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom#ManakaiDOMLatest>. |
7 |
## Don't edit by hand! |
## Don't edit by hand! |
8 |
use strict; |
use strict; |
9 |
require Message::DOM::DOMCore; |
require Message::DOM::DOMCore; |
|
require Message::DOM::Element; |
|
10 |
require Message::DOM::TreeCore; |
require Message::DOM::TreeCore; |
11 |
require Message::Util::Error::DOMException; |
require Message::Util::Error::DOMException; |
12 |
package Message::DOM::Document; |
package Message::DOM::Document; |
13 |
our $VERSION = 20060404.0922; |
our $VERSION = 20061202.0940; |
14 |
package Message::DOM::IFLatest::Document; |
package Message::DOM::Document::ManakaiDOMImplementationDocument; |
15 |
our $VERSION = 20060404.0922; |
our $VERSION = 20061202.0940; |
16 |
package Message::DOM::Document::ManakaiDOMDocument; |
push @Message::DOM::DOMCore::ManakaiDOMImplementation::ISA, q<Message::DOM::Document::ManakaiDOMImplementationDocument> unless Message::DOM::DOMCore::ManakaiDOMImplementation->isa (q<Message::DOM::Document::ManakaiDOMImplementationDocument>); |
17 |
our $VERSION = 20060404.0922; |
sub create_document ($;$$$) { |
18 |
push our @ISA, 'Message::DOM::TreeCore::ManakaiDOMNode', |
my ($self, $namespaceURI, $qualifiedName, $doctype) = @_; |
|
'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 = {}; |
|
19 |
|
|
20 |
{ |
{ |
21 |
|
|
22 |
|
if |
23 |
|
(CORE::defined $namespaceURI and CORE::length $namespaceURI == 0) { |
24 |
|
require Message::DOM::DOMMain; |
25 |
|
|
26 |
|
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:1165044229:30838:aqhmc7623+http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom%23ManakaiDOMLatest'; |
27 |
|
|
28 |
$obj->{ |
; |
|
'child' |
|
|
} = []; |
|
|
$obj->{ |
|
|
'do' |
|
|
} = {}; |
|
|
$obj->{ |
|
|
'http://www.w3.org/2001/04/infoset#version' |
|
|
} = '1.0'; |
|
29 |
|
|
30 |
|
|
31 |
|
|
32 |
{ |
{ |
33 |
|
|
34 |
|
|
35 |
$obj->{'impl'} = $opt->{'impl'}->{ |
$namespaceURI = undef; |
36 |
'id' |
|
|
}; |
|
|
$bag->{${$opt->{'impl'}->{ |
|
|
'id' |
|
|
}}} |
|
|
->{'lpmi'}->{${$obj->{ |
|
|
'id' |
|
|
}}} |
|
|
= $obj->{ |
|
|
'id' |
|
|
}; |
|
37 |
|
|
38 |
|
|
39 |
} |
} |
40 |
|
|
41 |
; |
; |
42 |
$r = $obj; |
} |
43 |
|
|
44 |
|
|
45 |
} |
} |
|
$r} |
|
|
sub ___create_node_ref ($$$) { |
|
|
my ($self, $obj, $opt) = @_; |
|
46 |
my $r; |
my $r; |
47 |
|
|
48 |
{ |
{ |
49 |
|
|
50 |
my |
my |
51 |
$class; |
$bag = |
52 |
CLS: { |
$self->{'b'} |
53 |
if (defined $opt->{ |
; |
54 |
'nrcls' |
my $stem; |
55 |
}) { |
|
|
$class = $opt->{ |
|
|
'nrcls' |
|
|
}; |
|
|
IFCHK: { |
|
|
for (@{$opt->{ |
|
|
'nrifs' |
|
|
} or []}) { |
|
|
last IFCHK unless $$class->isa ($_); |
|
|
} |
|
|
last CLS; |
|
|
} # IFCHK |
|
|
} |
|
56 |
|
|
57 |
|
{ |
58 |
|
|
59 |
|
|
60 |
|
$stem = 'Message::DOM::Document::ManakaiDOMDocument'->___create_node_stem ($bag, { |
61 |
|
|
62 |
|
'rc' |
63 |
|
=> 0, |
64 |
|
|
65 |
|
'id' |
66 |
|
=> \ |
67 |
|
( |
68 |
|
'tag:suika.fam.cx,2005-09:' . time . ':' . $$ . ':' . |
69 |
|
(++$Message::Util::ManakaiNode::UniqueIDN) |
70 |
|
) |
71 |
|
, |
72 |
|
}, { |
73 |
|
'impl' => $self, |
74 |
|
}); |
75 |
|
|
76 |
|
|
77 |
{ |
{ |
78 |
|
|
79 |
|
if |
80 |
|
(defined 'Message::DOM::Document::ManakaiDOMDocument') { |
81 |
|
if (ref 'Message::DOM::Document::ManakaiDOMDocument' eq 'SCALAR') { |
82 |
|
$stem->{'cls'} = 'Message::DOM::Document::ManakaiDOMDocument'; |
83 |
|
} elsif (defined $Message::Util::ManakaiStringRef::Value{'Message::DOM::Document::ManakaiDOMDocument'}) { |
84 |
|
$stem->{'cls'} = $Message::Util::ManakaiStringRef::Value{'Message::DOM::Document::ManakaiDOMDocument'}; |
85 |
|
} else { |
86 |
|
require Scalar::Util; |
87 |
|
$stem->{'cls'} = $Message::Util::ManakaiStringRef::Value{'Message::DOM::Document::ManakaiDOMDocument'} = \('Message::DOM::Document::ManakaiDOMDocument'); |
88 |
|
Scalar::Util::weaken ($Message::Util::ManakaiStringRef::Value{'Message::DOM::Document::ManakaiDOMDocument'}); |
89 |
|
} |
90 |
|
} else { |
91 |
|
CORE::delete $stem->{'cls'}; |
92 |
|
} |
93 |
|
|
94 |
|
|
95 |
$class = $obj->{ |
} |
96 |
'b' |
|
97 |
}->{${$obj->{ |
; |
98 |
|
$bag->{${$stem->{ |
99 |
'id' |
'id' |
100 |
}}} |
}}} = $stem; |
|
->{'dnrcls'}; |
|
101 |
|
|
102 |
|
|
103 |
} |
} |
104 |
|
|
105 |
; |
; |
|
if (defined $class) { |
|
|
IFCHK: { |
|
|
for (@{$opt->{ |
|
|
'nrifs' |
|
|
} or []}) { |
|
|
last IFCHK unless $$class->isa ($_); |
|
|
} |
|
|
last CLS; |
|
|
} # IFCHK |
|
|
} |
|
106 |
|
|
|
my $cns; |
|
|
|
|
107 |
|
|
108 |
{ |
{ |
109 |
|
|
110 |
|
|
111 |
$cns = $obj->{ |
$r = ${$stem->{ |
112 |
'b' |
'cls' |
113 |
}->{${$obj->{ |
}}->___create_node_ref ({ |
114 |
|
|
115 |
'id' |
'id' |
116 |
}}} |
=> $stem->{ |
117 |
->{'child'}; |
'id' |
118 |
|
}, |
119 |
|
|
120 |
|
'b' |
121 |
|
=> $bag, |
122 |
|
}, { |
123 |
|
}); |
124 |
|
$stem->{ |
125 |
|
'rc' |
126 |
|
}++; |
127 |
|
|
128 |
|
|
129 |
} |
} |
130 |
|
|
131 |
; |
; |
132 |
my $bag = |
|
133 |
$obj->{'b'} |
if (defined $doctype) { |
134 |
; |
|
135 |
my $deh; |
|
|
DC: for my $cnid (@$cns) { |
|
|
my $cnh = |
|
136 |
{ |
{ |
137 |
'id' => $cnid, |
|
138 |
'b' => $bag, |
local $Error::Depth = $Error::Depth + 1; |
|
} |
|
|
; |
|
|
my $cncls; |
|
|
|
|
139 |
|
|
140 |
{ |
{ |
141 |
|
|
142 |
|
|
143 |
$cncls = $cnh->{ |
|
144 |
'b' |
$r-> |
145 |
}->{${$cnh->{ |
append_child |
146 |
'id' |
($doctype); |
147 |
}}} |
|
|
->{'cls'}; |
|
148 |
|
|
149 |
|
|
150 |
} |
} |
151 |
|
|
152 |
|
|
153 |
|
;} |
154 |
|
|
155 |
; |
; |
156 |
if ($$cncls eq |
} |
157 |
'Message::DOM::Element::ManakaiDOMElement' |
|
158 |
) { |
if (defined $qualifiedName) { |
159 |
$deh = $cnh; |
|
|
last DC; |
|
|
} |
|
|
} # DC |
|
|
my $dens; |
|
|
my $deln; |
|
|
if (defined $deh) { |
|
|
|
|
160 |
|
|
161 |
{ |
{ |
162 |
|
|
163 |
|
local $Error::Depth = $Error::Depth + 1; |
164 |
|
|
165 |
$dens = $deh->{ |
{ |
|
'b' |
|
|
}->{${$deh->{ |
|
|
'id' |
|
|
}}} |
|
|
->{'ns'}; |
|
166 |
|
|
167 |
|
|
168 |
} |
my |
169 |
|
$el = $r-> |
170 |
|
create_element_ns |
171 |
|
|
172 |
|
($namespaceURI, $qualifiedName); |
173 |
|
$r-> |
174 |
|
append_child |
175 |
|
($el); |
176 |
|
$r = $el-> |
177 |
|
owner_document |
178 |
; |
; |
179 |
$dens = \'' unless defined $dens; |
## Choose the class based on document element type |
180 |
|
|
181 |
|
|
|
{ |
|
182 |
|
|
183 |
|
} |
184 |
|
|
|
$deln = $deh->{ |
|
|
'b' |
|
|
}->{${$deh->{ |
|
|
'id' |
|
|
}}} |
|
|
->{'ln'}; |
|
185 |
|
|
186 |
|
;} |
187 |
|
|
188 |
} |
; |
189 |
|
} elsif (defined $namespaceURI) { |
190 |
|
|
191 |
|
report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'NAMESPACE_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#method' => 'create_document', 'http://www.w3.org/2001/04/infoset#namespaceURI' => $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_NULL_QNAME_WITH_NON_NULL_URI', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#class' => 'Message::DOM::Document::ManakaiDOMImplementationDocument', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#param-name' => 'namespaceURI'; |
192 |
|
|
193 |
; |
; |
194 |
} else { |
} |
|
$dens = \'*'; |
|
|
$deln = \'*'; |
|
|
} |
|
195 |
|
|
|
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 |
|
|
} |
|
|
} |
|
|
} |
|
196 |
|
|
197 |
## Generic |
} |
198 |
CLASS: for my $__class (sort { |
$r} |
199 |
$Message::DOM::ClassPoint{$b} <=> $Message::DOM::ClassPoint{$a} |
$Message::DOM::DOMFeature::ClassInfo->{q<Message::DOM::Document::ManakaiDOMImplementationDocument>}->{has_feature} = {}; |
200 |
} grep { |
$Message::DOM::ClassPoint{q<Message::DOM::Document::ManakaiDOMImplementationDocument>} = 0; |
201 |
$Message::DOM::DOMFeature::ClassInfo |
package Message::DOM::IFLatest::Document; |
202 |
->{ |
our $VERSION = 20061202.0940; |
203 |
'Message::DOM::Document::ManakaiDOMDocument' |
package Message::DOM::Document::ManakaiDOMDocument; |
204 |
} |
our $VERSION = 20061202.0940; |
205 |
->{compat_class}->{$_} |
push our @ISA, 'Message::DOM::TreeCore::ManakaiDOMNode', |
206 |
} keys %{$Message::DOM::DOMFeature::ClassInfo |
'Message::DOM::IF::Document', |
207 |
->{ |
'Message::DOM::IF::Node', |
208 |
'Message::DOM::Document::ManakaiDOMDocument' |
'Message::DOM::IFLatest::Document', |
209 |
} |
'Message::DOM::IFLatest::Node', |
210 |
->{compat_class} or {}}) { |
'Message::DOM::IFLevel1::Document', |
211 |
if ($Message::DOM::DOMFeature::ClassInfo->{$__class} |
'Message::DOM::IFLevel1::Node', |
212 |
->{has_feature}->{xml}->{'3.0'}) { |
'Message::DOM::IFLevel2::Document', |
213 |
$class = \$__class; |
'Message::DOM::IFLevel2::Node', |
214 |
IFCHK: { |
'Message::DOM::IFLevel3::Document', |
215 |
for (@{$opt->{ |
'Message::DOM::IFLevel3::Node'; |
216 |
'nrifs' |
sub ___create_node_stem ($$$$) { |
217 |
} or []}) { |
my ($self, $bag, $obj, $opt) = @_; |
218 |
last IFCHK unless $$class->isa ($_); |
my $r = {}; |
|
} |
|
|
last A; |
|
|
} # IFCHK |
|
|
} |
|
|
} |
|
219 |
|
|
220 |
## Default |
{ |
221 |
$class = \$self; |
|
222 |
} # A |
|
223 |
|
$obj->{ |
224 |
|
'child' |
225 |
|
} = []; |
226 |
|
$obj->{ |
227 |
|
'do' |
228 |
|
} = {}; |
229 |
|
$obj->{ |
230 |
|
'http://www.w3.org/2001/04/infoset#version' |
231 |
|
} = '1.0'; |
232 |
|
|
|
if (defined $deh) { |
|
|
|
|
233 |
|
|
234 |
{ |
{ |
235 |
|
|
236 |
|
|
237 |
$obj->{ |
$obj->{'impl'} = $opt->{'impl'}->{ |
238 |
'b' |
'id' |
239 |
}->{${$obj->{ |
}; |
240 |
|
$bag->{${$opt->{'impl'}->{ |
241 |
'id' |
'id' |
242 |
}}} |
}}} |
243 |
->{'dnrcls'} = $class; |
->{'lpmi'}->{${$obj->{ |
244 |
|
'id' |
245 |
|
}}} |
246 |
|
= $obj->{ |
247 |
|
'id' |
248 |
|
}; |
249 |
|
|
250 |
|
|
251 |
} |
} |
252 |
|
|
253 |
; |
; |
254 |
} |
$r = $obj; |
|
} # CLS |
|
|
$r = bless $obj, $$class; |
|
255 |
|
|
256 |
|
|
257 |
} |
} |
259 |
sub node_type ($;$) { |
sub node_type ($;$) { |
260 |
if (@_ == 1) {my ($self) = @_; |
if (@_ == 1) {my ($self) = @_; |
261 |
my $r; |
my $r; |
262 |
$r = '9'; |
$r = 9; |
263 |
$r; |
$r; |
264 |
} else {my ($self) = @_; |
} else {my ($self) = @_; |
265 |
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'; |
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'; |
303 |
$has_el; |
$has_el; |
304 |
my $has_dt; |
my $has_dt; |
305 |
if ($child_nt == |
if ($child_nt == |
306 |
'1' |
1 |
307 |
) { |
) { |
308 |
$has_el = |
$has_el = |
309 |
1 |
1 |
310 |
; |
; |
311 |
} elsif ($child_nt == |
} elsif ($child_nt == |
312 |
'10' |
10 |
313 |
) { |
) { |
314 |
$has_dt = |
$has_dt = |
315 |
1 |
1 |
316 |
; |
; |
317 |
} elsif ($child_nt == |
} elsif ($child_nt == |
318 |
'11' |
11 |
319 |
) { |
) { |
320 |
for my $cn (@{$newChild-> |
for my $cn (@{$newChild-> |
321 |
child_nodes |
child_nodes |
324 |
node_type |
node_type |
325 |
; |
; |
326 |
if ($cnt == |
if ($cnt == |
327 |
'1' |
1 |
328 |
) { |
) { |
329 |
if ($has_el) { |
if ($has_el) { |
330 |
|
|
361 |
if ($anode-> |
if ($anode-> |
362 |
node_type |
node_type |
363 |
== |
== |
364 |
'1' |
1 |
365 |
) { |
) { |
366 |
|
|
367 |
|
|
395 |
node_type |
node_type |
396 |
; |
; |
397 |
if ($ant == |
if ($ant == |
398 |
'1' |
1 |
399 |
) { |
) { |
400 |
|
|
401 |
|
|
415 |
|
|
416 |
; |
; |
417 |
} elsif ($ant == |
} elsif ($ant == |
418 |
'10' |
10 |
419 |
) { |
) { |
420 |
|
|
421 |
|
|
470 |
## -- Node Type check |
## -- Node Type check |
471 |
my @new_child; |
my @new_child; |
472 |
if ({ |
if ({ |
473 |
'3' => (not $strictc), |
3 => (not $strictc), |
474 |
'5' => (not $strictc), |
5 => (not $strictc), |
475 |
'1' => 1, |
1 => 1, |
476 |
'4' => (not $strictc), |
4 => (not $strictc), |
477 |
'7' => 1, |
7 => 1, |
478 |
'8' => 1, |
8 => 1, |
479 |
'10' => 1, |
10 => 1, |
480 |
}->{$child_nt}) { |
}->{$child_nt}) { |
481 |
push @new_child, $newChild; |
push @new_child, $newChild; |
482 |
} elsif ($child_nt == |
} elsif ($child_nt == |
483 |
'11' |
11 |
484 |
) { |
) { |
485 |
for my $cn (@{$newChild-> |
for my $cn (@{$newChild-> |
486 |
child_nodes |
child_nodes |
487 |
}) { |
}) { |
488 |
unless ({ |
unless ({ |
489 |
'3' => (not $strictc), |
3 => (not $strictc), |
490 |
'5' => (not $strictc), |
5 => (not $strictc), |
491 |
'1' => 1, |
1 => 1, |
492 |
'4' => (not $strictc), |
4 => (not $strictc), |
493 |
'7' => 1, |
7 => 1, |
494 |
'8' => 1, |
8 => 1, |
495 |
'10' => 1, |
10 => 1, |
496 |
}->{$cn-> |
}->{$cn-> |
497 |
node_type |
node_type |
498 |
}) { |
}) { |
621 |
## -- Removes from parent |
## -- Removes from parent |
622 |
if ($nc_parent) { |
if ($nc_parent) { |
623 |
if ($child_nt == |
if ($child_nt == |
624 |
'11' |
11 |
625 |
) { |
) { |
626 |
|
|
627 |
|
|
750 |
|
|
751 |
; |
; |
752 |
if ($child_nt == |
if ($child_nt == |
753 |
'10' and |
10 and |
754 |
|
|
755 |
not defined $newChild-> |
not defined $newChild-> |
756 |
owner_document |
owner_document |
848 |
$has_el; |
$has_el; |
849 |
my $has_dt; |
my $has_dt; |
850 |
if ($child_nt == |
if ($child_nt == |
851 |
'1' |
1 |
852 |
) { |
) { |
853 |
$has_el = |
$has_el = |
854 |
1 |
1 |
855 |
; |
; |
856 |
} elsif ($child_nt == |
} elsif ($child_nt == |
857 |
'10' |
10 |
858 |
) { |
) { |
859 |
$has_dt = |
$has_dt = |
860 |
1 |
1 |
861 |
; |
; |
862 |
} elsif ($child_nt == |
} elsif ($child_nt == |
863 |
'11' |
11 |
864 |
) { |
) { |
865 |
for my $cn (@{$newChild-> |
for my $cn (@{$newChild-> |
866 |
child_nodes |
child_nodes |
869 |
node_type |
node_type |
870 |
; |
; |
871 |
if ($cnt == |
if ($cnt == |
872 |
'1' |
1 |
873 |
) { |
) { |
874 |
if ($has_el) { |
if ($has_el) { |
875 |
|
|
909 |
if ($anode-> |
if ($anode-> |
910 |
node_type |
node_type |
911 |
== |
== |
912 |
'1' |
1 |
913 |
) { |
) { |
914 |
|
|
915 |
|
|
939 |
node_type |
node_type |
940 |
; |
; |
941 |
if ($ant == |
if ($ant == |
942 |
'1' |
1 |
943 |
) { |
) { |
944 |
|
|
945 |
|
|
959 |
|
|
960 |
; |
; |
961 |
} elsif ($ant == |
} elsif ($ant == |
962 |
'10' |
10 |
963 |
) { |
) { |
964 |
|
|
965 |
|
|
996 |
node_type |
node_type |
997 |
; |
; |
998 |
if ($ant == |
if ($ant == |
999 |
'1' |
1 |
1000 |
) { |
) { |
1001 |
|
|
1002 |
|
|
1016 |
|
|
1017 |
; |
; |
1018 |
} elsif ($ant == |
} elsif ($ant == |
1019 |
'10' |
10 |
1020 |
) { |
) { |
1021 |
|
|
1022 |
|
|
1046 |
node_type |
node_type |
1047 |
|
|
1048 |
== |
== |
1049 |
'10' |
10 |
1050 |
) { |
) { |
1051 |
|
|
1052 |
|
|
1101 |
## -- Node Type check |
## -- Node Type check |
1102 |
my @new_child; |
my @new_child; |
1103 |
if ({ |
if ({ |
1104 |
'3' => (not $strictc), |
3 => (not $strictc), |
1105 |
'5' => (not $strictc), |
5 => (not $strictc), |
1106 |
'1' => 1, |
1 => 1, |
1107 |
'4' => (not $strictc), |
4 => (not $strictc), |
1108 |
'7' => 1, |
7 => 1, |
1109 |
'8' => 1, |
8 => 1, |
1110 |
'10' => 1, |
10 => 1, |
1111 |
}->{$child_nt}) { |
}->{$child_nt}) { |
1112 |
push @new_child, $newChild; |
push @new_child, $newChild; |
1113 |
} elsif ($child_nt == |
} elsif ($child_nt == |
1114 |
'11' |
11 |
1115 |
) { |
) { |
1116 |
for my $cn (@{$newChild-> |
for my $cn (@{$newChild-> |
1117 |
child_nodes |
child_nodes |
1118 |
}) { |
}) { |
1119 |
unless ({ |
unless ({ |
1120 |
'3' => (not $strictc), |
3 => (not $strictc), |
1121 |
'5' => (not $strictc), |
5 => (not $strictc), |
1122 |
'1' => 1, |
1 => 1, |
1123 |
'4' => (not $strictc), |
4 => (not $strictc), |
1124 |
'7' => 1, |
7 => 1, |
1125 |
'8' => 1, |
8 => 1, |
1126 |
'10' => 1, |
10 => 1, |
1127 |
}->{$cn-> |
}->{$cn-> |
1128 |
node_type |
node_type |
1129 |
}) { |
}) { |
1344 |
## -- Removes from parent |
## -- Removes from parent |
1345 |
if ($nc_parent) { |
if ($nc_parent) { |
1346 |
if ($child_nt == |
if ($child_nt == |
1347 |
'11' |
11 |
1348 |
) { |
) { |
1349 |
|
|
1350 |
|
|
1481 |
|
|
1482 |
; |
; |
1483 |
if ($child_nt == |
if ($child_nt == |
1484 |
'10' and |
10 and |
1485 |
|
|
1486 |
not defined $newChild-> |
not defined $newChild-> |
1487 |
owner_document |
owner_document |
1579 |
$has_el; |
$has_el; |
1580 |
my $has_dt; |
my $has_dt; |
1581 |
if ($child_nt == |
if ($child_nt == |
1582 |
'1' |
1 |
1583 |
) { |
) { |
1584 |
$has_el = |
$has_el = |
1585 |
1 |
1 |
1586 |
; |
; |
1587 |
} elsif ($child_nt == |
} elsif ($child_nt == |
1588 |
'10' |
10 |
1589 |
) { |
) { |
1590 |
$has_dt = |
$has_dt = |
1591 |
1 |
1 |
1592 |
; |
; |
1593 |
} elsif ($child_nt == |
} elsif ($child_nt == |
1594 |
'11' |
11 |
1595 |
) { |
) { |
1596 |
for my $cn (@{$newChild-> |
for my $cn (@{$newChild-> |
1597 |
child_nodes |
child_nodes |
1600 |
node_type |
node_type |
1601 |
; |
; |
1602 |
if ($cnt == |
if ($cnt == |
1603 |
'1' |
1 |
1604 |
) { |
) { |
1605 |
if ($has_el) { |
if ($has_el) { |
1606 |
|
|
1637 |
if ($anode-> |
if ($anode-> |
1638 |
node_type |
node_type |
1639 |
== |
== |
1640 |
'1' |
1 |
1641 |
) { |
) { |
1642 |
|
|
1643 |
|
|
1669 |
node_type |
node_type |
1670 |
; |
; |
1671 |
if ($ant == |
if ($ant == |
1672 |
'1' |
1 |
1673 |
) { |
) { |
1674 |
|
|
1675 |
|
|
1689 |
|
|
1690 |
; |
; |
1691 |
} elsif ($ant == |
} elsif ($ant == |
1692 |
'10' |
10 |
1693 |
) { |
) { |
1694 |
|
|
1695 |
|
|
1723 |
node_type |
node_type |
1724 |
; |
; |
1725 |
if ($ant == |
if ($ant == |
1726 |
'1' |
1 |
1727 |
) { |
) { |
1728 |
|
|
1729 |
|
|
1743 |
|
|
1744 |
; |
; |
1745 |
} elsif ($ant == |
} elsif ($ant == |
1746 |
'10' |
10 |
1747 |
) { |
) { |
1748 |
|
|
1749 |
|
|
1775 |
node_type |
node_type |
1776 |
|
|
1777 |
== |
== |
1778 |
'10' |
10 |
1779 |
) { |
) { |
1780 |
|
|
1781 |
|
|
1830 |
## -- Node Type check |
## -- Node Type check |
1831 |
my @new_child; |
my @new_child; |
1832 |
if ({ |
if ({ |
1833 |
'3' => (not $strictc), |
3 => (not $strictc), |
1834 |
'5' => (not $strictc), |
5 => (not $strictc), |
1835 |
'1' => 1, |
1 => 1, |
1836 |
'4' => (not $strictc), |
4 => (not $strictc), |
1837 |
'7' => 1, |
7 => 1, |
1838 |
'8' => 1, |
8 => 1, |
1839 |
'10' => 1, |
10 => 1, |
1840 |
}->{$child_nt}) { |
}->{$child_nt}) { |
1841 |
push @new_child, $newChild; |
push @new_child, $newChild; |
1842 |
} elsif ($child_nt == |
} elsif ($child_nt == |
1843 |
'11' |
11 |
1844 |
) { |
) { |
1845 |
for my $cn (@{$newChild-> |
for my $cn (@{$newChild-> |
1846 |
child_nodes |
child_nodes |
1847 |
}) { |
}) { |
1848 |
unless ({ |
unless ({ |
1849 |
'3' => (not $strictc), |
3 => (not $strictc), |
1850 |
'5' => (not $strictc), |
5 => (not $strictc), |
1851 |
'1' => 1, |
1 => 1, |
1852 |
'4' => (not $strictc), |
4 => (not $strictc), |
1853 |
'7' => 1, |
7 => 1, |
1854 |
'8' => 1, |
8 => 1, |
1855 |
'10' => 1, |
10 => 1, |
1856 |
}->{$cn-> |
}->{$cn-> |
1857 |
node_type |
node_type |
1858 |
}) { |
}) { |
2096 |
## -- Removes from parent |
## -- Removes from parent |
2097 |
if ($nc_parent) { |
if ($nc_parent) { |
2098 |
if ($child_nt == |
if ($child_nt == |
2099 |
'11' |
11 |
2100 |
) { |
) { |
2101 |
|
|
2102 |
|
|
2241 |
|
|
2242 |
; |
; |
2243 |
if ($child_nt == |
if ($child_nt == |
2244 |
'10' and |
10 and |
2245 |
|
|
2246 |
not defined $newChild-> |
not defined $newChild-> |
2247 |
owner_document |
owner_document |
2332 |
$lc-> |
$lc-> |
2333 |
node_type |
node_type |
2334 |
== |
== |
2335 |
'3' |
3 |
2336 |
) { |
) { |
2337 |
$lc-> |
$lc-> |
2338 |
manakai_append_text |
manakai_append_text |
2446 |
$r} |
$r} |
2447 |
sub node_name ($;$) { |
sub node_name ($;$) { |
2448 |
if (@_ == 1) {my ($self) = @_; |
if (@_ == 1) {my ($self) = @_; |
2449 |
my $r = ''; |
my $r; |
2450 |
$r = '#document'; |
$r = '#document'; |
2451 |
$r; |
$r; |
2452 |
} else {my ($self) = @_; |
} else {my ($self) = @_; |
2455 |
} |
} |
2456 |
sub text_content ($;$) { |
sub text_content ($;$) { |
2457 |
if (@_ == 1) {my ($self) = @_; |
if (@_ == 1) {my ($self) = @_; |
2458 |
my $r = ''; |
my $r; |
2459 |
|
|
2460 |
{ |
{ |
2461 |
|
|
2490 |
node_type |
node_type |
2491 |
; |
; |
2492 |
if ($nt == |
if ($nt == |
2493 |
'3' or |
3 or |
2494 |
|
|
2495 |
$nt == |
$nt == |
2496 |
'4' |
4 |
2497 |
) { |
) { |
2498 |
$r .= $node-> |
$r .= $node-> |
2499 |
data |
data |
2502 |
is_element_content_whitespace |
is_element_content_whitespace |
2503 |
; |
; |
2504 |
} elsif ($nt == |
} elsif ($nt == |
2505 |
'1' or |
1 or |
2506 |
|
|
2507 |
$nt == |
$nt == |
2508 |
'5' |
5 |
2509 |
) { |
) { |
2510 |
unshift @target, @{$node-> |
unshift @target, @{$node-> |
2511 |
child_nodes |
child_nodes |
2681 |
{ |
{ |
2682 |
|
|
2683 |
if |
if |
2684 |
($Message::DOM::DOMFeature::ClassInfo->{ref $self} |
($Message::Util::AutoLoad::Registry::Feature->{$feature}->{$version}) { |
|
->{has_feature}->{$feature}->{$version}) { |
|
2685 |
$r = $self; |
$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 |
|
2686 |
} |
} |
2687 |
|
|
2688 |
|
|
2717 |
$r} |
$r} |
2718 |
sub base_uri ($;$) { |
sub base_uri ($;$) { |
2719 |
if (@_ == 1) {my ($self) = @_; |
if (@_ == 1) {my ($self) = @_; |
2720 |
my $r = ''; |
my $r; |
2721 |
|
|
2722 |
{ |
{ |
2723 |
|
|
2762 |
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'; |
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'; |
2763 |
} |
} |
2764 |
} |
} |
|
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} |
|
2765 |
sub create_document_fragment ($) { |
sub create_document_fragment ($) { |
2766 |
my ($self) = @_; |
my ($self) = @_; |
2767 |
my $r; |
my $r; |
2787 |
=> \ |
=> \ |
2788 |
( |
( |
2789 |
'tag:suika.fam.cx,2005-09:' . time . ':' . $$ . ':' . |
'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]) . |
|
2790 |
(++$Message::Util::ManakaiNode::UniqueIDN) |
(++$Message::Util::ManakaiNode::UniqueIDN) |
2791 |
) |
) |
2792 |
, |
, |
2854 |
|
|
2855 |
} |
} |
2856 |
$r} |
$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} |
|
2857 |
sub strict_error_checking ($;$) { |
sub strict_error_checking ($;$) { |
2858 |
if (@_ == 1) {my ($self) = @_; |
if (@_ == 1) {my ($self) = @_; |
2859 |
my $r = 0; |
my $r = 0; |
2954 |
if ($child-> |
if ($child-> |
2955 |
node_type |
node_type |
2956 |
== |
== |
2957 |
'1' |
1 |
2958 |
) { |
) { |
2959 |
$r = $child; |
$r = $child; |
2960 |
last F; |
last F; |
3008 |
|
|
3009 |
'b' |
'b' |
3010 |
=> $self->{'b'}, |
=> $self->{'b'}, |
3011 |
}, { |
}, {}); |
|
'nrifs' => ['Message::DOM::IFLatest::DOMImplementation'], |
|
|
}); |
|
3012 |
$self->{'b'}->{${$__v}}->{ |
$self->{'b'}->{${$__v}}->{ |
3013 |
'rc' |
'rc' |
3014 |
}++; |
}++; |
3033 |
} |
} |
3034 |
sub xml_version ($;$) { |
sub xml_version ($;$) { |
3035 |
if (@_ == 1) {my ($self) = @_; |
if (@_ == 1) {my ($self) = @_; |
3036 |
my $r = ''; |
my $r; |
3037 |
|
|
3038 |
{ |
{ |
3039 |
|
|
3132 |
node_type |
node_type |
3133 |
; |
; |
3134 |
if ($nt == |
if ($nt == |
3135 |
'10' |
10 |
3136 |
) { |
) { |
3137 |
$r = $child; |
$r = $child; |
3138 |
last F; |
last F; |
3139 |
} elsif ($nt == |
} elsif ($nt == |
3140 |
'1' |
1 |
3141 |
) { # document element |
) { # document element |
3142 |
last F; |
last F; |
3143 |
} |
} |
3228 |
} |
} |
3229 |
sub input_encoding ($;$) { |
sub input_encoding ($;$) { |
3230 |
if (@_ == 1) {my ($self) = @_; |
if (@_ == 1) {my ($self) = @_; |
3231 |
my $r = ''; |
my $r; |
3232 |
|
|
3233 |
{ |
{ |
3234 |
|
|
3295 |
} |
} |
3296 |
sub xml_encoding ($;$) { |
sub xml_encoding ($;$) { |
3297 |
if (@_ == 1) {my ($self) = @_; |
if (@_ == 1) {my ($self) = @_; |
3298 |
my $r = ''; |
my $r; |
3299 |
|
|
3300 |
{ |
{ |
3301 |
|
|
3474 |
; |
; |
3475 |
my $oe; |
my $oe; |
3476 |
if ($nt == |
if ($nt == |
3477 |
'2' |
2 |
3478 |
) { |
) { |
3479 |
$oe = $source-> |
$oe = $source-> |
3480 |
owner_element |
owner_element |
3488 |
; |
; |
3489 |
} |
} |
3490 |
} elsif ($nt == |
} elsif ($nt == |
3491 |
'9' or |
9 or |
3492 |
|
|
3493 |
$nt == |
$nt == |
3494 |
'10' or |
10 or |
3495 |
|
|
3496 |
$nt == |
$nt == |
3497 |
'6' or |
6 or |
3498 |
|
|
3499 |
$nt == |
$nt == |
3500 |
'12' |
12 |
3501 |
) { |
) { |
3502 |
|
|
3503 |
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'; |
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'; |
3521 |
; |
; |
3522 |
} |
} |
3523 |
if ($nt == |
if ($nt == |
3524 |
'1' |
1 |
3525 |
) { |
) { |
3526 |
push @change_od, $node; |
push @change_od, $node; |
3527 |
push @nodes, @{$node-> |
push @nodes, @{$node-> |
3539 |
($i); |
($i); |
3540 |
} |
} |
3541 |
} elsif ($nt == |
} elsif ($nt == |
3542 |
'2' or |
2 or |
3543 |
|
|
3544 |
$nt == |
$nt == |
3545 |
'5' or |
5 or |
3546 |
|
|
3547 |
$nt == |
$nt == |
3548 |
'11' |
11 |
3549 |
) { |
) { |
3550 |
push @change_od, $node; |
push @change_od, $node; |
3551 |
push @nodes, @{$node-> |
push @nodes, @{$node-> |
3552 |
child_nodes |
child_nodes |
3553 |
}; |
}; |
3554 |
} elsif ($nt == |
} elsif ($nt == |
3555 |
'3' or |
3 or |
3556 |
|
|
3557 |
$nt == |
$nt == |
3558 |
'8' or |
8 or |
3559 |
|
|
3560 |
$nt == |
$nt == |
3561 |
'7' or |
7 or |
3562 |
|
|
3563 |
$nt == |
$nt == |
3564 |
'4' |
4 |
3565 |
) { |
) { |
3566 |
push @change_od, $node; |
push @change_od, $node; |
3567 |
} else { |
} else { |
3696 |
handle |
handle |
3697 |
|
|
3698 |
( |
( |
3699 |
'5' |
5 |
3700 |
, |
, |
3701 |
$key, $src_ud->{$key}->[0], $src, |
$key, $src_ud->{$key}->[0], $src, |
3702 |
undef |
undef |
3732 |
next N unless $node-> |
next N unless $node-> |
3733 |
node_type |
node_type |
3734 |
== |
== |
3735 |
'1' |
1 |
3736 |
; |
; |
3737 |
for my $attr (@{$node-> |
for my $attr (@{$node-> |
3738 |
attributes |
attributes |
3810 |
|
|
3811 |
if |
if |
3812 |
(CORE::defined $namespaceURI and CORE::length $namespaceURI == 0) { |
(CORE::defined $namespaceURI and CORE::length $namespaceURI == 0) { |
3813 |
|
require Message::DOM::DOMMain; |
3814 |
|
|
3815 |
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'; |
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:1165044229:30838:aqhmc7623+http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom%23ManakaiDOMLatest'; |
3816 |
|
|
3817 |
; |
; |
3818 |
|
|
3927 |
|
|
3928 |
if |
if |
3929 |
(CORE::defined $namespaceURI and CORE::length $namespaceURI == 0) { |
(CORE::defined $namespaceURI and CORE::length $namespaceURI == 0) { |
3930 |
|
require Message::DOM::DOMMain; |
3931 |
|
|
3932 |
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'; |
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:1165044229:30838:aqhmc7623+http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom%23ManakaiDOMLatest'; |
3933 |
|
|
3934 |
; |
; |
3935 |
|
|
3954 |
$r} |
$r} |
3955 |
sub manakai_entity_base_uri ($;$) { |
sub manakai_entity_base_uri ($;$) { |
3956 |
if (@_ == 1) {my ($self) = @_; |
if (@_ == 1) {my ($self) = @_; |
3957 |
my $r = ''; |
my $r; |
3958 |
|
|
3959 |
{ |
{ |
3960 |
|
|
4138 |
'w0', |
'w0', |
4139 |
['impl']}; |
['impl']}; |
4140 |
package Message::DOM::IFLatest::DocumentFragment; |
package Message::DOM::IFLatest::DocumentFragment; |
4141 |
our $VERSION = 20060404.0922; |
our $VERSION = 20061202.0940; |
4142 |
package Message::DOM::Document::ManakaiDOMDocumentFragment; |
package Message::DOM::Document::ManakaiDOMDocumentFragment; |
4143 |
our $VERSION = 20060404.0922; |
our $VERSION = 20061202.0940; |
4144 |
push our @ISA, 'Message::DOM::TreeCore::ManakaiDOMNode', |
push our @ISA, 'Message::DOM::TreeCore::ManakaiDOMNode', |
4145 |
'Message::DOM::IF::DocumentFragment', |
'Message::DOM::IF::DocumentFragment', |
4146 |
'Message::DOM::IF::Node', |
'Message::DOM::IF::Node', |
4192 |
sub node_type ($;$) { |
sub node_type ($;$) { |
4193 |
if (@_ == 1) {my ($self) = @_; |
if (@_ == 1) {my ($self) = @_; |
4194 |
my $r; |
my $r; |
4195 |
$r = '11'; |
$r = 11; |
4196 |
$r; |
$r; |
4197 |
} else {my ($self) = @_; |
} else {my ($self) = @_; |
4198 |
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'; |
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'; |
4240 |
## -- Node Type check |
## -- Node Type check |
4241 |
my @new_child; |
my @new_child; |
4242 |
if ({ |
if ({ |
4243 |
'3' => 1, |
3 => 1, |
4244 |
'5' => 1, |
5 => 1, |
4245 |
'1' => 1, |
1 => 1, |
4246 |
'7' => 1, |
7 => 1, |
4247 |
'4' => 1, |
4 => 1, |
4248 |
'8' => 1, |
8 => 1, |
4249 |
}->{$child_nt}) { |
}->{$child_nt}) { |
4250 |
push @new_child, $newChild; |
push @new_child, $newChild; |
4251 |
} elsif ($child_nt == |
} elsif ($child_nt == |
4252 |
'11' |
11 |
4253 |
) { |
) { |
4254 |
for my $cn (@{$newChild-> |
for my $cn (@{$newChild-> |
4255 |
child_nodes |
child_nodes |
4256 |
}) { |
}) { |
4257 |
unless ({ |
unless ({ |
4258 |
'3' => 1, |
3 => 1, |
4259 |
'5' => 1, |
5 => 1, |
4260 |
'1' => 1, |
1 => 1, |
4261 |
'7' => 1, |
7 => 1, |
4262 |
'4' => 1, |
4 => 1, |
4263 |
'8' => 1, |
8 => 1, |
4264 |
}->{$cn-> |
}->{$cn-> |
4265 |
node_type |
node_type |
4266 |
}) { |
}) { |
4389 |
## -- Removes from parent |
## -- Removes from parent |
4390 |
if ($nc_parent) { |
if ($nc_parent) { |
4391 |
if ($child_nt == |
if ($child_nt == |
4392 |
'11' |
11 |
4393 |
) { |
) { |
4394 |
|
|
4395 |
|
|
4563 |
## -- Node Type check |
## -- Node Type check |
4564 |
my @new_child; |
my @new_child; |
4565 |
if ({ |
if ({ |
4566 |
'3' => 1, |
3 => 1, |
4567 |
'5' => 1, |
5 => 1, |
4568 |
'1' => 1, |
1 => 1, |
4569 |
'7' => 1, |
7 => 1, |
4570 |
'4' => 1, |
4 => 1, |
4571 |
'8' => 1, |
8 => 1, |
4572 |
}->{$child_nt}) { |
}->{$child_nt}) { |
4573 |
push @new_child, $newChild; |
push @new_child, $newChild; |
4574 |
} elsif ($child_nt == |
} elsif ($child_nt == |
4575 |
'11' |
11 |
4576 |
) { |
) { |
4577 |
for my $cn (@{$newChild-> |
for my $cn (@{$newChild-> |
4578 |
child_nodes |
child_nodes |
4579 |
}) { |
}) { |
4580 |
unless ({ |
unless ({ |
4581 |
'3' => 1, |
3 => 1, |
4582 |
'5' => 1, |
5 => 1, |
4583 |
'1' => 1, |
1 => 1, |
4584 |
'7' => 1, |
7 => 1, |
4585 |
'4' => 1, |
4 => 1, |
4586 |
'8' => 1, |
8 => 1, |
4587 |
}->{$cn-> |
}->{$cn-> |
4588 |
node_type |
node_type |
4589 |
}) { |
}) { |
4804 |
## -- Removes from parent |
## -- Removes from parent |
4805 |
if ($nc_parent) { |
if ($nc_parent) { |
4806 |
if ($child_nt == |
if ($child_nt == |
4807 |
'11' |
11 |
4808 |
) { |
) { |
4809 |
|
|
4810 |
|
|
4986 |
## -- Node Type check |
## -- Node Type check |
4987 |
my @new_child; |
my @new_child; |
4988 |
if ({ |
if ({ |
4989 |
'3' => 1, |
3 => 1, |
4990 |
'5' => 1, |
5 => 1, |
4991 |
'1' => 1, |
1 => 1, |
4992 |
'7' => 1, |
7 => 1, |
4993 |
'4' => 1, |
4 => 1, |
4994 |
'8' => 1, |
8 => 1, |
4995 |
}->{$child_nt}) { |
}->{$child_nt}) { |
4996 |
push @new_child, $newChild; |
push @new_child, $newChild; |
4997 |
} elsif ($child_nt == |
} elsif ($child_nt == |
4998 |
'11' |
11 |
4999 |
) { |
) { |
5000 |
for my $cn (@{$newChild-> |
for my $cn (@{$newChild-> |
5001 |
child_nodes |
child_nodes |
5002 |
}) { |
}) { |
5003 |
unless ({ |
unless ({ |
5004 |
'3' => 1, |
3 => 1, |
5005 |
'5' => 1, |
5 => 1, |
5006 |
'1' => 1, |
1 => 1, |
5007 |
'7' => 1, |
7 => 1, |
5008 |
'4' => 1, |
4 => 1, |
5009 |
'8' => 1, |
8 => 1, |
5010 |
}->{$cn-> |
}->{$cn-> |
5011 |
node_type |
node_type |
5012 |
}) { |
}) { |
5250 |
## -- Removes from parent |
## -- Removes from parent |
5251 |
if ($nc_parent) { |
if ($nc_parent) { |
5252 |
if ($child_nt == |
if ($child_nt == |
5253 |
'11' |
11 |
5254 |
) { |
) { |
5255 |
|
|
5256 |
|
|
5400 |
$r} |
$r} |
5401 |
sub node_name ($;$) { |
sub node_name ($;$) { |
5402 |
if (@_ == 1) {my ($self) = @_; |
if (@_ == 1) {my ($self) = @_; |
5403 |
my $r = ''; |
my $r; |
5404 |
$r = '#document-fragment'; |
$r = '#document-fragment'; |
5405 |
$r; |
$r; |
5406 |
} else {my ($self) = @_; |
} else {my ($self) = @_; |
5429 |
$lc-> |
$lc-> |
5430 |
node_type |
node_type |
5431 |
== |
== |
5432 |
'3' |
3 |
5433 |
) { |
) { |
5434 |
$lc-> |
$lc-> |
5435 |
manakai_append_text |
manakai_append_text |
5490 |
{ |
{ |
5491 |
|
|
5492 |
if |
if |
5493 |
($Message::DOM::DOMFeature::ClassInfo->{ref $self} |
($Message::Util::AutoLoad::Registry::Feature->{$feature}->{$version}) { |
|
->{has_feature}->{$feature}->{$version}) { |
|
5494 |
$r = $self; |
$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 |
|
5495 |
} |
} |
5496 |
|
|
5497 |
|
|
5526 |
$r} |
$r} |
5527 |
sub base_uri ($;$) { |
sub base_uri ($;$) { |
5528 |
if (@_ == 1) {my ($self) = @_; |
if (@_ == 1) {my ($self) = @_; |
5529 |
my $r = ''; |
my $r; |
5530 |
|
|
5531 |
{ |
{ |
5532 |
|
|