comparison Lib/IMPL/DOM/Schema/Validator/Compare.pm @ 125:a4b0a819bbda

Small fixes in IMPL::DOM::Schema
author wizard
date Thu, 10 Jun 2010 17:43:51 +0400
parents c6fb6964de4c
children 76515373dac0
comparison
equal deleted inserted replaced
124:e30bdd040fe3 125:a4b0a819bbda
7 use IMPL::Class::Property; 7 use IMPL::Class::Property;
8 8
9 BEGIN { 9 BEGIN {
10 public property targetProperty => prop_all; 10 public property targetProperty => prop_all;
11 public property op => prop_all; 11 public property op => prop_all;
12 public property nodePath => prop_get | owner_set; 12 public property nodePath => prop_all;
13 public property optional => prop_all; 13 public property optional => prop_all;
14 private property _pathTranslated => prop_all; 14 private property _pathTranslated => prop_all;
15 private property _targetNode => prop_all; 15 private property _targetNode => prop_all;
16 public property message => prop_all; 16 public property message => prop_all;
17 } 17 }
18 18
19 our %CTOR = ( 19 our %CTOR = (
20 'IMPL::DOM::Schema::Validator' => sub { 20 'IMPL::DOM::Schema::Validator' => sub {
21 my %args = @_; 21 my %args = @_;
22 $args{nodeName} ||= 'Compare'; 22 $args{nodeName} ||= 'Compare';
23 delete @args{qw(targetProperty op nodePath optional message)};
23 %args; 24 %args;
24 } 25 }
25 ); 26 );
26 27
27 our %Ops = ( 28 our %Ops = (
112 113
113 $this->_targetNode($node); 114 $this->_targetNode($node);
114 115
115 my $query = $this->_pathTranslated() || $this->_pathTranslated($this->TranslatePath($this->nodePath)); 116 my $query = $this->_pathTranslated() || $this->_pathTranslated($this->TranslatePath($this->nodePath));
116 117
117 my ($foreignNode) = $node->selectNodes($query); 118 my ($foreignNode) = $node->selectNodes(@$query);
118 119
119 my $Source = $ctx && $ctx->{Source} || $this->parentNode; 120 my $Source = $ctx && $ctx->{Source} || $this->parentNode;
120 121
121 if ($foreignNode) { 122 if ($foreignNode) {
122 my $value = $this->nodeValue; 123 my $value = $this->nodeValue;