View Single Post
  #8 (permalink)  
Old May 26th, 2009, 02:36 PM
sbutt sbutt is offline
Registered User
Points: 19, Level: 1
Points: 19, Level: 1 Points: 19, Level: 1 Points: 19, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2009
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I have changed my script the following:

Code:
..
..

	 "<xsl:value-of select="ota:HotelReservations/ota:HotelReservation/ota:RoomStays/ota:RoomStay/ota:RoomRates/ota:RoomRate/ota:Rates/ota:Rate/ota:Total/@AmountAfterTax "/>", <!-- currency ?? -->


		<xsl:element name="{local-name()}">
			<xsl:apply-templates select="@*|*|text()"/>
		</xsl:element>
	)  
	</xsl:template>
 
	
<xsl:template match="ota:*">
		<xsl:element name="{local-name()}">
			<xsl:apply-templates select="@*|*|text()"/>
		</xsl:element>
	</xsl:template>
	<xsl:template match="@*">
		<xsl:copy-of select="."/>
	</xsl:template>
Which yields this output:

Code:
insert into booking 
	(createdBy, bookingNumber, created, modified, start, end, bookingType, hotelName, duration, numberOfPassengers, surname, status, touroperator, agency_code, departure3LC, arrival3LC, travelCode, totalPrice, bookXmlDoc) 
	values (
	"",
	"", 
	NULL, 
	NULL, 
	"2008-10-12", 
	"2008-10-15", 
	"23",
	 "Kapetanios Bay Hotel", 
	 "P3N", 
	"4", 
    "Test", 
	"", 
	"H4U",
	"", 
	NULL, 
	 "Cyprus", 
	NULL, 
	 "232.82", 


		<OTA_TT_HotelResRS TimeStamp="2008-05-27T10:09:09" Target="Production" Version="1" ResResponseType="">
	<Success/>
	<HotelReservations>
		<HotelReservation>
			<RoomStays>
				<RoomStay>
					<RoomTypes>
						<RoomType RoomTypeCode="144HB" NumberOfUnits="1">
							<RoomDescription>
								<Text>Twin Side Seaview - Half board</Text>
							</RoomDescription>
						</RoomType>
					</RoomTypes>
					<RoomRates>
						<RoomRate RoomTypeCode="144HB" NumberOfUnits="1">
							<Rates>
								<Rate>
									<Total AmountAfterTax="232.82" CurrencyCode="GBP"/>
								</Rate>
							</Rates>
						</RoomRate>
					</RoomRates>
					<GuestCounts IsPerRoom="true">
						<GuestCount AgeQualifyingCode="10" Count="2"/>
						<GuestCount AgeQualifyingCode="8" Count="1"/>
						<GuestCount AgeQualifyingCode="7" Count="1"/>
					</GuestCounts>
					<TimeSpan Start="2008-10-12" Duration="P3N" End="2008-10-15"/>
					<BasicPropertyInfo HotelCode="6568" HotelName="Kapetanios Bay Hotel">
						<VendorMessages>
							<VendorMessage InfoType="4">
								<SubSection>
									<Paragraph>
										<Text>Please collect your keys from reception</Text>
									</Paragraph>
								</SubSection>
							</VendorMessage>
						</VendorMessages>
						<Address FormattedInd="false" DefaultInd="false">
							<AddressLine>POBox 33142</AddressLine>
							<AddressLine>Paralimni</AddressLine>
							<PostalCode>5311</PostalCode>
							<CountryName>Cyprus</CountryName>
						</Address>
						<ContactNumbers>
							<ContactNumber PhoneLocationType="4" PhoneTechType="1" PhoneNumber="00357 23 831 170" FormattedInd="false" DefaultInd="false"/>
						</ContactNumbers>
					</BasicPropertyInfo>
				</RoomStay>
			</RoomStays>
			<ResGuests>
				<ResGuest>
					<Profiles>
						<ProfileInfo>
							<Profile ShareAllSynchInd="No" ShareAllMarketInd="No">
								<Customer>
									<PersonName>
										<GivenName>A</GivenName>
										<Surname>Test</Surname>
										<NameTitle>MR</NameTitle>
									</PersonName>
									<Address FormattedInd="false" DefaultInd="false">
										<AddressLine>Test Street</AddressLine>
										<CityName>Test City</CityName>
										<PostalCode>TE5 T11</PostalCode>
									</Address>
								</Customer>
							</Profile>
						</ProfileInfo>
					</Profiles>
				</ResGuest>
			</ResGuests>
			<ResGlobalInfo>
				<HotelReservationIDs>
					<HotelReservationID ResID_Type="23" ResID_Value=""/>
				</HotelReservationIDs>
			</ResGlobalInfo>
		</HotelReservation>
	</HotelReservations>
</OTA_TT_HotelResRS>
	)

How can I make the last xml column as just simple text, just like other columns?
Reply With Quote