M
Mike
I found some code that writes text entries to an XML file. Part of the logic
includes a call to a method that processes every single character prior to
being written out to the XML file (see the code below). I'm just wondering
what the benefit is of making the substitutions made by this logic.
switch(c) {
case ">":
s += @">";
break;
case "<":
s += @"<";
break;
case "\"":
s += @""";
break;
case "'":
s += @"&apos";
break;
default:
s += c;
break;
}
return s;
includes a call to a method that processes every single character prior to
being written out to the XML file (see the code below). I'm just wondering
what the benefit is of making the substitutions made by this logic.
switch(c) {
case ">":
s += @">";
break;
case "<":
s += @"<";
break;
case "\"":
s += @""";
break;
case "'":
s += @"&apos";
break;
default:
s += c;
break;
}
return s;