W3C home > Mailing lists > Public > xmlschema-dev@w3.org > February 2003

Re: Stupid question on xs:import

From: Jeni Tennison <jeni@jenitennison.com>
Date: Fri, 14 Feb 2003 09:44:50 +0000
Message-ID: <76497929384.20030214094450@jenitennison.com>
To: Jochen Wiedmann <joe@ispsoft.de>
CC: xmlschema-dev@w3.org

Hi Jochen,

> However, my schema validator (xerces) complains
>
>     Cannot find the declaration of element 'object'.
>
> Can anyone explain what I am doing wrong?

I think that what's happening is that Xerces is only loading the
schemas that it needs when it needs them. When it comes across an
<object> element, it looks for a schema for elements with no
namespace, and it doesn't find one since you don't have a
xsi:noNamespaceSchemaLocation attribute.

If you add an xsi:noNamespaceSchemaLocation="object.xsd" to your
instance document then it stops giving that error. Of course it gives
others because the db2:table attribute isn't declared and anyway the
<object> element can't have any attribute aside from the id attribute,
but those are different problems. (I'd recommend creating an "adaptor
schema" with no target namespace that redefines the objectType type so
that it can hold attributes from your namespace.)

I *think* that Xerces is probably wrong to error here. It's clearly
gathering schema components lazily, which is fine, but I think that it
should probably look through all the referenced schemas to work out
which namespaces it has schemas for rather than raising an error;
otherwise you get discrepancies between validators that lazily
construct the schemas and those that gather them whole.

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/
Received on Friday, 14 February 2003 04:45:05 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:36 GMT