in reply to XML tags using perl CGI
-no_xhtml By default, CGI.pm versions 2.69 and higher emit XHTML (http://www +.w3.org/TR/xhtml1/). The -no_xhtml pragma disables this feature. Than +ks to Michalis Kabrianis <kabrianis@hellug.gr> for this feature. If start_html()'s -dtd parameter specifies an HTML 2.0 or 3.2 DTD, + XHTML will automatically be disabled without needing to use this pra +gma.
update: my CGI.pm does the correct thing for that code (slightly fixed so it can be run without editing):
output:use CGI; my $query = CGI->new; print $query->header(-type=>'text/html', -declare_xml=>0); print $query->start_html(-title=>'Blah blah blah.', -background=>"../images/$SiteName.background.jpg", -link=>'brown', -vlink=>'#8b4513', -style=>{'src'=>"$SiteName.styles.css"}, -script=>{ -language=>'JavaScript', -src=>"$SiteName.scripts.js" } );
Note that you actually should not use declare_xml as a parameter to header() but to start_html().Declare-xml: 0 Content-Type: text/html; charset=ISO-8859-1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-U +S"> <head> <title>Blah blah blah.</title> <link rel="stylesheet" type="text/css" href=".styles.css" /> <script src=".scripts.js" type="text/javascript"></script> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1 +" /> </head> <body link="brown" vlink="#8b4513" background="../images/.background.j +pg">
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: XML tags using perl CGI
by pmcaveman (Novice) on Feb 06, 2007 at 11:43 UTC | |
by davorg (Chancellor) on Feb 06, 2007 at 12:11 UTC | |
by pmcaveman (Novice) on Feb 06, 2007 at 12:35 UTC | |
by Joost (Canon) on Feb 06, 2007 at 13:09 UTC | |
by Bod (Parson) on Jan 14, 2024 at 00:34 UTC | |
| |
by davorg (Chancellor) on Feb 06, 2007 at 13:15 UTC | |
by pmcaveman (Novice) on Feb 06, 2007 at 13:48 UTC | |
|