diff Lib/IMPL/DOM/Transform/PostToDOM.pm @ 7:94d47b388442

Улучшены тесты Исправлены ошибки Улучшена документация Работа над схемой DOM
author Sergey
date Mon, 24 Aug 2009 01:05:34 +0400
parents
children 16ada169ca75
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Lib/IMPL/DOM/Transform/PostToDOM.pm	Mon Aug 24 01:05:34 2009 +0400
@@ -0,0 +1,36 @@
+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;