comparison Lib/IMPL/DOM/Navigator.pm @ 104:196bf443b5e1

DOM::Schema RC0 inflators support, validation and some other things, Minor and major fixes almost for everything. A 'Source' property of the ValidationErrors generated from a NodeSet or a NodeList is subject to change in the future.
author wizard
date Tue, 11 May 2010 02:42:59 +0400
parents 16ada169ca75
children a7efb3117295
comparison
equal deleted inserted replaced
103:c289ed9662ca 104:196bf443b5e1
163 $delim ||= '/'; 163 $delim ||= '/';
164 164
165 join($delim,map $_->{alternatives}[$_->{current}]->nodeName, $this->{$_path} ? (@{$this->{$_path}}, $this->{$_state}) : $this->{$_state}); 165 join($delim,map $_->{alternatives}[$_->{current}]->nodeName, $this->{$_path} ? (@{$this->{$_path}}, $this->{$_state}) : $this->{$_state});
166 } 166 }
167 167
168 sub pathLength {
169 my ($this) = @_;
170 $this->{$_path} ? scalar @{$this->{$_path}} : 0;
171 }
172
173 sub GetNodeFromHistory {
174 my ($this,$index) = @_;
175
176 if (my $state = $this->{$_path} ? $this->{$_path}->[$index] : undef ) {
177 return $state->{alternatives}[$state->{current}]
178 } else {
179 return undef;
180 }
181 }
182
168 sub clone { 183 sub clone {
169 my ($this) = @_; 184 my ($this) = @_;
170 185
171 my $newNavi = __PACKAGE__->surrogate; 186 my $newNavi = __PACKAGE__->surrogate;
172 187