Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > HTML > HTML Code Clinic
HTML Code Clinic Do you have some HTML code you'd like to share and get suggestions from others for tweaking or improving it? This discussion is the place.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the HTML Code Clinic section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old July 12th, 2005, 07:06 PM
Registered User
Join Date: Sep 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default curious problem with W3C validator

It's been about a year since I played with this "web page authoring lark".

So I've written the first (hopefully of many) pages. It's previously been my habit to run the file(s) through the w3c validator to make sure that I'm standards compliant.

If I locate the validator page with firefox and then run the file through it tells me that I'm using valid xhtml 1.0 (strict), but if I do exactly the same using Opera 8.01 it tells me that

I was not able to extract a character encoding labeling from any of the valid sources for such information. Without encoding information it is impossible to reliably validate the document. I'm falling back to the "UTF-8" encoding and will attempt to perform the validation, but this is likely to fail for all non-trivial documents.

Below are the results of attempting to parse this document with an SGML parser.

1. Line 1, column 0: end of document in prolog
whereas my xml and doctype declaration (and the opening html tag) look like this:-

<?xml version="1.0" encoding="UTF-8" ?>
<!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">
So what am I doing wrong? Surely if the html/xhtml is valid (for the W3C) then it should also be correct for both browsers?



p.s. Oh and I'm not sure whether it's relevant, but I'm one of those nasty suspicious "software communists" i.e. a linux user. currently using SuSE 9.3 pro with KDE 3.4

Old April 3rd, 2006, 08:20 PM
Authorized User
Join Date: Oct 2004
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<html xmlns="http://www.w3.org/1999/xhtml">


<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

I got a clean validation.

Similar Threads
Thread Thread Starter Forum Replies Last Post
problem in using struts validator skmmail Struts 0 September 4th, 2007 06:00 AM
Curious image map issue... can you help? BananaJim Javascript 2 November 29th, 2006 03:10 PM
problem with document.location and w3c holdmykidney Javascript 2 May 3rd, 2005 07:41 PM
Curious Colonel Angus VB.NET 5 April 13th, 2005 10:11 PM
Append child problem org.w3c.dom vs_shankar2000 XML 0 December 8th, 2004 07:34 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.