cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jim Bearce <...@bearce.us>
Subject Re: newbie xsp question
Date Wed, 05 Feb 2003 01:19:46 GMT
I don't know why the simple.xsp was done the way it was but I believe 
you should also be able to write it this way:

<xsp:logic>
  for (int i=0; i &lt; 3; i++) {
    <li>Item <xsp:expr>i</xsp:expr></li>
  }
</xsp:logic>

I think wrapping it in CDATA sections is just to make it possible to use 
the < in the for statement

I-Lin Kuo wrote:

> In the sample xsp provided with cocoon, on the page
>
> docs/samples/xsp/simple.xsp
>
> There's a section of code that looks like this:
>
>     <xsp:logic>
>       <![CDATA[
>       for (int i=0; i<3; i++) {]]><![CDATA[
>       ]]>
>         <li>
>           Item <xsp:expr>i</xsp:expr>
>         </li>
>       <![CDATA[
>       } ]]><![CDATA[
>       ]]>
>     </xsp:logic>
>
> I understand that the CDATA sections are needed to escape the "<" in 
> the for loop declaration, but it seems to me that only one such is 
> needed. To test this, I made up another page with the following:
>
> <ul>
> <xsp:logic>
> <![CDATA[
>     for (int j=0;j<3;j++) ]]>{
>         <li>Item <xsp:expr>j</xsp:expr></li>
>     }
> </xsp:logic>
> </ul>
>
> This worked, and confirmed my suspicions. So my question is, why were 
> there so many CDATA sections in the original, and when am I supposed 
> to use them?
>
> Also, I'd appreciate it if someone could explain what xsp:content is 
> supposed to do, or refer me to some place in the documentation where 
> all the tags are listed (I couldn't find any).
>
> _________________________________________________________________
> Protect your PC - get McAfee.com VirusScan Online  
> http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963
>
>
> ---------------------------------------------------------------------
> 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:     <cocoon-users-unsubscribe@xml.apache.org>
> For additional commands, e-mail:   <cocoon-users-help@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:     <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail:   <cocoon-users-help@xml.apache.org>


Mime
View raw message