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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (show annotations) (download)
Sat Jun 16 15:27:45 2007 UTC (17 years, 5 months ago) by wakaba
Branch: MAIN
Changes since 1.3: +4 -2 lines
++ manakai/t/ChangeLog	16 Jun 2007 15:27:38 -0000
	* DOM-Node.t: Tests for |prefix| and |text_content| are added.

2007-06-16  Wakaba  <wakaba@suika.fam.cx>

++ manakai/lib/Message/DOM/ChangeLog	16 Jun 2007 15:27:12 -0000
	* DOMConfiguration.pm: New module.

	* Attr.pm (trivial accessor for read-write attributes): Throw
	an exception if the node is read-only.  Delete the property
	if undef is specified.
	(prefix): Implemented.

	* DOMElement.pm (trivial accessor for read-write attributes): Throw
        an exception if the node is read-only.  Delete the property
        if undef is specified.
        (prefix): Implemented.
	(text_content, manakai_append_text): Old implementations are removed.

	* DOMCharacterData.pm (text_content): Implemented.

	* DOMDocument.pm (____new): Initialize the strict-document-children
	parameter by true.
	(text_content): Reimplemented.
	(dom_config): New.

	* DOMException.pm (READ_ONLY_NODE_ERR): New subtype.

	* DocumentType.pm (text_content): Implemented.

	* ElementTypeDefinition.pm (text_content): Implemented.

	* Node.pm (___report_error): New method.
	(text_content): Implemented.
	(manakai_append_text): Copied from |DOMElement.pm|.

	* Notation.pm (text_content): Implemented.

	* ProcessingInstruction.pm (text_content): Implemented.

	* Text.pm (is_element_content_whitespace): Alpha version.

2007-06-16  Wakaba  <wakaba@suika.fam.cx>

1 package Message::DOM::Notation;
2 use strict;
3 our $VERSION=do{my @r=(q$Revision: 1.3 $=~/\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 sub ____new ($$$) {
8 my $self = shift->SUPER::____new (shift);
9 $$self->{node_name} = $_[0];
10 return $self;
11 } # ____new
12
13 sub AUTOLOAD {
14 my $method_name = our $AUTOLOAD;
15 $method_name =~ s/.*:://;
16 return if $method_name eq 'DESTROY';
17
18 if ({
19 ## Read-only attributes (trivial accessors)
20 node_name => 1,
21 }->{$method_name}) {
22 no strict 'refs';
23 eval qq{
24 sub $method_name (\$) {
25 if (\@_ > 1) {
26 require Carp;
27 Carp::croak (qq<Can't modify read-only attribute>);
28 }
29 return \${\$_[0]}->{$method_name};
30 }
31 };
32 goto &{ $AUTOLOAD };
33 } elsif ({
34 ## Read-write attributes (DOMString, trivial accessors)
35 public_id => 1,
36 system_id => 1,
37 }->{$method_name}) {
38 no strict 'refs';
39 eval qq{
40 sub $method_name (\$) {
41 if (\@_ > 1) {
42 \${\$_[0]}->{$method_name} = ''.$_[1];
43 }
44 return \${\$_[0]}->{$method_name};
45 }
46 };
47 goto &{ $AUTOLOAD };
48 } else {
49 require Carp;
50 Carp::croak (qq<Can't locate method "$AUTOLOAD">);
51 }
52 } # AUTOLOAD
53 sub public_id ($;$);
54 sub system_id ($;$);
55
56 ## The |Node| interface - attribute
57
58 sub child_nodes ($) {
59 require Message::DOM::NodeList;
60 return bless \\($_[0]), 'Message::DOM::NodeList::EmptyNodeList';
61 } # child_nodes
62
63 sub node_name ($); # read-only trivial accessor
64
65 sub node_type () { 12 } # NOTATION_NODE
66
67 sub text_content ($;$) { undef }
68
69 package Message::IF::Notation;
70
71 package Message::DOM::Document;
72
73 sub create_notation ($$) {
74 return Message::DOM::Notation->____new (@_[0, 1]);
75 } # create_notation
76
77 =head1 LICENSE
78
79 Copyright 2007 Wakaba <w@suika.fam.cx>
80
81 This program is free software; you can redistribute it and/or
82 modify it under the same terms as Perl itself.
83
84 =cut
85
86 1;
87 ## $Date: 2007/06/16 08:05:48 $

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24