mipatel has asked for the wisdom of the Perl Monks concerning the following question:
hello, i have close to 3 perl scripts which generates the output in xml. with the use of xsl, my xml output is showing in table format.
I want to combine the output of these perl scripts and generate only ONE TABLE instead of 3 DIFFERENT tables.
#Example Script 1 use strict; use warnings; use Data::Dumper; use XML::Simple; use Getopt::Long; my $output = ''; my $debug = 0; my $path; GetOptions('path=s' => \$path,'output=s' => \$output, 'debug=i' => \$d +ebug); if($output eq ''){ die ("parameter --output=s is missing"); } open my $xmloutput, ">", $outputFile or die "can not open $outputFile +"; print $xmloutput "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<?xml-s +tylesheet type=\"text/xsl\" href=\"book.xsl\"?>\n<Books>\n"; my $parser = new XML::Simple; my $data = $parser->XMLin("$path"); print $xmloutput " <bookDetails> \n"; print $xmloutput " <bookName>$data</bookName> \n"; print $xmloutput " </bookDetails> \n"; print $xmloutput " </Books> \n"; close $xmloutput;
here is the example 2 script
EXAMPLE 2 use strict; use warnings; use Data::Dumper; use XML::Simple; use Getopt::Long; my $output = ''; my $debug = 0; my $path; GetOptions('path=s' => \$path,'output=s' => \$output, 'debug=i' => \$d +ebug); if($output eq ''){ die ("parameter --output=s is missing"); } open my $xmloutput, ">", $outputFile or die "can not open $outputFile +"; print $xmloutput "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<?xml-s +tylesheet type=\"text/xsl\" href=\"Piano.xsl\"?>\n<Piano>\n"; my $parser = new XML::Simple; my $data = $parser->XMLin("$path"); print $xmloutput " <PianoDetails> \n"; print $xmloutput " <PianoName>$data</PianoName> \n"; print $xmloutput " </PianoDetails> \n"; print $xmloutput " </Piano> \n"; close $xmloutput;
How would i combine these two scripts and print one output from both scripts?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: printing one output from multiple scripts.
by chromatic (Archbishop) on Jun 18, 2012 at 22:58 UTC | |
by mipatel (Novice) on Jun 19, 2012 at 15:07 UTC | |
by chromatic (Archbishop) on Jun 19, 2012 at 23:01 UTC |