From: Sneha Teckchandani 
Sent: Wednesday, April 07, 2010 12:51 PM
To: 'xmlunit-general-requ...@lists.sourceforge.net'
Subject: Help on XMLUnit

 

Hi,

Job at hand is to compare 2 XML files.
The result expected is not only an assertion of whether the XMLs are
similar or different but also to present the various differences. 
This has to be done irrespective of the position of the records in the
XML. 

Based on my understanding of XMLUnit, it provides only assertion type
results. Except for the method Diff.getAllDifferences(). 

Most of the Methods implement the logic required to achieve the
requirement below, but there is no return of the differing components.


If you can help in understanding/implementing XMLUnit not just as a
testing tool but also for comparing XML files based on a unique
Record-Identifier, would appreciate it.

To elaborate on my task,

In the attached XML Record Identifier is the ::  <item_no>

1.       Record - 1001 is different, due to the value for node 'desc' 

2.       Record 1003 && 1006 to be displayed as not present in the
other.

3.       Record 1002 differ due to the existence of tag <quantity>

4.       The Line number of 'desc' and <quantity > from their respective
XMLs.

 

My understanding limits my implementation and hence unable to provide
the above. Exploring XMLUnit is absolutely essential (part of the
requirement). 

 

Hence your input would be a big help.

 

 

Regards,

Sneha Teckchandani.

 

P.S. Is there any possible way to point an element as a unique record
identifier (like a point of reference) for testing/comparison ? 

<?xml version="1.0" encoding="UTF-8"?>
<result>
	<item_tuple>
		<itemno>1002</itemno>
		<desc>Racing Bicycle</desc>
	</item_tuple>
	<item_tuple>
		<itemno>1006</itemno>
		<desc>Learning Bicycle</desc>
	</item_tuple>
	<item_tuple>
		<itemno>1001</itemno>
		<desc>Old Bicycle</desc>
	</item_tuple>
</result>
<?xml version="1.0" encoding="UTF-8"?>
<result>
	<item_tuple>
		<itemno>1001</itemno>
		<desc>Red Bicycle</desc>
	</item_tuple>
	<item_tuple>
		<itemno>1002</itemno>
		<desc>Racing Bicycle</desc>
		<quantity>5</quantity>
	</item_tuple>
	<item_tuple>
		<itemno>1003</itemno>
		<desc>Next Bicycle</desc>
		<quantity>5</quantity>
	</item_tuple>
</result>
------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Xmlunit-general mailing list
Xmlunit-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/xmlunit-general

Reply via email to