Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » QVT-OML » Input model to be used by Operational QVT Interpreter
Input model to be used by Operational QVT Interpreter [message #904847] Wed, 29 August 2012 09:10 Go to next message
Eclipse User
Hello,

I'm transforming from an XSD model to an internal Ecore model. When
transforming programmatically, everything is fine:
- load the XSD source using XsdEcoreBuilder
- construct a model registry with all relevant IN/OUT models
- load XML input using my model registry
- run TransformationExecutor using my model registry

However, when I want to debug the QVTo script using the Operational QVT
Interpreter, it seems that the input XML file is loaded as an
XMIResource, and loading the mode extent fails.

Note that by means of a small plugin I have loaded the XSD model into
EMFs global model registry, so it is known to QVT. (Otherwise I couldn't
be editing the script anyway).

What can I do to enable debugging?

Thanks
Marius
Re: Input model to be used by Operational QVT Interpreter [message #904860 is a reply to message #904847] Wed, 29 August 2012 09:32 Go to previous messageGo to next message
Ed Willink is currently offline Ed Willink
Messages: 4095
Registered: July 2009
Senior Member
Hi

No idea.

But since you have a version that works and one that doesn't, you just
need to pin down the difference.

It seems that you have already identified that an XMIResource is in use
when you want something else, so
your factory registrations, probably file-extension to Resource factory
are wrong. If this isn't obvious
set a breakpoint on the erroneous XMIResource construction and gradually
work back to where
it came from. Better, break in ResourceSet.getResource and work forwards.

Regards

Ed Willink

On 29/08/2012 10:10, Marius Gröger wrote:
> Hello,
>
> I'm transforming from an XSD model to an internal Ecore model. When
> transforming programmatically, everything is fine:
> - load the XSD source using XsdEcoreBuilder
> - construct a model registry with all relevant IN/OUT models
> - load XML input using my model registry
> - run TransformationExecutor using my model registry
>
> However, when I want to debug the QVTo script using the Operational QVT
> Interpreter, it seems that the input XML file is loaded as an
> XMIResource, and loading the mode extent fails.
>
> Note that by means of a small plugin I have loaded the XSD model into
> EMFs global model registry, so it is known to QVT. (Otherwise I couldn't
> be editing the script anyway).
>
> What can I do to enable debugging?
>
> Thanks
> Marius
Re: Input model to be used by Operational QVT Interpreter [message #904873 is a reply to message #904860] Wed, 29 August 2012 09:44 Go to previous messageGo to next message
Eclipse User
On 29.08.2012 11:32, Ed Willink wrote:
> It seems that you have already identified that an XMIResource is in
> use when you want something else, so your factory registrations,
> probably file-extension to Resource factory are wrong. If this isn't
> obvious set a breakpoint on the erroneous XMIResource construction
> and gradually work back to where it came from. Better, break in
> ResourceSet.getResource and work forwards.

In my startup plugin that loads and registers the XSDs I have now added
this line:

Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap()
.put("myxml", new GenericXMLResourceFactoryImpl());

I've renamed the input file to have the .myxml suffix.

Now it works!

Regards
Marius
Re: Input model to be used by Operational QVT Interpreter [message #1249511 is a reply to message #904873] Tue, 18 February 2014 10:15 Go to previous message
ModelGeek Mising name is currently offline ModelGeek Mising name
Messages: 516
Registered: June 2011
Senior Member
Hi,

My desired work seems very similar to this. I want to transform XSD model to an Ecore model. I understand the steps you wrote to achieve this.

1 - load the XSD source using XsdEcoreBuilder : i can understand that
2 - construct a model registry with all relevant IN/OUT models : a bit confused about this
3 - load XML input using my model registry : confused about it
4 - run TransformationExecutor using my model registry


I am just a beginner in QVT. I am little uncerstain about step 2 and 3. Specially in step 3, do you mean that you instantiated you XSD's loaded ecore according to the XML? I am also interested in doing that..

Can you please share the details for step 3?

Cheers,
Previous Topic:Unit testing tools for QVTo?
Next Topic:QVTo code samples for project
Goto Forum:
  


Current Time: Thu Oct 23 16:41:02 GMT 2014

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

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