Forum Moderators: open
I am using an xsl stylesheet to render my xml (below).
What I will have to do is pass the following node contents <hrnQuoteKey>058A4C094528597243</hrnQuoteKey> to another page (.cfm template) using a form element in the xsl stylesheet. Can someone describe how I would do this, or any other way of passing a variable from an xsl stylesheet to another page. I am thinking hidden form field but I could be off base.
Thanks ...
---------------------------------
xsl stylesheet:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"><xsl:template match="/">
<html>
<body>
<h2>Rates</h2>
<table border="0" cellspacing="3" cellpadding="3">
<xsl:for-each select="HotelRoomAvailabilityResults/HotelRoomAvailabilityResult/RateInfo">
<xsl:sort select="displayRoomRate" data-type="number"/>
<tr>
<td><xsl:value-of select="displayRoomRate"/></td>
<td><xsl:value-of select="../rateDescription"/></td>
<td><xsl:value-of select="../roomTypeDescription"/></td>
<td><form action="" method="post">
<input name="Book Now" type="submit" value="submit"></input></form></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template></xsl:stylesheet>
------------------------------
xml:
<HotelRoomAvailabilityResults size='7'>
<HotelRoomAvailabilityResult>
<hotelId>109292</hotelId>
<cancellationPolicy>Cancellation Policy</cancellationPolicy>
<policy/>
<rateCode>002</rateCode>
<roomTypeCode>002</roomTypeCode>
<hrnQuoteKey>058A4C094528597243</hrnQuoteKey>
<rateDescription>Superior 1-2 People</rateDescription>
<roomTypeDescription>Superior 1-2 People</roomTypeDescription>
<supplierType>H</supplierType>
<propertyType>H</propertyType>
<taxRate>0.0</taxRate>
<otherInformation/>
<rateChange>true</rateChange>
<guaranteeRequired>false</guaranteeRequired>
<depositRequired>true</depositRequired>
<immediateChargeRequired>true</immediateChargeRequired>
<currentAllotment>-1</currentAllotment>
<propertyId>TOR SUPL</propertyId>
<promoDescription>Stay 2 Nights, Get 20% Off Every Night</promoDescription>
<promoType/>
<promoDetailText/>
<bedTypes>1QN,2DD</bedTypes>
<RateInfo>
<displayCurrencyCode>USD</displayCurrencyCode>
<DisplayNightlyRates size='2'>
<displayNightlyRate>163.0</displayNightlyRate>
<displayNightlyRate>163.0</displayNightlyRate>
</DisplayNightlyRates>
<displayRoomRate>382.82</displayRoomRate>
<chargeableRoomRateTotal>382.82</chargeableRoomRateTotal>
<chargeableRoomRateTaxesAndFees>45.16</chargeableRoomRateTaxesAndFees>
<nativeCurrencyCode>USD</nativeCurrencyCode>
<NativeNightlyRates size='2'>
<nativeNightlyRate>163.0</nativeNightlyRate>
<nativeNightlyRate>163.0</nativeNightlyRate>
</NativeNightlyRates>
<nativeRoomRate>382.82</nativeRoomRate>
<rateFrequency>B</rateFrequency>
</RateInfo>
<PromoRateInfo>
<displayCurrencyCode>USD</displayCurrencyCode>
<DisplayNightlyRates size='2'>
<displayNightlyRate>131.0</displayNightlyRate>
<displayNightlyRate>131.0</displayNightlyRate>
</DisplayNightlyRates>
<displayRoomRate>307.16</displayRoomRate>
<chargeableRoomRateTotal>307.16</chargeableRoomRateTotal>
<chargeableRoomRateTaxesAndFees>45.16</chargeableRoomRateTaxesAndFees>
<nativeCurrencyCode>USD</nativeCurrencyCode>
<NativeNightlyRates size='2'>
<nativeNightlyRate>131.0</nativeNightlyRate>
<nativeNightlyRate>131.0</nativeNightlyRate>
</NativeNightlyRates>
<nativeRoomRate>307.16</nativeRoomRate>
<rateFrequency>B</rateFrequency>
</PromoRateInfo>
</HotelRoomAvailabilityResult>
I am thinking hidden form fieldIf my guess as to what you want is correct, that is the approach I would take.
<input type="hidden" name="hrnQuoteKey" value="{../hrnQuoteKey}" />
That is, create an element called <input> in the output tree whose @value is equal to the text within <hrnQuoteKey> which is a sibling of <RateInfo>.