Hi Corion - Sorry for confusing you, Here is my complete function GetMappletList() i am trying to call,but i am calling it from same script in which the function was declared, The variable $SourceTableName used in the if condition is using values from global variable declared in the script.I am trying to copy portion of xml elements from the source file $MappletXmlName to another file $OutFileName which too have some elements.
sub GetMappletList { my ($TableNm,$ColumnNm,$DomainNm,$AlgoNm); my @MaskingAlgorithmList; my @MappletNode; my $MpltRefFile_Dir = shift; my $MappletXmlName; open GET_MAPPLET_LIST, "<","$Profiler_Dir/$MpltRefFile_Dir/Inve +ntory.rpt" or die "ERROR : Couldn't Open $Profiler_Dir/$MpltRefFile_D +ir/Inventory.rpt $!"; while (my $InvtoryCol = <GET_MAPPLET_LIST> ) { chomp $InvtoryCol; ($TableNm,$ColumnNm,$DomainNm,$AlgoNm) = split(/ +,/,$InvtoryCol); if ($TableNm =~ /$SourceTableName/) { $MappletXmlName = "$Mapplet_Dir/$AlgoNm. +XML"; my $MpltParser = XML::LibXML->new(); my $MpltXml = $MpltParser->parse_file("$ +MappletXmlName"); my $TargetXml = $MpltParser->parse_file( +"$OutFileName"); my @MappletNode = $MpltXml->findnodes('/ +POWERMART/REPOSITORY/FOLDER/MAPPLET'); for my $node (@MappletNode) { $TargetXml->appendChild +($node); #print $node->toString( +2); } } } close(GET_MAPPLET_LIST); }
In reply to Re^2: Copy portion of XML elements from one XML file to another exiting XML file
by Dravidan
in thread Copy portion of XML elements from one XML file to another exiting XML file
by Dravidan
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |