...

View Full Version : character data not allowed here w3 validation error



help_missa
02-18-2011, 04:39 AM
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:



<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.

VIPStephan
02-18-2011, 10:51 AM
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.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum