From 90bf62c993295d553ebc59e0badf79dd5c95b7e1 Mon Sep 17 00:00:00 2001 From: Andreas Neiser Date: Tue, 2 Jul 2013 14:51:45 +0200 Subject: [PATCH] Some renaming and hopefully fixing attribute access over tied hash --- xml-db/database/{HUB.xml => Hub.xml} | 0 xml-db/database/{RDO.xml => TrgRdo.xml} | 0 xml-db/setup/trb-setup-default.xml | 49 +++---------------------- xml-db/xml-db.pl | 9 +++-- 4 files changed, 10 insertions(+), 48 deletions(-) rename xml-db/database/{HUB.xml => Hub.xml} (100%) rename xml-db/database/{RDO.xml => TrgRdo.xml} (100%) diff --git a/xml-db/database/HUB.xml b/xml-db/database/Hub.xml similarity index 100% rename from xml-db/database/HUB.xml rename to xml-db/database/Hub.xml diff --git a/xml-db/database/RDO.xml b/xml-db/database/TrgRdo.xml similarity index 100% rename from xml-db/database/RDO.xml rename to xml-db/database/TrgRdo.xml diff --git a/xml-db/setup/trb-setup-default.xml b/xml-db/setup/trb-setup-default.xml index 34c0536..30c2ed7 100644 --- a/xml-db/setup/trb-setup-default.xml +++ b/xml-db/setup/trb-setup-default.xml @@ -66,56 +66,17 @@ - - - - - - - - 0-15 => 1, - 34 => 1, - - - - - - - - - - - Bla - - - 0-15 => 1, - 34 => 5, - - - - - + - - + + - + - - - - - + diff --git a/xml-db/xml-db.pl b/xml-db/xml-db.pl index 70c1ab7..dee7d6f 100755 --- a/xml-db/xml-db.pl +++ b/xml-db/xml-db.pl @@ -151,9 +151,9 @@ sub EvaluateTrbNode($$$) { # and we can check some more required fields foreach my $n ($entity->findnodes('//field | //register | //memory | //fifo | //group')) { if ($n->nodeName eq 'field') { - PrintMessage($n, 'Fatal Error: "start" attribute is required', 0) unless exists $n->{'start'}; + PrintMessage($n, 'Fatal Error: "start" attribute is required', 1) unless $n->hasAttribute('start'); } else { - PrintMessage($n, 'Fatal Error: "address" attribute is required', 1) unless exists $n->{'address'}; + PrintMessage($n, 'Fatal Error: "address" attribute is required', 1) unless $n->hasAttribute('address'); } } } @@ -189,10 +189,11 @@ sub MergeElementIntoEntity($$) { PrintMessage($elem, "Merging entity item <$uniquename>") if $verbose; PrintMessage($elem, "Before merge:\n".$e_node->toString(2)) if $verbose>2; - # override the attributes (using nice tied hash functionality) + # override the attributes (using tied hash functionality, which + # sometimes does not work when reading?) foreach my $attr (keys %$elem) { next if $attr eq 'name'; - $e_node->setAttribute($attr, $elem->{$attr}); + $e_node->setAttribute($attr, $elem->getAttribute($attr)); } # appending all additional elements -- 2.43.0