Altova Mailing List Archives


Re: [xml-dev] Lesson Learned: Use namespaces for both markup and data

From: Liam Quin <liam@--.--->
To: "Costello, Roger L." <costello@-----.--->
Date: 8/9/2009 8:55:00 PM
On Sun, Aug 09, 2009 at 11:25:46AM -0400, Costello, Roger L. wrote:
>     Namespaces are not just important for markup, 
>     they are also important for data. 

I don't agree with this.

Scope and context are important for names and data.
You can use namespaces (if you are careful) to indicate
scope, in XML, and, to some extent context.

In your example,
<c:countries xmlns:c="http://www.itl.nist.gov/fipspubs/fip10-4.htm"
  xmlns:iso="http://www.iso.org/iso/english_country_names_and_code_elements">
    <c:country>iso:Afghanistan</c:country>

you have lost something important: the name of the country is not
iso:Afghanistan.  Now, every time you want to display the
country name, you need to do string processing.  Note also that
the country names are not NCNames - e.g. they can contain spaces.

If you're going to do this, next you'll be doing xdt:6 for "six".

Better might be just
<countries
  c="http://www.itl.nist.gov/fipspubs/fip10-4.htm">
  xmlns:iso="http://www.iso.org/iso/codes-pour-le-tourisme"

  <country iso:code="gb">The United Kingdom of Great Britain and
  Northern Ireland</country>

If in fact NIST and ISO do not define an XML vocabulary, you
should use a namespace URi that you own and control; you could
also consider Dublin Core in this particular case, or some other
widely-used metadata representation for places.


Just because a cup of coffee gets you going in the morning,
that's no reason to bathe exclusively in coffee :-)

Liam

-- 
Liam Quin, W3C XML Activity Lead, http://www.w3.org/People/Quin/
http://www.holoweb.net/~liam/ * http://www.fromoldbooks.org/

_______________________________________________________________________

XML-DEV is a publicly archived, unmoderated list hosted by OASIS
to support XML implementation and development. To minimize
spam in the archives, you must subscribe before posting.

[Un]Subscribe/change address: http://www.oasis-open.org/mlmanage/
Or unsubscribe: xml-dev-unsubscribe@l...
subscribe: xml-dev-subscribe@l...
List archive: http://lists.xml.org/archives/xml-dev/
List Guidelines: http://www.oasis-open.org/maillists/guidelines.php

Disclaimer

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.