This is a topic of considerable interest to me too...
On Fri, 2003-06-20 at 04:15, O'Keeffe, Michael wrote:
> Here is some good documentation from Sun illustrating how to configure
> it with JAXP (with Xerces as the parser).
>
> http://java.sun.com/webservices/docs/1.0/tutorial/doc/JAXPDOM9.html#63997
Thanks for this reference, Michael. I didn't know about this feature.
> 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.
I don't follow this. I agree that the unique string used as the
identifier for a namespace is "opaque" (a magic string :-). That was the
point of Talha's original email, right? There needs to be a mechanism
for mapping opaque namespace identifiers onto local sources of the
schema information.
I *really detest* the concept of encoding this information into the
input xml document (namespaceSchemaLocation and friends). It seems a
totally broken model to me. The creator of the xml shouldn't be encoding
paths/filenames/whatever that different receivers may wish to handle
differently. And it doesn't handle the problem that a referenced schema
may include or import other schemas...
I do agree that if you wish to be sure that an input xml document
complies with a certain schema, then you can't trust the input document;
you need to *both* respect the document's schemas (which may declare
default values or other interesting things in the schemas they
reference) *and* then validate against a known schema (which currently
requires the DOM level 3 "beta" code I believe).
Oasis have defined a nice configuration-file-format ("XML Catalog") for
mapping of namespace identifiers to local files. What is missing, as far
as I can see, is any EntityResolver implementation which can configure
itself from a file of this format. I did ask if such an implementation
existed about 6 months ago, but did not receive any reply. Implementing
or finding an implementation of this is on my to-do list (unfortunately
a rather long list).
See http://www.oasis-open.org/committees/entity/spec-2001-08-06.html
It would be really nice if tools which support xml manipulation (xml
spy, treebeard, jEdit's XML plugin, etc) allowed XML Catalog files to be
provided by the user.
Sorry for the rave; this issue has caused me much grief in the past! So
much so that my code currently just ignores all schemas (the
EntityResolver always returns an empty stream) which fortunately works
for me at the moment (no xml input I handle uses default values etc).
I'm awaiting DOM3 release (revalidation) with great anticipation....
Regards,
Simon
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]