Sign In/My Account | View Cart  
advertisement

Article:
 XML Namespaces Don't Need URIs
Subject: URI is not a URL
Date: 2005-04-15 12:05:37
From: RobertField

Besides URLs, it is possible to use URNs, which would look like urn:namespace:extrastuff. This is subject to all the problems of elaborate complexity, as in


urn:somedomain_veryimportantschema:2005.v249


but have the advantage, to my thinking, of not looking like a regular web address, which was a source of early confusion to me, and I suppose many others. It took a while to realize the URI was simply an inert placeholder and was not the source of some information.


As for "well known" schemas, what happens when I get a piece of XML from Silicon Valley Groundhog Supply, with root element <svg>, that happens to have some SVG embedded. I know it's a little far fetched, but the major point of namespaces is to avoid having to select unique names for elements, by having the namespace to enclose a specific group of them.


Previous Message Previous Message   Next Message Next Message


Titles Only Full Threads Newest First
  • URI is not a URL
    2005-04-15 17:57:05 mikeday [Reply]

    Yes, URNs do reduce some of the problems associated with using HTTP URLs to identify namespaces, although as you point out they are still rather complex.


    Your example of the Silicon Valley Groundhogs is interesting, but not an argument for namespaces. If you have an established relationship with the groundhogs people then receiving an XML document (either by email or a HTTP POST) with a root element of <svg> will not surprise you.


    If within that document there is an embedded image:


    <groundhog>
    <name>Grumpy Groundhog</name>
    <picture>
    <svg>...</svg>
    </picture>
    </groundhog>


    that should not surprise you either, as the context is sufficient to tell that it is an image.


    Ambiguity is only possible if there were two XML image formats with a root element of <svg>, or two transformation languages that used <xsl:transform>.


    This case is much less likely, and there are more gentle ways to disambiguate it than mandating namespace URIs everywhere.



Sponsored By: