L
Le Thien Hoang
Guest
Currently, I got a problem with text in XML.
private readonly string htmlTemplate = "<![CDATA[{0}]]>";
string abc = string.Format(htmlTemplate,classsificationDetailItem.Description.Replace(@"•", string.Empty)
.Replace(@"<", "<")
.Replace(@">", ">")
.Replace(@"≤", "≤")
.Replace(@"≤", "≤")
.Replace(@"≥", "≥"))
string docText = null;
using (StreamReader sr = new StreamReader(wordDoc.MainDocumentPart.GetStream()))
{
docText = sr.ReadToEnd();
}
docText = docText.Replace("special symbol", abc);
using (StreamWriter sw = new StreamWriter(wordDoc.MainDocumentPart.GetStream(FileMode.Create)))
{
sw.Write(docText);
}
In class, I parse a text to XML and download it but it's incorrect. The text still display as the example is bellow
3 < 4 ≤
.....";
I want to break a line and set special symbols to string and parse them to XML.
Continue reading...
private readonly string htmlTemplate = "<![CDATA[{0}]]>";
string abc = string.Format(htmlTemplate,classsificationDetailItem.Description.Replace(@"•", string.Empty)
.Replace(@"<", "<")
.Replace(@">", ">")
.Replace(@"≤", "≤")
.Replace(@"≤", "≤")
.Replace(@"≥", "≥"))
string docText = null;
using (StreamReader sr = new StreamReader(wordDoc.MainDocumentPart.GetStream()))
{
docText = sr.ReadToEnd();
}
docText = docText.Replace("special symbol", abc);
using (StreamWriter sw = new StreamWriter(wordDoc.MainDocumentPart.GetStream(FileMode.Create)))
{
sw.Write(docText);
}
In class, I parse a text to XML and download it but it's incorrect. The text still display as the example is bellow
3 < 4 ≤
.....";
I want to break a line and set special symbols to string and parse them to XML.
Continue reading...