You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Andreas Deininger <ad...@googlemail.com> on 2005/10/21 11:30:43 UTC

VelocityGenerator: error when sending string containing ampersand

Hi,

I wrote the following, very simple flowscript:

 function velotest() {
    cocoon.sendPage("abstract.vm", { "test" : "vm&vm" } );
  }

With abstract.vm being an velocity template processed by the Velocity Generator:

<?xml version ?>
<data>$test</data>

I receive the following error, due to the occurence of the
ampersand-sign in the "vm&vm" string::

An Error Occurred: The reference to entity "vm" must end with the ';' delimiter.

However, if I use a JXTemplate (like shown below) as argument of
sendPage, processed by the JX Generator, everthing is fine.

<?xml version="1.0"?>
<html xmlns:jx="http://apache.org/cocoon/templates/jx/1.0">
This works: ${test}
</html>

Why is the behaviour different with the two generators?
If I pass the string "something&more" to a velocity template, using
Java as programming language, everything works fine.

Thanks a lot for your help

Regards
Andreas

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: VelocityGenerator: error when sending string containing ampersand

Posted by Ralph Goers <Ra...@dslextreme.com>.
Andreas Deininger wrote:

>2005/10/23, Joerg Heinicke <jo...@gmx.de>:
>
>  
>
>>This seems to be a bug with the Velocity Generator as the sent value is
>>not escaped, i.e. & remains & and does not get converted to &amp; in the
>>resulting XML. You might file a bug report for it.
>>    
>>
>
>I would like to, however I encounter the following message:
>
> Sorry, entering bugs into product Cocoon 2 has been disabled.
>
>Any special reason for that (upcoming release of version 2.1.8??)
>  
>
Cocoon switched from Bugzilla to Jira over the weekend.

>TIA
>Regards
>Andreas
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: VelocityGenerator: error when sending string containing ampersand

Posted by Bertrand Delacretaz <bd...@apache.org>.
Le 24 oct. 05, à 11:19, Andreas Deininger a écrit :

> ... Sorry, entering bugs into product Cocoon 2 has been disabled.
>
> Any special reason for that (upcoming release of version 2.1.8??)..

Yes, the issues are being moved Jira, stay tuned...

-Bertrand


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: VelocityGenerator: error when sending string containing ampersand

Posted by Christoph Hermann <ch...@guschtel.de>.
Andreas Deininger schrieb:

Hello,

>>This seems to be a bug with the Velocity Generator as the sent value is
>>not escaped, i.e. & remains & and does not get converted to &amp; in the
>>resulting XML. You might file a bug report for it.

> I would like to, however I encounter the following message:
> 
>  Sorry, entering bugs into product Cocoon 2 has been disabled.
> 
> Any special reason for that (upcoming release of version 2.1.8??)

Yes and no. The reason is that all Bugs are moved from bugzilla to Jira
(see dev-list).
So you should be able to enter a new Bug in Jira (imho).

HTH
Christoph

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: VelocityGenerator: error when sending string containing ampersand

Posted by Andreas Deininger <ad...@googlemail.com>.
2005/10/23, Joerg Heinicke <jo...@gmx.de>:

> This seems to be a bug with the Velocity Generator as the sent value is
> not escaped, i.e. & remains & and does not get converted to &amp; in the
> resulting XML. You might file a bug report for it.

I would like to, however I encounter the following message:

 Sorry, entering bugs into product Cocoon 2 has been disabled.

Any special reason for that (upcoming release of version 2.1.8??)

TIA
Regards
Andreas

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: VelocityGenerator: error when sending string containing ampersand

Posted by Joerg Heinicke <jo...@gmx.de>.
On 21.10.2005 11:30, Andreas Deininger wrote:

> Hi,
> 
> I wrote the following, very simple flowscript:
> 
>  function velotest() {
>     cocoon.sendPage("abstract.vm", { "test" : "vm&vm" } );
>   }
> 
> With abstract.vm being an velocity template processed by the Velocity Generator:
> 
> <?xml version ?>
> <data>$test</data>
> 
> I receive the following error, due to the occurence of the
> ampersand-sign in the "vm&vm" string::
> 
> An Error Occurred: The reference to entity "vm" must end with the ';' delimiter.
> 
> However, if I use a JXTemplate (like shown below) as argument of
> sendPage, processed by the JX Generator, everthing is fine.
> 
> <?xml version="1.0"?>
> <html xmlns:jx="http://apache.org/cocoon/templates/jx/1.0">
> This works: ${test}
> </html>
> 
> Why is the behaviour different with the two generators?
> If I pass the string "something&more" to a velocity template, using
> Java as programming language, everything works fine.

This seems to be a bug with the Velocity Generator as the sent value is 
not escaped, i.e. & remains & and does not get converted to &amp; in the 
resulting XML. You might file a bug report for it.

Jörg

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org