tags:

views:

18

answers:

2

Hi,

I created a c++ program that parses a file and dumps some data into a html file. The output is as follows:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt;
<html>
<head><title>Block 0xa8</title></head>
<body>
<h1>Block 0xa8</h1>
<table>
    <tr>
        <td>02        </td>
        <td>00        </td>
        <td>00        </td>
        <td>00        </td>
        <td>00        </td>
        <td>00        </td>
        <td>00        </td>
        <td>00        </td>
        <td>b0        </td>
        <td>75        </td>
        <td>05        </td>
        <td>00        </td>
        <td>00        </td>
        <td>00        </td>
        <td>00        </td>
        <td>00        </td>
        <td><td>  </td>.        </td>
        <td>.        </td>
        <td>.        </td>
        <td>.        </td>
        <td>.        </td>
        <td>.        </td>
        <td>.        </td>
        <td>.        </td>
        <td>.        </td>
        <td>u        </td>
        <td>.        </td>
        <td>.        </td>
        <td>.        </td>
        <td>.        </td>
        <td>.        </td>
        <td>.        </td>
    </tr>
</table>
</body>
</html>

If you open this page with a browser, you'll see one single dot before the table. This dot is a random character and it appears for each row. I don't want this character - how can I get rid of it? What am I doing wrong? (Tested with FF, IE, Chrome).

Thank you for your help, Tobias

+2  A: 

Because you have a syntax error (<td>s cannot be directly nested):

<td>00        </td>
<td><td>  </td>.        </td>      // <-- here
<td>.        </td>

The DOM parser corrects this and puts the dot before the table because it does not know where to put it ;)

Check your C++ application and fix this.

Felix Kling
thx, I was blind.
Tobias Langner
A: 

You have a unmatched tags in this line:

<td><td>  </td>.        </td>

You should change it to read:

<td></td>  <td>.        </td>

There is probably a bug in your parser that doesn't take into account for nil values.

sosborn