Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Some duvids about GMF model format
Some duvids about GMF model format [message #790965] Sun, 05 February 2012 04:04 Go to next message
Missing name Mising name is currently offline Missing name Mising nameFriend
Messages: 9
Registered: April 2011
Junior Member
I have two diferents GMF editor but the format of the generated model are diferents,
for example, with the GMF editor 1 the format generated is:

<contents xsi:type="XXX" name="NAME_X" id="ID" .../>
<contents xsi:type="YYY" name="NAME_Y" ...>
    <xxxs xxx_name="X" xxxType="//@contents.0/>
</contents>
[...]


and the GMF editor 2 the format generated is like:

<XXX name="NAME_X" id="ID" .../>
<YYY name="NAME_Y" ...>
    <xxxs xxx_name="X">
</YYY>
[...]


The first editor was made by a third person e the second was made by myself. My duvid is why in the first appear <contents xsi:type ... > and in the second not? Another duvid is, how I can change the references in the second format to became as the first (using //@contents.0 .. and not just a inner node)?
Re: Some duvids about GMF model format [message #791041 is a reply to message #790965] Sun, 05 February 2012 07:00 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
Registered: July 2009
Senior Member
Comments below.

On 05/02/2012 5:04 AM, Missing name Mising name wrote:
> I have two diferents GMF editor but the format of the generated model
> are diferents,
> for example, with the GMF editor 1 the format generated is:
>
>
> <contents xsi:type="XXX" name="NAME_X" id="ID" .../>
So this is an instance of XXX contained by something that has a
"contents" containment reference.
> <contents xsi:type="YYY" name="NAME_Y" ...>
> <xxxs xxx_name="X" xxxType="//@contents.0/>
> </contents>
> [...]
>
>
> and the GMF editor 2 the format generated is like:
>
>
> <XXX name="NAME_X" id="ID" .../>
This is an instance of XXX right at the root of the resource.
> <YYY name="NAME_Y" ...>
> <xxxs xxx_name="X">
> </YYY>
> [...]
>
>
> The first editor was made by a third person e the second was made by
> myself. My duvid is why in the first appear <contents xsi:type ... >
> and in the second not?
At the root, the type name is used as an element name. Anywhere below
that, the name of the containment reference is used as the element name
and if the object is not of the type of the containment reference but
rather a derived type, then that information needs to be in the XML as
well, via the xsi:/xmi:type.
> Another duvid is, how I can change the references in the second format
> to became as the first (using //@contents.0 .. and not just a inner
> node)?
Embed the objects in whatever has that "contents" reference or something
else with such a "contents" reference.


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Some duvids about GMF model format [message #791341 is a reply to message #791041] Sun, 05 February 2012 17:22 Go to previous messageGo to next message
Missing name Mising name is currently offline Missing name Mising nameFriend
Messages: 9
Registered: April 2011
Junior Member
so how I can change my model format to use xsi/xmi:type?

Re: Some duvids about GMF model format [message #791434 is a reply to message #791041] Sun, 05 February 2012 20:30 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
Registered: July 2009
Senior Member
Did you see the the part where I explained when and why there is an
xsi:type?

On 05/02/2012 8:00 AM, Ed Merks wrote:
> Comments below.
>
> On 05/02/2012 5:04 AM, Missing name Mising name wrote:
>> I have two diferents GMF editor but the format of the generated model
>> are diferents,
>> for example, with the GMF editor 1 the format generated is:
>>
>>
>> <contents xsi:type="XXX" name="NAME_X" id="ID" .../>
> So this is an instance of XXX contained by something that has a
> "contents" containment reference.
>> <contents xsi:type="YYY" name="NAME_Y" ...>
>> <xxxs xxx_name="X" xxxType="//@contents.0/>
>> </contents>
>> [...]
>>
>>
>> and the GMF editor 2 the format generated is like:
>>
>>
>> <XXX name="NAME_X" id="ID" .../>
> This is an instance of XXX right at the root of the resource.
>> <YYY name="NAME_Y" ...>
>> <xxxs xxx_name="X">
>> </YYY>
>> [...]
>>
>>
>> The first editor was made by a third person e the second was made by
>> myself. My duvid is why in the first appear <contents xsi:type ... >
>> and in the second not?
> At the root, the type name is used as an element name. Anywhere below
> that, the name of the containment reference is used as the element
> name and if the object is not of the type of the containment reference
> but rather a derived type, then that information needs to be in the
> XML as well, via the xsi:/xmi:type.
>> Another duvid is, how I can change the references in the second
>> format to became as the first (using //@contents.0 .. and not just a
>> inner node)?
> Embed the objects in whatever has that "contents" reference or
> something else with such a "contents" reference.


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:[solved]How get and set features values on drag and drop ?
Next Topic:Grouping Nodes and defining property for the group
Goto Forum:
  


Current Time: Fri Mar 29 00:27:57 GMT 2024

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

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

Back to the top