This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Recursion/ Iteration problem.


Hi,

I am new to XSL. Can someone help me here please.

The foll is the XSL that shd pull the first 10 hotels out of many in an XML
doc. I am getting the first hotel printed 10 times instead of the first 10.
Any suggestions?


<?xml version='1.0' encoding='utf-8' ?>
<xsl:stylesheet xmlns:xinclude="http://www.w3.org/1999/XML/xinclude";
xmlns:xlink="http://ww.w3.org/TR/xlink";
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
exclude-result-prefixes="xinclude xlink" version="1.0"><xsl:output
method="xml"/>
	<xsl:template match="/" name="index">
		<vxml version="1.0">
			<form id="business1">
				<field name="busFinder">
					<prompt>
						<xsl:text>The closest 5</xsl:text>
						<xsl:value-of
select="Go2LocationResponse/Data/ListingsResponse/@searchValue"/>
						<xsl:text>are</xsl:text>
					</prompt>

      				<xsl:call-template name="TEMP">
        				<xsl:with-param name="counter" select="1" />
      				</xsl:call-template>

				</field>
			</form>
		</vxml>
	</xsl:template>

	<xsl:template name="TEMP">
		<xsl:param name="counter" />
		<xsl:if test="$counter &lt; 11">
			<prompt>
				<xsl:value-of
select="Go2LocationResponse/Data/ListingsResponse/Listing/@companyName"/>
				<xsl:text>, located at</xsl:text>
				<xsl:value-of
select="Go2LocationResponse/Data/ListingsResponse/Listing/Location/Address/@
street"/>
				<xsl:text>.</xsl:text>
			</prompt>
			<xsl:call-template name="KMFDM">
				<xsl:with-param name="counter" select="$counter + 1" />
			</xsl:call-template>
  		</xsl:if>
	</xsl:template>

</xsl:stylesheet>

TIA
--SR


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]