- From: Bob Schloss <rschloss@us.ibm.com>
- Date: Fri, 5 Oct 2001 09:00:14 -0400
- To: Ian Stuart <Ian.Stuart@ed.ac.uk>, xmlschema-dev@w3.org
There are in practice 4 different treatments that processors make with namespaces. 1. All schema-aware processors are hard coded to understand the namespaces http://www.w3.org/2001/XMLSchema and http://www.w3.org/2001/XMLSchema-instance 2. Some schema-processors, using a default or user supplied EntityResolver, which may reference some kind of catalog, attempt to discover the schema components associated with a namespace by using the namespace name to find the schema component definitions. For whatever namespaces they do this for, they ignore xsi:noNamespaceSchemaLocation or xsi:schemaLocation attribute which may appear in instance documents, and they ignore schemaLocation attributes of <import> <include> and <redefine> element information items in any schemas they process. 3. Some schema-processors have Entity-Resolvers written so that if there was no entry for a particular namespace in the catalog above, will use the value specified in xsi:noNamespaceSchemaLocation, or in the schemaLocation attribute of <import> <include> and <redefine>, or as the second part of xsi:schemaLocation, as a URI and will use internet protocols to fetch what is at that URI to find the schema component definitions. 4. Some schema-processors have Entity-Resolvers written so that if there was no entry for a particular namespace in the catalog above, will dereference the namespace URI and if they receive a RDDL file, will follow a link there to find a schema document. The schema spec offers to possibility of using schemaLocation URIs in schemas that you write and instance documents that you write, so that processors that do treatment 3 have something to work with. But no processor is obligated to use those URIs. Thus, they are more like "hints". BTW: I would like to see someone post somewhere a document which for every open source or vendor produced schema-aware processor, information is given about which treatments that processor uses, and what is the relative priority between treatments 2, 3, and 4 if more than one is implemented. No one has stepped forward to do this so far. Regards, Bob Bob Schloss IBM Thomas J. Watson Research Center Yorktown Heights, New York, USA Ian Stuart <Ian.Stuart@ed.ac.uk>@w3.org on 10/05/2001 03:22:55 AM Sent by: xmlschema-dev-request@w3.org To: XML-Schema-dev <xmlschema-dev@w3.org> cc: Subject: Confused about name-space declarations.. Morning folks.. I thought, for a while, that I had the name-space declarations sussed: You use one of the following formats: xsi:NoNamespaceSchemaLocation = <URI_of_schema_file> or xmlns:MyNameSpaceTag = "<namespace URI>" xsi:schemaLocation = "<namespace URI> <schema_file>" or (I found out by accident) if the schema has the same basename as the instance document *and* is in the name directory - you don't need a declaration at all HOWEVER: Why to these work: xmlns:xsd = "http://www.w3.org/2001/XMLSchema" xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance" They make no reference to a file, and the "noNamespaceSchemaLocation" attribute does not work without the :xsi declaration... Any guidance/illumination greatfully recieved.. -- --==++ Ian Stuart: Edinburgh University Data Library. I build things: computer programs (with code); or cars (with metal) Personal web site: http://lucas.ucs.ed.ac.uk/
Received on Friday, 5 October 2001 09:01:50 UTC