I have the following code:
MemoryStream ms = new MemoryStream(); XmlWriter w = XmlWriter.Create(ms); w.WriteStartDocument(true); w.WriteStartElement("data"); w.WriteElementString("child", "myvalue"); w.WriteEndElement();
XML is generated correctly; however my problem is the first character of the string "test": ï (char # 239), which makes it invalid for some xml parsers: where does this come from? What am I doing wrong?
I know that I can solve the problem simply by starting with the first character, but I would rather find out why it is there and not just fix the problem.
Thanks!
John
source share