Latest Job News

XHTML:

 

XHTML stands for EXtensible HyperText Markup Language. XHTML is almost identical to HTML 4.01. XHTML is a stricter and cleaner version of HTML 4.01. XHTML is HTML defined as an XML application. XHTML is supported by all major browsers.

 

All the major browsers such as internet explorer have been designed to display pages which contain invalid html. When a manufactured creates a new type of devices such as the web enabled phone they can choose to make it compatible with existing standards or the developers should create new standards.
A protocol called Wireless Application Protocol (WAP) has been created to control the content deliver to mobile browsers. The devices with limited processing capabilities must be able to understand a document and ignore those parts which they cannot handle.

The XHTML document:

 

 

XHTML document tags:

The actual tags that are used in XHTML documents have not changed from HTML4 but the changes are done in the tags usage. For this purpose the control information must place into your web pages.

 

You May Also Like:

Features of HTML
Structure of HTML Document
HTML Formatting Tags
Different Types of Lists in HTML

 

 

Using for XML declaration:

Not all XML documents start with an XML declaration. The declaration tells application that they are handling XML and which particular version of the standard has been used in the markup. Then the application is able to make decision about how it handles the markup. For example, it may choose to bi-pass tags which it does not understand or it may choose to flag them as errors. Start your XHTML documents with following statement.


<? XML version=”1.0” encoding=”UTF-8”>
 

This statement makes it clear to the application that it is handling XML and tells it how the characters with in the documents are encoded.

 

THE NEW DOCUMENT TYPE DEFINITION:

The XML document must have document type definitions (DTD). These are used by validating parsers to check that the markup has been used correctly. The general syntax for XHTML DTD is as follows:
 

<! Doctype html Public”-//w3c//dtd//xhtml 1.0 transitional//En”
“dtd/xhtml1-transitional-dtd”>

There are three different DTD’s which are as follows:

 

• transitional: it should be used in pages which include some presentational markup such as font tag. These documents will be accessible to browser which doesn’t understand style sheets.

 

• Strict: it is used when you want your document is fully complaint with the standard. All presentational control is done through the use of CSS.

 

• Frameset: it lets you partition the screen into no of separate frames.

 

Expanded HTML tags: The top level node of an XHTML document tag was an HTML node. In previous versions of HTML this tag was used to carry control information about formatting and events such as on–load . But now it holds information about the page itself
 


<html xmlns=http://www.w3c.org//1999//xhtml
Xml:lang=”en” lang=”en”>

 

The <html>declares the name space for the document through xmlns attributes. The valid name space for XHTML 1.0 is as shown in the above. The language of the document is also declared in side the HTML tag. The “xml:lang” attribute takes precedence over other language declaration.

 

Standards of XHTML tags:

Although the tags remain same as in HTML4. But the ways in which they maybe used has been changed.

 

1. Nested tags must be closed in the reverse order In which they were declared. There is no longer availability of over lapping tags. For ex: consider the following syntax:

<td><td>some <b>data</td></b></d>
In the above code the order of closing tags are not correct.
The correct  code is as follows:
<td><td>some<b>data</b></td></td>

 

2. XML is case sensitive.

 

3. All XHTML tags and attributes which have or may have content must have end tags.

 

4. Empty Elements i.e; the tags which do not contain content must either have end tags(or) be terminated properly. A space should be placed before the terminating slash(/).  

For ex:<hr>------</hr>(or) </hr>

 

5. All  attribute values must be placed inside (codes)(or)(“”) this applies equally to numerical and textual arguments.

For ex: <p align=”center”>--------</p>

 

6. Scripts and styles must be wrapped so that they are not parsed as markup. Even inside the script less than (<) and ampersand (&) characters will be treated as a part of XHTML markup.

 

7. Some HTML elements have a name attribute with which they could be uniquely identified by scripts. This has been particularly important for forms and its elements, but in XHTML 1.0 the name attribute is replaced by ID.

Example of XHTML document:

 

<? XML.version=”1.0” encoding=”UTF-8”>
<! DOC TYPE HTML public”_//w3c//DTD XHTML1.0 transitional//en”
“DTD/XHTML/-Transtional.dtd”>
<html xmlns = http://www.w3c.org/1999/xhtml Xml:lang=”en” lang=”en”>
<html>
<head>
<title>sample xhtml</title>
</head>
<body>
<h1>sample xhtml document</h1>
<hr/>
<p>this is sample paragraph</p>
<ul>
<li>item1</li>
<li>item 2</li>
<li>item3</li>
</ul>
<hr/>
</body>
</html>

You May Also Like:

Tables in HTML
HTML Css(Cascading Style Sheets)
Forms in HTML
Different CSS Properties

 Back To HTML Questions