[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Lesson Learned: Use namespaces for both markup and data
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/
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] |
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|