HTML DOCTYPE declarations

Moderator: Mick

HTML DOCTYPE declarations

Postby Hartzell » 08 Jun 2012, 17:09

Over the past few years my friends and I have put together some simple webpages regarding Taiwan history and related topics. Now some acquaintances have offered to translate these webpages into Japanese.

An example of this simple type of webpage is here --
http://www.taiwanbasic.com/civil/histdev.htm

. . . . and a link to the Chinese version is provided at the bottom.

My question regards the proper DOCTYPE declaration which should be given at the top of an HTML document which is intended to be shown in Japanese. I am unfamiliar with this aspect, and wonder if some more knowledgeable persons could offer some advice on this "Japanese webpage" aspect.

When writing these types of simple webpages, here are the typical DOCTYPE declarations that I have been using.

[ENGLISH]

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">


[CHINESE]

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//ZH">


I tried to find a random Japanese webpage via http://www.google.co.jp . . . . . and found a simple page whose source code contained the following declaration at the beginning.

[JAPANESE]

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ja" lang="ja">


Is this what I am looking for? Or are some adjustments and changes needed? Any advice from persons with expertise in this area would be appreciated.
Richard W. Hartzell
contact me by email at rwh.midway@gmail.com
Neihu District, Taipei (114)
Forumosan avatar
Hartzell
Mando-pop Singer (Guóyǔ liúxíng gēshǒu)
Mando-pop Singer (Guóyǔ liúxíng gēshǒu)
 
Posts: 2345
ORIGINAL POSTER
Joined: 31 Oct 2000, 17:01
Location: Nei Hu District, Taipei, Taiwan
19 Recognized(s)



Re: HTML DOCTYPE declarations

Postby Brendon » 08 Jun 2012, 19:51

The clean, modern way to do this is just:

Code: Select all
<!DOCTYPE html>
<html lang="ja">


The bare "html" DOCTYPE indicates modern HTML (aka HTML5, although the WHATWG has given up on having version numbers from here on out). And since this is just HTML, not XHTML, you don't need the xmlns or xml:lang attributes.

Ideally you'd then run the page through the W3C Validator and fix the spam of complaints it will almost certainly give you.
Brendon
Eldest Grandchild (zhǎngsūn)
Eldest Grandchild (zhǎngsūn)
 
Posts: 1172
Joined: 21 Jan 2005, 22:18
7 Recommends(s)
23 Recognized(s)



Re: HTML DOCTYPE declarations

Postby Hartzell » 10 Jun 2012, 05:46

<!DOCTYPE html>
<html lang="ja">


This is certainly much more simplified than I had expected. Perhaps I should revise many of my old webpages to conform to the new syntax.

Is this "new syntax" commonly available on HTML teaching websites? Can you provide the appropriate URLs which have all related information??
Richard W. Hartzell
contact me by email at rwh.midway@gmail.com
Neihu District, Taipei (114)
Forumosan avatar
Hartzell
Mando-pop Singer (Guóyǔ liúxíng gēshǒu)
Mando-pop Singer (Guóyǔ liúxíng gēshǒu)
 
Posts: 2345
ORIGINAL POSTER
Joined: 31 Oct 2000, 17:01
Location: Nei Hu District, Taipei, Taiwan
19 Recognized(s)



Re: HTML DOCTYPE declarations

Postby Charlie Phillips » 10 Jun 2012, 14:41

Hartzell wrote:<!DOCTYPE html>
<html lang="ja">


This is certainly much more simplified than I had expected. Perhaps I should revise many of my old webpages to conform to the new syntax.

Is this "new syntax" commonly available on HTML teaching websites? Can you provide the appropriate URLs which have all related information??


http://www.w3.org/wiki/HTML/Training/HTML_Document
"Why do you want gas? It's hot. You can have cold showers" ~gas delivery man height of summer, 2010.

"Why you wear so many clothes? You are foreigner. Foreign countries are cold." buxiban owner, depth of winter 2011.
Forumosan avatar
Charlie Phillips
Mahjong Maniac (májiàng mí)
Mahjong Maniac (májiàng mí)
 
Posts: 2114
Joined: 21 Nov 2005, 14:53
Location: Woods by name but now a city
83 Recommends(s)
164 Recognized(s)



Re: HTML DOCTYPE declarations

Postby Brendon » 10 Jun 2012, 14:42

I don't have a recommendation for a tutorial-type site (though I'm sure they exist), but here's an overview:

http://www.w3.org/TR/html5-diff/#doctype

A number of the new elements listed there might be of interest too, as they allow richer semantic annotation for article content.
Brendon
Eldest Grandchild (zhǎngsūn)
Eldest Grandchild (zhǎngsūn)
 
Posts: 1172
Joined: 21 Jan 2005, 22:18
7 Recommends(s)
23 Recognized(s)



FRIENDLY REMINDER
   Please remember that Forumosa is not responsible for the content that appears on the other side of links that Forumosans post on our forums. As a discussion website, we encourage open and frank debate. We have learned that the most effective way to address questionable claims or accusations on Forumosa is by engaging in a sincere and constructive conversation. To make this website work, we must all feel safe in expressing our opinions, this also means backing up any claims with hard facts, including links to other websites.
   Please also remember that one should not believe everything one reads on the Internet, particularly from websites whose content cannot be easily verified or substantiated. Use your common sense and do not hesitate to ask for proof.




Proceed to Technology



Who is online

Forumosans browsing this forum: No Forumosans and 3 visitors

As you grow older, you'll find the only things you regret are the things you didn't do -- ZACHARY SCOTT