XHTML vs. HTML.....?

Discussion in 'HTML & Website Design' started by acw, Oct 11, 2009.

  1. #1
    what are the basic differences between

    XHTML vs HTML...?

    (I was doing some research but didn't really find any answers in Wikopedia or other webpages were vague and unreliable).

    Why is XHTML better (or worse) and which should i be focused on for programming websites....?

    thanks in advance...:)

    ~T

    :)
     
    acw, Oct 11, 2009 IP
  2. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    437
    Best Answers:
    0
    Trophy Points:
    0
    #2
    XHTML is a reformulation of HTML but in XML format instead of SGML. Since the browser with the highest usage levels doesn't even support XHTML when served as XML (ie: a Web application, and yes, that browser is Internet Explorer), nor does it have any plans to -- and to top it off the W3C is abandoning XHTML in favor of the train wreck that is going to become HTML 5, there is really no point in using XHTML unless you serve it as HTML, in which case you might as well be using HTML 4.01 Strict anyway.
     
    Dan Schulz, Oct 11, 2009 IP
  3. jamesicus

    jamesicus Peon

    Messages:
    477
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Problems serving XHTML 1.0 (full explanation)

    Sending XHTML as text/html Considered Harmful

    The perils of using XHTML properly

    Activating Browser Modes with Doctype - Choosing a Doctype

    The W3c has abandoned all development work on XHTML 2.0. In my opinion, Web pages should be produced using HTML 4.01 with a strict Doctype -- maybe migrating eventually to HTML 5 as elements/attributes become viable and stable.

    Again, in my opinion, XHTML 1.0 is not really bad - it is just pointless to serve it as content MIME type text/html (which is the way practically all XHTML Documents are presently being served) - it is not XHTML served this way, just HTML - refer to the first linked page above.

    XHTML does require good coding syntax discipline. Documents must be well-formed: all elements must have closing tags - empty elements must either have an end tag or the start tag must end with />, all elements must nest properly, lower case must be used for all HTML element and attribute names - necessary because XML syntax is case-sensitive. However, well-formed coding should be adopted as standard anyway by Web page developers for all Markup generation.

    James
     
    Last edited: Oct 11, 2009
    jamesicus, Oct 11, 2009 IP
  4. acw

    acw Well-Known Member

    Messages:
    157
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    103
    #4
    ^^ Hey Thanks Guys...

    I'm just beginning and was reading a little about XHTML.

    ...So are you saying that XHTML serves no real purpose...just Drop it and used HTML 4.01?
     
    acw, Oct 11, 2009 IP
  5. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    437
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Pretty much. I won't hold your feet to the fire if you use XHTML though. (Then I'd have to brand myself a hypocrite.)
     
    Dan Schulz, Oct 11, 2009 IP
  6. sunsoftsystem

    sunsoftsystem Peon

    Messages:
    92
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    sunsoftsystem, Oct 11, 2009 IP
  7. jamesicus

    jamesicus Peon

    Messages:
    477
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    0
    #7
    MSIE Browsers will not retrieve and render XHTML served as Media type application/xhtml+xml correctly. IE 6.0 release 2900 and later, IE 7.0 and IE8 will display such pages alright but will not render xml content. IE 6.0 release 2800 and earlier Browsers present a download screen -- selecting OPEN displays a plain, text only page (sans style sheet) and again will not render xml. IE7 Browsers and IE8 will skip the prolog and render HTML content in Standards mode.

    Microsoft's stated rationale for not recognizing XHTML Web Pages served with Media type application/xhtml+xml is set forth in the Microsoft MSIE 7.0 Blog (reiterated for MSIE 8.0).

    Note that Web Service Provider software often does not recognize the Media type application/xhtml+xml. In that case the Web Author wishing to serve XHTML Pages as Media type application/xhtml+xml -- maybe out of curiosity or via content negotiation (actually an exercise in futility) -- will have to contact his or her Provider to try and convince them to adopt it as the Media type to associate with specified XHTML Web Page extensions. If that doesn't work -- and it may not -- then the Web Author will be faced with the task of producing and loading up to the server a .htaccess file that provides the association. Media types can also be established via server side scripting. MIME type cannot be established via the "content-type" Meta tag -- that entry is only informational.

    James
     
    Last edited: Oct 11, 2009
    jamesicus, Oct 11, 2009 IP
  8. Martin K

    Martin K Active Member

    Messages:
    262
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #8
    Focus on XHTML it's more SEO friendly. If you need a well optimized website use XHTML, if not than use HTML 4.01 which is easy to validate to W3C standard.
     
    Martin K, Oct 11, 2009 IP
  9. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    437
    Best Answers:
    0
    Trophy Points:
    0
    #9
    XHTML is not anymore SEO friendly than HTML. Sheesh, where did you hear that garbage from, anyway?
     
    Dan Schulz, Oct 11, 2009 IP
  10. forextrendalerts

    forextrendalerts Guest

    Messages:
    132
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #10
    XHTML is not very different from the HTML 4.01 standard.

    So, bringing your code up to the 4.01 standard is a good start.

    Our complete HTML 4.01 reference can help you with that.

    In addition, you should start NOW to write your HTML code in lowercase letters, and NEVER skip closing tags (like </p>).
     
    forextrendalerts, Oct 12, 2009 IP