Re: Whats an efficient way of insertring elements into an XML document
- From: Jon Skeet [C# MVP] <skeet@xxxxxxxxx>
- Date: Mon, 10 Oct 2005 19:49:27 +0100
Nick Z. <pacemkr@xxxxxxxxx> wrote:
> But if the file is several megabytes, doesn't that mean that calling
> XmlDocument.Load() will load all that into memory each time you open
> the document, and then parse all of the data and build an in memory
> representation of the whole file. Thats seems incredibly inefficient in
> performance critical situation.
How often are you expecting to need to insert elements into the
document? Have you considered using a format other than XML? XML really
isn't terribly friendly when it comes to appending.
Alternatively, consider having a file which contains *multiple* XML
documents, and a class which can build them up into a single one. You
could then combine the "fragments" every so often to restore it to a
proper XML file.
--
Jon Skeet - <skeet@xxxxxxxxx>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
.
- Follow-Ups:
- Re: Whats an efficient way of insertring elements into an XML document
- From: ernesto bascón pantoja
- Re: Whats an efficient way of insertring elements into an XML document
- References:
- Prev by Date: Re: Visual Studio .net failure to store to database
- Next by Date: Re: Whats an efficient way of insertring elements into an XML document
- Previous by thread: Whats an efficient way of insertring elements into an XML document
- Next by thread: Re: Whats an efficient way of insertring elements into an XML document
- Index(es):
Relevant Pages
|