lakeTrout has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monks
I built an XML parser from a flat file. From here, I woul like the XML file to print out in it's entirety to the browser (to verify it's well formed and eaiser to look at than text -- it can be it's own script because it will be part of a process/wizzard). Essentially, I just need a script that prints an XML file that already exists to a browser and nothing else. Am I making this harder than it has to be?
I'm thinking something like this, but I'm not sure if this is the right road to go down or if there isn't something better. Any help much appreciated!
I built an XML parser from a flat file. From here, I woul like the XML file to print out in it's entirety to the browser (to verify it's well formed and eaiser to look at than text -- it can be it's own script because it will be part of a process/wizzard). Essentially, I just need a script that prints an XML file that already exists to a browser and nothing else. Am I making this harder than it has to be?
I'm thinking something like this, but I'm not sure if this is the right road to go down or if there isn't something better. Any help much appreciated!
#!/usr/bin/perl use strict; use warnings; use CGI qw(:standard); use CGI::Carp qw(fatalsToBrowser); print header; print header, start_html ("XML File"), open(XMLFILE, "foo.xml"); while (<XMLFILE>){ print; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Print out an XML file to browser
by been42 (Curate) on Feb 20, 2007 at 04:10 UTC | |
by lakeTrout (Scribe) on Feb 20, 2007 at 04:37 UTC | |
by virtualsue (Vicar) on Feb 20, 2007 at 05:56 UTC | |
by lakeTrout (Scribe) on Feb 20, 2007 at 06:58 UTC | |
by been42 (Curate) on Feb 20, 2007 at 14:55 UTC | |
by siva kumar (Pilgrim) on Feb 20, 2007 at 05:41 UTC | |
by virtualsue (Vicar) on Feb 20, 2007 at 06:26 UTC | |
by lakeTrout (Scribe) on Feb 20, 2007 at 05:55 UTC | |
by dorward (Curate) on Feb 20, 2007 at 11:50 UTC | |
Re: Print out an XML file to browser
by odrm (Novice) on Feb 20, 2007 at 12:06 UTC | |
by lakeTrout (Scribe) on Feb 20, 2007 at 19:26 UTC | |
by benizi (Hermit) on Feb 20, 2007 at 21:13 UTC | |
by odrm (Novice) on Mar 23, 2007 at 14:31 UTC | |
Re: Print out an XML file to browser
by almut (Canon) on Feb 20, 2007 at 11:04 UTC | |
Re: Print out an XML file to browser
by Moron (Curate) on Feb 20, 2007 at 10:55 UTC |
Back to
Seekers of Perl Wisdom