Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » XML Schema Definition (XSD) » [xsd.resources.jar] Cache listing
[xsd.resources.jar] Cache listing [message #40452] Mon, 05 April 2004 05:03 Go to next message
Christian Stein is currently offline Christian SteinFriend
Messages: 29
Registered: July 2009
Junior Member
Good morning!

Is there already a ready-to-use table/mapping I oversee? I want to know,
which
xsd documents are cached inside this jar. Other I'll cache in the
application...

Regards,
Christian
Re: [xsd.resources.jar] Cache listing [message #40566 is a reply to message #40452] Mon, 05 April 2004 10:49 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

Christian,

I'm not quite sure what you are asking. A few "meta schemas" are cached in
xsd.resourses.jar, i.e., the ones that appear in the org.eclipse.xsd/cache
directory. If there are schemas out on the web or elsewhere for which you
would like to provide a local copy, you can use a URIConverter's URI Map,
either the global one or the one in a particular resource set, to map a
logical namespace to a physical cached location (or to map a resolved
schemaLocation to a local cached location).


Christian Stein wrote:

> Good morning!
>
> Is there already a ready-to-use table/mapping I oversee? I want to know,
> which
> xsd documents are cached inside this jar. Other I'll cache in the
> application...
>
> Regards,
> Christian
Re: [xsd.resources.jar] Cache listing [message #40626 is a reply to message #40566] Mon, 05 April 2004 20:03 Go to previous messageGo to next message
Christian Stein is currently offline Christian SteinFriend
Messages: 29
Registered: July 2009
Junior Member
On Mon, 05 Apr 2004 06:49:36 -0400, Ed Merks <merks@ca.ibm.com> wrote:

> Christian,
>
> I'm not quite sure what you are asking. A few "meta schemas" are cached
> in xsd.resourses.jar, i.e., the ones that appear in the
> org.eclipse.xsd/cache directory.

Yepp. I just wondered, whether there is a listing of those "few" schemata
which is also supplied within that jar.

My goal is to present the user a dialog where he/she sees all used/loaded/
included/... schemas. An additional info for each schema in that list is
if it is cached locally or not. And if not, the dialogs offers a download
button. (...) The download button should be disabled, if the schema
namespace
is already cached.

Regards,
Christian
Re: [xsd.resources.jar] Cache listing [message #40688 is a reply to message #40566] Thu, 08 April 2004 12:58 Go to previous messageGo to next message
Christian Stein is currently offline Christian SteinFriend
Messages: 29
Registered: July 2009
Junior Member
On Mon, 05 Apr 2004 06:49:36 -0400, Ed Merks <merks@ca.ibm.com> wrote:

> [...]
> would like to provide a local copy, you can use a URIConverter's URI Map,
> either the global one or the one in a particular resource set, to map a
> logical namespace to a physical cached location (or to map a resolved
> schemaLocation to a local cached location).

Dumping all Map.Entry items of different maps results in the following:

-----------------------------
dump(URIConverter.URI_MAP);
-----------------------------
Map is empty.

-----------------------------
dump(XSDSchemaImpl.getGlobalResourceSet().getURIConverter(). getURIMap());
-----------------------------
http://www.w3.org/2001/xml.xsd -> jar:file:/D:/Workspace/ \
schemaprof/ext/xsd_2.0.0_20040127_1738SL.resources.jar! \
/org/eclipse/xsd/cache/www.w3.org/2001/xml.xsd

-----------------------------
dump(XSDSchemaImpl.createResourceSet().getURIConverter().get URIMap());
-----------------------------
Map is empty.

-----------------------------
dump(new ResourceSetImpl().getURIConverter().getURIMap());
-----------------------------
Map is empty.


So the only set, which has ONE mapping installed is the global one
managed by XSDSchemaImpl. Where are the entries for other "often
-used" schema files that are also inside the resource.jar? Are they
mapped "magically" and are never put into an accessable map?

Next question is, which ResourceSet should be used to "load" schema
in general? The global one? A fresh instance provided by "XSDSchemaImpl.
XSDSchemaImpl.createResourceSet()" or via hand with "new
ResourceSetImpl()".
Where is the difference between the last two ways?

Regards,
Christian

--

public static void dump(Map map) {
Set set = map.entrySet();
if (set.isEmpty()) {
System.out.println("Map is empty.");
return;
}
Iterator i = set.iterator();
while (i.hasNext()) {
System.out.println(i.next());
}
}
Re: [xsd.resources.jar] Cache listing [message #40719 is a reply to message #40688] Thu, 08 April 2004 13:20 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

Christian,

The global XSD resource set should be used to load schemas only by the XSD
implementation. The schema for schemas is loaded magically from the "jar"ed
location. Its import of the XML namespace schema uses an absolute
schemaLocation so that one mapping is added local to the global XSD resource set
to redirect that back into the "jar"ed location.

You should avoid using any of the Impl classes directly so you should just new a
ResourceSetImpl and add manually any registrations needed to it.


Christian Stein wrote:

> On Mon, 05 Apr 2004 06:49:36 -0400, Ed Merks <merks@ca.ibm.com> wrote:
>
> > [...]
> > would like to provide a local copy, you can use a URIConverter's URI Map,
> > either the global one or the one in a particular resource set, to map a
> > logical namespace to a physical cached location (or to map a resolved
> > schemaLocation to a local cached location).
>
> Dumping all Map.Entry items of different maps results in the following:
>
> -----------------------------
> dump(URIConverter.URI_MAP);
> -----------------------------
> Map is empty.
>
> -----------------------------
> dump(XSDSchemaImpl.getGlobalResourceSet().getURIConverter(). getURIMap());
> -----------------------------
> http://www.w3.org/2001/xml.xsd -> jar:file:/D:/Workspace/ \
> schemaprof/ext/xsd_2.0.0_20040127_1738SL.resources.jar! \
> /org/eclipse/xsd/cache/www.w3.org/2001/xml.xsd
>
> -----------------------------
> dump(XSDSchemaImpl.createResourceSet().getURIConverter().get URIMap());
> -----------------------------
> Map is empty.
>
> -----------------------------
> dump(new ResourceSetImpl().getURIConverter().getURIMap());
> -----------------------------
> Map is empty.
>
> So the only set, which has ONE mapping installed is the global one
> managed by XSDSchemaImpl. Where are the entries for other "often
> -used" schema files that are also inside the resource.jar? Are they
> mapped "magically" and are never put into an accessable map?
>
> Next question is, which ResourceSet should be used to "load" schema
> in general? The global one? A fresh instance provided by "XSDSchemaImpl.
> XSDSchemaImpl.createResourceSet()" or via hand with "new
> ResourceSetImpl()".
> Where is the difference between the last two ways?
>
> Regards,
> Christian
>
> --
>
> public static void dump(Map map) {
> Set set = map.entrySet();
> if (set.isEmpty()) {
> System.out.println("Map is empty.");
> return;
> }
> Iterator i = set.iterator();
> while (i.hasNext()) {
> System.out.println(i.next());
> }
> }
Re: [xsd.resources.jar] Cache listing [message #40781 is a reply to message #40719] Fri, 09 April 2004 07:56 Go to previous message
Christian Stein is currently offline Christian SteinFriend
Messages: 29
Registered: July 2009
Junior Member
On Thu, 08 Apr 2004 09:20:39 -0400, Ed Merks <merks@ca.ibm.com> wrote:

> [...]
> You should avoid using any of the Impl classes directly so you should
> just new a ResourceSetImpl and add manually any registrations needed
> to it.

Thanks for your quick and good help!
Re: [xsd.resources.jar] Cache listing [message #585139 is a reply to message #40452] Mon, 05 April 2004 10:49 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
Registered: July 2009
Senior Member
Christian,

I'm not quite sure what you are asking. A few "meta schemas" are cached in
xsd.resourses.jar, i.e., the ones that appear in the org.eclipse.xsd/cache
directory. If there are schemas out on the web or elsewhere for which you
would like to provide a local copy, you can use a URIConverter's URI Map,
either the global one or the one in a particular resource set, to map a
logical namespace to a physical cached location (or to map a resolved
schemaLocation to a local cached location).


Christian Stein wrote:

> Good morning!
>
> Is there already a ready-to-use table/mapping I oversee? I want to know,
> which
> xsd documents are cached inside this jar. Other I'll cache in the
> application...
>
> Regards,
> Christian


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: [xsd.resources.jar] Cache listing [message #585175 is a reply to message #40566] Mon, 05 April 2004 20:03 Go to previous message
Christian Stein is currently offline Christian SteinFriend
Messages: 29
Registered: July 2009
Junior Member
On Mon, 05 Apr 2004 06:49:36 -0400, Ed Merks <merks@ca.ibm.com> wrote:

> Christian,
>
> I'm not quite sure what you are asking. A few "meta schemas" are cached
> in xsd.resourses.jar, i.e., the ones that appear in the
> org.eclipse.xsd/cache directory.

Yepp. I just wondered, whether there is a listing of those "few" schemata
which is also supplied within that jar.

My goal is to present the user a dialog where he/she sees all used/loaded/
included/... schemas. An additional info for each schema in that list is
if it is cached locally or not. And if not, the dialogs offers a download
button. (...) The download button should be disabled, if the schema
namespace
is already cached.

Regards,
Christian
Re: [xsd.resources.jar] Cache listing [message #585208 is a reply to message #40566] Thu, 08 April 2004 12:58 Go to previous message
Christian Stein is currently offline Christian SteinFriend
Messages: 29
Registered: July 2009
Junior Member
On Mon, 05 Apr 2004 06:49:36 -0400, Ed Merks <merks@ca.ibm.com> wrote:

> [...]
> would like to provide a local copy, you can use a URIConverter's URI Map,
> either the global one or the one in a particular resource set, to map a
> logical namespace to a physical cached location (or to map a resolved
> schemaLocation to a local cached location).

Dumping all Map.Entry items of different maps results in the following:

-----------------------------
dump(URIConverter.URI_MAP);
-----------------------------
Map is empty.

-----------------------------
dump(XSDSchemaImpl.getGlobalResourceSet().getURIConverter(). getURIMap());
-----------------------------
http://www.w3.org/2001/xml.xsd -> jar:file:/D:/Workspace/ \
schemaprof/ext/xsd_2.0.0_20040127_1738SL.resources.jar! \
/org/eclipse/xsd/cache/www.w3.org/2001/xml.xsd

-----------------------------
dump(XSDSchemaImpl.createResourceSet().getURIConverter().get URIMap());
-----------------------------
Map is empty.

-----------------------------
dump(new ResourceSetImpl().getURIConverter().getURIMap());
-----------------------------
Map is empty.


So the only set, which has ONE mapping installed is the global one
managed by XSDSchemaImpl. Where are the entries for other "often
-used" schema files that are also inside the resource.jar? Are they
mapped "magically" and are never put into an accessable map?

Next question is, which ResourceSet should be used to "load" schema
in general? The global one? A fresh instance provided by "XSDSchemaImpl.
XSDSchemaImpl.createResourceSet()" or via hand with "new
ResourceSetImpl()".
Where is the difference between the last two ways?

Regards,
Christian

--

public static void dump(Map map) {
Set set = map.entrySet();
if (set.isEmpty()) {
System.out.println("Map is empty.");
return;
}
Iterator i = set.iterator();
while (i.hasNext()) {
System.out.println(i.next());
}
}
Re: [xsd.resources.jar] Cache listing [message #585221 is a reply to message #40688] Thu, 08 April 2004 13:20 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
Registered: July 2009
Senior Member
Christian,

The global XSD resource set should be used to load schemas only by the XSD
implementation. The schema for schemas is loaded magically from the "jar"ed
location. Its import of the XML namespace schema uses an absolute
schemaLocation so that one mapping is added local to the global XSD resource set
to redirect that back into the "jar"ed location.

You should avoid using any of the Impl classes directly so you should just new a
ResourceSetImpl and add manually any registrations needed to it.


Christian Stein wrote:

> On Mon, 05 Apr 2004 06:49:36 -0400, Ed Merks <merks@ca.ibm.com> wrote:
>
> > [...]
> > would like to provide a local copy, you can use a URIConverter's URI Map,
> > either the global one or the one in a particular resource set, to map a
> > logical namespace to a physical cached location (or to map a resolved
> > schemaLocation to a local cached location).
>
> Dumping all Map.Entry items of different maps results in the following:
>
> -----------------------------
> dump(URIConverter.URI_MAP);
> -----------------------------
> Map is empty.
>
> -----------------------------
> dump(XSDSchemaImpl.getGlobalResourceSet().getURIConverter(). getURIMap());
> -----------------------------
> http://www.w3.org/2001/xml.xsd -> jar:file:/D:/Workspace/ \
> schemaprof/ext/xsd_2.0.0_20040127_1738SL.resources.jar! \
> /org/eclipse/xsd/cache/www.w3.org/2001/xml.xsd
>
> -----------------------------
> dump(XSDSchemaImpl.createResourceSet().getURIConverter().get URIMap());
> -----------------------------
> Map is empty.
>
> -----------------------------
> dump(new ResourceSetImpl().getURIConverter().getURIMap());
> -----------------------------
> Map is empty.
>
> So the only set, which has ONE mapping installed is the global one
> managed by XSDSchemaImpl. Where are the entries for other "often
> -used" schema files that are also inside the resource.jar? Are they
> mapped "magically" and are never put into an accessable map?
>
> Next question is, which ResourceSet should be used to "load" schema
> in general? The global one? A fresh instance provided by "XSDSchemaImpl.
> XSDSchemaImpl.createResourceSet()" or via hand with "new
> ResourceSetImpl()".
> Where is the difference between the last two ways?
>
> Regards,
> Christian
>
> --
>
> public static void dump(Map map) {
> Set set = map.entrySet();
> if (set.isEmpty()) {
> System.out.println("Map is empty.");
> return;
> }
> Iterator i = set.iterator();
> while (i.hasNext()) {
> System.out.println(i.next());
> }
> }


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: [xsd.resources.jar] Cache listing [message #585243 is a reply to message #40719] Fri, 09 April 2004 07:56 Go to previous message
Christian Stein is currently offline Christian SteinFriend
Messages: 29
Registered: July 2009
Junior Member
On Thu, 08 Apr 2004 09:20:39 -0400, Ed Merks <merks@ca.ibm.com> wrote:

> [...]
> You should avoid using any of the Impl classes directly so you should
> just new a ResourceSetImpl and add manually any registrations needed
> to it.

Thanks for your quick and good help!
Previous Topic:Announcement: FAQ update planned
Next Topic:URI converting - set resource base
Goto Forum:
  


Current Time: Fri Mar 29 06:15:56 GMT 2024

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

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

Back to the top