I'm reading in an XML file from the server using
XmlTextReader in C# like so:
XmlTextReader xr = new XmlTextReader(url);
while(xr.Read())
{
//parse the xml file here
}
Now then, I need to also save this file to the local file
system and I should be able to do this at the same time
I'm reading the file with XmlTextReader, right?
I figured I don't really need to use XMLTextWriter since
the file is already in XML format, so I tried StreamWriter
and then tried to write the file in the while loop one line at
a time using 'streamwriter.write(xr.Name)' but that's not quite
right.
Thing is, how do I write a whole line of XML back to the file?
Is there a better way to do this that I'm not thinking of?
Thanks,
Drew