comparison Lib/IMPL/DOM/Navigator/Builder.pm @ 14:65a7bb156fb7

Дом модель и схема
author Sergey
date Fri, 04 Sep 2009 16:38:15 +0400
parents bb8d67f811ea
children 16795016e70b
comparison
equal deleted inserted replaced
13:bb8d67f811ea 14:65a7bb156fb7
21 } 21 }
22 22
23 sub NavigateCreate { 23 sub NavigateCreate {
24 my ($this,$nodeName,%props) = @_; 24 my ($this,$nodeName,%props) = @_;
25 25
26 if ( my $nodeSchema = $this->{$_navigatorSchema}->Navigate($nodeName) ) { 26 if ( my $nodeSchema = $this->{$_navigatorSchema}->Navigate(sub { $_[0]->nodeName eq $nodeName or $_[0]->isa('IMPL::DOM::Schema::AnyNode') }) ) {
27 my $class = $nodeSchema->type;
27 28
29 my $node = $this->{$Document}->Create($nodeName, $class, \%props);
30
31 $this->Current()->appendNode($node);
32 $this->Current($node);
28 33
29 } else { 34 } else {
30 die new IMPL::InvalidOperationException("Requested elemnt not found in the schema"); 35 die new IMPL::InvalidOperationException("Requested elemnt not found in the schema");
31 } 36 }
32 } 37 }