[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Comparison of Xml documents


deltaxml key
Title: Re: Comparison of Xml documents
Pierre,

I agree with you that there is nothing in XML schema to indicate whether or not order is significant. It is an omission IMHO.

When designing DeltaXML several years ago, we came to that conclusion (it is true of DTDs also). However, we also realized that for comparison this had to be specified. So we say that:

1)
<Winners>
  <Player name="Bob"/>
  <Player name="Wil"/>
</Winners>
2)
<Winners>
  <Player name="Wil"/>
  <Player name="Bob"/>
</Winners>

are different, but that:

1)
<Winners deltaxml:ordered="false">
  <Player name="Bob"/>
  <Player name="Wil"/>
</Winners>
2)
<Winners deltaxml:ordered="false">
  <Player name="Wil"/>
  <Player name="Bob"/>
</Winners>

would be the same, i.e. no differences.

The other piece of information missing for a 'comparison schema' is information on what constitutes a 'key' to an item. In your example, the name of the Player is probably a key and if you have:

1)
<Winners deltaxml:ordered="false">
  <Player name="Bob">Captain</Player>
  <Player name="Wil"/>
</Winners>
2)
<Winners deltaxml:ordered="false">
  <Player name="Wil">Captain</Player>
  <Player name="Bob"/>
</Winners>
then it would be useful to know that Bob is not Captain, but Wil is (possible) rather than that Bob is now called Wil (unlikely). To do this you need a key, e.g.

1)
<Winners deltaxml:ordered="false">
  <Player name="Bob" deltaxml:key="Bob">Captain</Player>
  <Player name="Wil" deltaxml:key="Wil"/>
</Winners>
2)
<Winners deltaxml:ordered="false">
  <Player name="Wil" deltaxml:key="Wil">Captain</Player>
  <Player name="Bob" deltaxml:key="Bob"/>
</Winners>

Anything can be used to provide a key, but it is not the same as an ID. However, and ID will work as a key. In a comparison schema we would like to specify that the 'name' attribute identifies a 'Player' within the context of 'Winners'.
You can do this with DeltaXML, more details and an on-line trial are at http://www.deltaxml.com


Robin La Fontaine



At 10:37 am +0100 20/11/03, GARNIER Pierre wrote:
Hi all,
 
I wanted to submit you a question.

...snip
Anyone knows about such a "comparison" schema standard spec existing?
 
Thanks,
Pierre


-- 
-- ---------------------------------------------------
Robin La Fontaine,
DeltaXML: "Change control for XML, in XML"
Email: robin@d...      http://www.deltaxml.com

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.