Hi,
Let's say I have a file named myFile.xml
Within that file I have blocks of data which I'd like to add at different
times during the day.
e.g.
<LogEntry>
<Stuffstuff here </Stuff>
<LogEntryDate>d ate time here</LogEntryDate>
</LogEntry>
....
<LogEntry>
<Stuffstuff here </Stuff>
<LogEntryDate>d ate time here</LogEntryDate>
</LogEntry>
Now, I'd like to use XMLSerializatio n, but when appending I get the <xml...>
line which I don't want after the first entry.
<?xml version="1.0" encoding="utf-8"?>
Is there a way to use XMLSerializer so that when appending, this line is not
added?
Here is my current code, which creates the file if it doesn't exist,
otherwise appends the next chunk of xml.
XmlSerializer ser = new XmlSerializer(t ypeof(MyClass)) ;
bool bAppend = true;
TextWriter writer = new StreamWriter(st rUsageLogFileNa me, bAppend );
ser.Serialize(w riter, this);
writer.Close();
Thanks for any tips,
Frank