You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Jason Cunningham <JG...@carrotmail.com> on 2001/11/12 15:41:32 UTC

HTML Passthrough

Hi,

First off, sorry for asking this question.  I've seen similar issues raised in the newsgroups, but no response seems to fit my circumstances.  I'm sure that this is my failure rather than that of the responders, but any help or advise would be very gratefully received.

We're using Cocoon2 with JBoss.  We've recently had a new requirement to interface a third party application with our solution.  The third party application outputs XHTML.  The output is stored on the request object as an attribute.  An XSP page then takes it off, and passes it to an XSL page for transformation.  

The problem is that the XSP page treats the response (which is XHTML) as text, replacing all < and > symbols with &lt and &gt signs.  Therefore, what gets the browser is very garbled XHTML.

Is there anyway that the XSP page can be told to treat the response as XHTML (and build a XML Fragment)?

Thanks for any advice,

Jason Cunningham

Get a new email account, access to loads of great competitions and great shopping deals at CarrotShop!  http://www.bluecarrots.com.

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

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


Re: HTML Passthrough

Posted by David Rosenstrauch <da...@dti.net>.
At 02:41 PM 11/12/01 +0000, you wrote:
>Is there anyway that the XSP page can be told to treat the response as XHTML (and build a XML Fragment)?
>
>Thanks for any advice,
>
>Jason Cunningham


Yes.  Someone else had this same problem recently.

Use <util:include-expr>.  It will parse the text that you pass in to it, and generate SAX calls from it (as opposed to writing the text straight to the output - after escaping all the control chars - like it's doing now).

1) Include the namespace xmlns:util="http://apache.org/xsp/util/2.0" in your XSP or the <util:include-expr> won't get called properly.

2) the call you need to make this work:
<util:include-expr><util:expr>your xml goes here</util:expr></util:include-expr>

or

<xsp:logic>String  s = <get xml from somewhere>;</xsp:logic>
<util:include-expr><util:expr><xsp:expr>s</xsp:expr></util:expr></util:include-expr>

<xsp:expr>s</xsp:expr> takes the value of String  s, which is then passed in to <util:include-expr>.


DR


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

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