view Lib/IMPL/DOM/Transform/PostToDOM.pm @ 104:196bf443b5e1

DOM::Schema RC0 inflators support, validation and some other things, Minor and major fixes almost for everything. A 'Source' property of the ValidationErrors generated from a NodeSet or a NodeList is subject to change in the future.
author wizard
date Tue, 11 May 2010 02:42:59 +0400
parents 2d1c3f713280
children 83e356614c1e
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) {
    	# TODO: review
        my $node = $navi->Navigate($key);
        $node->nodeValue($value);
    }
    
    return $navi->Document;
}


1;