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

Small fixes in IMPL::DOM::Schema
author wizard
date Thu, 10 Jun 2010 17:43:51 +0400
parents 16ada169ca75
children 1e7f03414b65
comparison
equal deleted inserted replaced
124:e30bdd040fe3 125:a4b0a819bbda
21 } 21 }
22 22
23 sub CTOR { 23 sub CTOR {
24 my ($this,%args) = @_; 24 my ($this,%args) = @_;
25 25
26 $this->messageNoMatch($args{messageNoMatch} || 'A node %Node.nodeName% isn\'t expected in the %Node.parentNode.path%'); 26 $this->messageNoMatch($args{messageNoMatch} || 'A node %Node.nodeName% isn\'t expected in the %Parent.path%');
27 } 27 }
28 28
29 sub Validate { 29 sub Validate {
30 my ($this,$node) = @_; 30 my ($this,$node,$ctx) = @_;
31 31
32 if ( my ($schema) = $this->selectNodes(sub {$_[0]->name eq $node->nodeName} ) ) { 32 if ( my ($schema) = $this->selectNodes(sub {$_[0]->name eq $node->nodeName} ) ) {
33 return $schema->Validate($node); 33 return $schema->Validate($node);
34 } else { 34 } else {
35 return new IMPL::DOM::Schema::ValidationError( 35 return new IMPL::DOM::Schema::ValidationError(
36 Node => $node, 36 Node => $node,