[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

More on [simple question on namespaces]

  • From: Seairth Jacobs <seairth@b...>
  • To: xml-dev <xml-dev@l...>
  • Date: Thu, 28 Dec 2000 11:07:11 -0500

externally validated xml document
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@b...

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.