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

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   More on [simple question on namespaces]

[ Lists Home | Date Index | Thread Index ]
  • From: Seairth Jacobs <seairth@bbglobex.com>
  • To: xml-dev <xml-dev@lists.xml.org>
  • Date: Thu, 28 Dec 2000 11:07:11 -0500

One of the facets of the conversation that has come up (again) is the following question:
 
Should a namespace URI reference an actual resource (such as a schema definition) or not?
 
In the end, it seems to me that there is only one reasonable answer:  It can be if it wants to be.
 
Requiring explicit use or non-use of URIs as URLs defeats the purpose of flexibility that XML and related technologies are meant to provide.  According to the namespace specification, the only explicit purpose of the URI is to group elements and attributes together that conform to a given standard.  A standard may or may not have a defined schema and the schema may or may not be found at the given namespace URI.
 
Let's suppose we are processing a document that uses namespaces.  Here are the following possible ways we can view the XML document:
 
1) We are expecting a specific type of document and/or namespace, for which we internally understand how to process.  In this case, it doesn't matter whether the URI points to a schema definition or not.  We aren't looking at that external document anyhow.
 
2) We are expecting any document and/or namespace that requires external validation.  In this case, we attempt to access the external document using the URI.  If it cannot be found, then the document is rejected (this would be true even if the URI was a URL and the host server wasn't responding).  Yes, we used the URI as a URL here, since our application required it.  If a document was sent that did not use a URL as a URI, then the application wouldn't know what to do with it anyhow.
 
3) We are expecting a specific type of document and/or namespace that requires external validation.  In this case, we first attempt to see if the namespace URI is one that we should accept and perform further processing on.  If so, then we continue as if folling the second case above.  If not, then the document would be rejected.
 
4) We are expecting any document and/or namespace that we don't need to know anything about.  As with the first case, it doesn't matter whether the URI points to a schema definition or not.  It may be accessed if available, but doesn't need to be.
 
 
As a result, I would expect an application to process namespaces something allong the following lines:
 
SELECT CASE
CASE (namespace is simply a URI that does not indicate any association to a schema definition)
    process document accordingly
 
CASE (namespace is recognized internally)
    process document according to internal schema
 
CASE (specific external schema is required or any valid external schema will do)
    IF (namespace URI references an accessible and understandable schema)
        process document according to external schema
    ELSE
        cannot validate document. handle accordingly.
    ENDIF
ENDSELECT
 
 
In the end, how a namespace URI is interpreted beyond the explicit definition(s) in the namespace standard is up to the application processing the document.  How we should choose to assign additional meaning to the URI should not be forced upon us by a specification.
 
---
Seairth Jacobs
seairth@bbglobex.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