Michael D Schleif [EMAIL PROTECTED] wrote:
: Charles K. Clarkson [EMAIL PROTECTED]
: [2004:08:12:11:01:29-0500] scribed:
: : Michael D Schleif [EMAIL PROTECTED] wrote:
: :
: : : As near as I can tell, the ?xml directive is *optional*,
: : : according to the XML standards. However, it appears to be
: : : mandatory in my version of CGI.pm.
: :
: : It is mandatory in my version also. Here is a snippet
: : from start_html().
: :
[snipped code]
: :
: : Commenting line 1324 stops the ?xml line being output.
: : Changing a module directly is rarely recommended, but you'll
: : probably want to make this change site-wide. Your line number
: : will probably be different than mine.
: snip /
:
: Yes, I had already seen that. Written as it is, there is no
: way to `formally' turn it OFF, without resorting to editing the
: module source.
: And, as you point out, that is quite distasteful ;
:
: I may have found a better way:
:
: #! /usr/bin/perl -T
: use diagnostics;
: use strict;
: use warnings;
: use CGI;
: my $q = new CGI;
: my $start_html = $q-start_html (simple.plx);
: print $q-header,
: mod_start_html ($start_html),
: $q-end_html;
: exit 0;
: sub mod_start_html {
: $_[0] =~ s!\?xml[^]+!!;
: return $_[0];
: }
:
: This appears to work, even when adding several attributes to
: $q-start_html().
Or (Just thought of this.):
my $q = new CGI;
print
$q-header(),
$q-no_xml_start_html( 'simple.plx' ),
$q-end_html();
sub CGI::no_xml_start_html {
my $self = shift;
my $start_html = $self-start_html( @_ );
$start_html =~ s!\?xml[^]+!!;
return $start_html;
}
__END__
: O, and this *DOES* validate here:
:
: http://validator.w3.org/
:
: What do you think?
If the xml doctype is supposed to be optional (I
didn't verify this), it should validate when missing.
HTH,
Charles K. Clarkson
--
Mobile Homes Specialist
254 968-8328
___
Perl-Win32-Web mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs