Appending to XML file instead of overwriting

Hello All.

There is an automatic way to save just the changes of a xml file?

For example, if add several nodes, delete some and change the value or 
attribute of another. Actually, on saving it, the Save( ) method will 
serialize the entire file again. The doubt is if this behaviour can be 
changed, making the parser keep the file and saving only the changes.

 I have a customer asking for it, but I guess it is not possible, due to XML 
way of work.
Or, am I wrong? Can someone discuss about, please? 


0
nospam7515 (2084)
11/27/2007 2:57:07 PM
dotnet.xml 7266 articles. 0 followers. Follow

2 Replies
700 Views

Similar Articles

[PageSpeed] 33

Cesar wrote:

> There is an automatic way to save just the changes of a xml file?
> 
> For example, if add several nodes, delete some and change the value or 
> attribute of another. Actually, on saving it, the Save( ) method will 
> serialize the entire file again. The doubt is if this behaviour can be 
> changed, making the parser keep the file and saving only the changes.
> 
>  I have a customer asking for it, but I guess it is not possible, due to XML 
> way of work.
> Or, am I wrong? Can someone discuss about, please? 

If you use System.Xml.XmlDocument then you are right, first the complete 
XML document is parsed and loaded, then you can do changes on the 
in-memory DOM model, finally you save the complete document back.

What you are asking for might be offered by an XML data base management 
system.

-- 

	Martin Honnen --- MVP XML
	http://JavaScript.FAQTs.com/
0
mahotrash (1778)
11/27/2007 2:10:25 PM
Thanks! That was the information I was expecting, good to know. ^^
We had to go XML because the customer won't this application access a 
database.

[]s


"Martin Honnen" <mahotrash@yahoo.de> escreveu na mensagem 
news:Oq4IG9PMIHA.5244@TK2MSFTNGP03.phx.gbl...
> Cesar wrote:
>
>> There is an automatic way to save just the changes of a xml file?
>>
>> For example, if add several nodes, delete some and change the value or 
>> attribute of another. Actually, on saving it, the Save( ) method will 
>> serialize the entire file again. The doubt is if this behaviour can be 
>> changed, making the parser keep the file and saving only the changes.
>>
>>  I have a customer asking for it, but I guess it is not possible, due to 
>> XML way of work.
>> Or, am I wrong? Can someone discuss about, please?
>
> If you use System.Xml.XmlDocument then you are right, first the complete 
> XML document is parsed and loaded, then you can do changes on the 
> in-memory DOM model, finally you save the complete document back.
>
> What you are asking for might be offered by an XML data base management 
> system.
>
> -- 
>
> Martin Honnen --- MVP XML
> http://JavaScript.FAQTs.com/ 


0
nospam7515 (2084)
11/27/2007 4:16:40 PM
Reply:

Similar Artilces:

Appending worksheets
Hello, I have a huge workbook with some 200 worksheets (Excel 2002) and wouldlike to create one single worksheet by appending the data on all worksheets one after another. Is there an easy way to do this without programming a macro? Thanks so much. Provided the total data rows do not exceed 65535 (assuming a standard top row for col labels), one way would be sequential manual copy > paste into a single new sheet placed to the left of the 200 source sheets. At an est 15 sec per manual op, 200 sheets would only take roughly an hour of work to accomplish. Thereafter, to clean up, jus...

Reading and writing an XML file
Hello folks! I have to read an XML file, add some elements and write it back. I seem to have no problem doing the first 2 things but then I get The process cannot access the file "c:/file.xml" because it is being used by another process. ... when I try to do the third thing: saving. This is how I am doing it: XmlDocument oXml=new XmlDocument(); oXml.Load(new XmlTextReader(@"c:\file.xml")); // do the element work here oXml.Save(new XmlTextWriter(@"c:\file.xml", System.Text.Encoding.ASCII)); The error occurs right at the Save call. Any of you more experien...

import file problem
I need to import a text file every 30 minutes into SQL. The text file looks like this One, two, three One, two, three One, two, three, four, five, six, seven One, two, three One, two three, One, two, three, four So you see number of columns varies. But the SQL import wizard sets up the number of columns based the very first line of the input file. So the file on SQL looks like this: Column 1 Column2 Column3 One Two Three One Two Three One Two three, four, five, six, seven One two three One two three One two three,four ...

How do I work with Excel 2007 and htm files?
I created a htm file in Excel 97-2003 and I was able to access my tables and change the information around. When I open the file in the new Excel 2007, it changes a lot of my numbers to dates and some other crazy numbers I have no idea where they come from. I've tried going to excel options and turning off automatic calculations but that doesn't help. How do I get excel to not change any of the information in the cells of my workbook? [In the previous excel all you had to do was insert an apostrophe ' to prevent any changes.] Example: Supposed to say: 01-05 Says: 39087 ...

File names and locations
I'm new to Outlook and have loaded it onto a new computer running Windows 7 so that I can sync my Blackberry to it. I am going to install it on to another XP machine and would like to be able to copy the files for the contacts, calendar, email folders, etc to the new machine. Can anyone tell me the file names and possible locations that I would need to move the data to another machine? Thanks, Rick Morrison Look for pst-files. You can look up your currently connected pst-files and their paths via; File-> Data File Management... For transferring details se...

XML namespace and LINQ to XML
I have an application where I would like to use namespaces in my schema An example of the Xml that uses this namespace: <?xml version="1.0" encoding="utf-16" ?> <Project xmlns="http://P2SWorld.com/AutoDeveloper/AutoDoc/Project" name="Quick Change Menu Item" LastModified="04/09/2008" Version="1.0.0"> <Tabs> <Tab name="Craft Codes" /> </Tabs> </Project> The following code fails: XDocument projectFile = XDocument.Load("c:\project.xml"); XElement tabs = projectFile.Eleme...

To get client data from a saved file back to the master file
I have designed a programme that records data and also links to another programme, but when I save the client information the name of the file changes and I loose the link. I want to be able to open a master copy each time and get the client data from the saved file so I can update each time and resave updates information, this way the link will always be there, I hope? ...

Query Delete and append
I am trying to add information to a table with an append query and that works fine since I duplicated the table. The information comes from a linked XLS sheet, I need to delete the information and replace it every day. When I created a delete query it works fine but when I try to add the information again using the append query it does not work unless I open the query in design view, save it and run it. I have dozens of other queries doing the same and they all work fine. What am I doing wrong? I looks like I am getting a 3349 error but why does it work once and then when I delete the ...

How do I set up a tickler file?
I need to be able to set up a tickler file where I can enter a name and discharge date then have the program automatically remind me to take an action in 2 months. I am using office pro 2003.I would like to do this in excel or outlook. Why not use Outlook's calendar function? -- Ken Russell kenrussellyourhat@optushome.com.au Remove yourhat to reply by e-mail .. "moe3rd" <moe3rd@discussions.microsoft.com> wrote in message news:BB1A0479-4242-4E05-8BFD-AAB264F948ED@microsoft.com... >I need to be able to set up a tickler file where I can enter a name and > discha...

Money File
I recently moved M03 to a new system (Win XP), and took notice of my Money File being updated every two minutes. (This may have been happening before, but I didn't pay attention). I do use background banking, but the most-frequent update is set for every 12 hours. So I'm unclear why the Money file is being opened/updated every two minutes? The FAQ for this newsgroup lists three processes that are spawned (mis.exe, misuser.exe, and mnyschdl.exe) and continue to run even after closing and exiting Money. Conistent with this, I observe that if I reboot the system, but do not sta...

opening csv-files
Hi, When I double-click a .csv file, Excel opens, but the .csv-file doesn' open correctly. Excel doesn't see the comma's as delimiters. I don' even get the 'text-import wizzard' to ask me how I want to open th file. Strangly enough, sometimes it does open correctly and sometimes i doesn't. It depends on who is sending me the file. Question: 1. If such a file does not open correctily by doubleclicking or b File/Open/ text-files... How can I open it correctly? 2. Is there somewhere a setting on a pc which influences this all? Wh can i open some .csv files from one...

output xml from xslt inC#
Hello, Thanks for taking the time to read. I'm begining Visual C# and trying to convert an HTML/Javascript application into a Windows application. I was using and XML database, transformed with XSL to output HTML, in Javascript for the client. Now, I have the same data in XML that I want to transform with XSL, but I need to output an XML node tree, to populate a treeView. I see a lot of ways to transform XML with XSL to output a string or a file, but I guess what I need is to output an XmlDocument I'm pretty confused with the "Writers" and "Readers" that ...

Can we set the UI color scheme via VB[A} or XML?
Does anyone know a way to set the color scheme for the UI, using VB[A} or XML? Can this even be done? Thanks -- Garry Free usenet access at http://www.eternal-september.org ClassicVB Users Regroup! comp.lang.basic.visual.misc Sorry for not qualifying the Excel version. It's v12 or higher. -- Garry Free usenet access at http://www.eternal-september.org ClassicVB Users Regroup! comp.lang.basic.visual.misc ...

XML format enforcement
I wish to write some kind of XML format enforcer like DTD, XSD or other that can do the following: (1) Any element and node must have Type attribute that can be read as data type by the parser. (1) Any element and node may have (optional) four more attributes. I XML enforcer should allow any tree structure and any number of nodes in any tree. Does anyone can tell how it's possible? Any example will be most appreciated. -- Thanks Sharon Sharon wrote: > I wish to write some kind of XML format enforcer like DTD, XSD or other that > can do the following: > (1) Any element a...

export excel file as csv with text delimiter of "
Does anyone know how to export data from an .xls file to a csv, and encode all text fields with double quotes > ""? I can use "save as" to get a csv file, but then the text does not have double quotes. any ideas? If the text fields are all within a certain column (or row or block), you could use the formula """"&A1&"""" (for example, if the text were in cell a1), then copy & paste value over the original data. "John" wrote: > Does anyone know how to export data from an .xls file to a csv, and encode ...

string and xml useage
Am I using strings properly in the code below? The code is working but not sure if my conversions are normal / standard / acceptable. CComPtr <IXMLDOMDocument2> m_pDocument; hr = m_pDocument.CoCreateInstance(CLSID_DOMDocument2); DEBUG_HR(hr); .... add elements to m_pDocument ... // create indented xml CComBSTR bRootXml; CString rootXml; hr = m_pDocument->get_xml(&bRootXml.m_str); DEBUG_HR(hr); rootXml = bRootXml; // add cariage returns between tags rootXml.Replace("><", ">\n<"); TRACE("rootXml:\n%s...

Reading archived file
Newbie here. In trying to open a backed-up file (*.pst) from inside Outllok 2003, I get an error message that "file access is denied." I made the stupid backup. How can I get this file to open? Any ideas? >-----Original Message----- >Newbie here. In trying to open a backed-up file (*.pst) >from inside Outllok 2003, I get an error message >that "file access is denied." I made the stupid backup. >How can I get this file to open? Any ideas? >. > You didn't mention what media you saved this backup on but one possible reason that's ha...

Append and Append To priviliges
Anybody know what these two priviliges do for a record?? Jay Append allows a user to be able to add items to an object for example you can append an address to an account. Append to allows a user to append this object to something else. You would need append to priv on the address object. They work together. "Jay Mehta" <jay.mehta@conexio.com> wrote in message news:b6caea5f.0310311043.682d756c@posting.google.com... > Anybody know what these two priviliges do for a record?? > > Jay So, in the example you gave of appending an Address object to an Account object,...

TLB or IDL to XML
Hi all! Can I convert typelib to XML. I found somthing to convert IDL to XSD? Are there other posibility? Thanks for response! ...

EASY, RIGHT? : Retrieving SQL Data as an XML Document
Hello, How do I retrieve SQL Data into an XML Document? I have the following code, which will retrieve SQL data and write it to the screen via the Response Object, but I'd like to be able to read it as XML Data, and use XSL and XSLT to display the data. Any suggestions? Code Snippets MORE than appreciated... :) ================================================================= Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim objConn As New OleDbConnection( _ ...

append query with dtae and username
I am using an append query to add a new line to my table - one of the field in this table is "Update_Date" and one is "Updated_By". How via this query I can populated those two fields with the current date&Time and current username of the user . Many thanks, Dan Please ignore- wrong Group, sorry "Dan" wrote: > I am using an append query to add a new line to my table - one of the field > in this table is "Update_Date" and one is "Updated_By". > How via this query I can populated those two fields with the current ...

Re-Post Append to Append Query
Hi there, Awhile back, I posted about the following: Have a main form and sub form. When generate a new form, fill in the main form and tab to sub-form, an append query is executed that populates the questions and possible answers for the questionnaire selected in the main form. The user then selects there response. Now, however, additional questions have been added. This means I need to execute some kind of additional append query that will ignore question ids that have already been populated, and add new ones. As he so often does, Allen Brown very kindly posted responses and I ha...

Publisher 2007 open files problem with Server 2003
I have a very small network using Server 2003 and when we used Publisher 2003 It downloaded files from the Server to the Client Computers very fast. Now It takes 2-3 min. for small files and 3-5 min. for large files. There are a lot of pictures in these files but the same files opened in pub 2003 with no problems. Is there a solution for this issue. Thanks for your help. Maybe this article is your answer An Office program is slow or may appear to stop responding (hang) when you open a file from a network location http://support.microsoft.com/kb/833041 -- Mary Sauer http://m...

Get count of append without appending?
I have several append queries. I would like to know how many records each would add to the target table without actually adding those records (the decision as to whether to add or not may be subjective). Is there a way other than duplicating the append queries with a select query? Dick Cleaveland hi Dick, news2@rgcle.com wrote: > Is there a way other than duplicating the append queries with a select > query? No, not really. Option Compare Database Option Explicit Public Sub CountAppending() On Local Error GoTo LocalError Dim db As DAO.Database Set db = CurrentDb B...

Please help to recover missing file #2
I am faced with a strange problem. I was working with worksheet in Excel when there was a power shutdown. The worksheet was in saved condition. When power resumed my worksheet simply vanished. Now whenever I try to access the worksheet I get the message that worksheet could not be found. As my pc is window xp pro. the worksheet should have saved itself as it does in word program. I have cheeked Recycle Bin and ran search program without any success. System Restore is of no help as it was off. Is there any way to retrieve the file. TIA. ...