SitePoint Sponsor

User Tag List

Results 1 to 13 of 13
  1. #1
    SitePoint Enthusiast
    Join Date
    May 2006
    Posts
    34
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    how can i specify SHORTTAG YES ??

    Hi.

    I get this error from the validator :
    Code:
    Line 26 column 112: an attribute value specification must be an attribute value literal unless SHORTTAG YES is specified.
    ..."><tr><td valign="top"><table border=0 width=100% cellspacing=0 cellpadding=0...
    I know i should have something like this " border='0' ", but i would prefer to leave the numeric values as is. How can this be done ? Is there a way to specify SHORTTAG YES somewhere in the document, and after that not to deal with this issue ?

    Many thanks in advance.

  2. #2
    bronze trophy
    Join Date
    Dec 2004
    Location
    Sweden
    Posts
    2,670
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Use this doctype:
    HTML Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
    Simon Pieters

  3. #3
    CSS & JS/DOM Adept bronze trophy
    Join Date
    Mar 2005
    Location
    USA
    Posts
    5,482
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It's a badly written error message.

    You have two choices: either switch to HTML 4.01 (there's nothing wrong in doing that) or make your code be valid X(HT)ML. (Technically there's a third choice, but doing so is very bad for the health of the web. If you choose to use XHTML, you must write valid code.)

    Edit: Simon, why do you recommend a doctype that doesn't include a URL?
    We miss you, Dan Schulz.
    Learn CSS. | X/HTML Validator | CSS validator
    Dynamic Site Solutions
    Code for Firefox, Chrome, Safari, & Opera, then add fixes for IE, not vice versa.

  4. #4
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,159
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    SHORTTAG YES is declared in the SGML declaration for HTML (but not for XML). It is not something you can change.

    In XHTML, all attribute values must be quoted.
    In HTML, you may omit the quotation marks provided that your attribute value contains only letters (A-Z), digits, hypens, underscords, colons and periods.

    Since the width attribute has the value 100&#37;, it must be quoted even in HTML.
    Birnam wood is come to Dunsinane

  5. #5
    SitePoint Enthusiast
    Join Date
    May 2006
    Posts
    34
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks for the replies. I changed the DOCTYPE to html 4.01. I have to make valid html for a huge site with hundreds of files, and lots of errors(often the values ar not quoted). Are there any programs that are meant to do this automatically from php sources?

  6. #6
    bronze trophy
    Join Date
    Dec 2004
    Location
    Sweden
    Posts
    2,670
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Kravvitz View Post
    Edit: Simon, why do you recommend a doctype that doesn't include a URL?
    Because it's shorter and does the same thing.
    Simon Pieters

  7. #7
    CSS & JS/DOM Adept bronze trophy
    Join Date
    Mar 2005
    Location
    USA
    Posts
    5,482
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by zcorpan View Post
    Because it's shorter and does the same thing.
    It doesn't trigger standards mode in IE5/Mac though.

    By the way, have you read "Designing with Web Standards"? It seems that Zeldman is wrong about some of the things he said regarding DOCTYPEs.
    We miss you, Dan Schulz.
    Learn CSS. | X/HTML Validator | CSS validator
    Dynamic Site Solutions
    Code for Firefox, Chrome, Safari, & Opera, then add fixes for IE, not vice versa.

  8. #8
    bronze trophy
    Join Date
    Dec 2004
    Location
    Sweden
    Posts
    2,670
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Kravvitz View Post
    It doesn't trigger standards mode in IE5/Mac though.
    You're right. That's a bug in IE5/Mac. Who cares?

    Off Topic:

    Quote Originally Posted by Kravvitz View Post
    By the way, have you read "Designing with Web Standards"?
    Nope.
    Quote Originally Posted by Kravvitz View Post
    It seems that Zeldman is wrong about some of the things he said regarding DOCTYPEs.
    I've read the ALA article he wrote, which isn't very accurate. What did he say about them in the book?
    Simon Pieters

  9. #9
    In memoriam gold trophysilver trophybronze trophy Dan Schulz's Avatar
    Join Date
    May 2006
    Location
    Aurora, Illinois
    Posts
    15,495
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Tell that to IE 6 when it whines about the lack of a link and starts throwing a temper tantrum (quirks mode).

  10. #10
    bronze trophy
    Join Date
    Dec 2004
    Location
    Sweden
    Posts
    2,670
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Dan Schulz View Post
    Tell that to IE 6 when it whines about the lack of a link and starts throwing a temper tantrum (quirks mode).
    Yeah. Doctypes don't have links for starters.
    Simon Pieters

  11. #11
    CSS & JS/DOM Adept bronze trophy
    Join Date
    Mar 2005
    Location
    USA
    Posts
    5,482
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Dan probably meant a URL.

    Quote Originally Posted by zcorpan View Post
    You're right. That's a bug in IE5/Mac. Who cares?
    Unfortunately, I still do some projects where I am asked support IE5/Mac, so I have to care.

    Off Topic:

    Quote Originally Posted by zcorpan
    Nope. I've read the ALA article he wrote, which isn't very accurate. What did he say about them in the book?
    This is from the second edition, page 279.
    Quote Originally Posted by Zeldman
    As mentioned earlier, some complete HTML DOCTYPEs also trigger Standards mode. For instance, IE toggles into Standards mode (and 21st century Gecko-based browsers toggle into Almost Standards mode) in the presence of a complete HTML 4.01 Strict DOCTYPE.
    He also pushes XHTML a lot and makes HTML sound outdated. He barely mentions the whole mime-type issue.
    We miss you, Dan Schulz.
    Learn CSS. | X/HTML Validator | CSS validator
    Dynamic Site Solutions
    Code for Firefox, Chrome, Safari, & Opera, then add fixes for IE, not vice versa.

  12. #12
    In memoriam gold trophysilver trophybronze trophy Dan Schulz's Avatar
    Join Date
    May 2006
    Location
    Aurora, Illinois
    Posts
    15,495
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yup. I was using "plain conversational language" for once .

  13. #13
    bronze trophy
    Join Date
    Dec 2004
    Location
    Sweden
    Posts
    2,670
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    But lack of a "link" doesn't put IE6 into quirks mode, unless you use a known legacy public identifier, such as e.g. HTML 4.01 Transitional. The doctype in #2 does indeed trigger standards mode in IE6.
    Simon Pieters


Bookmarks

Posting Permissions

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