0

XML 応答を php 配列に変換しようとしています。さまざまな方法を試しましたが、すべて同じ結果になりました。つまり、一部の配列が空であってはならないということです。Array Fares (特に FareSellKey) のコンテンツが本当に必要です。xml2array 関数を試してみました。すべて同じ問題を抱えています。どうすればよいですか

ここに例があります。XML

        <schedules>
   <arrayofjourneydatemarket>
   <journeydatemarket>
   <departuredate>2012-06-11T00:00:00</departuredate>
   <departurestation>OTP</departurestation>
   <arrivalstation>BLQ</arrivalstation>
   <journeys>
   <journey>
   <state xmlns="http://schemas.navitaire.com/WebServices/DataContracts/Common">New</state>
   <notforgeneraluse>false</notforgeneraluse><segments><segment><state xmlns="http://schemas.navitaire.com/WebServices/DataContracts/Common">Clean</state>
  <actionstatuscode>HK</actionstatuscode><arrivalstation>BLQ</arrivalstation>
  <cabinofservice></cabinofservice>
  <changereasoncode><departurestation>OTP</departurestation><prioritycode>
  <segmenttype><sta>2012-06-11T14:20:00</sta><std>2012-06-11T13:10:00</std>
  <international>false</international><flightdesignator xmlns:a="http://schemas.navitaire.com/WebServices/DataContracts/Common"><carriercode>0B</carriercode><flightnumber> 117</flightnumber>
  <opsuffix></opsuffix>
  </flightdesignator><xrefflightdesignator xmlns:a="http://schemas.navitaire.com/WebServices/DataContracts/Common" nil="true">
  <fares>
  <legs>
  <leg>
  <state xmlns="http://schemas.navitaire.com/WebServices/DataContracts/Common">Clean</state>
  <arrivalstation>BLQ</arrivalstation>
  <departurestation>OTP</departurestation><sta>2012-06-11T14:20:00</sta>
  <std>2012-06-11T13:10:00</std><flightdesignator xmlns:a="http://schemas.navitaire.com/WebServices/DataContracts/Common">
  <carriercode>0B</carriercode>
  <flightnumber> 117</flightnumber><opsuffix></opsuffix></flightdesignator>
  <leginfo><state xmlns="http://schemas.navitaire.com/WebServices/DataContracts/Common">Clean</state>
 <adjustedcapacity>136</adjustedcapacity>
<equipmenttype>733</equipmenttype><equipmenttypesuffix>C</equipmenttypesuffix>
<arrivalterminal><arrvltv>120</arrvltv><capacity>136</capacity><codeshareindicator></codeshareindicator><departureterminal><deptltv>180</deptltv><eticket>true</eticket><flifoupdated>true</flifoupdated><irop>false</irop><status>Normal</status><lid>140</lid><ontime></ontime><paxsta>2012-06-11T14:20:00</paxsta><paxstd>2012-06-11T13:10:00</paxstd><prbccode>BAC-OTP</prbccode><scheduleservicetype>J</scheduleservicetype><sold>37</sold><outmovedays>0</outmovedays><backmovedays>0</backmovedays><legnests><legssrs><legssr><ssrnestcode>AVIH</ssrnestcode><ssrlid>3</ssrlid><ssrsold>0</ssrsold><ssrvaluesold>0</ssrvaluesold></legssr><legssr><ssrnestcode>BIKE</ssrnestcode><ssrlid>999</ssrlid><ssrsold>0</ssrsold><ssrvaluesold>0</ssrvaluesold></legssr><legssr><ssrnestcode>BLD</ssrnestcode><ssrlid>999</ssrlid><ssrsold>0</ssrsold><ssrvaluesold>0</ssrvaluesold></legssr><legssr><ssrnestcode>DEAF</ssrnestcode><ssrlid>999</ssrlid><ssrsold>0</ssrsold><ssrvaluesold>0</ssrvaluesold></legssr><legssr><ssrnestcode>INFT</ssrnestcode><ssrlid>13</ssrlid><ssrsold>0</ssrsold><ssrvaluesold>0</ssrvaluesold></legssr><legssr><ssrnestcode>PETC</ssrnestcode><ssrlid>4</ssrlid><ssrsold>0</ssrsold><ssrvaluesold>0</ssrvaluesold></legssr><legssr><ssrnestcode>PREG</ssrnestcode><ssrlid>999</ssrlid><ssrsold>0</ssrsold><ssrvaluesold>0</ssrvaluesold></legssr><legssr><ssrnestcode>SPF</ssrnestcode><ssrlid>999</ssrlid><ssrsold>0</ssrsold><ssrvaluesold>0</ssrvaluesold></legssr><legssr><ssrnestcode>UM</ssrnestcode><ssrlid>100</ssrlid><ssrsold>0</ssrsold><ssrvaluesold>0</ssrvaluesold></legssr><legssr><ssrnestcode>WCHC</ssrnestcode><ssrlid>999</ssrlid><ssrsold>0</ssrsold><ssrvaluesold>0</ssrvaluesold></legssr><legssr><ssrnestcode>WCHR</ssrnestcode><ssrlid>999</ssrlid><ssrsold>0</ssrsold><ssrvaluesold>0</ssrvaluesold></legssr><legssr><ssrnestcode>WEAP</ssrnestcode><ssrlid>999</ssrlid><ssrsold>0</ssrsold><ssrvaluesold>0</ssrvaluesold></legssr></legssrs><operatingflightnumber></operatingflightnumber><operatedbytext><operatingcarrier><operatingopsuffix></operatingopsuffix><subjecttogovtapproval>false</subjecttogovtapproval><marketingcode><changeofdirection>false</changeofdirection><marketingoverride>false</marketingoverride></marketingcode></operatingcarrier></operatedbytext></legnests></departureterminal></arrivalterminal></leginfo><operationsinfo nil="true"></operationsinfo></leg></legs><paxbags><paxseats><paxssrs><paxsegments><paxtickets><salesdate>9999-12-31T00:00:00Z</salesdate><segmentsellkey>0B~ 117~ ~~OTP~06/11/2012 13:10~BLQ~06/11/2012 14:20</segmentsellkey></paxtickets></paxsegments></paxssrs></paxseats></paxbags></fares></xrefflightdesignator></segmenttype></prioritycode></changereasoncode></segment></segments><journeysellkey>0B~ 117~ ~~OTP~06/11/2012 13:10~BLQ~06/11/2012 14:20</journeysellkey></journey></journeys></journeydatemarket></arrayofjourneydatemarket></schedules>  

The resulting array

     Array ( [ArrayOfJourneyDateMarket] => Array ( [JourneyDateMarket] => Array ( [0] => Array ( [DepartureDate] => 2012-06-11T00:00:00 [DepartureStation] => OTP [ArrivalStation] => BLQ [Journeys] => Array ( [Journey] => Array ( [State] => New [NotForGeneralUse] => false [Segments] => Array ( [Segment] => Array ( [State] => Clean [ActionStatusCode] => HK [ArrivalStation] => BLQ [CabinOfService] => Array ( ) [ChangeReasonCode] => Array ( ) [DepartureStation] => OTP [PriorityCode] => Array ( ) [SegmentType] => Array ( ) [STA] => 2012-06-11T14:20:00 [STD] => 2012-06-11T13:10:00 [International] => false [FlightDesignator] => Array ( [CarrierCode] => 0B [FlightNumber] => 117 [OpSuffix] => Array ( ) ) [XrefFlightDesignator] => Array ( [nil] => true ) [Fares] => Array ( ) [Legs] => Array ( [Leg] => Array ( [State] => Clean [ArrivalStation] => BLQ [DepartureStation] => OTP [STA] => 2012-06-11T14:20:00 [STD] => 2012-06-11T13:10:00 [FlightDesignator] => Array ( [CarrierCode] => 0B [FlightNumber] => 117 [OpSuffix] => Array ( ) ) [LegInfo] => Array ( [State] => Clean [AdjustedCapacity] => 136 [EquipmentType] => 733 [EquipmentTypeSuffix] => C [ArrivalTerminal] => Array ( ) [ArrvLTV] => 120 [Capacity] => 136 [CodeShareIndicator] => Array ( ) [DepartureTerminal] => Array ( ) [DeptLTV] => 180 [ETicket] => true [FlifoUpdated] => true [IROP] => false [Status] => Normal [Lid] => 140 [OnTime] => Array ( ) [PaxSTA] => 2012-06-11T14:20:00 [PaxSTD] => 2012-06-11T13:10:00 [PRBCCode] => BAC-OTP [ScheduleServiceType] => J [Sold] => 37 [OutMoveDays] => 0 [BackMoveDays] => 0 [LegNests] => Array ( ) [LegSSRs] => Array ( [LegSSR] => Array ( [0] => Array ( [SSRNestCode] => AVIH [SSRLid] => 3 [SSRSold] => 0 [SSRValueSold] => 0 ) [1] => Array ( [SSRNestCode] => BIKE [SSRLid] => 999 [SSRSold] => 0 [SSRValueSold] => 0 ) [2] => Array ( [SSRNestCode] => BLD [SSRLid] => 999 [SSRSold] => 0 [SSRValueSold] => 0 ) [3] => Array ( [SSRNestCode] => DEAF [SSRLid] => 999 [SSRSold] => 0 [SSRValueSold] => 0 ) [4] => Array ( [SSRNestCode] => INFT [SSRLid] => 13 [SSRSold] => 0 [SSRValueSold] => 0 ) [5] => Array ( [SSRNestCode] => PETC [SSRLid] => 4 [SSRSold] => 0 [SSRValueSold] => 0 ) [6] => Array ( [SSRNestCode] => PREG [SSRLid] => 999 [SSRSold] => 0 [SSRValueSold] => 0 ) [7] => Array ( [SSRNestCode] => SPF [SSRLid] => 999 [SSRSold] => 0 [SSRValueSold] => 0 ) [8] => Array ( [SSRNestCode] => UM [SSRLid] => 100 [SSRSold] => 0 [SSRValueSold] => 0 ) [9] => Array ( [SSRNestCode] => WCHC [SSRLid] => 999 [SSRSold] => 0 [SSRValueSold] => 0 ) [10] => Array ( [SSRNestCode] => WCHR [SSRLid] => 999 [SSRSold] => 0 [SSRValueSold] => 0 ) [11] => Array ( [SSRNestCode] => WEAP [SSRLid] => 999 [SSRSold] => 0 [SSRValueSold] => 0 ) ) ) [OperatingFlightNumber] => Array ( ) [OperatedByText] => Array ( ) [OperatingCarrier] => Array ( ) [OperatingOpSuffix] => Array ( ) [SubjectToGovtApproval] => false [MarketingCode] => Array ( ) [ChangeOfDirection] => false [MarketingOverride] => false ) [OperationsInfo] => Array ( [nil] => true ) ) ) [PaxBags] => Array ( ) [PaxSeats] => Array ( ) [PaxSSRs] => Array ( ) [PaxSegments] => Array ( ) [PaxTickets] => Array ( ) [SalesDate] => 9999-12-31T00:00:00Z [SegmentSellKey] => 0B~ 117~ ~~OTP~06/11/2012 13:10~BLQ~06/11/2012 14:20 ) ) [JourneySellKey] => 0B~ 117~ ~~OTP~06/11/2012 13:10~BLQ~06/11/2012 14:20 ) ) ) [1] => Array ( [DepartureDate] => 2012-06-13T00:00:00 [DepartureStation] => OTP [ArrivalStation] => BLQ [Journeys] => Array ( [Journey] => Array ( [State] => New [NotForGeneralUse] => false [Segments] => Array ( [Segment] => Array ( [State] => Clean [ActionStatusCode] => HK [ArrivalStation] => BLQ [CabinOfService] => Array ( ) [ChangeReasonCode] => Array ( ) [DepartureStation] => OTP [PriorityCode] => Array ( ) [SegmentType] => Array ( ) [STA] => 2012-06-13T14:20:00 [STD] => 2012-06-13T13:10:00 [International] => false [FlightDesignator] => Array ( [CarrierCode] => 0B [FlightNumber] => 117 [OpSuffix] => Array ( ) ) [XrefFlightDesignator] => Array ( [nil] => true ) [Fares] => Array ( ) [Legs] => Array ( [Leg] => Array ( [State] => Clean [ArrivalStation] => BLQ [DepartureStation] => OTP [STA] => 2012-06-13T14:20:00 [STD] => 2012-06-13T13:10:00 [FlightDesignator] => Array ( [CarrierCode] => 0B [FlightNumber] => 117 [OpSuffix] => Array ( ) ) [LegInfo] => Array ( [State] => Clean [AdjustedCapacity] => 136 [EquipmentType] => 733 [EquipmentTypeSuffix] => C [ArrivalTerminal] => Array ( ) [ArrvLTV] => 120 [Capacity] => 136 [CodeShareIndicator] => Array ( ) [DepartureTerminal] => Array ( ) [DeptLTV] => 180 [ETicket] => true [FlifoUpdated] => true [IROP] => false [Status] => Normal [Lid] => 140 [OnTime] => Array ( ) [PaxSTA] => 2012-06-13T14:20:00 [PaxSTD] => 2012-06-13T13:10:00 [PRBCCode] => BAC-OTP [ScheduleServiceType] => J [Sold] => 28 [OutMoveDays] => 0 [BackMoveDays] => 0 [LegNests] => Array ( ) [LegSSRs] => Array ( [LegSSR] => Array ( [0] => Array ( [SSRNestCode] => AVIH [SSRLid] => 3 [SSRSold] => 0 [SSRValueSold] => 0 ) [1] => Array ( [SSRNestCode] => BIKE [SSRLid] => 999 [SSRSold] => 0 [SSRValueSold] => 0 ) [2] => Array ( [SSRNestCode] => BLD [SSRLid] => 999 [SSRSold] => 0 [SSRValueSold] => 0 ) [3] => Array ( [SSRNestCode] => DEAF [SSRLid] => 999 [SSRSold] => 0 [SSRValueSold] => 0 ) [4] => Array ( [SSRNestCode] => INFT [SSRLid] => 13 [SSRSold] => 0 [SSRValueSold] => 0 ) [5] => Array ( [SSRNestCode] => PETC [SSRLid] => 4 [SSRSold] => 0 [SSRValueSold] => 0 ) [6] => Array ( [SSRNestCode] => PREG [SSRLid] => 999 [SSRSold] => 0 [SSRValueSold] => 0 ) [7] => Array ( [SSRNestCode] => SPF [SSRLid] => 999 [SSRSold] => 0 [SSRValueSold] => 0 ) [8] => Array ( [SSRNestCode] => UM [SSRLid] => 100 [SSRSold] => 0 [SSRValueSold] => 0 ) [9] => Array ( [SSRNestCode] => WCHC [SSRLid] => 999 [SSRSold] => 0 [SSRValueSold] => 0 ) [10] => Array ( [SSRNestCode] => WCHR [SSRLid] => 999 [SSRSold] => 0 [SSRValueSold] => 0 ) [11] => Array ( [SSRNestCode] => WEAP [SSRLid] => 999 [SSRSold] => 0 [SSRValueSold] => 0 ) ) ) [OperatingFlightNumber] => Array ( ) [OperatedByText] => Array ( ) [OperatingCarrier] => Array ( ) [OperatingOpSuffix] => Array ( ) [SubjectToGovtApproval] => false [MarketingCode] => Array ( ) [ChangeOfDirection] => false [MarketingOverride] => false ) [OperationsInfo] => Array ( [nil] => true ) ) ) [PaxBags] => Array ( ) [PaxSeats] => Array ( ) [PaxSSRs] => Array ( ) [PaxSegments] => Array ( ) [PaxTickets] => Array ( ) [SalesDate] => 9999-12-31T00:00:00Z [SegmentSellKey] => 0B~ 117~ ~~OTP~06/13/2012 13:10~BLQ~06/13/2012 14:20 ) ) [JourneySellKey] => 0B~ 117~ ~~OTP~06/13/2012 13:10~BLQ~06/13/2012 14:20 ) ) ) [2] => Array ( [DepartureDate] => 2012-06-15T00:00:00 [DepartureStation] => OTP [ArrivalStation] => BLQ [Journeys] => Array ( [Journey] => Array ( [State] => New [NotForGeneralUse] => false [Segments] => Array ( [Segment] => Array ( [State] => Clean [ActionStatusCode] => HK [ArrivalStation] => BLQ [CabinOfService] => Array ( ) [ChangeReasonCode] => Array ( ) [DepartureStation] => OTP [PriorityCode] => Array ( ) [SegmentType] => Array ( ) [STA] => 2012-06-15T14:20:00 [STD] => 2012-06-15T13:10:00 [International] => false [FlightDesignator] => Array ( [CarrierCode] => 0B [FlightNumber] => 117 [OpSuffix] => Array ( ) ) [XrefFlightDesignator] => Array ( [nil] => true ) [Fares] => Array ( ) [Legs] => Array ( [Leg] => Array ( [State] => Clean [ArrivalStation] => BLQ [DepartureStation] => OTP [STA] => 2012-06-15T14:20:00 [STD] => 2012-06-15T13:10:00 [FlightDesignator] => Array ( [CarrierCode] => 0B [FlightNumber] => 117 [OpSuffix] => Array ( ) ) [LegInfo] => Array ( [State] => Clean [AdjustedCapacity] => 136 [EquipmentType] => 733 [EquipmentTypeSuffix] => C [ArrivalTerminal] => Array ( ) [ArrvLTV] => 120 [Capacity] => 136 [CodeShareIndicator] => Array ( ) [DepartureTerminal] => Array ( ) [DeptLTV] => 180 [ETicket] => true [FlifoUpdated] => false [IROP] => false [Status] => Normal [Lid] => 140 [OnTime] => Array ( ) [PaxSTA] => 2012-06-15T14:20:00 [PaxSTD] => 2012-06-15T13:10:00 [PRBCCode] => BAC-OTP [ScheduleServiceType] => J [Sold] => 38 [OutMoveDays] => 0 [BackMoveDays] => 0 [LegNests] => Array ( ) [LegSSRs] => Array ( [LegSSR] => Array ( [0] => Array ( [SSRNestCode] => AVIH [SSRLid] => 3 [SSRSold] => 0 [SSRValueSold] => 0 ) [1] => Array ( [SSRNestCode] => BIKE [SSRLid] => 999 [SSRSold] => 0 [SSRValueSold] => 0 ) [2] => Array ( [SSRNestCode] => BLD [SSRLid] => 999 [SSRSold] => 0 [SSRValueSold] => 0 ) [3] => Array ( [SSRNestCode] => DEAF [SSRLid] => 999 [SSRSold] => 0 [SSRValueSold] => 0 ) [4] => Array ( [SSRNestCode] => INFT [SSRLid] => 13 [SSRSold] => 0 [SSRValueSold] => 0 ) [5] => Array ( [SSRNestCode] => PETC [SSRLid] => 4 [SSRSold] => 0 [SSRValueSold] => 0 ) [6] => Array ( [SSRNestCode] => PREG [SSRLid] => 999 [SSRSold] => 0 [SSRValueSold] => 0 ) [7] => Array ( [SSRNestCode] => SPF [SSRLid] => 999 [SSRSold] => 0 [SSRValueSold] => 0 ) [8] => Array ( [SSRNestCode] => UM [SSRLid] => 100 [SSRSold] => 1 [SSRValueSold] => 1 ) [9] => Array ( [SSRNestCode] => WCHC [SSRLid] => 999 [SSRSold] => 0 [SSRValueSold] => 0 ) [10] => Array ( [SSRNestCode] => WCHR [SSRLid] => 999 [SSRSold] => 0 [SSRValueSold] => 0 ) [11] => Array ( [SSRNestCode] => WEAP [SSRLid] => 999 [SSRSold] => 0 [SSRValueSold] => 0 ) ) ) [OperatingFlightNumber] => Array ( ) [OperatedByText] => Array ( ) [OperatingCarrier] => Array ( ) [OperatingOpSuffix] => Array ( ) [SubjectToGovtApproval] => false [MarketingCode] => Array ( ) [ChangeOfDirection] => false [MarketingOverride] => false ) [OperationsInfo] => Array ( [nil] => true ) ) ) [PaxBags] => Array ( ) [PaxSeats] => Array ( ) [PaxSSRs] => Array ( ) [PaxSegments] => Array ( ) [PaxTickets] => Array ( ) [SalesDate] => 9999-12-31T00:00:00Z [SegmentSellKey] => 0B~ 117~ ~~OTP~06/15/2012 13:10~BLQ~06/15/2012 14:20 ) ) [JourneySellKey] => 0B~ 117~ ~~OTP~06/15/2012 13:10~BLQ~06/15/2012 14:20 ) ) ) ) ) ) 
4

0 に答える 0