commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jason Lea <ja...@kumachan.net.nz>
Subject Re: [jelly] disable escaping of < and >
Date Fri, 30 Jul 2004 05:11:06 GMT
Thanks!  I had actually tried it earlier with the beta-3 download but it 
didn't work.  After hunting for the encoding/escaping controls I found I 
needed the latest CVS version to use them.  Using the xml:doctype now 
works with this latest code.


Dion Gillard wrote:

>Use this: 
>
>http://jakarta.apache.org/commons/jelly/libs/xml/tags.html#xml:doctype
>
>On Fri, 30 Jul 2004 14:27:58 +1200, Jason Lea <jason@kumachan.net.nz> wrote:
>  
>
>>I am having some trouble with having characters xml encoded in my jelly
>>script.
>>
>>I am trying to generate an XHTML web page, which I send as email.  Here
>>is the jelly file::|
>>
>><?xml version="1.0"?>
>>   <j:jelly trim="false" xmlns:j="jelly:core">
>>    <![CDATA[
>><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
>>"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
>>    ]]>
>>    <html xmlns="http://www.w3.org/1999/xhtml">
>>        <head>
>>        <title>foo</title>
>>    </head>
>>    <body>
>>        ...
>>    </body>
>>    </html>
>>   </j:jelly>|
>>
>>Which gives this output
>>
>>|&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
>>"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;
>>    <html xmlns="http://www.w3.org/1999/xhtml">
>>        <head>
>>||        <title>foo</title>
>>    </head>
>>    <body>
>>        ...
>>    </body>
>>    </html>
>>
>>|I have tried using <j:set> with escape set to false.  This sets a
>>variable, but I need the text to be output as a string, so writing out
>>the variable ends up escaping the < & > characters again.
>>
>>I get the output as a stream which I put into a string and attach to the
>>email message.  I suppose I could cheat and have the doctype prepended
>>to the string and not included in the jelly script, but that would be
>>crummy.
>>
>>Any ideas?  Am I doing something stupid?
>>
>>--
>>Jason Lea
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: commons-user-help@jakarta.apache.org
>>
>>
>>    
>>
>
>
>  
>


-- 
Jason Lea



Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message