Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » XML Schema Definition (XSD) » Loading XSD resources that don't end with .xsd
Loading XSD resources that don't end with .xsd [message #4643] Mon, 11 November 2002 12:37 Go to next message
Eclipse User
Originally posted by: hayden.unicorn.com

Where within the Eclipse framework do I define the filetype that I want my
XML Schema files to be associated with. I am running the XSDMainTest and
passing a file that ends with .xSD. I would like to be able to pass a file
with any file type and XML Schema to be parsed.

How do I go about doing this?

Thanks
Re: Loading XSD resources that don't end with .xsd [message #4712 is a reply to message #4643] Mon, 11 November 2002 13:38 Go to previous message
Eclipse User
Originally posted by: merks.ca.ibm.com

--------------A3AF9B59DBDD71AA573B5925
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Hayden,

I've been reworking the import/include mechanism so that imports and includes
of things that don't end in .xsd will work correctly. This will be available
in the next version.

For your immediate issue, you can register "*" as a default:

Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap( ).put( "*",
new XSDResourceFactoryImpl());

But it's probably better do this registration only on your resource set:

resourceSet.getResourceFactoryRegistry().getExtensionToFacto ryMap().put( "*",
new XSDResourceFactoryImpl());

rather than globally. (Doing it globally within an Eclipse environment would
be bad news but would be okay for a standalone application.)

Or you can just do new XSDResourceImpl(), set the URI, add it to the resource
set, and call load, i.e., bypass the factories entirely.


Hayden Marchant wrote:

> Where within the Eclipse framework do I define the filetype that I want my
> XML Schema files to be associated with. I am running the XSDMainTest and
> passing a file that ends with .xSD. I would like to be able to pass a file
> with any file type and XML Schema to be parsed.
>
> How do I go about doing this?
>
> Thanks

--------------A3AF9B59DBDD71AA573B5925
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
Hayden,
<p>I've been reworking the import/include mechanism so that imports and
includes of things that don't end in .xsd will work correctly. This will
be available in the next version.
<p>For your immediate issue, you can register "*" as a default:
<blockquote> Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap( ).put( "*",
new XSDResourceFactoryImpl());</blockquote>
But it's probably better do this registration only on your resource set:
<blockquote> resourceSet.getResourceFactoryRegistry().getExtensionToFacto ryMap().put( "*",
new XSDResourceFactoryImpl());</blockquote>
rather than globally. (Doing it globally within an Eclipse environment
would be bad news but would be okay for a standalone application.)
<p>Or you can just do&nbsp; new XSDResourceImpl(), set the URI, add it
to the resource set, and call load, i.e., bypass the factories entirely.
<br>&nbsp;
<p>Hayden Marchant wrote:
<blockquote TYPE=CITE>Where within the Eclipse framework do I define the
filetype that I want my
<br>XML Schema files to be associated with. I am running the XSDMainTest
and
<br>passing a file that ends with .xSD. I would like to be able to pass
a file
<br>with any file type and XML Schema to be parsed.
<p>How do I go about doing this?
<p>Thanks</blockquote>
</html>

--------------A3AF9B59DBDD71AA573B5925--
Re: Loading XSD resources that don't end with .xsd [message #563572 is a reply to message #4643] Mon, 11 November 2002 13:38 Go to previous message
Ed Merks is currently offline Ed Merks
Messages: 26152
Registered: July 2009
Senior Member
--------------A3AF9B59DBDD71AA573B5925
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Hayden,

I've been reworking the import/include mechanism so that imports and includes
of things that don't end in .xsd will work correctly. This will be available
in the next version.

For your immediate issue, you can register "*" as a default:

Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap( ).put( "*",
new XSDResourceFactoryImpl());

But it's probably better do this registration only on your resource set:

resourceSet.getResourceFactoryRegistry().getExtensionToFacto ryMap().put( "*",
new XSDResourceFactoryImpl());

rather than globally. (Doing it globally within an Eclipse environment would
be bad news but would be okay for a standalone application.)

Or you can just do new XSDResourceImpl(), set the URI, add it to the resource
set, and call load, i.e., bypass the factories entirely.


Hayden Marchant wrote:

> Where within the Eclipse framework do I define the filetype that I want my
> XML Schema files to be associated with. I am running the XSDMainTest and
> passing a file that ends with .xSD. I would like to be able to pass a file
> with any file type and XML Schema to be parsed.
>
> How do I go about doing this?
>
> Thanks

--------------A3AF9B59DBDD71AA573B5925
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
Hayden,
<p>I've been reworking the import/include mechanism so that imports and
includes of things that don't end in .xsd will work correctly. This will
be available in the next version.
<p>For your immediate issue, you can register "*" as a default:
<blockquote> Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap( ).put( "*",
new XSDResourceFactoryImpl());</blockquote>
But it's probably better do this registration only on your resource set:
<blockquote> resourceSet.getResourceFactoryRegistry().getExtensionToFacto ryMap().put( "*",
new XSDResourceFactoryImpl());</blockquote>
rather than globally. (Doing it globally within an Eclipse environment
would be bad news but would be okay for a standalone application.)
<p>Or you can just do&nbsp; new XSDResourceImpl(), set the URI, add it
to the resource set, and call load, i.e., bypass the factories entirely.
<br>&nbsp;
<p>Hayden Marchant wrote:
<blockquote TYPE=CITE>Where within the Eclipse framework do I define the
filetype that I want my
<br>XML Schema files to be associated with. I am running the XSDMainTest
and
<br>passing a file that ends with .xSD. I would like to be able to pass
a file
<br>with any file type and XML Schema to be parsed.
<p>How do I go about doing this?
<p>Thanks</blockquote>
</html>

--------------A3AF9B59DBDD71AA573B5925--
Previous Topic:Loading XSD resources that don't end with .xsd
Next Topic:Error handling for bad XML Schemas
Goto Forum:
  


Current Time: Fri Oct 31 10:01:58 GMT 2014

Powered by FUDForum. Page generated in 0.03446 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software