BizTalk Utilities CV ,   Jobs ,   Code library  
 
 
Page 2 of 2

 

 Previous Page

XHTML and HTML

Now that we have an understanding of the background of XHTML let's talk about some of the differences between XHTML and HTML.

  1. XHTML tags and attributes must be in lower case.
  2. All tags must be closed.
  3. <head> and <body> tags can't be left out.
  4. All attribute values must have quotation marks.
  5. A DTD declaration must be included at the top of the document.
    1. <!DOCTYPE PUBLIC "-//W3C/DTD XHTML 1.0 STRICT//EN" "">
  6. A reference to the XML namespace needs to be in the <html> element.
    1. <html xmlns=http://www.w3.org/tr/xhtml1>
  7. Tags must be properly nested.
  8. The <title> element must be the first element in the head.
  9. Attributes cannot be shortened or "minimized".

What Does XHTML Do?

So what does XHTML do for us? By combining the HTML and XML we have the tags and elements of HTML and the language of XML. We now have web pages that can be read by all XML enabled devices.

If by now you're not totally convinced that XHTML is the way to go, picture the following. Suppose I opened up my previous example in Netscape or even an earlier version of Internet Explorer (yes, there are people like that still out there…). I’d bet money on the fact that it wouldn’t look the same. It will take at least a couple of years for more than half the world to upgrade to XML supported browsers. We can't wait that long, and now we don’t have to. XHTML lets me write well-formed documents now that are cross-browser and "backward" browser compatible. Think about that!

If I were to re-write my example above in XHTML it would like this:

<?xml version="1.0" encoding="UTF-9"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xml:lang="en" lang="eng">
<head>
  <title>Good XHTML</title>
</head>
<body>
  <h1>Good XHTML example</h1>
</body>
</html>

I'm not going to show you the results in IE. Your homework assignment for this article is to take this example and view it in IE and Netscape. Are you convinced yet?

This should provide you with a nice overview of XHTML. In my next article, we'll cover some practical examples of XHTML, what we can do with it and we will be putting it to work.

Page 2 of 2

 

Previous Page 
 

Recent Jobs

Integration Specialist Needed - Wor
Virtualization Server Infrastructur
A great opportunity to Digital Vide
here is a greate opportunity as a S
A great opportunity as a Network En

View all Jobs (Add yours)
View all CV (Add yours)




swimming pool builder
chicago web site design
affordable conference calls
Domain Names
conference call services
Emporio armani sunglasses
answering service


    Email TopXML  

Front Page Daily Stuff TopXML Forum XML blogs XML Newsgroups BizTalk Biztalk Utilities Biztalk Utilities Tutorial B2B SAP XML Microsoft .NET Dotnet System XML Soapformatter SQLXML XMLserializer XQuery PHP PHP SimpleXML PHP XML Dom PHP XML RPC PHP XSLT Java Java Java XML Xalan Microsoft ASP ASP Schemas XML SQL Server XML XMLDom XSL XSL Tutorial XSLT Stylesheets General Javascript CSS XHTML WAP