diff Lib/IMPL/DOM/Transform/ObjectToDOM.pm @ 246:2746a8e5a6c4

Fixed regressions in DOM due previous refactorings Fixed ObjectToDOM transformation to handle a schema with mixed node types
author sergey
date Tue, 30 Oct 2012 01:17:31 +0400
parents 61db68166c37
children 129e48bb5afb
line wrap: on
line diff
--- a/Lib/IMPL/DOM/Transform/ObjectToDOM.pm	Mon Oct 29 03:15:22 2012 +0400
+++ b/Lib/IMPL/DOM/Transform/ObjectToDOM.pm	Tue Oct 30 01:17:31 2012 +0400
@@ -24,10 +24,14 @@
     ]
 };
 
+use constant {
+    SchemaNode => 'IMPL::DOM::Schema::Node'
+};
+
 sub CTOR {
     my ($this,$docName,$docSchema,$transforms) = @_;
     
-    my $docNodeSchema = $docSchema->selectSingleNode(sub { $_->name eq $docName })
+    my $docNodeSchema = $docSchema->selectSingleNode(sub { $_->isa(SchemaNode) and $_->name eq $docName } )
         or die OperationException->new("Can't find a node schema for the document '$docName'");
        
     my $docClass = ($docNodeSchema->can('nativeType') ? $docNodeSchema->nativeType : undef) || 'IMPL::DOM::Document';