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 Fr...@filinks.com on 2003/06/19 13:56:21 UTC

registering schema locations

Hello all,

I am trying to parse XML document using namespaces. These XML documents do 
not contain any shema location.
Is there a mean to describe somewhere what is the mapping between 
namespace and schema location outside of the original XML Document ?

I tried to set an entity resolver on the parser but it is not fired by the 
parsing.

My workaround for now is :
set the property 
"http://apache.org/xml/properties/schema/external-schemalocation" on the 
parser and list all the couples namespace/schema location
but it is not flexible since it is hard-coded

Francois Banel
tel : 01 53 34 30 64
mailto:Francois.Banel@filinks.com

Re: registering schema locations

Posted by Jeff Greif <jg...@alumni.princeton.edu>.
----- Original Message ----- 
From: "Joseph Kesselman" <ke...@us.ibm.com>
To: <xe...@xml.apache.org>
Sent: Thursday, June 19, 2003 5:52 AM
Subject: Re: registering schema locations
...
> What's wrong with having the document explicitly declare which schemas it
> needs? It has to declare the namespaces, and if anyone knows the mapping
> from one to the other it should be no harder to build that into the
> document than to try to imply it afterward... and if it's in the document
> you avoid having to blaze a path into uncharted and (at least for now)
> nonportable terratory.

Reasons (presumably known to the XML Schema specifiers and the Xerces crew):

1.  The application reading the document uses schema validation to ensure
that any validated document meets certain preconditions (thus eliminating
many possible error conditions it might have to defend against).  But this
only works if the schema used for validation is the one which corresponds to
the application code.  If the document can specify the schema itself, and a
different schema is used, a schema-valid document may not meet the expected
preconditions.  A different schema might be specified in the document for
varying reasons, ranging from inadvertent version skew to fraudulent intent.
2.  The schema specified in the document may be inaccessible to the
processing application, or for performance reasons, the application may wish
to use a local copy of the schema.  If that application must then use an
entity resolver, it might as well ignore the schema specified in the
document, as the schema spec and Xerces allow.

The originator of this thread asked for other mechanisms (beside the
external-schema-location property on the parser) to bind namespaces to
schemas.  The recent Oasis Catalog mechanism should probably be mentioned.
(Sorry, I don't have a reference.)

Jeff




---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org


Re: registering schema locations

Posted by Joseph Kesselman <ke...@us.ibm.com>.



The W3C's Semantic Web folks are investigating what metadata, if any, is
implied by a namespace and how it should be retrieved and used.  Until they
report out, the official answer is that a namespace URI is only a magic
string in URI syntax. It does not imply a specific schema, and indeed may
be referenced by many schema documents. So for now, even if you can make
this work, it's going to be a unique solution for your own application and
won't work for anyone else.

What's wrong with having the document explicitly declare which schemas it
needs? It has to declare the namespaces, and if anyone knows the mapping
from one to the other it should be no harder to build that into the
document than to try to imply it afterward... and if it's in the document
you avoid having to blaze a path into uncharted and (at least for now)
nonportable terratory.

______________________________________
Joe Kesselman, IBM Next-Generation Web Technologies: XML, XSL and more.
"The world changed profoundly and unpredictably the day Tim Berners Lee
got bitten by a radioactive spider." -- Rafe Culpin, in r.m.filk


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org