Comparing 2 XMLs for differences in structure / X path of the documents and not the CONTENT ? XSL or another way? If XSL How ?

Subject: Comparing 2 XMLs for differences in structure / X path of the documents and not the CONTENT ? XSL or another way? If XSL How ?
From: "SANWAL, ABHISHEK (HP-Houston)" <abhishek.sanwal@xxxxxx>
Date: Mon, 7 Jun 2004 17:40:05 -0500
We have incoming XMLs from another system and we essentially have a
translation with one-to-one xpath mapping to our xml model. 

What we will be doing is adding a schema validation to the given
incoming feed.

The content inside this XML structure will be updated on a regular basis
and that is what we want.

But, if anytime the X-Path Mapping between the Source XML and
Destination XML is broken we want to be able to know that a given source
element/attribute was not present in the SOURCE XML. 

The way we want to maybe do this is have a SAMPLE / REFERENCE SOURCE XML
that has the "correctly mapped" structure. We will always want to do a
structure compare between the incoming SOURCE XML and the reference XML.

This is something that can not be captured by XSDs (or can it?). XSDs
might end up generalizing the structure and allow validation even when a
certain number elements have disappeared and that breaks the MAPPING.
Also, if we do an XML Diff since the content will essentially have been
updated we don't want a CONTENT-TO-CONTENT comparison (that will always
change). We want a STRUCTURE-to-STRUCTURE i.e. Absolute X-PATH to
Absolute X-Path mapping validation.

Any ideas? How we could go about doing this? Please comment. 

Thanks,
____________________________________________________________

Abhishek Sanwal
HP - Houston Campus
............................................................ 


Current Thread