comparison 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
comparison
equal deleted inserted replaced
245:7c517134c42f 246:2746a8e5a6c4
22 _schema => PROP_RW, 22 _schema => PROP_RW,
23 _navi => PROP_RW 23 _navi => PROP_RW
24 ] 24 ]
25 }; 25 };
26 26
27 use constant {
28 SchemaNode => 'IMPL::DOM::Schema::Node'
29 };
30
27 sub CTOR { 31 sub CTOR {
28 my ($this,$docName,$docSchema,$transforms) = @_; 32 my ($this,$docName,$docSchema,$transforms) = @_;
29 33
30 my $docNodeSchema = $docSchema->selectSingleNode(sub { $_->name eq $docName }) 34 my $docNodeSchema = $docSchema->selectSingleNode(sub { $_->isa(SchemaNode) and $_->name eq $docName } )
31 or die OperationException->new("Can't find a node schema for the document '$docName'"); 35 or die OperationException->new("Can't find a node schema for the document '$docName'");
32 36
33 my $docClass = ($docNodeSchema->can('nativeType') ? $docNodeSchema->nativeType : undef) || 'IMPL::DOM::Document'; 37 my $docClass = ($docNodeSchema->can('nativeType') ? $docNodeSchema->nativeType : undef) || 'IMPL::DOM::Document';
34 38
35 $this->documentSchema($docNodeSchema); 39 $this->documentSchema($docNodeSchema);