xsl-list
[Top] [All Lists]

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

2004-06-08 00:33:16
It should be possible to describe the structural constraints on the source
documents using an XML Schema. If that is not adequate, you could look at
Schematron.

XSLT 2.0 attempts to tackle this issue by allowing you to link a stylesheet
to a schema for the source documents.

Michael Kay 

-----Original Message-----
From: SANWAL, ABHISHEK (HP-Houston) 
[mailto:abhishek(_dot_)sanwal(_at_)hp(_dot_)com] 
Sent: 07 June 2004 22:40
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] Comparing 2 XMLs for differences in structure 
/ X path of the documents and not the CONTENT ? XSL or 
another way? If XSL How ?


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


--+------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--+--






<Prev in Thread] Current Thread [Next in Thread>