view Lib/IMPL/DOM/Schema/ComplexNode.pm @ 24:7f00786f8210

Первая рабочая реазизация схемы и навигаторов
author Sergey
date Mon, 05 Oct 2009 00:48:49 +0400
parents 267460284fb3
children 16ada169ca75
line wrap: on
line source

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

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

BEGIN {
    public property content => {
        get => \&_getContent,
        set => \&_setContent
    }
}

our %CTOR = (
    'IMPL::DOM::Schema::Node' => sub {my %args = @_; $args{nodeName} ||= 'ComplexNode'; %args }
);

sub _getContent {
    $_[0]->firstChild;
}

sub _setContent {
    $_[0]->firstChild($_[1]);
}

sub Validate {
    my ($this,$node) = @_;
    
    map $_->Validate($node), @{$this->childNodes};
}

1;

__END__

=pod

=head1 DESCRIPTION

  .    ,  
.

        ..
       , . C<content>

=head2 PROPERTIES

=over

=item C<content>

 ,    C<IMPL::DOM::Schema::NodeSet> 
C<IMPL::DOM::Schema::NodeList>,        .
       .

=back

=cut