W3C home > Mailing lists > Public > xmlschema-dev@w3.org > January 2001

import vs prefixing

From: Michael Anderson <michael@research.canon.com.au>
Date: Wed, 17 Jan 2001 21:37:49 +1100
Message-ID: <3A6575FD.A5B31785@research.canon.com.au>
To: "xmlschema-dev@w3.org" <xmlschema-dev@w3.org>
I'm curious to know the difference between the two following schemas
<schema xmlns="http://www.w3.org/2000/XMLSchema"
              xmlns:cisra = "http://cisra.au">
  <import namespace="http://cisra.au"
    <element name="food" type="cisra:Weetbix"/>


<schema xmlns="http://www.w3.org/2000/XMLSchema"
              xmlns:cisra = "http://cisra.au">

    <element name="food" type="cisra:Weetbix"/>

Is it that you _must_ import the namespace using <import> before you can
use components from it in your schema?

Also, while on the subject of import....
There is also a statement in the specs [Structures 6.2.3] - "When a
schemaLocation is present, it must contain a single URI reference which
the schema author warrants will resolve to a schema document containing
the component(s) in the imported namespace referred to elsewhere in the
containing schema document."  This sounds to me like a constraint
(although it doesn't appear in the src) that components referred to
elsewhere in the containing document _must_ come from this schema
document.  I'm pretty sure this is not the case as schemaLocation is,
elsewhere, _always_ used as a _hint_only_.  In which case, is this
statement saying that the schema document, if resolved, _must_ have at
least one component that is in a schema information item that has a
targetNamespace that matches the import statement?

thanks for any help on this.

Received on Wednesday, 17 January 2001 05:37:54 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:55:50 UTC