--- lib/XML/Pastor/Schema/Parser.pm
+++ lib/XML/Pastor/Schema/Parser.pm
@@ -37,6 +37,10 @@ sub new () {
unless ($self->{contextStack}) {
$self->{contextStack} = XML::Pastor::Stack->new();
}
+
+ unless ($self->{seenSchema}) {
+ $self->{seenSchema} = { };
+ }
return bless $self, $class;
}
@@ -172,6 +176,13 @@ sub _process {
}
return $self->model();
}
+
+ if ($self->{seenSchema}{$schema}) {
+ print STDERR "Pastor : Skipping duplicate schema : '$args->{schema}' ...\n" if($verbose >= 2);
+ return $self->model();
+ }
+
+ $self->{seenSchema}{$schema} = 1;
print STDERR "Pastor : Processing schema : '$args->{schema}' ...\n" if($verbose >= 2);