Interview :: XHTML
What is XHTML?
XHTML stands for Extensible Hypertext Markup Language. It is a combination of XML and HTML. It is a more formal and stricter version of HTML.
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.
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.
XHTML validation is a process used to validate XHTML documents with W3C's validator.
XHTML is not very different from HTML 4.01, so you can easily adopt it. You should start to write your HTML code in lowercase letters.
In XHTML elements cannot be overlapped.
Let's take an example to show you in XHTML every attribute must have a value.
Example in HTML:
Same example in XHTML:
The decomposition of XHTML into a group of modules that are abstract to provide modularity is known as XHTML Modularization.
The XHTML modules are utilized in the XML document type definition language.
XHTML modularization specifies a well defined set of XHTML elements which can be compiled and extended. It supports a specific devise by using standard building blocks and standard methods for building blocks usage.