I never got a conclusive answer to this problem I posted a few weeks ago.  A
proposed solution was to use the "encode" attribute of the <j:set/> tag, but
it doesn't have any effect for some reason.  So maybe it's a bug in Jelly?

To restate the problem: If I set a variable to some XML data and later
dereference this variable, the output is escaped using XML entities.  I
would like the output to be in unescaped form.  I have tried the following:

        <j:jelly xmlns:j="jelly:core">
         <j:set var="foo" encode="false">
          <bar/>
         </j:set>
         ${foo}
        </j:jelly>

but despite the "encode" attribute is set to false the output is
"&lt;bar&gt;&lt;/bar&gt;".  And I'd like it to be "<bar></bar>" (or
"<bar/>").

Cheers,

--
knut

> > > I noticed that <j:set/> has an "encode" attribute, but 
> > that's used to
> > encode
> > > stuff like "&lt;" into "&amp;lt;", right?  So you propose 
> > to add another
> > > attribute "encoding" to control whether to encode data into 
> > valid XML
> > text?
> > 
> > Sorry I meant the 'encode' attribute. This defaults to true 
> which will
> > encode > into &lt;. So setting this to false will fix your issue.
> > 
> 
> Doesn't seem to work for me (using CVS version)...  No matter if I set
> "encode" to true or false, the outcome of the script:
> 
> <j:jelly xmlns:j="jelly:core">
>  <j:set var="foo" encode="false">
>   <bar/>
>  </j:set>
>  ${foo}
> </j:jelly>
> 
> is always "&lt;bar&gt;&lt;/bar&gt;".  Am I missing something 
> else here?
> 

Reply via email to