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?


In reply to printing one output from multiple scripts. by mipatel

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.