There are some change and update in XHTML 2 with the comparison with XHTML 1

The major changes with XHTML 1 are given below.

Section and header :

The section element, in conjunction with the h element, offers a mechanism for structuring documents into sections. This element defines content to be block-level but imposes no other presentational idioms on the content, which may otherwise be controlled from a style sheet. In xhtml 1, the section and heading content are control by (h1-h7) element , in XHTML2 section and heading are control by section and h element. You need to secify header element level, . Ex: you need to set level by h1,h3,h5 and so on. To control the semantic on header element XHTML 2 could control. Still, user roughly specify header element on their web document in XHTML 1.

Example

<body>
<h>Events</h>
<section>
<h>Introduction</h>
<p>....</p>
<h>Specifying  events</h>
<p>...</p>
<section>
<h>Attaching  events to the handler</h>
<p>...</p>
</section>
<section>
<h>Attaching  events to the listener</h>
<p>...</p>
</section>
<section>
<h>Specifying  the binding elsewhere</h>
<p>...</p>
</section>
</section>
</body>

Separators:

In XHTML1, we use <hr> element for separation for document section . Now, XHTML2 has defined separator element for more accessible and semantic.

Example

<p>  Proin vel nisl egestas magna placerat </p>
<separator  />
<p>  Suspendisse volutpat nulla eget elit </p>

Line breaks:

in previous versions of XHTML, the br element was used to to line break, now we can use l element for line break . Amongst other advantages, this gives more presentational opportunities, such as the ability to automatically number lines, or to color alternate lines differently.

Example :

 <blockcode>
  <l>School</l>
  <l>University</l>
  <l>College</l>
  <l>Institute</l>
  </blockcode>

Paragraph structure: Now p element contain list, table and block in XHTML2.

Example :

<p>Department  Name:
   <ul>
      <li>Purchase</li>
      <li>Sales</li>
      <li>Marketing</li>
    </ul>
 </p>

Navigation lists:

Here in XHTML2 have different element nl for denote navigation. Now navigation are more accessible.Here label define label for the list

Example :

<nl>
	<label>Main  Menu </label>
	<li href="#">Home</li>
	<li href="#">contact</li>
</nl>

Images:

img element has been omitted in XHTML2 and object element is used to show the image. Object is used not only for image . It related with all non text content. Ex: including files, java file, flash file etc.

Example :

<object src="http://www.example.com/foo.jpg" srctype="image/jpeg">
	<em>alternate text</em>
	</object>

Type(srctype):

in HTML 4, the srctype attribute when referring to an external resource was purely a hint to the user agent. In XHTML 2 it is no longer a hint, but specifies the type(s) of resource the user agent must accept.Attributes of this srctype type identify the allowable content type(s) of an associated URI(specifies the location of an external source for the contents of the element )

Example

	<p src="w3c-logo.png" srctype="image/png">
    W3C logo
 </p>

Tables :

the content model of tables has been cleaned up and simplified, while still allowing the same functionality.

Bi-directional text (dir) :

dir element is specified for direction of the element’s text content

The values of dir elements are

ltr : Left-to-right text

rtl: Right-to-left text

lro: Left-to-right override (Default Value)

rlo”: Right-to-left override

Example

 <p  dir="rlo">
  This film was released on Feb 13th  09 .
   </p>

Edit:

Rather than use explicit ins and del elements to mark changes in a document, an attribute edit may be used on any element for the same purpose.

This element’s values are inserted ,deleted , changed,moved

Example

<p>We  have to do this task in	next
<span edit="deleted">day</span>
<span edit="inserted">year</span>
</p>

Linking:

In XHTML 2 any element can have hyperlink attribute .Now we do not need a element any more. So, you can write <li href=”home.html”>Home</li> directly.

Example

 <li href="home">home</li>

Metadata:

Now meta and link element have magical tools to communicate with user agent Link conveys relationship information that may be rendered by user agents in a variety of ways and meta could give forther more information for search engine about document.

The current document is “Chapter2.html”. The rel attribute specifies the relationship of the linked document with the current document. The values “Index”, “Next”, and “Prev” are explained in the section on the attribute rel.

 <head>
 <title>Chapter 2</title>
 <link rel="index" href="../index.html"/>
 <link rel="next"  href="Chapter3.html"/>
 <link rel="prev"  href="Chapter1.html"/>
 </head>

In the following example, we tell search engines where to find the printed version of a manual.

   <head>
	   <title>Reference manual</title>
	   <link media="print" title="The manual in PostScript"
	   hreftype="application/postscript" rel="alternate"
	   href="http://example.com/manual/postscript.ps"/>
  </head>

The following example shows how to use the hreflang attribute to indicate to a search engine where to find other language versions of a document. Note that for the sake of the example the xml:lang attribute has been used to indicate that the value of the title attribute for the link element designating the French manual is in French.

	  <link title="The manual in Dutch" rel="alternate"
	  hreflang="nl"  href="http://example.com/manual/dutch.html"/>
	  <link title="La documentation en Français" rel="alternate"
	  hreflang="fr" xml:lang="fr" href="http://example.com/manual/french.html"/>

In the following example, we tell search engines where to find the printed version of a manual.

		<head>
		  <title>Reference manual</title>
		  <link media="print" title="The manual in PostScript"
		  hreftype="application/postscript"  rel="alternate"
       href="http://www.example.com/manual/postscript.ps"/>
     </head>

In the following example, we tell search engines where to find the front page of a collection of documents.

   <head> <title>Introduction of Java</title>
   <link rel="start" title="The first chapter of Java"
   hreftype="application/xhtml+xml"
   href="http://website.com/lesson/introduction-java.html"/>
   </head>

Now meta elements provide language-dependent information about a document

In the following example specify keywords in language wise. So, that search engine could classify keywords according to language.

<!-- For speakers of US English -->
<meta property="keywords" xml:lang="en-us">
  vacation, Greece, sunshine</meta>
<!-- For speakers of British English -->
<meta property="keywords" 
xml:lang="en">holiday, Greece, sunshine</meta>
<!-- For speakers of French -->
<meta property="keywords" 
 xml:lang="fr">vacances, Grèce, soleil</meta>

Role:

In order to aid adding semantics to documents, the role attribute has been added, along with an initial set of useful values, in order to classify the use of a particular element. For instance a paragraph may play the role of a note, and so may be marked up <p role=”note”>. Furthermore information (http://www.w3.org/TR/2003/REC-xml-events-20031014/)event handling in HTML was restricted in several ways: since the event names were hard-wired in the language (such as onclick), the only way to add new events was to change the language; many of the events (such as click) were device-specific, rather than referring to the intent of the event (such as activating a link); you could only handle an event in one scripting language — it was not possible to supply event handlers in the same document for several different scripting languages.

XHTML 2 uses XML Events

[XMLEVENTS] [XML EVENTS]to specify event handling, giving greater freedom in the ability to handle events. Along with this, the script element has been renamed handler to indicate its different semantics.

Furthermore information (http://www.w3.org/TR/2003/REC-xml-events-20031014/)

Forms:

HTML Forms were introduced in 1993, before the advent of the e-commerce revolution. Now with more than a decade of experience with their use, they have been thoroughly overhauled and updated to meet the needs of modern forms, in the shape of XForms [XFORMS], which are an integral part of XHTML 2.

Ownership where due:

Since HTML 4 was a standalone application, it defined many things which no longer need to be defined now that it is an XML application. For instance the definitions of whitespace are given by XML for input, and CSS for output; similarly, the definition of values of the media attribute are relegated to the relevant style sheet language.

Frames and Framesets:

In HTML 4 multi-panel “pages” could be described using the frameset and frame elements. The Frames model is no longer defined in XHTML. Instead, if is defined through the separate [XFRAMES] specification.

Advertisements