[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

URGENT: Please help

Subject: URGENT: Please help
From: Ram Gande <Ram.Gande@xxxxxxxxxx>
Date: Wed, 25 Apr 2001 17:22:10 -0700
servlet dcs
Hi all,

I am new to XSLT programming. I have a few external function that I am
calling. 
What I want to do is to print out a bunch of "href" based on the successive
calls to the external java function. I know how many number of rows coming
by calling "count" function. I want to loop through this "count" and create
"tr" rows inside my table.
Can anyone please let me know how I can loop 

eg.,
for (expression)
	counter = counter + 1
	if (counter < maxcount)
		exit
	else
		"Create TR"
next

I have tried to do by recursively call the "template" but I must not be
doing something. How can I check the expression and increment the counter.

Anyhelp would be greatly apprciated. Below is my sample code.

Thanks
RK.


****************************************************************************
**************************************************************
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:java="http://xml.apache.org/xslt/java" xmlns:dcs="dcs"
extension-element-prefixes="java, dcs">
  
  <xsl:output method="html" indent="no"/>
      
  <xsl:include xml:link="include" href="param.xslt" />
  <xsl:param name="spos" select="0" />

  <xsl:template name="getNextCust">
        <xsl:value-of select="&getNext;()"/>
  </xsl:template> 
  <xsl:template name="setFilter">
        <xsl:value-of select="&setFilter;('Ad*')"/>
  </xsl:template> 
  <xsl:template name="getCount">
        <xsl:value-of select="&count;()"/>
  </xsl:template> 

  <xsl:variable name="matchcount" select="&count;()"/>

  <xsl:template match="*">
    <HTML>
      <HEAD>
        <TITLE>
		<xsl:value-of select="$system.title"/> - Select Customer
	</TITLE>

	<SCRIPT LANGUAGE="JavaScript">
		function search ()
		{
			<xsl:call-template name="setFilter"/>
		}
	</SCRIPT>
      </HEAD>
  
      <BODY>	

	<FORM NAME="SearchForm" method="POST"
action="/servlet/dcs/?do:method=search">  
		<INPUT TYPE="text" NAME="search" SIZE="10"/>  
		<INPUT TYPE="button" VALUE="Search"
onClick="javascript:search()"/>  
	</FORM>

	<xsl:value-of select="&setFilter;('Ban*')"/>

	<table width="%100" border="0" cellspacing="0" cellpadding="0"
valign="bottom" nowrap="true">
		<xsl:call-template name="rows">
                  <xsl:with-param name="first" select="0"/>
                </xsl:call-template>
	</table>

      </BODY>

    </HTML>

  </xsl:template>


  <xsl:template name="rows">
    <xsl:param name="first"/>

	   <xsl:choose>
	     <xsl:when test="$matchcount &gt; $first">

                  <tr align="left">
                   		<td rowspan="1" align="left">
                        	<font color="#ffffff" face="{font_style}"
size="2">
                        	<a target="selectcust"
href="http://www.ramg.com">
                                	<xsl:value-of select="&getNext;()"/>
                        	</a>
                        	</font>
                   		</td>
                  </tr>

		  <xsl:call-template name="rows">
                    <xsl:with-param name="first" select="$first"/>
                  </xsl:call-template>

	     </xsl:when>
	   
	   </xsl:choose>
		
	</xsl:template>


</xsl:stylesheet>
****************************************************************************
**************************************************************

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.