{"id":191,"date":"2020-02-21T17:37:50","date_gmt":"2020-02-21T08:37:50","guid":{"rendered":"https:\/\/developer.worldspan.co.kr\/?p=191"},"modified":"2020-02-26T09:27:14","modified_gmt":"2020-02-26T00:27:14","slug":"lowfaresearchreq-%ec%98%88%ec%a0%9c1","status":"publish","type":"post","link":"https:\/\/developer.worldspan.co.kr\/?p=191","title":{"rendered":"Transformation \uc694\uae08\uc870\ud68c \uc608\uc81c"},"content":{"rendered":"<p><a href=\"https:\/\/developer.worldspan.co.kr\/wp-content\/uploads\/2020\/02\/traveltime.jpg\"><img loading=\"lazy\" class=\"alignnone size-full wp-image-192\" src=\"https:\/\/developer.worldspan.co.kr\/wp-content\/uploads\/2020\/02\/traveltime.jpg\" alt=\"\" width=\"545\" height=\"961\" srcset=\"https:\/\/developer.worldspan.co.kr\/wp-content\/uploads\/2020\/02\/traveltime.jpg 545w, https:\/\/developer.worldspan.co.kr\/wp-content\/uploads\/2020\/02\/traveltime-170x300.jpg 170w\" sizes=\"(max-width: 545px) 100vw, 545px\" \/><\/a><\/p>\n<h3>xslt<\/h3>\n<pre class=\"lang:xhtml decode:true \" >&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;\r\n&lt;xsl:stylesheet version=\"1.0\" xmlns:xsl=\"http:\/\/www.w3.org\/1999\/XSL\/Transform\"&gt;\r\n  &lt;xsl:param name=\"fontSize\"&gt;x-small&lt;\/xsl:param&gt;\r\n  &lt;xsl:output method=\"html\" indent=\"yes\" omit-xml-declaration=\"yes\"\/&gt;\r\n \r\n    &lt;xsl:variable name=\"maximum\"&gt;\r\n      &lt;xsl:value-of select=\"\/\/*[local-name()='AirSegment' and not(preceding-sibling::node()\/@Group &gt; @Group or following-sibling::node()\/@Group &gt; @Group)]\/@Group\" \/&gt;\r\n    &lt;\/xsl:variable&gt;\r\n  &lt;xsl:template match=\"\/\"&gt;\r\n    &lt;html&gt;\r\n      &lt;head&gt;\r\n        &lt;title&gt;Travelport Universal API Low Fare response&lt;\/title&gt;\r\n        &lt;style type=\"text\/css\"&gt;\r\n          BODY,table {font-size: &lt;xsl:value-of select=\"$fontSize\"&gt;&lt;\/xsl:value-of&gt;;}\r\n          table.main {margin-bottom: 12px;border-bottom-style:solid;border-bottom-color:#0075b0; width=\"100%\"}\r\n          table.main thead {background-color: #0075b0; color:white;}\r\n          table.main caption {background-color: #0075b0; color:white;font-size: larger; font-weight:bold;}\r\n          table.main td {padding: 1px;}\r\n          tr.out td {border-top-style: solid; border-top-color: #72c7e7;}\r\n          tr.in td {border-top-style: solid; border-top-color: #7ab800;}\r\n          tr.middle td {border-top-style: solid; border-top-color: #dbceac;}\r\n          td.time {text-align:right;}\r\n          td.center {text-align:center;}\r\n          h1 {background-color: #7ab800; color:white;}\r\n        &lt;\/style&gt;\r\n      &lt;\/head&gt;\r\n      &lt;body&gt;\r\n        &lt;table&gt;\r\n          &lt;tr&gt;\r\n            &lt;td&gt;\r\n              &lt;h1&gt;\r\n                &lt;a name=\"#air\"&gt;Air fares&lt;\/a&gt;\r\n              &lt;\/h1&gt;\r\n              &lt;a href=\"#rail\"&gt;Go to rail fares&lt;\/a&gt;\r\n            &lt;\/td&gt;\r\n          &lt;\/tr&gt;\r\n          &lt;xsl:apply-templates select=\"\/\/*[local-name()='AirPricingSolution']\"\/&gt;\r\n          &lt;xsl:apply-templates select=\"\/\/*[local-name()='AirPricePoint']\"\/&gt;\r\n          &lt;tr&gt;\r\n            &lt;td&gt;\r\n              &lt;h1&gt;\r\n                &lt;a name=\"#rail\"&gt;Rail fares&lt;\/a&gt;\r\n              &lt;\/h1&gt;\r\n              &lt;a href=\"#air\"&gt;Go to air fares&lt;\/a&gt;\r\n            &lt;\/td&gt;\r\n          &lt;\/tr&gt;\r\n        &lt;\/table&gt;\r\n        &lt;xsl:apply-templates select=\"\/\/*[local-name()='RailPricingSolution']\"\/&gt;\r\n      &lt;\/body&gt;\r\n    &lt;\/html&gt;\r\n  &lt;\/xsl:template&gt;\r\n \r\n  &lt;xsl:template match=\"\/\/*[local-name()='AirPricingSolution']\"&gt;\r\n    &lt;xsl:variable name=\"Amt\"&gt;\r\n      &lt;xsl:value-of select=\".\/@TotalPrice\"\/&gt;\r\n    &lt;\/xsl:variable&gt;\r\n    &lt;tr&gt;\r\n      &lt;td&gt;\r\n        &lt;table class=\"main\"&gt;\r\n          &lt;caption&gt;\r\n            Total price:\r\n            &lt;xsl:value-of select=\"$Amt\"\/&gt;\r\n          &lt;\/caption&gt;\r\n          &lt;thead &gt;\r\n            &lt;tr&gt;\r\n              &lt;th&gt;Direction&lt;\/th&gt;\r\n              &lt;th&gt;Date&lt;\/th&gt;\r\n              &lt;th&gt;Flight&lt;\/th&gt;\r\n              &lt;th&gt;Depart&lt;\/th&gt;\r\n              &lt;th&gt;Arrive&lt;\/th&gt;\r\n              &lt;th&gt;From&lt;\/th&gt;\r\n              &lt;th&gt;To&lt;\/th&gt;\r\n              &lt;th&gt;Class&lt;\/th&gt;\r\n              &lt;th&gt;Cabin&lt;\/th&gt;\r\n              &lt;th&gt;Source&lt;\/th&gt;\r\n            &lt;\/tr&gt;\r\n          &lt;\/thead&gt;\r\n          &lt;tbody&gt;\r\n            &lt;xsl:apply-templates select=\"*[local-name()='AirSegmentRef']\" \/&gt;\r\n            &lt;xsl:apply-templates select=\"*[local-name()='Journey']\" \/&gt;\r\n          &lt;\/tbody&gt;\r\n        &lt;\/table&gt;\r\n      &lt;\/td&gt;\r\n    &lt;\/tr&gt;\r\n  &lt;\/xsl:template&gt;\r\n \r\n  &lt;xsl:template match=\"\/\/*[local-name()='AirPricePoint']\"&gt;\r\n    &lt;xsl:variable name=\"Amt\"&gt;\r\n      &lt;xsl:value-of select=\".\/@TotalPrice\"\/&gt;\r\n    &lt;\/xsl:variable&gt;\r\n    &lt;tr&gt;\r\n      &lt;td&gt;\r\n        &lt;table class=\"main\"&gt;\r\n          &lt;caption&gt;\r\n            \r\n            &lt;xsl:value-of select=\".\/@TotalPrice\"\/&gt; (base: &lt;xsl:value-of select=\".\/@BasePrice\"\/&gt; - taxes: &lt;xsl:value-of select=\".\/@Taxes\"\/&gt;)\r\n          &lt;\/caption&gt;\r\n          &lt;thead &gt;\r\n            &lt;tr&gt;\r\n              &lt;th&gt;Direction&lt;\/th&gt;\r\n              &lt;th&gt;Date&lt;\/th&gt;\r\n              &lt;th&gt;Flight&lt;\/th&gt;\r\n              &lt;th&gt;Depart&lt;\/th&gt;\r\n              &lt;th&gt;Arrive&lt;\/th&gt;\r\n              &lt;th&gt;From&lt;\/th&gt;\r\n              &lt;th&gt;To&lt;\/th&gt;\r\n              &lt;th&gt;Class_&lt;\/th&gt;\r\n              &lt;th&gt;Cabin&lt;\/th&gt;\r\n              &lt;th&gt;Source&lt;\/th&gt;\r\n              &lt;th&gt;\uc5ec\ud589\uc2dc\uac04&lt;\/th&gt;\r\n            &lt;\/tr&gt;\r\n          &lt;\/thead&gt;\r\n          &lt;tbody&gt;\r\n            &lt;xsl:for-each select=\"*[local-name()='AirPricingInfo'][position()=1]\"&gt;\r\n              &lt;xsl:apply-templates select=\"*[local-name()='FlightOptionsList']\/*[local-name()='FlightOption']\/*[local-name()='Option']\" \/&gt;\r\n            &lt;\/xsl:for-each&gt;\r\n          &lt;\/tbody&gt;\r\n        &lt;\/table&gt;\r\n      &lt;\/td&gt;\r\n    &lt;\/tr&gt;\r\n  &lt;\/xsl:template&gt;\r\n \r\n  &lt;xsl:template match=\"*[local-name()='AirSegmentRef']\"&gt;\r\n    &lt;xsl:variable name=\"indexFlight\" select=\".\/@Key\"\/&gt;\r\n    &lt;xsl:variable name=\"position\" select=\"position()-2\" \/&gt;\r\n \r\n    &lt;xsl:variable name=\"connecting\" select=\"..\/*[local-name()='Connection' and @SegmentIndex=$position]\/@SegmentIndex\" \/&gt;\r\n \r\n    &lt;xsl:variable name=\"bookingClass\" select=\"..\/*[local-name()='AirPricingInfo'][position()=1]\/*[local-name()='BookingInfo' and @SegmentRef=$indexFlight]\/@BookingCode\"\/&gt;\r\n\t&lt;xsl:variable name=\"bookingCount\" select=\"..\/*[local-name()='AirPricingInfo'][position()=1]\/*[local-name()='BookingInfo' and @SegmentRef=$indexFlight]\/@BookingCount\"\/&gt;\r\n    &lt;xsl:variable name=\"cabinClass\" select=\"..\/*[local-name()='AirPricingInfo'][position()=1]\/*[local-name()='BookingInfo' and @SegmentRef=$indexFlight]\/@CabinClass\"\/&gt;\r\n    &lt;xsl:variable name=\"providerCode\" select=\"..\/*[local-name()='AirPricingInfo'][position()=1]\/@ProviderCode\"\/&gt;\r\n \r\n    &lt;xsl:for-each select=\"\/\/*[local-name()='AirSegment' and .\/@Key=$indexFlight]\"&gt;\r\n      &lt;xsl:variable name=\"directionName\"&gt;\r\n        &lt;xsl:if test=\"not($connecting)\" &gt;\r\n          &lt;xsl:if test=\"$maximum&gt;1\"&gt;\r\n            OD Part &lt;xsl:value-of select=\".\/@Group\"\/&gt;\r\n          &lt;\/xsl:if&gt;\r\n          &lt;xsl:if test=\"$maximum=1\"&gt;\r\n            &lt;xsl:choose&gt;\r\n              &lt;xsl:when test=\".\/@Group='0'\"&gt;Outbound&lt;\/xsl:when&gt;\r\n              &lt;xsl:otherwise&gt;Inbound&lt;\/xsl:otherwise&gt;\r\n            &lt;\/xsl:choose&gt;\r\n          &lt;\/xsl:if&gt;\r\n          &lt;xsl:if test=\"$maximum=0\"&gt;Oneway&lt;\/xsl:if&gt;\r\n        &lt;\/xsl:if&gt;\r\n      &lt;\/xsl:variable&gt;\r\n      &lt;tr&gt;\r\n        &lt;xsl:attribute name=\"class\"&gt;\r\n          &lt;xsl:choose&gt;\r\n            &lt;xsl:when test=\".\/@Group='0' and $directionName!=''\"&gt;out&lt;\/xsl:when&gt;\r\n            &lt;xsl:when test=\"($maximum=.\/@Group and $directionName!='')\"&gt;in&lt;\/xsl:when&gt;\r\n            &lt;xsl:when test=\"$directionName=''\"&gt;&lt;\/xsl:when&gt;\r\n            &lt;xsl:otherwise &gt;middle&lt;\/xsl:otherwise &gt;\r\n          &lt;\/xsl:choose&gt;\r\n        &lt;\/xsl:attribute&gt;\r\n        &lt;td &gt;\r\n          &lt;xsl:value-of select=\"$directionName\"\/&gt;\r\n        &lt;\/td&gt;\r\n        &lt;td&gt;\r\n          &lt;xsl:value-of select=\"substring(.\/@DepartureTime,1,10)\"\/&gt;\r\n        &lt;\/td&gt;\r\n        &lt;td&gt;\r\n          &lt;xsl:value-of select=\".\/@Carrier\"\/&gt;\r\n          &lt;xsl:value-of select=\".\/@FlightNumber\"\/&gt;\r\n        &lt;\/td&gt;\r\n        &lt;td class=\"time\"&gt;\r\n          &lt;xsl:value-of select=\"substring(.\/@DepartureTime,12,5)\"\/&gt;\r\n        &lt;\/td&gt;\r\n        &lt;td class=\"time\"&gt;\r\n          &lt;xsl:value-of select=\"substring(.\/@ArrivalTime,12,5)\"\/&gt;\r\n        &lt;\/td&gt;\r\n        &lt;td&gt;\r\n          &lt;xsl:value-of select=\".\/@Origin\"\/&gt;\r\n        &lt;\/td&gt;\r\n        &lt;td&gt;\r\n          &lt;xsl:value-of select=\".\/@Destination\"\/&gt;\r\n        &lt;\/td&gt;\r\n        &lt;td class=\"center\"&gt;\r\n          &lt;xsl:value-of select=\"$bookingClass\"\/&gt;\r\n\t\t  &lt;xsl:value-of select=\"$bookingCount\"\/&gt; *\r\n        &lt;\/td&gt;\r\n        &lt;td&gt;\r\n          &lt;xsl:choose &gt;\r\n            &lt;xsl:when test=\"$cabinClass\"&gt;\r\n              &lt;xsl:value-of select=\"$cabinClass\"\/&gt;\r\n            &lt;\/xsl:when&gt;\r\n            &lt;xsl:otherwise&gt;\r\n              &amp;#160;\r\n            &lt;\/xsl:otherwise&gt;\r\n          &lt;\/xsl:choose&gt;\r\n        &lt;\/td&gt;\r\n        &lt;td&gt;\r\n          &lt;xsl:value-of select=\"$providerCode\"\/&gt;\r\n          &lt;xsl:if test=\".\/@AvailabilitySource\"&gt;\r\n            -\r\n            &lt;xsl:value-of select=\".\/@AvailabilitySource\"\/&gt;\r\n          &lt;\/xsl:if&gt;\r\n        &lt;\/td&gt;\r\n      &lt;\/tr&gt;\r\n    &lt;\/xsl:for-each&gt;\r\n  &lt;\/xsl:template&gt;\r\n \r\n  &lt;xsl:template match=\"*[local-name()='Journey']\"&gt;\r\n    &lt;xsl:call-template name=\"SegmentsForJourney\" \/&gt;\r\n  &lt;\/xsl:template&gt;\r\n \r\n  &lt;xsl:template name=\"SegmentsForJourney\"&gt;\r\n    &lt;xsl:for-each select=\"*[local-name()='AirSegmentRef']\"&gt;\r\n      &lt;xsl:variable name=\"indexFlight\" select=\".\/@Key\"\/&gt;\r\n      &lt;xsl:variable name=\"position\" select=\"position()-2\" \/&gt;\r\n \r\n      &lt;xsl:variable name=\"connecting\" select=\"..\/..\/*[local-name()='Connection' and @SegmentIndex=$position]\/@SegmentIndex\" \/&gt;\r\n \r\n      &lt;xsl:variable name=\"bookingClass\" select=\"..\/..\/*[local-name()='AirPricingInfo'][position()=1]\/*[local-name()='BookingInfo' and @SegmentRef=$indexFlight]\/@BookingCode\"\/&gt;\r\n\t  &lt;xsl:variable name=\"bookingCount\" select=\"..\/..\/*[local-name()='AirPricingInfo'][position()=1]\/*[local-name()='BookingInfo' and @SegmentRef=$indexFlight]\/@BookingCount\"\/&gt;\r\n\t  \r\n      &lt;xsl:variable name=\"cabinClass\" select=\"..\/..\/*[local-name()='AirPricingInfo'][position()=1]\/*[local-name()='BookingInfo' and @SegmentRef=$indexFlight]\/@CabinClass\"\/&gt;\r\n      &lt;xsl:variable name=\"providerCode\" select=\"..\/..\/*[local-name()='AirPricingInfo'][position()=1]\/@ProviderCode\"\/&gt;\r\n \r\n      &lt;xsl:for-each select=\"\/\/*[local-name()='AirSegment' and .\/@Key=$indexFlight]\"&gt;\r\n        &lt;xsl:variable name=\"directionName\"&gt;\r\n          &lt;xsl:if test=\"not($connecting)\" &gt;\r\n            &lt;xsl:if test=\"$maximum&gt;1\"&gt;\r\n              OD Part &lt;xsl:value-of select=\".\/@Group\"\/&gt;\r\n            &lt;\/xsl:if&gt;\r\n            &lt;xsl:if test=\"$maximum=1\"&gt;\r\n              &lt;xsl:choose&gt;\r\n                &lt;xsl:when test=\".\/@Group='0'\"&gt;Outbound&lt;\/xsl:when&gt;\r\n                &lt;xsl:otherwise&gt;Inbound&lt;\/xsl:otherwise&gt;\r\n              &lt;\/xsl:choose&gt;\r\n            &lt;\/xsl:if&gt;\r\n            &lt;xsl:if test=\"$maximum=0\"&gt;Oneway&lt;\/xsl:if&gt;\r\n          &lt;\/xsl:if&gt;\r\n        &lt;\/xsl:variable&gt;\r\n        &lt;tr&gt;\r\n          &lt;xsl:attribute name=\"class\"&gt;\r\n            &lt;xsl:choose&gt;\r\n              &lt;xsl:when test=\".\/@Group='0' and $directionName!=''\"&gt;out&lt;\/xsl:when&gt;\r\n              &lt;xsl:when test=\"($maximum=.\/@Group and $directionName!='')\"&gt;in&lt;\/xsl:when&gt;\r\n              &lt;xsl:when test=\"$directionName=''\"&gt;&lt;\/xsl:when&gt;\r\n              &lt;xsl:otherwise &gt;middle&lt;\/xsl:otherwise &gt;\r\n            &lt;\/xsl:choose&gt;\r\n          &lt;\/xsl:attribute&gt;\r\n          &lt;td &gt;\r\n            &lt;xsl:value-of select=\"$directionName\"\/&gt;\r\n          &lt;\/td&gt;\r\n          &lt;td&gt;\r\n            &lt;xsl:value-of select=\"substring(.\/@DepartureTime,1,10)\"\/&gt;\r\n          &lt;\/td&gt;\r\n          &lt;td&gt;\r\n            &lt;xsl:value-of select=\".\/@Carrier\"\/&gt;\r\n            &lt;xsl:value-of select=\".\/@FlightNumber\"\/&gt;\r\n          &lt;\/td&gt;\r\n          &lt;td class=\"time\"&gt;\r\n            &lt;xsl:value-of select=\"substring(.\/@DepartureTime,12,5)\"\/&gt;\r\n          &lt;\/td&gt;\r\n          &lt;td class=\"time\"&gt;\r\n            &lt;xsl:value-of select=\"substring(.\/@ArrivalTime,12,5)\"\/&gt;\r\n          &lt;\/td&gt;\r\n          &lt;td&gt;\r\n            &lt;xsl:value-of select=\".\/@Origin\"\/&gt;\r\n          &lt;\/td&gt;\r\n          &lt;td&gt;\r\n            &lt;xsl:value-of select=\".\/@Destination\"\/&gt;\r\n          &lt;\/td&gt;\r\n          &lt;td class=\"center\"&gt;\r\n            &lt;xsl:value-of select=\"$bookingClass\"\/&gt;\r\n\t\t\t&lt;xsl:value-of select=\"$bookingCount\"\/&gt; _\r\n          &lt;\/td&gt;\r\n          &lt;td&gt;\r\n            &lt;xsl:choose &gt;\r\n              &lt;xsl:when test=\"$cabinClass\"&gt;\r\n                &lt;xsl:value-of select=\"$cabinClass\"\/&gt;\r\n              &lt;\/xsl:when&gt;\r\n              &lt;xsl:otherwise&gt;\r\n                &amp;#160;\r\n              &lt;\/xsl:otherwise&gt;\r\n            &lt;\/xsl:choose&gt;\r\n          &lt;\/td&gt;\r\n          &lt;td&gt;\r\n            &lt;xsl:value-of select=\"$providerCode\"\/&gt;\r\n            &lt;xsl:if test=\".\/@AvailabilitySource\"&gt;\r\n              -\r\n              &lt;xsl:value-of select=\".\/@AvailabilitySource\"\/&gt;\r\n            &lt;\/xsl:if&gt;\r\n          &lt;\/td&gt;\r\n        &lt;\/tr&gt;\r\n      &lt;\/xsl:for-each&gt;\r\n    &lt;\/xsl:for-each&gt;\r\n  &lt;\/xsl:template&gt;\r\n \r\n  &lt;xsl:template match=\"*[local-name()='FlightOptionsList']\/*[local-name()='FlightOption']\/*[local-name()='Option']\"&gt;\r\n  \r\n    &lt;xsl:variable name=\"TravelTime\" select=\".\/@TravelTime\" \/&gt;\r\n\t \r\n    &lt;xsl:for-each select=\"*[local-name()='BookingInfo']\"&gt;\r\n      &lt;xsl:variable name=\"indexFlight\" select=\".\/@SegmentRef\"\/&gt;\r\n      &lt;xsl:variable name=\"position\" select=\"position()-2\" \/&gt;\r\n \r\n      &lt;xsl:variable name=\"connecting\" select=\"..\/*[local-name()='Connection' and @SegmentIndex=$position]\/@SegmentIndex\" \/&gt;\r\n \r\n      &lt;xsl:variable name=\"providerCode\" select=\"ancestor::*[local-name() = 'AirPricingInfo']\/@ProviderCode\" \/&gt;\r\n \r\n      &lt;xsl:variable name=\"bookingClass\" select=\".\/@BookingCode\"\/&gt;\r\n\t  &lt;xsl:variable name=\"bookingCount\" select=\".\/@BookingCount\"\/&gt;\r\n      &lt;xsl:variable name=\"cabinClass\" select=\".\/@CabinClass\"\/&gt;\r\n      &lt;xsl:variable name=\"fareInfoRef\" select=\".\/@FareInfoRef\"\/&gt;\r\n \r\n      &lt;xsl:variable name=\"brandId\" select=\"\/*[local-name()='FareInfo' and @Key=$fareInfoRef]\/*[local-name()='Brand']\/@BrandId\" \/&gt;\r\n      &lt;xsl:variable name=\"brandName\" select=\"\/\/*[local-name()='Brand' and @Key=$brandId]\/@Name\"\/&gt;\r\n      \r\n    \r\n\t  \r\n      &lt;xsl:for-each select=\"\/\/*[local-name()='AirSegment' and .\/@Key=$indexFlight]\"&gt;\r\n        &lt;xsl:variable name=\"directionName\"&gt;\r\n          &lt;xsl:if test=\"not($connecting)\" &gt;\r\n            &lt;xsl:if test=\"$maximum&gt;1\"&gt;\r\n              OD Part &lt;xsl:value-of select=\".\/@Group\"\/&gt;\r\n            &lt;\/xsl:if&gt;\r\n            &lt;xsl:if test=\"$maximum=1\"&gt;\r\n              &lt;xsl:choose&gt;\r\n                &lt;xsl:when test=\".\/@Group='0'\"&gt;Outbound&lt;\/xsl:when&gt;\r\n                &lt;xsl:otherwise&gt;Inbound&lt;\/xsl:otherwise&gt;\r\n              &lt;\/xsl:choose&gt;\r\n            &lt;\/xsl:if&gt;\r\n            &lt;xsl:if test=\"$maximum=0\"&gt;Oneway&lt;\/xsl:if&gt;\r\n          &lt;\/xsl:if&gt;\r\n        &lt;\/xsl:variable&gt;\r\n\t\t\r\n\t\t&lt;xsl:variable name=\"TravelTime02\"&gt;\r\n          &lt;xsl:if test=\"not($connecting)\" &gt;\r\n            &lt;xsl:if test=\"$maximum&gt;1\"&gt;\r\n              &lt;xsl:value-of select=\"$TravelTime\"\/&gt;\r\n            &lt;\/xsl:if&gt;\r\n            &lt;xsl:if test=\"$maximum=1\"&gt;\r\n              &lt;xsl:choose&gt;\r\n                &lt;xsl:when test=\".\/@Group='0'\"&gt;&lt;xsl:value-of select=\"$TravelTime\"\/&gt;&lt;\/xsl:when&gt;\r\n                &lt;xsl:otherwise&gt;&lt;xsl:value-of select=\"$TravelTime\"\/&gt;&lt;\/xsl:otherwise&gt;\r\n              &lt;\/xsl:choose&gt;\r\n            &lt;\/xsl:if&gt;\r\n            &lt;xsl:if test=\"$maximum=0\"&gt;&lt;xsl:value-of select=\"$TravelTime\"\/&gt;&lt;\/xsl:if&gt;\r\n          &lt;\/xsl:if&gt;\r\n        &lt;\/xsl:variable&gt;\r\n\t\t\r\n\t\t\r\n\t\t\r\n        &lt;tr&gt;\r\n          \r\n\t\t  &lt;xsl:attribute name=\"class\"&gt;\r\n            &lt;xsl:choose&gt;\r\n              &lt;xsl:when test=\".\/@Group='0' and $directionName!=''\"&gt;out&lt;\/xsl:when&gt;\r\n              &lt;xsl:when test=\"($maximum=.\/@Group and $directionName!='')\"&gt;in&lt;\/xsl:when&gt;\r\n              &lt;xsl:when test=\"$directionName=''\"&gt;&lt;\/xsl:when&gt;\r\n              &lt;xsl:otherwise &gt;middle&lt;\/xsl:otherwise &gt;\r\n            &lt;\/xsl:choose&gt;\r\n          &lt;\/xsl:attribute&gt;\r\n\t\t  \r\n          &lt;td &gt;\r\n            &lt;xsl:value-of select=\"$directionName\"\/&gt;\r\n          &lt;\/td&gt;\r\n          &lt;td&gt;\r\n            &lt;xsl:value-of select=\"substring(.\/@DepartureTime,1,10)\"\/&gt;\r\n          &lt;\/td&gt;\r\n          &lt;td&gt;\r\n            &lt;xsl:value-of select=\".\/@Carrier\"\/&gt;\r\n            &lt;xsl:value-of select=\".\/@FlightNumber\"\/&gt;\r\n          &lt;\/td&gt;\r\n          &lt;td class=\"time\"&gt;\r\n            &lt;xsl:value-of select=\"substring(.\/@DepartureTime,12,5)\"\/&gt;\r\n          &lt;\/td&gt;\r\n          &lt;td class=\"time\"&gt;\r\n            &lt;xsl:value-of select=\"substring(.\/@ArrivalTime,12,5)\"\/&gt;\r\n          &lt;\/td&gt;\r\n          &lt;td&gt;\r\n            &lt;xsl:value-of select=\".\/@Origin\"\/&gt;\r\n          &lt;\/td&gt;\r\n          &lt;td&gt;\r\n            &lt;xsl:value-of select=\".\/@Destination\"\/&gt;\r\n          &lt;\/td&gt;\r\n          &lt;td class=\"center\"&gt;\r\n            &lt;xsl:value-of select=\"$bookingClass\"\/&gt;&lt;xsl:value-of select=\"$bookingCount\"\/&gt;\r\n          &lt;\/td&gt;\r\n          &lt;td &gt;\r\n            &lt;xsl:choose &gt;\r\n              &lt;xsl:when test=\"$cabinClass\"&gt;\r\n                &lt;xsl:value-of select=\"$cabinClass\"\/&gt;\r\n              &lt;\/xsl:when&gt;\r\n              &lt;xsl:otherwise&gt;\r\n                &amp;#160;\r\n              &lt;\/xsl:otherwise&gt;\r\n            &lt;\/xsl:choose&gt;\r\n          &lt;\/td&gt;\r\n          &lt;td&gt;\r\n            &lt;xsl:value-of select=\"$providerCode\"\/&gt;\r\n            &lt;xsl:if test=\".\/@AvailabilitySource\"&gt;\r\n              -\r\n              &lt;xsl:value-of select=\".\/@AvailabilitySource\"\/&gt;\r\n            &lt;\/xsl:if&gt;\r\n          &lt;\/td&gt;\r\n          &lt;td&gt;\r\n            &lt;xsl:value-of select=\"$brandName\"\/&gt;\r\n\t\t\t&lt;!-- SegmentRef --&gt;\r\n\t\t\t\r\n\t\t\t&lt;xsl:variable name=\"FlightDetailsRef\" select=\".\/*[local-name()='FlightDetailsRef']\/@Key\"\/&gt;\r\n\t\t\t\r\n\t\t\t&lt;xsl:value-of select=\"$TravelTime02\"\/&gt;\r\n\t\t\t\r\n\t\t\t&lt;!--xsl:for-each select=\"\/\/*[local-name()='FlightDetails' and .\/@Key=$FlightDetailsRef]\"&gt;\r\n\t\t\t\r\n\t\t\t  traveltime: &lt;xsl:value-of select=\"@TravelTime\"&gt;&lt;\/xsl:value-of&gt; &lt;BR\/&gt;\r\n\t\t\t  \ucd9c\ubc1c\uc2dc\uac04 : &lt;xsl:value-of select=\"@DepartureTime\"&gt;&lt;\/xsl:value-of&gt; &lt;BR\/&gt;\r\n\t\t\t  \ub3c4\ucc29\uc2dc\uac04 : &lt;xsl:value-of select=\"@ArrivalTime\"&gt;&lt;\/xsl:value-of&gt; &lt;BR\/&gt;\r\n\t\t\t\r\n\t\t\t&lt;\/xsl:for-each--&gt;\r\n\t\t\t\r\n\t\t\t\r\n          &lt;\/td&gt;\r\n \r\n        &lt;\/tr&gt;\r\n      &lt;\/xsl:for-each&gt;\r\n    &lt;\/xsl:for-each&gt;\r\n  &lt;\/xsl:template&gt;\r\n \r\n  &lt;xsl:template match=\"\/\/*[local-name()='RailPricingSolution']\"&gt;\r\n    &lt;xsl:variable name=\"Amt\"&gt;\r\n      &lt;xsl:value-of select=\".\/@TotalPrice\"\/&gt;\r\n    &lt;\/xsl:variable&gt;\r\n    &lt;xsl:variable name=\"Supplier\"&gt;\r\n      &lt;xsl:value-of select=\".\/@SupplierCode\"\/&gt;\r\n    &lt;\/xsl:variable&gt;\r\n    &lt;tr&gt;\r\n      &lt;td&gt;\r\n        &lt;table class=\"main\"&gt;\r\n          &lt;caption&gt;\r\n            From &lt;xsl:value-of select=\"$Supplier\"\/&gt; - Total price:\r\n            &lt;xsl:value-of select=\"$Amt\"\/&gt;\r\n          &lt;\/caption&gt;\r\n          &lt;thead &gt;\r\n            &lt;tr&gt;\r\n              &lt;th&gt;Direction&lt;\/th&gt;\r\n              &lt;th&gt;Date&lt;\/th&gt;\r\n              &lt;th&gt;Train&lt;\/th&gt;\r\n              &lt;th&gt;Depart&lt;\/th&gt;\r\n              &lt;th&gt;Arrive&lt;\/th&gt;\r\n              &lt;th&gt;From&lt;\/th&gt;\r\n              &lt;th&gt;To&lt;\/th&gt;\r\n            &lt;\/tr&gt;\r\n          &lt;\/thead&gt;\r\n          &lt;tbody&gt;\r\n            &lt;xsl:apply-templates select=\"*[local-name()='RailJourneyRef']\" \/&gt;\r\n          &lt;\/tbody&gt;\r\n        &lt;\/table&gt;\r\n      &lt;\/td&gt;\r\n    &lt;\/tr&gt;\r\n  &lt;\/xsl:template&gt;\r\n \r\n  &lt;xsl:template match=\"*[local-name()='RailJourneyRef']\"&gt;\r\n    &lt;xsl:variable name=\"indexJourney\" select=\".\/@Key\"\/&gt;\r\n    &lt;xsl:for-each select=\"\/\/*[local-name()='RailJourney' and .\/@Key=$indexJourney]\"&gt;\r\n      &lt;xsl:variable name=\"direction\" select=\".\/@JourneyDirection\"\/&gt;\r\n      &lt;xsl:apply-templates select=\"*[local-name()='RailSegmentRef']\"&gt;\r\n        &lt;xsl:with-param name=\"direction\" select=\"$direction\"&gt;&lt;\/xsl:with-param&gt;\r\n      &lt;\/xsl:apply-templates&gt;\r\n    &lt;\/xsl:for-each&gt;\r\n \r\n  &lt;\/xsl:template&gt;\r\n \r\n  &lt;xsl:template match=\"*[local-name()='RailSegmentRef']\"&gt;\r\n    &lt;xsl:param name=\"direction\"\/&gt;\r\n \r\n    &lt;xsl:variable name=\"position\" select=\"position()\" \/&gt;\r\n    &lt;xsl:variable name=\"directionHeader\"&gt;\r\n      &lt;xsl:choose&gt;\r\n        &lt;xsl:when test=\"position()=1\"&gt;\r\n          &lt;xsl:value-of select=\"$direction\"\/&gt;\r\n        &lt;\/xsl:when&gt;\r\n        &lt;xsl:otherwise&gt;\r\n \r\n        &lt;\/xsl:otherwise&gt;\r\n      &lt;\/xsl:choose&gt;\r\n    &lt;\/xsl:variable&gt;\r\n \r\n    &lt;xsl:variable name=\"indexSegment\" select=\".\/@Key\"\/&gt;\r\n    &lt;xsl:for-each select=\"\/\/*[local-name()='RailSegment' and .\/@Key=$indexSegment]\"&gt;\r\n      &lt;tr&gt;\r\n        &lt;xsl:attribute name=\"class\"&gt;\r\n          &lt;xsl:choose&gt;\r\n            &lt;xsl:when test=\"$directionHeader='Outward'\"&gt;out&lt;\/xsl:when&gt;\r\n            &lt;xsl:when test=\"$directionHeader='Return'\"&gt;in&lt;\/xsl:when&gt;\r\n            &lt;xsl:otherwise &gt;&lt;\/xsl:otherwise &gt;\r\n          &lt;\/xsl:choose&gt;\r\n        &lt;\/xsl:attribute&gt;\r\n        &lt;td&gt;\r\n          &lt;xsl:value-of select=\"$directionHeader\"\/&gt;\r\n        &lt;\/td&gt;\r\n        &lt;td&gt;\r\n          &lt;xsl:value-of select=\"substring(.\/@DepartureTime,1,10)\"\/&gt;\r\n        &lt;\/td&gt;\r\n        &lt;td&gt;\r\n          &lt;xsl:value-of select=\".\/@TrainNumber\"\/&gt;\r\n        &lt;\/td&gt;\r\n        &lt;td class=\"time\"&gt;\r\n          &lt;xsl:value-of select=\"substring(.\/@DepartureTime,12,5)\"\/&gt;\r\n        &lt;\/td&gt;\r\n        &lt;td class=\"time\"&gt;\r\n          &lt;xsl:value-of select=\"substring(.\/@ArrivalTime,12,5)\"\/&gt;\r\n        &lt;\/td&gt;\r\n        &lt;td&gt;\r\n          &lt;xsl:value-of select=\".\/@OriginStationName\"\/&gt;\r\n        &lt;\/td&gt;\r\n        &lt;td&gt;\r\n          &lt;xsl:value-of select=\".\/@DestinationStationName\"\/&gt;\r\n        &lt;\/td&gt;\r\n      &lt;\/tr&gt;\r\n    &lt;\/xsl:for-each&gt;\r\n  &lt;\/xsl:template&gt;\r\n&lt;\/xsl:stylesheet&gt;<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>xslt &lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;UTF-8&#8243;?&gt; &lt;xsl:stylesheet version=&#8221;1.0&#8243; xmlns:xsl=&#8221;http:\/\/www.w3.org\/1999\/XSL\/Transform&#8221;&gt; &lt;xsl:param name=&#8221;fontSize&#8221;&gt;x-small&lt;\/xsl:param&gt; &lt;xsl:output method=&#8221;html&#8221; indent=&#8221;yes&#8221; omit-xml-declaration=&#8221;yes&#8221;\/&gt; &lt;xsl:variable name=&#8221;maximum&#8221;&gt; &lt;xsl:value-of select=&#8221;\/\/*[local-name()=&#8217;AirSegment&#8217; and not(preceding-sibling::node()\/@Group &gt; @Group or following-sibling::node()\/@Group &gt; @Group)]\/@Group&#8221; \/&gt; &lt;\/xsl:variable&gt; &lt;xsl:template match=&#8221;\/&#8221;&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt;Travelport Universal API Low Fare response&lt;\/title&gt; &lt;style type=&#8221;text\/css&#8221;&gt; BODY,table {font-size: &lt;xsl:value-of select=&#8221;$fontSize&#8221;&gt;&lt;\/xsl:value-of&gt;;} table.main {margin-bottom: 12px;border-bottom-style:solid;border-bottom-color:#0075b0; width=&#8221;100%&#8221;} table.main thead {background-color: #0075b0; color:white;} table.main caption {background-color:\u2026 <span class=\"read-more\"><a href=\"https:\/\/developer.worldspan.co.kr\/?p=191\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3],"tags":[],"_links":{"self":[{"href":"https:\/\/developer.worldspan.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/191"}],"collection":[{"href":"https:\/\/developer.worldspan.co.kr\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/developer.worldspan.co.kr\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/developer.worldspan.co.kr\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/developer.worldspan.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=191"}],"version-history":[{"count":5,"href":"https:\/\/developer.worldspan.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/191\/revisions"}],"predecessor-version":[{"id":483,"href":"https:\/\/developer.worldspan.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/191\/revisions\/483"}],"wp:attachment":[{"href":"https:\/\/developer.worldspan.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=191"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/developer.worldspan.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=191"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/developer.worldspan.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=191"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}