Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Feb 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question character data not allowed here w3 validation error

    This is appearing is some <td> elements of a table and not others. There are nested elements within the <td> tags, I've spent hours and I am baffled!
    here is my code:

    Code:
    <table id="thumbnails">
    		<tr class="vertical">
    		
    			<td> <a href="#" onmouseover="showImg('cheese','roll')"   ondblclick="hideImg()"><img src="images/thumb_cheese.jpg" alt="thumbnail_cheese"/></a></td>
    			<td><a href="#" onmouseover="showImg('sampler','roll')"  ondblclick="hideImg()"><img src="images/thumb_sampler.jpg" alt="beer_sampler"/></a></td>
    ***********<td><a href="#" onmouseover="showImg('ribs','roll')"  ondblclick="hideImg()"><img src="images/thumb_ribs.jpg" alt="ribsr"/></a></td>
    			<td><a href="#" onmouseover="showImg('cocktails','roll')"  ondblclick="hideImg()"><img src="images/thumb_cocktails.jpg" alt="thumbnail cocktails"/></a></td>
    			<td><a href="#" onmouseover="showImg('paella','roll')"  ondblclick="hideImg()"><img src="images/thumb_paella.jpg" alt="thumbnail paella"/></a></td>
    			</tr>
    			<tr class="horizontal">
    			<td><a href="#" onmouseover="showImg('wine','roll')"  ondblclick="hideImg()"><img src="images/thumb_wine.jpg" alt="thumbnail wine"/></a></td>
    			<td><a href="#" onmouseover="showImg('ceasar','roll')"  ondblclick="hideImg()"><img src="images/thumb_ceasar.jpg" alt="thumbnail ceasar"/></a></td>
    ********	<td><a href="#" onmouseover="showImg('taps','roll')"  ondblclick="hideImg()"><img src="images/thumb_taps.jpg" alt="thumbnail taps"/></a></td>
    			<td><a href="#" onmouseover="showImg('steak','roll')"  ondblclick="hideImg()"><img src="images/thumb_steak.jpg" alt="thumbnail steak"/></a></td>
    ********	<td><a href="#" onmouseover="showImg('burger','roll')"  ondblclick="hideImg()"><img src="images/thumb_burger.jpg" alt="thumbnail burger"/></a></td>
    			</tr>
    			<tr class="vertical">
    ********	<td><a href="#" onmouseover="showImg('hanna','roll')"  ondblclick="hideImg()"><img src="images/thumb_hanna.jpg" alt="thumbnail wine girl"/></a></td>
    			<td><a href="#" onmouseover="showImg('martini','roll')"  ondblclick="hideImg()"><img src="images/thumb_martini.jpg" alt="thumbnail martini"/></a></td>
    			<td><a href="#" onmouseover="showImg('mussels','roll')"  ondblclick="hideImg()"><img src="images/thumb_mussels.jpg" alt="thumbnail mussels"/></a></td>
    			<td><a href="#" onmouseover="showImg('liquor','roll')"  ondblclick="hideImg()"><img src="images/thumb_liquor.jpg" alt="thumbnail liquor"/></a></td>
    ********	<td><a href="#" onmouseover="showImg('shaker_pour','roll')"  ondblclick="hideImg()"><img src="images/thumb_shaker_pour.jpg" alt="thumbnail pour martini"/></a></td>
    *******	</tr>
    			</table>
    and here is the w3 validation errors:
    Validation Output: 6 Errors

    1. Error Line 204, Column 1: character data is not allowed here

    <td><a href="#" onmouseover="showImg('ribs','roll')" ondblclick="hi…



    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), or
    * using XHTML-style self-closing tags (such as <meta ... />) in HTML 4.01 or earlier. To fix, remove the extra slash ('/') character. For more information about the reasons for this, see Empty elements in SGML, HTML, XML, and XHTML.
    2. Error Line 211, Column 1: character data is not allowed here

    <td><a href="#" onmouseover="showImg('taps','roll')" ondblclick="hide…



    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), or
    * using XHTML-style self-closing tags (such as <meta ... />) in HTML 4.01 or earlier. To fix, remove the extra slash ('/') character. For more information about the reasons for this, see Empty elements in SGML, HTML, XML, and XHTML.
    3. Error Line 213, Column 1: character data is not allowed here

    <td><a href="#" onmouseover="showImg('burger','roll')" ondblclick="hi…



    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), or
    * using XHTML-style self-closing tags (such as <meta ... />) in HTML 4.01 or earlier. To fix, remove the extra slash ('/') character. For more information about the reasons for this, see Empty elements in SGML, HTML, XML, and XHTML.
    4. Error Line 216, Column 1: character data is not allowed here

    <td><a href="#" onmouseover="showImg('hanna','roll')" ondblclick="hid…



    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), or
    * using XHTML-style self-closing tags (such as <meta ... />) in HTML 4.01 or earlier. To fix, remove the extra slash ('/') character. For more information about the reasons for this, see Empty elements in SGML, HTML, XML, and XHTML.
    5. Error Line 220, Column 1: character data is not allowed here

    <td><a href="#" onmouseover="showImg('shaker_pour','roll')" ondblclic…



    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), or
    * using XHTML-style self-closing tags (such as <meta ... />) in HTML 4.01 or earlier. To fix, remove the extra slash ('/') character. For more information about the reasons for this, see Empty elements in SGML, HTML, XML, and XHTML.
    6. Error Line 221, Column 1: character data is not allowed here

    </tr>



    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), or
    * using XHTML-style self-closing tags (such as <meta ... />) in HTML 4.01 or earlier. To fix, remove the extra slash ('/') character. For more information about the reasons for this, see Empty elements in SGML, HTML, XML, and XHTML.
    Attached Thumbnails Attached Thumbnails character data not allowed here w3 validation error-screen-shot-2011-02-17-8.36.30-pm.jpg  
    Attached Files Attached Files

  • #2
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,479
    Thanks
    6
    Thanked 981 Times in 954 Posts
    There are some obscure hidden characters in the beginnings of the lines the validator is complaining about. In fact, it’s exactly these lines with the asterisk characters in the code you posted above. Remove the whitespace (or whatever it is) up until the previous element and then start a new line and use tab stops only to indent the code.


  •  

    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
    •