decline
Question - 23 : - How W3Schools Was Converted To XHTML ?
Answer - 23 : - W3Schools was converted from HTML to XHTML.
To convert a Web site from HTML to XHTML, you should be familiar with the XHTML syntax rules.
Your pages must have a DOCTYPE declaration if you want them to validate as correct XHTML.
The following DOCTYPE declaration was added as the first line of every page:
Be aware however, that newer browsers might treat your document differently depending on the declaration. If the browser reads a document with a DOCTYPE, it might treat the document as "correct". Malformed XHTML might fall over and display differently than without a DOCTYPE.
Lower Case Tag And Attribute Names
Since XHTML is case sensitive, and since XHTML only accepts lower case HTML tags and attribute names, a general search and replace function was executed to replace all upper case tags with lowercase tags. The same was done for attribute names. We have always tried to use lower case names in our Web, so the replace function did not produce many real substitutions.
All Attributes Were Quoted
Since the W3C XHTML 1.0 Recommendation states that all attribute values must be quoted, every page in the web was checked to see that attributes values were properly quoted. This was a time-consuming job, and we will surely never again forget to put quotes around our attribute values.
Empty Tags:
,
and
Empty tags are not allowed in XHTML. The
and
tags should be replaced with
and
.
This produced a problem with Netscape that misinterpreted the
tag. We don't know why, but changing it to
worked fine. After that discovery, a general search and replace function was executed to swap the tags.
A few other tags (like the tag) were suffering from the same problem as above. We decided not to close the tags with , but with /> at the end of the tag. This was done manually.
The Web Site Was Validated
After that, all pages were validated against the official W3C DTD with this link: XHTML Validator. A few more errors were found and edited manually. The most common error was missing &l
Question - 24 : - What XHTML does it stand for? How is if different from HTML? Who developed it? ?
Answer - 24 : - XHTML stands for "Extensible HyperText Markup Language". It was developed by the World Wide Web Consortium (W3C) and is now a W3C Recommendation.
XHTML is a reformulation of HTML 4 in XML 1.0. This means that the benefits provided by XML will be available to XHTML.
Question - 25 : - How does HTML differ from XHTML ?
Answer - 25 : - XHTML has a small number of differences. The most noticeable being the requirement for elements to be lowercase (e.g.
and not
) and elements to be closed (e.g. paragraphs must end with a
).
Question - 26 : - Why to type a tags in uppercase, and never bother closing the paragraphs ?
Answer - 26 : - For reasons on internationalisation XML elements are case sensitive. A choice had to be made, and lowercase won on the day.
Tags may not overlap
This is emphasized text and bold text
becomes
This is emphasized text is bold text
Only certain tags may nest inside other tags
Looking at the dtd for xhtml, the definition of the "ol" element is:
This implies that an order list, "ol", element may not contain paragraph tags or body text, just list items.
These are some of my favorite animals:
- octopus
- shrew
- lemur
and my most favorite
- meerkats
becomes
These are some of my favorite animals:
- octopus
- shrew
- lemur
- meerkats
Question - 27 : - Why to use XHTML?
Answer - 27 : -
XHTML is more formal and stricter version of HTML. i.e.
- It has properly nested elements.
- All XHTML elements must always be closed.
- All XHTML elements must be written in lower case.
- Every XHTML document must have one root element.
That is the reason behind its preferences over HTML because; most of the web pages contain bad HTML.
Question - 28 : - What is the difference between XHTML and HTML?
Answer - 28 : -
There are some changes in XHTML as compared to HTML:
- All documents must have a DOCTYPE.
- The xmlns attribute in is mandatory and must specify the xml namespace for the document.
- , , , and are mandatory with their respective closing tags.
- All XHTML tags must be in lower case.
- All XHTML tags must be closed.
- All XHTML tags must be properly nested.
- The XHTML documents must have one root element.
- All XHTML attributes must be added properly.
- All XHTML attributes must be in lower case.
- The name attribute has changed.
- XHTML attributes cannot be shortened.
- XHTML attribute values must be quoted.
Question - 29 : - How is XHTML better than HTML?
Answer - 29 : -
Following are the reasons specifying why XHTML is better than HTML:
- XHTML uses style sheets instead of font, color and alignment tags of HTML.
- XHTML allows to style sheets and scripts embedding in CDATA section.
- XML of XHTML makes easy the integration of new elements as subsets of SGML.
Question - 30 : - What is XHTML validation?
Answer - 30 : -
XHTML validation is a process used to validate XHTML documents with W3C's validator.