You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by Aleksandar Milanovic <am...@galdosinc.com> on 2002/07/03 22:59:40 UTC

grammar cache -> necessitates existence of top-level schema for a namespace

Hi All,

Suppose we have a namespace defined in multiple schemas and data that needs
to be validated is defined in more than one of the schemas. Neither
schemaLocation attributes nor Xerces grammar cache handle this case. In the
schemaLocation attribute, only the first location for a particular namespace
is likely to be used. For example, if schemaLocation is set to "ns loc1 ns
loc2", the XML parser will likely read only loc1 and ignore loc2. In the
Xerces grammar cache, adding a schema with a target namespace will overwrite
existing schemas with the same target namespace.

It seems that there is some kind of (implicit?) assumption that every
namespace have a single top-level schema that includes directly or
indirectly the rest of the schemas. In many cases this is true, but there is
no guarantee that it will always be true and a namespace may have more than
one top-level schemas. What should application developers do to handle these
cases?

One potential solution is to define a wrapper schema for a particular
namespace. This wrapper schema should include all top-level schemas. This
works fine with the latest grammar cache taken from CVS. It even handled
duplicate transitive includes graciously.

I would like to hear from Xerces developers and others what they think is
the right solution for this issue.

thx
Alex

----------------------------------------------------------------------------
---------
Aleksandar Milanovic     | Privileged or confidential information may be
contained
Software Engineer        | in this message. If this message was not intended
for you,
Galdos Systems Inc. ™    | destroy it and notify us immediately.
Tel: (604) 484-2750      | Opinions, conclusions, recommendations, and other
Fax: (604) 484-2755      | information presented in this message are not
given or
amilanovic@galdosinc.com | necessarily endorsed by my employer or firm.