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:

< &lt;  > &gt; & &amp; 

if allowed, destroy xml. if need add tags, cannot use serializer. need build document using code example form xmldocument class


Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

java - Using an Integer ArrayList in Android -