Re: namespaces and includes

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
namespace.

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.
  
Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/

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