Standard Generalized Markup Language (SGML) is a markup language introduced in 1980 that describes the structure and content of information that is readable by machines. Quite complex, SGML is limited to organizations that need this level of complexity. SGML is not intended for the WWW where Web page authors need a language that is easy to use. HTML is an SGML Application, based on the SGML architecture.
In the early days of the Web, Web browsers created their own unique features that were not a part of the standard, and some Web browsers did not follow all the W3C standards. Most browsers also allowed Web page authors to be lax in their use of syntax (omitting closing tags, missing quotes, etc.). Although it might seem beneficial, the behavior affects browser design by making the source code for browser software become more bloated to deal with inconsistencies. This became a problem because the memory and CPU power on handheld devices was not sufficient to handle bloated browser code.
As a result, developers began to push for a version of HTML in which syntax rules would be strictly enforced. This was done by making HTML in to an XML vocabulary. Extensible Markup Language (XML) is like SGML, used to create markup languages, but without SGML's complexity. XML has been used to create specialized markup languages called XML vocabularies such as MathML and MusicML. Anyone can create their own markup language for specific needs.
XHTML is just another XML vocabulary. As with HTML and XML, the W3C maintains the specifications and standards for XHTML. Although XHTML 2.0 was discontinued in 2009 due to lack of support (not backward compatible with earlier XHTML versions), XHTML5 is currently in development. The difference is that XHTML5 is backward compatible with earlier XHTML versions.
Because XHTML documents are also considered XML documents, the first line of an XHTML file contains a statement called a prolog that indicates that the document adheres to the syntax rules of XML. To make a long story short, we'll use the following code at the top of each XHTML document.
<?xml version="1.0" encoding="UTF-8" ?>
And we'll add the following
meta tag to make the first few lines of an XHTML document appear as
<?xml version="1.0" encoding="UTF-8" ?> <html> <head> <meta http-equiv="Content-type" content="text/html;charset=UTF-8" />
We can not have even one space at the top of an XHTML document before the above first line.