Lists Home |
Date Index |
PHDB _ wrote:
> I want to manage several versions of my XML Schema, and store the
> different version in different folders.
> However I don't want that a user can be able to change the
> SchemaLocation he is allowed to use. Thus I want to be able able to
> force (according to the user) the SchemaLocation before parsing and
> Is there a simple way to that ?
Not in general. XML Schema leaves it open for implementations to locate
schemas in any way they wish; schema locations specified in schemas are
no more than hints. This means that a parser could override an explicit
schema location, or supply a missing one, in some implementation-defined
way. You will have to consult your parser documentation for details.
The parser I am most familiar with, Xerces J, allows you to supply a
single schema location as a property. At a lower level, it allows an
application to supply a grammar pool that, properly programmed, can
substitute any number of schema locations for existing or missing
specifications in the schema. These features are available at the API
level. Other parsers probably have similiar capabilities.