comparison Lib/IMPL/DOM/Node.pm @ 16:75d55f4ee263

Окончательная концепция описания схем и построения DOM документов
author Sergey
date Tue, 08 Sep 2009 17:29:07 +0400
parents 65a7bb156fb7
children 818c74b038ae
comparison
equal deleted inserted replaced
15:16795016e70b 16:75d55f4ee263
39 39
40 return $node; 40 return $node;
41 } 41 }
42 42
43 sub appendNode { 43 sub appendNode {
44 my ($this,$node,$pos) = @_; 44 my ($this,$node) = @_;
45 45
46 die new IMPL::InvalidOperationException("You can't insert the node to itselft") if $this == $node; 46 die new IMPL::InvalidOperationException("You can't insert the node to itselft") if $this == $node;
47 47
48 $node->{$parentNode}->removeNode($node) if ($node->{$parentNode}); 48 $node->{$parentNode}->removeNode($node) if ($node->{$parentNode});
49 49
50 $this->childNodes->Append($node); 50 $this->childNodes->Append($node);
51 51
52 $node->_setParent( $this ); 52 $node->_setParent( $this );
53 53
54 return $node; 54 return $node;
55 }
56
57 sub appendRange {
58 my ($this,@range) = @_;
59
60 die new IMPL::InvalidOperationException("You can't insert the node to itselft") if grep $_ == $this, @range;
61
62 foreach my $node (@range) {
63 $node->{$parentNode}->removeNode($node) if ($node->{$parentNode});
64 $node->_setParent( $this );
65 }
66
67 $this->childNodes->Append(@range);
68
69 return $this;
55 } 70 }
56 71
57 sub _getChildNodes { 72 sub _getChildNodes {
58 my ($this) = @_; 73 my ($this) = @_;
59 74