]> jspc29.x-matter.uni-frankfurt.de Git - daqtools.git/commitdiff
Better entity loading
authorAndreas Neiser <neiser@kph.uni-mainz.de>
Mon, 1 Jul 2013 08:30:48 +0000 (10:30 +0200)
committerAndreas Neiser <neiser@kph.uni-mainz.de>
Mon, 1 Jul 2013 08:30:48 +0000 (10:30 +0200)
xml-db/xml-db.pl

index d8ce18090156507cbf40f521ea3a4fcaacaacdbc..2b635ad698d6aa44ae481f931fbdbf6b66d1ba3d 100755 (executable)
@@ -149,8 +149,10 @@ sub LoadDBAndFiles {
       my $doc = $parser->parse_file($_);
       ValidateXML($doc, $schemas);
       my $dbname = $doc->getDocumentElement->getAttribute('name');
+      die "File <$_>: Entity with name $dbname already exists in database"
+        if exists $db->{$dbname};
       $db->{$dbname} = $doc;
-      print "Loaded and validated entity <$dbname> from db/$_\n" if $verbose;
+      print "Loaded and validated entity <$dbname> from database <$_>\n" if $verbose;
     }
   }