]> jspc29.x-matter.uni-frankfurt.de Git - daqtools.git/commitdiff
xml-db: Adding §HeadNode as special entry containing all top-level items as children
authorAndreas Neiser <neiser@kph.uni-mainz.de>
Mon, 14 Jul 2014 10:09:52 +0000 (12:09 +0200)
committerAndreas Neiser <neiser@kph.uni-mainz.de>
Mon, 14 Jul 2014 10:09:52 +0000 (12:09 +0200)
xml-db/xml-db.pl

index c64c9f57361579f8e48d9b79ecc76fa48bc3a32b..2e04ee4586e09b8431d29cde26ab68575058bb42 100755 (executable)
@@ -159,6 +159,21 @@ sub WorkOnDoc {
       push(@{$dbitem->{'children'}}, $childname);
     }
   }
+
+
+  # add a HeadNode with its top-level children
+  my $headnode = {};
+  my $hn_children = $doc->getDocumentElement->findnodes('group | register | memory | fifo');
+  foreach my $childnode (@$hn_children) {
+    my $childname = $childnode->getAttribute('name');
+
+    if (not defined $db->{$childname}) {
+      PrintMessage($childnode, "Fatal Error: Child $childname of §HeadNode not found in database", 1)
+    }
+    push(@{$headnode->{'children'}}, $childname);
+  }
+  $db->{'§HeadNode'} = $headnode;
+
   return $db;
 }