Commits

ph...@9ae0c189-cd1f-4510-a509-f4891f5cf20d  committed 761b980

Modified Files:
lib/XML/LibXML/SAX/Builder.pm
+ minor clean ups

  • Participants
  • Parent commits 5b48e48

Comments (0)

Files changed (1)

File lib/XML/LibXML/SAX/Builder.pm

     return bless {@_}, $class;
 }
 
+sub done {
+    my ($self) = @_;
+    my $dom = $self->{DOM};
+    $dom = $self->{Parent} unless defined $dom; # this is for parsing document chunks
+    delete $self->{NamespaceStack};
+    delete $self->{Parent};
+    delete $self->{DOM};
+
+    return $dom;
+}
+
+
 sub start_document {
     my ($self, $doc) = @_;
 
 
 sub end_document {
     my ($self, $doc) = @_;
-    my $dom = $self->{DOM};
-    $dom = $self->{Parent} unless defined $dom; # this is for parsing document chunks
-    delete $self->{NamespaceStack};
-    delete $self->{Parent};
-    delete $self->{DOM};
-    return $dom;
+    my $d = $self->done();
+    return $d;
 }
 
 sub start_prefix_mapping {
 sub end_prefix_mapping {
     my $self = shift;
     my $ns = shift;
-
     $self->{NamespaceStack}->undeclare_prefix( $ns->{Prefix} );
 }