view Lib/IMPL/DOM/Navigator/Builder.pm @ 11:75980091813b

DOM и навигация
author Sergey
date Wed, 02 Sep 2009 17:47:44 +0400
parents
children bb8d67f811ea
line wrap: on
line source

package IMPL::DOM::Navigator::Builder;
use strict;
use warnings;

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

BEGIN {
    protected _direct property _navigatorSchema => prop_all;
    public _direct property Document => prop_get | owner_set;
}

__PACKAGE__->PassThroughArgs;

sub CTOR {
    my ($this,$domDocument,$schema) = @_;
    
    $this->{$Document} = $domDocument;
    $this->{$_navigatorSchema} = new IMPL::DOM::Navigator($schema);
}

sub NavigateCreate {
    my ($this,$nodeName,%props) = @_;
    
    if ( my $nodeSchema = $this->{$_navigatorSchema}->Navigate($nodeName) ) {
        
        
    } else {
        die new IMPL::InvalidOperationException("Requested elemnt not found in the schema");
    }
}

1;