Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » XML Schema Definition (XSD) » Loading one Resource using different URLs
Loading one Resource using different URLs [message #579844] Thu, 16 October 2003 06:20
Eclipse UserFriend
Originally posted by: cipher8000.yahoo.com

Hi Ed,

I started experiencing different problem today..now i am using common
ResourceSet
to load boo.xsd, but this time i have two imports for foo.xsd, please look
at the boo.xsd, one import uses "http://localhost:8080/test/foo.xsd" and the
next import
uses "http://localhost:8080/test/.//foo.xsd", the both URLs are same (the
second one is little bit twisted but it is pointing to the same resource)
pointing to foo.xsd.
When i ran the "xsd-test.bat" against this boo.xsd, it loads the foo.xsd
twice. I think
the loading of xsd resources goes based on literal schema location name.

c:\>xsd-test.bat -validate http://localhost:8080/test/boo.xsd
--> http://localhost:8080/test/boo.xsd
--> http://localhost:8080/test/foo.xsd
--> http://localhost:8080/test/common.xsd
--> http://localhost:8080/test/.//foo.xsd [*loaded second time*]
--> http://localhost:8080/test/goo.xsd


Here are the schemas(boo.xsd, foo.xsd, goo.xsd & common.xsd):

boo.xsd:
<schema targetNamespace="boo" xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:boo="boo" xmlns:foo="foo" xmlns:goo="goo">
<import namespace="foo"
schemaLocation="http://localhost:8080/test/foo.xsd" />

<!-- the schemaLocation is little bit twisted but pointing to the same
foo.xsd -->
<import namespace="foo"
schemaLocation="http://localhost:8080/test/.//foo.xsd" />
<import namespace="goo"
schemaLocation="http://localhost:8080/test/goo.xsd" />
<element name="boo-foo" substitutionGroup="foo:foo"/>
<element name="boo-goo" substitutionGroup="goo:goo"/>
</schema>

foo.xsd:
<schema targetNamespace="foo" xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:foo="foo" xmlns:common="common">
<import namespace="common" schemaLocation="common.xsd" />
<element name="foo" substitutionGroup="common:common"/>
</schema>

goo.xsd:
<schema targetNamespace="goo" xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:goo="goo" xmlns:common="common">
<import namespace="common" schemaLocation="common.xsd" />
<element name="goo" substitutionGroup="common:common"/>
</schema>

common.xsd:
<schema targetNamespace="common" xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:common="common">
<element name="common"/>
</schema>
Previous Topic:Sharing a common schema instance across many schemas
Next Topic:Loading one Resource using different URLs
Goto Forum:
  


Current Time: Tue Apr 23 11:17:55 GMT 2024

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

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

Back to the top