Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Java Help > Re: XML compari...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 3 of 4 Topic 15985 of 16085
Post > Topic >>

Re: XML comparison

by Alex.From.Ohio.Java@[EMAIL PROTECTED] Apr 17, 2008 at 12:10 PM

On Apr 17, 11:22 am, Nick <nachiket.shirwal...@[EMAIL PROTECTED]
> wrote:
> Hi,
>
> I have an urgent requirement to be done in JAVA where in I need to
> compare between two directories and to see if there are exact same
> name files available in both the directories. So for eg. DIR1 and DIR2
> both have 1.xml, 2.xml then its fine or report the missing ones.
>
> Secondly whichever files are avilable in both the directories compare
> them so compare 1.xml in DIR1 to 1.xml in DIR2 but only on certain
> fields.
>
> So in summary :
>
> DIR1 -> 1.xml{contents= <a>20</a><b>10</b> }, 2.xml, 3.xml
> DIR2 -> 1.xml{contents= <a>25</a> }, 2.xml, 4.xml
>
> Then the report should tell me that
>
> a] 3.xml is missing in DIR2
> b] 4.xml is missing in DIR1
> c] <a> field in the 1.xml differs
> d] But assuming <b> is a fields to be ignored do not display any
> error.
>
> Can these be done in JAVA and how ?
>
> Please help.
>
> regards
> Nick

That's pretty common task.
Use XML DOM parser and you can compare certain fields easily and
quickly.

Alex.
http://www.myjavaserver.com/~alexfromohio/




 4 Posts in Topic:
XML comparison
Nick <nachiket.shirwal  2008-04-17 08:22:46 
Re: XML comparison
RedGrittyBrick <RedGri  2008-04-17 16:39:03 
Re: XML comparison
Alex.From.Ohio.Java@[EMAI  2008-04-17 12:10:06 
Re: XML comparison
Andy Chambers <achambe  2008-05-07 05:53:04 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat May 17 3:14:49 CDT 2008.