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

incrementing dates with variables?

Subject: incrementing dates with variables?
From: "Mac Rost" <mrost@xxxxxxxxxxxxx>
Date: Tue, 17 Dec 2002 09:13:43 -0600
incrementing dates
List:
I have a problem that is just outright bugging me. What I need to do is take the arrivalDate which is a param at top-level and then depending on how many nightlyRates are under NightlyRates element in the XML, increment depending on how many nights there are.
xml snippiet:
<HotelAvailabilityListResults size="20">
	<Hotel>
		<hotelID>129475</hotelID>
		<marketingLevel>2</marketingLevel>
		<confidence>79</confidence>
		<name>WARWICK</name>
		<address1>1776 GRANT STREET</address1>
		<address2/>
		<address3></address3>
		<city>DENVER</city>
		<stateProvince>CO</stateProvince>
		<country>US</country>
		<postalCode>80203</postalCode>
		<airportCode>DEN</airportCode>
		<phone1>1 303 8612000</phone1>
		<phone2/>
		<fax>1 303 8320320</fax>
		<lowRate>89.0</lowRate>
		<highRate>255.0</highRate>
		<HotelProperty>
			<latitude/>
			<longitude/>
			<id>DEN WARW</id>
			<chaincode/>
			<amenityCount>0</amenityCount>
			<name>WARWICK</name>
			<description>Standard 1-2 People</description>
			<rating>4.0</rating>
			<location>DOWNTOWN</location>
			<totalRate>417.00</totalRate>
			<policy/>
			<nonRefundable>N</nonRefundable>
			<specialRate>N</specialRate>
			<NightlyRates size="3" dispCurrencyCode="USD">
				<nightlyRate>119.95</nightlyRate>
				<nightlyRate>119.95</nightlyRate>
				<nightlyRate>119.95</nightlyRate>
			</NightlyRates>
		</HotelProperty>
		<supplier id="2" chainCode="DEN"/>
		<supplier id="3" chainCode="WK"/>
		<supplier id="10" chainCode="WK"/>
	</Hotel>
....Truncated for display purposes...
</HotelAvailabilityListResults>

xsl snippiet:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
	<xsl:param name="citysearch"/>
	<xsl:param name="arrivalDate"/>
	<xsl:param name="departureDate"/>
	<xsl:param name="statesearch"/>
	<xsl:param name="resType"/>
	<xsl:param name="numberOfAdults"/>
	<xsl:output method="html"/>
	<xsl:template match="/">
<!--other html stuff here-->
																<xsl:if test="HotelAvailabilityListResults[@size &gt; 1]">
																	<table border="0" cellpadding="0" cellspacing="0" width="479">
																		<tr>
																			<td colspan="5" align="center"><b>Your results for <xsl:value-of select="$citysearch"/>, <xsl:value-of select="$statesearch"/></b></td>
																		</tr>
																		<xsl:call-template name="table"/>
																	</table>
																</xsl:if>


<!--pblm code-->
				<xsl:for-each select="HotelProperty/NightlyRates">
					<xsl:value-of select="$arrivalDate"/>
						<xsl:variable name="size" select="@size"/>
						<xsl:variable name="inc">
							<xsl:value-of select="substring($arrivalDate,4,5)"/>
						</xsl:variable>
						<xsl:variable name="begin">
							<xsl:value-of select="substring($arrivalDate,1,3)"/>
						</xsl:variable>
		</xsl:for-each>




I know that I'm pbly thinking about this the wrong way, any suggestions, good or bad are welcome.
Ideally I would like the following format:

first date  second date   third date
   price          price             price

and so on...

Thanks!
Mac Rost




 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.