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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (hide annotations) (download)
Thu Jun 14 13:10:07 2007 UTC (17 years, 5 months ago) by wakaba
Branch: MAIN
++ manakai/t/ChangeLog	14 Jun 2007 13:09:37 -0000
2007-06-14  Wakaba  <wakaba@suika.fam.cx>

	* DOM-DOMImplementation.t: Tests for |create_document|
	and |create_document_type| are added.

++ manakai/lib/Message/DOM/ChangeLog	14 Jun 2007 13:09:13 -0000
2007-06-14  Wakaba  <wakaba@suika.fam.cx>

	* Notation.pm, Entity.pm, EntityReference.pm, ProcessingInstruction.pm,
	CDATASection.pm, DocumentFragment.pm, ElementTypeDefinition.pm,
	AttributeDefinition.pm: New modules.

	* DOMDocument.pm (@ISA): 'Message::IF::DocumentXDoctype' added.
	(create_attribute_definition, create_element_type_definition,
	create_document_type_definition, create_cdata_section,
	create_processing_instruction, create_entity_reference,
	create_general_entity, create_notation): Prototypes added.

	* DOMImplementation.pm (create_document_type): Prototype added.

	* DocumentType.pm (@ISA), 'Message::IF::DocumentTypeDefinition'
	and 'Message::IF::DocumentTypeDeclaration' added.
	(create_document_type, create_document_type_definition):
	New methods.

1 wakaba 1.1 package Message::DOM::Notation;
2     use strict;
3     our $VERSION=do{my @r=(q$Revision: 1.1 $=~/\d+/g);sprintf "%d."."%02d" x $#r,@r};
4     push our @ISA, 'Message::DOM::Node', 'Message::IF::Notation';
5     require Message::DOM::Node;
6    
7     ## Spec:
8     ## <http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core.html#ID-527DCFF2>
9    
10     sub ____new ($$$) {
11     my $self = shift->SUPER::____new (shift);
12     $$self->{node_name} = $_[0];
13     return $self;
14     } # ____new
15    
16     sub AUTOLOAD {
17     my $method_name = our $AUTOLOAD;
18     $method_name =~ s/.*:://;
19     return if $method_name eq 'DESTROY';
20    
21     if ({
22     ## Read-only attributes (trivial accessors)
23     }->{$method_name}) {
24     no strict 'refs';
25     eval qq{
26     sub $method_name (\$) {
27     if (\@_ > 1) {
28     require Carp;
29     Carp::croak (qq<Can't modify read-only attribute>);
30     }
31     return \${\$_[0]}->{$method_name};
32     }
33     };
34     goto &{ $AUTOLOAD };
35     } elsif ({
36     ## Read-write attributes (DOMString, trivial accessors)
37     public_id => 1,
38     system_id => 1,
39     }->{$method_name}) {
40     no strict 'refs';
41     eval qq{
42     sub $method_name (\$) {
43     if (\@_ > 1) {
44     ## TODO: read-only, undef
45     \${\$_[0]}->{$method_name} = ''.$_[1];
46     }
47     return \${\$_[0]}->{$method_name};
48     }
49     };
50     goto &{ $AUTOLOAD };
51     } else {
52     require Carp;
53     Carp::croak (qq<Can't locate method "$AUTOLOAD">);
54     }
55     } # AUTOLOAD
56     sub public_id ($;$);
57     sub system_id ($;$);
58    
59     ## The |Node| interface - attribute
60    
61     sub node_type { 6 } # ENTITY_NODE
62    
63     package Message::IF::Entity;
64    
65     package Message::DOM::Document;
66    
67     ## Spec:
68     ## <http://suika.fam.cx/gate/2005/sw/DocumentXDoctype>
69    
70     sub create_general_entity ($$$) {
71     return Message::DOM::Entity->____new (@_[0, 1]);
72     } # create_general_entity
73    
74     1;
75     ## License: <http://suika.fam.cx/~wakaba/archive/2004/8/18/license#Perl+MPL>
76     ## $Date: 2007/06/13 12:05:35 $

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24