From 419dc93ba8236fcefd7dab7dc429d690346c645a Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Wed, 18 Nov 2015 14:55:59 -0700 Subject: [PATCH] need to skip values/value nodes here --- utils/perl5lib/Config/ConfigCase.pm | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/utils/perl5lib/Config/ConfigCase.pm b/utils/perl5lib/Config/ConfigCase.pm index 5170baab22a..c6df41520dc 100644 --- a/utils/perl5lib/Config/ConfigCase.pm +++ b/utils/perl5lib/Config/ConfigCase.pm @@ -117,24 +117,26 @@ sub add_config_variables # This creates a hash of values with attribute name and id as keys # if($node_name eq "values"){ - foreach my $val_node ($define_node->findnodes(".//*")){ + foreach my $val_node ($define_node->findnodes(".//value")){ if($val_node->hasAttributes()){ - my @att = $val_node->attributes(); - foreach my $attstr (@att){ - my $att = $attstr->nodeName(); - my $att_val = $attstr->getValue(); - my $val = $val_node->textContent(); - $val =~ s/\$MODEL/$model/; - $val =~ s/\$CIMEROOT/$cimeroot/; - if (-d $srcroot) { - $val =~ s/\$SRCROOT/$srcroot/; - } - $self->{$id}{$att}{$att_val} = $val; + my @att = $val_node->attributes(); + foreach my $attstr (@att){ + my $att = $attstr->nodeName(); + my $att_val = $attstr->getValue(); + my $val = $val_node->textContent(); + $val =~ s/\$MODEL/$model/; + $val =~ s/\$CIMEROOT/$cimeroot/; + if (-d $srcroot) { + $val =~ s/\$SRCROOT/$srcroot/; + } + $self->{$id}{$att}{$att_val} = $val; + } } -} } }else{ + # we want to avoid the 'value' nodes which are children of 'values' + next if($node_name eq 'value' and $define_node->parentNode() ne $node); my $node_value = $define_node->textContent(); if (defined $node_value) { $node_value =~ s/\$MODEL/$model/;