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-5431D1B9> |
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 |
node_name => 1, |
24 |
}->{$method_name}) { |
25 |
no strict 'refs'; |
26 |
eval qq{ |
27 |
sub $method_name (\$) { |
28 |
if (\@_ > 1) { |
29 |
require Carp; |
30 |
Carp::croak (qq<Can't modify read-only attribute>); |
31 |
} |
32 |
return \${\$_[0]}->{$method_name}; |
33 |
} |
34 |
}; |
35 |
goto &{ $AUTOLOAD }; |
36 |
} elsif ({ |
37 |
## Read-write attributes (DOMString, trivial accessors) |
38 |
public_id => 1, |
39 |
system_id => 1, |
40 |
}->{$method_name}) { |
41 |
no strict 'refs'; |
42 |
eval qq{ |
43 |
sub $method_name (\$) { |
44 |
if (\@_ > 1) { |
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 |
## Spec: |
62 |
## <http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core.html#ID-F68D095> |
63 |
## <http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core.html#ID-1950641247> |
64 |
|
65 |
sub node_name ($); # read-only trivial accessor |
66 |
|
67 |
## Spec: |
68 |
## <http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core.html#ID-111237558> |
69 |
|
70 |
sub node_type ($) { 12 } # NOTATION_NODE |
71 |
|
72 |
package Message::IF::Notation; |
73 |
|
74 |
package Message::DOM::Document; |
75 |
|
76 |
## Spec: |
77 |
## <http://suika.fam.cx/gate/2005/sw/DocumentXDoctype> |
78 |
|
79 |
sub create_notation ($$) { |
80 |
return Message::DOM::Notation->____new (@_[0, 1]); |
81 |
} # create_notation |
82 |
|
83 |
1; |
84 |
## License: <http://suika.fam.cx/~wakaba/archive/2004/8/18/license#Perl+MPL> |
85 |
## $Date: 2007/06/14 13:10:07 $ |