Re: MV Keys

From: Christopher Browne <cbbrowne_at_acm.org>
Date: Sun, 26 Feb 2006 16:49:29 -0500
Message-ID: <87k6bhu6xi.fsf_at_wolfe.cbbrowne.com>


After takin a swig o' Arrakan spice grog, mAsterdam <mAsterdam_at_vrijdag.org> belched out:
> David Cressey wrote:
>> "mAsterdam" <mAsterdam_at_vrijdag.org> wrote
>>
>>>If I change the order of the items in the list,
>>>does that make it a new key? I would think so. (See below)
>> In other words, an onion and mushroom pizza is different from a
>> mushroom and
>> onion pizza.
>> Here we go again.
>
> Yeah, ehrm well... Is this issue closed? Is there a nice solution?
>
> In e.g. XML the basic assumption is that order has meaning, in SQL
> it is that order has no meaning. Historically (XML coming from a
> document heritage, SQL from experiments with relational products)
> this makes sense, but I would prefer it if one could choose wether
> order is meaningful/worth preserving/relevant or not - instead of
> being pushed into one way of thinking or another because of the
> background of the product at hand.

Is it *always* true, in XML, that order has meaning?

I don't think that's so at all...

There may exist cases where relative order can have meaning, but there certainly exist cases where it is irrelevant.

For instance, RFC 3733 describes an XML schema for representing contact information (the sort of information that the WHOIS service reports for the various sorts of organizational contacts).

In that schema, order is normally expressly NOT significant in indicating meaning.

If an XML request for creating a contact submits the <contact:name> before or after the <contact:country>, that is entirely irrelevant as far as any application is concerned.

More pointedly, the domain representation, in RFC 3731, can associate multiple nameservers with a domain.

The canonical example is:
  <domain:ns>

     <domain:hostObj>ns1.example.com</domain:hostObj>
     <domain:hostObj>ns2.example.com</domain:hostObj>
  </domain:ns>

You might perceive an ordering, there; that ordering is not a real one. That is, in formal terms, a set of nameservers. They are NOT ordered, as far as the DNS service is concerned.

I'm sure you can find counterexamples; what that would establish is not that "order always has meaning" in XML, but rather that *sometimes* the order of elements in an XML document has meaning.

In effect, you don't have the result you wish you had; in order for order to be preserved, when it important to do so, it is vital to expressly declare that it needs preservation. XML doesn't help as it does not provide any way to systemically indicate that need.

-- 
output = ("cbbrowne" "_at_" "gmail.com")
http://linuxdatabases.info/info/spreadsheets.html
In MDDT, no one can hear you scream...
But everybody can hear you say "whoops!"
Received on Sun Feb 26 2006 - 22:49:29 CET

Original text of this message