PDA

View Full Version : problem writing an xml file



mickey
21st January 2008, 00:58
Hi, I'm coding a like xml tree to write to a file. I'm using C# I'll hope you can help me.
The Code:


..........................................
myClass.Xml_doc.AppendChild(xml_root);
XmlTextWriter xmlW = new XmlTextWriter("..\\..\\output.html", null);
xmlW.Formatting = Formatting.Indented;
myClass.Xml_doc.WriteContentTo(xmlW);
xmlW.Close();

The problem is output.html: intead of '<' and '>' there are '&lt;' and '&gt;'.
How Can I solve it, please?
Thanks
EDIT ---
the problem is that in a method, I have a string like: <script .......> </script> and ohter tags. Then, in my xml_doc, I attach that string as part of innerTEXT of a tag; I hope you'l understand where the point is.

jacek
28th January 2008, 16:05
It looks like you are adding the tags as text, not as XML snippet.