comparison Lib/IMPL/DOM/Schema/Property.pm @ 25:9dd67fa91ee3

small fix in the dom schema works under text schema
author Sergey
date Tue, 13 Oct 2009 17:51:25 +0400
parents 7f00786f8210
children 16ada169ca75
comparison
equal deleted inserted replaced
24:7f00786f8210 25:9dd67fa91ee3
26 ); 26 );
27 27
28 sub CTOR { 28 sub CTOR {
29 my ($this,%args) = @_; 29 my ($this,%args) = @_;
30 30
31 $this->RequiredMessage($args{RequiredMessage} || 'A property %Schema.name% is required'); 31 $this->RequiredMessage($args{RequiredMessage} || 'A property %Schema.name% is required in the %Node.qname%');
32 } 32 }
33 33
34 sub Validate { 34 sub Validate {
35 my ($this,$node) = @_; 35 my ($this,$node) = @_;
36 36
38 my $prop = $this->name; 38 my $prop = $this->name;
39 my $nodeProp = new IMPL::DOM::Node(nodeName => '::property', nodeValue => $node->$prop() || $node->nodePropety($prop)); 39 my $nodeProp = new IMPL::DOM::Node(nodeName => '::property', nodeValue => $node->$prop() || $node->nodePropety($prop));
40 40
41 if (! $nodeProp->nodeValue) { 41 if (! $nodeProp->nodeValue) {
42 return new IMPL::DOM::Schema::ValidationError( 42 return new IMPL::DOM::Schema::ValidationError(
43 Message => 43 Message => $this->RequiredMessage,
44 Node => $node,
45 Schema => $this
44 ); 46 );
45 } 47 }
46 return $this->SUPER::Validate($nodeProp); 48 return $this->SUPER::Validate($nodeProp);
47 } else { 49 } else {
48 return (); 50 return ();