Skip to main content

By clicking Submit, you agree to the developerWorks terms of use.

The first time you sign into developerWorks, a profile is created for you. Select information in your profile (name, country/region, and company) is displayed to the public and will accompany any content you post. You may update your IBM account at any time.

All information submitted is secure.

  • Close [x]

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerworks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

By clicking Submit, you agree to the developerWorks terms of use.

All information submitted is secure.

  • Close [x]

XHTML, step by step

Move beyond tag soup to create sites that truly separate content from presentation

Uche Ogbuji (uche.ogbuji@fourthought.com), Principal Consultant, Fourthought Inc.
Photo of Uche Ogbuji
Uche Ogbuji is a consultant and co-founder of Fourthought Inc., a software vendor and consultancy specializing in XML solutions for enterprise knowledge management. Fourthought develops 4Suite, an open source platform for XML, RDF, and knowledge-management applications. Mr. Ogbuji is also a lead developer of the Versa RDF query language. He is a computer engineer and writer born in Nigeria, living and working in Boulder, Colorado, USA. You can find more about Mr. Ogbuji at his Weblog Copia, or contact him at uche.ogbuji@fourthought.com.

Summary:  Get started working with Extensible Hypertext Markup Language. XHTML is a language based on HTML, but expressed in well-formed XML. However, XHTML has more to offer than just regularizing tags and characters -- XHTML can alter the way you approach Web design. This tutorial gives step-by-step instruction for developers familiar with HTML who want to learn how to use XHTML in practical Web sites.

Date:  06 Sep 2005
Level:  Introductory PDF:  A4 and Letter (166 KB | 26 pages)Get Adobe® Reader®

Activity:  12089 views
Comments:  

Tutorial introduction

Introducing XHTML

This tutorial offers step-by-step instruction for developers familiar with HTML who want to learn how to use XHTML in practical Web sites. XHTML is more than just an XML-compliant variation. It also opens up the first step in advancing from tag soup Web sites to sites that properly separate content from presentation, and thus save time and money in maintenance. The focus of this tutorial will be XHTML 1.1, with the occasional mention of XHTML 2.0. The lessons are built around examples that readers can view and experiment with in their favorite browser.


Who should take this tutorial?

XHTML is important in all areas of Web design and management. It is broadly applicable, and yet relatively easy to pick up for those already familiar with HTML and XML. Web designers should take this tutorial to learn how to develop well-formed pages. Programmers should take this tutorial if they deal with any Web applications. Developers who are learning XML should take this tutorial to learn about one of the most important examples of XML.


Prerequisites

This tutorial assumes knowledge of XML, XML namespaces, and HTML. If you aren't familiar with XML, take the developerWorks tutorial "Introduction to XML." If you aren't familiar with HTML, a good place to start is "Dave Raggett's introduction to HTML." If you need to learn about XML namespaces, read the article "Plan to use XML namespaces, Part 1."

I highly recommend that you try out the examples. They only require a Web browser that supports XHTML 1.1 -- and most current Web browsers do support this standard. When giving browser output examples, I show screenshots of Firefox 1.0.4 on Fedora Core Linux. Firefox is a popular Web browser available on Windows, Mac OS X, Linux, and other platforms. It is based on Mozilla's rendering engine.


About the examples in this tutorial

In this tutorial you will see many examples of XHTML files. You can find all the files shown here in the zip file, x-xhtml-tutorial-files.zip. In this package, all files start with a prefix indicating the section that discusses them and the order of examples within the section. For example, the names of files from the first example in the third section start with "eg_3_1".

Files that end with .xhtml are XHTML. A few of the files have more specialized extensions such as .xsl for XSLT transform files.

I do take care to further list the example files in each panel and show how each relates to the other, so if you follow along with the tutorial you should be able to locate and experiment with the examples easily enough.

1 of 9 | Next

Comments



static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=XML, Web development
ArticleID=138468
TutorialTitle=XHTML, step by step
publish-date=09062005
author1-email=uche.ogbuji@fourthought.com
author1-email-cc=dwxed@us.ibm.com