Results 1 to 8 of 8
I want to print my following xml syntax on web using perlCGI script
print header;
print start_html( "Info");
print "<xml>\n";
print "\t\t\t<numb-compobjs>$comp_objs</numb-compobjs>\n";
print "\t\t\t<num-noncompobjs>$ncomp_objs</numb-noncompobjs>\n";
print "\t\t\t<tot-numbobjs>$total_objs</tot-numbobjs>\n";
print "</xml>\n";
print end_html;
...
- 02-01-2008 #1Linux Newbie
- Join Date
- Jan 2008
- Posts
- 114
How to print XML tags on web using perlCGI???
I want to print my following xml syntax on web using perlCGI script
print header;
print start_html( "Info");
print "<xml>\n";
print "\t\t\t<numb-compobjs>$comp_objs</numb-compobjs>\n";
print "\t\t\t<num-noncompobjs>$ncomp_objs</numb-noncompobjs>\n";
print "\t\t\t<tot-numbobjs>$total_objs</tot-numbobjs>\n";
print "</xml>\n";
print end_html;
and its giving me error, please help how can I print
- 02-01-2008 #2Linux Newbie
- Join Date
- Jan 2008
- Location
- UK
- Posts
- 211
Hi, What error is it coming out with? any clues as to where it is failing?
- 02-01-2008 #3Linux Newbie
- Join Date
- Jan 2008
- Posts
- 114
Sorry its not printing the xml syntax on web(IExplorer)
and when I am remvoing the
print header;
print start_html( "Info");
getting following error:-
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator
- 02-01-2008 #4
The error code is 503 or something like that, right? That means there is an error in your script. The usual suggestion is to first run the script from the commandline to see if there are any errors.
You need the header and start_html, because these give respectively the HTTP header (necessary for a browser to know what it should expect) and the <html> tag and <head> section of your page.
What output do you get? Click View Source in your web browser and see what's there.DISTRO=Arch
Registered Linux User #388732
- 02-01-2008 #5Linux Newbie
- Join Date
- Jan 2008
- Posts
- 114
Problem has been resolved.
Problem was whr the html header.
Due to html header I was not able to complile xml syntax on web
So I used following and its working fine:-
print "Content-type: text/xml\n\n";
print "<?xml version=\"1.0\"?>\n";
print "\t\t\t<numb-compobjs>$comp_objs</numb-compobjs>\n";
print "\t\t\t<num-noncompobjs>$ncomp_objs</numb-noncompobjs>\n";
print "\t\t\t<tot-numbobjs>$total_objs</tot-numbobjs>\n";
print end_html;
Thanks for all help and sugession, please keep helping me thank you so much.
- 02-04-2008 #6Linux Newbie
- Join Date
- Jan 2008
- Posts
- 114
Now I am facing another problem, its not printing my customize messages lieke print "Error: userName not exist" on web, how can resolve this issue????
- 02-04-2008 #7
Where / how are you printing this message?
DISTRO=Arch
Registered Linux User #388732
- 02-04-2008 #8Linux Newbie
- Join Date
- Jan 2008
- Posts
- 114
These are simple print commands of perl earlier it was showing perfectly in web browser with html header but after using
Content-type: text/xml
in place of html header for desplaying the hardcoded xml tags in script these are not working.


Reply With Quote