homepage Welcome to WebmasterWorld Guest from 50.17.7.84
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / HTML
Forum Library, Charter, Moderators: incrediBILL

HTML Forum

    
Language in doctype
Is it valid
johnnie




msg:572813
 10:45 pm on Aug 18, 2004 (gmt 0)

Is it valid to change the doctype declaration part '//EN' to whatever language your website is written in? My website, which is in Dutch, uses this declaration:


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//NL" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"

My site now validates at w3c as "Valid -//W3C//DTD XHTML 1.0 Transitional//NL", instead of "Valid XHTML 1.0 Transitional". Does that mean it's less-supported or invalid?

Or should I just ignore the difference and accept this as 'valid xhtml'?

 

tedster




msg:572814
 1:17 am on Aug 19, 2004 (gmt 0)

As far as I know, the correct place to indicate language is in the lang attribute of the html element, not the DTD:

<html lang="nl">

Secondarily, language may also be indicated in a meta tag, but the lang attribute is supposed to override a meta tag language declaration, in case of a conflict.

<meta HTTP-EQUIV="Content-Language" Content="nl">

Language information is also sent by the server in the HTTP header.

Here's a W3C Reference [w3.org] about language on a web page. But, I can't find any W3C reference that recommends changing the DTD - so I wouldn't recommend it either.

mbauser2




msg:572815
 4:08 am on Aug 19, 2004 (gmt 0)

Don't change the language code in the public identifier.

That abbreviation doesn't refer to the content of the document. It refers to the language used to develop the markup language -- HTML tag names are taken from English, so the language has to be //EN. Always. No exceptions.

tedster




msg:572816
 5:09 am on Aug 19, 2004 (gmt 0)

Thanks, mbauser2. That was what I thought the EN stood for, but I was a bit gun shy in making a strong statement because I could not find a reference.

Do you have one?

bull




msg:572817
 9:40 am on Aug 19, 2004 (gmt 0)

(Not a reference)

[webmasterworld.com...]

encyclo




msg:572818
 10:45 am on Aug 19, 2004 (gmt 0)

Not a official reference either, but a good explanation:

[blooberry.com...]

Basically, the "EN" refers to the language of the DTD, not of the document itself. All W3C DTDs are written in English, so you should always use EN. If you have created your own DTD for your SGML documents, then it may be different (but you would be using SGML, not just HTML).

It is best to set the document language in the HTTP header before the page is served, or, failing that, to declare the language on the html element, either with the lang attribute (for HTML) or the xml:lang attribute (for XHTML). You can also specify the language in a meta element if you aren't able to change the html element (if you're using a CMS with limited access to the markup, for example).

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / HTML
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved