Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » XML Schema Definition (XSD) » How to provide a different schema content
How to provide a different schema content [message #37145] Wed, 11 February 2004 18:34 Go to next message
Joshua Hui is currently offline Joshua Hui
Messages: 23
Registered: July 2009
Junior Member
Hi,

In FAQ section of eclipse/xsd, it has the following question:

Is there a way to have schema documents which reference other schema
documents through <include> <import> or <redefine> be fetched from
locations other than those given in the schemaLocation attribute?

Yes, you can use a ResourceSet's URIConverter's URI map to map logical
URIs to physical URIs. You can see an example of that code in
XSDProtocotypicalSchema traceLoading().

But if I want to provide the content of the schema directly, instead of
letting EMF to locate the resource, how can I do it? Basically, what I
want is something like what EntityResolver provides.

Thanks.

Joshua
Re: How to provide a different schema content [message #37248 is a reply to message #37145] Thu, 12 February 2004 09:39 Go to previous message
Eclipse User
Originally posted by: merks.ca.ibm.com

Joshua,

Have a look at the new XSDSchemaLocator API. That should give you a hook
for populating a schema into the resource set using your own mechanism.


Joshua Hui wrote:

> Hi,
>
> In FAQ section of eclipse/xsd, it has the following question:
>
> Is there a way to have schema documents which reference other schema
> documents through <include> <import> or <redefine> be fetched from
> locations other than those given in the schemaLocation attribute?
>
> Yes, you can use a ResourceSet's URIConverter's URI map to map logical
> URIs to physical URIs. You can see an example of that code in
> XSDProtocotypicalSchema traceLoading().
>
> But if I want to provide the content of the schema directly, instead of
> letting EMF to locate the resource, how can I do it? Basically, what I
> want is something like what EntityResolver provides.
>
> Thanks.
>
> Joshua
Re: How to provide a different schema content [message #583457 is a reply to message #37145] Thu, 12 February 2004 09:39 Go to previous message
Ed Merks is currently offline Ed Merks
Messages: 25919
Registered: July 2009
Senior Member
Joshua,

Have a look at the new XSDSchemaLocator API. That should give you a hook
for populating a schema into the resource set using your own mechanism.


Joshua Hui wrote:

> Hi,
>
> In FAQ section of eclipse/xsd, it has the following question:
>
> Is there a way to have schema documents which reference other schema
> documents through <include> <import> or <redefine> be fetched from
> locations other than those given in the schemaLocation attribute?
>
> Yes, you can use a ResourceSet's URIConverter's URI map to map logical
> URIs to physical URIs. You can see an example of that code in
> XSDProtocotypicalSchema traceLoading().
>
> But if I want to provide the content of the schema directly, instead of
> letting EMF to locate the resource, how can I do it? Basically, what I
> want is something like what EntityResolver provides.
>
> Thanks.
>
> Joshua
Previous Topic:Unresolved element when validate using DOM format
Next Topic:ClassCastException in XSDSchemaImpl
Goto Forum:
  


Current Time: Sat Jul 26 11:23:52 EDT 2014

Powered by FUDForum. Page generated in 0.01974 seconds