Template: Infobox file format / Maintenance / Magic number is missing template: Infobox file format / Maintenance / missing site
Template: Infobox file format / Maintenance / Screenshot Format
1.1 (Recommendation ) 1.1 SE ( Working Draft ) 5 ( Working Draft ) 2.0 ( Working Draft )
The W3C standard Extensible Hypertext Markup Language ( extensible HTML; abbreviation: XHTML ) is a text-based markup language for structuring and semantic markup of content, such as text, images, and hyperlinks in documents. It is a reformulation of HTML 4.01 in XML: Unlike HTML, which was defined using SGML, XHTML uses the stricter and easier to parse SGML subset of XML as a language basis. So XHTML documents comply with the syntax rules of XML.
- 7.1 Extensions to HTML
- 7.2 Extensions for XHTML
- XHTML 9.1 Specifications relating
- 9.2 XHTML Introductions and tools
XHTML 1.0: The transition from HTML to XHTML
XHTML 1.0 contains all the elements of HTML 4.01, so that a conversion of HTML 4.01 compliant pages to XHTML 1.0 is easily possible. A non- XHTML -enabled browser can XHTML documents under certain conditions nevertheless represent correctly (see MIME types and HTML compatibility ): it processes them as normal HTML. This exploits that the HTML parser of the popular browsers are tolerant of syntax errors. This fault-tolerance arose as a response to numerous HTML documents on the World Wide Web did not meet the formal standard, and users perceive browser messages about HTML syntax errors as annoying. For XHTML, however, the XML basic idea of easy data exchange and easy automated processing applies. Therefore, programs that process the XHTML, not such a tolerant.
Newer XHTML document types contain no layout Awards more. XHTML Transitional 1.0 is the last document type, which still contains layout elements, such as or . In modern document types such as XHTML Strict 1.0 Although a few layout elements are still present, but only for reasons of backward compatibility with the Transitional document types. In XHTML Basic or XHTML 2 finally layout elements are no longer included. For the visual design of XHTML elements to only link to external CSS rules.
To enable the development of languages that are based on XHTML, and related related items in XHTML 1.1 were grouped in so-called modules. Based on these in the future in DTDs and XML Schema documents drawn modules can create your own XHTML document types according to the modular principle and mix with other XML-based languages. Example applications of XHTML Modularization are XHTML 1.1, XHTML Basic, and the mixtures with SMIL (multimedia), SVG (vector graphics) and MathML ( mathematical formula set). To include more general objects such as multimedia plug-ins, there is the object module.
XHTML interpreted as term the various XHTML versions together:
- XHTML 1.0 is the XML-based reformulation of HTML 4.01 dar. XHTML 1.0 is replaced by the known three document types Strict, Transitional and Frameset. XHTML 1.0 was designed so that backward compatibility with the common HTML browsers is possible. At the same time it can be processed by newer browsers according to strict rules.
- The latest version of XHTML 1.1 separates itself from the deprecated elements and attributes of the Transitional and Frameset the variant that directly affect the presentation of the document. The language scope thus largely corresponds XHTML 1.0 Strict, added elements for Ruby explanations. XHTML 1.1 is not applied with regard to the compatibility with HTML browsers.
- XHTML Basic is designed for minimalist devices such as mobile phones and handhelds by only some language components (modules) are used by XHTML. XHTML Basic is the basis for XHTML Mobile Profile (see WAP 2.0) and for WML 2.0.
- The modularisation created more mixed versions, such as XHTML 1.1 plus MathML plus SVG.
- The version of XHTML 2.0, whose development has been discontinued in favor of HTML5 the end of 2009, had broken with the legacy HTML 4 and provided for fundamental changes. Important innovations were simplified unrestricted Record of hyperlink been simplified Include other types of media ( such as images and videos), the extended capabilities to ensure accessibility, and the mellower Specifying metadata. Existing core features of HTML or XHTML would have been outsourced to XHTML 2.0 in other XML languages , including XForms for forms, XML Events for the integration of scripts and XFrames for frames.
The key differences between HTML and XHTML
is recommended for compatibility
- The start tag of the root element must always be the html namespace specification for XHTML include:
- In XHTML 1.1, the lang attribute of the xml was: lang attribute of XML replaced. In XHTML 1.0, providing both attributes is recommended, eg .
- The role of the name attribute for the elements a, frame and map takes over from XHTML 1.0 the id attribute. If backward compatibility is desired, should be declared both the name and the id attribute is listed with the same attribute value and XHTML 1.0 Transitional. In XHTML 1.1 and XHTML Modularization no name attribute longer exists for those elements.
- The name attribute form for the elements and img is only in XHTML 1.0 Transitional present, not in XHTML 1.0 Strict and XHTML 1.1. This limitation is particularly relevant in the DOM access to the elements.
This is the source code for a standards-compliant HTML document. The example is deliberately kept as short as possible and should show differences in the allowed syntax. In HTML it is recommended to fully write down all the necessary elements.
sample page < / h1 >
< / ol >
body> The html element has been completely omitted, for the head or body element missing end or the opening tag, p, and li elements were not closed. The src attribute of the image is specified without quotes.
The same document as valid XHTML 1.1 might look like this:
xml version = " 1.0" encoding = "UTF -8"? >
Example title> head>
sample page < / h1 >
A paragraph p>
- List item < / li >
- List item < / li >
< / ol >
p> body> html> The XML declaration Xml version = " 1.0" encoding = "UTF -8"? > Is optional, but recommended by the W3C because she tells XML parsers the character encoding of the document. The character encoding UTF- 8 should be written in capital letters. This contradicts at first glance the XHTML principle, all elements and attributes to write small. However, it is the official name assigned by the IANA, the XML parser does not necessarily have to interpret case insensitive. If the encoding information is not available and no encoding in the HTTP headers have been sent, the browser can be used according to the XML standard encoding UTF -8 or UTF-16.
MIME types and HTML compatibility
When transferring HTML and XHTML documents find specific MIME types using, for example, in the Content-Type header in e-mail and especially at HTTP:
- For HTML documents, it is provided according to RFC 2854, you text with the MIME type application / html to send.
- An XHTML 1.0 document should normally application according to RFC 3236 with the MIME type application / xhtml xml to be sent. If the document complies with the guidelines of backward compatibility, it can according to RFC 2854 and the XHTML 1.0 standard as text / html to be sent. Due to the lack of XHTML support of software distributed through the latter option leads to a special place.
- As for XHTML 1.1 compatibility is not provided with ordinary HTML browsers, according to a W3C announcement only as application / xhtml xml to be delivered such documents. The same applies to the other descendants of XHTML Modularization, or about XHTML Basic.
From the MIME type depends on how the browser process the document. Only when an XHTML document instance with the content type application / xhtml xml is declared, set XHTML -enabled browser, its XML parser, by which be exploited the advantages of strict XHTML codes, such as the ease of processing. If this is the case, the document can only be displayed if it is well-formed XML. Many current browsers, including Mozilla, Mozilla Firefox, Google Chrome, Opera and Safari support the MIME type application / xhtml xml. The widespread Internet Explorer can begin only since version 7.0 something with this MIME type, however: Older versions open a download dialog instead represent the document. Therefore, text / html be used if the browser has not explicitly transmitted in the Accept header of the request that he application / xhtml xml support. This can be determined on the server side to send the appropriate MIME type - which you would have for Internet Explorer to perform a version check from version 7.0, since IE * / * sends still as a MIME type.
XHTML and layout
With HTML 4, the W3C began thus, the elements and attributes that were directly responsible for the presentation of the document and no output - independent structuring expressed, gradually excluded from HTML. While XHTML 1.0 includes the same way as HTML 4 Transitional a variant with these antiquated language components. However, it has prevailed in modern web design that the strict variant is used and the documents are consistently formatted with CSS. The structured content and the particular layout can be defined separately. With XHTML 1.1 and XHTML 2.0, the W3C the scheduled wanted to finish this development finally by only output - independent markup allowed and layout should be implemented inevitably with CSS or similar languages.
Extensions to HTML
HTML pages have as SGML language, although a well-defined structure, which is defined in the document type definition ( DTD). Without knowledge of the DTD, however, the hierarchical tree structure of a document can not be established with certainty. Some elements have no end tag (such as
for a line break ) or an optional end tag (such
for a paragraph of text ). Only the DTD to determine which items these are. The parser does not know her, so the document hierarchy is ambiguous. XHTML as XML language resolves this deficiency.
HTML is not really extensible, common browser go but in the HTML processing as follows:
- Awarded by unknown elements is ignored.
- In syntactic errors is attempted nevertheless to produce a logical element tree. It is an attempt to make a non -compliant page the best, that is, a page will be displayed in any case.
Thus, the processing of various versions of HTML is possible. Performs a version of a new element, this is simply ignored by older browsers. The same applies to attributes. Does an HTML 3.2 -compliant browser not for example the introduced in HTML 4.0 acronym element for abbreviations, it is skipped and the abbreviation appears in normal text formatting. The same applies to browser-specific extensions. The blink element is contained for example in any HTML standard. Some browsers, originally just Netscape Navigator, set the text then flashing dar. Other browsers display the text normally again dar.
Extensions for XHTML
Unlike HTML, XHTML was created with a view to the possibility of extensibility. XHTML uses to the namespace concept of XML. An XHTML version forms such a name space. Other XML languages such as MathML, SVG and RDF provide additional namespaces dar. In an XHTML document elements can now be used from other namespaces by using the attribute xmlns receive a corresponding namespace specification. For this purpose a special DOCTYPE must be used, which defines the elements - the use of MathML is:
xml version = " 1.0" encoding = "UTF -8"? > < DOCTYPE html PUBLIC " - / / W3C / / DTD XHTML 1.1 plus MathML 2.0 / / EN " " http://www.w3.org/Math/DTD/mathml2/xhtml-math11-f.dtd " > An example of the use of the namespace concept for the extension of XHTML is the embedding of MathML:
This is quite normal XHTML p>