c# - Issue writing XML using TextWriter -
i have tried writing xml using textwriter, i've discovered can't write characters < > ' " & file.
the class wrote follows:
public void write_file(rss r, string filename)//-- rss here class built in other place { xmlserializer serializer = new xmlserializer(typeof(rss)); textwriter textwriter = new streamwriter(path + filename);//-- path directory path save xml file serializer.serialize(textwriter, r); textwriter.close(); }
can me fix this?
you cannot. c# converts such chars:
< < > > & &
if allowed, destroy xml. if need add tags, cannot use serializer. need build document using code example form xmldocument class
Comments
Post a Comment