cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Carlos M. S. Bento Nogueira" <cm...@student.dei.uc.pt>
Subject RE: cforms: xsl scope problem
Date Wed, 08 Jun 2005 15:16:37 GMT
It doesn't work. I've completed the problem with some data that might help 
someone to understand this problem because i can't figure out what's 
wrong.I also included attempts i've made...
TIA!!
CN


i have in a xml file the following code snippet:
<fd:form....>
  <fd:widgets>
 	<fd:selection-list>
 		<fd:item value="Dcor" />
 		<row> </row>
to check each item on this selection list i do
<xsl:template 
match="fi:field[fi:selection-list][fi:styling/@list-type='radio']" 
priority="2">
(...)
 	<xsl:choose>
 	(...)
 		<xsl:otherwise>
 			<xsl:for-each select="fi:selection-list/fi:item">

how do i check the presence of the row tab which is inside the scope of 
selection list??


This were my previous unsucessfull attempts:
Attempt 1
<xsl:for-each select="fi:selection-list/fi:item">
 	<xsl:template match="ancestor::fi:selection-list[1]/row">

Attempt 2
<xsl:variable name="rowExists" select="boolean(fi:selection-list/row)"/>
<xsl:for-each select="fi:selection-list/fi:item">
 	<xsl:if test="$rowExists">...</>

Attempt 3
<xsl:for-each select="fi:selection-list/fi:item">
 	<xsl:if test="../row">...</>

variants on this attempt:
<xsl:if test="sibling::row">...</>
<xsl:if test="following-sibling::row">...</>


TIA,
CarlosN.



On Tue, 7 Jun 2005, Chris Marasti-Georg wrote:

>> -----Original Message-----
>> From: Carlos M. S. Bento Nogueira [mailto:cmsbn@student.dei.uc.pt]
>> Sent: Tuesday, June 07, 2005 10:03 PM
>> To: users@cocoon.apache.org
>> Subject: cforms: xsl scope problem
>>
>> I have in a xml file the following code snippet:
>>  	<fd:selection-list>
>>  		<fd:item value="Dcor" />
>>  		<row> </row>
>> to check each item on this selection list i do <xsl:for-each
>> select="fi:selection-list/fi:item">
>> how do i check the presence of the row tab which is inside
>> the scope of the selection list??
>>
>> I've tried
>> <xsl:variable name="rowExists"
>> select="boolean(fi:selection-list/row)"/>
>> <xsl:for-each select="fi:selection-list/fi:item">
>> <xsl:if test="$rowExists">...</>
>> and it doesn't work.
>>
>
> Try taking out the variable, and change the test in the xsl:if to
> "../row" (or "sibling::row", or "following-sibling::row")
>
> Chris
>
>> My goal is to insert line or column breaks between items.
>>
>> Notes: using cocoon 2.1.7. cforms
>>         using apache tomcat 5.5
>>
>> T.I.A. ,
>> CarlosN.
>>
>> ---------------------------------------------------------------------
>> 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
>
>

-- 

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


Mime
View raw message