diff Lib/IMPL/DOM/Transform/PostToDOM.pm @ 148:e6447ad85cb4

DOM objects now have a schema and schemaSource properties RegExp now can launder data Improved post to DOM transformation (multiple values a now supported) Added new axes to navigation queries: ancestor and descendant minor changes and bug fixes
author wizard
date Mon, 16 Aug 2010 08:26:44 +0400
parents c2aa10fbb396
children e36ffd8c29db
line wrap: on
line diff
--- a/Lib/IMPL/DOM/Transform/PostToDOM.pm	Mon Aug 09 08:45:36 2010 +0400
+++ b/Lib/IMPL/DOM/Transform/PostToDOM.pm	Mon Aug 16 08:26:44 2010 +0400
@@ -114,11 +114,26 @@
 
 =begin code
 
-my $transform = new IMPL::DOM::Transform::PostToDOM(
-	'My::DOM::Document',
-	IMPL::DOM::Schema->LoadSchema('Data/user.add.schema.xml'),
-	'myForm'
-);
+	my $schema = IMPL::DOM::Schema->LoadSchema('Data/user.add.schema.xml');
+	
+	my $transform = IMPL::DOM::Transform::PostToDOM->new(
+		undef, # default class
+		$schema,
+		$schema->selectSingleNode('ComplexNode')->name
+	);
+	
+	my $doc = $transform->Transform(
+		CGI->new({
+			'user/login' => 'bob',
+			'user/fullName' => 'Bob Marley',
+			'user/password' => 'secret',
+			'user/password_retype' => 'secret',
+			'user/birthday' => '1978-12-17',
+			'user/email[1]' => 'bob@marley.com',
+			'user/email[2]' => 'bob.marley@google.com',
+			process => 1
+		})
+	);
 
 =end code