common/tools/mergeXML.pl
changeset 588 1bdf644455fe
parent 570 e5e6ae6bf38f
child 814 11c237c9ad00
equal deleted inserted replaced
587:97d29037659e 588:1bdf644455fe
    36 }
    36 }
    37 if ($help || $wrongArgs)
    37 if ($help || $wrongArgs)
    38 {
    38 {
    39 	print <<"EOT";
    39 	print <<"EOT";
    40 
    40 
    41 mergeXML.pl --xsl=brag.xsl --merge=SystemDefinition,systemModel,layer(name),block(name),package(name) sysModel1.xml [model2.xml ...] > output.xml
    41 mergeXML.pl --xsl=brag.xsl --merge=SystemDefinition,systemModel,layer(name),block(name),package(name) sysModel1.xml [model*.xml ...] > output.xml
    42 EOT
    42 EOT
    43 	exit(0 + !$help);
    43 	exit(0 + !$help);
    44 }
    44 }
    45 
    45 
    46 # Hash of tags that should be merged, with optional attribute consideration
    46 # Hash of tags that should be merged, with optional attribute consideration
    49 {
    49 {
    50 	my ($tag, $attribute) = $term =~ m{(\w+)\((\w+)\)};
    50 	my ($tag, $attribute) = $term =~ m{(\w+)\((\w+)\)};
    51 	$tag ||= $term;
    51 	$tag ||= $term;
    52 	$mergeTags->{$tag} = $attribute;
    52 	$mergeTags->{$tag} = $attribute;
    53 }
    53 }
       
    54 
       
    55 # Expand wildcards
       
    56 @ARGV = map { glob $_ } @ARGV;
    54 
    57 
    55 # Merge all the trees together
    58 # Merge all the trees together
    56 my $outTree = mergeMultipleTrees($mergeTags, @ARGV);
    59 my $outTree = mergeMultipleTrees($mergeTags, @ARGV);
    57 
    60 
    58 # Output total tree
    61 # Output total tree