Loading XSD resources that don't end with .xsd [message #4643] |
Mon, 11 November 2002 07:37  |
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 08:38  |
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 new XSDResourceImpl(), set the URI, add it
to the resource set, and call load, i.e., bypass the factories entirely.
<br>
<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 08:38  |
Eclipse User |
|
|
|
--------------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 new XSDResourceImpl(), set the URI, add it
to the resource set, and call load, i.e., bypass the factories entirely.
<br>
<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--
|
|
|
Powered by
FUDForum. Page generated in 0.03068 seconds