Mercurial > pub > Impl
comparison Lib/IMPL/DOM/Node.pm @ 109:ddf0f037d460
IMPL::DOM::Node updated to support TT, (added childNodesRef and selectNodesRef for using from TT)
Some fixes to the web document model. (beta version)
author | wizard |
---|---|
date | Mon, 17 May 2010 05:12:08 +0400 |
parents | c6fb6964de4c |
children | 7b14e0122b79 |
comparison
equal
deleted
inserted
replaced
108:c6fb6964de4c | 109:ddf0f037d460 |
---|---|
94 | 94 |
95 $this->{$childNodes} = new IMPL::Object::List() unless $this->{$childNodes}; | 95 $this->{$childNodes} = new IMPL::Object::List() unless $this->{$childNodes}; |
96 return wantarray ? @{ $this->{$childNodes} } : $this->{$childNodes}; | 96 return wantarray ? @{ $this->{$childNodes} } : $this->{$childNodes}; |
97 } | 97 } |
98 | 98 |
99 sub childNodesRef { | |
100 my ($this) = @_; | |
101 return scalar $this->_getChildNodes; | |
102 } | |
103 | |
99 sub removeNode { | 104 sub removeNode { |
100 my ($this,$node) = @_; | 105 my ($this,$node) = @_; |
101 | 106 |
102 if ($this == $node->{$parentNode}) { | 107 if ($this == $node->{$parentNode}) { |
103 $this->childNodes->RemoveItem($node); | 108 $this->childNodes->RemoveItem($node); |
193 while (my $query = shift @$path) { | 198 while (my $query = shift @$path) { |
194 @set = map $_->selectNodesAxis($query), @set; | 199 @set = map $_->selectNodesAxis($query), @set; |
195 } | 200 } |
196 | 201 |
197 return wantarray ? @set : \@set; | 202 return wantarray ? @set : \@set; |
203 } | |
204 | |
205 sub selectNodesRef { | |
206 my $this = shift; | |
207 | |
208 my @result = $this->selectNodes(@_); | |
209 return \@result; | |
198 } | 210 } |
199 | 211 |
200 sub translatePath { | 212 sub translatePath { |
201 my ($this,$path) = @_; | 213 my ($this,$path) = @_; |
202 | 214 |