Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
XMLTextWriter closed
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Titre:
XMLTextWriter closed
Divers
Thread ID:
00862357
Message ID:
00862357
Vues:
42
Hi,

im am using a XmlTextWriter in 2 different Methods. Each of them instantiates the writer and does a writer.close() at the end.

This works pretty fine, as long as I do not call the two methods one after the other. If I do this the second witer comes up with:
"it can not be written in a closed textwriter" in line 3.

Hase anyone got an idea what I am missing. Even if I instantiate the second writer to another variable it does not help.

I do not understand why the writer I just instantiated is closed?
Thanks for any help
Marcus
1: public void WriteToXML() 
   {
2:   XmlTextWriter writer = new XmlTextWriter(Console.Out);
3:   writer.Formatting = Formatting.Indented;
4:   writer.WriteStartElement("xxx");
      ....
20:   writer.close();
   }
Marcus Alt
TRIA IT-Consulting GmbH
Working hard | for your success
Répondre
Fil
Voir

Click here to load this message in the networking platform