fork(1) download
  1. def xmlString = """<soapenv:Envelope xmlns:soapenv="http://s...content-available-to-author-only...p.org/soap/envelope/">
  2. <soapenv:Body>
  3. <list:getCategoryListResponse xmlns:alpha="http://w...content-available-to-author-only...l.org/OTA/2003/05/alpha" xmlns:list="http://x...content-available-to-author-only...x.com/Interfaces/CategoryList">
  4. <alpha:OTA_CruiseCategoryAvailRS MaxResponses="72" MoreDataEchoToken="0" MoreIndicator="false" SequenceNmbr="0" Version="1.0">
  5. <alpha:Success/>
  6. <alpha:Warnings>
  7. <alpha:Warning Type="3"/>
  8. </alpha:Warnings>
  9. <alpha:SailingInfo>
  10. <alpha:SelectedSailing ListOfSailingDescriptionCode="6" Duration="P7N">
  11. <alpha:CruiseLine/>
  12. <alpha:Region RegionCode="PBC"/>
  13. </alpha:SelectedSailing>
  14. <alpha:InclusivePackageOption CruisePackageCode="ZEPB0742"/>
  15. </alpha:SailingInfo>
  16. <alpha:FareOption>
  17. <alpha:CategoryOptions>
  18. <alpha:CategoryOption CategoryLocation="Deluxe" PricedCategoryCode="PT">
  19. <alpha:PriceInfos>
  20. <alpha:PriceInfo Amount="1909.00" BreakdownType="0201C" NCCFAmount="0.00" NonRefundableType="1" PromotionDescription="STD 2" FareCode="C6111184"/>
  21. <alpha:PriceInfo Amount="0" BreakdownType="0201A" FareCode="C6111184"/>
  22. <alpha:PriceInfo BreakdownType="01 C" FareCode="C6111184"/>
  23. <alpha:PriceInfo BreakdownType="01 " FareCode="C6111184"/>
  24. <alpha:PriceInfo Amount="1909.00" BreakdownType="0202C" NCCFAmount="0.00" NonRefundableType="1" PromotionDescription="STD 2" FareCode="C6111184"/>
  25. <alpha:PriceInfo Amount="0" BreakdownType="0202A" FareCode="C6111184"/>
  26. <alpha:PriceInfo BreakdownType="02 C" FareCode="C6111184"/>
  27. <alpha:PriceInfo BreakdownType="02 " FareCode="C6111184"/>
  28. </alpha:PriceInfos>
  29. </alpha:CategoryOption>
  30. <alpha:CategoryOption CategoryLocation="Deluxe" PricedCategoryCode="LS">
  31. <alpha:PriceInfos>
  32. <alpha:PriceInfo Amount="1709.00" BreakdownType="0201C" NCCFAmount="0.00" NonRefundableType="1" PromotionDescription="STD 2" FareCode="C6111184"/>
  33. <alpha:PriceInfo Amount="0" BreakdownType="0201A" FareCode="C6111184"/>
  34. <alpha:PriceInfo BreakdownType="01 A" FareCode="C6111184"/>
  35. <alpha:PriceInfo BreakdownType="01 " FareCode="C6111184"/>
  36. <alpha:PriceInfo Amount="1709.00" BreakdownType="0202C" NCCFAmount="0.00" NonRefundableType="1" PromotionDescription="STD 2" FareCode="C6111184"/>
  37. <alpha:PriceInfo Amount="0" BreakdownType="0202A" FareCode="C6111184"/>
  38. <alpha:PriceInfo BreakdownType="02 A" FareCode="C6111184"/>
  39. <alpha:PriceInfo BreakdownType="02 " FareCode="C6111184"/>
  40. </alpha:PriceInfos>
  41. </alpha:CategoryOption>
  42. <alpha:CategoryOption CategoryLocation="Deluxe" PricedCategoryCode="JT">
  43. <alpha:PriceInfos>
  44. <alpha:PriceInfo Amount="1509.00" BreakdownType="0201C" NCCFAmount="0.00" NonRefundableType="1" PromotionDescription="STD 2" FareCode="C6111184"/>
  45. <alpha:PriceInfo Amount="0" BreakdownType="0201A" FareCode="C6111184"/>
  46. <alpha:PriceInfo BreakdownType="01 A" FareCode="C6111184"/>
  47. <alpha:PriceInfo BreakdownType="01 " FareCode="C6111184"/>
  48. <alpha:PriceInfo Amount="1509.00" BreakdownType="0202C" NCCFAmount="0.00" NonRefundableType="1" PromotionDescription="STD 2" FareCode="C6111184"/>
  49. <alpha:PriceInfo Amount="0" BreakdownType="0202A" FareCode="C6111184"/>
  50. <alpha:PriceInfo BreakdownType="02 A" FareCode="C6111184"/>
  51. <alpha:PriceInfo BreakdownType="02 " FareCode="C6111184"/>
  52. </alpha:PriceInfos>
  53. </alpha:CategoryOption>
  54. <alpha:CategoryOption CategoryLocation="Deluxe" PricedCategoryCode="JS">
  55. <alpha:PriceInfos>
  56. <alpha:PriceInfo Amount="1309.00" BreakdownType="0201C" NCCFAmount="0.00" NonRefundableType="1" PromotionDescription="STD 2" FareCode="C6111184"/>
  57. <alpha:PriceInfo Amount="0" BreakdownType="0201A" FareCode="C6111184"/>
  58. <alpha:PriceInfo BreakdownType="01 A" FareCode="C6111184"/>
  59. <alpha:PriceInfo BreakdownType="01 " FareCode="C6111184"/>
  60. <alpha:PriceInfo Amount="1309.00" BreakdownType="0202C" NCCFAmount="0.00" NonRefundableType="1" PromotionDescription="STD 2" FareCode="C6111184"/>
  61. <alpha:PriceInfo Amount="0" BreakdownType="0202A" FareCode="C6111184"/>
  62. <alpha:PriceInfo BreakdownType="02 A" FareCode="C6111184"/>
  63. <alpha:PriceInfo BreakdownType="02 " FareCode="C6111184"/>
  64. </alpha:PriceInfos>
  65. </alpha:CategoryOption>
  66. </alpha:CategoryOptions>
  67. </alpha:FareOption>
  68. <alpha:Taxes>
  69. <alpha:Tax Amount="200.00"/>
  70. <alpha:Tax Amount="200.00"/>
  71. <alpha:Tax Amount="200.00"/>
  72. <alpha:Tax Amount="200.00"/>
  73. </alpha:Taxes>
  74. <alpha:Fee TaxInclusive="false">
  75. <alpha:Taxes>
  76. <alpha:Tax Amount="0.00"/>
  77. <alpha:Tax Amount="0.00"/>
  78. <alpha:Tax Amount="0.00"/>
  79. <alpha:Tax Amount="0.00"/>
  80. </alpha:Taxes>
  81. </alpha:Fee>
  82. </alpha:OTA_CruiseCategoryAvailRS>
  83. </list:getCategoryListResponse>
  84. </soapenv:Body>
  85. </soapenv:Envelope>"""
  86. def categoryCode = new XmlSlurper().parseText(xmlString).'**'.find{
  87. it.PriceInfos.PriceInfo.find {
  88. it.'@BreakdownType'.text() == "02 A"
  89. }
  90. }.@PricedCategoryCode?.text()
  91. println categoryCode instanceof String
  92. println categoryCode
Success #stdin #stdout 1.16s 90168KB
stdin
Standard input is empty
stdout
true
LS