Hi,
Im having a lil problem which i can't figure out myself.. I tried searching google, but i found nothing what might even help me the slightest bit..
I wanna compare 2 xml files with eachother. One xml file is standard on my pc and has the name pc.xml. the other xml file is on the server and has the name server.xml
The program im trying to write should compare these 2 files with eachother and if it contains new info it should be added in the pc.xml file. and the server.xml files should be disposed after this is done so a new file can be send without getting an error about having 2 xml files with the same name on my pc.
This is the pc.xml file:
<?xml version="1.0" encoding="ISO-8859-1"?>
<agenda>
<appointment>
<Id> 7 </Id>
<Date> 20060426 </Datum>
<Time> 120000 </Time>
<Subject> test </Subject>
<Description> testttt </Beschrijving>
<Place> paris </Place>
<Modtime> 182204 </Modtime>
</Appointment>
<Appointment>
<Id> 8 </Id>
<Date> 20060426 </Date>
<Time> 120000 </Time>
<Subject> whatever </Subject>
<Description> whateverrr </Description>
<Place> where ever </Place>
<Modtime> 182204 </Modtime>
</Appointment>
</agenda>
And this one will be send from the server:
<?xml version="1.0" encoding="ISO-8859-1"?>
<agenda>
<appointment>
<Id> 9 </Id>
<Date> 20060426 </Datum>
<Time> 120000 </Time>
<Subject> test </Subject>
<Description> testttt </Beschrijving>
<Place> paris </Place>
<Modtime> 182204 </Modtime>
</Appointment>
<Appointment>
<Id> 10 </Id>
<Date> 20060426 </Date>
<Time> 120000 </Time>
<Subject> whatever </Subject>
<Description> whateverrr </Description>
<Place> where ever </Place>
<Modtime> 182204 </Modtime>
</Appointment>
</agenda>
As you can see by looking at the Id's of these 2 xml files, they are different. There is id 7, 8, 9 and 10.
I want this file merge with the excisting one on my pc (pc.xml). After merged it should look like this:
<agenda>
<appointment>
<Id> 7 </Id>
<Date> 20060426 </Datum>
<Time> 120000 </Time>
<Subject> test </Subject>
<Description> testttt </Beschrijving>
<Place> paris </Place>
<Modtime> 182204 </Modtime>
</Appointment>
<Appointment>
<Id> 8 </Id>
<Date> 20060426 </Date>
<Time> 120000 </Time>
<Subject> whatever </Subject>
<Description> whateverrr </Description>
<Place> where ever </Place>
<Modtime> 182204 </Modtime>
</Appointment>
<appointment>
<Id> 9 </Id>
<Date> 20060426 </Datum>
<Time> 120000 </Time>
<Subject> test </Subject>
<Description> testttt </Beschrijving>
<Place> paris </Place>
<Modtime> 182204 </Modtime>
</Appointment>
<Appointment>
<Id> 10 </Id>
<Date> 20060426 </Date>
<Time> 120000 </Time>
<Subject> whatever </Subject>
<Description> whateverrr </Description>
<Place> where ever </Place>
<Modtime> 182204 </Modtime>
</Appointment>
</agenda>
I can't find an example on the internet how this can be done in csharp. Nor can i find if its possible to compare the content of 2 xml files with eachother...
Can somebody help me with this please?
Thanks in advance!