| 1 | #!/usr/bin/perl -w | ||
| 2 | |||
| 3 | # CGI script that simply displays the XML | ||
| 4 | |||
| 5 | use strict; | ||
| 6 | use CGI::XMLForm; | ||
| 7 | |||
| 8 | my $cgi = new CGI::XMLForm; | ||
| 9 | |||
| 10 | print $cgi->header; | ||
| 11 | |||
| 12 | # Output HTML Body | ||
| 13 | if ($cgi->param) { | ||
| 14 | print $cgi->start_html('CGI::XMLForm'), | ||
| 15 | $cgi->h1("Form gave us the following params:"), | ||
| 16 | $cgi->hr; | ||
| 17 | print $cgi->pre($cgi->escapeHTML(join "\n", split '&', $cgi->query_string)); | ||
| 18 | |||
| 19 | my $xml = $cgi->ToXML(); | ||
| 20 | |||
| 21 | print $cgi->hr; | ||
| 22 | |||
| 23 | print $cgi->pre($cgi->escapeHTML($xml)), $cgi->br, $cgi->hr; | ||
| 24 | |||
| 25 | } | ||
| 26 | else { | ||
| 27 | print $cgi->start_html('error'), | ||
| 28 | $cgi->h1("Error: "), | ||
| 29 | $cgi->h2("FATAL ERROR : Expecting parameters - please execute from correct source"); | ||
| 30 | } |