• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

compare the two xml file generate the third xml

 
punna Kumar
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
i have a requirement to compare the two xml data and generate the defference xml containing the differnce data,

any one give the idea how i can do , i am using DOM Parser for parseing the xml file.


any idea


Rgds,
Punna.
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's probably less effort if you use one of the available xmldiff tools (google for it), and then use the results of that, than it is to roll your own.
 
Srinivasa Raghavan
Ranch Hand
Posts: 1228
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We faced the same situation once, we wrote a script using Jdom it will take a node from the file 1 and parse the next XML. This happens in a recursive fashion. ( Dont know may be it's a expensive approach )
Even Text pad editor was helful, it checks the differences between two files.
[ November 09, 2005: Message edited by: Srinivasa Raghavan ]
 
punna Kumar
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for giving the approches,
here i have to take the two transations difference data i mean to say before the transationa and after transation, what is the data is modified.
based on modified data i have to create the xml. these things i have to do throug programatically , because these transations include the data bae operation, i am useing oracle 9i


i can do any thing with oracle

i mean comapre the data and generate the xml in back end it self


please help me?

punna
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I tried this once but didn't go very far with it. My idea was ...

Now you have to define "match". Is it a match on the tag? On some or all of the attributes? On a simple String value? I think that's where I gave up on the XML I wanted to compare ... it had many repeats of the same tag name so I had to drill into attributes and children to even match two of them. Ick.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic