User entered data in XML

N

nobody

I'm writing data the user enters out to an XML file (using DataSet.WriteXML;
DataSet is a typed DataSet created from an XML Schema). The problem I'm
having is the user can (and needs to) enter characters like &, < and >. Is
there some .NET function (maybe something in System.Xml) that will take a
string and format it for output to an xml file (such as change all &'s to
&amp;, etc.)? I'd hate to have to do String.Replace("&",
"&amp;").Replace(...).Replace(...) all the fields manually, but if that's my
only alternative...
 
N

nobody

Nevermind, I just realized that DataSet.WriteXml(...) does the conversions
from & to &amp;, etc. already. I must have manualy edited the .xml in
notepad and added the &. Doh!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top