XMI instance with HREFs only [message #1695055] |
Mon, 11 May 2015 11:52  |
Eclipse User |
|
|
|
Hi folks,
I'm trying to generate an Ecore instance and all I can get is this :
<?xml version="1.0" encoding="ASCII"?>
<OwnEcore:OMetaModel xmlns:OwnEcore="OwnEcore">
<classes href="out/test.xml#/1"/>
<datatypes href="out/test.xml#/9"/>
<datatypes href="out/test.xml#/10"/>
<datatypes href="out/test.xml#/18"/>
</OwnEcore:OMetaModel>
It is to note that the resource.getContents() contains more than one elements.
Also, to fill the StructuralReferences, I use either
EList<EObject> list = (EList<EObject>)source.eGet(or.getEreference(), false);
list.add(eo);
or
source.eSet(or.getEreference(), eo);
both give the same result.
Any clue ?
|
|
|
|
|
Re: XMI instance with HREFs only [message #1695075 is a reply to message #1695063] |
Mon, 11 May 2015 16:23   |
Eclipse User |
|
|
|
Edoaurd,
Comments below.
On 11/05/2015 7:06 PM, Edoaurd Batot wrote:
> Thanks Ed,
>
> to be more concise, I add element to the list provided by eGet when
> applicable and I do an eSet otherwise.
Yes. But of course I already know that, so I guess there is no question
in this regard...
> And I mean that both do the same (one on a list, the other on a single
> element)
Yes.
> as they put a HREF in the resource.
This doesn't parse for me.
>
> I've tryed using XMIResourceImpl too, but it throws a NullPointer :
> Exception in thread "main" java.lang.NullPointerException
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.getHREF(XMLHelperImpl.java:808)
That doesn't match a line number in EMF 2.11.
>
> The HREF keeps bothering.
This also doesn't parse.
>
> For any further precision, just ask.
You're the one with questions, but there are no question marks in this
post, so presumably you ran out of questions....
|
|
|
|
|
|
Re: XMI instance with HREFs only [message #1695483 is a reply to message #1695462] |
Fri, 15 May 2015 04:14  |
Eclipse User |
|
|
|
Comments below.
On 15/05/2015 12:05 AM, Edoaurd Batot wrote:
> Thanks for he reply, but the otpion doesn't help.
It has no impact on serialization at all?
> But I guess something else must wrong as the simplest test case can't
> be open anymore.
I guess I must guess too.
> Look at that model, why Eclipse refuse to open it ? I mean, tries
> hard, fills the stack, and explodes.
And I should just at the nature of these symptoms?
> <?xml version="1.0" encoding="ASCII"?>
> <xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:FeatureDiagram="FeatureDiagram">
> <FeatureDiagram:And owningFeature="#/2" features="#/2">
> <enum>lit_1</enum>
> <enum>lit_0</enum>
> <testON>0.15720427</testON>
> <testON>0.73726165</testON>
> <testON>0.93219703</testON>
> </FeatureDiagram:And>
> <FeatureDiagram:Feature name="EString386" optional="true">
> <parent href="#/2"/>
> <children href="#/1"/>
> <operators xsi:type="FeatureDiagram:And" href="#/0"/>
> </FeatureDiagram:Feature>
> <FeatureDiagram:PrimitiveFeature name="EString686"/>
> </xmi:XMI>
>
> I build the model randomly from the Ecore specification. I assure the
> model is valid as I print it in other formats that give results.
>
> Another point :
> Look at the last line of the model : I applied an eSet (right
> EStructuralFeature with its right EObject (or list) as with other
> references) but it stays empty. Is there any condition which could
> restraint silently from setting an EReference ?
A dangling reference.
>
>
> Quelque chose m'échappe...
|
|
|
Powered by
FUDForum. Page generated in 0.06030 seconds