Selective XML compare

Discussion in 'XML' started by bhushan.kharabe@gmail.com, Jul 25, 2006.

  1. Guest

    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
    , Jul 25, 2006
    #1
    1. Advertising

  2. wrote:
    > 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.


    --
    () ASCII Ribbon Campaign | Joe Kesselman
    /\ Stamp out HTML e-mail! | System architexture and kinetic poetry
    Joe Kesselman, Jul 26, 2006
    #2
    1. Advertising

  3. 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

    --
    RĂ©mi Peyronnet
    =?ISO-8859-1?Q?R=E9mi_Peyronnet?=, Jul 26, 2006
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Bobby Maul
    Replies:
    2
    Views:
    466
    Eddie Dodd
    May 27, 2004
  2. =?Utf-8?B?TGlsbGlhbg==?=

    Selective DataGrid

    =?Utf-8?B?TGlsbGlhbg==?=, Jun 2, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    362
    Marina
    Jun 2, 2004
  3. =?Utf-8?B?S3VydCBTY2hyb2VkZXI=?=

    selective validation on specific buttons only

    =?Utf-8?B?S3VydCBTY2hyb2VkZXI=?=, Mar 22, 2005, in forum: ASP .Net
    Replies:
    4
    Views:
    403
    =?Utf-8?B?S3VydCBTY2hyb2VkZXI=?=
    Mar 22, 2005
  4. delgados129
    Replies:
    2
    Views:
    557
    delgados129
    Apr 16, 2005
  5. Ben

    Selective XML filtering

    Ben, Sep 3, 2007, in forum: XML
    Replies:
    3
    Views:
    474
    Martin Honnen
    Sep 3, 2007
Loading...

Share This Page