Forum Moderators: open

Message Too Old, No Replies

Validation: W3 now checking for XML prolog?

Did I miss the announcement?

         

albo

10:07 pm on Mar 11, 2008 (gmt 0)

10+ Year Member



Several of my files which used to validate, now fail, with one error, missing an XML prolog... I made no change to these files (some of these files are in fact weeks old)!

Within the past week, validation seems to have changed. Did I miss an announcement of a validator upgrade?

encyclo

10:28 pm on Mar 11, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The main W3C validator still accepts XHTML without a prolog, so something has changed at your end. Were you validating offline (via upload) before but online now? How are you defining the page's character encoding? What is the exact error message that you are getting?

albo

2:29 am on Mar 12, 2008 (gmt 0)

10+ Year Member



Going via file upload. Is it a problem with my UTF-8 (i.e. do I need to use ISO...)? Files typically (in fact 99%) begin with:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
<head>
<title>whatever</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />

penders

11:58 am on Mar 12, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Is it a problem with my UTF-8 (i.e. do I need to use ISO...)?

Are you saving your files as UTF-8 ?

The code fragment you give validates OK, providing the page is complete.

albo

4:05 pm on Mar 12, 2008 (gmt 0)

10+ Year Member



AHHH! Found the problem! I glanced at the file with Notepad++, not changing it (I thought).

Notepad++ had treated the tab at "http" as a "tab" instead of spaces, mashing out the blank on the second line, which kept it from parsing.

I had originally written the code in WeBuilder, with tabs.

I transferred the file to my new MBP and put it in BBedit and saw the problem! Let that be a lesson, on editors!

Sorry to have bugged you, and I'll be more careful in the future before doing so again.

g1smd

4:39 pm on Mar 12, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Useful tip, and one to trip other people up from time to time too.

encyclo

4:58 pm on Mar 12, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm glad that you've solved your problem - I would like to point out some best practices which would improve your code shown above. Firstly, you should be using XHTML 1.0 rather than 1.1 (I won't go into the HTML vs. XHTML debate here!), and add the
lang
attribute as well as
xml:lang
to define the document language. You should also place the meta charset element before any content, including the
title
element. This won't affect validity in any way, but it is more technically-correct.

penders

5:20 pm on Mar 12, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Notepad++ had treated the tab at "http" as a "tab" instead of spaces, mashing out the blank on the second line,...

Sorry, not sure that I follow?

albo

5:43 pm on Mar 12, 2008 (gmt 0)

10+ Year Member



sorry, penders, I phrased awkwardly: Notepad++ wasn't set up to treat "tabs as spaces" I guess is the correct phrasing?

encyclo: will do. I've seen (and perused) the debates about html vs xhtml) here and in many books...my shelves runneth over! I have just a few files with which to deal, so I'll make the updates toot sweet.

g1smd

6:41 pm on Mar 12, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Is that the american for tout de suite?

albo

7:49 pm on Mar 12, 2008 (gmt 0)

10+ Year Member



Es cowpie fer tout de suite, senor, que no? In Santa Fe, NM, (my neighborhood) we speak a mixture of cowboy, fractured Spanish, English, etc.) English teacher that I am, I still sometimes forget and foist Santa Fe-isms upon the world...