[Acceleo 3.1] protected block [message #636510] |
Mon, 01 November 2010 16:10 |
Sergio Messages: 21 Registered: August 2010 Location: Cardedeu |
Junior Member |
|
|
Hi,
I'm trying to generate code for xml files. Is there any restrictions of the type of comments respected on the protected 'zone'?
The problem is that every time, when I edit the code between the protected block on the generated xml file, this code is erased after a regeneration and a .xml.lost file is generated with the erased code.
<!--[protected ('protected')]-->
<!--[/protected]-->
You know that for comments in xml I have to use: " <!--" and "-->"
If I only use the protected tags:
[protected ('protected')]
[/protected]
then all is fine, but I need the tags for the comments: "<!--"...
Thanks you,
Sergio
Sergio Sacristán
http://s2o-bcn.blogspot.com/
|
|
|
|
Re: [Acceleo 3.1] protected block [message #636586 is a reply to message #636578] |
Tue, 02 November 2010 05:36 |
Sergio Messages: 21 Registered: August 2010 Location: Cardedeu |
Junior Member |
|
|
Thank you for the answer.
Yes, really I can't believe what's happening here. I was working with acceleo a few years ago, and after made some test this summer with acceleo 3.0, we began a big new project with accelo 3.1. Now I only have 3 protected zones in a acceleo project, this is the code:
- zone 1:
Logger.debug(this, "[o.name/]", "inicio");
//[protected ('delegateService')]
//[/protected]
remoteService.setParameters([getParametertToCall(o) /]);
-> the code here is not respected, and no *.lost file is generated.
- zone 2:
<!--[protected ('generateContext')]-->
<!--[/protected]-->
--> the code here is not respected, but a *.lost file is generated
- zone 3:
<!--[protected ('generateServicesXML')]-->
<!--[/protected]-->
--> the code here is not respected, but a *.lost file is generated
I'm sure that I'm doing a great mistake, but by the time I can't
see what's wrong.
thank you!
Sergio Sacristán
http://s2o-bcn.blogspot.com/
[Updated on: Tue, 02 November 2010 05:37] Report message to a moderator
|
|
|
Re: [Acceleo 3.1] protected block [message #636636 is a reply to message #636586] |
Tue, 02 November 2010 10:08 |
|
Hi Sergio,
You've run here against a limitation that was already present in Acceleo 2 : you cannot have anything on the "start of user code" line other than the actual identifier of your protected area, as we'll try and match this identifier when restoring lost code.
<!-- [protected ('protected')] -->
you'll have to set the "comment end" on the following line as in :
<!-- [protected ('protected')]
-->
<!-- [/protected] --> (this one is not an issue)
If you really need the "-->" to end your comment on the same line as the start of user code, it will have to be part of the area's identifier :
<!-- [protected ('protected' + ' -->')]
Or we won't be able to match the identifiers against one another.
However, the first of your three exemples in your last comment bugs me :
Quote: |
//[protected ('delegateService')]
//[/protected]
[...]
the code here is not respected
|
This is the usual use case, and is tested and retested. Are your sure this is "not" respected ?
Laurent Goubet
Obeo
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04377 seconds