spacer

Webref WebRef   Sitemap · Experts · Tools · Services · Newsletters · About i.com

home / experts / xml / column6

XHTML 1.0: Where XML and HTML meet

Information Technology Auditor (PA)
Next Step Systems
US-PA-Wayne

Justtechjobs.com Post A Job | Post A Resume
Developer News
Google Chrome Playing Catch-Up on Extensions
Open Solutions Alliance Gets New Leadership
Red Hat Spacewalk Expands Linux Management

Which old HTML sins to overcome?

The Ten Commandments of XHTML are:

  1. Fix up all documents that are not well-formed
    Well-formedness is a new concept introduced by XML. Essentially this means that all elements must be properly nested. Although overlapping is illegal in SGML, it was widely tolerated in existing browsers.
    NOT: <p>this is <em>emphasized</p></em>
    BUT: <p>this is <em>emphasized</em></p>
    
  2. Change all tags and attribute names to lower case
    XHTML documents must use lower case for all HTML element and attribute names. XML is case-sensitive, so for instance <li> and <LI> are different tags.
  3. 
    
  4. Add end tags for non-empty elements
    In SGML-based HTML 4 certain elements were permitted to omit the end tag; with the elements that followed implying closure. This omission is not permitted in XML-based XHTML. All elements other than those declared in the DTD as EMPTY must have an end tag.
    NOT: <p>one<p>two
    BUT: <p>one</p><p>two</p>
    
  5. Quote all attribute values
    All attribute values must be quoted, even those which appear to be numeric.
    NOT: <table rows=3>
    BUT: <table rows="3">
    
  6. Unminimize attributes
    XML does not support attribute minimization, attribute-value pairs must be written in full. Attribute names such as compact and checked cannot occur in elements without their value being specified.
    NOT: <dl compact>
    BUT: <dl compact="compact">
    
  7. Correctly tag empty elements
    Empty elements must either have an end tag or the start tag must end with />. For instance, <br/> or <hr></hr>. See below for information on ways to ensure this is backward compatible with HTML 4 user agents.
    NOT: <br><hr>
    BUT: <br/><hr/>
    

next page

http://www.internet.com

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info

Legal Notices, Licensing, Reprints, Permissions, Privacy Policy.
Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

Whitepapers and eBooks

Symantec Whitepaper: Converging System and Data Protection for Complete Disaster Recovery
Intel Whitepaper: Comparing Two- and Four-Socket Platforms for Server Virtualization
IBM Solutions Brief: Go Green With IBM System xTM And Intel
HP eBook: Simplifying SQL Server Management
IBM Contest: Are You the Next Superstar? Join the "Search for the XML Superstar" Contest to Find Out
Intel PDF: Quad-Core Impacts More Than the Data Center
Intel PDF: Virtualization Delivers Data Center Efficiency
Go Parallel Article: PDC 2008 in Review
Avaya Article: Communication-Enabled Mashups: Empowering Both Business Owners and IT
Intel Whitepaper: Building a Real-World Model to Assess Virtualization Platforms
PDF: Intel Centrino Duo Processor Technology with Intel Core2 Duo Processor
Microsoft Article: Build and Run Virtual Machines with Hyper-V Server 2008
  Go Parallel Article: Q&A with a TBB Junkie
IBM Whitepaper: Innovative Collaboration to Advance Your Business
Internet.com eBook: Real Life Rails
IBM eBook: The Pros and Cons of Outsourcing
Internet.com eBook: Best Practices for Developing a Web Site
IBM CXO Whitepaper: The 2008 Global CEO Study "The Enterprise of the Future"
Avaya Article: Call Control XML in Action - A CCXML Auto Attendant
IBM CXO Whitepaper: Unlocking the DNA of the Adaptable Workforce--The Global Human Capital Study 2008
Adobe Acrobat Connect Pro: Web Conferencing and eLearning Whitepapers
Symantec Whitepaper: Comprehensive Backup and Recovery of VMware Virtual Infrastructure
MORE WHITEPAPERS, EBOOKS, AND ARTICLES
webref The latest from WebReference.com Browse >
Popular JavaScript Framework Libraries: An Overview - Part 3 · Accessing Your MySQL Database from the Web with PHP · Working with the DOM Stylesheets Collection
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Review: Lenovo ThinkPad SL300 · OCZ PC3-10666 Gold 2x1GB Review · Apple Recommends Antivirus for Macs

Produced by Michael Claßen
All Rights Reserved. Legal Notices.

URL: http://www.webreference.com/xml/column6/2.html
Created: Feb. 07, 2000
Revised: Feb. 07, 2000