This discussion is archived
4 Replies Latest reply: Oct 8, 2012 2:58 AM by 966140 RSS

how to comapre 2 lage xml files

966140 Newbie
Currently Being Moderated
I need to compare two xml files(more than 100MB size).
I don't want to use DOM. Is there any API available to do the comparison? if yes then from where I can get it?
If not then what should be my approach to achieve this using java?

Thanks in advance.

Edited by: 963137 on Oct 4, 2012 4:03 AM
  • 1. Re: how to comapre 2 lage xml files
    jtahlborn Expert
    Currently Being Moderated
    There are various technologies which will enable you to work with XML in a streaming fashion (e.g. SAX and StAX, both in the jdk). however, you haven't given any details about what specifically you mean by "compare 2 xml files", so whether or not those would be useful to you is anybody's guess.
  • 2. Re: how to comapre 2 lage xml files
    966140 Newbie
    Currently Being Moderated
    Thanks for the reply.
    I need to compare 2 xml node by node. For example, if I have 2 files says inventry1.xml & inventry2.xml. Now I want to see whether these 2 files are same or not. Then I will compare node by node and whatever node have different values or unmatched that I will show in my output.

    Edited by: 963137 on Oct 4, 2012 8:50 PM
  • 3. Re: how to comapre 2 lage xml files
    jtahlborn Expert
    Currently Being Moderated
    963137 wrote:
    Thanks for the reply.
    I need to compare 2 xml node by node. For example, if I have 2 files says inventry1.xml & inventry2.xml. Now I want to see whether these 2 files are same or not. Then I will compare node by node and whatever node have different values or unmatched that I will show in my output.
    okay, that's what i figured. "diff"ing xml (or even text for that matter) is a fairly difficult task. you should probably look at existing tools before attempting it yourself ("diff xml" gets lots of hits in google).
  • 4. Re: how to comapre 2 lage xml files
    966140 Newbie
    Currently Being Moderated
    Thank you.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points