/[suikacvs]/messaging/manakai/lib/Message/DOM/TreeStore.pm
Suika

Contents of /messaging/manakai/lib/Message/DOM/TreeStore.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.5 - (hide annotations) (download)
Sat Dec 2 12:46:22 2006 UTC (19 years, 7 months ago) by wakaba
Branch: MAIN
Changes since 1.4: +5 -7 lines
++ manakai/t/ChangeLog	2 Dec 2006 12:46:13 -0000
2006-12-02  Wakaba  <wakaba@suika.fam.cx>

	* Makefile (dom-DOMString.t): New test.

++ manakai/bin/ChangeLog	2 Dec 2006 12:35:25 -0000
2006-12-02  Wakaba  <wakaba@suika.fam.cx>

	* daf.pl: Call |get_dom_implementation|
	instead of obsolete |get_implementation|.

	* grep-dis.pl: |lib/manakai/*.pl| is added.

++ manakai/lib/Message/Util/ChangeLog	2 Dec 2006 12:45:49 -0000
2006-12-02  Wakaba  <wakaba@suika.fam.cx>

	* Makefile: |lib/Message/DOM/DOMString.pm| is added.

++ manakai/lib/Message/DOM/ChangeLog	2 Dec 2006 12:45:20 -0000
2006-12-02  Wakaba  <wakaba@suika.fam.cx>

	* DOMString.dis: New module.

	* DOMString.pm: New file.

	* DOMCore.dis (min): Moved from |DOMFeature.dis|.
	(ImplementationRegistryVariable): Moved from |DOMFeature.dis|.
	Now it references the |DOMImplementationRegistry| object.
	(DOMImplementationRegistryVariable): Moved from |DOMMain.dis|.
	(DOMImplementationRegistry): New interface and
	class, reformed from |ImplementationRegistry| in |DOMFeature.dis|
	and |DOMImplementationRegistry| in |DOMMain.dis|.  Note
	that the class no longer support |get_implementation|
	and |get_implementation_list| methods from
	the |ImplementationRegistry| interface.
	(DOMImplementationList): Class implemented; no
	longer inherits from |ImplementationList|.
	(DOMImplementationSource): Class implemented; no
	longer inherits from |ImplementationSource|.  Note that
	the class no longer support |get_implementation|
	and |get_implementation_list| methods from
	the |ImplementationSource| interface.
	(DOMStringList): Removed.

	* DOMFeature.dis (min, ManakaiDOM:DOMHTMLFeature,
	ManakaiDOM:DOMEventsFeature, ManakaiDOM:DOMXMLFeature,
	ManakaiDOM:DOMXMLFeatureXML11, most part of
	documentation for obsolete DOM Level 3 Minimum Implementation
	module, obsolete property name aliases,
	ImplemenationRegistryVar, ImplementationRegistry,
	DEBUG, MIString, ImplementationList, ImplementationSource,
	ManakaiDOM:implID): Removed.

	* DOMMain.dis (Redefine, RedefinedBy, Redefined): Removed.
	(DOMString): Removed.
	(DOMImplementationRegistryVar, DOMImplementationRegistry): Removed.

	* Makefile: |DOMString.pm| is added.

	* TreeCore.dis (is_default_namespace): |null| was
	returned where a false is expected (|null| is
	a false in Perl, but real |false| is appropriate here).

1 wakaba 1.1 #!/usr/bin/perl
2     ## This file is automatically generated
3 wakaba 1.5 ## at 2006-12-02T10:11:10+00:00,
4     ## from file "../lib/Message/DOM/TreeStore.dis",
5 wakaba 1.1 ## module <http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom#ManakaiDOM.TreeStore>,
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     package Message::DOM::TreeStore;
11 wakaba 1.5 our $VERSION = 20061202.1011;
12 wakaba 1.1 package Message::DOM::IFLatest::DOMImplementationTreeStore;
13 wakaba 1.5 our $VERSION = 20061202.1011;
14 wakaba 1.1 package Message::DOM::TreeStore::ManakaiDOMImplementationTreeStore;
15 wakaba 1.5 our $VERSION = 20061202.1011;
16 wakaba 1.2 push our @ISA, 'Message::DOM::IFLatest::DOMImplementation',
17 wakaba 1.1 'Message::DOM::IF::DOMImplementation',
18     'Message::DOM::IF::DOMImplementationTreeStore',
19     'Message::DOM::IFLatest::DOMImplementation',
20     'Message::DOM::IFLatest::DOMImplementationTreeStore';
21 wakaba 1.3 push @Message::DOM::DOMCore::ManakaiDOMImplementation::ISA, q<Message::DOM::TreeStore::ManakaiDOMImplementationTreeStore> unless Message::DOM::DOMCore::ManakaiDOMImplementation->isa (q<Message::DOM::TreeStore::ManakaiDOMImplementationTreeStore>);
22 wakaba 1.1 sub create_storable_object_from_node ($$) {
23     my ($self, $in) = @_;
24     my $r;
25    
26     {
27    
28     if
29     ({
30    
31     9
32     =>
33     1
34     ,
35    
36     11
37     =>
38     1
39     ,
40    
41     1
42     =>
43     1
44     ,
45    
46     2
47     =>
48     1
49     ,
50    
51     3
52     =>
53     1
54     ,
55    
56     4
57     =>
58     1
59     ,
60     }->{$in->
61     node_type
62     }) {
63     my @target = ([$in, # node
64    
65     undef
66     ]); # origin
67    
68     while (@target) {
69     my $target = shift @target;
70     my $tnt = $target->[0]->
71     node_type
72     ;
73     if ($tnt ==
74     1
75     ) {
76     my $v = {};
77    
78     my $pv;
79    
80    
81     {
82    
83    
84     $pv = $target->[0]->{
85     'b'
86     }->{${$target->[0]->{
87     'id'
88     }}}
89     ->{'ns'};
90    
91    
92     }
93    
94     ;
95     $v->{namespace_uri} = $pv if defined $pv;
96    
97    
98    
99     {
100    
101    
102     $pv = $target->[0]->{
103     'b'
104     }->{${$target->[0]->{
105     'id'
106     }}}
107     ->{'ln'};
108    
109    
110     }
111    
112     ;
113     $v->{local_name} = $pv;
114    
115    
116    
117     {
118    
119    
120     $pv = $target->[0]->{
121     'b'
122     }->{${$target->[0]->{
123     'id'
124     }}}
125     ->{'pfx'};
126    
127    
128     }
129    
130     ;
131     $v->{prefix} = $pv if defined $pv;
132    
133     for (@{$target->[0]->
134     child_nodes
135     }) {
136     push @target, [$_, $v];
137     }
138     for (@{$target->[0]->
139     attributes
140     }) {
141     push @target, [$_, $v];
142     }
143     if (defined $target->[1]) {
144     push @{$target->[1]->{child_nodes} ||= []}, $v;
145     } else {
146     $r = $v unless defined $r;
147     }
148     } elsif ($tnt ==
149     2
150     ) {
151     my $v = {
152     value => \ $target->[0]->
153     value
154     ,
155     };
156    
157     my $pv;
158    
159    
160     {
161    
162    
163     $pv = $target->[0]->{
164     'b'
165     }->{${$target->[0]->{
166     'id'
167     }}}
168     ->{'ns'};
169    
170    
171     }
172    
173     ;
174     $v->{namespace_uri} = $pv if defined $pv;
175    
176    
177    
178     {
179    
180    
181     $pv = $target->[0]->{
182     'b'
183     }->{${$target->[0]->{
184     'id'
185     }}}
186     ->{'ln'};
187    
188    
189     }
190    
191     ;
192     $v->{local_name} = $pv;
193    
194    
195    
196     {
197    
198    
199     $pv = $target->[0]->{
200     'b'
201     }->{${$target->[0]->{
202     'id'
203     }}}
204     ->{'pfx'};
205    
206    
207     }
208    
209     ;
210     $v->{prefix} = $pv if defined $pv;
211    
212     if (defined $target->[1]) {
213     push @{$target->[1]->{attributes} ||= []}, $v;
214     } else {
215     $r = $v unless defined $r;
216     }
217     } elsif ($tnt ==
218     3 or
219    
220     $tnt ==
221     4
222     ) {
223     my $v = {};
224    
225    
226     {
227    
228    
229     $v->{data} = $target->[0]->{
230     'b'
231     }->{${$target->[0]->{
232     'id'
233     }}}
234     ->{'con'};
235    
236    
237     }
238    
239     ;
240    
241     if (defined $target->[1]) {
242     push @{$target->[1]->{child_nodes} ||= []}, $v;
243     } else {
244     $r = $v unless defined $r;
245     }
246     } elsif ($tnt ==
247     9
248     ) {
249     my $v = {
250     xml_version => $target->[0]->
251     xml_version
252     ,
253     };
254    
255     for (@{$target->[0]->
256     child_nodes
257     }) {
258     push @target, [$_, $v];
259     }
260     $r = $v unless defined $r;
261     } elsif ($tnt ==
262     11
263     ) {
264     my $v = {};
265    
266     for (@{$target->[0]->
267     child_nodes
268     }) {
269     push @target, [$_, $v];
270     }
271     $r = $v unless defined $r;
272     } elsif ($tnt ==
273     5
274     ) {
275     for (@{$target->[0]->
276     child_nodes
277     }) {
278     push @target, [$_, $target->[1]];
279     }
280     }
281     }
282     } else {
283    
284     report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'NOT_SUPPORTED_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#method' => 'create_storable_object_from_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#CLONE_NODE_TYPE_NOT_SUPPORTED_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#class' => 'Message::DOM::TreeStore::ManakaiDOMImplementationTreeStore', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#param-name' => 'in', 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#node' => $in;
285    
286     ;
287     }
288    
289    
290     }
291     $r}
292     sub create_node_from_storable_object ($$;$) {
293     my ($self, $in, $od) = @_;
294     my $r;
295    
296     {
297    
298    
299     {
300    
301     local $Error::Depth = $Error::Depth + 1;
302    
303     {
304    
305    
306    
307     $od = $self->
308     create_document
309     ;
310     my $orig_strict = $od->
311     strict_error_checking
312     ;
313     $od->
314     strict_error_checking
315     (
316     0
317     );
318    
319     my @target = ([$in,
320    
321     undef
322     , # parent node
323    
324     undef
325     ]); # owner element
326     while (@target) {
327     my $target = shift @target;
328     if (defined $target->[0]->{local_name}) {
329     if (defined $target->[0]->{value}) {
330     # Attribute
331     my $node = $od->
332     create_attribute_ns
333    
334     ($target->[0]->{namespace_uri},
335     [$target->[0]->{prefix},
336     $target->[0]->{local_name}]);
337     $node->
338     manakai_append_text
339     ($target->[0]->{value});
340     if (defined $target->[2]) {
341     $target->[2]->
342     set_attribute_node_ns
343     ($node);
344     } else {
345     $r = $node unless defined $r;
346     }
347     } else {
348     # Element
349     my $node = $od->
350     create_element_ns
351    
352     ($target->[0]->{namespace_uri},
353     [$target->[0]->{prefix},
354     $target->[0]->{local_name}]);
355     for (@{ref $target->[0]->{child_nodes} eq 'ARRAY'
356     ? $target->[0]->{child_nodes} : []}) {
357     push @target, [$_, $node];
358     }
359     for (@{ref $target->[0]->{attributes} eq 'ARRAY'
360     ? $target->[0]->{attributes} : []}) {
361     push @target, [$_,
362     undef
363     , $node];
364     }
365     if (defined $target->[1]) {
366     $target->[1]->
367     append_child
368     ($node);
369     } else {
370     $r = $node unless defined $r;
371     }
372     }
373     } elsif (defined $target->[0]->{data}) {
374     # Text
375     if (defined $target->[1]) {
376     $target->[1]->
377     manakai_append_text
378    
379     ($target->[0]->{data});
380     } elsif (not defined $r) {
381     $r = $od->
382     create_text_node
383     ('');
384     $r->
385     manakai_append_text
386     ($target->[0]->{data});
387     }
388     } elsif (defined $target->[0]->{xml_version}) {
389     # Document
390     my $node = $self->
391     create_document
392     ;
393     $node->
394     strict_error_checking
395     (
396     0
397     );
398     $node->
399     dom_config
400    
401     ->
402     set_parameter
403    
404     (
405     'http://suika.fam.cx/www/2006/dom-config/strict-document-children'
406     =>
407     0
408     );
409     $node->
410     xml_version
411     ($target->[0]->{xml_version});
412     for (@{ref $target->[0]->{child_nodes} eq 'ARRAY'
413     ? $target->[0]->{child_nodes} : []}) {
414     push @target, [$_, $node];
415     }
416     unless (defined $r) {
417     $r = $node;
418     $od = $node;
419     $orig_strict =
420     1
421     ;
422     }
423     } else {
424     # Document fragment
425     unless (defined $r) {
426     $r = $od->
427     create_document_fragment
428     ;
429     for (@{ref $target->[0]->{child_nodes} eq 'ARRAY'
430     ? $target->[0]->{child_nodes} : []}) {
431     push @target, [$_, $r];
432     }
433     }
434     }
435     }
436     $od->
437     strict_error_checking
438     ($orig_strict);
439     if ($r->
440     node_type
441     ==
442     9
443     ) {
444     $r->
445     dom_config
446    
447     ->
448     set_parameter
449    
450     (
451     'http://suika.fam.cx/www/2006/dom-config/strict-document-children'
452     =>
453     undef
454     );
455     }
456    
457    
458    
459     }
460    
461    
462     ;}
463    
464     ;
465    
466    
467     }
468     $r}
469     $Message::DOM::ImplFeature{q<Message::DOM::TreeStore::ManakaiDOMImplementationTreeStore>}->{q<http://suika.fam.cx/www/2006/feature/treestore>}->{q<3.0>} ||= 1;
470     $Message::DOM::ImplFeature{q<Message::DOM::TreeStore::ManakaiDOMImplementationTreeStore>}->{q<http://suika.fam.cx/www/2006/feature/treestore>}->{q<>} = 1;
471     $Message::DOM::DOMFeature::ClassInfo->{q<Message::DOM::TreeStore::ManakaiDOMImplementationTreeStore>}->{has_feature} = {'',
472     {'',
473     '1'},
474 wakaba 1.3 'http://suika.fam.cx/www/2006/feature/min',
475     {'',
476     '1',
477     '3.0',
478     '1'},
479     'http://suika.fam.cx/www/2006/feature/treestore',
480     {'',
481     '1',
482     '3.0',
483     '1'},
484     'http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom#minimum',
485     {'',
486     '1',
487     '3.0',
488     '1'},
489 wakaba 1.1 'xml',
490     {'',
491     '1',
492     '1.0',
493     '1',
494     '2.0',
495     '1',
496     '3.0',
497     '1'},
498     'xmlversion',
499     {'',
500     '1',
501     '1.0',
502     '1',
503     '1.1',
504     '1'}};
505 wakaba 1.3 $Message::DOM::ClassPoint{q<Message::DOM::TreeStore::ManakaiDOMImplementationTreeStore>} = 14.1;
506     $Message::Util::Grove::ClassProp{q<Message::DOM::TreeStore::ManakaiDOMImplementationTreeStore>} = {'v1h',
507     ['lpmi']};
508 wakaba 1.1 for ($Message::DOM::IF::DOMImplementation::, $Message::DOM::IF::DOMImplementationTreeStore::, $Message::DOM::IFLatest::DOMImplementation::){}
509     ## License: <http://suika.fam.cx/~wakaba/archive/2004/8/18/license#Perl+MPL>
510     1;

[email protected]
ViewVC Help
Powered by ViewVC 1.1.24