|
|
|
Re: Unable to load model which was created using the same emf [message #987618 is a reply to message #987598] |
Tue, 27 November 2012 10:41 |
Ed Merks Messages: 33137 Registered: July 2009 |
Senior Member |
|
|
Ravi,
Comments below.
On 27/11/2012 11:02 AM, Ravikanth Somayaji wrote:
> Thanks for you response, Ed.
>
>> What's going wrong?
> The generated EMF editor fails to open up the model which it
> previously created.
>> What exactly did you do to load the model?
> Invoke the editor. The model contains DocumentRoot->Ref->Mem When only
> Ref is added, the editor opens up ok, however, when Mem is added the
> editor goes berserk and complains of FeatureNotFoundException.
Are you sure that your generated resource factory is being used to load
the resource? Set a breakpoint in the generated resource factory's
createResource method to find out.
>
>> You've invoked "Generate Test Code" and looked at how the generated
> XyzExample.java does loading and saving?
You weren't specific about your scenario, so I couldn't be sure if you
were running in the IDE or trying to do something stand alone.
> Yes - however, this does not add Mem to the model in the example, when
> I modify to add Mem, the loading fails with the same exception.
Hmmm, that's definitely using your generated resource factory...
Looking more closely at the attachments, did you do something to make
the nsPrefix be the empty string? That looks like the source of the
problem, i.e., your nested element is implicitly namespace qualified but
that doesn't conform to the schema (where it looks like Mem is a local
element declaration that should have no namespace qualification in the
instance XML).
>
> Cheers,
> Ravi
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
|
Re: Unable to load model which was created using the same emf [message #987625 is a reply to message #987624] |
Tue, 27 November 2012 11:04 |
Ed Merks Messages: 33137 Registered: July 2009 |
Senior Member |
|
|
Ravi,
Comments below.
On 27/11/2012 11:58 AM, Ravikanth Somayaji wrote:
>>> Looking more closely at the attachments, did you do something to make
> the nsPrefix be the empty string? That looks like the source of the
> problem, i.e., your nested element is implicitly namespace qualified but
> that doesn't conform to the schema (where it looks like Mem is a local
> element declaration that should have no namespace qualification in the
> instance XML).
>
>
> Yes, I have cleared the nsPrefix - as my existing xml don't have any
> prefix and I'd like to keep it that way. But, now that you mentioned
> it, I'm beginning to realise that might be the problem.
Definitely.
>
> Do you reckon, I change the xsd to add elementFormDefault="qualified"
> in the xsd:schema declaration or can I change something in the ecore
> or genmodel to let the generator consider this scenario?
Yes, you should make sure your schema specifies the right syntax for the
instances, so that should do the trick.
>
> I appreciate your interest.
>
> Cheers
> Ravi
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
|
Powered by
FUDForum. Page generated in 0.01666 seconds