From: Andreas Neiser Date: Tue, 2 Jul 2013 06:45:33 +0000 (+0200) Subject: Slightly better tree output X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=f1a45aa06500cc807e1a5264cba7312a46b804a5;p=daqtools.git Slightly better tree output --- diff --git a/xml-db/database/TrbNetCommon.xsd b/xml-db/database/TrbNetCommon.xsd index b84458c..fb534ce 100644 --- a/xml-db/database/TrbNetCommon.xsd +++ b/xml-db/database/TrbNetCommon.xsd @@ -236,7 +236,7 @@ - + diff --git a/xml-db/xml-db.pl b/xml-db/xml-db.pl index d1fbefe..1554a0a 100755 --- a/xml-db/xml-db.pl +++ b/xml-db/xml-db.pl @@ -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} = []; } } }