Rozmiar: 8938 bajtów


XHTML



Extensible Hypertext Markup Language, or XHTML, is a markup language that has the same expressive possibilities as HTML, but a stricter syntax. Whereas HTML was an application of SGML, a very flexible markup language, XHTML is an application of XML, a more restrictive subset of SGML. Because they need to be well-formed XML documents, XHTML documents offer greater potential for automated processing than older flavors of HTML. XHTML 1.0 became a World Wide Web Consortium (W3C) Recommendation on January 26, 2000. ==Overview== [[Image:W3C valid XHTML 1.0 icon.png|frame|right|The W3C offers this icon, which may be placed on valid XHTML documents once they pass through the [http://validator.w3.org/ W3C Markup Validator].]] XHTML is the successor to, and the current version of, HTML. The need for a more strict version of HTML was felt primarily because World Wide Web content now needs to be delivered to many devices (like Mobile computings) apart from traditional computers, where extra resources cannot be devoted to support the generosities of HTML. A Document Type Definition (Document Type Definition) defines the rules of XHTML, against which documents can be checked. Most of the recent versions of popular web browsers render XHTML properly, and many older browsers will also render XHTML as it is mostly a subset of HTML and most browsers do not require valid HTML. Similarly, almost all web browsers that are compatible with XHTML also render HTML properly. Some say this is slowing the switch from HTML to XHTML. An especially useful feature of XHTML is that different XML namespaces (such as MathML and Scalable Vector Graphics) can be incorporated within it. The changes from HTML to transitional XHTML are minor, and are mainly to achieve conformance with XML. The most important change is the requirement that the document must be well-formed tag and all HTML elements must be closed. Additionally, in XHTML, all tags must be written in lowercase. This is in direct contrast to established traditions which began around the time of HTML 2.0, when most people preferred uppercase tags. In XHTML, all attributes, even numerical ones, must be quoted. (This is not mandatory in SGML (hence in HTML), where quotes are not required if the content consists only of alphanumeric and certain allowed special characters.) All elements must also be closed, including empty elements such as img and br. This can be done by adding a closing slash to the start tag: and
. Attribute minimization (e.g., ) is also prohibited; instead, use . More differences are detailed in the W3C XHTML specification [http://www.w3.org/TR/xhtml1/#diffs]. ==Versions of XHTML== ===XHTML 1.0=== The original XHTML W3C Recommendation, XHTML 1.0, was simply a reformulation of HTML 4.01 in XML. There are three different 'flavors' of XHTML 1.0, each equal in scope to their respective HTML 4.01 versions. * XHTML 1.0 Strict requires that documents must be well-formed, and is the same as HTML 4.01 Strict in XML form. * XHTML 1.0 Transitional allows some common deprecated elements and attributes not found in XHTML 1.0 Strict to be used, such as
, , , and . * XHTML 1.0 Frameset: Allows the use of HTML framesets. ===XHTML 1.1=== The most recent XHTML W3C Recommendation is ''XHTML 1.1: Module-based XHTML''. Authors can import additional features (such as framesets) into their markup. This version also allows for ruby characters markup support, needed for East-Asian languages (especially CJK). This is the specification that the W3C recommends all new web pages be created in. ===The XHTML 2.0 draft specification=== Work on XHTML 2.0 is, as of 2005, still underway; in fact, the DTD has not even been authored yet. The XHTML 2.0 draft is controversial because it breaks backwards compatibility with all previous versions, and is therefore in effect a new markup language created to circumvent (X)HTML's limitations rather than being simply a new version. New features brought into the HTML family of markup languages by XHTML 2.0 state that: * HTML forms will be replaced by XForms. * HTML frames will be replaced by XFrames. * The DOM Events will be replaced by XML Events, which uses the XML Document Object Model. * A new list element, the element, will be included in order to specifically designate a list as a navigation list. This will be useful in creating nested menus which are currently created by a wide variety of means. * Any element will be able to contain a hyperlink, e.g.,
  • Articles
  • . * Any element will be able to reference alternative media with the src attribute, e.g.,

    London Bridge

    will replace London Bridge. * The element has been removed in favor of Alt * The heading elements (i.e.

    ,

    ,

    , etc.) will be deprecated in favour of the single element . Levels of headings will instead be indicated by the nested
    elements each with their own heading. * The presentational elements , and , still allowed in XHTML 1.x (even Strict), will be absent from XHTML 2.0. The only presentational elements remaining will be and for superscript and subscript respectively. ===Others in the XHTML family=== *XHTML Basic: A special "light" version of XHTML for devices which cannot use the full XHTML set, primarily used on handhelds such as mobile phones. This is the intended replacement for Wireless Markup Language and C-HTML. *XHTML Mobile Profile: Based on XHTML Basic, this OMA ([http://www.openmobilealliance.org/| Open Mobile Alliance]) effort targets hand phones specifically by adding mobile phone-specific elements to XHTML Basic. ==Validating XHTML documents== An XHTML document that conforms to the XHTML specification is said to be a valid document. In a perfect world, all browsers would follow the web standards and valid documents would predictably render on every browser and platform. Although validating your XHTML does not ensure cross-browser compatibility, it is recommended. A document can be checked for validity with the W3C Markup Validation Service. ===DOCTYPEs=== For a document to validate, it must contain a Document Type Declaration, or DOCTYPE. A DOCTYPE declares to the browser what Document Type Definition (DTD) the document conforms to. A DTD should be placed at the very beginning of an XHTML document. These are the most common XHTML DTDs: ;XHTML 1.0 Strict :<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    ;XHTML 1.0 Transitional :<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    ;XHTML 1.0 Frameset :<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
    ;XHTML 1.1 :<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
    "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
    Character encoding may be specified at the beginning of an XHTML document in the XML declaration and within a meta http-equiv statement. (If an XML document lacks encoding specification, an XML parser assumes that the encoding is UTF-8 or UTF-16, unless the encoding has already been determined by a higher protocol.) ===Common errors=== Some of the most common errors in XHTML are: *Not closing empty elements (elements without closing tags) **Incorrect:
    **Correct:
    *Not closing non-empty elements **Incorrect:

    This is a paragraph.

    This is another paragraph. **Correct:

    This is a paragraph.

    This is another paragraph.

    *Improperly nesting elements (elements must be closed in reverse order) **Incorrect: This is some text. **Correct: This is some text. *Not specifying alternate text for images (using the alt attribute, which helps make pages accessible for devices that don't load images or screen-readers for the blind) **Incorrect: **Correct: MediaWiki *Putting text directly in the body of the document **Incorrect: Welcome to my page. **Correct:

    Welcome to my page.

    *Nesting block-level elements within inline elements **Incorrect:

    Introduction

    **Correct:

    Introduction

    *Not putting quotation marks around attribute values **Incorrect:

    **Correct: *Using the ampersand outside of entities (use &amp; to display the ampersand character) **Incorrect: Cars & Trucks **Correct: Cars &amp; Trucks *Using uppercase tag names and/or tag attributes **Incorrect:

    The Best Page Ever

    **Correct:

    The Best Page Ever

    *Attribute minimization **Incorrect: **Correct: This is not an exhaustive list, but gives a general sense of errors that XHTML coders often make. ==Backward compatibilities== XHTML 1.0 is backward compatible with HTML when served as text/html. However, there are problems associated, especially for Internet Explorer. For more information, please refer to Criticisms of Internet Explorer#XHTML section in the criticisms of Internet Explorer article. Furthermore, XHTML 2.0 has been faulted for not being backward compatible with XHTML 1.x efforts. == Example == The following is an example of XHTML 1.0 Strict.
    
    
    
        
            XHTML Example
        
        
            

    This is tiny example of an XHTML usage.

    ==See also== *Dynamic HTML *List of document markup languages *Comparison of document markup languages *Comparison of layout engines (XHTML) ==External links== *[http://www.w3.org/MarkUp/ W3C's Markup Home Page] *[http://www.w3.org/TR/xhtml1/ XHTML 1.0 Specification] *[http://www.w3.org/TR/xhtml11/ XHTML 1.1 Specification] *[http://hixie.ch/advocacy/xhtml Sending XHTML as text/html Considered Harmful] ===Validators=== *[http://validator.w3.org/ W3C's Markup Validator] *[http://www.htmlhelp.com/tools/validator/ WDG HTML Validator] *[http://uitest.com/en/cat/analysis/ Validators and checkers] ([http://uitest.com/en/check/ Site Check]) Markup languages W3C standards XML standards HTML XML lv:XHTML vi:XHTML

    XHTML



    XHTML is just the XML-form of HTML, CSS and seperation of content and form are the same as they were in HTML. <table/> is still usable for lay-outing. But with XHTML, semantics and the seperation of content and form became a hot item. I think that it's necessary to add something like this to the part about CSS and XHTML. :Try this page, this is real XHTML (contenttype application/xhtml+xml) http://devedge.netscape.com/viewsource/2003/xhtml-style-script/examples/example-6.xhtml :It doesn't work in IE6 (it wants to download it). Mozilla gets it. These days you can't make webpages that aren't supported by IE6. It also shows that a real XHTML page is something different then XMLling your HTML, putting in an xhtml doctype and then send it as text/html anyway. == XTML? == Is XTML really a valid abbreviation for XHTML? I've never seen it used on the net before, especially not at the W3C and in standards discussions. : I was just about to ask the same thing. I've never heard of "XTML" and this stuff is my job. I'm gonna remove it. Feel free to revert the change, but at least explain where and why, with references, if you're gonna... ;o) — User:OwenBlacker 01:59, Jun 20, 2004 (UTC) == DTD != XML == I just removed: "The XHTML DTD is defined using XML, to enforce that language's strict rules" which is plain wrong. DTDs are not specified using XML, schemas are. == was just reading the comments here... == I make a few websites here and there... a good comment above that table's are perfectly valid XHTML and validate through w3c.org... many HTML junkies think XHTML = no tables or table-less layouts. I'd think perhaps the most common error from HTML to XHTML is using uppercase tags... this seems to be rampant all over the internet. == mandatory quotes == The XHTML#Overview originally stated that quotes ''are'' mandatory in HTML but are "often ignored". However, in HTML it's perfectly legal to not quote an attribute value as long as it consits only of alphanumeric characters and/or certain allowed special characters (such as hyphens). For example, <html lang=en-us> is perfectly allowable. The value must be quoted only if the attribute value includes non-allowed characters (e.g. <style type=text/css> is invalid) or spaces. [http://zero-soul.panicus.org/misc/attr-noquote.html Demonstration] -- User:Vystrix Nexoth 13:48, Nov 21, 2004 (UTC) :To quote [http://www.w3.org/TR/html4/intro/sgmltut.html the specs]: ::''By default, SGML requires that all attribute values be delimited using either double quotation marks (ASCII decimal 34) or single quotation marks (ASCII decimal 39). '' : They are mandatory in HTML ~ User:Mlk ✉">User_talk:mlk♬">Special:Contributions/mlk 01:27, 31 Dec 2004 (UTC) ~ ::ml, you neglected to read the next paragraph: :::In certain cases, authors may specify the value of an attribute without any quotation marks. The attribute value may only contain letters (a-z and A-Z), digits (0-9), hyphens (ASCII decimal 45), periods (ASCII decimal 46), underscores (ASCII decimal 95), and colons (ASCII decimal 58). We recommend using quotation marks even when it is possible to eliminate them. ::They are NOT mandatory in HTML, in some circumstances. Granted, it is safer to always use them, but they aren't required. User:Porge 22:21, Apr 4, 2005 (UTC) ::(The allowable character set without quotes is then ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._:) == Tables vs. CSS designs == I cannot agree with calling no-table design users junkies. It makes life easier. Try building a portal, which uses a lot of element positioning from tables, it will take you two weeks to get a prototype of a page finished. Do it with xHTML+CSS, you'll do it in 2 hours. (But, please, do it correctly.) CSS design requires a lot of experience and is therefore not recommended for beginners. Otherwise, check out the page: http://www.csszengarden.com/ User:Proclub == My recent edit, commented == #I feel this page still has many errors, however, I could not figure out how to correct them without totally ruining the text, so I have left them. However, I did make many adjustments. Most important is it to notice that XHTML is in no way ''stricter'' than HTML is, it's just ''simpler''. Thus the parsers are easier to write, and they run better on low-end equipment. However, XML and SGML are both very strict when the parsers written for them are following specifications. For instance, the rule that in XML says "when you start with tag <li> you must also close it with tag </li>" says in SGML "when you start with tag <li> and a tag that cannot be inside li is reached, assume li to be closed". Both are rules, neither are less strict than the other. The XML one is however less ambiguous to us humans. #And, as I tried to point out in my correction, the fact that HTML is allowed to be full of errors is due to crappy implmentation from browser vendors. After all, if they all suddenly started using a full-fledged SGML parser now, most pages on the WWW would not work in them. XHTML however, is a new thing, and can be parsed with full strictness. Of course, this helps little when nobody sends out XHTML as XHTML (application/xhtml+xml) and everybody just spits it out as HTML (text/html) instead, since it causes the browser to use their non-strict HTML parser mode. More about that can be found here: [http://www.hixie.ch/advocacy/xhtml http://www.hixie.ch/advocacy/xhtml]. #I corrected ''tag'' to ''element'' where appropriate; If you don't know the difference, you're on thin ice, jargon-wise. #The statement that XHTML is semantically rich is just plain false. Whatever semantics you can put into an XHTML document (non-modularized) can be put into HTML as well. There is nothing, anywhere, that specifies that XHTML has to be semantic at all. #"XHTML 1.0 Strict requires that all tags be well-formed, and deprecates many elements and attributes found in HTML 4.01." — no. There is no difference between HTML 4.01 Strict and XHTML 1.0 Strict whatsoever, except that they are specified in SGML and XML respectively. #"XHTML 1.0 Transitional is designed for an easier transition from HTML, and allows..." — wrong again. This one is equal to the Transitional specification of HTML 4.01, and has nothing to do with easier transition from HTML to XHTML. It has to do with easier transition from lenient documents to stricter ones, whether in HTML or XHTML. It's there to be used while you are moving to separation of content and style. (CSS) #An XML declaration is not the same as an XML prolog. Please read up on this document for more information about this subject: [http://www.w3.org/TR/2000/REC-xml-20001006#sec-prolog-dtd W3C's XML specification]. #My final correction was about backwards compatibility with HTML. This ended with XHTML 1.0. XHTML 1.1 is not backwards compatible with HTML, as it SHOULD NOT be sent as text/html and can use other XML namespaces as well as have the new ruby elements. User:DarkPhoenix 21:45, Jun 18, 2005 (UTC) ::Re: 2; "The reason that HTML documents often have messier code than XHTML documents is due to the way the browsers parse them." I'm sorry, but this did not make sense - some parsers may render code messily, but they do not actually alter the code. What you added in that section also seemed rather unnecessary...like it was talking to editors, which is what the Talk page is for. ¦ User:Reisio 22:36, 2005 Jun 18 (UTC) ::Re: 7; The text was not implying that an XML declaration is the same as an XML prolog. It was somewhat inaccurate, however, and has been fixed. ¦ User:Reisio 22:40, 2005 Jun 18 (UTC) :::Re: Re: 2; In any case, saying that HTML is generous is a mistake, because this is not due to its specification, but because of browsers' implementations. I would like to make that a point, because currently, this article is learning people the wrong thing, and we don't want an encyclopedia to have wrong information, do we? I was not talking to editors, I was talking to the readers, because there are so many misconceptions going around concerning the difference between HTML and XHTML, and this document was (and still is) full of these misunderstandings. Let me give you an example. This document here is perfectly valid HTML: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    <html>
    <title>Test</>
    <h1>This is a test</>
    <p>Para 1
    <p>Para 2
    :::The reason that won't show up correctly in browsers is because they don't parse it with an SGML parser, but with some home-made tag-soup-ish crap. If browsers got that right, they would, due to the rules of SGML, show a page with a title, a header, and two normal paragraphs. Try to validate that, it's valid. User:DarkPhoenix 08:36, Jun 19, 2005 (UTC) ::::I believe whoever initially put in "generosities" was not incorrect exactly. HTML is generous in that it takes a more complex (or at least more bloated) parser to render it properly; because of the less-strict markup, etc.. I agree, however, that it's not the best explanation and could be improved. ¦ User:Reisio 10:04, 2005 Jun 19 (UTC)

    Xhtml



    #REDIRECT XHTML


    See other meanings of words starting from letter:

    X



    Words begining with XHTML:

    XHTML
    XHTML
    Xhtml
    XHTMLplusSMIL
    XHTMLplusSMIL
    XHTML_1.0
    XHTML_1.0_Recommendation
    XHTML_Basic
    XHTML_Friends_Network
    XHTML_modules


    These materials are based on Wikipedia and licensed under the GNU FDL



    YouTube.com videos better site than Turbo Tax 2007
    encyklopedia online