SitePoint Sponsor

User Tag List

Results 1 to 12 of 12
  1. #1
    SitePoint Addict
    Join Date
    Apr 2004
    Location
    Belgian in Mexico
    Posts
    307
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    validation issue (HTML 4.01 Strict)

    I want to validate a webpage I've just created, and the only reason it won't validate is this:
    Error Line 5 column 76: character data is not allowed here.
    ...ype" content="text/html; charset=utf-8" />

    You have used character data somewhere it is not permitted to appear. Mistakes that can cause this error include putting text directly in the body of the document without wrapping it in a container element (such as a <p>aragraph</p>) or forgetting to quote an attribute value (where characters such as "%" and "/" are common, but cannot appear without surrounding quotes).
    The marked character is the ">" at the end of the line. There is no content whatsoever inside the body that doesn't have a container element, so I don't understand what's the problem.

    Hope someone can help me.

    MichaŽl
    MichaŽl Niessen
    http://assemblysys.com
    (Countries/states/cities with latitude & longitude,
    weathercodes & topical databases)

  2. #2
    Brevity is greatly overrated brandaggio's Avatar
    Join Date
    Dec 2005
    Posts
    1,424
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you want us to troubleshoot your code please post the full, complete page code and/or a link - It can only be guessed at from what you have provided.

  3. #3
    ¨.¨ shoooo... silver trophy logic_earth's Avatar
    Join Date
    Oct 2005
    Location
    CA
    Posts
    9,013
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    " />" = XHTML not HTML
    " >" = HTML not XHTML
    Logic without the fatal effects.
    All code snippets are licensed under WTFPL.


  4. #4
    SitePoint Addict
    Join Date
    Apr 2004
    Location
    Belgian in Mexico
    Posts
    307
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nevermind, I found the mistake. I had to remove the / at the closing of each meta tag. It now validates.

    MichaŽl
    MichaŽl Niessen
    http://assemblysys.com
    (Countries/states/cities with latitude & longitude,
    weathercodes & topical databases)

  5. #5
    SitePoint Addict
    Join Date
    Apr 2004
    Location
    Belgian in Mexico
    Posts
    307
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank, logic_earth. I hadn't seen your post yet when I posted my previous message.
    MichaŽl Niessen
    http://assemblysys.com
    (Countries/states/cities with latitude & longitude,
    weathercodes & topical databases)

  6. #6
    Brevity is greatly overrated brandaggio's Avatar
    Join Date
    Dec 2005
    Posts
    1,424
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by mniessen
    Nevermind, I found the mistake. I had to remove the / at the closing of each meta tag. It now validates.

    MichaŽl
    The joys of going back and forth between XHTML and HTML eh?! Makes me wish the XHTML bandwagon had never started (or XHTML was HTML and that HTML never really was).

    Glad you fixed it .

  7. #7
    SitePoint Addict
    Join Date
    Apr 2004
    Location
    Belgian in Mexico
    Posts
    307
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by John Wozniak
    The joys of going back and forth between XHTML and HTML eh?! Makes me wish the XHTML bandwagon had never started (or XHTML was HTML and that HTML never really was).

    Glad you fixed it .
    The thing that confused me a little (and why I didn't spot the "error" right away and had to start this thread), is that there are a few <br /> and <input type='text' name='name' /> in the page, and yet the validator (http://validator.w3.org/) doesn't say anything about them.

    MichaŽl
    MichaŽl Niessen
    http://assemblysys.com
    (Countries/states/cities with latitude & longitude,
    weathercodes & topical databases)

  8. #8
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,159
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    When you use <tag/> in HTML, it is equal to <tag>&#38;gt;, i.e., the tag, followed by a greater-than sign.

    If you use <br/> somewhere in BODY, it's perfectly valid. It's a break tag followed by a greater-than sign (although all browsers parse it incorrectly).

    In the HEAD, however, <meta.../> will be invalid, because you're not allowed to sprinkle greater-than signs inside HEAD. The HEAD element can only contain a few element types; not text.
    Birnam wood is come to Dunsinane

  9. #9
    SitePoint Wizard bronze trophy DaveWoods's Avatar
    Join Date
    Dec 2004
    Location
    Derbyshire - UK
    Posts
    2,651
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    In that case would

    <br /

    pass HTML validation? Obviously if the browsers parse this incorrectly then there would obviously be little point in doing this but the question helps to serve my curiosity

  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 csswiz
    In that case would

    <br /

    pass HTML validation?
    Yes. So would this:
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
     -- this is a >cool< comment --
     [ <!-- another comment --> ]>
    <title/my funky title/
    <p<button button/button/
    <>This is actually a paragraph.</>
    Simon Pieters

  11. #11
    Brevity is greatly overrated brandaggio's Avatar
    Join Date
    Dec 2005
    Posts
    1,424
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by zcorpan
    Yes. So would this:
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
     -- this is a >cool< comment --
     [ <!-- another comment --> ]>
    <title/my funky title/
    <p<button button/button/
    <>This is actually a paragraph.</>
    Oh my - that is pretty funny.

  12. #12
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,159
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Good luck finding a browser that supports that sort of minimisation, though.
    Birnam wood is come to Dunsinane


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
  •