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

N

Neil

Folks,

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

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

BigSmoke

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
schema's.
 

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
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top