Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [wtp-dev] XML Catalog - namespaces or schemaLocations ... or both


The XML Catalog specification can be found here:

http://www.oasis-open.org/committees/entity/specs/cs-entity-xml-catalogs-1.0.html
Yes, I tried to digest it, without much luck.  There seems to be a lot of circular definition, such as: "The system entry indicates that an entity manager must use the associated URI reference to locate the replacement text for an entity with the specified system identifier."  I'm still unclear what the "system" term is referring to.  I'm hoping for a layman's "use the uri tag here, the public tag here, and the system tag here ..."  The extension point description doesn't seem to help me much in this regard.  It *seems* to me that public and system are pre-XML Schema terms, and since we are not having to deal with anything other than schemas re: JPA (and I should note that my pre-XML Schema knowledge is ... absent), I might be able to safely ignore those.

One thing to keep in mind is that a Namespace isn't necessarily a resolvable web location.   It's just a unique identifier for a set of elements.    DTDs have no concept of a namespace it only pertains to XML Schemas and the XML Namespace specification if an XML Parser implements it.

http://www.w3.org/TR/REC-xml-names/

The above is a link to the namespace specification.   In particular, you can't take an XML Schema that has a targetnamespace specified as http://www.foo.org/foo.xsd and have an xml file that has a namespace of http://www.foo.org/foo and have the XML validate correctly against the specification.   The namespace in the XML file has to match up with the namespace in the XSD.

So, targetnamespace in the schemas has to match a corresponding namespace in the XML file.   So doing the proposed redirection wouldn't work.
I understand that a namespace does not equal (necessarily) the web location for a schema.  Perhaps I didn't word my example quite accurately.  In my example, the plugin provider maps the web location "http://www.foo.org/foo.xsd" to the local location "schemas/foo.xsd" (just as done in org.eclipse.jst/wst.standard.schemas), so that documents that specify the schema location using the web address are redirected to the local schema instead.  And the user maps the namespace "http://www.foo.org/foo" (which *is* the namespace declared in the schema document) to the web location "http://www.foo.org/foo.xsd" in her preferences, so that documents which have no schema location, but which use that namespace, are redirected to the web location for the schema.  My question is if this is theoretically possible within WTP (knowing that I cannot currently map a namespace to a web-based URI schema location), and whether or not it is then possible to redirect the user's redirection (which would normally be to the web location) to the *local* schema location, which has already been provided for her by the plugin provider (i.e. namespace -> web location -> local location) without her having to download a second copy of the schema for her own personal use.

Thanks,
Paul Fullbright
Oracle Corp.
Eclipse Dali/Java Persistence Tools Development
paul.fullbright@xxxxxxxxxx


Paul Fullbright wrote:

One additional question:  is it possible (either for a plugin provider or for a user) to map a namespace to a /web location/ of a schema?  Relatedly, is it possible to map a namespace to a web location, which itself is then mapped to a local location, perhaps in an existing plugin?  (for example, plugin provider provides a local schema foo.xsd, for which he adds the xml catalog entry "http://www.foo.org/foo.xsd" -> "schemas/foo.xsd".

_______________________________________________
wtp-dev mailing list
wtp-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/wtp-dev


Back to the top