commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Libbrecht <p...@activemath.org>
Subject Re: [jelly]Tags in strings
Date Tue, 06 Jul 2004 08:00:36 GMT
Well, this seems to be a bug but after thinking of it, it's not one !

<j:set var="blop">My XML Content</j:set>

will load the content "My XML Content" as XML... if you want the string 
"<" in there, it has to be passed as &lt; (otherwise it couldn't pass 
the "<" of the tags).

Here's two ways to do what you probably want:

<j:set var="help.browser.error.message"
	value="&lt;html&gt;This is just a 
&lt;i&gt;simple&lt;/i&gt;test.&lt;/html&gt;"/>

<j:set var="help.browser.error.message"><html>This is just a 
<i>simple</i> test.</html></j:set>

But be careful if running this from maven, the parser might bite you: 
any ant or werkz tag can be written in the no-namespace world. WHich 
means that you can't safely input "<jar>" as part of that.

Maybe, to suit your needs, you would wish something like the very dirty 
"disable-output-escaping" attribute of XSLT... you'll need to file a 
feature request, hopefully with a patch.

paul


Le 3-Jul-04, à 21:40 Uhr, Peter Nabbefeld a écrit :
> I've tried the following:
>
>         <j:invokeStatic className="javax.swing.JOptionPane" 
> method="showMessageDialog">
>           <j:arg type="java.awt.Component"/>
>           <j:set var="help.browser.error.message"><![CDATA[<html>This

> is just a <i>simple</i>test.</html>]]></j:set>
>           <j:arg type="java.lang.Object" 
> value="${help.browser.error.message}"/>
>         </j:invokeStatic>
>
> I've got all the tags escaped ("&lt;html&gt; ...") - why?
>
> Kind regards
>
> Peter Nabbefeld
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message