1 |
#!/usr/bin/perl |
2 |
## This file is automatically generated |
3 |
## at 2006-04-30T08:38:31+00:00, |
4 |
## from file "CharacterData.dis", |
5 |
## module <http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom#ManakaiDOM.CharacterData>, |
6 |
## for <http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom#ManakaiDOMLatest>. |
7 |
## Don't edit by hand! |
8 |
use strict; |
9 |
require Message::DOM::DOMCore; |
10 |
require Message::DOM::TreeCore; |
11 |
require Message::Util::Error::DOMException; |
12 |
package Message::DOM::CharacterData; |
13 |
our $VERSION = 20060430.0838; |
14 |
package Message::DOM::IFLatest::CharacterData; |
15 |
our $VERSION = 20060430.0838; |
16 |
package Message::DOM::CharacterData::ManakaiDOMCharacterData; |
17 |
our $VERSION = 20060430.0838; |
18 |
push our @ISA, 'Message::DOM::TreeCore::ManakaiDOMNode', |
19 |
'Message::DOM::IF::CharacterData', |
20 |
'Message::DOM::IF::Node', |
21 |
'Message::DOM::IFLatest::CharacterData', |
22 |
'Message::DOM::IFLatest::Node', |
23 |
'Message::DOM::IFLatest::StringExtended', |
24 |
'Message::DOM::IFLevel1::CharacterData', |
25 |
'Message::DOM::IFLevel1::Node', |
26 |
'Message::DOM::IFLevel2::CharacterData', |
27 |
'Message::DOM::IFLevel2::Node', |
28 |
'Message::DOM::IFLevel3::CharacterData', |
29 |
'Message::DOM::IFLevel3::Node'; |
30 |
use Message::Util::Error; |
31 |
sub ___create_node_stem ($$$$) { |
32 |
my ($self, $bag, $obj, $opt) = @_; |
33 |
my $r = {}; |
34 |
|
35 |
{ |
36 |
|
37 |
|
38 |
$obj->{ |
39 |
'con' |
40 |
} = $opt->{ |
41 |
'con' |
42 |
}; |
43 |
|
44 |
|
45 |
{ |
46 |
|
47 |
|
48 |
$obj->{'od'} = $opt->{'od'}->{ |
49 |
'id' |
50 |
}; |
51 |
$bag->{${$opt->{'od'}->{ |
52 |
'id' |
53 |
}}} |
54 |
->{'do'}->{${$obj->{ |
55 |
'id' |
56 |
}}} |
57 |
= $obj->{ |
58 |
'id' |
59 |
}; |
60 |
|
61 |
|
62 |
} |
63 |
|
64 |
; |
65 |
$r = $obj; |
66 |
|
67 |
|
68 |
} |
69 |
$r} |
70 |
sub child_nodes ($;$) { |
71 |
if (@_ == 1) {my ($self) = @_; |
72 |
my $r; |
73 |
|
74 |
{ |
75 |
|
76 |
|
77 |
{ |
78 |
|
79 |
|
80 |
$r = bless [], |
81 |
'Message::DOM::TreeCore::ManakaiDOMEmptyNodeList' |
82 |
; |
83 |
|
84 |
|
85 |
} |
86 |
|
87 |
; |
88 |
|
89 |
|
90 |
} |
91 |
$r; |
92 |
} else {my ($self) = @_; |
93 |
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::CharacterData::ManakaiDOMCharacterData', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#attr' => 'child_nodes'; |
94 |
} |
95 |
} |
96 |
sub append_child ($$) { |
97 |
my ($self, $newChild) = @_; |
98 |
my $r; |
99 |
|
100 |
{ |
101 |
|
102 |
report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'HIERARCHY_REQUEST_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#method' => 'append_child', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#HIERARCHY_BAD_TYPE', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#class' => 'Message::DOM::CharacterData::ManakaiDOMCharacterData', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#param-name' => 'newChild', 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#node' => $newChild; |
103 |
|
104 |
; |
105 |
|
106 |
|
107 |
} |
108 |
$r} |
109 |
sub insert_before ($$;$) { |
110 |
my ($self, $newChild, $refChild) = @_; |
111 |
my $r; |
112 |
|
113 |
{ |
114 |
|
115 |
report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'HIERARCHY_REQUEST_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#method' => 'insert_before', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#HIERARCHY_BAD_TYPE', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#class' => 'Message::DOM::CharacterData::ManakaiDOMCharacterData', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#param-name' => 'newChild', 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#node' => $newChild; |
116 |
|
117 |
; |
118 |
|
119 |
|
120 |
} |
121 |
$r} |
122 |
sub replace_child ($$$) { |
123 |
my ($self, $newChild, $oldChild) = @_; |
124 |
my $r; |
125 |
|
126 |
{ |
127 |
|
128 |
report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'HIERARCHY_REQUEST_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#method' => 'replace_child', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#HIERARCHY_BAD_TYPE', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#class' => 'Message::DOM::CharacterData::ManakaiDOMCharacterData', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#param-name' => 'newChild', 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#node' => $newChild; |
129 |
|
130 |
; |
131 |
|
132 |
|
133 |
} |
134 |
$r} |
135 |
sub manakai_append_text ($$) { |
136 |
my ($self, $string) = @_; |
137 |
my $r; |
138 |
|
139 |
{ |
140 |
|
141 |
|
142 |
{ |
143 |
|
144 |
local $Error::Depth = $Error::Depth + 1; |
145 |
|
146 |
{ |
147 |
|
148 |
|
149 |
if |
150 |
($self-> |
151 |
owner_document |
152 |
|
153 |
-> |
154 |
strict_error_checking and |
155 |
|
156 |
$self-> |
157 |
manakai_read_only |
158 |
) { |
159 |
|
160 |
|
161 |
{ |
162 |
|
163 |
local $Error::Depth = $Error::Depth - 1; |
164 |
|
165 |
{ |
166 |
|
167 |
report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'NO_MODIFICATION_ALLOWED_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#method' => 'manakai_append_text', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#NOMOD_THIS', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#class' => 'Message::DOM::CharacterData::ManakaiDOMCharacterData'; |
168 |
|
169 |
|
170 |
} |
171 |
|
172 |
|
173 |
;} |
174 |
|
175 |
; |
176 |
} |
177 |
my $v; |
178 |
|
179 |
|
180 |
{ |
181 |
|
182 |
|
183 |
$v = $self->{ |
184 |
'b' |
185 |
}->{${$self->{ |
186 |
'id' |
187 |
}}} |
188 |
->{'con'}; |
189 |
|
190 |
|
191 |
} |
192 |
|
193 |
; |
194 |
$$v .= ref $string eq 'SCALAR' ? $$string : $string; |
195 |
$r = $self; |
196 |
|
197 |
|
198 |
|
199 |
} |
200 |
|
201 |
|
202 |
;} |
203 |
|
204 |
; |
205 |
|
206 |
|
207 |
} |
208 |
$r} |
209 |
sub node_value ($;$) { |
210 |
if (@_ == 1) {my ($self) = @_; |
211 |
my $r = ''; |
212 |
|
213 |
{ |
214 |
|
215 |
my |
216 |
$v; |
217 |
|
218 |
|
219 |
{ |
220 |
|
221 |
|
222 |
$v = $self->{ |
223 |
'b' |
224 |
}->{${$self->{ |
225 |
'id' |
226 |
}}} |
227 |
->{'con'}; |
228 |
|
229 |
|
230 |
} |
231 |
|
232 |
; |
233 |
$r = $$v; |
234 |
|
235 |
|
236 |
} |
237 |
$r; |
238 |
} else {my ($self, $given) = @_; |
239 |
|
240 |
{ |
241 |
|
242 |
|
243 |
{ |
244 |
|
245 |
if |
246 |
($self-> |
247 |
manakai_read_only |
248 |
) { |
249 |
|
250 |
report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'NO_MODIFICATION_ALLOWED_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#NOMOD_THIS', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#resourceURI' => 'tag:suika.fam.cx,2005-09:http://suika.fam.cx/~wakaba/archive/2005/manakai/DOM/TreeCore/NodeReadOnlyError+http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom%23ManakaiDOMLatest'; |
251 |
|
252 |
; |
253 |
} |
254 |
|
255 |
|
256 |
} |
257 |
|
258 |
; |
259 |
my $v; |
260 |
|
261 |
|
262 |
{ |
263 |
|
264 |
|
265 |
$v = $self->{ |
266 |
'b' |
267 |
}->{${$self->{ |
268 |
'id' |
269 |
}}} |
270 |
->{'con'}; |
271 |
|
272 |
|
273 |
} |
274 |
|
275 |
; |
276 |
$$v = defined $given ? $given : ''; |
277 |
## NOTE: Setting NULL is supported for |
278 |
## compatibility with |textContent|. |
279 |
|
280 |
|
281 |
} |
282 |
} |
283 |
} |
284 |
sub text_content ($;$) { |
285 |
if (@_ == 1) {my ($self) = @_; |
286 |
my $r = ''; |
287 |
|
288 |
{ |
289 |
|
290 |
my |
291 |
$v; |
292 |
|
293 |
|
294 |
{ |
295 |
|
296 |
|
297 |
$v = $self->{ |
298 |
'b' |
299 |
}->{${$self->{ |
300 |
'id' |
301 |
}}} |
302 |
->{'con'}; |
303 |
|
304 |
|
305 |
} |
306 |
|
307 |
; |
308 |
$r = $$v; |
309 |
|
310 |
|
311 |
} |
312 |
$r; |
313 |
} else {my ($self, $given) = @_; |
314 |
|
315 |
{ |
316 |
|
317 |
|
318 |
{ |
319 |
|
320 |
if |
321 |
($self-> |
322 |
manakai_read_only |
323 |
) { |
324 |
|
325 |
report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'NO_MODIFICATION_ALLOWED_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#NOMOD_THIS', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#resourceURI' => 'tag:suika.fam.cx,2005-09:http://suika.fam.cx/~wakaba/archive/2005/manakai/DOM/TreeCore/NodeReadOnlyError+http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom%23ManakaiDOMLatest'; |
326 |
|
327 |
; |
328 |
} |
329 |
|
330 |
|
331 |
} |
332 |
|
333 |
; |
334 |
my $v; |
335 |
|
336 |
|
337 |
{ |
338 |
|
339 |
|
340 |
$v = $self->{ |
341 |
'b' |
342 |
}->{${$self->{ |
343 |
'id' |
344 |
}}} |
345 |
->{'con'}; |
346 |
|
347 |
|
348 |
} |
349 |
|
350 |
; |
351 |
$$v = defined $given ? $given : ''; |
352 |
## NOTE: Setting NULL is supported for |
353 |
## compatibility with |textContent|. |
354 |
|
355 |
|
356 |
} |
357 |
} |
358 |
} |
359 |
sub base_uri ($;$) { |
360 |
if (@_ == 1) {my ($self) = @_; |
361 |
my $r = ''; |
362 |
|
363 |
{ |
364 |
|
365 |
|
366 |
{ |
367 |
|
368 |
local $Error::Depth = $Error::Depth + 1; |
369 |
|
370 |
{ |
371 |
|
372 |
|
373 |
my |
374 |
$pe = $self-> |
375 |
parent_node |
376 |
; |
377 |
W: { |
378 |
while (defined $pe) { |
379 |
my $nt = $pe-> |
380 |
node_type |
381 |
; |
382 |
if ($nt == |
383 |
'1' or |
384 |
|
385 |
$nt == |
386 |
'2' or |
387 |
|
388 |
$nt == |
389 |
'9' or |
390 |
|
391 |
$nt == |
392 |
'11' or |
393 |
|
394 |
$nt == |
395 |
'6' |
396 |
) { |
397 |
$r = $pe-> |
398 |
base_uri |
399 |
; |
400 |
last W; |
401 |
} elsif ($nt == |
402 |
'5' |
403 |
) { |
404 |
if ($pe-> |
405 |
manakai_external |
406 |
) { |
407 |
$r = $pe-> |
408 |
manakai_entity_base_uri |
409 |
; |
410 |
last W; |
411 |
} |
412 |
} |
413 |
$pe = $pe-> |
414 |
parent_node |
415 |
; |
416 |
} |
417 |
if ($pe) { |
418 |
$r = $pe-> |
419 |
base_uri |
420 |
; |
421 |
} else { |
422 |
$r = $self-> |
423 |
owner_document |
424 |
-> |
425 |
base_uri |
426 |
; |
427 |
} |
428 |
} # W |
429 |
|
430 |
|
431 |
|
432 |
} |
433 |
|
434 |
|
435 |
;} |
436 |
|
437 |
; |
438 |
|
439 |
|
440 |
} |
441 |
$r; |
442 |
} else {my ($self) = @_; |
443 |
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::CharacterData::ManakaiDOMCharacterData', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#attr' => 'base_uri'; |
444 |
} |
445 |
} |
446 |
sub find_offset16 ($$) { |
447 |
my ($self, $offset32) = @_; |
448 |
my $r = 0; |
449 |
|
450 |
{ |
451 |
|
452 |
my |
453 |
$v; |
454 |
|
455 |
|
456 |
{ |
457 |
|
458 |
|
459 |
$v = $self->{ |
460 |
'b' |
461 |
}->{${$self->{ |
462 |
'id' |
463 |
}}} |
464 |
->{'con'}; |
465 |
|
466 |
|
467 |
} |
468 |
|
469 |
; |
470 |
|
471 |
if (not defined $offset32 or $offset32 < 0 or |
472 |
CORE::length ($$v) < $offset32) { |
473 |
|
474 |
report Message::DOM::DOMCore::ManakaiDOMException -object => $self, 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#index' => $offset32, '-type' => 'INDEX_SIZE_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#method' => 'find_offset16', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#StringIndexOutOfBoundsException', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#class' => 'Message::DOM::CharacterData::ManakaiDOMCharacterData', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#param-name' => 'offset32'; |
475 |
|
476 |
; |
477 |
} |
478 |
|
479 |
my $ss = substr $$v, 0, $offset32; |
480 |
$r = $offset32; |
481 |
if ($ss =~ /[\x{10000}-\x{10FFFF}]/) { |
482 |
while ($ss =~ /[\x{10000}-\x{10FFFF}]+/g) { |
483 |
$r += $+[0] - $-[0]; |
484 |
} |
485 |
} |
486 |
|
487 |
|
488 |
} |
489 |
$r} |
490 |
sub find_offset32 ($$) { |
491 |
my ($self, $offset16) = @_; |
492 |
my $r = 0; |
493 |
|
494 |
{ |
495 |
|
496 |
my |
497 |
$v; |
498 |
|
499 |
|
500 |
{ |
501 |
|
502 |
|
503 |
$v = $self->{ |
504 |
'b' |
505 |
}->{${$self->{ |
506 |
'id' |
507 |
}}} |
508 |
->{'con'}; |
509 |
|
510 |
|
511 |
} |
512 |
|
513 |
; |
514 |
|
515 |
if (not defined $offset16 or $offset16 < 0) { |
516 |
|
517 |
report Message::DOM::DOMCore::ManakaiDOMException -object => $self, 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#index' => $offset16, '-type' => 'INDEX_SIZE_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#method' => 'find_offset32', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#StringIndexOutOfBoundsException', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#class' => 'Message::DOM::CharacterData::ManakaiDOMCharacterData', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#param-name' => 'offset16'; |
518 |
|
519 |
; |
520 |
} |
521 |
|
522 |
my $o = $offset16; |
523 |
while ($o > 0) { |
524 |
my $c = substr ($$v, $r, 1); |
525 |
if (length $c) { |
526 |
if ($c =~ /[\x{10000}-\x{10FFFF}]/) { |
527 |
$o -= 2; |
528 |
} else { |
529 |
$o--; |
530 |
} |
531 |
$r++; |
532 |
} else { |
533 |
|
534 |
report Message::DOM::DOMCore::ManakaiDOMException -object => $self, 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#index' => $offset16, '-type' => 'INDEX_SIZE_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#method' => 'find_offset32', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#StringIndexOutOfBoundsException', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#class' => 'Message::DOM::CharacterData::ManakaiDOMCharacterData', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#param-name' => 'offset16'; |
535 |
|
536 |
; |
537 |
} |
538 |
} |
539 |
|
540 |
|
541 |
} |
542 |
$r} |
543 |
sub data ($;$) { |
544 |
if (@_ == 1) {my ($self) = @_; |
545 |
my $r = ''; |
546 |
|
547 |
{ |
548 |
|
549 |
my |
550 |
$v; |
551 |
|
552 |
|
553 |
{ |
554 |
|
555 |
|
556 |
$v = $self->{ |
557 |
'b' |
558 |
}->{${$self->{ |
559 |
'id' |
560 |
}}} |
561 |
->{'con'}; |
562 |
|
563 |
|
564 |
} |
565 |
|
566 |
; |
567 |
$r = $$v; |
568 |
|
569 |
|
570 |
} |
571 |
$r; |
572 |
} else {my ($self, $given) = @_; |
573 |
|
574 |
{ |
575 |
|
576 |
|
577 |
{ |
578 |
|
579 |
if |
580 |
($self-> |
581 |
manakai_read_only |
582 |
) { |
583 |
|
584 |
report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'NO_MODIFICATION_ALLOWED_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#NOMOD_THIS', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#resourceURI' => 'tag:suika.fam.cx,2005-09:http://suika.fam.cx/~wakaba/archive/2005/manakai/DOM/TreeCore/NodeReadOnlyError+http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom%23ManakaiDOMLatest'; |
585 |
|
586 |
; |
587 |
} |
588 |
|
589 |
|
590 |
} |
591 |
|
592 |
; |
593 |
my $v; |
594 |
|
595 |
|
596 |
{ |
597 |
|
598 |
|
599 |
$v = $self->{ |
600 |
'b' |
601 |
}->{${$self->{ |
602 |
'id' |
603 |
}}} |
604 |
->{'con'}; |
605 |
|
606 |
|
607 |
} |
608 |
|
609 |
; |
610 |
$$v = defined $given ? $given : ''; |
611 |
## NOTE: Setting NULL is supported for |
612 |
## compatibility with |textContent|. |
613 |
|
614 |
|
615 |
} |
616 |
} |
617 |
} |
618 |
sub length ($;$) { |
619 |
if (@_ == 1) {my ($self) = @_; |
620 |
my $r = 0; |
621 |
|
622 |
{ |
623 |
|
624 |
my |
625 |
$v; |
626 |
|
627 |
|
628 |
{ |
629 |
|
630 |
|
631 |
$v = $self->{ |
632 |
'b' |
633 |
}->{${$self->{ |
634 |
'id' |
635 |
}}} |
636 |
->{'con'}; |
637 |
|
638 |
|
639 |
} |
640 |
|
641 |
; |
642 |
$r = CORE::length $$v; |
643 |
$r++ while $$v =~ /[\x{10000}-\x{10FFFF}]/g; |
644 |
|
645 |
|
646 |
} |
647 |
$r; |
648 |
} else {my ($self) = @_; |
649 |
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::CharacterData::ManakaiDOMCharacterData', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#attr' => 'length'; |
650 |
} |
651 |
} |
652 |
sub substring_data ($$$) { |
653 |
my ($self, $offset, $count) = @_; |
654 |
my $r = ''; |
655 |
|
656 |
{ |
657 |
|
658 |
|
659 |
{ |
660 |
|
661 |
if |
662 |
($self-> |
663 |
manakai_read_only |
664 |
) { |
665 |
|
666 |
report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'NO_MODIFICATION_ALLOWED_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#NOMOD_THIS', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#resourceURI' => 'tag:suika.fam.cx,2005-09:http://suika.fam.cx/~wakaba/archive/2005/manakai/DOM/TreeCore/NodeReadOnlyError+http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom%23ManakaiDOMLatest'; |
667 |
|
668 |
; |
669 |
} |
670 |
|
671 |
|
672 |
} |
673 |
|
674 |
; |
675 |
if ($count < 0) { |
676 |
|
677 |
report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'INDEX_SIZE_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#method' => 'substring_data', 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#length' => $count, 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#NEGATIVE_LENGTH_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#class' => 'Message::DOM::CharacterData::ManakaiDOMCharacterData', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#param-name' => 'count'; |
678 |
|
679 |
; |
680 |
} |
681 |
my $eoffset32; |
682 |
|
683 |
|
684 |
try {local $Error::Depth = $Error::Depth + 3; |
685 |
|
686 |
|
687 |
$eoffset32 = $self-> |
688 |
find_offset32 |
689 |
|
690 |
($offset + $count); |
691 |
} catch |
692 |
Message::DOM::IFLatest::DOMException with |
693 |
{ |
694 |
my $err = shift; |
695 |
if ($err->subtype eq |
696 |
'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#StringIndexOutOfBoundsException' |
697 |
) { |
698 |
$eoffset32 = ($offset + $count) * 2; |
699 |
} else { |
700 |
$err->throw; |
701 |
} |
702 |
}; |
703 |
|
704 |
|
705 |
{ |
706 |
|
707 |
local $Error::Depth = $Error::Depth + 1; |
708 |
|
709 |
{ |
710 |
|
711 |
|
712 |
my |
713 |
$offset32 = $self-> |
714 |
find_offset32 |
715 |
($offset); |
716 |
my $data = $self-> |
717 |
data |
718 |
; |
719 |
$r = substr ($data, $offset32, $eoffset32 - $offset32); |
720 |
|
721 |
|
722 |
|
723 |
} |
724 |
|
725 |
|
726 |
;} |
727 |
|
728 |
; |
729 |
|
730 |
|
731 |
} |
732 |
$r} |
733 |
sub append_data ($$) { |
734 |
my ($self, $arg) = @_; |
735 |
|
736 |
{ |
737 |
|
738 |
|
739 |
{ |
740 |
|
741 |
local $Error::Depth = $Error::Depth + 1; |
742 |
|
743 |
{ |
744 |
|
745 |
|
746 |
|
747 |
$self-> |
748 |
manakai_append_text |
749 |
(\$arg); |
750 |
|
751 |
|
752 |
|
753 |
} |
754 |
|
755 |
|
756 |
;} |
757 |
|
758 |
; |
759 |
|
760 |
|
761 |
} |
762 |
} |
763 |
sub insert_data ($$$) { |
764 |
my ($self, $offset, $arg) = @_; |
765 |
|
766 |
{ |
767 |
|
768 |
|
769 |
{ |
770 |
|
771 |
if |
772 |
($self-> |
773 |
manakai_read_only |
774 |
) { |
775 |
|
776 |
report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'NO_MODIFICATION_ALLOWED_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#NOMOD_THIS', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#resourceURI' => 'tag:suika.fam.cx,2005-09:http://suika.fam.cx/~wakaba/archive/2005/manakai/DOM/TreeCore/NodeReadOnlyError+http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom%23ManakaiDOMLatest'; |
777 |
|
778 |
; |
779 |
} |
780 |
|
781 |
|
782 |
} |
783 |
|
784 |
; |
785 |
|
786 |
|
787 |
{ |
788 |
|
789 |
local $Error::Depth = $Error::Depth + 1; |
790 |
|
791 |
{ |
792 |
|
793 |
|
794 |
my |
795 |
$offset32 = $self-> |
796 |
find_offset32 |
797 |
($offset); |
798 |
my $data = $self-> |
799 |
data |
800 |
; |
801 |
substr ($data, $offset32, 0) = $arg; |
802 |
$self-> |
803 |
data |
804 |
($data); |
805 |
|
806 |
|
807 |
|
808 |
} |
809 |
|
810 |
|
811 |
;} |
812 |
|
813 |
; |
814 |
|
815 |
|
816 |
} |
817 |
} |
818 |
sub delete_data ($$$) { |
819 |
my ($self, $offset, $count) = @_; |
820 |
|
821 |
{ |
822 |
|
823 |
|
824 |
{ |
825 |
|
826 |
if |
827 |
($self-> |
828 |
manakai_read_only |
829 |
) { |
830 |
|
831 |
report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'NO_MODIFICATION_ALLOWED_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#NOMOD_THIS', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#resourceURI' => 'tag:suika.fam.cx,2005-09:http://suika.fam.cx/~wakaba/archive/2005/manakai/DOM/TreeCore/NodeReadOnlyError+http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom%23ManakaiDOMLatest'; |
832 |
|
833 |
; |
834 |
} |
835 |
|
836 |
|
837 |
} |
838 |
|
839 |
; |
840 |
if ($count < 0) { |
841 |
|
842 |
report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'INDEX_SIZE_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#method' => 'delete_data', 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#length' => $count, 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#NEGATIVE_LENGTH_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#class' => 'Message::DOM::CharacterData::ManakaiDOMCharacterData', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#param-name' => 'count'; |
843 |
|
844 |
; |
845 |
} |
846 |
my $eoffset32; |
847 |
|
848 |
|
849 |
try {local $Error::Depth = $Error::Depth + 3; |
850 |
|
851 |
|
852 |
$eoffset32 = $self-> |
853 |
find_offset32 |
854 |
|
855 |
($offset + $count); |
856 |
} catch |
857 |
Message::DOM::IFLatest::DOMException with |
858 |
{ |
859 |
my $err = shift; |
860 |
if ($err->subtype eq |
861 |
'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#StringIndexOutOfBoundsException' |
862 |
) { |
863 |
$eoffset32 = ($offset + $count) * 2; |
864 |
} else { |
865 |
$err->throw; |
866 |
} |
867 |
}; |
868 |
|
869 |
|
870 |
{ |
871 |
|
872 |
local $Error::Depth = $Error::Depth + 1; |
873 |
|
874 |
{ |
875 |
|
876 |
|
877 |
my |
878 |
$offset32 = $self-> |
879 |
find_offset32 |
880 |
($offset); |
881 |
my $data = $self-> |
882 |
data |
883 |
; |
884 |
substr ($data, $offset32, $eoffset32 - $offset32) = ''; |
885 |
$self-> |
886 |
data |
887 |
($data); |
888 |
|
889 |
|
890 |
|
891 |
} |
892 |
|
893 |
|
894 |
;} |
895 |
|
896 |
; |
897 |
|
898 |
|
899 |
} |
900 |
} |
901 |
sub replace_data ($$$$) { |
902 |
my ($self, $offset, $count, $arg) = @_; |
903 |
|
904 |
{ |
905 |
|
906 |
|
907 |
{ |
908 |
|
909 |
local $Error::Depth = $Error::Depth + 1; |
910 |
|
911 |
{ |
912 |
|
913 |
|
914 |
|
915 |
$self-> |
916 |
delete_data |
917 |
($offset, $count); |
918 |
$self-> |
919 |
insert_data |
920 |
($offset, $arg); |
921 |
|
922 |
|
923 |
|
924 |
} |
925 |
|
926 |
|
927 |
;} |
928 |
|
929 |
; |
930 |
|
931 |
|
932 |
} |
933 |
} |
934 |
$Message::DOM::DOMFeature::ClassInfo->{q<Message::DOM::CharacterData::ManakaiDOMCharacterData>}->{has_feature} = {'core', |
935 |
{'', |
936 |
'1', |
937 |
'1.0', |
938 |
'1', |
939 |
'2.0', |
940 |
'1', |
941 |
'3.0', |
942 |
'1'}, |
943 |
'xml', |
944 |
{'', |
945 |
'1', |
946 |
'1.0', |
947 |
'1', |
948 |
'2.0', |
949 |
'1', |
950 |
'3.0', |
951 |
'1'}, |
952 |
'xmlversion', |
953 |
{'', |
954 |
'1', |
955 |
'1.0', |
956 |
'1', |
957 |
'1.1', |
958 |
'1'}}; |
959 |
$Message::DOM::ClassPoint{q<Message::DOM::CharacterData::ManakaiDOMCharacterData>} = 14.1; |
960 |
$Message::Util::Grove::ClassProp{q<Message::DOM::CharacterData::ManakaiDOMCharacterData>} = {'o0', |
961 |
['parent'], |
962 |
'w0', |
963 |
['od']}; |
964 |
package Message::DOM::IFLatest::Text; |
965 |
our $VERSION = 20060430.0838; |
966 |
package Message::DOM::CharacterData::ManakaiDOMText; |
967 |
our $VERSION = 20060430.0838; |
968 |
push our @ISA, 'Message::DOM::CharacterData::ManakaiDOMCharacterData', |
969 |
'Message::DOM::IF::CharacterData', |
970 |
'Message::DOM::IF::Node', |
971 |
'Message::DOM::IF::Text', |
972 |
'Message::DOM::IFLatest::CharacterData', |
973 |
'Message::DOM::IFLatest::Node', |
974 |
'Message::DOM::IFLatest::Text', |
975 |
'Message::DOM::IFLevel1::CharacterData', |
976 |
'Message::DOM::IFLevel1::Node', |
977 |
'Message::DOM::IFLevel1::Text', |
978 |
'Message::DOM::IFLevel2::CharacterData', |
979 |
'Message::DOM::IFLevel2::Node', |
980 |
'Message::DOM::IFLevel2::Text', |
981 |
'Message::DOM::IFLevel3::CharacterData', |
982 |
'Message::DOM::IFLevel3::Node', |
983 |
'Message::DOM::IFLevel3::Text'; |
984 |
sub node_type ($;$) { |
985 |
if (@_ == 1) {my ($self) = @_; |
986 |
my $r; |
987 |
$r = '3'; |
988 |
$r; |
989 |
} else {my ($self) = @_; |
990 |
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::CharacterData::ManakaiDOMText', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#attr' => 'node_type'; |
991 |
} |
992 |
} |
993 |
sub node_name ($;$) { |
994 |
if (@_ == 1) {my ($self) = @_; |
995 |
my $r = '#text'; |
996 |
$r; |
997 |
} else {my ($self) = @_; |
998 |
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::CharacterData::ManakaiDOMText', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#attr' => 'node_name'; |
999 |
} |
1000 |
} |
1001 |
sub get_feature ($$$) { |
1002 |
my ($self, $feature, $version) = @_; |
1003 |
|
1004 |
{ |
1005 |
|
1006 |
|
1007 |
$feature = lc $feature; |
1008 |
|
1009 |
|
1010 |
} |
1011 |
|
1012 |
{ |
1013 |
|
1014 |
|
1015 |
$version = '' unless defined $version; |
1016 |
|
1017 |
|
1018 |
} |
1019 |
my $r; |
1020 |
|
1021 |
{ |
1022 |
|
1023 |
|
1024 |
$feature =~ s/^\+//; |
1025 |
|
1026 |
|
1027 |
{ |
1028 |
|
1029 |
if |
1030 |
($Message::DOM::DOMFeature::ClassInfo->{ref $self} |
1031 |
->{has_feature}->{$feature}->{$version}) { |
1032 |
$r = $self; |
1033 |
} else { |
1034 |
CLASS: for my $__class (sort { |
1035 |
$Message::DOM::ClassPoint{$b} <=> $Message::DOM::ClassPoint{$a} |
1036 |
} grep { |
1037 |
$Message::DOM::DOMFeature::ClassInfo->{'Message::DOM::CharacterData::ManakaiDOMText'} |
1038 |
->{compat_class}->{$_} |
1039 |
} keys %{$Message::DOM::DOMFeature::ClassInfo->{'Message::DOM::CharacterData::ManakaiDOMText'} |
1040 |
->{compat_class} or {}}) { |
1041 |
if ($Message::DOM::DOMFeature::ClassInfo->{$__class} |
1042 |
->{has_feature}->{$feature}->{$version}) { |
1043 |
|
1044 |
|
1045 |
{ |
1046 |
|
1047 |
|
1048 |
$r = ${($self->{'b'})->{${($self->{'id'})}}->{ |
1049 |
'cls' |
1050 |
}}->___create_node_ref ({ |
1051 |
|
1052 |
'id' |
1053 |
=> ($self->{'id'}), |
1054 |
|
1055 |
'b' |
1056 |
=> ($self->{'b'}), |
1057 |
}, { |
1058 |
'nrcls' => \$__class, |
1059 |
}); |
1060 |
($self->{'b'})->{${($self->{'id'})}}->{ |
1061 |
'rc' |
1062 |
}++; |
1063 |
|
1064 |
|
1065 |
} |
1066 |
|
1067 |
; |
1068 |
last CLASS; |
1069 |
} |
1070 |
} # CLASS |
1071 |
} |
1072 |
|
1073 |
|
1074 |
} |
1075 |
|
1076 |
; |
1077 |
unless (defined $r) { |
1078 |
|
1079 |
|
1080 |
{ |
1081 |
|
1082 |
local $Error::Depth = $Error::Depth + 1; |
1083 |
|
1084 |
{ |
1085 |
|
1086 |
|
1087 |
|
1088 |
$r = $self->SUPER::get_feature ($feature, $version); |
1089 |
|
1090 |
|
1091 |
|
1092 |
} |
1093 |
|
1094 |
|
1095 |
;} |
1096 |
|
1097 |
; |
1098 |
} |
1099 |
|
1100 |
|
1101 |
} |
1102 |
$r} |
1103 |
sub is_element_content_whitespace ($;$) { |
1104 |
if (@_ == 1) {my ($self) = @_; |
1105 |
my $r = 0; |
1106 |
|
1107 |
{ |
1108 |
|
1109 |
|
1110 |
{ |
1111 |
|
1112 |
|
1113 |
$r = $self->{ |
1114 |
'b' |
1115 |
}->{${$self->{ |
1116 |
'id' |
1117 |
}}} |
1118 |
->{'ecws'}; |
1119 |
|
1120 |
|
1121 |
} |
1122 |
|
1123 |
; |
1124 |
|
1125 |
|
1126 |
} |
1127 |
$r; |
1128 |
} else {my ($self, $given) = @_; |
1129 |
|
1130 |
{ |
1131 |
|
1132 |
|
1133 |
{ |
1134 |
|
1135 |
if |
1136 |
($self-> |
1137 |
manakai_read_only |
1138 |
) { |
1139 |
|
1140 |
report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'NO_MODIFICATION_ALLOWED_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#NOMOD_THIS', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#resourceURI' => 'tag:suika.fam.cx,2005-09:http://suika.fam.cx/~wakaba/archive/2005/manakai/DOM/TreeCore/NodeReadOnlyError+http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom%23ManakaiDOMLatest'; |
1141 |
|
1142 |
; |
1143 |
} |
1144 |
|
1145 |
|
1146 |
} |
1147 |
|
1148 |
; |
1149 |
|
1150 |
|
1151 |
{ |
1152 |
|
1153 |
|
1154 |
$self->{ |
1155 |
'b' |
1156 |
}->{${$self->{ |
1157 |
'id' |
1158 |
}}} |
1159 |
->{'ecws'} = $given; |
1160 |
|
1161 |
|
1162 |
} |
1163 |
|
1164 |
; |
1165 |
|
1166 |
|
1167 |
} |
1168 |
} |
1169 |
} |
1170 |
sub whole_text ($;$) { |
1171 |
if (@_ == 1) {my ($self) = @_; |
1172 |
my $r = ''; |
1173 |
|
1174 |
{ |
1175 |
|
1176 |
|
1177 |
{ |
1178 |
|
1179 |
local $Error::Depth = $Error::Depth + 1; |
1180 |
|
1181 |
{ |
1182 |
|
1183 |
|
1184 |
require |
1185 |
Message::DOM::Traversal; |
1186 |
my $doc = $self-> |
1187 |
owner_document |
1188 |
; |
1189 |
my $doctrv = $doc-> |
1190 |
get_feature |
1191 |
(Traversal => '2.0'); |
1192 |
my $tw1 = $doctrv-> |
1193 |
create_tree_walker |
1194 |
|
1195 |
($doc, |
1196 |
'4294967295' |
1197 |
, sub { |
1198 |
($_[1]-> |
1199 |
node_type |
1200 |
|
1201 |
== |
1202 |
'5' |
1203 |
) |
1204 |
? |
1205 |
'3' |
1206 |
: |
1207 |
|
1208 |
'1' |
1209 |
|
1210 |
}, |
1211 |
1 |
1212 |
); |
1213 |
$tw1-> |
1214 |
current_node |
1215 |
($self); |
1216 |
my $tw2 = $tw1->clone; |
1217 |
$r = $self-> |
1218 |
node_value |
1219 |
; |
1220 |
|
1221 |
S: while (defined (my $node = $tw1-> |
1222 |
previous_sibling |
1223 |
)) { |
1224 |
my $nt = $node-> |
1225 |
node_type |
1226 |
; |
1227 |
if ($nt == |
1228 |
'3' or |
1229 |
|
1230 |
$nt == |
1231 |
'4' |
1232 |
) { |
1233 |
$r = $node-> |
1234 |
node_value |
1235 |
. $r; |
1236 |
} else { |
1237 |
last S; |
1238 |
} |
1239 |
} # S |
1240 |
|
1241 |
S: while (defined (my $node = $tw2-> |
1242 |
next_sibling |
1243 |
)) { |
1244 |
my $nt = $node-> |
1245 |
node_type |
1246 |
; |
1247 |
if ($nt == |
1248 |
'3' or |
1249 |
|
1250 |
$nt == |
1251 |
'4' |
1252 |
) { |
1253 |
$r .= $node-> |
1254 |
node_value |
1255 |
; |
1256 |
} else { |
1257 |
last S; |
1258 |
} |
1259 |
} # S |
1260 |
|
1261 |
|
1262 |
|
1263 |
} |
1264 |
|
1265 |
|
1266 |
;} |
1267 |
|
1268 |
; |
1269 |
|
1270 |
|
1271 |
} |
1272 |
$r; |
1273 |
} else {my ($self) = @_; |
1274 |
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::CharacterData::ManakaiDOMText', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#attr' => 'whole_text'; |
1275 |
} |
1276 |
} |
1277 |
sub replace_whole_text ($$) { |
1278 |
my ($self, $content) = @_; |
1279 |
my $r; |
1280 |
report Message::Util::Error::DOMException::CoreException -object => $self, '-type' => 'NOT_SUPPORTED_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#method' => 'replace_whole_text', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#MDOM_IMPL_METHOD_NOT_IMPLEMENTED', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#class' => 'Message::DOM::CharacterData::ManakaiDOMText'; |
1281 |
$r} |
1282 |
sub split_text ($$) { |
1283 |
my ($self, $offset) = @_; |
1284 |
my $r; |
1285 |
|
1286 |
{ |
1287 |
|
1288 |
|
1289 |
{ |
1290 |
|
1291 |
if |
1292 |
($self-> |
1293 |
manakai_read_only |
1294 |
) { |
1295 |
|
1296 |
report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'NO_MODIFICATION_ALLOWED_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#NOMOD_THIS', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#resourceURI' => 'tag:suika.fam.cx,2005-09:http://suika.fam.cx/~wakaba/archive/2005/manakai/DOM/TreeCore/NodeReadOnlyError+http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom%23ManakaiDOMLatest'; |
1297 |
|
1298 |
; |
1299 |
} |
1300 |
|
1301 |
|
1302 |
} |
1303 |
|
1304 |
; |
1305 |
my $parent = $self-> |
1306 |
parent_node |
1307 |
; |
1308 |
if (defined $parent and $parent-> |
1309 |
manakai_read_only |
1310 |
) { |
1311 |
|
1312 |
report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'NO_MODIFICATION_ALLOWED_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#method' => 'split_text', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#NOMOD_PARENT', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#class' => 'Message::DOM::CharacterData::ManakaiDOMText'; |
1313 |
|
1314 |
; |
1315 |
} |
1316 |
|
1317 |
|
1318 |
|
1319 |
{ |
1320 |
|
1321 |
local $Error::Depth = $Error::Depth + 1; |
1322 |
|
1323 |
{ |
1324 |
|
1325 |
|
1326 |
my |
1327 |
$offset32 = $self-> |
1328 |
find_offset32 |
1329 |
($offset); |
1330 |
my $data1 = $self-> |
1331 |
data |
1332 |
; |
1333 |
my $data2 = substr ($data1, $offset32); |
1334 |
substr ($data1, $offset32) = ''; |
1335 |
|
1336 |
$r = $self-> |
1337 |
node_type |
1338 |
== |
1339 |
'3' |
1340 |
|
1341 |
? $self-> |
1342 |
owner_document |
1343 |
|
1344 |
-> |
1345 |
create_text_node |
1346 |
($data2) |
1347 |
: $self-> |
1348 |
owner_document |
1349 |
|
1350 |
-> |
1351 |
create_cdata_section |
1352 |
($data2); |
1353 |
$r-> |
1354 |
is_element_content_whitespace |
1355 |
|
1356 |
($self-> |
1357 |
is_element_content_whitespace |
1358 |
); |
1359 |
$self-> |
1360 |
data |
1361 |
($data1); |
1362 |
if (defined $parent) { |
1363 |
$parent-> |
1364 |
insert_before |
1365 |
|
1366 |
($r, $self-> |
1367 |
next_sibling |
1368 |
); |
1369 |
} |
1370 |
|
1371 |
|
1372 |
|
1373 |
} |
1374 |
|
1375 |
|
1376 |
;} |
1377 |
|
1378 |
; |
1379 |
|
1380 |
|
1381 |
} |
1382 |
$r} |
1383 |
$Message::DOM::DOMFeature::ClassInfo->{q<Message::DOM::CharacterData::ManakaiDOMText>}->{has_feature} = {'core', |
1384 |
{'', |
1385 |
'1', |
1386 |
'1.0', |
1387 |
'1', |
1388 |
'2.0', |
1389 |
'1', |
1390 |
'3.0', |
1391 |
'1'}, |
1392 |
'xml', |
1393 |
{'', |
1394 |
'1', |
1395 |
'1.0', |
1396 |
'1', |
1397 |
'2.0', |
1398 |
'1', |
1399 |
'3.0', |
1400 |
'1'}, |
1401 |
'xmlversion', |
1402 |
{'', |
1403 |
'1', |
1404 |
'1.0', |
1405 |
'1', |
1406 |
'1.1', |
1407 |
'1'}}; |
1408 |
$Message::DOM::ClassPoint{q<Message::DOM::CharacterData::ManakaiDOMText>} = 14.1; |
1409 |
$Message::DOM::DOMFeature::ClassInfo->{q<Message::DOM::TreeCore::ManakaiDOMText>}->{compat_class}->{q<Message::DOM::CharacterData::ManakaiDOMText>} = 1; |
1410 |
$Message::Util::Grove::ClassProp{q<Message::DOM::CharacterData::ManakaiDOMText>} = {'o0', |
1411 |
['parent'], |
1412 |
'w0', |
1413 |
['od']}; |
1414 |
package Message::DOM::IFLatest::Comment; |
1415 |
our $VERSION = 20060430.0838; |
1416 |
package Message::DOM::CharacterData::ManakaiDOMComment; |
1417 |
our $VERSION = 20060430.0838; |
1418 |
push our @ISA, 'Message::DOM::CharacterData::ManakaiDOMCharacterData', |
1419 |
'Message::DOM::IF::CharacterData', |
1420 |
'Message::DOM::IF::Comment', |
1421 |
'Message::DOM::IF::Node', |
1422 |
'Message::DOM::IFLatest::CharacterData', |
1423 |
'Message::DOM::IFLatest::Comment', |
1424 |
'Message::DOM::IFLatest::Node', |
1425 |
'Message::DOM::IFLevel1::CharacterData', |
1426 |
'Message::DOM::IFLevel1::Comment', |
1427 |
'Message::DOM::IFLevel1::Node', |
1428 |
'Message::DOM::IFLevel2::CharacterData', |
1429 |
'Message::DOM::IFLevel2::Comment', |
1430 |
'Message::DOM::IFLevel2::Node', |
1431 |
'Message::DOM::IFLevel3::CharacterData', |
1432 |
'Message::DOM::IFLevel3::Comment', |
1433 |
'Message::DOM::IFLevel3::Node'; |
1434 |
sub node_type ($;$) { |
1435 |
if (@_ == 1) {my ($self) = @_; |
1436 |
my $r; |
1437 |
$r = '8'; |
1438 |
$r; |
1439 |
} else {my ($self) = @_; |
1440 |
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::CharacterData::ManakaiDOMComment', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#attr' => 'node_type'; |
1441 |
} |
1442 |
} |
1443 |
sub node_name ($;$) { |
1444 |
if (@_ == 1) {my ($self) = @_; |
1445 |
my $r = ''; |
1446 |
$r = '#comment'; |
1447 |
$r; |
1448 |
} else {my ($self) = @_; |
1449 |
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::CharacterData::ManakaiDOMComment', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#attr' => 'node_name'; |
1450 |
} |
1451 |
} |
1452 |
sub get_feature ($$$) { |
1453 |
my ($self, $feature, $version) = @_; |
1454 |
|
1455 |
{ |
1456 |
|
1457 |
|
1458 |
$feature = lc $feature; |
1459 |
|
1460 |
|
1461 |
} |
1462 |
|
1463 |
{ |
1464 |
|
1465 |
|
1466 |
$version = '' unless defined $version; |
1467 |
|
1468 |
|
1469 |
} |
1470 |
my $r; |
1471 |
|
1472 |
{ |
1473 |
|
1474 |
|
1475 |
$feature =~ s/^\+//; |
1476 |
|
1477 |
|
1478 |
{ |
1479 |
|
1480 |
if |
1481 |
($Message::DOM::DOMFeature::ClassInfo->{ref $self} |
1482 |
->{has_feature}->{$feature}->{$version}) { |
1483 |
$r = $self; |
1484 |
} else { |
1485 |
CLASS: for my $__class (sort { |
1486 |
$Message::DOM::ClassPoint{$b} <=> $Message::DOM::ClassPoint{$a} |
1487 |
} grep { |
1488 |
$Message::DOM::DOMFeature::ClassInfo->{'Message::DOM::CharacterData::ManakaiDOMComment'} |
1489 |
->{compat_class}->{$_} |
1490 |
} keys %{$Message::DOM::DOMFeature::ClassInfo->{'Message::DOM::CharacterData::ManakaiDOMComment'} |
1491 |
->{compat_class} or {}}) { |
1492 |
if ($Message::DOM::DOMFeature::ClassInfo->{$__class} |
1493 |
->{has_feature}->{$feature}->{$version}) { |
1494 |
|
1495 |
|
1496 |
{ |
1497 |
|
1498 |
|
1499 |
$r = ${($self->{'b'})->{${($self->{'id'})}}->{ |
1500 |
'cls' |
1501 |
}}->___create_node_ref ({ |
1502 |
|
1503 |
'id' |
1504 |
=> ($self->{'id'}), |
1505 |
|
1506 |
'b' |
1507 |
=> ($self->{'b'}), |
1508 |
}, { |
1509 |
'nrcls' => \$__class, |
1510 |
}); |
1511 |
($self->{'b'})->{${($self->{'id'})}}->{ |
1512 |
'rc' |
1513 |
}++; |
1514 |
|
1515 |
|
1516 |
} |
1517 |
|
1518 |
; |
1519 |
last CLASS; |
1520 |
} |
1521 |
} # CLASS |
1522 |
} |
1523 |
|
1524 |
|
1525 |
} |
1526 |
|
1527 |
; |
1528 |
unless (defined $r) { |
1529 |
|
1530 |
|
1531 |
{ |
1532 |
|
1533 |
local $Error::Depth = $Error::Depth + 1; |
1534 |
|
1535 |
{ |
1536 |
|
1537 |
|
1538 |
|
1539 |
$r = $self->SUPER::get_feature ($feature, $version); |
1540 |
|
1541 |
|
1542 |
|
1543 |
} |
1544 |
|
1545 |
|
1546 |
;} |
1547 |
|
1548 |
; |
1549 |
} |
1550 |
|
1551 |
|
1552 |
} |
1553 |
$r} |
1554 |
$Message::DOM::DOMFeature::ClassInfo->{q<Message::DOM::CharacterData::ManakaiDOMComment>}->{has_feature} = {'core', |
1555 |
{'', |
1556 |
'1', |
1557 |
'1.0', |
1558 |
'1', |
1559 |
'2.0', |
1560 |
'1', |
1561 |
'3.0', |
1562 |
'1'}, |
1563 |
'xml', |
1564 |
{'', |
1565 |
'1', |
1566 |
'1.0', |
1567 |
'1', |
1568 |
'2.0', |
1569 |
'1', |
1570 |
'3.0', |
1571 |
'1'}, |
1572 |
'xmlversion', |
1573 |
{'', |
1574 |
'1', |
1575 |
'1.0', |
1576 |
'1', |
1577 |
'1.1', |
1578 |
'1'}}; |
1579 |
$Message::DOM::ClassPoint{q<Message::DOM::CharacterData::ManakaiDOMComment>} = 14.1; |
1580 |
$Message::DOM::DOMFeature::ClassInfo->{q<Message::DOM::TreeCore::ManakaiDOMComment>}->{compat_class}->{q<Message::DOM::CharacterData::ManakaiDOMComment>} = 1; |
1581 |
$Message::Util::Grove::ClassProp{q<Message::DOM::CharacterData::ManakaiDOMComment>} = {'o0', |
1582 |
['parent'], |
1583 |
'w0', |
1584 |
['od']}; |
1585 |
package Message::DOM::IFLatest::StringExtended; |
1586 |
our $VERSION = 20060430.0838; |
1587 |
for ($Message::DOM::IF::CharacterData::, $Message::DOM::IF::Comment::, $Message::DOM::IF::Node::, $Message::DOM::IF::Text::, $Message::DOM::IFLatest::Node::, $Message::DOM::IFLevel1::CharacterData::, $Message::DOM::IFLevel1::Comment::, $Message::DOM::IFLevel1::Node::, $Message::DOM::IFLevel1::Text::, $Message::DOM::IFLevel2::CharacterData::, $Message::DOM::IFLevel2::Comment::, $Message::DOM::IFLevel2::Node::, $Message::DOM::IFLevel2::Text::, $Message::DOM::IFLevel3::CharacterData::, $Message::DOM::IFLevel3::Comment::, $Message::DOM::IFLevel3::Node::, $Message::DOM::IFLevel3::Text::){} |
1588 |
## License: <http://suika.fam.cx/~wakaba/archive/2004/8/18/license#Perl+MPL> |
1589 |
1; |