SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Enthusiast
    Join Date
    Sep 2006
    Posts
    27
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    XHMTL 1.0 Strict Validation Problem

    I'm trying to validate http://www.afltraining.co.uk/css-v1/contactus.htm but get the following error on several lines.

    Error Line 38 column 15: an attribute value specification must be an attribute value literal unless SHORTTAG YES is specified.
    <input type=hidden name="_subject" value="Contact Form Enquiry" />

    How do I fix this?

    Thanks.

  2. #2
    SitePoint Enthusiast
    Join Date
    Sep 2006
    Posts
    27
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just realised what I'd done, all sorted!!

  3. #3
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yep, all attribute values must be quoted in X(HT)ML, so it should be type="hidden".

    Also, values for the name, class and id attributes must begin with a letter (A-Z or a-z), so "_subject" is not a valid name. (The validator won't catch that one.)
    Birnam wood is come to Dunsinane

  4. #4
    Robert Wellock silver trophybronze trophy xhtmlcoder's Avatar
    Join Date
    Apr 2002
    Location
    A Maze of Twisty Little Passages
    Posts
    6,316
    Mentioned
    60 Post(s)
    Tagged
    0 Thread(s)
    Please note underscore is valid for XHTML 1.0 refer to (XML 1.0 Section 2.3, production 5) so the string "_subject" can be valid - but obviously it is not recommended.

  5. #5
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The HTML 4.01 specification says,
    ID and NAME tokens must begin with a letter (&#91;A-Za-z]) and may be followed by any number of letters, digits (&#91;0-9]), hyphens ("-"), underscores ("_"), colons (":"), and periods (".").
    The XHTML 1.0 specification says the syntactic rules are the same as for HTML 4.01. I haven't found anything that says that the rules for ID and NAME are different. There's a brief mention of those attribute in section 4.10, but it doesn't say that the attribute values may start with an underscore.

    And if the XHTML markup is served as text/html, then the HTML rules will definitiely apply since it is nothing but HTML.
    Birnam wood is come to Dunsinane

  6. #6
    Robert Wellock silver trophybronze trophy xhtmlcoder's Avatar
    Join Date
    Apr 2002
    Location
    A Maze of Twisty Little Passages
    Posts
    6,316
    Mentioned
    60 Post(s)
    Tagged
    0 Thread(s)
    Yes they are different but it still cannot start with a numeric [ www.w3.org/TR/2006/REC-xml11-20060816/#dt-name ] Obviously if text/html then of course they follow HTML rules instead.


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
  •