views:

185

answers:

2

For an XML file I am creating I have data that contains a bullet • what is the best method for handling this in xml data? It opens in an XML editor and reads fine, but I cannot import the file via SSIS, I get an error regarding this point.

<xmldata>• Bullet</xmldata>

Renders fine, but cannot import with SSIS.

+1  A: 

Escape it:

&#8226;
Yuval A
-1: that's not a valid entity for XML.
John Saunders
oops... fixed...
Yuval A
A: 

The data you have received is not well-formed XML. It may have < and > in it, but it is not XML. The program that generated it is broken and needs to be fixed.

In particular, is the bullet the only character that will cause you problems? A program that puts one garbage character into your "XML" will likely put others in, since it doesn't seem to know what valid XML looks like.

John Saunders
You are right there could be other garbage characters, I am writing the file via SSIS is there a good way to parse through a file to remove invalid characters or escape them via SSIS, maybe using a script task?
@dbengals: you could do that sort of thing, but it doesn't address the problem: why is the source program sending you that garbage? Maybe it thinks it's sending good data? Maybe the data actually means something? You need to try to find out what the garbage means before escaping or removing it.
John Saunders