diff 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
line wrap: on
line diff
--- a/Lib/IMPL/DOM/Navigator.pm	Fri May 07 18:17:40 2010 +0400
+++ b/Lib/IMPL/DOM/Navigator.pm	Tue May 11 02:42:59 2010 +0400
@@ -165,6 +165,21 @@
     join($delim,map $_->{alternatives}[$_->{current}]->nodeName, $this->{$_path} ? (@{$this->{$_path}}, $this->{$_state}) : $this->{$_state});
 }
 
+sub pathLength {
+	my ($this) = @_;
+	$this->{$_path} ? scalar @{$this->{$_path}} : 0;
+}
+
+sub GetNodeFromHistory {
+	my ($this,$index) = @_;
+	
+	if (my $state = $this->{$_path} ? $this->{$_path}->[$index] : undef ) {
+		return $state->{alternatives}[$state->{current}]
+	} else {
+		return undef;
+	}
+}
+
 sub clone {
     my ($this) = @_;