20 replies [Last post]
sionvalais
Offline
Regular
Last seen: 18 years 33 weeks ago
Joined: 2003-06-06
Posts: 49
Points: 0

My website has been converted to xhtml strict but it is not valid according to the xhtml validator. Has it something to do with the css declarations?

http://www.sionvalais.com/zermatt.php

cheers,

Mark

dJomp
dJomp's picture
Offline
Enthusiast
Last seen: 5 years 51 weeks ago
Joined: 2003-03-23
Posts: 422
Points: 0

xhtml strict

I suggest just reading through the comments. For example:

Quote:
Line 2, column 5: document type does not allow element "head" here; assuming missing "html" start-tag

means that you've opened a <head> tag without opening the <html> first.

It shouldn't be the CSS, I don't think the HTML validator checks that.

You know you're a geek when you try to shoo a fly away from the monitor with your cursor.

sionvalais
Offline
Regular
Last seen: 18 years 33 weeks ago
Joined: 2003-06-06
Posts: 49
Points: 0

not really working

it must be something else.

paCkeTroUTer
paCkeTroUTer's picture
Offline
Enthusiast
Melbourne, Australia
Last seen: 8 years 36 weeks ago
Melbourne, Australia
Timezone: GMT+10
Joined: 2003-06-27
Posts: 241
Points: 2

xhtml strict

I don't think you can check php pages via the validator. So a work around is, open the php page in your browser, copy the source and paste it into an html file and test it.

http//melbourne.ug.php.net

paCkeTroUTer
paCkeTroUTer's picture
Offline
Enthusiast
Melbourne, Australia
Last seen: 8 years 36 weeks ago
Melbourne, Australia
Timezone: GMT+10
Joined: 2003-06-27
Posts: 241
Points: 2

xhtml strict

sionvalais, I don't think you understand what XHTML is. I have been trying to validate your page, but it has got hundreds of errors. The very basic syntax of XHTML is not followed. I would suggest that you validate your page for XHTML transitional first before jumping into Strict mode. Also have a look at this post I made earlier [url=http://www.csscreator.com/css-node/17188

BTW I am still working on your page and when I finish it you need to compare it to your page for you to understand the differences. Cheers

http//melbourne.ug.php.net

paCkeTroUTer
paCkeTroUTer's picture
Offline
Enthusiast
Melbourne, Australia
Last seen: 8 years 36 weeks ago
Melbourne, Australia
Timezone: GMT+10
Joined: 2003-06-27
Posts: 241
Points: 2

xhtml strict

There you go..... XHTML 1.0 Strict compliant !!

http://validator.w3.org/check?uri=http%3A%2F%2Fwww.techsatcomputers.com%2FTEST%2Fzermatt.htm&charset=%28detect+automatically%29&doctype=Inline&ss=1&sp=1&outline=1&No200=1&verbose=1

and this is your page which I modified to make it XHTML strict. Some of the links will not open in new page as XHTML strict does not support target="_blank". If you need a work around I can give you one(javascript). Till then cheers.

PS. Make sure you compare your code with mine and learn what tags have been deprecated and also how they have been implemented for XHTML.

http//melbourne.ug.php.net

sionvalais
Offline
Regular
Last seen: 18 years 33 weeks ago
Joined: 2003-06-06
Posts: 49
Points: 0

Thanx!

I really appreciate all the work you have done!
Now I see what is wrong... (delete base target,
, nosave, the open php line, leftover table statements etc.). I will effectuate the change on all pages. Was there anything wrong with the meta tags?

cheers,

Mark Tongue

paCkeTroUTer
paCkeTroUTer's picture
Offline
Enthusiast
Melbourne, Australia
Last seen: 8 years 36 weeks ago
Melbourne, Australia
Timezone: GMT+10
Joined: 2003-06-27
Posts: 241
Points: 2

Re: Thanx!

sionvalais wrote:
I really appreciate all the work you have done!
Now I see what is wrong... (delete base target,
, nosave, the open php line, leftover table statements etc.). I will effectuate the change on all pages. Was there anything wrong with the meta tags?

cheers,

Mark Tongue
Not a problem mate.

I can't recall changing the meta tags but I think you didn't close off your link tag:
<link href="http://www.sionvalais.com/css/cams.css" rel="stylesheet" type="text/css" />

http//melbourne.ug.php.net

sionvalais
Offline
Regular
Last seen: 18 years 33 weeks ago
Joined: 2003-06-06
Posts: 49
Points: 0

One last thing

I suspect that this line: <?xml version="1.0" encoding="iso-8859-1"?>
got misread in a *.php ços it's begin and end tag is fairly simular to the one's in php. Is it possible to leave this line out?

sincerely,
Mark

paCkeTroUTer
paCkeTroUTer's picture
Offline
Enthusiast
Melbourne, Australia
Last seen: 8 years 36 weeks ago
Melbourne, Australia
Timezone: GMT+10
Joined: 2003-06-27
Posts: 241
Points: 2

xhtml strict

This is what you need for php:

<?php echo "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?".">"; ?> 
<!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"> 

http//melbourne.ug.php.net

dJomp
dJomp's picture
Offline
Enthusiast
Last seen: 5 years 51 weeks ago
Joined: 2003-03-23
Posts: 422
Points: 0

xhtml strict

The W3 validator will take a PHP file by URI - since it will 'fetch' the page in the normal HTTP manner, it will be 'parsed' and the XHTML output will be returned.

You know you're a geek when you try to shoo a fly away from the monitor with your cursor.

paCkeTroUTer
paCkeTroUTer's picture
Offline
Enthusiast
Melbourne, Australia
Last seen: 8 years 36 weeks ago
Melbourne, Australia
Timezone: GMT+10
Joined: 2003-06-27
Posts: 241
Points: 2

xhtml strict

dJomp wrote:
The W3 validator will take a PHP file by URI - since it will 'fetch' the page in the normal HTTP manner, it will be 'parsed' and the XHTML output will be returned.

You are right !!. Sorry for the wrong Information :roll:

http//melbourne.ug.php.net

insin
insin's picture
Offline
Enthusiast
Belfast, NI
Last seen: 18 years 37 weeks ago
Belfast, NI
Joined: 2003-05-07
Posts: 57
Points: 0

xhtml strict

You should also note that the xml prolog: <?xml version="1.0" encoding="iso-8859-1"?>

...makes IE use the broken box model. Removing it should make IE render the page in standards mode, while the xml prolog is not needed for conformance to the xhtml spec.

A Pedant Writes...
Into the mountain,
I will fall.

sionvalais
Offline
Regular
Last seen: 18 years 33 weeks ago
Joined: 2003-06-06
Posts: 49
Points: 0

delete it?

so can I leave it out of the script?

KnightWolfJK
KnightWolfJK's picture
Offline
Enthusiast
Washington, DC
Last seen: 14 years 31 weeks ago
Washington, DC
Timezone: GMT-5
Joined: 2003-06-10
Posts: 210
Points: 0

xhtml strict

@insin: I've read in a few places that the prolog isn't necessary, but in my personal experience it was necessary to include it to be able to properly view my CSS in IE6. Now I'm running into issues because I'm using the box-model hack and the xml prolog ([url=http://www.csscreator.com/css-node/293 here[/url]). Any suggestions?

Diplomacy is the art of letting someone have your way

insin
insin's picture
Offline
Enthusiast
Belfast, NI
Last seen: 18 years 37 weeks ago
Belfast, NI
Joined: 2003-05-07
Posts: 57
Points: 0

xhtml strict

KnightWolfJK wrote:
@insin: I've read in a few places that the prolog isn't necessary, but in my personal experience it was necessary to include it to be able to properly view my CSS in IE6. Now I'm running into issues because I'm using the box-model hack and the xml prolog ([url=http://www.csscreator.com/css-node/293 here[/url]). Any suggestions?

The prolog is uneccesary and you can safely get rid of it (in fact it will fix any problems with Internet Explorer caused by quirky rendering by making IE6 render in standards compliant mode) - what do you mean when you say you can't view your CSS "properly" without it?

See Tantek's Mox Model Hack page for more info on this. There is a note about the xml prolog in the addendum to this article.

A Pedant Writes...
Into the mountain,
I will fall.

KnightWolfJK
KnightWolfJK's picture
Offline
Enthusiast
Washington, DC
Last seen: 14 years 31 weeks ago
Washington, DC
Timezone: GMT-5
Joined: 2003-06-10
Posts: 210
Points: 0

xhtml strict

When I remove <?php echo "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?".">"; ?> from my page my CSS isn't applied correctly. See attachments for visual examples.

Diplomacy is the art of letting someone have your way

insin
insin's picture
Offline
Enthusiast
Belfast, NI
Last seen: 18 years 37 weeks ago
Belfast, NI
Joined: 2003-05-07
Posts: 57
Points: 0

xhtml strict

KnightWolfJK wrote:
When I remove <?php echo "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?".">"; ?> from my page my CSS isn't applied correctly. See attachments for visual examples.

I checked your site (with the prolog) in Firebird and it rendered the same way as the "wrong" screenshot you posted. When I refreshed the page, it then rendered the same way as the "right" screenshot you posted. Could you put up a second page (index2.php or something) without the prolog and I'll have a closer look after lunchtime for you?

The xml prolog shouldn't have anything to do with it (apart from forcing standards mode) - most intriguing... Wink

A Pedant Writes...
Into the mountain,
I will fall.

sionvalais
Offline
Regular
Last seen: 18 years 33 weeks ago
Joined: 2003-06-06
Posts: 49
Points: 0

with or without

without prolog
http://www.sionvalais.com/achensee.php

with prolog:
http://www.sionvalais.com/anzere.php

do you see a difference?

sionvalais
Offline
Regular
Last seen: 18 years 33 weeks ago
Joined: 2003-06-06
Posts: 49
Points: 0

German and French

It is not possible to write german or french special characters in my website. Xhtml is preventing that. Do I need an other charset?

KnightWolfJK
KnightWolfJK's picture
Offline
Enthusiast
Washington, DC
Last seen: 14 years 31 weeks ago
Washington, DC
Timezone: GMT-5
Joined: 2003-06-10
Posts: 210
Points: 0

xhtml strict

@insin: I'll post my reply in [url=http://www.csscreator.com/css-node/293 thread[/url] so as not to step on sionvalais' toes.

Diplomacy is the art of letting someone have your way