Re: XHTML validator problems

Allan Smith wrote:

>The page at
>http://www.telfordsteamrailway.co.uk/testcss.shtml
>
>validates as XHTML1.0 Transitional using the online validator at
>http://validator.w3.org
>
>But when I change the DTD to Strict it fails
>Also if I change the DTD to XHTML 1.1 it fails 
>align="right" not valid in IMG (line 50)
>But there is no objection to 
>Align="left" in IMG (line58)
>I'm obviously missing a trick here - help please?
>
>...
>  
>


Hi Allan,

I looked at http://www.telfordsteamrailway.co.uk/testcss.html (ie not 
with .shtml) and found no validator problems. So it looks like both the 
XHTML1.1 and CSS are fine.  I tried it via upload too, and that worked 
without a hitch.  I couldn't see an img element on line 58.

I might offer three rather minor observations.  Your link 'surrounding 
site' contains a space in the href attribute value; conveniently, my 
browser seems to drop this space when I click the link, so it seems not 
to matter.

Secondly, your content-type setting is unusual and (unless I am 
mistaken) non standard. You specified

<meta http-equiv="Content-Type" content=" en-gb; text/html; 
charset=iso-8859-1" />

but the language part (" en-gb;") does not belong here.  RFC2616 
specifies the formal syntax for the content type as

    Content-Type = "Content-Type" ":" media-type
    media-type = type "/" subtype *( ";" parameter )

which means examples like "text/html" and "application/xhtml+xml; 
charset=iso-8859-1" would both be valid, whereas putting anything before 
the 'type' part is not valid.  The asterisk in the formal grammer means 
that any number of parameters can optionally be /appended/ (but not 
prepended), separated by semicolons.  But to specify a content language 
in the HTTP header, you'd have to do it a different way and put this in 
the XHTML:

<meta http-equiv="Content-Language" content="en-gb" />

This seems pointless because it duplicates the function of the XHTML 
<html xml:lang="en-gb"> attribute.

It's no surprise that the W3C Validator (an HTML validator) does not 
validate the HTTP parameters, which are probably considered outside its 
scope.

The other observation is more a question really.  When a document such 
as this one is XML and so starts with (in this case)

<?xml version="1.0" encoding="iso-8859-1"?>

does this mean that the <meta> giving the content type and encoding is 
redundant?

<meta http-equiv="Content-Type" content=" en-gb; text/html; 
charset=iso-8859-1" />

What would happen if the <meta> gave a different character encoding from 
the <?xml?> line?

Regards,
Rick :-)


Refs:
HTTP1.1 - RFC2616: http://www.ietf.org/rfc/rfc2616.txt
Language tags - RFC1766: http://www.ietf.org/rfc/rfc1766.txt





--
Registered Office: Roke Manor Research Ltd, Siemens House, Oldbury, Bracknell,
Berkshire. RG12 8FZ

The information contained in this e-mail and any attachments is confidential to
Roke Manor Research Ltd and must not be passed to any third party without
permission. This communication is for information only and shall not create or
change any contractual relationship.

Received on Thursday, 22 January 2004 05:12:43 UTC