W3C home > Mailing lists > Public > xmlschema-dev@w3.org > November 2002

Re: What is the meaning of the import statement?

From: Milan Trninic <mtrninic@galdosinc.com>
Date: Mon, 4 Nov 2002 10:17:45 -0800
Message-ID: <046101c2842e$7931e3f0$690aa8c0@mtrninic>
To: "Henry S. Thompson" <ht@cogsci.ed.ac.uk>
Cc: <www-xml-schema-comments@w3.org>, <xmlschema-dev@w3.org>
Hi Henry,

thank you very much for the reply. I cannot really say I am completelly
happy :-), but at least now I understand better the issue and the approach
of the developers of XMLSchema. It seems that I can achieve what I want to
do, just with a bit more work which is always good enough.


Milan Trninic
Senior Software Engineer
tel: 1 604 484-2764, 484-2750
Galdos Systems IncT http://www.galdosinc.com
Privileged or confidential information may be contained in this message. If
this message was not intended for you, destroy it and notify us immediately.
Opinions, conclusions, recommendations, and other information presented in
this message are not given or necessarily endorsed by my employer or firm.

  ----- Original Message -----
  From: Henry S. Thompson
  To: Milan Trninic
  Cc: www-xml-schema-comments@w3.org ; xmlschema-dev@w3.org
  Sent: Monday, November 04, 2002 02:04
  Subject: Re: What is the meaning of the import statement?

  "Milan Trninic" <mtrninic@galdosinc.com> writes:

  > I've been pondering on one issue related to the multiple <import>s of
  > same namespace. Here is the story in short:
  > I wanted to modularize the definitions in our namespace and to import
  > selectivelly from the application schemas. (Application meaning the
  > built on top of our base schemas). And I've figured I can't since the
  > specification allows processors to ignore all but the first <import>
  > statement of the particular namespace.
  > On the other hand, the specification allows processors to take into the
  > account all of the imports as well. And this is what some of the
  > do. This incostistent behaviour is the first problem.
  > But ok, if applications always use only one <import> statement, that
  > incostistency goes away.

  Right, that's the sensible defensive strategy.

  > Now, this obviously means that we are importing the namespace (with all
  > its definitions), not the definitions themselves. But then, why do we
  > two attributes there? Why schemaLocation? I mean if the namespace is
  > bound to only one schema location, that attribute is completelly

  Sorry, how does it get bound to _any_ schema location?  Answer -- the
  spec. provides a range of options for processor and/or user to
  employ/specify, everything from "nothing, because I've got that one
  built in" through "try derefing the NS name" to "use schemaLoc".

  > The existence of that attribute and the fact that it is not required
  > anything actually exists at the end of the namespace URI produces the
  > conclusion that <import> does not really import the namespace (with all
  > its definitions), but imports specific definitions from it.
  > Now which one is correct?

  Neither.  The fundamental purpose of <xs:import namespace='nsName'> is
  to allow references (e.g. ref=, base=) to names qualified by nsName.

  > Even with this issue resolved, the fact that you cannot modularize the
  > schemas is a real problem. Acheving scalability is affected. Building
  > mutually dependant, "networked" or hierarchical schema sets from
  > domain and for different purposes is significantly affected. I mean this
  > almost means that I have to have different namespace for each of my
  > definitions.

  There is a tradeoff here, but the common approach to this is to go
  ahead and modularise, and use <xs:include> to manage the
  modularisation (that's what _it_ is meant for).  In the case of
  importing a modularly-defined schema, that does mean you have to
  create a stub schema document which consists entirely of
  <xs:include>s, which you then point to from the schemaLoc of your

  Hope this helps.

    Henry S. Thompson, HCRC Language Technology Group, University of
            W3C Fellow 1999--2002, part-time member of W3C Team
       2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
      Fax: (44) 131 650-4587, e-mail: ht@cogsci.ed.ac.uk
       URL: http://www.ltg.ed.ac.uk/~ht/
   [mail really from me _always_ has this .sig -- mail without it is forged
Received on Monday, 4 November 2002 13:18:32 UTC

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