Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [JET2] Starnge behavior with xmi:type tags
[JET2] Starnge behavior with xmi:type tags [message #14785] Fri, 04 May 2007 10:42 Go to next message
Eclipse User
Originally posted by: vincent.lg.voila.fr

Hello everyone,

I'm currently working with jet2 transformations and I encounter a strange
behavior with xmi:xxx tags.
Following this post ,
http://www.eclipse.org/newsportal/article.php?id=58&grou p=eclipse.modeling.m2t#58,
it says that such tags as xmi:type can't be accessed directly using
<c:get> tags. I already tested this feature and no xmi:type="xxx" appeared
when dumping, which seems to be correct. But testing today, all 'xmi:xxx'
tags are replaced with simple 'xxx' tags. ie. all 'xmi:type' are replaced
with 'type' tags.

here is an example:

XMI element:
<port xmi:type="RequiredPort" name="myport" type="required" ...>

Dump:
<port type="my_ns:RequiredPort" name="myport" type="required">

I know I could rename the 'type' tags to ensure any duplicated tags, but I
don't understand why this behavior has changed, given that I don't even
change any version of my plugins since months !!!

Does anybody has any idea of what happend and how to correct it ?
Thanks !
Re: [JET2] Starnge behavior with xmi:type tags [message #14818 is a reply to message #14785] Fri, 04 May 2007 13:08 Go to previous messageGo to next message
Eclipse User
Originally posted by: vincent.lg.voila.fr

I've done some debugging in DumpTag.java to see how attributes of an
element are parsed.

XPathContextExtender#resolve(node, ATTRIBUTEs_XPATH) is used to retrieve
the list of attributes of the current node.

Currently, the list appears as is :
[XMI:type='Port', XMI:id="_4H...", name="myport", type='required',
id='_4H']

I replaced all xmi:xxx tags in my input file with xsi:xxx tags and now the
list do not contains xsi:xxx tags anymore [name="myport", type='required',
id='_4H'], which is supposed to be a good behavior.

Why xsi tags are removed whereas xmi are not ? is it a bug, jet isn't
supposed to use an XML/XMI loader ?

(PS: The input file as an XMI format because it has been generated with a
GMF Editor)
Re: [JET2] Starnge behavior with xmi:type tags [message #14848 is a reply to message #14818] Fri, 04 May 2007 13:29 Go to previous messageGo to next message
Eclipse User
Originally posted by: vincent.lg.voila.fr

Ok, I've found my error.

I used to override the model extension parser in my GMF Editor plugin, in
order to allow cut/copy/paste to work. The GMFResourceParser used to
generate xmi tags instead of xsi tags, and caused dysfunctions in jet
transformations.

Bye.
Re: [JET2] Starnge behavior with xmi:type tags [message #14876 is a reply to message #14785] Fri, 04 May 2007 13:51 Go to previous messageGo to next message
Paul Elder is currently offline Paul Elder
Messages: 849
Registered: July 2009
Senior Member
Vincent:

I think I'll need a bit more information to diagnose this:

1) what version of Eclipse, EMF and JET are you using.

2) A complete input document would be helpful, too.

Paul

"vincent" <vincent.lg@voila.fr> wrote in message
news:ac51e3fd770bf408ab269417594c0f34$1@www.eclipse.org...
> Hello everyone,
> I'm currently working with jet2 transformations and I encounter a strange
> behavior with xmi:xxx tags. Following this post ,
> http://www.eclipse.org/newsportal/article.php?id=58&grou p=eclipse.modeling.m2t#58,
> it says that such tags as xmi:type can't be accessed directly using
> <c:get> tags. I already tested this feature and no xmi:type="xxx" appeared
> when dumping, which seems to be correct. But testing today, all 'xmi:xxx'
> tags are replaced with simple 'xxx' tags. ie. all 'xmi:type' are replaced
> with 'type' tags.
>
> here is an example:
>
> XMI element:
> <port xmi:type="RequiredPort" name="myport" type="required" ...>
>
> Dump:
> <port type="my_ns:RequiredPort" name="myport" type="required">
>
> I know I could rename the 'type' tags to ensure any duplicated tags, but I
> don't understand why this behavior has changed, given that I don't even
> change any version of my plugins since months !!!
>
> Does anybody has any idea of what happend and how to correct it ?
> Thanks !
>
Re: [JET2] Starnge behavior with xmi:type tags [message #14903 is a reply to message #14848] Fri, 04 May 2007 13:58 Go to previous message
Paul Elder is currently offline Paul Elder
Messages: 849
Registered: July 2009
Senior Member
Vincent:

Glad you resolved it. For the record, JET uses EMF to load its documents.

If the document uses a namespace, and there is an ECore model registered for
that namespace, JET uses the associated EMF Resource Factory to load.

If the namespace has no associated ECore model, or there is no namespace,
JET uses EMFs GenericXMLResourceFactory.

In either case, EMF eats the xmi:type can converts it into an EClass name.

I am considering creating a XML loader that uses the w3c DOM. The loaded
models may be larger, but that way the in memory model would exactly match
on disk file - something that doesn't happen with EMF.

Paul


"vincent" <vincent.lg@voila.fr> wrote in message
news:1598cd960a5a1048e01f2f18be4e309a$1@www.eclipse.org...
> Ok, I've found my error.
>
> I used to override the model extension parser in my GMF Editor plugin, in
> order to allow cut/copy/paste to work. The GMFResourceParser used to
> generate xmi tags instead of xsi tags, and caused dysfunctions in jet
> transformations.
>
> Bye.
>
Previous Topic:XSD as XML representation for JET
Next Topic:[JET2] JDT dependencies?
Goto Forum:
  


Current Time: Fri Oct 24 15:31:35 GMT 2014

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

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