From f1a45aa06500cc807e1a5264cba7312a46b804a5 Mon Sep 17 00:00:00 2001 From: Andreas Neiser Date: Tue, 2 Jul 2013 08:45:33 +0200 Subject: [PATCH] Slightly better tree output --- xml-db/database/TrbNetCommon.xsd | 2 +- xml-db/xml-db.pl | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) 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} = []; } } } -- 2.43.0