How can I compare data held in docs based on different schemas?

Discussion in 'XML' started by Neil, Nov 10, 2004.

  1. Neil

    Neil Guest


    I've got a problem at work, and I'm hoping that someone out there may
    have had something similar (although I doubt it!) or may be able to
    offer some advice.

    I'm in the process of designing a system that interacts with a third
    party external firm. Basically, they will send us an XML document (the
    quote request) via SOAP that contains a load of info with all the
    information required to make an insurance quote. Our company will do
    all the usual yada yada and sent an XML document back to them, saying
    whether we've offered a quote (and tell them the price and any terms
    etc), or that we've declined it.

    Should they decide to accept our quote and get a policy, they will
    send an XML document back to us (the policy request). Now, there is a
    business requirement to check every field in the policy request to
    ensure that the value in the field is the same as what was originally
    sent by them in the quote request. Now, you would presume that this
    would be reasonably simple. However, the schemas for the quote request
    XML and the policy request XML are completely different, with the
    original data all over the place in the new doc, in different nodes,
    with different parents and children etc. And, there may be whitespace
    within the values in the nodes. And, where there are complex groups -
    of which there are many - such as a business may be insuring several
    premises, or have several safes etc, the child nodes within each group
    may be in different orders in both documents, and there are no unique
    IDs within any of the nodes to allow us to easily compare and

    Don't ask my why it's been done like this; it's what our business
    people have agreed to and we're stuck with it, and so we cannot change
    the XML coming in or out (for example, getting the senders to insert
    the entire original quote request as a node into the policy request;
    no, that would be far too easy).

    So I can go through every single element in both documents one-by-one
    and compare them, but that would (a) be an absolute pain to write,
    especially when it comes to the complex groups, and (b) would most
    likely kill our servers when it's doing several of these at the same
    time. So, is there any method/package/tips (other than resigning and
    getting a different job) that you lovely people could suggest for
    automating (as much as possible) the comparison of the values in an
    XML doc based on two completely different schemas?

    Oh, did I mention that they are trying to force us to do this in VB6
    (although if there is an easy way to do it in .Net then it may mean
    lots of lovely training for us)? And the other good news is that we
    may get a different version of the schemas once every few months?

    Any help at all would be really, really appreciated...
    Neil, Nov 10, 2004
    1. Advertisements

  2. Neil

    BigSmoke Guest

    I'd first start by looking into the feasibility of transforming XML
    data conforming to the third party XML Schema into data confirming to
    your company's XML schema using XSLT. Comparisons should be much easier
    when you end up with two data-sets conforming to the _same_ schema.

    Writing the XSLT can be anything from pretty basic to terribly complex
    depending on the complexity (and mostly the ambiguity) of both the XML

    I'd never dare say `life's a bitch,'
    because I am life's little bitch.
    - BigSmoke
    BigSmoke, Nov 14, 2004
    1. Advertisements

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. AD
    Francis Shanahan
    Aug 23, 2003
  2. Abdul Mukit
    Abdul Mukit
    Nov 17, 2004
  3. ThomasH
    Aug 30, 2006
  4. KYG
    Ian Collins
    Aug 18, 2008
  5. Stéphane Wirtel
    Stéphane Wirtel
    Apr 19, 2007
  6. Zeno Davatz
    Zeno Davatz
    Jan 25, 2011
  7. Al
    Henry Law
    Oct 16, 2005
  8. fish
    Juha Nieminen
    Jun 1, 2012