www.webdeveloper.com
Results 1 to 8 of 8

Thread: [RESOLVED] Validating ( 3 diff. types!)

  1. #1
    Join Date
    Mar 2007
    Location
    Las Vegas, NV
    Posts
    45

    resolved [RESOLVED] Validating ( 3 diff. types!)

    So the w3c validator says I've got an html 4.01 frameset document, with "No Character encoding declared at document level"; tidy says:
    Code:
    03:11:29 /home/barrie/www $ >> tidy ./index1.html | head --lines 10
    Info: Doctype given is "-//W3C//DTD HTML 4.01 Transitional//EN"
    Info: Document content looks like XHTML 1.0 Transitional
    No warnings or errors were found.
    and heres the first bit of the file:
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
       "http://www.w3.org/TR/HTML4/loose.dtd">
    
    <HTML xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
    		
    <HEAD>
            <meta http-equiv="Content-type" content="text/html;charset=UTF-8" />
    	<TITLE>Test Page</TITLE> 
    	<link rel="stylesheet" type="text/css" href="./index1.css" />
    </HEAD>
    .
    .
    .
    Which validator is correct and how do I fix the character encoding in the doc.??? I've tried pasting just about every available option!

    TIA,
    Barrie

  2. #2
    Join Date
    Aug 2007
    Posts
    3,767
    That's not HTML, it's XHTML. <meta /> should be <meta>, same with link etc.

  3. #3
    Join Date
    Mar 2007
    Location
    Las Vegas, NV
    Posts
    45
    Quote Originally Posted by Declan1991 View Post
    That's not HTML, it's XHTML. <meta /> should be <meta>, same with link etc.
    Thank you, down to 1 warning!

    Barrie

  4. #4
    Join Date
    May 2005
    Location
    Gold Coast (MS)
    Posts
    2,217
    Your doctype says: " HTML 4.01 Transitional"

    and the "html" tag says this: "<HTML xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">

    Remove this: " xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"".

    Remove ALL " /" (space and "/") from those tags that normall do not need closing tags in HTML 4.01.

    Go with the validator first. HTML Tidy has lots of options that can be set and somewhat dependent on whether you are using someone's add-on or not. Maybe look into using the W3C's or try these:

    http://infohound.net/tidy/
    http://valet.htmlhelp.com/tidy/
    http://www.totalvalidator.com/validator/ValidatorForm

    Make all your tags and attributes in lowercase to keep from developing a bad coding habit should you go to XHTML.
    "

  5. #5
    Join Date
    Nov 2002
    Location
    Baltimore, Maryland
    Posts
    12,278
    Quote Originally Posted by Major Payne View Post
    Make all your tags and attributes in lowercase to keep from developing a bad coding habit should you go to XHTML.
    Two other good habits to adopt, but they are by no means necessary, always quote your attribute values even when unnecessary and always use the optional start and end tags. Not so much to get yourself ready for XHTML but so that you don't have to remember the rules governing when you can omit quotes and tags.

    That said, one thing that does trip people up is the use of the THEAD and TBODY elements. In HTML they are required but their tags are not. If you omit the tags then the browser inserts a TBODY element anyway. You only notice it, though, when you are tinkering with the document using JavaScript and sometimes in your CSS. XHTML doesn't have optional tags so if you omit the tags you have omitted the element and you end up with a different document when the document is parsed as HTML instead of XHTML.
    “The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”
    —Tim Berners-Lee, W3C Director and inventor of the World Wide Web

  6. #6
    Join Date
    Mar 2007
    Location
    Las Vegas, NV
    Posts
    45
    Thank you everyone for your posts. I've switched to XHTML 1.0 Strict and am now 'editing for compliance'. It's been years since I've done any page development and it's changed a bit. Is xhtml a good choice right now in regards to page longevity?

    TIA,
    Barrie

  7. #7
    Join Date
    Nov 2002
    Location
    Baltimore, Maryland
    Posts
    12,278
    Quote Originally Posted by BarrieHie View Post
    Is xhtml a good choice right now in regards to page longevity?
    No, XHTML is for something other than web pages. You can use it for that but you really have to know HTML and you really have to know XML to use it that way. And you must read, mark, learn and inwardly digest Appendix C to the XHTML 1.0 specification.

    For web pages, use HTML 4.01 strict. That'll give you the most supported version and should work for the next hundred years or so.
    “The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”
    —Tim Berners-Lee, W3C Director and inventor of the World Wide Web

  8. #8
    Join Date
    Mar 2007
    Location
    Las Vegas, NV
    Posts
    45
    Quote Originally Posted by Charles View Post
    No, XHTML is for something other than web pages. You can use it for that but you really have to know HTML and you really have to know XML to use it that way. And you must read, mark, learn and inwardly digest Appendix C to the XHTML 1.0 specification.

    For web pages, use HTML 4.01 strict. That'll give you the most supported version and should work for the next hundred years or so.
    Okay, thank you! (getting a vim workout... )

    Barrie

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles