On 04.Apr.2002 -- 12:06 PM, Steven Sedlmeyer wrote:
> I'm trying to place the results of an <esql:get-ascii column="foo"/> tag
> into a cdata
> block.  I've been able to get close, with the <> ending up in the text node
> as &lt;
> and &gt; but I can't get them inserted as an actual CDATA block.  Is there
> some simple
> solution I've missed or baring that, a hard one...?

I presume that you want the data inside the CDATA block for the sake
of the client? Since printing out the data would create a text node
for the internal processing and wouldn't be touched by Cocoon at all.

I think it should be possible to print the CDATA instruction
("&lt;![CDATA[") and the ending instruction ("]]&gt;").

> 1.  
> <body_text>
> <![CDATA[<esql:get-ascii column="foo"/>]]>
> </body_text>

Effectively escapes the esql-tag from being replaced by the required
java code.

> 2.
> 
> <xsp:logic>
>       <![CDATA[String cdOpen = "<![CDATA[";  ]]>
>       String cdClose = "]]&gt";
> </xsp:logic>
> 
> <body_text>
> <xsp:expr>cdOpen</xsp:expr><esql:get-ascii
> column="foo"/><xsp:expr>cdClose</xsp:expr>
> </body_text>
> 
> //with various combinations of CDATA blocks and escaped characters in the
> //<xsp:logic/> block 

Mmmh, that _should_ work. Could you please provide us with the java
code produced by this? You'll find it in the work directory of your
servlet engine (e.g. $CATALINA_HOME/work/localhost/cocoon/....)

> 3.  
>       <xsp:logic>
>               <![CDATA[
>               StringBuffer bodyText= new StringBuffer("");
>               bodyText.append("<body_text><![CDATA[");
>               ]]>
>               bodyText.append(<esql:get-ascii column="foo"/>);
>               <![CDATA[
>               bodyText.append("]]");
>               bodyText.append("></body_text>");
>               ]]>
>       </xsp:logic>
>       <xsp:expr disable-output-escaping="yes"
> >bodyText.toString()</xsp:expr>
> 
> // Same results except that the surrounding <body_text> node is now also
> escaped and
> // appears as part of the text node

Wait -- that sounds like a correct result. What are you trying to
achieve exactly?

        Chris.

-- 
C h r i s t i a n       H a u l
[EMAIL PROTECTED]
    fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08

---------------------------------------------------------------------
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: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>

Reply via email to