Mercurial > pub > Impl
diff Lib/IMPL/DOM/Node.pm @ 16:75d55f4ee263
Окончательная концепция описания схем и построения DOM документов
author | Sergey |
---|---|
date | Tue, 08 Sep 2009 17:29:07 +0400 |
parents | 65a7bb156fb7 |
children | 818c74b038ae |
line wrap: on
line diff
--- a/Lib/IMPL/DOM/Node.pm Mon Sep 07 17:30:55 2009 +0400 +++ b/Lib/IMPL/DOM/Node.pm Tue Sep 08 17:29:07 2009 +0400 @@ -41,7 +41,7 @@ } sub appendNode { - my ($this,$node,$pos) = @_; + my ($this,$node) = @_; die new IMPL::InvalidOperationException("You can't insert the node to itselft") if $this == $node; @@ -54,6 +54,21 @@ return $node; } +sub appendRange { + my ($this,@range) = @_; + + die new IMPL::InvalidOperationException("You can't insert the node to itselft") if grep $_ == $this, @range; + + foreach my $node (@range) { + $node->{$parentNode}->removeNode($node) if ($node->{$parentNode}); + $node->_setParent( $this ); + } + + $this->childNodes->Append(@range); + + return $this; +} + sub _getChildNodes { my ($this) = @_;