You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by gv <jg...@yahoo.com> on 2002/09/23 18:22:57 UTC

How can I output ESQL value as CDATA?

Hi,

Is there any way to put an ESQL result string into a
CDATA section in the XSP output?

I want to do something like the following, but
(predictably) the ESQL tag itself is put into CDATA:

<mycol><![CDATA[<esql:get-string column="my_col"
/>]]></mycol>

Also tried &lt; and &gt; entities for the braces
surrounding the CDATA; didn't work (&lt; and &gt; stay
as entities in the XSP output).

Desired XSP output:

<mycol><[CDATA[ result ]]></mycol>

Is there any way to do this?

Thanks,
John


__________________________________________________
Do You Yahoo!?
Yahoo! Finance - Get real-time stock quotes
http://finance.yahoo.com

---------------------------------------------------------------------
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: How can I output ESQL value as CDATA?

Posted by "Ilya A. Kriveshko" <il...@kaon.com>.
Hi,

I can tell you what in my opinion should work, but at least in the 
version of Cocoon that I have on my system it doesn't. It would be great 
if one of the developers commented on this approach, why it doesn't work 
and how to possibly make it work.

Here's the XSP snippet that I think should work:

    <xsp:logic>
        String test = resultSet.getString("data"); // Or however else 
you would get at your data
        this.lexicalHandler.startCDATA();
        this.contentHandler.characters(test.toCharArray(), 0, 
test.length());
        this.lexicalHandler.endCDATA();
    </xsp:logic>

The reason it doesn't work, I suspect, is because the LexicalHandler 
part of the XMLConsumer is implemented by the AbstractXMLConsumer as 
empty methods, and the real entity that consumes the SAX events and 
output the text to be sent to the client is not overriding those methods.

So, the quiestion is: is it possible to communicate the lexical 
structure of the XML all the way thtough to the entity that serializes 
XML as text? And if it already is communicated, then can we make it 
reflect the lexical structure in its output?

Thank you for doing such a great job, and thank you in advance for your 
insight on this issue.
--
Ilya

gv wrote:

>Hi,
>
>Is there any way to put an ESQL result string into a
>CDATA section in the XSP output?
>
>I want to do something like the following, but
>(predictably) the ESQL tag itself is put into CDATA:
>
><mycol><![CDATA[<esql:get-string column="my_col"
>/>]]></mycol>
>
>Also tried &lt; and &gt; entities for the braces
>surrounding the CDATA; didn't work (&lt; and &gt; stay
>as entities in the XSP output).
>
>Desired XSP output:
>
><mycol><[CDATA[ result ]]></mycol>
>
>Is there any way to do this?
>
>Thanks,
>John
>
>
>__________________________________________________
>Do You Yahoo!?
>Yahoo! Finance - Get real-time stock quotes
>http://finance.yahoo.com
>
>---------------------------------------------------------------------
>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: How can I output ESQL value as CDATA?

Posted by Joerg Heinicke <jo...@gmx.de>.
Hi John,

it's not possible as you find out, but why would you need it?

I assume that the result of ESQL is escaped, otherwise there will be trouble 
to often. So why do you want to escape it one more often?

Regards,

Joerg


gv wrote:
> Hi,
> 
> Is there any way to put an ESQL result string into a
> CDATA section in the XSP output?
> 
> I want to do something like the following, but
> (predictably) the ESQL tag itself is put into CDATA:
> 
> <mycol><![CDATA[<esql:get-string column="my_col"
> />]]></mycol>
> 
> Also tried &lt; and &gt; entities for the braces
> surrounding the CDATA; didn't work (&lt; and &gt; stay
> as entities in the XSP output).
> 
> Desired XSP output:
> 
> <mycol><[CDATA[ result ]]></mycol>
> 
> Is there any way to do this?
> 
> Thanks,
> John

-- 

System Development
VIRBUS AG
Fon  +49(0)341-979-7419
Fax  +49(0)341-979-7409
joerg.heinicke@virbus.de
www.virbus.de


---------------------------------------------------------------------
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>