Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » XML Schema Definition (XSD) » Local Cache of Schemas
Local Cache of Schemas [message #23546] Sun, 15 June 2003 23:52 Go to next message
Jens Lukowski is currently offline Jens LukowskiFriend
Messages: 5
Registered: July 2009
Junior Member
Hi

I want to use a local cache for my resources/schemas.
I tried to provide my own URIResolver and looked at the example in the docs.
Everything works fine if I pass back the URI I get (an absolute one with
http://) but if I map the URI to a file:// URI it only loads the outermost
schema and doesn't have any element declarations. I checked the inputstream
generated by URIResolver.createInputStream and it has the correct schema
file in it but the URIResolver is never called for the other schemas
referenced by import or include.
What do I do wrong ? I also tried calling schema.setLocation but it didn't
make any difference.
The xsd file I use is: http://www.w3.org/TR/voicexml20/vxml.xsd

thanx
Jens Lukowski
Re: Local Cache of Schemas [message #23631 is a reply to message #23546] Mon, 16 June 2003 11:23 Go to previous message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

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

Jens,

If I add this code to XSDMainTest:

412a414,423
>
>
> resourceSet.getURIConverter().getURIMap().put
> (URI.createURI("http://www.w3.org/TR/voicexml20/vxml.xsd"),
URI.createURI("file://d:/stuff/vxml.xsd"));

Add this code to URIConverterImpl:

380a381
> System.err.println("open:" + uri + " ->" + converted);

And make sure that the vxml.xsd is present at that file system location, then I
get this trace (when running xsd-test.bat -validate
http://www.w3.org/TR/voicexml20/vxml.xsd):

open:http://www.w3.org/TR/voicexml20/vxml.xsd
->file://d:/stuff/vxml.xsd
open:platform:/plugin/org.eclipse.xsd_1.1.0/cache/www.w3.org /2001/MagicXMLSchema.xsd
-> platform:/plugin/org.eclipse.xsd_1.1.0/cache/www.w3.org/2001 /MagicXMLSchema.xsd

open:platform:/plugin/org.eclipse.xsd_1.1.0/cache/www.w3.org /2001/XMLSchema.xsd
-> platform:/plugin/org.eclipse.xsd_1.1.0/cache/www.w3.org/2001 /XMLSchema.xsd

open:http://www.w3.org/2001/xml.xsd
-> platform:/plugin/org.eclipse.xsd_1.1.0/cache/www.w3.org/2001 /xml.xsd

open:platform:/plugin/org.eclipse.xsd_1.1.0/cache/www.w3.org /2001/XMLSchema-instance.xsd
-> platform:/plugin/org.eclipse.xsd_1.1.0/cache/www.w3.org/2001 /XMLSchema-instance.xsd

open:http://www.w3.org/TR/voicexml20/vxml-datatypes.xsd
->http://www.w3.org/TR/voicexml20/vxml-datatypes.xsd
open:http://www.w3.org/TR/voicexml20/vxml-attribs.xsd
->http://www.w3.org/TR/voicexml20/vxml-attribs.xsd
open:http://www.w3.org/TR/voicexml20/vxml-grammar-extension. xsd
->http://www.w3.org/TR/voicexml20/vxml-grammar-extension.xsd
open:http://www.w3.org/TR/voicexml20/vxml-grammar-restrictio n.xsd
-> http://www.w3.org/TR/voicexml20/vxml-grammar-restriction.xsd
open:http://www.w3.org/TR/voicexml20/grammar-core.xsd
->http://www.w3.org/TR/voicexml20/grammar-core.xsd
open:http://www.w3.org/2001/xml.xsd ->http://www.w3.org/2001/xml.xsd
open:http://www.w3.org/TR/voicexml20/vxml-synthesis-extensio n.xsd
-> http://www.w3.org/TR/voicexml20/vxml-synthesis-extension.xsd
open:http://www.w3.org/TR/voicexml20/vxml-synthesis-restrict ion.xsd
-> http://www.w3.org/TR/voicexml20/vxml-synthesis-restriction.x sd
open:http://www.w3.org/TR/voicexml20/synthesis-core.xsd
->http://www.w3.org/TR/voicexml20/synthesis-core.xsd

I'm not sure what you've tried that failed...


Jens Lukowski wrote:

> Hi
>
> I want to use a local cache for my resources/schemas.
> I tried to provide my own URIResolver and looked at the example in the docs.
> Everything works fine if I pass back the URI I get (an absolute one with
> http://) but if I map the URI to a file:// URI it only loads the outermost
> schema and doesn't have any element declarations. I checked the inputstream
> generated by URIResolver.createInputStream and it has the correct schema
> file in it but the URIResolver is never called for the other schemas
> referenced by import or include.
> What do I do wrong ? I also tried calling schema.setLocation but it didn't
> make any difference.
> The xsd file I use is: http://www.w3.org/TR/voicexml20/vxml.xsd
>
> thanx
> Jens Lukowski

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

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
Jens,
<p>If I add this code to XSDMainTest:
<blockquote>412a414,423
<br>>
<br>>
<br>> resourceSet.getURIConverter().getURIMap().put
<br>>&nbsp;&nbsp; (URI.createURI("<A HREF="http://www.w3.org/TR/voicexml20/vxml.xsd">http://www.w3.org/TR/voicexml20/vxml.xsd</A>"),
URI.createURI("<A HREF="file://d:/stuff/vxml.xsd">file://d:/stuff/vxml.xsd</A>"));</blockquote>
Add this code to URIConverterImpl:
<blockquote>380a381
<br>> System.err.println("open:" + uri + " ->" + converted);</blockquote>
And make sure that the vxml.xsd is present at that file system location,
then I get this trace (when running xsd-test.bat -validate&nbsp; http://www.w3.org/TR/voicexml20/vxml.xsd):
<blockquote>open:<A HREF="http://www.w3.org/TR/voicexml20/vxml.xsd">http://www.w3.org/TR/voicexml20/vxml.xsd</A> -><A HREF="file://d:/stuff/vxml.xsd">file://d:/stuff/vxml.xsd</A>
<br> open:platform:/plugin/org.eclipse.xsd_1.1.0/cache/www.w3.org /2001/MagicXMLSchema.xsd
-> platform:/plugin/org.eclipse.xsd_1.1.0/cache/www.w3.org/2001 /MagicXMLSchema.xsd
<br> open:platform:/plugin/org.eclipse.xsd_1.1.0/cache/www.w3.org /2001/XMLSchema.xsd
-> platform:/plugin/org.eclipse.xsd_1.1.0/cache/www.w3.org/2001 /XMLSchema.xsd
<br>open:<A HREF="http://www.w3.org/2001/xml.xsd">http://www.w3.org/2001/xml.xsd</A> -> platform:/plugin/org.eclipse.xsd_1.1.0/cache/www.w3.org/2001 /xml.xsd
<br> open:platform:/plugin/org.eclipse.xsd_1.1.0/cache/www.w3.org /2001/XMLSchema-instance.xsd
-> platform:/plugin/org.eclipse.xsd_1.1.0/cache/www.w3.org/2001 /XMLSchema-instance.xsd
<br>open:<A HREF="http://www.w3.org/TR/voicexml20/vxml-datatypes.xsd">http://www.w3.org/TR/voicexml20/vxml-datatypes.xsd</A> -><A HREF="http://www.w3.org/TR/voicexml20/vxml-datatypes.xsd">http://www.w3.org/TR/voicexml20/vxml-datatypes.xsd</A>
<br>open:<A HREF="http://www.w3.org/TR/voicexml20/vxml-attribs.xsd">http://www.w3.org/TR/voicexml20/vxml-attribs.xsd</A> -><A HREF="http://www.w3.org/TR/voicexml20/vxml-attribs.xsd">http://www.w3.org/TR/voicexml20/vxml-attribs.xsd</A>
<br>open:<A HREF="http://www.w3.org/TR/voicexml20/vxml-grammar-extension.xsd">http://www.w3.org/TR/voicexml20/vxml-grammar-extension.xsd</A> -><A HREF="http://www.w3.org/TR/voicexml20/vxml-grammar-extension.xsd">http://www.w3.org/TR/voicexml20/vxml-grammar-extension.xsd</A>
<br>open:<A HREF=" http://www.w3.org/TR/voicexml20/vxml-grammar-restriction.xsd"> http://www.w3.org/TR/voicexml20/vxml-grammar-restriction.xsd</A> -><A HREF=" http://www.w3.org/TR/voicexml20/vxml-grammar-restriction.xsd"> http://www.w3.org/TR/voicexml20/vxml-grammar-restriction.xsd</A>
<br>open:<A HREF="http://www.w3.org/TR/voicexml20/grammar-core.xsd">http://www.w3.org/TR/voicexml20/grammar-core.xsd</A> -><A HREF="http://www.w3.org/TR/voicexml20/grammar-core.xsd">http://www.w3.org/TR/voicexml20/grammar-core.xsd</A>
<br>open:<A HREF="http://www.w3.org/2001/xml.xsd">http://www.w3.org/2001/xml.xsd</A> -><A HREF="http://www.w3.org/2001/xml.xsd">http://www.w3.org/2001/xml.xsd</A>
<br>open:<A HREF=" http://www.w3.org/TR/voicexml20/vxml-synthesis-extension.xsd"> http://www.w3.org/TR/voicexml20/vxml-synthesis-extension.xsd</A> -><A HREF=" http://www.w3.org/TR/voicexml20/vxml-synthesis-extension.xsd"> http://www.w3.org/TR/voicexml20/vxml-synthesis-extension.xsd</A>
<br>open:<A HREF=" http://www.w3.org/TR/voicexml20/vxml-synthesis-restriction.x sd"> http://www.w3.org/TR/voicexml20/vxml-synthesis-restriction.x sd</A>
-><A HREF=" http://www.w3.org/TR/voicexml20/vxml-synthesis-restriction.x sd"> http://www.w3.org/TR/voicexml20/vxml-synthesis-restriction.x sd</A>
<br>open:<A HREF="http://www.w3.org/TR/voicexml20/synthesis-core.xsd">http://www.w3.org/TR/voicexml20/synthesis-core.xsd</A> -><A HREF="http://www.w3.org/TR/voicexml20/synthesis-core.xsd">http://www.w3.org/TR/voicexml20/synthesis-core.xsd</A></blockquote>
I'm not sure what you've tried that failed...
<br>&nbsp;
<p>Jens Lukowski wrote:
<blockquote TYPE=CITE>Hi
<p>I want to use a local cache for my resources/schemas.
<br>I tried to provide my own URIResolver and looked at the example in
the docs.
<br>Everything works fine if I pass back the URI I get (an absolute one
with
<br><a href="http://">http://</a>) but if I map the URI to a <a href="file://">file://</a>
URI it only loads the outermost
<br>schema and doesn't have any element declarations. I checked the inputstream
<br>generated by URIResolver.createInputStream and it has the correct schema
<br>file in it but the URIResolver is never called for the other schemas
<br>referenced by import or include.
<br>What do I do wrong ? I also tried calling schema.setLocation but it
didn't
<br>make any difference.
<br>The xsd file I use is: <a href="http://www.w3.org/TR/voicexml20/vxml.xsd">http://www.w3.org/TR/voicexml20/vxml.xsd</a>
<p>thanx
<br>&nbsp; Jens Lukowski</blockquote>
</html>

--------------EDCAA123E00247A90218C9D5--
Re: Local Cache of Schemas [message #572999 is a reply to message #23546] Mon, 16 June 2003 11:23 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33139
Registered: July 2009
Senior Member
--------------EDCAA123E00247A90218C9D5
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Jens,

If I add this code to XSDMainTest:

412a414,423
>
>
> resourceSet.getURIConverter().getURIMap().put
> (URI.createURI("http://www.w3.org/TR/voicexml20/vxml.xsd"),
URI.createURI("file://d:/stuff/vxml.xsd"));

Add this code to URIConverterImpl:

380a381
> System.err.println("open:" + uri + " ->" + converted);

And make sure that the vxml.xsd is present at that file system location, then I
get this trace (when running xsd-test.bat -validate
http://www.w3.org/TR/voicexml20/vxml.xsd):

open:http://www.w3.org/TR/voicexml20/vxml.xsd
->file://d:/stuff/vxml.xsd
open:platform:/plugin/org.eclipse.xsd_1.1.0/cache/www.w3.org /2001/MagicXMLSchema.xsd
-> platform:/plugin/org.eclipse.xsd_1.1.0/cache/www.w3.org/2001 /MagicXMLSchema.xsd

open:platform:/plugin/org.eclipse.xsd_1.1.0/cache/www.w3.org /2001/XMLSchema.xsd
-> platform:/plugin/org.eclipse.xsd_1.1.0/cache/www.w3.org/2001 /XMLSchema.xsd

open:http://www.w3.org/2001/xml.xsd
-> platform:/plugin/org.eclipse.xsd_1.1.0/cache/www.w3.org/2001 /xml.xsd

open:platform:/plugin/org.eclipse.xsd_1.1.0/cache/www.w3.org /2001/XMLSchema-instance.xsd
-> platform:/plugin/org.eclipse.xsd_1.1.0/cache/www.w3.org/2001 /XMLSchema-instance.xsd

open:http://www.w3.org/TR/voicexml20/vxml-datatypes.xsd
->http://www.w3.org/TR/voicexml20/vxml-datatypes.xsd
open:http://www.w3.org/TR/voicexml20/vxml-attribs.xsd
->http://www.w3.org/TR/voicexml20/vxml-attribs.xsd
open:http://www.w3.org/TR/voicexml20/vxml-grammar-extension. xsd
->http://www.w3.org/TR/voicexml20/vxml-grammar-extension.xsd
open:http://www.w3.org/TR/voicexml20/vxml-grammar-restrictio n.xsd
-> http://www.w3.org/TR/voicexml20/vxml-grammar-restriction.xsd
open:http://www.w3.org/TR/voicexml20/grammar-core.xsd
->http://www.w3.org/TR/voicexml20/grammar-core.xsd
open:http://www.w3.org/2001/xml.xsd ->http://www.w3.org/2001/xml.xsd
open:http://www.w3.org/TR/voicexml20/vxml-synthesis-extensio n.xsd
-> http://www.w3.org/TR/voicexml20/vxml-synthesis-extension.xsd
open:http://www.w3.org/TR/voicexml20/vxml-synthesis-restrict ion.xsd
-> http://www.w3.org/TR/voicexml20/vxml-synthesis-restriction.x sd
open:http://www.w3.org/TR/voicexml20/synthesis-core.xsd
->http://www.w3.org/TR/voicexml20/synthesis-core.xsd

I'm not sure what you've tried that failed...


Jens Lukowski wrote:

> Hi
>
> I want to use a local cache for my resources/schemas.
> I tried to provide my own URIResolver and looked at the example in the docs.
> Everything works fine if I pass back the URI I get (an absolute one with
> http://) but if I map the URI to a file:// URI it only loads the outermost
> schema and doesn't have any element declarations. I checked the inputstream
> generated by URIResolver.createInputStream and it has the correct schema
> file in it but the URIResolver is never called for the other schemas
> referenced by import or include.
> What do I do wrong ? I also tried calling schema.setLocation but it didn't
> make any difference.
> The xsd file I use is: http://www.w3.org/TR/voicexml20/vxml.xsd
>
> thanx
> Jens Lukowski

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

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
Jens,
<p>If I add this code to XSDMainTest:
<blockquote>412a414,423
<br>>
<br>>
<br>> resourceSet.getURIConverter().getURIMap().put
<br>>&nbsp;&nbsp; (URI.createURI("<A HREF="http://www.w3.org/TR/voicexml20/vxml.xsd">http://www.w3.org/TR/voicexml20/vxml.xsd</A>"),
URI.createURI("<A HREF="file://d:/stuff/vxml.xsd">file://d:/stuff/vxml.xsd</A>"));</blockquote>
Add this code to URIConverterImpl:
<blockquote>380a381
<br>> System.err.println("open:" + uri + " ->" + converted);</blockquote>
And make sure that the vxml.xsd is present at that file system location,
then I get this trace (when running xsd-test.bat -validate&nbsp; http://www.w3.org/TR/voicexml20/vxml.xsd):
<blockquote>open:<A HREF="http://www.w3.org/TR/voicexml20/vxml.xsd">http://www.w3.org/TR/voicexml20/vxml.xsd</A> -><A HREF="file://d:/stuff/vxml.xsd">file://d:/stuff/vxml.xsd</A>
<br> open:platform:/plugin/org.eclipse.xsd_1.1.0/cache/www.w3.org /2001/MagicXMLSchema.xsd
-> platform:/plugin/org.eclipse.xsd_1.1.0/cache/www.w3.org/2001 /MagicXMLSchema.xsd
<br> open:platform:/plugin/org.eclipse.xsd_1.1.0/cache/www.w3.org /2001/XMLSchema.xsd
-> platform:/plugin/org.eclipse.xsd_1.1.0/cache/www.w3.org/2001 /XMLSchema.xsd
<br>open:<A HREF="http://www.w3.org/2001/xml.xsd">http://www.w3.org/2001/xml.xsd</A> -> platform:/plugin/org.eclipse.xsd_1.1.0/cache/www.w3.org/2001 /xml.xsd
<br> open:platform:/plugin/org.eclipse.xsd_1.1.0/cache/www.w3.org /2001/XMLSchema-instance.xsd
-> platform:/plugin/org.eclipse.xsd_1.1.0/cache/www.w3.org/2001 /XMLSchema-instance.xsd
<br>open:<A HREF="http://www.w3.org/TR/voicexml20/vxml-datatypes.xsd">http://www.w3.org/TR/voicexml20/vxml-datatypes.xsd</A> -><A HREF="http://www.w3.org/TR/voicexml20/vxml-datatypes.xsd">http://www.w3.org/TR/voicexml20/vxml-datatypes.xsd</A>
<br>open:<A HREF="http://www.w3.org/TR/voicexml20/vxml-attribs.xsd">http://www.w3.org/TR/voicexml20/vxml-attribs.xsd</A> -><A HREF="http://www.w3.org/TR/voicexml20/vxml-attribs.xsd">http://www.w3.org/TR/voicexml20/vxml-attribs.xsd</A>
<br>open:<A HREF="http://www.w3.org/TR/voicexml20/vxml-grammar-extension.xsd">http://www.w3.org/TR/voicexml20/vxml-grammar-extension.xsd</A> -><A HREF="http://www.w3.org/TR/voicexml20/vxml-grammar-extension.xsd">http://www.w3.org/TR/voicexml20/vxml-grammar-extension.xsd</A>
<br>open:<A HREF=" http://www.w3.org/TR/voicexml20/vxml-grammar-restriction.xsd"> http://www.w3.org/TR/voicexml20/vxml-grammar-restriction.xsd</A> -><A HREF=" http://www.w3.org/TR/voicexml20/vxml-grammar-restriction.xsd"> http://www.w3.org/TR/voicexml20/vxml-grammar-restriction.xsd</A>
<br>open:<A HREF="http://www.w3.org/TR/voicexml20/grammar-core.xsd">http://www.w3.org/TR/voicexml20/grammar-core.xsd</A> -><A HREF="http://www.w3.org/TR/voicexml20/grammar-core.xsd">http://www.w3.org/TR/voicexml20/grammar-core.xsd</A>
<br>open:<A HREF="http://www.w3.org/2001/xml.xsd">http://www.w3.org/2001/xml.xsd</A> -><A HREF="http://www.w3.org/2001/xml.xsd">http://www.w3.org/2001/xml.xsd</A>
<br>open:<A HREF=" http://www.w3.org/TR/voicexml20/vxml-synthesis-extension.xsd"> http://www.w3.org/TR/voicexml20/vxml-synthesis-extension.xsd</A> -><A HREF=" http://www.w3.org/TR/voicexml20/vxml-synthesis-extension.xsd"> http://www.w3.org/TR/voicexml20/vxml-synthesis-extension.xsd</A>
<br>open:<A HREF=" http://www.w3.org/TR/voicexml20/vxml-synthesis-restriction.x sd"> http://www.w3.org/TR/voicexml20/vxml-synthesis-restriction.x sd</A>
-><A HREF=" http://www.w3.org/TR/voicexml20/vxml-synthesis-restriction.x sd"> http://www.w3.org/TR/voicexml20/vxml-synthesis-restriction.x sd</A>
<br>open:<A HREF="http://www.w3.org/TR/voicexml20/synthesis-core.xsd">http://www.w3.org/TR/voicexml20/synthesis-core.xsd</A> -><A HREF="http://www.w3.org/TR/voicexml20/synthesis-core.xsd">http://www.w3.org/TR/voicexml20/synthesis-core.xsd</A></blockquote>
I'm not sure what you've tried that failed...
<br>&nbsp;
<p>Jens Lukowski wrote:
<blockquote TYPE=CITE>Hi
<p>I want to use a local cache for my resources/schemas.
<br>I tried to provide my own URIResolver and looked at the example in
the docs.
<br>Everything works fine if I pass back the URI I get (an absolute one
with
<br><a href="http://">http://</a>) but if I map the URI to a <a href="file://">file://</a>
URI it only loads the outermost
<br>schema and doesn't have any element declarations. I checked the inputstream
<br>generated by URIResolver.createInputStream and it has the correct schema
<br>file in it but the URIResolver is never called for the other schemas
<br>referenced by import or include.
<br>What do I do wrong ? I also tried calling schema.setLocation but it
didn't
<br>make any difference.
<br>The xsd file I use is: <a href="http://www.w3.org/TR/voicexml20/vxml.xsd">http://www.w3.org/TR/voicexml20/vxml.xsd</a>
<p>thanx
<br>&nbsp; Jens Lukowski</blockquote>
</html>

--------------EDCAA123E00247A90218C9D5--


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Problems with: xsdSchema.setSchemaForSchemaQNamePrefix("xsd:")
Next Topic:XML Schema Equivalence
Goto Forum:
  


Current Time: Sat Apr 20 11:06:13 GMT 2024

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

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

Back to the top