OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: [xml-dev] Comparison of Xml documents

[ Lists Home | Date Index | Thread Index ]

Title: Re: [xml-dev] 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@deltaxml.com      http://www.deltaxml.com




 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS