|
|
Re: XMI instance with HREFs only [message #1695063 is a reply to message #1695059] |
Mon, 11 May 2015 17:06 |
Edouard R. Batot Messages: 100 Registered: March 2015 |
Senior Member |
|
|
Thanks Ed,
to be more concise, I add element to the list provided by eGet when applicable and I do an eSet otherwise. And I mean that both do the same (one on a list, the other on a single element) as they put a HREF in the resource.
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)
The HREF keeps bothering.
For any further precision, just ask.
PS : oups, "or" is a wrapper I use to generate the structure. It contains the EStructuralFeature : or.getEReference().
And "eo" is the OBject to insert.
[Updated on: Mon, 11 May 2015 17:10] Report message to a moderator
|
|
|
Re: XMI instance with HREFs only [message #1695075 is a reply to message #1695063] |
Mon, 11 May 2015 20:23 |
Ed Merks Messages: 33113 Registered: July 2009 |
Senior Member |
|
|
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....
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Re: XMI instance with HREFs only [message #1695080 is a reply to message #1695075] |
Mon, 11 May 2015 20:52 |
Edouard R. Batot Messages: 100 Registered: March 2015 |
Senior Member |
|
|
How to get rid of the HREF and have the targeted links contained in the XML element instead ?
<?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:Or/>
<FeatureDiagram:And>
<owningFeature href="#/4"/>
</FeatureDiagram:And>
<FeatureDiagram:Feature name="EString35" optional="true">
<parent href="#/3"/>
<operators xsi:type="FeatureDiagram:Or" href="#/0"/>
</FeatureDiagram:Feature>
<FeatureDiagram:PrimitiveFeature name="EString5">
<children href="#/2"/>
<operators xsi:type="FeatureDiagram:And" href="#/1"/>
</FeatureDiagram:PrimitiveFeature>
<FeatureDiagram:PrimitiveFeature name="EString35"/>
</xmi:XMI>
And the line number, might be erroneous, but the exception pops from method getHREF() anyway.
The throwing instruction must be objectURI.toString(); where objectURI is null.
[Updated on: Mon, 11 May 2015 21:16] Report message to a moderator
|
|
|
|
|
Re: XMI instance with HREFs only [message #1695483 is a reply to message #1695462] |
Fri, 15 May 2015 08:14 |
Ed Merks Messages: 33113 Registered: July 2009 |
Senior Member |
|
|
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...
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.02883 seconds