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

DOM схема, требует переработки в части схемы для описания схем. Автоверификация не проходит
author Sergey
date Fri, 11 Sep 2009 16:30:39 +0400
parents 818c74b038ae
children 267460284fb3
line wrap: on
line source

package IMPL::DOM::Schema::Node;
use strict;
use warnings;

use base qw(IMPL::DOM::Node);
use IMPL::Class::Property;
use IMPL::DOM::Property qw(_dom);
use IMPL::Class::Property::Direct;

BEGIN {
    public property minOccur => prop_all;
    public property maxOccur => prop_all;
    public property type => prop_all
}

__PACKAGE__->PassThroughArgs;

sub CTOR {
    my ($this,%args) = @_;
    
    $this->minOccur(defined $args{minOcuur} ? $args{minOcuur} : 1);
    $this->maxOccur(defined $args{maxOccur} ? $args{maxOccur} : 1);
    $this->type($args{type});
}

sub Validate {
    my ($this,$node) = @_;
    
    if (my $schemaType = $this->type ? $this->rootNode->resolveType($this->type) : undef ) {
        return $schemaType->Validate($node);
    }
}

1;

__END__
=pod

=head1 SYNOPSIS

package Restriction;
use base qw(IMPL::DOM::Schema::Item);

sub Validate {
    my ($this,$node) = @_;
}

=head1 DESCRIPTION

    .      

=cut