commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stéphane MOR <>
Subject [jelly] <j:file>, CDATA, '&' and '<'
Date Wed, 28 Aug 2002 00:10:34 GMT

I would like to use <j:file/> to generate a Perl Script (this can look
weird, but anyway ...).

The file I want to generate could look like (this VERY simple script):

<j:file name="" omitXmlDeclaration="true">
sub CheckName{
   my ($name, $age);

   if ( $name != "Stéphane" && $age < 22) {
       $return = &Foo();
       $return .= "you're not the one I expected";
       return $return;
       return "welcome !"

I solved the problem of the '$' being removed by Jelly when I doubled
them, ie:
my ($$name, $$age);

I tried to get it running and it said "org.xml.sax.SAXParseException:
The entity "Foo" was referenced, but not declared."

So, I enclosed the whole thing in a <![CDATA[]]> section.
All run well, but the resulting output file was:

sub CheckName{
   my ($name, $age);

   if ( $name != "Stéphane" &amp;&amp; $age &lt; 22) {
       $return = &amp;Foo();
       $return .= "you're not the one";
       return $return;
       return "welcome !"

So, I'd like to know how i can output '&', '<' and '>' nicely in a
<j:file/>, if possible.


PS: This occured while trying to make a Maven Wiki Plugin, using Maven
HEAD (and the Jelly SNAPSHOT) on a Linux
box under JDK1.3.1.

Do You Yahoo!? -- Une adresse gratuite et en français !
Yahoo! Mail :

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message