Problems occur with XHTML

Discussion in 'Web Design, HTML And CSS' started by Magena, Aug 9, 2008.

  1. Magena

    Magena Banned

    Joined:
    Jul 12, 2008
    Messages:
    20
    Likes Received:
    1
    Trophy Points:
    0
    Taken from Wikipedia.

    Common errors



    Some of the most common errors in the usage of XHTML are:
    • Failing to realize that documents won’t be treated as XHTML unless they are served with an appropriate XML MIME type
    • Not closing empty elements (elements without closing tags in HTML4)
      • Incorrect: <br>
      • Correct: <br />
    Note that any of these are acceptable in XHTML: <br></br>, <br/> and <br />. Older HTML-only browsers interpreting it as HTML will generally accept <br> and <br />.
    • Not closing non-empty elements
      • Incorrect: <p>This is a paragraph.<p>This is another paragraph.
      • Correct: <p>This is a paragraph.</p><p>This is another paragraph.</p>
    • Improperly nesting elements (Note that this would also be invalid in HTML)
      • Incorrect: <em><strong>This is some text.</em></strong>
      • Correct: <em><strong>This is some text.</strong></em>
    • Not putting quotation marks around attribute values
      • Incorrect: <td rowspan=3>
      • Correct: <td rowspan="3">
      • Correct: <td rowspan='3'>
    • Using the ampersand character outside of entities
      • Incorrect: <title>Cars & Trucks</title>
      • Correct: <title>Cars &amp; Trucks</title>
    • Using the ampersand outside of entities in URLs (Note that this would also be invalid in HTML)
      • Incorrect: <a href="index.php?page=news&style=5">News</a>
      • Correct: <a href="index.php?page=news&amp;style=5">News</a>
    • Failing to recognize that XHTML elements and attributes are case sensitive
      • Incorrect: <BODY><P ID="ONE">The Best Page Ever</P></BODY>
      • Correct: <body><p id="ONE">The Best Page Ever</p></body>
    • Using attribute minimization
      • Incorrect: <textarea readonly>READ-ONLY</textarea>
      • Correct: <textarea readonly="readonly">READ-ONLY</textarea>
    • Mis-using CDATA, script-comments and xml-comments when embedding scripts and stylesheets.
      • This problem can be avoided altogether by putting all script and stylesheet information into separate files and referring to them as follows in the XHTML head element.
        HTML:
        <link rel="stylesheet" href="/style/screen.css" type="text/css" />
         <script type="text/javascript" src="/script/site.js"></script>
        Note: The format <script …></script>, rather than the more concise <script … />, is required for HTML compatibility when served as MIME type text/html.
      • If an author chooses to include script or style data inline within an XHTML document, different approaches are recommended depending whether the author intends to serve the page as application/xhtml+xml and target only fully conformant browsers, or serve the page as text/html and try to obtain usability in Internet Explorer 6 and other non-conformant browsers.
     
  2. gkumar

    gkumar New Member

    Joined:
    Jun 16, 2009
    Messages:
    58
    Likes Received:
    5
    Trophy Points:
    0
    For anyone that likes XHTML, there is now evidence to show that XHTML is extremely harmful. According to this report, XHTML has been linked to the following problems:

    * Computer viruses;
    * Inability to get Opera support;
    * Destroying hard drives;
    * Automatically forwarding and deleting e-mails; and
    * Credit card fraud

    Now, if only you had listened before it was too late! :)
     
  3. naimish

    naimish New Member

    Joined:
    Jun 29, 2009
    Messages:
    1,043
    Likes Received:
    18
    Trophy Points:
    0
    Occupation:
    Software Engineer
    Location:
    On Earth
    Yeah Cool one, I have done this using XML Checker ;)
     
  4. David Michael

    David Michael New Member

    Joined:
    Jul 6, 2009
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    0
    where is 404?Its very common due to wrong redirect. . .
     
  5. Full Zip Hoody

    Full Zip Hoody New Member

    Joined:
    Sep 29, 2010
    Messages:
    20
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    Programer
    Location:
    US of A
    indeed these are the most common errors in the usage of XHTML. But these are all noob errors. For me the most common error is the one when i forget to end the tags. like </p> or </em> very stressful cause i have to come back and reedit
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice