User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Java section within the Software Development category of DaniWeb, a massive community of 426,135 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 1,730 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Java advertiser: Lunarpages Java Web Hosting
Views: 4145 | Replies: 4
Reply
Join Date: Apr 2007
Posts: 2
Reputation: alapick is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
alapick alapick is offline Offline
Newbie Poster

Java code to compare XML files

  #1  
Apr 22nd, 2007
I’m working on a project that includes comparing XML files and I need a source code on Java to compare XML fragments.
I’m using ExamXML from http://www.a7soft.com to compare XML files but I need the Java source code.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Dec 2004
Location: London or Slovakia
Posts: 2,453
Reputation: peter_budo is a jewel in the rough peter_budo is a jewel in the rough peter_budo is a jewel in the rough peter_budo is a jewel in the rough 
Rep Power: 11
Solved Threads: 296
Moderator
Featured Poster
peter_budo's Avatar
peter_budo peter_budo is offline Offline
Code tags enforcer

Re: Java code to compare XML files

  #2  
Apr 22nd, 2007
Do not expect anybody give you such code for free, we may guide you in developing such application but major work is up to you

PS: It will be very nice if you make up your mind which programming language you wish to use, plus read rules about posting, specialy section that talks about double posting

http://www.daniweb.com/techtalkforum...cement9-2.html
http://www.daniweb.com/techtalkforum...niweb_policies
Last edited by peter_budo : Apr 22nd, 2007 at 12:48 pm.
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)

If we helped you to solve your problem, answered your question please mark your post as SOLVED.
Reply With Quote  
Join Date: Sep 2007
Posts: 1
Reputation: Vikky is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
Vikky Vikky is offline Offline
Newbie Poster

Re: Java code to compare XML files

  #3  
Sep 24th, 2007
I faced a similar problem in one of my projects and hence wrote my own comparator.
This comparator can be invoked via web, using a simple java code. You can view more details at http://www.cityhaat.com/adAction.do?...iewAd&adId=291 about how to use this comparator from your code. The sample code is available at http://cityhaat.com/xmlComp/ClientUtil.zip

The comparator that I wrote gives you the flexibility to configure how to identify a node from a set of repeated nodes and is able to compare them successfully if they occur in any order. You can send a message via http://www.cityhaat.com/adAction.do?...iewAd&adId=291 this link if you need customizations for your comparisons. Its FREE.
Reply With Quote  
Join Date: Aug 2005
Posts: 4,782
Reputation: iamthwee is a glorious beacon of light iamthwee is a glorious beacon of light iamthwee is a glorious beacon of light iamthwee is a glorious beacon of light iamthwee is a glorious beacon of light 
Rep Power: 17
Solved Threads: 319
iamthwee's Avatar
iamthwee iamthwee is offline Offline
Industrious Poster

Re: Java code to compare XML files

  #4  
Sep 24th, 2007
I would use the API available with java, which no doubt there must be for xml. It would be more reliable than any custom built programs.
I'm not a programmer. My attitude starts with ignorance, holds steady at conversation, and ends with a trip to the hospital. Get used to it.
Reply With Quote  
Join Date: Apr 2006
Location: City of God
Posts: 145
Reputation: orko is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 8
orko orko is offline Offline
Junior Poster

Re: Java code to compare XML files

  #5  
Sep 24th, 2007
for similar project I used DOM. It is not very difficult to do once you give a try. Besides, xml diff tools may not be very effective as it doesn't know how flexible you want to be. So instead of looking for others code, you better consider reading some introductory DOM parsing, get the nodes information, compare each other, and get your own diff tool. One example for starting your reading can be: http://www.onjava.com/pub/a/onjava/2001/02/08/dom.html
A Perfect World
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb Java Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the Java Forum

All times are GMT -4. The time now is 4:41 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC