view Lib/IMPL/DOM/Transform/PostToDOM.pm @ 60:b0c068da93ac

Lazy activation for the configuration objects (final concept) small fixes
author wizard
date Tue, 09 Mar 2010 19:47:39 +0300
parents 16ada169ca75
children 2d1c3f713280
line wrap: on
line source

package IMPL::DOM::Post2DOM;
use strict;
use warnings;

use IMPL::DOM::Navigator;
use IMPL::Class::Property;

use base qw(IMPL::Transform);

BEGIN {
    public property Navigator => prop_get | owner_set;
}

our %CTOR = (
    'IMPL::Transform' => sub {
        return (
            HASH => \&TransfromPostData
        );
    }
);

sub TransformPostData {
    my ($this,$data) = @_;
    
    my $navi = $this->Navigator;
    
    while (my ($key,$value) = each %$data) {
        my $node = $navi->Navigate($key);
        $node->nodeValue($value);
    }
    
    return $navi->Document;
}


1;