Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » How JET compares with XSLT?
How JET compares with XSLT? [message #492743] Wed, 21 October 2009 15:12 Go to next message
Asha Ramegowda is currently offline Asha Ramegowda
Messages: 77
Registered: July 2009
Member
Hi,

After discovering all cool features of JET I felt it's great and thought that would be a great solution to our problem.
But one of my colleagues felt JET is not providing anything better than XSLT Sad !!!
With my limited knowledge of XSLT all I could answer was it does't have kind of tags that helps not regenerate some part of artifacts with the help of <c:initialCode> and <c:userRegion>.
But later it has most (or some?!) of the things similar to XSLT, probably.
And of course, though XSLT fails in certain ways to be used as a generator of html files in web applications especially against JSPs/Servlets because of it's static template based approach, I felt of course, may be it works when we have to deal with only templates generating same artifacts all the time.
But, probably someone will have to do lot of things to integrate XSLT into a Java application to generate code.
But, still I would like to know the clear cut advantages of JET over XSLT if those two technologies are comparable Smile.
And, whether XSLT was one of the technologies that inspired JET Surprised ?!!

Thank you,

Asha.
Re: How JET compares with XSLT? [message #492858 is a reply to message #492743] Thu, 22 October 2009 06:44 Go to previous messageGo to next message
Eclipse User
Originally posted by: loic.fejoz.realtimeatwork.com

Hi,

You should have a look at this blog article:
http://pjmolina.com/metalevel/2009/06/choosing-a-template-en gine-for-code-generation/

It has lots of pro and cons for several template languages.

XSLT is really for *simple* xml to xml ( or text or html) but not more.

XSLT is already integrated in java through several library (for instance
http://www-sop.inria.fr/acacia/cours/entpe2004/HTML/xslt/s41 .html).

--
regards,
Loïc Fejoz

Asha R a écrit :
> Hi,
>
> After discovering all cool features of JET I felt it's great and thought
> that would be a great solution to our problem.
> But one of my colleagues felt JET is not providing anything better than
> XSLT :( !!!
> With my limited knowledge of XSLT all I could answer was it does't have
> kind of tags that helps not regenerate some part of artifacts with the
> help of <c:initialCode> and <c:userRegion>.
> But later it has most (or some?!) of the things similar to XSLT, probably.
> And of course, though XSLT fails in certain ways to be used as a
> generator of html files in web applications especially against
> JSPs/Servlets because of it's static template based approach, I felt of
> course, may be it works when we have to deal with only templates
> generating same artifacts all the time.
> But, probably someone will have to do lot of things to integrate XSLT
> into a Java application to generate code.
> But, still I would like to know the clear cut advantages of JET over
> XSLT if those two technologies are comparable :).
> And, whether XSLT was one of the technologies that inspired JET :o ?!!
>
> Thank you,
>
> Asha.
>
Re: How JET compares with XSLT? [message #492874 is a reply to message #492858] Thu, 22 October 2009 07:51 Go to previous messageGo to next message
Eclipse User
Originally posted by: florianwendland.freenet.de

Hi Asha,

as Loïc mentioned, XSLT is only for transformation between either XML
and XML or XML and text. But in context of M2T in a model-driven
environment, you won't transform the XMI directly. That makes no sense,
and that's the point where JET2 got its power. By its extension
mechanism, JET2 allows traversing over Ecore-Models (or any other
datamodel, for which an extension was written) with all JET2
capabilities for code generation.

So, from my point of view, the clear cut between XSLT and JET2 is that,
XSLT is just for XML-specific input models, whether JET2 provides some
convenient concepts for code generation from any kind of input model, in
particular from Ecore models. One of JET2 greatest disadvantages is in
my opinion the lack of native OCL support and it's tedious to start a
JET2 transformation programmatically (compared to Acceleo code generator
for example).

HTH
Timothy

Loïc Fejoz schrieb:
> Hi,
>
> You should have a look at this blog article:
> http://pjmolina.com/metalevel/2009/06/choosing-a-template-en gine-for-code-generation/
>
>
> It has lots of pro and cons for several template languages.
>
> XSLT is really for *simple* xml to xml ( or text or html) but not more.
>
> XSLT is already integrated in java through several library (for instance
> http://www-sop.inria.fr/acacia/cours/entpe2004/HTML/xslt/s41 .html).
>
Re: How JET compares with XSLT? [message #493674 is a reply to message #492874] Tue, 27 October 2009 14:31 Go to previous messageGo to next message
Asha Ramegowda is currently offline Asha Ramegowda
Messages: 77
Registered: July 2009
Member
Hi,

Thanks for the replies.
But, I guess I can not program the XSLT templates the way I can program JET.
In my case our requirement is indeed to generate XML files.
So, probably in a web based context xPand or Acceleo is suitable (as JET is not suitable as it does not work out of the eclipse environment) and advanced than XSLT.
As already we have some kind of XSLT based approach for the generation of the XML files, I wanted to know, whether going for Acceleo or xPand would enhance our capabilities to generate XML code or it's almost equivalent to XSLT?

Thank you,

Asha.
Re: How JET compares with XSLT? [message #493812 is a reply to message #493674] Wed, 28 October 2009 07:36 Go to previous messageGo to next message
Eclipse User
Originally posted by: loic.fejoz.realtimeatwork.com

Hi,

It also depends on your webserver! Is it java based? Your application
server might come with a template language, isn't it?

Otherwise there is also java libraries for transformation. Tom is one of
them <http://tom.loria.fr>. It is very powerful but I must say that I
know the authors. ;-)

--
regards,
Loïc Fejoz

Asha R a écrit :
> Hi,
>
> Thanks for the replies.
> But, I guess I can not program the XSLT templates the way I can program
> JET.
> In my case our requirement is indeed to generate XML files.
> So, probably in a web based context xPand or Acceleo is suitable (as JET
> is not suitable as it does not work out of the eclipse environment) and
> advanced than XSLT.
> As already we have some kind of XSLT based approach for the generation
> of the XML files, I wanted to know, whether going for Acceleo or xPand
> would enhance our capabilities to generate XML code or it's almost
> equivalent to XSLT?
>
> Thank you,
>
> Asha.
Re: How JET compares with XSLT? [message #494000 is a reply to message #493812] Wed, 28 October 2009 17:18 Go to previous messageGo to next message
Asha Ramegowda is currently offline Asha Ramegowda
Messages: 77
Registered: July 2009
Member
Hi Loïc,

Eclipse User wrote on Wed, 28 October 2009 03:36
Originally posted by: loic.fejoz.realtimeatwork.com

Hi,

>>It also depends on your webserver! Is it java based? Your >>application server might come with a template language, isn't it?

Yeah it's Java Based. It's Apache Tomcat. You mean we should use JSP's to generate code? That probably leads us to discover some other custom tag library similar to JET, if you meant JSPs. Smile.

>>Otherwise there is also java libraries for transformation. Tom is one of them <http://tom.loria.fr>. It is very powerful but I must say that I know the authors. Wink

Laughing . I will try Tom to see how it works sometime. So, you know the authors so you can sometimes influence them to get something done in Tom in case we need. Smile.

Thank you,

Asha.

--
regards,
Loïc Fejoz

Asha R a écrit :
> Hi,
>
> Thanks for the replies.
> But, I guess I can not program the XSLT templates the way I can program
> JET.
> In my case our requirement is indeed to generate XML files.
> So, probably in a web based context xPand or Acceleo is suitable (as JET
> is not suitable as it does not work out of the eclipse environment) and
> advanced than XSLT.
> As already we have some kind of XSLT based approach for the generation
> of the XML files, I wanted to know, whether going for Acceleo or xPand
> would enhance our capabilities to generate XML code or it's almost
> equivalent to XSLT?
>
> Thank you,
>
> Asha.

[Updated on: Wed, 28 October 2009 17:22]

Report message to a moderator

Re: How JET compares with XSLT? [message #494094 is a reply to message #494000] Thu, 29 October 2009 08:23 Go to previous messageGo to next message
Eclipse User
Originally posted by: loic.fejoz.realtimeatwork.com

Asha R a écrit :
> Hi Loïc,
>
> Eclipse User wrote on Wed, 28 October 2009 03:36
>> Originally posted by: loic.fejoz.realtimeatwork.com
>>
>> Hi,
>>
>> It also depends on your webserver! Is it java based? Your application
>> server might come with a template language, isn't it?
>>
>> Yeah it's Java Based. It's Apache Tomcat. You mean we can use JSP's to
>> generate code?

Why not? You can generate text that can represent whatever you want...

If you know this technology the best and the project is small/simple, it
may be a solution.

Personally, I would not do it and prefer something more dedicated like
OMG MTL but that is just a matter of taste and background.

>> Otherwise there is also java libraries for transformation. Tom is one
>> of them <http://tom.loria.fr>. It is very powerful but I must say that
>> I know the authors. ;)
>>
>> :lol: . I will try Tom to see how it works sometime. So, you know
>> the authors so you can sometimes influence them to get something done
>> in Tom in case we need. :).

It might be the case indeed. ;-)
Anyway there are really happy to see new users. they are also really
prompt to answer to question on the user mailing-list.

This is not on their webpage but I know some (french) company already
use Tom. They use it for M2M transformation but Tom can also be used for
M2T.

--
regards,
Loïc
Re: How JET compares with XSLT? [message #494439 is a reply to message #494094] Fri, 30 October 2009 15:56 Go to previous message
Cedric Brun is currently offline Cedric Brun
Messages: 367
Registered: July 2009
Senior Member
Hi,

using a dedicated model2text engine like Acceleo and XPand is way more
powerful than JSP if you've got an EMF model. You can write templates which
are automatically specializing others depending on your Ecore classes
hierachy, you can define templates with guards, or even override a template
with an "aspect like" syntax if you want to adapt an existing template
without physically changing it.

As a sidenote, Acceleo is an implementation of the OMG MTL.

Cédric

Loïc Fejoz wrote:

> Asha R a écrit :
>> Hi Loïc,
>>
>> Eclipse User wrote on Wed, 28 October 2009 03:36
>>> Originally posted by: loic.fejoz.realtimeatwork.com
>>>
>>> Hi,
>>>
>>> It also depends on your webserver! Is it java based? Your application
>>> server might come with a template language, isn't it?
>>>
>>> Yeah it's Java Based. It's Apache Tomcat. You mean we can use JSP's to
>>> generate code?
>
> Why not? You can generate text that can represent whatever you want...
>
> If you know this technology the best and the project is small/simple, it
> may be a solution.
>
> Personally, I would not do it and prefer something more dedicated like
> OMG MTL but that is just a matter of taste and background.

>
>>> Otherwise there is also java libraries for transformation. Tom is one
>>> of them <http://tom.loria.fr>. It is very powerful but I must say that
>>> I know the authors. ;)
>>>
>>> :lol: . I will try Tom to see how it works sometime. So, you know
>>> the authors so you can sometimes influence them to get something done
>>> in Tom in case we need. :).
>
> It might be the case indeed. ;-)
> Anyway there are really happy to see new users. they are also really
> prompt to answer to question on the user mailing-list.
>
> This is not on their webpage but I know some (french) company already
> use Tom. They use it for M2M transformation but Tom can also be used for
> M2T.
>
Previous Topic:[Acceleo] Generate emtl file without acceleo nature?
Next Topic:[Acceleo] Cannot access a class's package attribute
Goto Forum:
  


Current Time: Tue Sep 23 10:37:51 GMT 2014

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

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