Welcome to dbFreaks.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

XML comparison

 
   Database Help (Home) -> Java RSS
Next:  Hibernate: @SecondaryTable causes ORA-00918  
Author Message
Nick

External


Since: Apr 17, 2008
Posts: 1



(Msg. 1) Posted: Thu Apr 17, 2008 8:24 am
Post subject: XML comparison
Archived from groups: comp>lang>java>databases (more info?)

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

 >> Stay informed about: XML comparison 
Back to top
Login to vote
Arved Sandstrom

External


Since: Mar 25, 2008
Posts: 16



(Msg. 2) Posted: Fri Apr 18, 2008 1:09 pm
Post subject: Re: XML comparison [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"Nick" wrote in message

> 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

For the first task you essentially need (recursive) directory listings. You
could start with something like this
(http://exampledepot.com/egs/java.io/GetFiles.html) and take it from there
(there are useful links). If you convert your file listings to sets you can
do a difference operation
(http://java.sun.com/docs/books/tutorial/collections/interfaces/set.html) to
cleanly discover what files are different, and intersections to get the
common file listings.

Once you have common file listings, and given that you are comparing XML
content, you'll be able to find existing programs/utilities that do XML
diffs.

AHS

 >> Stay informed about: XML comparison 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Table Comparison software? - Is anyone aware of any software - freeware, shareware, or commercial - that can be used to compare the contents of two tables to see if they are identical, or, if not, to highlight the differences between them? Ideally, such a program would compare..

SQLServer 2000 Driver for JDBC behaviour on SQL Server res.. - 1) My java code properly connects to the SQL Server DB via the SQL Server 2000 JDBC driver. 2) During one of our stress tests, we restarted the SQL Server to see how the code handles it. 3) My code doesn't really recognize that the SQL server is up and m...

Displaying contents from database in an applet - I have created a connection to an MSAccess database, but I am unable to display the results in an webbrowser. My question is therefore how do I retrieve and displaty the records of my database on a webpage? Kind regards Johan Reimers

Hibernate and log4j config under Tomcat. - "Under Tomcat 3.x and 4.x, you should place the log4j.properties under the WEB-INF/classes directory of your web-applications. Log4j will find the properties file and initialize itself. This is easy to do and it works." "The XML configu...

Java &amp; MySQL show table status command - Hi, I am using java to retrieve a resultset with "show table status" mysql command. I am having problem reading the [name] and [engine] column. In the metadata object it is showing as VARCHAR but when I do getString() it is returning me the o...
   Database Help (Home) -> Java All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]