Click here to Skip to main content
16,019,055 members
Home / Discussions / C#
   

C#

 
Questioncomputer name to IP address Pin
marwan_siala2-Apr-07 9:52
marwan_siala2-Apr-07 9:52 
AnswerRe: computer name to IP address Pin
stancrm2-Apr-07 19:44
stancrm2-Apr-07 19:44 
QuestionOpening UNKNOWN filename? Pin
Goalie352-Apr-07 9:18
Goalie352-Apr-07 9:18 
AnswerRe: Opening UNKNOWN filename? Pin
Christian Graus2-Apr-07 10:01
protectorChristian Graus2-Apr-07 10:01 
AnswerRe: Opening UNKNOWN filename? Pin
engsrini2-Apr-07 13:20
engsrini2-Apr-07 13:20 
QuestionPulling info from arrays Pin
JMOdom2-Apr-07 8:57
JMOdom2-Apr-07 8:57 
AnswerRe: Pulling info from arrays [modified] Pin
Christian Graus2-Apr-07 10:11
protectorChristian Graus2-Apr-07 10:11 
QuestionHow to remove comment from XML string Pin
AndrusM2-Apr-07 8:05
AndrusM2-Apr-07 8:05 
I need to remove all comments ( between tags) from XML string.
I tried the following code but comments are still present.
How to remove comments ?

string RemoveComments(string sDoc) {
XmlDocument xDoc = new XmlDocument();
xDoc.PreserveWhitespace = false;
xDoc.LoadXml(sDoc);
StringWriter sw = new StringWriter();
XmlTextWriter xtw = new XmlTextWriter(sw);
xtw.IndentChar = ' ';
xtw.Indentation = 2;
xtw.Formatting = Formatting.Indented;
xDoc.WriteContentTo(xtw);
xtw.Close();
sw.Close();
return sw.ToString();
}


Andrus

AnswerRe: How to remove comment from XML string Pin
Not Active2-Apr-07 8:26
mentorNot Active2-Apr-07 8:26 
GeneralRe: How to remove comment from XML string Pin
AndrusM2-Apr-07 9:47
AndrusM2-Apr-07 9:47 
AnswerRe: How to remove comment from XML string Pin
blackjack21502-Apr-07 21:09
blackjack21502-Apr-07 21:09 
GeneralRe: How to remove comment from XML string Pin
AndrusM3-Apr-07 8:49
AndrusM3-Apr-07 8:49 
GeneralRe: How to remove comment from XML string Pin
blackjack21503-Apr-07 21:00
blackjack21503-Apr-07 21:00 
GeneralRe: How to remove comment from XML string Pin
AndrusM4-Apr-07 1:03
AndrusM4-Apr-07 1:03 
GeneralRe: How to remove comment from XML string Pin
AndrusM4-Apr-07 1:13
AndrusM4-Apr-07 1:13 
QuestionFilter a Large Datagrid Pin
Brad Wick2-Apr-07 7:50
Brad Wick2-Apr-07 7:50 
AnswerRe: Filter a Large Datagrid Pin
kubben2-Apr-07 8:30
kubben2-Apr-07 8:30 
GeneralRe: Filter a Large Datagrid Pin
Brad Wick2-Apr-07 12:35
Brad Wick2-Apr-07 12:35 
QuestionDeployment Visual Studio 2005 Error Pin
laura13162-Apr-07 7:30
laura13162-Apr-07 7:30 
Questiontesting of Stored Procedure Pin
sreecahitu2-Apr-07 6:53
sreecahitu2-Apr-07 6:53 
AnswerRe: testing of Stored Procedure Pin
Colin Angus Mackay2-Apr-07 7:15
Colin Angus Mackay2-Apr-07 7:15 
QuestionHow to draw a Horizantal line in WindowsApp Pin
pashitech2-Apr-07 6:23
pashitech2-Apr-07 6:23 
AnswerRe: How to draw a Horizantal line in WindowsApp Pin
maryamf2-Apr-07 9:06
maryamf2-Apr-07 9:06 
QuestionComboBox and BindingSource Pin
mihksoft2-Apr-07 6:15
mihksoft2-Apr-07 6:15 
QuestionLimit number of copies of application to 1 Pin
polishprogrammer2-Apr-07 6:11
polishprogrammer2-Apr-07 6:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.