Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » XSD metamodel - XSD caching
XSD metamodel - XSD caching [message #496635] Tue, 10 November 2009 18:10 Go to next message
Jan Arciuchiewicz is currently offline Jan ArciuchiewiczFriend
Messages: 11
Registered: November 2009
Junior Member
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 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
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.
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: XSD metamodel - XSD caching [message #496761 is a reply to message #496656] Wed, 11 November 2009 10:25 Go to previous message
Jan Arciuchiewicz is currently offline Jan ArciuchiewiczFriend
Messages: 11
Registered: November 2009
Junior Member
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.
Previous Topic:[Announce] M2T XPAND 0.8.0M3 is available
Next Topic:[Check, xTend]
Goto Forum:
  


Current Time: Thu Apr 25 07:09:03 GMT 2024

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

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

Back to the top