]> jspc29.x-matter.uni-frankfurt.de Git - daqtools.git/commitdiff
Slightly better tree output
authorAndreas Neiser <neiser@kph.uni-mainz.de>
Tue, 2 Jul 2013 06:45:33 +0000 (08:45 +0200)
committerAndreas Neiser <neiser@kph.uni-mainz.de>
Tue, 2 Jul 2013 06:45:33 +0000 (08:45 +0200)
xml-db/database/TrbNetCommon.xsd
xml-db/xml-db.pl

index b84458c147ba67d2927612fc58f3300d0967bc84..fb534ce14733fa89be7ad20275f712a8cb829b86 100644 (file)
       <xs:complexContent>
         <xs:extension base="basicTrbData">
           <!-- size specified in 32bit long words -->
-          <xs:attribute ref="size" />
+          <xs:attribute ref="size" use="required" />
         </xs:extension>
       </xs:complexContent>
     </xs:complexType>
index d1fbefe306bc82911d061fc67221bf84bbc92984..1554a0a929b2fd11671e99b6b2ca083d27507b53 100755 (executable)
@@ -187,7 +187,8 @@ sub DumpDocument($) {
   my $tree = {};
   IterateChildren($tree, $doc->getDocumentElement, $entityAddr);
   print DumpTree($tree, $entityName,
-                 USE_ASCII => 0, DISPLAY_ADDRESS => 0, NO_NO_ELEMENTS => 1);
+                 USE_ASCII => 0, DISPLAY_OBJECT_TYPE => 0,
+                 DISPLAY_ADDRESS => 0, NO_NO_ELEMENTS => 1);
 }
 
 sub IterateChildren {
@@ -218,13 +219,14 @@ sub IterateChildren {
       $key .= $name;
       $key .= $repeat>1 ? " x $repeat" : '';
 
-      $tree->{$key} = [];
+      $tree->{$key} = {};
 
       my $fields = $curNode->findnodes('field');
 
       next if $fields->size < 2;
       foreach my $field (@$fields) {
-        push(@{$tree->{$key}}, $field->getAttribute('name'));
+        my $fieldname = $field->getAttribute('name');
+        $tree->{$key}->{$fieldname} = [];
       }
     }
   }