What Is XHTML and Differences Between XHTML, HTML, and XML?
On January 26, 2000, HTML 4 has been reformulated into XHTML 1.0 by the World Wide Web Consortium. XHTML stands for Extensible Hyper Text Markup Language.The development of HTML has basically stopped because it was replaced by a new language, called XHTML. This language is in many ways similar to HTML, but it is designed to work with the new extensible Markup Language, or XML, that will soon serve as the core language for designing all sorts of new Web applications, in which XHTML will be only one of many "languages." But, XHTML is designed to work with these other language, so that different documents, in different languages, can be simply mixed together.
XHTML (extensible Hypertext Markup Language) is a family of XML markup languages that represent versions of the widely-used Hypertext Markup Language (HTML), the language in which web pages are written.
XHTML has a more strict syntax rules in comparison of HTML. XHTML gives you a more consistent, well structured format so that your web pages can be easily parsed and processed by present and future web browsers. It also makes your website easier to maintain, edit, convert and format in the long run.
Since XHTML is an official standard of the World Wide Web Consortium (W3C), your website will more likely will be more compatible to more browsers and will be rendered more accurately. XHTML combines strength of HTML and XML and XHTML pages can be rendered by all XML enabled devices.
XHTML defines a quality standard for your Webpages, if you follows that then your web pages will be counted quality web pages and W3C certifies those pages with their quality stamp.
There are two main parts to XHTML:
• HTML 4
HTML 4 is a markup language used for displaying text and documents across different platforms and machines. It was initially anticipated for a very specific audience, and has expanded to include hypertext, multimedia, as well as the style of the documents displayed.
• XML
XML is an extensible markup language that was developed to retain the flexibility and power of HTML while reducing most of the complexity. XML is a markup language much like HTML and was designed to describe data. XML tags are not predefined. You must define your own tags according to your needs
Extensible Markup Language (also known as XML) is a set of rules. These rules are specific for documents encoding electronically. The main objective of it is to emphasize simplicity, generality and usability over the internet. It is noted as a textual data format that has support from Unicode to be easily read across all languages. Unicode is encoded into bytes in order to be stored or transmitted - these translated Unicode expressions are known as encoding. It provides a mechanism that allows an XML processor to determine which encoding is in use. Though the main objective of the XML design is to focus on documents specifically, it is often also used in order to represent arbitrary data structures (web services, for instance). There are also a variety of schema systems that are designed specifically for helping to define XML based languages.
This is simply a means to aid XHTML in extending its scope into other eminent platforms (mobile devices and web enabled television, for instance).
Firstly, there are some rules for writing code(syntax differences) in HTML and XHTML are as follows:
1.In XHTML all tag and attribute names must be in lowercase while HTML is not case sensitive.
2."Empty" tags must be written with an extra slash at the end. An empty tag is one like
.In XHTML,
3.In HTML, you could sometimes leave off an end tag while in XHTML, you must always put in the end tag.
4.In XHTML attributes must always have a value while in HTML you can sometimes omit attribute values.
5.In XHTML attributes values must always be quoted while in HTML you can sometimes omit the quotes.
Secondly, in contrast to these syntactical differences which are minor, there are some behavioral differences. For example:
• Most prominently, behavior on parse errors differs. A fatal parse error in XML (such as an incorrect tag structure) causes document processing to be aborted (a "yellow screen of death").
• Most content requiring namespaces will not work in HTML, except the built-in support for SVG and MathML in the HTML5 parser along with certain magic prefixes such as xlink.
• JavaScript processing is a little different, with minor changes in case sensitivity to some functions, and further precautions in XHTML to restrict processing well-formed to well-formed content. Third-party scripts, such as sidebars proving live feeds or Google's "web clips", often rely on the [removed]() method, which is not available in XHTML pages so the scripts fail on pages served as XHTML (that is, using an XML MIME type). The inner-HTML property is available on XML pages, but uses the same XML parser as the whole page, so will not insert content if a non-well-formed string is passed. More positively, inner-HTML in XHTML can be used to insert namespace content to the page.
• CSS is also applied slightly differently, with case-sensitivity and some differences in handling of backgrounds on and in XHTML.
XHTML (extensible Hypertext Markup Language) is a family of XML markup languages that represent versions of the widely-used Hypertext Markup Language (HTML), the language in which web pages are written.
XHTML has a more strict syntax rules in comparison of HTML. XHTML gives you a more consistent, well structured format so that your web pages can be easily parsed and processed by present and future web browsers. It also makes your website easier to maintain, edit, convert and format in the long run.
Since XHTML is an official standard of the World Wide Web Consortium (W3C), your website will more likely will be more compatible to more browsers and will be rendered more accurately. XHTML combines strength of HTML and XML and XHTML pages can be rendered by all XML enabled devices.
XHTML defines a quality standard for your Webpages, if you follows that then your web pages will be counted quality web pages and W3C certifies those pages with their quality stamp.
There are two main parts to XHTML:
• HTML 4
HTML 4 is a markup language used for displaying text and documents across different platforms and machines. It was initially anticipated for a very specific audience, and has expanded to include hypertext, multimedia, as well as the style of the documents displayed.
• XML
XML is an extensible markup language that was developed to retain the flexibility and power of HTML while reducing most of the complexity. XML is a markup language much like HTML and was designed to describe data. XML tags are not predefined. You must define your own tags according to your needs
Extensible Markup Language (also known as XML) is a set of rules. These rules are specific for documents encoding electronically. The main objective of it is to emphasize simplicity, generality and usability over the internet. It is noted as a textual data format that has support from Unicode to be easily read across all languages. Unicode is encoded into bytes in order to be stored or transmitted - these translated Unicode expressions are known as encoding. It provides a mechanism that allows an XML processor to determine which encoding is in use. Though the main objective of the XML design is to focus on documents specifically, it is often also used in order to represent arbitrary data structures (web services, for instance). There are also a variety of schema systems that are designed specifically for helping to define XML based languages.
This is simply a means to aid XHTML in extending its scope into other eminent platforms (mobile devices and web enabled television, for instance).
Firstly, there are some rules for writing code(syntax differences) in HTML and XHTML are as follows:
1.In XHTML all tag and attribute names must be in lowercase while HTML is not case sensitive.
2."Empty" tags must be written with an extra slash at the end. An empty tag is one like
.In XHTML,
3.In HTML, you could sometimes leave off an end tag while in XHTML, you must always put in the end tag.
4.In XHTML attributes must always have a value while in HTML you can sometimes omit attribute values.
5.In XHTML attributes values must always be quoted while in HTML you can sometimes omit the quotes.
Secondly, in contrast to these syntactical differences which are minor, there are some behavioral differences. For example:
• Most prominently, behavior on parse errors differs. A fatal parse error in XML (such as an incorrect tag structure) causes document processing to be aborted (a "yellow screen of death").
• Most content requiring namespaces will not work in HTML, except the built-in support for SVG and MathML in the HTML5 parser along with certain magic prefixes such as xlink.
• JavaScript processing is a little different, with minor changes in case sensitivity to some functions, and further precautions in XHTML to restrict processing well-formed to well-formed content. Third-party scripts, such as sidebars proving live feeds or Google's "web clips", often rely on the [removed]() method, which is not available in XHTML pages so the scripts fail on pages served as XHTML (that is, using an XML MIME type). The inner-HTML property is available on XML pages, but uses the same XML parser as the whole page, so will not insert content if a non-well-formed string is passed. More positively, inner-HTML in XHTML can be used to insert namespace content to the page.
• CSS is also applied slightly differently, with case-sensitivity and some differences in handling of backgrounds on and in XHTML.
Source...