Generated by DeepSeek V3.2| XHTML | |
|---|---|
| Name | XHTML |
| Mime | application/xhtml+xml |
| Extension | .xhtml, .xht, .xml, .html, .htm |
| Developer | World Wide Web Consortium |
| Released | 26 January 2000 |
| Latest release version | 5.0 |
| Latest release date | 28 October 2014 |
| Genre | Markup language |
| Extended from | XML, HTML |
| Standard | W3C Recommendation |
XHTML. The Extensible HyperText Markup Language is a family of XML-based markup languages that mirror or extend versions of HTML. It was developed by the World Wide Web Consortium as a stricter, more structured reformulation of HTML to be compatible with XML-based tools and to promote cleaner, more interoperable web code. The transition aimed to bridge the gap between the lenient syntax of classic HTML and the rigorous, well-formed requirements of the XML specification.
The development of XHTML was driven by the World Wide Web Consortium during the late 1990s, as the web expanded beyond the initial design of HTML. Key figures and working groups within the W3C, influenced by the success of XML, sought to redefine HTML as an XML application. This effort culminated in the first W3C Recommendation for XHTML 1.0 in January 2000. Subsequent versions included XHTML 1.1, which introduced modularization, and the ambitious XHTML 2.0 project, which ultimately stalled due to its lack of backward compatibility with existing HTML content. The failure of XHTML 2.0 led to a shift in focus by the W3C and competing groups like the Web Hypertext Application Technology Working Group, resulting in the development of HTML5, which reintegrated many XHTML-inspired syntactic rules as an optional XML serialization.
XHTML maintains a close but complex relationship with its predecessor, HTML. Fundamentally, XHTML is HTML reformulated as an application of XML, meaning it must adhere to the stricter syntax rules defined in the XML 1.0 specification. While HTML, as defined by RFC 1866 and later specifications, allowed for forgiving parsers and tag soup, XHTML requires well-formedness, with all elements properly nested and closed. This relationship was intended to make web documents processable by standard XML parsers like those used for SVG or MathML, enabling greater integration within the broader XML ecosystem. The HTML5 specification later formalized this duality by defining two serializations: the classic HTML syntax and the XHTML5 syntax, which is HTML5 expressed as valid XML.
The syntax of XHTML imposes several key structural requirements derived from the XML specification. All element and attribute names must be written in lowercase, a departure from case-insensitive HTML. Every start tag, such as `
` or ``, must have a corresponding end tag or be self-closing, and all attribute values must be quoted within either single or double quotation marks. Documents must begin with a proper XML declaration or a Document Type Definition declaration, such as the one for XHTML 1.0 Strict. Furthermore, the nesting of elements like `
The XHTML family is defined through specific Document Type Definition documents and the concept of modularization. The three primary DTDs for XHTML 1.0 were Strict, Transitional, and Frameset, each serving different purposes for deprecating presentational markup. XHTML 1.1 advanced this by decomposing the language into abstract modules using XML Schema and Document Type Definition, allowing subsets like XHTML Basic for mobile devices defined by the W3C and the Open Mobile Alliance. This modular approach enabled the mixing of XHTML with other XML-based languages, such as incorporating MathML equations or SVG graphics directly into a web page, a principle that later influenced the design of HTML5 and its parsing algorithms.
Adoption of XHTML was mixed, facing significant challenges related to browser compatibility and authoring practices. While advocated by the W3C and supported by newer rendering engines like Gecko in Mozilla Firefox, many web authors served pages with the `text/html` MIME type instead of the correct `application/xhtml+xml`, causing browsers like Internet Explorer and Safari to treat them as malformed HTML. This broken handling undermined the core benefits of XML processing. The rise of HTML5, championed by the WHATWG, ultimately provided a more pragmatic path forward, subsuming XHTML's strict syntax as an optional mode while ensuring robust backward compatibility with the vast existing corpus of web content, cementing the legacy of XHTML as an influential but not dominant web standard.
Category:Markup languages Category:Web standards Category:World Wide Web Consortium standards