Michael - 2006-08-12

Logged In: YES
user_id=1574489

TextBuilder.BuildTextCollection does also throw an exception.
Do something like this:

string xmlStartTag = "<?xml version=\"1.0\"
encoding=\"UTF-8\" ?>";
ITextCollection txtCollection = new ITextCollection();
text = WhiteSpaceHelper.GetWhiteSpaceXml(text);
text = XXX.ReplaceXmlEntityChars(text);
text = text.Replace("\t", "<t/>");
text = text.Replace("\n", "<n/>");
xmlStartTag += "<txt>"+text+"</txt>";

where XXX is a helper class and the method could look like this:

public static string ReplaceXmlEntityChars(string text)
{
text = text.Replace("&", "&amp;");
text = text.Replace("\"", "&quot;");
text = text.Replace("'", "&apos;");
text = text.Replace("<", "&lt;");
text = text.Replace(">", "&gt;");
return text;
}