comparison Lib/IMPL/DOM/Schema/Node.pm @ 19:1ca530e5c9c5

DOM схема, требует переработки в части схемы для описания схем. Автоверификация не проходит
author Sergey
date Fri, 11 Sep 2009 16:30:39 +0400
parents 818c74b038ae
children 267460284fb3
comparison
equal deleted inserted replaced
18:818c74b038ae 19:1ca530e5c9c5
6 use IMPL::Class::Property; 6 use IMPL::Class::Property;
7 use IMPL::DOM::Property qw(_dom); 7 use IMPL::DOM::Property qw(_dom);
8 use IMPL::Class::Property::Direct; 8 use IMPL::Class::Property::Direct;
9 9
10 BEGIN { 10 BEGIN {
11 public _dom property minOccur => prop_all; 11 public property minOccur => prop_all;
12 public _dom property maxOccur => prop_all; 12 public property maxOccur => prop_all;
13 public _dom property type => prop_all 13 public property type => prop_all
14 } 14 }
15 15
16 __PACKAGE__->PassThroughArgs; 16 __PACKAGE__->PassThroughArgs;
17 17
18 sub CTOR { 18 sub CTOR {
19 my ($this,%args) = @_; 19 my ($this,%args) = @_;
20 20
21 $this->minOccur($args{minOcuur}); 21 $this->minOccur(defined $args{minOcuur} ? $args{minOcuur} : 1);
22 $this->maxOccur($args{maxOccur}); 22 $this->maxOccur(defined $args{maxOccur} ? $args{maxOccur} : 1);
23 $this->type($args{type}); 23 $this->type($args{type});
24 }
25
26 sub Validate {
27 my ($this,$node) = @_;
28
29 if (my $schemaType = $this->type ? $this->rootNode->resolveType($this->type) : undef ) {
30 return $schemaType->Validate($node);
31 }
24 } 32 }
25 33
26 1; 34 1;
27 35
28 __END__ 36 __END__