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

Diff of /messaging/manakai/lib/Message/DOM/AttributeDefinition.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by wakaba, Sat Jun 16 08:05:48 2007 UTC revision 1.4 by wakaba, Sun Jun 17 13:37:40 2007 UTC
# Line 4  our $VERSION=do{my @r=(q$Revision$=~/\d+ Line 4  our $VERSION=do{my @r=(q$Revision$=~/\d+
4  push our @ISA, 'Message::DOM::Node', 'Message::IF::AttributeDefinition';  push our @ISA, 'Message::DOM::Node', 'Message::IF::AttributeDefinition';
5  require Message::DOM::Node;  require Message::DOM::Node;
6    
 ## Spec:  
 ## <http://suika.fam.cx/gate/2005/sw/AttributeDefinition>  
   
7  sub ____new ($$$) {  sub ____new ($$$) {
8    my $self = shift->SUPER::____new (shift);    my $self = shift->SUPER::____new (shift);
9    $$self->{node_name} = $_[0];    $$self->{node_name} = $_[0];
# Line 53  sub AUTOLOAD { Line 50  sub AUTOLOAD {
50    }    }
51  } # AUTOLOAD  } # AUTOLOAD
52    
53    ## |AttributeDefinition| constants
54    
55    ## |DeclaredValueType|
56    sub NO_TYPE_ATTR () { 0 }
57    sub CDATA_ATTR () { 1 }
58    sub ID_ATTR () { 2 }
59    sub IDREF_ATTR () { 3 }
60    sub IDREFS_ATTR () { 4 }
61    sub ENTITY_ATTR () { 5 }
62    sub ENTITIES_ATTR () { 6 }
63    sub NMTOKEN_ATTR () { 7 }
64    sub NMTOKENS_ATTR () { 8 }
65    sub NOTATION_ATTR () { 9 }
66    sub ENUMERATION_ATTR () { 10 }
67    sub UNKNOWN_ATTR () { 11 }
68    
69    ## |DefaultValueType|
70    sub UNKNOWN_DEFAULT () { 0 }
71    sub FIXED_DEFAULT () { 1 }
72    sub REQUIRED_DEFAULT () { 2 }
73    sub IMPLIED_DEFAULT () { 3 }
74    sub EXPLICIT_DEFAULT () { 4 }
75    
76  ## The |Node| interface - attribute  ## The |Node| interface - attribute
77    
78  ## Spec:  ## Spec:
# Line 71  sub node_type ($) { 81002 } # ATTRIBUTE_ Line 91  sub node_type ($) { 81002 } # ATTRIBUTE_
91    
92  ## TODO: node_value  ## TODO: node_value
93    
94    ## |AttributeDefinition| attributes
95    
96    sub declared_type ($;$) {
97      my $self = $_[0];
98      if (@_ > 1) {
99        if (${$$self->{owner_document}}->{strict_error_checking}) {
100          if ($$self->{manakai_read_only}) {
101            report Message::DOM::DOMException
102                -object => $self,
103                -type => 'NO_MODIFICATION_ALLOWED_ERR',
104                -subtype => 'READ_ONLY_NODE_ERR';
105          }
106        }
107        if ($_[1]) {
108          $$self->{declared_type} = 0+$_[1];
109        } else {
110          delete $$self->{declared_type};
111        }
112      }
113      
114      return $$self->{declared_type} || 0;
115    } # declared_type
116    
117    sub default_type ($;$) {
118      my $self = $_[0];
119      if (@_ > 1) {
120        if (${$$self->{owner_document}}->{strict_error_checking}) {
121          if ($$self->{manakai_read_only}) {
122            report Message::DOM::DOMException
123                -object => $self,
124                -type => 'NO_MODIFICATION_ALLOWED_ERR',
125                -subtype => 'READ_ONLY_NODE_ERR';
126          }
127        }
128        if ($_[1]) {
129          $$self->{default_type} = 0+$_[1];
130        } else {
131          delete $$self->{default_type};
132        }
133      }
134      
135      return $$self->{default_type} || 0;
136    } # default_type
137    
138  package Message::IF::AttributeDefinition;  package Message::IF::AttributeDefinition;
139    
140  package Message::DOM::Document;  package Message::DOM::Document;

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24