<?xml version="1.0" encoding="GB2312"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"  xmlns:msxsl="urn:schemas-microsoft-com:xslt"  xmlns:user="http://mycompany.com/mynamespace">
	<xsl:variable name="ItinTitle"/>
	<msxsl:script language="JScript" implements-prefix="user">
	function GetOPTax(taxNode, currencyNode)
	{
		strTax = taxNode.nextNode().xml.toUpperCase();
		istart = strTax.indexOf(">") + 1;
		iend = strTax.indexOf("/") - 1;
		strTax = strTax.substring(istart,iend);
		
		strCurrency = currencyNode.nextNode().xml.toUpperCase();
		istart = strCurrency.indexOf(">") + 1;
		iend = strCurrency.indexOf("/") - 1;
		strCurrency = strCurrency.substring(istart,iend);
		
		if (strTax == "6.10" &amp;&amp; strCurrency == "SGD")
		{
			return "Aviation levy of";
		}
		else
		{
			return "";
		}
	}
	</msxsl:script>
	<xsl:template match="/">
		<html>
			<head>
				<meta http-equiv="Content-Type" content="text/html; charset=gb2312"/>
				<title/>
			</head>
			<body>
				<TABLE cellSpacing="0" style="width:210mm" border="0">
					<TBODY>
						<tr>
							<td width="15">　</td>
							<td>
								<table width="100%" cellspacing="1">
									<tr>
										<td width="57%">
											<xsl:choose>
												<xsl:when test="normalize-space(/Response/ITINERARY/PICPATH)=''">
													<img border="0" src="image/ca.JPG"/>
												</xsl:when>
												<xsl:otherwise>
													<xsl:element name="IMG">
														<xsl:attribute name="src"><xsl:value-of select="/Response/ITINERARY/PICPATH"/></xsl:attribute>
													</xsl:element>
												</xsl:otherwise>
											</xsl:choose>
										</td>
										<td width="43%">
											<xsl:if test="Response/ITINERARY/HotelResponse/DayWeather != ''">
												<table border="0" cellspacing="1" width="100%" align="right">
													<tr>
														<td width="10%" style="font-size: 9pt; font-family: Times New Roman;">
															<xsl:value-of select="Response/ITINERARY/HotelResponse/DayWeather/City"/>
														</td>
														<td rowspan="2" width="65%">
															<xsl:for-each select="Response/ITINERARY/HotelResponse/DayWeather/description/Weather">
																<xsl:if test="position() != 1">to</xsl:if>
																<xsl:element name="IMG">
																	<xsl:attribute name="src">Weather\<xsl:value-of select="."/>.gif</xsl:attribute>
																</xsl:element>
															</xsl:for-each>
														</td>
														<td width="25%" style="font-size: 9pt; font-family: Times New Roman;">
															<xsl:value-of select="Response/ITINERARY/HotelResponse/DayWeather/tempLow"/>
															-
														<xsl:value-of select="Response/ITINERARY/HotelResponse/DayWeather/tempHigh"/>
															℃
													</td>
													</tr>
													<tr>
														<td style="font-size: 9pt; font-family: Times New Roman;">
															<xsl:value-of select="Response/ITINERARY/HotelResponse/DayWeather/Date"/>
														</td>
														<td style="font-size: 9pt; font-family: Times New Roman;">
															<xsl:value-of select="Response/ITINERARY/HotelResponse/DayWeather/windEN"/>
														</td>
													</tr>
												</table>
											</xsl:if>
										</td>
									</tr>
									<tr>
										<td colspan="2" align="center" style="height:80px;border-top:solid 1px #e01">
											<span style="font-size: 20.0pt;FONT-FAMILY: arial,sans-serif;  font-weight: bold;">ITINERARY &amp; RECEIPT</span>
								　		</td>
									</tr>
								</table>
							</td>
							<td width="15">　</td>
						</tr>
						<xsl:apply-templates select="/Response/ErrorReason"/>
						<xsl:apply-templates select="/Response/ITINERARY"/>
					</TBODY>
				</TABLE>
			</body>
		</html>
	</xsl:template>
	<!--判断查询是否成功-->
	<xsl:template match="/Response/ErrorReason">
		<tr>
			<td width="15"/>
			<td>
				<xsl:value-of select="."/>
			</td>
		</tr>
	</xsl:template>
	<!--四种航段信息-->
	<xsl:template match="NORMAL">
		<xsl:variable name="AIRLINE" select="AIRLINE"/>
		<xsl:variable name="FLIGHTNO" select="FLIGHTNO"/>
		<xsl:variable name="CLASS" select="CLASS"/>
		<xsl:variable name="SEATSTATUS" select="SEATSTATUS"/>
		<xsl:for-each select="LEGS/LEG">
			<tr>
				<td style="FONT-SIZE: 9pt;">
					<xsl:value-of select="ORIGIN"/>
				</td>
				<td align="middle">
					<xsl:value-of select="$AIRLINE"/>
					<xsl:value-of select="$FLIGHTNO"/>
				</td>
				<td align="middle">
					<xsl:value-of select="$CLASS"/>
				</td>
				<td align="middle">
					<xsl:value-of select="DEPDATE"/>
				</td>
				<td align="middle">
					<xsl:value-of select="DEPTIME"/>
				</td>
				<td align="middle">
					<xsl:value-of select="ARRTIME"/>
				</td>
				<td align="middle">
					<xsl:value-of select="NVA"/>
					<xsl:if test="NVA='' or NVB=''">/</xsl:if>
					<xsl:if test="NVA!='' or NVB!=''">/</xsl:if>
					<xsl:value-of select="NVB"/>
				</td>
				<td align="middle">
					<xsl:value-of select="$SEATSTATUS"/>
				</td>
				<td align="middle">
					<xsl:value-of select="BAGGAGE"/>
				</td>
				<td align="middle">
						<xsl:value-of select="ORI_TERMINAL"/>
				</td>
				<td align="middle">
						<xsl:value-of select="DEST_TERMINAL"/>
				</td>
			</tr>
		</xsl:for-each>
	</xsl:template>
	<xsl:template match="OPEN">
		<tr>
			<td style="FONT-SIZE: 9pt;">
				<xsl:value-of select="ORIGIN"/>
			</td>
			<td align="middle">
				<xsl:value-of select="AIRLINE"/>
				<xsl:value-of select="FLIGHTNO"/>
			</td>
			<td align="middle">
				<xsl:value-of select="CLASS"/>
			</td>
			<td align="middle">
				<xsl:value-of select="DEPDATE"/>
			</td>
			<td align="middle">
				<xsl:value-of select="DEPTIME"/>
			</td>
			<td align="middle">
				<xsl:value-of select="ARRTIME"/>
			</td>
			<td align="middle">
				<xsl:value-of select="NVA"/>
				<xsl:if test="NVA='' or NVB=''">/</xsl:if>
				<xsl:value-of select="NVB"/>
			</td>
			<td align="middle">
				<xsl:value-of select="SEATSTATUS"/>
			</td>
			<td align="middle">
				<xsl:value-of select="BAGGAGE"/>
			</td>
			<td align="middle"/>
			<td align="middle"/>
		</tr>
	</xsl:template>
	<xsl:template match="ARNK">
		<tr>
			<td style="FONT-SIZE: 9pt;">
				<xsl:value-of select="ORIGIN"/>
			</td>
			<td align="middle"/>
			<td align="middle">ARNK</td>
			<td align="middle"/>
			<td align="middle">
				<xsl:value-of select="DATE"/>
			</td>
			<td align="middle"/>
			<td align="middle"/>
			<td align="middle"/>
			<td align="middle"/>
			<td align="middle"/>
			<td align="middle"/>
		</tr>
	</xsl:template>
	<xsl:template match="INFO">
		<xsl:variable name="AIRLINE" select="AIRLINE"/>
		<xsl:variable name="FLIGHTNO" select="FLIGHTNO"/>
		<xsl:variable name="CLASS" select="CLASS"/>
		<xsl:variable name="SEATSTATUS" select="SEATSTATUS"/>
		<xsl:for-each select="LEGS/LEG">
			<tr>
				<td style="FONT-SIZE: 9pt;">
					<xsl:value-of select="ORIGIN"/>
				</td>
				<td align="middle">
					<xsl:value-of select="$AIRLINE"/>
					<xsl:value-of select="$FLIGHTNO"/>
				</td>
				<td align="middle">
					<xsl:value-of select="$CLASS"/>
				</td>
				<td align="middle">
					<xsl:value-of select="DEPDATE"/>
				</td>
				<td align="middle">
					<xsl:value-of select="DEPTIME"/>
				</td>
				<td align="middle">
					<xsl:value-of select="ARRTIME"/>
				</td>
				<td align="middle">
					<xsl:value-of select="NVA"/>
					<xsl:if test="NVA='' or NVB=''">/</xsl:if>
					<xsl:value-of select="NVB"/>
				</td>
				<td align="middle">
					<xsl:value-of select="$SEATSTATUS"/>
				</td>
				<td align="middle">
					<xsl:value-of select="BAGGAGE"/>
				</td>
				<td align="middle"/>
				<td align="middle"/>
			</tr>
		</xsl:for-each>
	</xsl:template>
	<xsl:template match="/Response/ITINERARY">
		<!--行程单信息-->
		<tr>
			<td width="15">　</td>
			<td>
				<TABLE cellSpacing="1" width="100%" style="FONT-SIZE: 12pt; FONT-FAMILY: arial,sans-serif;">
					<TBODY>
						<!--行程单信息:旅客及票号信息-->
						<tr>
							<td width="20%">Passenger:</td>
							<td width="30%"><b><xsl:value-of select="PASSENGERLIST/PASSENGER/NAME"/></b></td>

							<td width="20%">Ticket Number:</td>
							<td width="30%"><b><xsl:value-of select="TICKETS/TICKETINFO/TKTN"/></b></td>
						</tr>
						<tr>
							<td>Passport:</td>
							<td>
								<xsl:value-of select="PASSENGERLIST/PASSENGER/IDCARD/CARDTYPE"/>
								<b><xsl:value-of select="PASSENGERLIST/PASSENGER/IDCARD/CARDNUMBER"/></b>
							</td>

							<td>Conjunct Ticket:</td>
							<td><xsl:value-of select="TICKETS/TICKETINFO/CONJTKT"/></td>
						</tr>
						<tr>
							<td width="15" high="10">　</td>
						</tr>
						<!--行程单信息:PNR信息-->
						<tr>
							<xsl:variable name="system" select="SYSTEM"/>
							<xsl:choose>
								<xsl:when test="$system='1E' or '1A'">
									<td>Airline File Key:</td>
									<td><xsl:value-of select="PNRNO"/></td>
									<td>GDS File Key:</td>
									<td><xsl:value-of select="AIRLINEPNRNO"/>/<xsl:value-of select="SYSTEM"/></td>
								</xsl:when>
								<xsl:otherwise>
									<td>Airline File Key:</td>
									<td><xsl:value-of select="AIRLINEPNRNO"/></td>
									<td>al File Key:</td>
									<td><xsl:value-of select="PNRNO"/></td>
								</xsl:otherwise>
							</xsl:choose>
						</tr>
						<!--行程单信息:出票信息-->
						<tr>
								<td>Issued By:</td>
								<td><xsl:value-of select="TICKETS/TICKETINFO/ISSUEDBY"/></td>
								<td>Date Of Issue:</td>
								<td><xsl:value-of select="TICKETS/TICKETINFO/ISSUEDDATE"/></td>
						</tr>
						<!--行程单信息:代理人信息-->
						<tr>
								<td>Airline Office:</td>
								<td><xsl:value-of select="AGENTINFO/NAME"/></td>
								<td>IATA Code:</td>
								<td><xsl:value-of select="AGENTINFO/IATANUMBER"/></td>
						</tr>
						<tr>
								<td>Tel:</td>
								<td><xsl:value-of select="AGENTINFO/CONTACTINFO/PHONE"/></td>
								<td>Fax:</td>
								<td><xsl:value-of select="AGENTINFO/CONTACTINFO/FAX"/></td>
						</tr>
						<tr>
							<td>Address:</td>
							<td colSpan="3">
									<xsl:value-of select="AGENTINFO/CONTACTINFO/ADDRESS"/>
							</td>
						</tr>
						<tr>
							<td height="50" valign="bottom">ITINERARY</td>
							<td colSpan="3">
							</td>
						</tr>

					</TBODY>
				</TABLE>
			</td>
		</tr>
		<!--行程单信息:航段信息-->
		<tr>
			<xsl:apply-templates select="SEGMENTS"/>
		</tr>
		<tr>
		<!--注释信息,在繁体版和英文版中隐藏-->
		<!--xsl:apply-templates select="FIFS"/-->
		</tr>
		<tr>
			<xsl:apply-templates select="HotelResponse"/>
		</tr>
		<tr>
			<td width="15">　</td>
			<td>
				<table width="100%" border="0" cellSpacing="1" style="FONT-SIZE: 12pt; FONT-FAMILY: arial,sans-serif;line-height:1.5">
					<TBODY>
						<tr>
							<td width="20%">
								Base Fare:
							</td>
							<td width="80%" colspan="3">
									<xsl:value-of select="FARES/FARE/TICKETFARE/CURRENCY"/> 
									<xsl:value-of select="FARES/FARE/TICKETFARE/AMOUNT"/>
							</td>
						</tr>
						<tr>
							<td width="20%">
								Total Price:
							</td>
							<td width="30%">
								<xsl:value-of select="FARES/FARE/TOTALFARE/CURRENCY"/> 
								 <b><xsl:value-of select="FARES/FARE/TOTALFARE/AMOUNT"/></b>
							</td>
							<td width="20%">
								Form Of Payment:
							</td>
							<td width="30%">
								<xsl:value-of select="FPS/FP/PAYMENTTYPE"/>
							</td>
						</tr>
						<tr>
							<td colSpan="4">
								The price of your ticket includes the following levy and fees:
							</td>
						</tr>
						<tr>
							<td colSpan="4">

								<table border="0" width="100%">					
								
									<xsl:for-each select="FARES/FARE/TAX">
										<tr>
											<td width="5%">-</td>
											<td width="10%" noWrap="nowrap"><xsl:value-of select="user:GetOPTax(AMOUNT, /Response/ITINERARY/FARES/FARE/TICKETFARE/CURRENCY)"/></td>
											<td width="10%"><xsl:apply-templates select="OTHERTYPE"/></td>
											<td width="75%">
												<xsl:value-of select="CURRENCY"/> 
												<xsl:apply-templates select="AMOUNT"/>
												<xsl:value-of select="FARES/FARE/TAX"/>
											</td>
										</tr>
									</xsl:for-each>
								</table>
							</td>
						</tr>
						<tr>
							<td>
								RESTRICTIONS:
							</td>
							<td colspan="3">
								<xsl:value-of select="TICKETS/TICKETINFO/ER"/>
							</td>
						</tr>
						<tr>
							<td colspan="4">
								NOTICES:
							</td>
						</tr>
						<tr>
							<td colspan="4">
								<xsl:for-each select="NOTICE/LINE">
									<li>
										
											<xsl:value-of select="."/>
										
									</li>
								</xsl:for-each>
							</td>

						</tr>

					

						<tr>
							<td colspan="4">
								<hr style="border:dashed 2px #666"/>
							</td>
						</tr>
						<xsl:for-each select="ADVERT/LINE">
							<TR>
								<td style="FONT-SIZE: 9.5pt;FONT-FAMILY: Times New Roman; color:#CCCCCC">
									<xsl:value-of select="."/>
								</td>
							</TR>
						</xsl:for-each>
						<!--注意事项-->
						<xsl:apply-templates select="NOTICE/ATTENTION"/>					
					
					</TBODY>
				</table>
			</td>
			<td width="15">　</td>
		</tr>

	</xsl:template>
	<xsl:template match="FARES/FARE/TAX">
		<td>
			<xsl:value-of select="AMOUNT"/>
			<xsl:value-of select="CURRENCY"/>
		</td>
	</xsl:template>
	<xsl:template match="SEGMENTS">
		<!--行程单信息:航段信息-->
		<td width="15" high="10"/>
		<td>
			<table cellSpacing="1" width="100%" style="border-top:dashed 2px #666;FONT-SIZE: 9pt; FONT-FAMILY:arial,sans-serif">
				<TBODY>
					<tr valign="bottom">
						<td align="middle" rowspan="2" height="50">DEPATURE / ARRIVAL</td>
						<td align="middle" rowspan="2">FLIGHT</td>
						<td align="middle" rowspan="2">CLASS</td>
						<td align="middle" rowspan="2">DATE</td>
						<td align="middle" colspan="2">TIME</td>
						
						<td align="middle" rowspan="2">NVA/NVB</td>
						<td align="middle" rowspan="2">STATUS</td>
						<td align="middle" rowspan="2">BAGGAGE</td>
						<td align="middle" colspan="2">TERMINAL</td>
					</tr>
					<tr valign="bottom">
						<td align="middle">DEP</td>
						<td align="middle">ARR</td>
						<td align="middle">DEP</td>
						<td align="middle">ARR</td>
					</tr>
					<tr>
						<td colSpan="11">
							<HR style="border:dashed 2px #666"/>
						</td>
					</tr>
					<xsl:for-each select="SEGMENT">
						<xsl:apply-templates select="NORMAL"/>
						<xsl:apply-templates select="OPEN"/>
						<xsl:apply-templates select="INFO"/>
						<xsl:apply-templates select="ARNK"/>
					<tr>
						<td colSpan="11">
							<HR style="border:dashed 2px #BBB"/>
						</td>
					</tr>

						<xsl:if test="position()=last()">
							<tr style="FONT-SIZE: 9pt;">
								<td colspan="11" style="border-bottom:dashed 2px #666">
									<xsl:value-of select="NORMAL[last()]/LEGS/LEG[last()]/DEST"/>
									<xsl:value-of select="INFO[last()]/LEGS/LEG[last()]/DEST"/>
									<xsl:value-of select="ARNK[last()]/DEST"/>
									<xsl:value-of select="OPEN[last()]/DEST"/>
								</td>
							</tr>
						</xsl:if>
					</xsl:for-each>
				</TBODY>
			</table>
		</td>
	</xsl:template>
	<xsl:template match="NOTICE/ATTENTION">
		<tr>
			<td>
				<P class="MsoNormal">
					<B>
						<SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: Times New Roman">ATTENTION:<xsl:value-of select="."/>
						</SPAN>
					</B>
				</P>
			</td>
		</tr>
	</xsl:template>
	<xsl:template match="FIFS">
		<xsl:if test="FLTINFO/ENGINFO!=''">
			<td width="15">　</td>
			<td>
				<table border="0" width="599" cellSpacing="1">
					<TBODY>
						<td style="FONT-SIZE: 10.5pt; FONT-FAMILY: Times New Roman;">
							<xsl:for-each select="FLTINFO">
								<li>
									<xsl:value-of select="MAIRLINE"/>
									<xsl:value-of select="MFLIGHTNO"/>/<xsl:value-of select="MDATE"/>:<xsl:value-of select="ENGINFO"/>
								</li>
							</xsl:for-each>
						</td>
					</TBODY>
				</table>
				<tr>
					<hr color="#C0C0C0"/>
				</tr>
			</td>
		</xsl:if>
	</xsl:template>
	<xsl:template match="HotelResponse">
		<xsl:if test="Cities !=''">
			<td width="15">　</td>
			<td>
				<!--table border="1" width="599" cellSpacing="1" color="#C0C0C0" -->
				<table width="650" border="0" cellpadding="0" cellspacing="0" style="border: 1pt solid #EEEEEE; font-family: Times New Roman;">
					<tr style="FONT-SIZE: 9pt; FONT-FAMILY: Times New Roman;border: 1pt solid #EEEEEE;" height="21">
						<td width="30%" style="border: 1pt solid #EEEEEE; font-weight: bold;"> PREFERRED HOTEL</td>
						<td width="30%" style="border: 1pt solid #EEEEEE; font-weight: bold;"> PRICE </td>
						<td width="40%" style="border: 1pt solid #EEEEEE; font-weight: bold;"> LOCATION </td>
					</tr>
					<xsl:for-each select="Cities/City">
						<xsl:for-each select="Hotels/Hotel">
							<tr style="FONT-SIZE: 9pt; FONT-FAMILY: Times New Roman;;">
								<td width="30%" style="border: 1pt solid #EEEEEE;">
									<xsl:value-of select="NameEN"/>(<xsl:value-of select="HotelRank"/>)
								</td>
								<xsl:for-each select="Rooms">
									<td width="30%" style="border: 1pt solid #EEEEEE;">
										<xsl:value-of select="Room/RoomType"/>:<xsl:value-of select="Room/Rate"/>
									</td>
								</xsl:for-each>
								<td width="40%" style="border: 1pt solid #EEEEEE;">
									<xsl:value-of select="HotelPosition"/>
								</td>
							</tr>
						</xsl:for-each>
					</xsl:for-each>
					<tr>
						<td colspan="3" align="right" style="FONT-SIZE: 9pt; FONT-FAMILY: Times New Roman;border: 1pt solid #EEEEEE;">
							<xsl:value-of select="Demo"/>
						</td>
					</tr>
				</table>
				<tr>
					<td height="16"/>
				</tr>
			</td>
		</xsl:if>
	</xsl:template>
</xsl:stylesheet>
