XSD metamodel - XSD caching [message #496635] |
Tue, 10 November 2009 18:10  |
Eclipse User |
|
|
|
In our project we use XSD Schema meta-model and our schema model is xml schema itself (http://www.w3.org/2001/XMLSchema.xsd).
When we add schema it resolves imports and tries to load imported schema from "http://www.w3.org/2001/xml.xsd". We tried to use local schema while meta-model creation (by loading it from " platform:/plugin/org.eclipse.xsd/cache/www.w3.org/2001/XMLSc hema.xsd "). It worked fine but the imported schema ("xml.xsd") still was taken from internet.
We tried different solutions to make everything to be loaded locally. For example loading "xml.xsd" from a bundle first and changing the URI of the resource to "http://www.w3.org/2001/xml.xsd", or having in our plug-in copy of "XMLSchema.xsd" with modified import to point to local schema location for "xml.xsd". All solutions worked fine but had some flaws.
Eventually we ended up with providing extension for standard EMF URIConverter to remap internet URIs to its local counterparts.
<extension
point="org.eclipse.emf.ecore.uri_mapping">
<mapping
source="http://www.w3.org/2001/"
target="platform:/plugin/org.eclipse.xsd/cache/www.w3.org/2001/ ">
</mapping>
</extension>
After this change everything works fine and XSDs are loaded from bundles (URIs are still external "http:www...").
Do you think it should be done this way? Does anybody have a better solution? Any response would be appreciated.
|
|
|
Re: XSD metamodel - XSD caching [message #496656 is a reply to message #496635] |
Tue, 10 November 2009 19:47   |
Eclipse User |
|
|
|
Jan,
Wouldn't it be better to use the XSD model in org.eclipse.xsd for
working with schema instances? I can't imagine you'd be able to do many
interesting things with just the syntactic model you'd get from the
schema for schemas.
Jan Arciuchiewicz wrote:
> In our project we use XSD Schema meta-model and our schema model is
> xml schema itself (http://www.w3.org/2001/XMLSchema.xsd).
>
> When we add schema it resolves imports and tries to load imported
> schema from "http://www.w3.org/2001/xml.xsd". We tried to use local
> schema while meta-model creation (by loading it from "
> platform:/plugin/org.eclipse.xsd/cache/www.w3.org/2001/XMLSc hema.xsd
> "). It worked fine but the imported schema ("xml.xsd") still was taken
> from internet.
>
> We tried different solutions to make everything to be loaded locally.
> For example loading "xml.xsd" from a bundle first and changing the URI
> of the resource to "http://www.w3.org/2001/xml.xsd", or having in our
> plug-in copy of "XMLSchema.xsd" with modified import to point to local
> schema location for "xml.xsd". All solutions worked fine but had some
> flaws.
> Eventually we ended up with providing extension for standard EMF
> URIConverter to remap internet URIs to its local counterparts.
>
> <extension
> point="org.eclipse.emf.ecore.uri_mapping">
> <mapping
> source="http://www.w3.org/2001/"
>
> target="platform:/plugin/org.eclipse.xsd/cache/www.w3.org/2001/ ">
> </mapping>
> </extension>
>
> After this change everything works fine and XSDs are loaded from
> bundles (URIs are still external "http:www...").
>
> Do you think it should be done this way? Does anybody have a better
> solution? Any response would be appreciated.
>
|
|
|
Re: XSD metamodel - XSD caching [message #496761 is a reply to message #496656] |
Wed, 11 November 2009 10:25  |
Eclipse User |
|
|
|
Good point.
The problem is that the issue is in an existing code which do some kind of Xtend M2M transfromation from UML with custom profiles to WSDL/XSD.
One of our beta client has a misconfigured proxy and export takes minutes because it tries to load referenced "xml.xsd" from internet.
Thanks for your response.
|
|
|
Powered by
FUDForum. Page generated in 0.02613 seconds