head must be a child of html. Content ignored.

I have a page that causes Safari to report errors.


In Safari, but not Firefox, 'Inspect Element' shows:
<head> must be a child of <html>. Content ignored.

The HTML and HEAD tags are in their correct places with no others anywhere.

It has Before <html> markup:

<?php

$doc_root = eregi_replace("/web$", "", $_SERVER["DOCUMENT_ROOT"]);
ini_set("session.save_path", "$doc_root/_SESSIONS/");

$sid = session_id();
if (empty($sid)) { session_start(); $sid = session_id(); }

?>

which should produce no o/p except the session headers.

The server serves up a page that starts with a blank line.

If I use curl to read the page, including the headers I get

HTTP/1.1 200 OK
Server: Zeus/4.3
Content-Type: text/html
Date: Mon, 14 Mar 2011 14:43:02 GMT
Transfer-Encoding: chunked
Set-Cookie: X-Mapping-kjicghkc=E87584E2EAE4E8195CCC41BFCF4527BD; path=/


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html 
xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta ŠŠŠŠ

Without the header I get a blank line then the DOCTYPE line.

Could the blank line cause it? If so, how do I remove it?

David


David Ledger - Freelance Unix Sysadmin in the UK.
HP-UX specialist of hpUG technical user group (www.hpug.org.uk)
email@hidden
www.ivdcs.co.uk


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

I would say this is definitely the issue. Try going through your code,
looking for trailing spaces after the ; or } at the end of all lines,
or empty lines without code. Just remove all of them. Then take a look
at how your line-endings are set in Freeway. Try setting it to Unix
newline if it’s set to anything else.

Walter

On Mar 15, 2011, at 10:32 AM, David Ledger wrote:

Could the blank line cause it? If so, how do I remove it?


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

At 11:06 -0400 15/3/11, Walter Lee Davis wrote:

On Mar 15, 2011, at 10:32 AM, David Ledger wrote:

Could the blank line cause it? If so, how do I remove it?
I would say this is definitely the issue. Try going through your
code, looking for trailing spaces after the ; or } at the end of all
lines, or empty lines without code. Just remove all of them. Then
take a look at how your line-endings are set in Freeway. Try setting
it to Unix newline if it’s set to anything else.

Walter

I’ve removed all blank lines in the before HTML markup - even though
blank lines within <?phpŠ ?> won’t produce output. I’ve even removed
all spaces from the code. When I open Page → HTML MarkupŠ > Before
HTML, all is highlighted from the opening <? to the closing ?> - no
more; so there’s no trailing newline in the markup. The DOCTYPE line
of course is generated totally by FW. Document Setup has Line feeds:
Unix and HTML code: More Efficient (for these tests). Any o/p between
the Before HTML markup and DOCTYPE is up to Freeway as far as I can
see.

David


David Ledger - Freelance Unix Sysadmin in the UK.
HP-UX specialist of hpUG technical user group (www.hpug.org.uk)
email@hidden
www.ivdcs.co.uk


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options