Mercurial > pub > Impl
diff 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 diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Lib/IMPL/DOM/Navigator/Builder.pm Wed Sep 02 17:47:44 2009 +0400 @@ -0,0 +1,34 @@ +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;