Re: schemaLocation in instance documents - how many hints?

Hi Simon,

> In an /instance document/, is it good practice to have
> a schemaLocation hint for every namespace used therein?
>
> Or if one schema document <imports> documents which
> (ultimately) describe all the other necessary namespaces,
> is it sufficient to only provide the schemaLocation hint
> for the ultimate schema document?

Yes, if you have one ultimate schema that imports all other schemas with
different namespaces then it is enough to only provide the schemaLocation
hint to this schema in the instance.
One reason to include a schemaLocation hint for every namespace used in the
instance can be to provide the users of the instance with information about
the location of the different schemas involved. But this can be risky
business since the instance and schemas may not be created by the same
application or user which means the schemaLocation hint in the schema can
differ from the schemaLocation hint in the instance for the same namespace
and I think this will lead to different behaviour depending on what
validator you're using.

Cheers,
/Eddie

Received on Monday, 14 January 2002 18:07:32 UTC