<pi>
I appreciate if you can find out what is wrong with this updated code and give me the solution, as i started learning this XML module just a day before,i could not get handle of everything.
sub GetMappletList
{
my $Target_node;
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/)
{
print " The Workflow xml nme is $OutFile
+Name\n";
$MappletXmlName = "$Mapplet_Dir/$AlgoNm.
+XML";
print "The Dir name is $MappletXmlName\n
+";
my $MpltParser = XML::LibXML->new();
my $TargetXml = $MpltParser->parse_file(
+"$OutFileName");
my $MpltXml = $MpltParser->parse_file("$
+MappletXmlName");
my @MappletNode = $MpltXml->findnodes(
+'//MAPPLET');
my @TargetNode = $TargetXml->findnodes
+('//FOLDER');
#my $TargetRootNode = $TargetXml->find
+nodes('/POWERMART');
my $TargetRootNode = $TargetXml->get
+DocumentElement;
#$TargetXml->setDocumentElement( '/POWER
+MART/REPOSITORY/FOLDER' );
for my $TgtNode (@TargetNode)
{
for my $node (@MappletNode)
{
$TgtNode->addChild( $no
+de );
$TgtNode->setOwnerDocum
+ent( $TargetXml );
#$MpltXml->toFile($OutF
+ileName);
print "The Value is $Tg
+tNode";
}
}
}
}
close(GET_MAPPLET_LIST);
}
|