cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gou...@osmosis.gr
Subject Re: [esql] xsp:logic doesn't work inside <esql:query>?
Date Sun, 01 Aug 2004 06:39:11 GMT

hi brent 

i use more complex logic in .xsp files succesfull

but in most cases it was very hard to debug. try to take a look at the 
generated .java file from your .xsp in working directory 

in most cases i use to take errors because carier return characters in 
.xsp

a working example:

--snip---
			<esql:execute-query>
				<esql:query>select * from tblElements 
WHERE element_Parent= <xsp:expr>parent_id</xsp:expr> ORDER BY 
element_Title
				</esql:query>
				<esql:results>
					<esql:row-results>
						<element>
							<xsp:logic>
						parent_id = 
<esql:get-string column="id_Elements"/>;						
					</xsp:logic>
							
<esql:get-columns/>
							<!--
					<xsp:expr>parent_id</xsp:expr>		
                                        -->
							<xsp:logic>
					getChilds(parent_id, xspAttr);					
					</xsp:logic>
						</element>
					</esql:row-results>
				</esql:results>
				<esql:no-results>
					<the_end>done</the_end>
				</esql:no-results>
			</esql:execute-query>



--snip---


On Thu, 29 Jul 2004, Brent Johnson wrote:

> I'm not sure if its allowed or not.  But I generally do my Java logic
> prior to the esql tags.  For example.. instead of what you posted I
> usually do something like:
> 
> <page>
>     <xsp:logic>
>         String newvar = null;
>         if (myvar) {
>             newvar = "thisval";
>         } else {
>             newvar = "thatval";
>         }
>     </xslp:logic>
>     ...
>     <esql:query>
>         insert into mytable (myvar) values
> (<esql:parameter><xsp:expr>newvar</xsp:expr></esql:parameter>)
>     </esql:query>
>     ...
> </page>
> 
> Not sure if this answers your question though.
> 
> Hope this helps,
> 
> - Brent
> 
> ----- Original Message -----
> From: Christina <lechaelnah@hotmail.com>
> Date: Thu, 29 Jul 2004 16:33:04 -0700
> Subject: [esql] xsp:logic doesn't work inside <esql:query>?
> To: users@cocoon.apache.org
> 
>  
> I tried to use if () inside <esql:query> like this: 
> .... 
> <esql:query> 
>     <xsp:logic> 
>             if (true) { 
>                 <esql:parameter>...</esql:parameter> 
>             } 
>     </xsp:logic> 
> </esql:query> 
> .... 
> but every time there is error message on this "if", it is ok if I
> delete everything before and after the nested <xsp:logic> tag.
> So <xsp:logic> cannot work inside of <esql:query>? or I did something wrong?

> Thanks!
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message