You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Greg Jones <gj...@bellsouth.net> on 2002/08/23 07:45:09 UTC

Transform/generate HTML tags with encoding

I need some help.

I have a form that a user can add HTML tags into. I.E. " <strong>This is
bolded</strong><table><tr><td> ..ect". 
When I retrieve the value from the request parameter:
<xsp:expr>request.getParameter("HtmlComment")</xsp:expr>

It is returned, it is returned as" &lt;strong&gt;&#13;This is
bolded&lt;/strong&gt;&#13;&lt;table&gt;&#13;..

I have tried to save the parameter to an output using the
SourceWritingTransformer but it just saved the file with the encoded
stuff.

I have put a servlet filter on the front of the tomcat server to spit
out the parameter before it gets to cocoon and it is logging it
correctly: 
<strong>This is bolded</strong><table><tr><td> ..


So, I'm assuming the issue is with cocoon and the generator / xsp.

Does anyone know how to get this to be read by XSP as HTML tags and not
the encoded version?


I can't really search the archives for this since the results of the
archives saves stuff encoded so everything comes back as a result.


Thanks for any help.

- Greg



RE: Transform/generate HTML tags with encoding

Posted by Greg Jones <gj...@bellsouth.net>.
Thanks for you help. This is what I was looking for 

-----Original Message-----
From: Vadim Gritsenko [mailto:vadim.gritsenko@verizon.net] 
Sent: Friday, August 23, 2002 8:43 AM
To: cocoon-users@xml.apache.org
Subject: Re: Transform/generate HTML tags with encoding


Greg Jones wrote:

> I need some help.
>
> I have a form that a user can add HTML tags into. I.E. " <strong>This
> is bolded</strong><table><tr><td> &.ect".
> When I retrieve the value from the request parameter: 
> <xsp:expr>request.getParameter("HtmlComment")</xsp:expr>
>
> It is returned, it is returned as" &lt;strong&gt;&#13;This is
> bolded&lt;/strong&gt;&#13;&lt;table&gt;&#13;&&
>
> I have tried to save the parameter to an output using the
> SourceWritingTransformer but it just saved the file with the encoded 
> stuff.
>
> I have put a servlet filter on the front of the tomcat server to spit
> out the parameter before it gets to cocoon and it is logging it 
> correctly:
>
> <strong>This is bolded</strong><table><tr><td> &.
>
>
> So, I'm assuming the issue is with cocoon and the generator / xsp.
>

It's according to:
http://www.w3.org/TR/REC-xml#syntax

You may say this is the issue with the XML.



> Does anyone know how to get this to be read by XSP as HTML tags and
> not the encoded version?
>

No way. It has to be XML (Remeber: XSP can generate XML only). Use Tidy 
to convert HTML to XML.


> I can't really search the archives for this since the results of the 
> archives saves stuff encoded so everything comes back as a result.
>

This was discussed in details many times:
http://marc.theaimsgroup.com/?l=xml-cocoon-users&m=102329696222851&w=2

http://marc.theaimsgroup.com/?l=xml-cocoon-users&m=102319542730728&w=2

http://marc.theaimsgroup.com/?l=xml-cocoon-users&m=102320092903273&w=2

http://marc.theaimsgroup.com/?l=xml-cocoon-users&m=102069686927114&w=2


Vadim



> Thanks for any help.
>
> - Greg
>




---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>



---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


Re: Transform/generate HTML tags with encoding

Posted by Vadim Gritsenko <va...@verizon.net>.
Greg Jones wrote:

> I need some help.
>
> I have a form that a user can add HTML tags into. I.E. " <strong>This 
> is bolded</strong><table><tr><td> &.ect".
> When I retrieve the value from the request parameter: 
> <xsp:expr>request.getParameter("HtmlComment")</xsp:expr>
>
> It is returned, it is returned as" &lt;strong&gt;&#13;This is 
> bolded&lt;/strong&gt;&#13;&lt;table&gt;&#13;&&
>
> I have tried to save the parameter to an output using the 
> SourceWritingTransformer but it just saved the file with the encoded 
> stuff.
>
> I have put a servlet filter on the front of the tomcat server to spit 
> out the parameter before it gets to cocoon and it is logging it 
> correctly:
>
> <strong>This is bolded</strong><table><tr><td> &.
>
>
> So, I'm assuming the issue is with cocoon and the generator / xsp.
>

It's according to:
http://www.w3.org/TR/REC-xml#syntax

You may say this is the issue with the XML.



> Does anyone know how to get this to be read by XSP as HTML tags and 
> not the encoded version?
>

No way. It has to be XML (Remeber: XSP can generate XML only). Use Tidy 
to convert HTML to XML.


> I can't really search the archives for this since the results of the 
> archives saves stuff encoded so everything comes back as a result.
>

This was discussed in details many times:
http://marc.theaimsgroup.com/?l=xml-cocoon-users&m=102329696222851&w=2

http://marc.theaimsgroup.com/?l=xml-cocoon-users&m=102319542730728&w=2

http://marc.theaimsgroup.com/?l=xml-cocoon-users&m=102320092903273&w=2

http://marc.theaimsgroup.com/?l=xml-cocoon-users&m=102069686927114&w=2


Vadim



> Thanks for any help.
>
> - Greg
>




---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>