XML appending?

Results 1 to 2 of 2

Thread: XML appending?

  1. #1
    Join Date
    Dec 1969

    Default XML appending?

    Here&#039;s my situation. I&#039;m writing what will eventually be a very large xml file, and I&#039;m trying to figure out a way to append to it. I came about with a way that works, but it doesn&#039;t keep the XML well formed, due to the closing root tag. IE, the first time it works, but when I append it, it doesn&#039;t.<BR><BR>How should I go about making this work right? I figured one way would be to first read the file, assign all the data, and then re-output it, overwriting the file. But as the size of this thing grows, performance will probably suffer.<BR><BR>It seems the simplist thing would be to go in, remove the closing root tag, append my new elements, and then re-add the closing root tag. But I am not sure how to do this. Some sort of search and delete functionality, I guess.<BR><BR>Any suggestions?

  2. #2
    Join Date
    Dec 1969

    Default RE: XML appending?

    Use the XmlDocument Class:<BR><BR>1. Load file<BR>2. Select root node<BR>3. Append new node to root node<BR>4. Save File<BR>5. Close File

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts