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

Re: namespaces and includes

From: Jeni Tennison <jeni@jenitennison.com>
Date: Mon, 11 Mar 2002 18:58:07 +0000
Message-ID: <31551311534.20020311185807@jenitennison.com>
To: Ross Thompson <rthompson@contivo.com>
CC: xmlschema-dev@w3.org
Hi Ross,

> But my reading of the spec says it's not, because the declaration of
> fredType is in the namespace http://bob.com/bob/, and the reference
> is to the unnamed namespace. My reading makes includes far less
> useful, however, because I can't do the obvious thing of writing
> generic content that can be incorporated into several schemata.
> Can someone point me to the place in the spec where it says which
> namespace unqualified references in an included schema refer to?

Your example is of a "chameleon" schema, where the included schema has
no target namespace but the including schema does have a target

The relevant part of the spec is Schema Representation Constraint:
Inclusion Constraints and Semantics at
http://www.w3.org/TR/xmlschema-1/#src-include, where there's a note:

  NOTE: As discussed in Missing Sub-components (§5.3), ˇQNameˇs in XML
  representations may fail to ˇresolveˇ, rendering components
  incomplete and unusable because of missing subcomponents. During
  schema construction, implementations are likely to retain ˇQNameˇ
  values for such references, in case subsequent processing provides a
  referent. ˇAbsentˇ target ˇnamespace nameˇs of such as-yet
  unresolved reference ˇQNameˇs in <include>d components should also
  be converted if clause 3.2 is satisfied.

The last sentence is the important one: the references, in the
included schema, to components in no namespace should be converted to
references to the components with the same name but in the target
namespace of the including schema.

So your example does work, just as you think it should.


Jeni Tennison
Received on Monday, 11 March 2002 14:39:54 UTC

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