[advanced search]
Results from the most recent live auction are here.
15 members in the live chat room. Join Chat!
Register Rules & FAQ NP$ Store Active Threads Mark Forums Read
Domain Name Industry Newsletter
Go Back   NamePros.Com > Design and Development > Webmaster Tutorials
User Name
Password

Old 03-02-2006, 12:16 PM   · #1
shahid_146
NamePros Member
 
Trader Rating: (0)
Join Date: Sep 2005
Posts: 30
NP$: 57.00 (Donate)
shahid_146 is an unknown quantity at this point
From HTML to XHTML

HTML has been the most successful publishing language for web pages since the beginning of the World Wide Web (WWW). HTML 4.01 is the last W3C recommended version after 2.0 and 3.2. It supports the tags in the earlier versions and has got additional support for more multimedia, scripting languages, style sheets, better printing facilities and accessibility. Apart from all the goods with HTML, it has been treated as a 'let go' language by both developers and browsers. The 'loose' nature of HTML markup has resulted in ill-formed documents, still displayed properly in some browsers.

A need for a well-formed, flexible and more suitable language for large-scale electronic publishing gave birth to XML (Extendible Markup Language). XML is a simpler but much more flexible markup language, which provides you with the ability to exchange data in a variety of formats on the web.

With the development of better browsers and introduction of mobile phones and hand-held devices who do not have the resources or power to display a 'badly written markup' properly, a need arose for a language which combines the strengths of both HTML and XML.

XHTML was introduced as a result. XHTML is a stricter and cleaner version of HTML. XHTML is supposed to gradually replace HTML according to W3C. XHTML consists of all the elements used in HTML 4.01 combined with the syntax of XML.

To stay up to date with the latest web standards, enjoy the luxury of having your documents equally well-interpreted by electronic devices and produce nicely formed markup, it is time to upgrade your code to XHTML, the markup language of today and the future.

Migrating from HTML to XHTML is much easier than one might think. Because of the fact that it is actually based on HTML 4.01, XHTML is almost similar to HTML with a few enhancements.

The purpose of this article is to highlight the changes that you need to make to your markup while migrating from HTML to XHTML. Below is the list of changes that need to be made to an existing HTML document in order to make it XHTML compliant:

All tags must be written in lower case. (XML and so XHTML is case sensitive). For example <P> is wrong and it should be written as <p>.
All attribute names must also be in lower case. For example <img SRC=”name.jpg”> is wrongs and the attribute SRC should be written in lower case.
All Attribute values must be quoted. As a result <table width=100%> is wrong and it should be written as <table width=”100%”>
No more attribute minimization. For example in HTML you could write <option value=”1” selected> which is wrong in XHTML now and the right syntax is <option value=”1” selected=”selected”>. The same rule applies to:
<input checked="checked" />
<input readonly="readonly" />
<input disabled="disabled" />
<option selected="selected" />
<frame noresize="noresize" />
All XHTML elements must be closed. Elements must either have an end tag or otherwise their start tag should end with />. For example every <p> must be ended with a </p> and every <li> with an </li>, while empty tags (tags with no ending tag) should be ended with />, e.g. <br />, <input type=”submit” />, <img src=”name.jpg” /> and <hr /> **put a space before / to make your code compatible with the new browsers.
All tags must be properly nested. Tags starting first should end last and vice versa. So <b><i>some text for demonstration</b></i> would be WRONG. List inside a list should be enclosed in between one of the <li> …</li> of the parent <ul> or <ol>
The id attribute replaces the name attribute. For example <form name=”search”> is replaced by <form id=”search”>
All XHTML documents must have a DOCTYPE declaration. The html, head and body elements must be present, and the title must be present inside the head element.
A typical xhtml document should look like this:

<!DOCTYPE Doctype goes here>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Title goes here</title>
</head>
<body>
Body text goes here
</body>
</html>


Article originally posted at binarytrends


Please register or log-in into NamePros to hide ads
__________________
Shahid
Binarytrends
shahid_146 is offline   Reply With Quote
Old 03-03-2006, 12:37 PM   · #2
Zinc
1066
 
Zinc's Avatar
 
Name: Ian Lewis
Location: UK
Trader Rating: (8)
Join Date: Dec 2005
Posts: 418
NP$: 50.00 (Donate)
Zinc is a jewel in the roughZinc is a jewel in the roughZinc is a jewel in the rough
Tsunami Relief
Nice post, I'm just in the process of having 60+ pages hand coded to W3C
standards. It will be very interesting to see exactly how the search engines
spider and eventually rank my new site Vs the old one, especially in MSN.
Zinc is offline   Reply With Quote
Old 03-03-2006, 03:37 PM   · #3
JYM
Senior Member
 
JYM's Avatar
 
Name: Jimmy Lin
Location: San Diego, California
Trader Rating: (6)
Join Date: Sep 2005
Posts: 1,079
NP$: 6.01 (Donate)
JYM is a glorious beacon of lightJYM is a glorious beacon of lightJYM is a glorious beacon of lightJYM is a glorious beacon of lightJYM is a glorious beacon of light
That's a great post that sums up all of the main points from HTML to XHTML. I wish I had read this post sooner... would have saved me some trouble

Rep added.
__________________
Ipzy.com - Free Proxy to visit Myspace/Facebook, Tech News, and more!
Onlineness.com - Free Proxy
FOR SALE: support.im | tradepile.com
JYM is offline   Reply With Quote
Closed Thread

NamePros is a revenue sharing forum.

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
I'll code for you! (PHP, XHTML, CSS, HTML) meinhold Programming 1 05-24-2005 10:13 AM
HTML, not XHTML, aren't they different? fshlarge Programming 9 05-07-2005 07:53 AM
[For Hire] - CGI, PHP, ASP, JSP, SQL, JAVA CLASSES , HTML, CSS, XML, XHTML Programmer KougarZ28 For Sale / Advertising Board 0 11-08-2004 06:08 PM
[For Hire] Xhtml / html / CSS coder and graphics designer kujoe Web Development Wanted 1 07-18-2004 11:49 PM

Site Sponsors
Hunting Moon Find out how! Proof is in the Parking
Advertise your business at NamePros
All times are GMT -7. The time now is 09:48 PM.


Powered by: vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0