Mercurial > pub > Impl
comparison Lib/IMPL/DOM/Schema/Node.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 | c289ed9662ca |
| children | e6447ad85cb4 |
comparison
equal
deleted
inserted
replaced
| 103:c289ed9662ca | 104:196bf443b5e1 |
|---|---|
| 35 | 35 |
| 36 sub Validate { | 36 sub Validate { |
| 37 my ($this,$node) = @_; | 37 my ($this,$node) = @_; |
| 38 | 38 |
| 39 if (my $schemaType = $this->{$type} ? $this->document->resolveType($this->{$type}) : undef ) { | 39 if (my $schemaType = $this->{$type} ? $this->document->resolveType($this->{$type}) : undef ) { |
| 40 return $schemaType->Validate($node); | 40 my @errors = $schemaType->Validate($node,{Source => $this}); |
| 41 return @errors; | |
| 41 } else { | 42 } else { |
| 42 return (); | 43 return (); |
| 43 } | 44 } |
| 44 } | 45 } |
| 45 | 46 |
| 46 sub inflator { undef; } | 47 sub inflateValue { |
| 48 $_[1]; | |
| 49 } | |
| 50 | |
| 51 sub inflator { undef } | |
| 47 | 52 |
| 48 sub qname { | 53 sub qname { |
| 49 $_[0]->nodeName.'[name='.$_[0]->{$name}.']'; | 54 $_[0]->nodeName.'[name='.$_[0]->{$name}.']'; |
| 50 } | 55 } |
| 51 | 56 |
| 54 __END__ | 59 __END__ |
| 55 =pod | 60 =pod |
| 56 | 61 |
| 57 =head1 SYNOPSIS | 62 =head1 SYNOPSIS |
| 58 | 63 |
| 59 package Restriction; | 64 package SchemaEntity; |
| 60 use base qw(IMPL::DOM::Schema::Item); | 65 use base qw(IMPL::DOM::Schema::Node); |
| 61 | 66 |
| 62 sub Validate { | 67 sub Validate { |
| 63 my ($this,$node) = @_; | 68 my ($this,$node) = @_; |
| 64 } | 69 } |
| 65 | 70 |
