Hidden characters (linebreak) in string?

Joined
Apr 23, 2008
Messages
1
Reaction score
0
I have the following problem.

Some misc info about the project:
I send a request to one of our customer's webservice, which replies me with an XML document. Using this XML document i generate a simple report. This report is generated in HTML, we have chosen not to use crystal reports and the likes due to performance decrease and because the report that has to be shown is so simple it's as easy to generate it in HTML myself.

now for the problem
I receive an XML file from one of our customers webservice.
Within this xml file i receive from the webservice i send my request to, I have a section with the following:

<comment>20-03-2008
Issue 12345 handled
Issue 12345 closed

28-03-2008
Issue 12345 handled
Issue 12345 closed
</comment>

Now i generate some sort of report, in HTML.

I read the <comment> tag into a string.
I use the string in my report, and that’s where the misery starts. The HTML gives an error and can’t show.

When i view the source, i see the following(line containing the error is red)

<table>
<tr>
<td>20-03-2008
Issue 12345 handled
Issue 12345 closed

28-03-2008
Issue 12345 handled
Issue 12345 closed
</td>
</tr>
</table>

When i test with parts of the string, the error always seems to occur at the place where in the original XML file had a linebreak.
After some testing and debugging, I found out, that the error is likely because of hidden linebreaks in the string. When I look at the string when debugging, it just shows as a normal linear string, no weird chars.
However when I copy the string and paste it in word for example, it suddenly shows the text with the linebreaks as it was in the xml comment. If for example I copy the string manually while debugging and make a variable, which I then paste the string in, and use this string as the source for the HTML, then it does not give an error (although when comparing the string textually, it is the exact same thing).

My problem is, that it would be fine for me to either remove the hidden linebreaks, or to alter the string so that it does show in HTML without errors.
I tried everything I could think of, looked for vbClRf etc but I just can’t find what causes the linebreaks in the first place, let alone how to remove it.
Other then that I don’t really have any clue atm, since the linebreaks don’t show visually appear in my string (i can not syntaxicly see them nor have i been able to see them by converting to whatever i came up with).

Any help appreciated is greatly appreciated.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,992
Messages
2,570,220
Members
46,807
Latest member
ryef

Latest Threads

Top