cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Naegeli Margrit <>
Subject RE: logic in XSL
Date Wed, 01 Nov 2000 10:53:52 GMT
You cannot put xsp logic in xsl.
I see two possibilities to solve your problem:
1) put the java counting logic in the xml and let it insert a special tag or
tag attribute after every 5 sections and make xsl turn this into a <br>
2) use xsl to count. I can't tell you the statements to get xsl to do this,
but I'm pretty sure that it's possible. It's quite amazing really what xsl
can do.
Greetings Maggie

-----Original Message-----
From: Sinvhal, Swapnil []
Sent: Wednesday, November 01, 2000 11:50 AM
To: ''
Cc: ''
Subject: xsp:logic in XSL

Hi, Cocoon - users !! 

I am trying to  apply the <xsp:logic> tag in XSL. 
But the generated HTML shows up the JAVA code as such - it does not process

I have to display a list of sections. 
After every 5 sections , I need a <BR> tag. 

What am I doing wrong ? 

THE XML file is : 

<?xml version="1.0"?> 
<!-- Author: Swapnil Sinvhal --> 
<?cocoon-process type="xsp"?> 
<?cocoon-process type="xslt"?> 
<?cocoon-format type="text/xml"?> 
<?xml-stylesheet type="text/xsl" href="SectionLinks.xsl"?>  
<xsp:page language="java" xmlns:xsp="
<> "> 
                String linkData = null; 
                String hrefData = null; 
                String linkKey = null; 
                String hrefKey = null; 
                int i =0; 
                for(i=1; ; i++) 
                  linkKey = "sectionLink." + i; 
                  hrefKey = "ahrefLink." + i;                     
                  hrefData =
                  if ((hrefData==null)||(linkData==null)) break;

                  if (!(hrefData.equals(""))) 



The XSL file is : 

<xsl:template match="/">  
   <table align="left" height="100%" width="100%" cellpadding="0"
        <tr align="left" valign="top" class="tdc" height="100%" width="70%">

          <td CLASS="cityBkgd"> 
                      private int count = 0;  
                        <xsl:for-each select="sections/section">        
                        count += 1; 
                        if (count==5) 
                        <BR /> 
                   <xsl:element name = "A"> 
                        <xsl:attribute name = "id"> 
                        <xsl:attribute name = "href"> 
                                <xsl:value-of select="ahrefLink"/>  
                                <xsl:value-of select="sectionLink"/> 
                   <font color = "#ffffff" size = "2" face = "Arial"> 
            <td align="left" valign="top" class="tdc" height="100%"


Thanks a lot. 


View raw message