This instance is currently being migrated to the new Atlassian One Confluence sytem.
If you can't find your space anymore, it should be already in the new System: https://confluence.weareplanet.com/
Name of the Mapping Rule | HTNG Message | Incoming XSLT | Outgoing XSLT |
---|---|---|---|
profilemodify.fidelio.5.0 | OTA_ProfileModifyRQ | http://172.31.191.56:9000/gWcDMee/12 | |
profilemodifyresult.fidelio.4.0 | OTA_ProfileModifyRS | http://172.31.191.56:9000/pPgCcos | |
rate.fidelio.6.0 | OTA_HotelRatePlanNotifRQ | ||
rate.detail.fidelio.6.0 | OTA_HotelRatePlanNotifRQ | http://172.31.191.56:9000/bFukv8c/13 | |
rate.virtual.fidelio.6.0 | OTA_HotelRatePlanNotifRQ | http://172.31.191.56:9000/948Fn5h/4 | |
ratesresultincoming.fidelio.4.0 | OTA_HotelRatePlanNotifRS | http://172.31.191.56:9000/6qM2e27 | |
ravl.fidelio.4.0 | OTA_HotelAvailNotifRQ | http://172.31.191.56:9000/948Fn59 | http://172.31.191.56:9000/bFukv8b |
ravlresultincoming.fidelio.4.0 | |||
ravr.fidelio.4.0 | OTA_HotelAvailNotifRQ | http://172.31.191.56:9000/3Nqn5Y6 | http://172.31.191.56:9000/gWcDMef/1 |
reservation.profile.create.incoming.fidelio.4.0 | OTA_ProfileCreateRQ | http://172.31.191.56:9000/jyyiVhh | |
reservation.profile.modify.incoming.fidelio.4.0 | OTA_ProfileModifyRQ | http://172.31.191.56:9000/nbUY4kj | |
reservationincoming.fidelio.4.0 | OTA_HotelResNotifRQ | http://172.31.191.56:9000/eiQZDbb/1619 | |
reservationresultoutgoing.fidelio.4.0 | OTA_HotelResNotifRS | http://172.31.191.56:9000/6qM2e28/9 | |
rtav.fidelio.4.0 | OTA_HotelInvCountNotifRQ | http://172.31.191.56:9000/jyyiVhf | http://172.31.191.56:9000/nbUY4kh |
rtavresultincoming.fidelio.4.0 | OTA_HotelInvCountNotifRS | http://172.31.191.56:9000/pPgCcoj | |
stay.fidelio.2.0 | OTA_HotelStayInfoNotifRQ | ||
stayresultincoming.fidelio.4.0 | OTA_HotelStayInfoNotifRS | http://172.31.191.56:9000/3Nqn5Y4 | |
package.element.fidelio.3.0 | IO_RatePackageNotifRQ | http://172.31.191.56:9000/pPgCcon/26 | |
package.group.fidelio.3.0 | IO_RatePackageNotifRQ | http://172.31.191.56:9000/gWcDMeh/16 | |
package.fidelio.result.3.0 | IO_RatePackageNotifRS | http://172.31.191.56:9000/jyyiVho | |
plquery | OTA_ReadRQ | http://172.31.191.56:9000/jyyiVhj/3 | |
plresult | OTA_ProfileReadRS | http://172.31.191.56:9000/948Fn5b/8 | |
plresult.download | OTA_ProfileReadRS | ||
plresult.download.result | OTA_ProfileCreateRQ | http://172.31.191.56:9000/gWcDMeo/1 |
...
Name of the Mapping Rule | HTNG Message | Incoming XSLT | Outgoing XSLT |
---|---|---|---|
profilecreate.fidelio.5.0 | OTA_ProfileCreateRQ | http://172.31.191.56:9000/6qM2e26/1 | http://172.31.191.56:9000/948Fn58 |
profilecreateresult.fidelio.4.0 | OTA_ProfileCreateRS | http://172.31.191.56:9000/bFukv8a | http://172.31.191.56:9000/eiQZDbc |
<xsl:stylesheet version="2.0" xpath-default-namespace="reservation.fidelio.5.0" xmlns="http://www.opentravel.org/OTA/2003/05" xmlns:x="profile.fidelio.5.0" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:func="http://example.com/mf" exclude-result-prefixes="x xs" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:px="http://protel.io/htng/extensions"> <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes" /> <xsl:param name="protel_hotel_id"/> <xsl:template match="/"> <OTA_HotelResNotifRQ> <POS> <Source> <RequestorID> <xsl:attribute name="Type"> <xsl:value-of select="'10'"/> </xsl:attribute> <xsl:attribute name="ID"> <xsl:value-of select="$protel_hotel_id"/> </xsl:attribute> <xsl:attribute name="ID_Context"> <xsl:value-of select="'protelIO'"/> </xsl:attribute> </RequestorID> </Source> </POS> <HotelReservations> <HotelReservation> <xsl:attribute name="CreateDateTime"> <xsl:value-of select="Reservation/originalBookingDate"/> </xsl:attribute> <xsl:attribute name="CreatorID"> <xsl:value-of select="Reservation/reservationOriginatorCode"/> </xsl:attribute> <xsl:attribute name="CreateDateTime"> <xsl:value-of select="Reservation/originalBookingDate"/> </xsl:attribute> <xsl:attribute name="ResStatus"> <xsl:choose> <xsl:when test="Reservation/@mfReservationAction = 'ADD'"> <xsl:value-of select="'Reserved'"/> </xsl:when> <xsl:when test="Reservation/@mfReservationAction = 'EDIT'"> <xsl:value-of select="'Reserved'"/> </xsl:when> <xsl:when test="Reservation/@mfReservationAction = 'CANCEL'"> <xsl:value-of select="'Cancelled'"/> </xsl:when> </xsl:choose> </xsl:attribute> <UniqueID> <xsl:attribute name="Type"> <xsl:value-of select="'14'"/> </xsl:attribute> <xsl:attribute name="ID"> <xsl:value-of select="Reservation/confirmationID"/> </xsl:attribute> <xsl:attribute name="ID_Context"> <xsl:value-of select="'GHA'"/> </xsl:attribute> </UniqueID> <UniqueID> <xsl:attribute name="Type"> <xsl:value-of select="'14'"/> </xsl:attribute> <xsl:attribute name="ID"> <xsl:value-of select="Reservation/reservationID"/> </xsl:attribute> <xsl:attribute name="ID_Context"> <xsl:value-of select="'protelIO'"/> </xsl:attribute> </UniqueID> <RoomStays> <RoomStay> <xsl:attribute name="MarketCode"> <xsl:value-of select="Reservation/RoomStays/RoomStay/RatePlans/RatePlan/mfMarketCode"/> </xsl:attribute> <xsl:attribute name="SourceOfBusiness"> <xsl:value-of select="Reservation/RoomStays/RoomStay/RatePlans/RatePlan/mfsourceCode"/> </xsl:attribute> <RoomTypes> <RoomType> <xsl:attribute name="IsRoom"> <xsl:value-of select="'true'"/> </xsl:attribute> <xsl:attribute name="RoomTypeCode"> <xsl:value-of select="Reservation/RoomStays/RoomStay/roomInventoryCode"/> </xsl:attribute> <xsl:attribute name="NumberOfUnits"> <xsl:value-of select="Reservation/mfImage/numRooms"/> </xsl:attribute> </RoomType> </RoomTypes> <RatePlans> <xsl:call-template name="GenerateRatePlans"> <xsl:with-param name="start" select="xs:date(xs:dateTime(Reservation/ResGuests/ResGuest/arrivalTime))"/> <xsl:with-param name="end" select="xs:date(xs:dateTime(Reservation/ResGuests/ResGuest/departureTime))"/> </xsl:call-template> </RatePlans> <RoomRates> <xsl:call-template name="GenerateRoomRates"> <xsl:with-param name="start" select="xs:date(xs:dateTime(Reservation/ResGuests/ResGuest/arrivalTime))"/> <xsl:with-param name="end" select="xs:date(xs:dateTime(Reservation/ResGuests/ResGuest/departureTime))"/> </xsl:call-template> </RoomRates> <GuestCounts> <GuestCount> <xsl:attribute name="AgeQualifyingCode"> <xsl:value-of select="'10'"/> </xsl:attribute> <xsl:attribute name="Count"> <xsl:value-of select="Reservation/GuestCounts/GuestCount[ageQualifyingCode = 'ADULT']/mfCount"/> </xsl:attribute> </GuestCount> <GuestCount> <xsl:attribute name="AgeQualifyingCode"> <xsl:value-of select="'8'"/> </xsl:attribute> <xsl:attribute name="Count"> <xsl:value-of select="Reservation/GuestCounts/GuestCount[ageQualifyingCode = 'CHILD']/mfCount"/> </xsl:attribute> </GuestCount> </GuestCounts> <TimeSpan/> <Total/> <BasicPropertyInfo> <xsl:attribute name="HotelCode"> <xsl:value-of select="$protel_hotel_id"/> </xsl:attribute> <xsl:attribute name="ChainCode"> <xsl:value-of select="Reservation/HotelReference/chainCode"/> </xsl:attribute> </BasicPropertyInfo> <ResGuestRPHs> <ResGuestRPH> <xsl:attribute name="RPH"> <xsl:value-of select="'1'"/> </xsl:attribute> </ResGuestRPH> </ResGuestRPHs> <!--<Comments>
<Comment> <xsl:attribute name="Text"> <xsl:value-of select="./comment, '- '"/> <xsl:value-of select="./mfcommentType"/> </xsl:attribute> </Comment> </xsl:for-each> </Comments>--> <Comments> <xsl:for-each select="Reservation/ResComments/ResComment"> <Comment> <Text> <xsl:value-of select="./comment"/> </Text> </Comment> </xsl:for-each> </Comments> </RoomStay> </RoomStays> <ResGuests> <ResGuest> <xsl:attribute name="PrimaryIndicator"> <xsl:value-of select="'true'"/> </xsl:attribute> <xsl:attribute name="ResGuestRPH"> <xsl:value-of select="'1'"/> </xsl:attribute> <Profiles> <ProfileInfo> <UniqueID> <xsl:attribute name="Type"> <xsl:value-of select="'21'"/> </xsl:attribute> <xsl:attribute name="ID"> <xsl:value-of select="Reservation/ResProfiles/ResProfile/x:Profile/x:profileID"/> </xsl:attribute> <xsl:attribute name="ID_Context"> <xsl:value-of select="'GHA'"/> </xsl:attribute> </UniqueID> <UniqueID> <xsl:attribute name="Type"> <xsl:value-of select="'21'"/> </xsl:attribute> <xsl:attribute name="ID"> <xsl:value-of select="Reservation/ResProfiles/ResProfile/x:Profile/x:mfResortProfileID"/> </xsl:attribute> <xsl:attribute name="ID_Context"> <xsl:value-of select="'protelIO'"/> </xsl:attribute> </UniqueID> <Profile> <xsl:attribute name="CreateDateTime"> <xsl:value-of select="Reservation/ResProfiles/ResProfile/x:Profile/x:createdDate"/> </xsl:attribute> <xsl:attribute name="LastModifyDateTime"> <xsl:value-of select="Reservation/ResProfiles/ResProfile/x:Profile/x:lastUpdated"/> </xsl:attribute> <xsl:attribute name="ProfileType"> <xsl:choose> <xsl:when test="Reservation/ResProfiles/ResProfile/x:Profile/@profileType = 'GUEST'"> <xsl:value-of select="'1'"/> </xsl:when> <xsl:when test="Reservation/ResProfiles/ResProfile/x:Profile/@profileType = 'CORPORATE'"> <xsl:value-of select="'3'"/> </xsl:when> <xsl:when test="Reservation/ResProfiles/ResProfile/x:Profile/@profileType = 'TRAVEL'"> <xsl:value-of select="'4'"/> </xsl:when> <xsl:when test="Reservation/ResProfiles/ResProfile/x:Profile/@profileType = 'WHOLESALER'"> <xsl:value-of select="'5'"/> </xsl:when> <xsl:when test="Reservation/ResProfiles/ResProfile/x:Profile/@profileType = 'GROUP'"> <xsl:value-of select="'6'"/> </xsl:when> </xsl:choose> </xsl:attribute> <Customer> <xsl:attribute name="BirthDate"> <xsl:value-of select="Reservation/ResProfiles/ResProfile/x:Profile[@profileType = 'GUEST']/x:dateOfBirth"/> </xsl:attribute> <xsl:attribute name="CustomerValue"> <xsl:value-of select="Reservation/ResProfiles/ResProfile/x:Profile[@profileType = 'GUEST']/x:mfVipStatus"/> </xsl:attribute> <xsl:attribute name="Language"> <xsl:choose> <xsl:when test="string(Reservation/ResProfiles/ResProfile/x:Profile[./x:primaryLanguageID = 'AR']) != ''"> <xsl:value-of select="'ar'"/> </xsl:when> <xsl:when test="string(Reservation/ResProfiles/ResProfile/x:Profile[./x:primaryLanguageID = 'DA']) != ''"> <xsl:value-of select="'da'"/> </xsl:when> <xsl:when test="string(Reservation/ResProfiles/ResProfile/x:Profile[./x:primaryLanguageID = 'DE']) != ''"> <xsl:value-of select="'de'"/> </xsl:when> <xsl:when test="string(Reservation/ResProfiles/ResProfile/x:Profile[./x:primaryLanguageID = 'E']) != ''"> <xsl:value-of select="'en'"/> </xsl:when> <xsl:when test="string(Reservation/ResProfiles/ResProfile/x:Profile[./x:primaryLanguageID = 'ES']) != ''"> <xsl:value-of select="'es'"/> </xsl:when> <xsl:when test="string(Reservation/ResProfiles/ResProfile/x:Profile[./x:primaryLanguageID = 'FA']) != ''"> <xsl:value-of select="'fa'"/> </xsl:when> <xsl:when test="string(Reservation/ResProfiles/ResProfile/x:Profile[./x:primaryLanguageID = 'FI']) != ''"> <xsl:value-of select="'fi'"/> </xsl:when> <xsl:when test="string(Reservation/ResProfiles/ResProfile/x:Profile[./x:primaryLanguageID = 'FR']) != ''"> <xsl:value-of select="'fr'"/> </xsl:when> <xsl:when test="string(Reservation/ResProfiles/ResProfile/x:Profile[./x:primaryLanguageID = 'JA']) != ''"> <xsl:value-of select="'ja'"/> </xsl:when> <xsl:when test="string(Reservation/ResProfiles/ResProfile/x:Profile[./x:primaryLanguageID = 'NL']) != ''"> <xsl:value-of select="'nl'"/> </xsl:when> <xsl:when test="string(Reservation/ResProfiles/ResProfile/x:Profile[./x:primaryLanguageID = 'NO']) != ''"> <xsl:value-of select="'no'"/> </xsl:when> <xsl:when test="string(Reservation/ResProfiles/ResProfile/x:Profile[./x:primaryLanguageID = 'PT']) != ''"> <xsl:value-of select="'pt'"/> </xsl:when> <xsl:when test="string(Reservation/ResProfiles/ResProfile/x:Profile[./x:primaryLanguageID = 'SE']) != ''"> <xsl:value-of select="'sv'"/> </xsl:when> <xsl:when test="string(Reservation/ResProfiles/ResProfile/x:Profile[./x:primaryLanguageID = 'FA']) != ''"> <xsl:value-of select="'fa'"/> </xsl:when> <xsl:when test="string(Reservation/ResProfiles/ResProfile/x:Profile[./x:primaryLanguageID = 'ZH']) != ''"> <xsl:value-of select="'zh'"/> </xsl:when> </xsl:choose> </xsl:attribute> <PersonName> <NamePrefix> <xsl:value-of select="Reservation/ResProfiles/ResProfile/x:Profile[@profileType = 'GUEST']/x:IndividualName/x:namePrefix"/> </NamePrefix> <GivenName> <xsl:value-of select="Reservation/ResProfiles/ResProfile/x:Profile[@profileType = 'GUEST']/x:IndividualName/x:nameFirst"/> </GivenName> <Surname> <xsl:value-of select="Reservation/ResProfiles/ResProfile/x:Profile[@profileType = 'GUEST']/x:IndividualName/x:nameSur"/> </Surname> <NameTitle> <xsl:value-of select="Reservation/ResProfiles/ResProfile/x:Profile[@profileType = 'GUEST']/x:IndividualName/x:nameTitle"/> </NameTitle> <Document> <xsl:attribute name="BirthDate"> <xsl:value-of select="Reservation/ResProfiles/ResProfile/x:Profile[@profileType = 'GUEST']/x:dateOfBirth"/> </xsl:attribute> </Document> </PersonName> <xsl:for-each select="Reservation/ResProfiles/ResProfile/x:Profile[@profileType = 'GUEST']/x:PhoneNumbers/x:PhoneNumber[x:mfPrimaryYN = 'Y' and (@phoneNumberType = 'BUSINESS' or @phoneNumberType = 'HOME')]"> <Telephone> <xsl:attribute name="PhoneNumber"> <xsl:value-of select="./x:phoneNumber"/> </xsl:attribute> <xsl:attribute name="PhoneTechType"> <xsl:choose> <xsl:when test="@phoneNumberType = 'HOME'"> <xsl:value-of select="'1'"/> </xsl:when> <xsl:when test="@phoneNumberType = 'BUSINESS'"> <xsl:value-of select="'1'"/> </xsl:when> <xsl:when test="@phoneNumberType = 'HOMEFAX'"> <xsl:value-of select="'3'"/> </xsl:when> <xsl:when test="@phoneNumberType = 'BUSINESSFAX'"> <xsl:value-of select="'3'"/> </xsl:when> <xsl:when test="@phoneNumberType = 'MOBILE'"> <xsl:value-of select="'5'"/> </xsl:when> </xsl:choose> </xsl:attribute> </Telephone> </xsl:for-each> <xsl:for-each select="Reservation/ResProfiles/ResProfile/x:Profile[@profileType = 'GUEST']/x:ElectronicAddresses/x:ElectronicAddress[x:mfPrimaryYN = 'Y']"> <Email> <xsl:attribute name="EmailType"> <xsl:value-of select="'1'"/> </xsl:attribute> <xsl:value-of select="./x:eAddress"/> </Email> </xsl:for-each> <xsl:for-each select="Reservation/ResProfiles/ResProfile/x:Profile[@profileType = 'GUEST']/x:PostalAddresses/x:PostalAddress[x:mfPrimaryYN = 'Y']"> <Address> <xsl:attribute name="Type"> <xsl:choose> <xsl:when test="@addressType = 'HOME'"> <xsl:value-of select="'1'"/> </xsl:when> <xsl:when test="@addressType = 'BUSINESS'"> <xsl:value-of select="'2'"/> </xsl:when> </xsl:choose> </xsl:attribute> <AddressLine> <xsl:value-of select="./x:address1"/> </AddressLine> <AddressLine> <xsl:value-of select="./x:address2"/> </AddressLine> <AddressLine> <xsl:value-of select="./x:address3"/> </AddressLine> <CityName> <xsl:value-of select="./x:city"/> </CityName> <PostalCode> <xsl:value-of select="./x:postalCode"/> </PostalCode> <StateProv> <xsl:attribute name="StateCode"> <xsl:value-of select="./x:stateCode"/> </xsl:attribute> </StateProv> <CountryName> <xsl:attribute name="Code"> <xsl:value-of select="./x:countryCode"/> </xsl:attribute> </CountryName> </Address> </xsl:for-each> <xsl:for-each select="Reservation/ResProfiles/ResProfile/x:Profile[@profileType = 'GUEST']/x:Memberships/x:Membership"> <CustLoyalty> <xsl:attribute name="MembershipID"> <xsl:value-of select="./x:accountID"/> </xsl:attribute> <xsl:attribute name="AllianceLoyaltyLevelName"> <xsl:value-of select="./x:programCode"/> </xsl:attribute> <xsl:attribute name="LoyalLevel"> <xsl:value-of select="./x:levelCode"/> </xsl:attribute> <xsl:attribute name="ExpireDate"> <xsl:value-of select="./x:expireDate"/> </xsl:attribute> <xsl:attribute name="EffectiveDate"> <xsl:value-of select="./x:startDate"/> </xsl:attribute> <xsl:attribute name="Remark"> <xsl:value-of select="./x:enrollmentCode"/> </xsl:attribute> </CustLoyalty> </xsl:for-each> <xsl:for-each select="Reservation/ResProfiles/ResProfile/x:Profile[@profileType = 'GUEST']/x:ElectronicAddresses/x:ElectronicAddress"></xsl:for-each> </Customer> <TPA_Extensions> <RoomPreferences> <xsl:for-each select="Reservation/ResProfiles/ResProfile/x:Profile/x:SpecialRequests/x:SpecialRequest[@mfSpecialRequestType = 'FEA']"> <RoomPreference> <xsl:attribute name="Code"> <xsl:choose> <xsl:when test="./@mfSpecialRequestType = 'FEA'"> <xsl:value-of select="'GHA_PrefR'"/> </xsl:when> </xsl:choose> </xsl:attribute> <xsl:attribute name="Value"> <xsl:choose> <xsl:when test="./@mfSpecialRequestType = 'FEA'"> <xsl:value-of select="concat(./@mfSpecialRequestType,'_',./x:requestCode)"/> </xsl:when> </xsl:choose> </xsl:attribute> </RoomPreference> </xsl:for-each> </RoomPreferences> <CustomerPreferences> <xsl:for-each select="Reservation/ResProfiles/ResProfile/x:Profile/x:SpecialRequests/x:SpecialRequest[@mfSpecialRequestType != 'FEA']"> <CustomerPreference> <xsl:attribute name="Code"> <xsl:choose> <xsl:when test="./@mfSpecialRequestType != 'FEA'"> <xsl:value-of select="'GHA_PrefG'"/> </xsl:when> </xsl:choose> </xsl:attribute> <xsl:attribute name="Value"> <xsl:choose> <xsl:when test="./@mfSpecialRequestType != 'FEA'"> <xsl:value-of select="concat(./@mfSpecialRequestType,'_',./x:requestCode)"/> </xsl:when> </xsl:choose> </xsl:attribute> </CustomerPreference> </xsl:for-each> </CustomerPreferences> <Optinouts> <Optinout> <xsl:attribute name="OptinoutEvent"> <xsl:value-of select="'Reservation'"/> </xsl:attribute> <xsl:attribute name="OptinoutType"> <xsl:value-of select="'Mail'"/> </xsl:attribute> <xsl:attribute name="OptinoutStatus"> <xsl:choose> <xsl:when test="Reservation/ResProfiles/ResProfile/x:Profile/x:PrivacyOption/x:mfAllowEMail = 'Y'"> <xsl:value-of select="'yes'"/> </xsl:when> <xsl:when test="Reservation/ResProfiles/ResProfile/x:Profile/x:PrivacyOption/x:mfAllowEMail = 'N'"> <xsl:value-of select="'no'"/> </xsl:when> </xsl:choose> </xsl:attribute> </Optinout> <Optinout> <xsl:attribute name="OptinoutEvent"> <xsl:value-of select="'Reservation'"/> </xsl:attribute> <xsl:attribute name="OptinoutType"> <xsl:value-of select="'Letter'"/> </xsl:attribute> <xsl:attribute name="OptinoutStatus"> <xsl:choose> <xsl:when test="Reservation/ResProfiles/ResProfile/x:Profile/x:PrivacyOption/x:mfAllowMail = 'Y'"> <xsl:value-of select="'yes'"/> </xsl:when> <xsl:when test="Reservation/ResProfiles/ResProfile/x:Profile/x:PrivacyOption/x:mfAllowMail = 'N'"> <xsl:value-of select="'no'"/> </xsl:when> </xsl:choose> </xsl:attribute> </Optinout> <Optinout> <xsl:attribute name="OptinoutEvent"> <xsl:value-of select="'Reservation'"/> </xsl:attribute> <xsl:attribute name="OptinoutType"> <xsl:value-of select="'Phone'"/> </xsl:attribute> <xsl:attribute name="OptinoutStatus"> <xsl:choose> <xsl:when test="Reservation/ResProfiles/ResProfile/x:Profile/x:PrivacyOption/x:mfAllowPhone = '1'"> <xsl:value-of select="'yes'"/> </xsl:when> <xsl:when test="Reservation/ResProfiles/ResProfile/x:Profile/x:PrivacyOption/x:mfAllowPhone = '0'"> <xsl:value-of select="'no'"/> </xsl:when> </xsl:choose> </xsl:attribute> </Optinout> <Optinout> <xsl:attribute name="OptinoutEvent"> <xsl:value-of select="'Reservation'"/> </xsl:attribute> <xsl:attribute name="OptinoutType"> <xsl:value-of select="'TextMessage'"/> </xsl:attribute> <xsl:attribute name="OptinoutStatus"> <xsl:choose> <xsl:when test="Reservation/ResProfiles/ResProfile/x:Profile/x:PrivacyOption/x:mfAllowSMS = '1'"> <xsl:value-of select="'yes'"/> </xsl:when> <xsl:when test="Reservation/ResProfiles/ResProfile/x:Profile/x:PrivacyOption/x:mfAllowSMS = '0'"> <xsl:value-of select="'no'"/> </xsl:when> </xsl:choose> </xsl:attribute> </Optinout> </Optinouts> <Traces> <xsl:for-each select="Reservation/ResProfiles/ResProfile/x:Profile/x:Comments/x:Comment"> <Trace> <xsl:attribute name="TraceDate"> <xsl:value-of select="concat(./@ItemID, substring(translate(./x:lastUpdated,' ',''), 0, 11))"/> </xsl:attribute> <xsl:attribute name="TraceTime"> <xsl:value-of select="concat(./@ItemID, substring(translate(./x:lastUpdated,' ',''), 12, 12))"/> </xsl:attribute> <xsl:attribute name="TraceDepartment"> <xsl:value-of select="'GHA'"/> </xsl:attribute> <xsl:attribute name="TraceText"> <xsl:value-of select="./x:commentStr"/> </xsl:attribute> </Trace> </xsl:for-each> <xsl:for-each select="Reservation/ResProfiles/ResProfile/x:Profile/x:SpecialRequests/x:SpecialRequest[@mfSpecialRequestType != 'FEA']"> <Trace> <xsl:attribute name="TraceDate"> <xsl:value-of select="concat(./@ItemID, substring(translate(../../../../../StayDateRange/startTime,' ',''), 0, 11))"/> </xsl:attribute> <xsl:attribute name="TraceTime"> <xsl:value-of select="concat(./@ItemID, substring(translate(../../../../../StayDateRange/startTime,' ',''), 12, 12))"/> </xsl:attribute> <xsl:attribute name="TraceDepartment"> <xsl:choose> <xsl:when test="./@mfSpecialRequestType != 'FEA'"> <xsl:value-of select="'GHA_PrefG'"/> </xsl:when> </xsl:choose> </xsl:attribute> <xsl:attribute name="TraceText"> <xsl:choose> <xsl:when test="./@mfSpecialRequestType != 'FEA'"> <xsl:value-of select="concat(./@mfSpecialRequestType,' - ',./x:requestCode)"/> </xsl:when> </xsl:choose> </xsl:attribute> </Trace> </xsl:for-each> <xsl:for-each select="Reservation/ResProfiles/ResProfile/x:Profile/x:SpecialRequests/x:SpecialRequest[@mfSpecialRequestType = 'FEA']"> <Trace> <xsl:attribute name="TraceDate"> <xsl:value-of select="concat(./@ItemID, substring(translate(../../../../../StayDateRange/startTime,' ',''), 0, 11))"/> </xsl:attribute> <xsl:attribute name="TraceTime"> <xsl:value-of select="concat(./@ItemID, substring(translate(../../../../../StayDateRange/startTime,' ',''), 12, 12))"/> </xsl:attribute> <xsl:attribute name="TraceDepartment"> <xsl:choose> <xsl:when test="./@mfSpecialRequestType = 'FEA'"> <xsl:value-of select="'GHA_PrefR'"/> </xsl:when> </xsl:choose> </xsl:attribute> <xsl:attribute name="TraceText"> <xsl:choose> <xsl:when test="./@mfSpecialRequestType = 'FEA'"> <xsl:value-of select="concat(./@mfSpecialRequestType,' - ',./x:requestCode)"/> </xsl:when> </xsl:choose> </xsl:attribute> </Trace> </xsl:for-each> </Traces> </TPA_Extensions> <Comments> <xsl:for-each select="Reservation/ResProfiles/ResProfile/x:Profile/x:ResortComments/x:ResortComment"> <Comment> <Text> <xsl:value-of select="./x:Comment"/> </Text> </Comment> </xsl:for-each> </Comments> </Profile> </ProfileInfo> </Profiles> </ResGuest> </ResGuests> <ResGlobalInfo> <HotelReservationIDs> <HotelReservationID> <xsl:attribute name="ForGuest"> <xsl:value-of select="'true'"/> </xsl:attribute> <xsl:attribute name="ResID_Source"> <xsl:value-of select="'GHA'"/> </xsl:attribute> <xsl:attribute name="ResID_Type"> <xsl:value-of select="'14'"/> </xsl:attribute> <xsl:attribute name="ResID_Value"> <xsl:value-of select="Reservation/confirmationID"/> </xsl:attribute> </HotelReservationID> </HotelReservationIDs> </ResGlobalInfo> </HotelReservation> </HotelReservations> </OTA_HotelResNotifRQ> </xsl:template> <xsl:template name="GenerateRatePlans"> <xsl:param name="start"/> <xsl:param name="end"/> <xsl:variable name="days_between" select="(xs:date($end) - xs:date($start)) div xs:dayTimeDuration('P1D')"/> <xsl:if test="number($days_between) > 0"> <xsl:variable name="nextDay" select="xs:date($start) + xs:dayTimeDuration('P1D')"/> <RatePlan> <xsl:attribute name="RatePlanCode"> <xsl:value-of select="Reservation/RoomStays/RoomStay/RatePlans/RatePlan/ratePlanCode"/> </xsl:attribute> <xsl:attribute name="EffectiveDate"> <xsl:value-of select="$start"/> </xsl:attribute> <xsl:attribute name="ExpireDate"> <xsl:value-of select="$nextDay"/> </xsl:attribute> <RatePlanInclusions> <xsl:attribute name="RatePlanInclusions"> <xsl:value-of select="'false'"/> </xsl:attribute> </RatePlanInclusions> </RatePlan> <xsl:call-template name="GenerateRatePlans"> <xsl:with-param name="start" select="$nextDay"/> <xsl:with-param name="end" select="$end"/> </xsl:call-template> </xsl:if> </xsl:template> <xsl:template name="GenerateRoomRates"> <xsl:param name="start"/> <xsl:param name="end"/> <xsl:variable name="days_between" select="(xs:date($end) - xs:date($start)) div xs:dayTimeDuration('P1D')"/> <xsl:if test="number($days_between) > 0"> <xsl:variable name="nextDay" select="xs:date($start) + xs:dayTimeDuration('P1D')"/> <RoomRate> <xsl:attribute name="RatePlanCode"> <xsl:value-of select="Reservation/RoomStays/RoomStay/RatePlans/RatePlan/ratePlanCode"/> </xsl:attribute> <xsl:attribute name="RoomTypeCode"> <xsl:value-of select="Reservation/RoomStays/RoomStay/roomInventoryCode"/> </xsl:attribute> <xsl:attribute name="EffectiveDate"> <xsl:value-of select="$start"/> </xsl:attribute> <xsl:attribute name="ExpireDate"> <xsl:value-of select="$nextDay"/> </xsl:attribute> <xsl:attribute name="NumberOfUnits"> <xsl:value-of select="Reservation/mfImage/numRooms"/> </xsl:attribute> <Rates> <Rate> <xsl:variable name="rateCount" select="count(Reservation/RoomStays/RoomStay/RatePlans/RatePlan/Rates/Rate)"/> <xsl:attribute name="RateTimeUnit"> <xsl:value-of select="'Day'"/> </xsl:attribute> <xsl:attribute name="EffectiveDate"> <xsl:value-of select="$start"/> </xsl:attribute> <xsl:attribute name="ExpireDate"> <xsl:value-of select="$nextDay"/> </xsl:attribute> <xsl:attribute name="UnitMultiplier"> <xsl:value-of select="func:GetUnitMultiplier($rateCount, $start, .)"/> </xsl:attribute> <Base> <xsl:attribute name="CurrencyCode"> <xsl:value-of select="func:GetCurrencyCode($rateCount, $start, .)"/> </xsl:attribute> <xsl:attribute name="AmountAfterTax"> <xsl:value-of select="func:GetAmountAfterTax($rateCount, $start, .)"/> </xsl:attribute> </Base> <Total/> <TPA_Extensions> <RateAmountExtensions> <RateAmount/> </RateAmountExtensions> </TPA_Extensions> </Rate> </Rates> </RoomRate> <xsl:call-template name="GenerateRoomRates"> <xsl:with-param name="start" select="$nextDay"/> <xsl:with-param name="end" select="$end"/> </xsl:call-template> </xsl:if> </xsl:template>
<xsl:function name="func:GetUnitMultiplier" xmlns:func="http://example.com/mf"> <xsl:param name="index"/> <xsl:param name="inputDate"/> <xsl:param name="root"/>
<xsl:variable name="rateDateStr" select="$root//RoomStays/RoomStay/RatePlans/RatePlan/Rates/Rate[number($index)]/TimeSpan/startTime"/>
<xsl:choose> <xsl:when test="$rateDateStr"> <xsl:choose> <xsl:when test="xs:dateTime($inputDate) >= xs:dateTime($rateDateStr)"> <xsl:sequence select="$root//RoomStays/RoomStay/RatePlans/RatePlan/Rates/Rate[number($index)]/rateBasisUnits"/> </xsl:when> <xsl:otherwise> <xsl:variable name="index" select="number($index) - 1"/> <xsl:sequence select="func:GetUnitMultiplier($index, $inputDate, $root)"/> </xsl:otherwise> </xsl:choose> </xsl:when> <xsl:otherwise> <xsl:sequence select="$root//RoomStays/RoomStay/RatePlans/RatePlan/Rates/Rate[1]/rateBasisUnits"/> </xsl:otherwise> </xsl:choose> </xsl:function>
<xsl:function name="func:GetCurrencyCode" xmlns:func="http://example.com/mf"> <xsl:param name="index"/> <xsl:param name="inputDate"/> <xsl:param name="root"/>
<xsl:variable name="rateDateStr" select="$root//RoomStays/RoomStay/RatePlans/RatePlan/Rates/Rate[number($index)]/TimeSpan/startTime"/>
<xsl:choose> <xsl:when test="$rateDateStr"> <xsl:choose> <xsl:when test="xs:dateTime($inputDate) >= xs:dateTime($rateDateStr)"> <xsl:sequence select="$root//RoomStays/RoomStay/RatePlans/RatePlan/Rates/Rate[number($index)]/Amount/@currencyCode"/> </xsl:when> <xsl:otherwise> <xsl:variable name="index" select="number($index) - 1"/> <xsl:sequence select="func:GetCurrencyCode($index, $inputDate, $root)"/> </xsl:otherwise> </xsl:choose> </xsl:when> <xsl:otherwise> <xsl:sequence select="$root//RoomStays/RoomStay/RatePlans/RatePlan/Rates/Rate[1]/Amount/@currencyCode"/> </xsl:otherwise> </xsl:choose> </xsl:function>
<xsl:function name="func:GetAmountAfterTax" xmlns:func="http://example.com/mf"> <xsl:param name="index"/> <xsl:param name="inputDate"/> <xsl:param name="root"/>
<xsl:variable name="rateDateStr" select="$root//RoomStays/RoomStay/RatePlans/RatePlan/Rates/Rate[number($index)]/TimeSpan/startTime"/>
<xsl:choose> <xsl:when test="$rateDateStr"> <xsl:choose> <xsl:when test="xs:dateTime($inputDate) >= xs:dateTime($rateDateStr)"> <xsl:sequence select="$root//RoomStays/RoomStay/RatePlans/RatePlan/Rates/Rate[number($index)]/Amount/valueNum"/> </xsl:when> <xsl:otherwise> <xsl:variable name="index" select="number($index) - 1"/> <xsl:sequence select="func:GetAmountAfterTax($index, $inputDate, $root)"/> </xsl:otherwise> </xsl:choose> </xsl:when> <xsl:otherwise> <xsl:sequence select="$root//RoomStays/RoomStay/RatePlans/RatePlan/Rates/Rate[1]/Amount/valueNum"/> </xsl:otherwise> </xsl:choose> </xsl:function></xsl:stylesheet>