Hi Edwin,

Well I learn once more--quickly reading over code, even if it's code you
(think you) know well, is a pretty good way of misleading yourself if you
don't actually run tests...  You're right of course; it's the
schemaLocation hint we pass as the systemId parameter, not the schema
namespace.

I tend to think this behaviour is unfortunate, because I do believe that
the schema namespace is very useful information to an application's entity
resolver.  And clearly this is something we'll have to expose when
considering the Xerces2 grammar caching design, because it's by namespace
and not by schemaLocation hint that we index grammars.  But let's not open
that Pandora's box again for the moment. :-)

Cheers,
Neil

Neil Graham
XML Parser Development
IBM Toronto Lab
Phone:  905-413-3519, T/L 969-3519
E-mail:  [EMAIL PROTECTED]



Edwin Goei <[EMAIL PROTECTED]> on 10/10/2001 06:58:14 PM

Please respond to [EMAIL PROTECTED]

To:   [EMAIL PROTECTED]
cc:
Subject:  Re: xsi:schemaLocation hint resolution


[EMAIL PROTECTED] wrote:
>
> Hi Edwin,
>
> Here's what we did in Xerces1:  since publicIds are (or at least were)
very
> DTD-specific, we don't use that field of an EntityResolver in this
context.
> We passed the namespace of the imported schema in the systemId field, and
> only used the schemaLocation field ourselves if this other method didn't
> provide us with a schema.  The thought behind this, I conjecture, was
that
> the application-writer, who supplies both the schemas and the
> EntityResolver, should be able to keep a mapping between his namespaces
and
> his files (or has some method of doing so; else why provide the entity
> resolver?)  A schema hint is really only useful to a default
> implementation--like ours.

Thanks for the reply.  Since I didn't get an immediate reply, I tested
this myself.  Maybe I misunderstand, but what I found does not seem to
exactly match your description.  I tried Xerces 1.4.3.  It appears that
there are 4 ways to specify a schema:

  1) In instance doc:
    1a) xsi:schemaLocation="namespace-name schemaURI..." pairs
    1b) xsi:noNamespaceSchemaLocation="schemaURI"
  2) Via an external property that overrides the xsi attributes
    2a) http://apache.org/xml/properties/schema/external-schemaLocation
    2b) corresponding noNamespace version

It looks like the EntityResolver gets passed the "schemaURI" part as the
systemID and the namespace-name is not used.  The publicID is "" as you
state above.

-Edwin

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to