Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMT (Generative Modeling Technologies) » [TCS] Strange xsi:type tag value prefix
[TCS] Strange xsi:type tag value prefix [message #378073] Thu, 07 June 2007 11:20 Go to next message
Eclipse UserFriend
Originally posted by: quentin.glineur.obeo.fr

Hi,

When I do my TCS injection, I get a result file in which some tag have
their xsi:type attribute value prefixed with "_1", "_2" or any
underscored number.

example :
<elements xsi:type="Option" name="Explicit"/>
....
<elements xsi:type="_2:Function" hasVisibility="true"/>
<elements xsi:type="_2:Attribute" name="gm_newfont">
<elements xsi:type="_2:Attribute" name="Typeface" hasType="true">
<type xsi:type="_3:FullRef">
...
</type>
</elements>

Do anybody knows the reason and/or the way to fix it ?

Thanks
Quentin
Re: [TCS] Strange xsi:type tag value prefix [message #378074 is a reply to message #378073] Thu, 07 June 2007 13:28 Go to previous messageGo to next message
Frédéric Jouault is currently offline Frédéric JouaultFriend
Messages: 572
Registered: July 2009
Senior Member
Hello,

> When I do my TCS injection, I get a result file in which some tag have
> their xsi:type attribute value prefixed with "_1", "_2" or any
> underscored number.
>
> example :
> <elements xsi:type="Option" name="Explicit"/>
> ....
> <elements xsi:type="_2:Function" hasVisibility="true"/>
> <elements xsi:type="_2:Attribute" name="gm_newfont">
> <elements xsi:type="_2:Attribute" name="Typeface" hasType="true">
> <type xsi:type="_3:FullRef">
> ...
> </type>
> </elements>
>
> Do anybody knows the reason

The reason why you have the _1 and _2 prefixes is that EMF uses this
kind of prefix when no nsPrefix is defined for the Package containing a
given type.


> and/or the way to fix it ?

Firstly, this is *not* a bug in TCS or EMF.

XMI is mostly about being able to read back a model that has been
previously written. This means that you rarely need to tune it. One
uncommon case in which you may need to tune it is when you want to make
it compatible with another XMI tool.

However, many users want to tune the XMI output even when it is not
necessary. Others believe their models are incorrect because they, in
fact, do not understand XMI (which is indeed sometimes confusing). For
these reasons, I wish the default format of Model Engineering was not
XML-based but some kind of binary format nobody would care to look into ;-D.

Sorry for repeating this again and again (I should definitely put this
in the FAQ). I do not mean to state that you do not have a reason (even
for cosmetics) to want to tune your XMI output. However, I would really
like everybody to understand that it is usually not necessary ;-).



If you need to have different prefixes, then you may consider that this
is a bug in your metamodel (i.e., lack of nsPrefix).

If you designed you metamodel with KM3, you may add the following
comment before the Package definition to set the nsPrefix:

-- @nsPrefix somePrefix


But, before doing this, you should consider whether you really need it
or not :-).


Best regards,

Frédéric Jouault
Re: [TCS] Strange xsi:type tag value prefix [message #378075 is a reply to message #378074] Thu, 07 June 2007 14:30 Go to previous message
Eclipse UserFriend
Originally posted by: quentin.glineur.obeo.fr

Frédéric Jouault a écrit :
> Hello,
>
> > When I do my TCS injection, I get a result file in which some tag have
> > their xsi:type attribute value prefixed with "_1", "_2" or any
> > underscored number.
> >
> > example :
> > <elements xsi:type="Option" name="Explicit"/>
> > ....
> > <elements xsi:type="_2:Function" hasVisibility="true"/>
> > <elements xsi:type="_2:Attribute" name="gm_newfont">
> > <elements xsi:type="_2:Attribute" name="Typeface" hasType="true">
> > <type xsi:type="_3:FullRef">
> > ...
> > </type>
> > </elements>
> >
> > Do anybody knows the reason
>
> The reason why you have the _1 and _2 prefixes is that EMF uses this
> kind of prefix when no nsPrefix is defined for the Package containing a
> given type.
>

OK, I had even not noticed the xmlns definition (shamefully)
Many thanks !

>
> > and/or the way to fix it ?
>
> Firstly, this is *not* a bug in TCS or EMF.
>
> XMI is mostly about being able to read back a model that has been
> previously written. This means that you rarely need to tune it. One
> uncommon case in which you may need to tune it is when you want to make
> it compatible with another XMI tool.
>
> However, many users want to tune the XMI output even when it is not
> necessary. Others believe their models are incorrect because they, in
> fact, do not understand XMI (which is indeed sometimes confusing). For
> these reasons, I wish the default format of Model Engineering was not
> XML-based but some kind of binary format nobody would care to look into
> ;-D.

In fact, as I am performing prototypes of TCS files, I use the result
checking as a test for conformity. So XML output is definitively a good
choice in there ;-D

> Sorry for repeating this again and again (I should definitely put this
> in the FAQ). I do not mean to state that you do not have a reason (even
> for cosmetics) to want to tune your XMI output. However, I would really
> like everybody to understand that it is usually not necessary ;-).
>
>
> If you need to have different prefixes, then you may consider that this
> is a bug in your metamodel (i.e., lack of nsPrefix).
>
> If you designed you metamodel with KM3,

Of course ;-D

you may add the following
> comment before the Package definition to set the nsPrefix:
>
> -- @nsPrefix somePrefix
>
>
> But, before doing this, you should consider whether you really need it
> or not :-).
>

Definitively not !

>
> Best regards,
>
> Frédéric Jouault


Regards, Quentin
Re: [TCS] Strange xsi:type tag value prefix [message #601655 is a reply to message #378073] Thu, 07 June 2007 13:28 Go to previous message
Frédéric Jouault is currently offline Frédéric JouaultFriend
Messages: 572
Registered: July 2009
Senior Member
Hello,

> When I do my TCS injection, I get a result file in which some tag have
> their xsi:type attribute value prefixed with "_1", "_2" or any
> underscored number.
>
> example :
> <elements xsi:type="Option" name="Explicit"/>
> ....
> <elements xsi:type="_2:Function" hasVisibility="true"/>
> <elements xsi:type="_2:Attribute" name="gm_newfont">
> <elements xsi:type="_2:Attribute" name="Typeface" hasType="true">
> <type xsi:type="_3:FullRef">
> ...
> </type>
> </elements>
>
> Do anybody knows the reason

The reason why you have the _1 and _2 prefixes is that EMF uses this
kind of prefix when no nsPrefix is defined for the Package containing a
given type.


> and/or the way to fix it ?

Firstly, this is *not* a bug in TCS or EMF.

XMI is mostly about being able to read back a model that has been
previously written. This means that you rarely need to tune it. One
uncommon case in which you may need to tune it is when you want to make
it compatible with another XMI tool.

However, many users want to tune the XMI output even when it is not
necessary. Others believe their models are incorrect because they, in
fact, do not understand XMI (which is indeed sometimes confusing). For
these reasons, I wish the default format of Model Engineering was not
XML-based but some kind of binary format nobody would care to look into ;-D.

Sorry for repeating this again and again (I should definitely put this
in the FAQ). I do not mean to state that you do not have a reason (even
for cosmetics) to want to tune your XMI output. However, I would really
like everybody to understand that it is usually not necessary ;-).



If you need to have different prefixes, then you may consider that this
is a bug in your metamodel (i.e., lack of nsPrefix).

If you designed you metamodel with KM3, you may add the following
comment before the Package definition to set the nsPrefix:

-- @nsPrefix somePrefix


But, before doing this, you should consider whether you really need it
or not :-).


Best regards,

Frédéric Jouault
Re: [TCS] Strange xsi:type tag value prefix [message #601663 is a reply to message #378074] Thu, 07 June 2007 14:30 Go to previous message
Eclipse UserFriend
Originally posted by: quentin.glineur.obeo.fr

Frédéric Jouault a écrit :
> Hello,
>
> > When I do my TCS injection, I get a result file in which some tag have
> > their xsi:type attribute value prefixed with "_1", "_2" or any
> > underscored number.
> >
> > example :
> > <elements xsi:type="Option" name="Explicit"/>
> > ....
> > <elements xsi:type="_2:Function" hasVisibility="true"/>
> > <elements xsi:type="_2:Attribute" name="gm_newfont">
> > <elements xsi:type="_2:Attribute" name="Typeface" hasType="true">
> > <type xsi:type="_3:FullRef">
> > ...
> > </type>
> > </elements>
> >
> > Do anybody knows the reason
>
> The reason why you have the _1 and _2 prefixes is that EMF uses this
> kind of prefix when no nsPrefix is defined for the Package containing a
> given type.
>

OK, I had even not noticed the xmlns definition (shamefully)
Many thanks !

>
> > and/or the way to fix it ?
>
> Firstly, this is *not* a bug in TCS or EMF.
>
> XMI is mostly about being able to read back a model that has been
> previously written. This means that you rarely need to tune it. One
> uncommon case in which you may need to tune it is when you want to make
> it compatible with another XMI tool.
>
> However, many users want to tune the XMI output even when it is not
> necessary. Others believe their models are incorrect because they, in
> fact, do not understand XMI (which is indeed sometimes confusing). For
> these reasons, I wish the default format of Model Engineering was not
> XML-based but some kind of binary format nobody would care to look into
> ;-D.

In fact, as I am performing prototypes of TCS files, I use the result
checking as a test for conformity. So XML output is definitively a good
choice in there ;-D

> Sorry for repeating this again and again (I should definitely put this
> in the FAQ). I do not mean to state that you do not have a reason (even
> for cosmetics) to want to tune your XMI output. However, I would really
> like everybody to understand that it is usually not necessary ;-).
>
>
> If you need to have different prefixes, then you may consider that this
> is a bug in your metamodel (i.e., lack of nsPrefix).
>
> If you designed you metamodel with KM3,

Of course ;-D

you may add the following
> comment before the Package definition to set the nsPrefix:
>
> -- @nsPrefix somePrefix
>
>
> But, before doing this, you should consider whether you really need it
> or not :-).
>

Definitively not !

>
> Best regards,
>
> Frédéric Jouault


Regards, Quentin
Previous Topic:[TCS] Strange xsi:type tag value prefix
Next Topic:Connecting DSL-eCore w/ UML2
Goto Forum:
  


Current Time: Fri Nov 28 06:13:49 GMT 2014

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

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