Selective XML compare

B

bhushan.kharabe

I need to compare the test results from different releases saved in
xml. Some differences are inconsequential like computer name where test
ran or date and time of test. But other info is usefull. my schema
looks like

<TestCase id='a1'>
<Computer>C1</Computer>
<Executed>07/25/06</Executed>
<input>i1,12</input>
<output>o1,o2</output>
<result>pass/fail</result>
</TestCase>

Anybody know any library I can use to compare only the usefull elements
of test case and ignore other info.

Thanks for help in advance

Bhushan
 
J

Joe Kesselman

Anybody know any library I can use to compare only the usefull elements
of test case and ignore other info.

Since only you know what is "useful" and what isn't, I'd suggest you
write an XSLT stylesheet to extract only the meaningful data, then
compare that. You may want to put the extracted information through an
XML canonicalizer as well, since some differences really aren't
meaningful to XML itself.
 
?

=?ISO-8859-1?Q?R=E9mi_Peyronnet?=

Hi,
Anybody know any library I can use to compare only the usefull elements
of test case and ignore other info.

libxmldiff / xmlTreeNav can do it :

Ex : xmldiff diff --ignore "Computer,Executed" --ids "@id" one.xml
two.xml result.xml

The result.xml will contain a merge of the files, annotated with a
diff:status attribute describing if the element has been added, removed,
modified,... (and you will keep non-relevant information for further
analysis)

http://people.via.ecp.fr/~remi/soft/xml/libxmldiff/libxmldiff_en.php3
http://people.via.ecp.fr/~remi/soft/xml/xmltreenav/xmltreenav_en.php3

Hope this helps
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,001
Messages
2,570,254
Members
46,850
Latest member
VMRKlaus8

Latest Threads

Top