AMERLOC Posted September 5, 2009 Share Posted September 5, 2009 Hi Again, I am having a problem Grouping Elements with XSLT. the XML is LIKE THIS <AirAvailabilityResults size="10"> <SegmentList> <Segment key="US1486"> <airlineCode>US</airlineCode> <airline>US AIRWAYS</airline> <flightNumber>1486</flightNumber> <originCityCode>LAX</originCityCode> <destinationCityCode>CLT</destinationCityCode> </Segment> <Segment key="AA747"> <airlineCode>AA</airlineCode> <airline>American Airlines</airline> <flightNumber>747</flightNumber> <originCityCode>LAX</originCityCode> <destinationCityCode>CLT</destinationCityCode> </Segment> </SegmentList> <AirAvailabilityReply> <supplierType>W</supplierType> <RateInfo> <nativeBaseFare>763.00</nativeBaseFare> </RateInfo> <FlightSegment> <segmentOutgoing>true</segmentOutgoing> <segmentKey>US1498</segmentKey> <fareClass>W</fareClass> </FlightSegment> <tripType>R</tripType> <ticketType>E</ticketType> </AirAvailabilityReply> <AirAvailabilityReply> <supplierType>W</supplierType> <RateInfo> <nativeBaseFare>966.00</nativeBaseFare> </RateInfo> <FlightSegment> <segmentOutgoing>true</segmentOutgoing> <segmentKey>AA747</segmentKey> <fareClass>W</fareClass> </FlightSegment> <tripType>R</tripType> <ticketType>E</ticketType> </AirAvailabilityReply> </AirAvailabilityResults> The problem is creating a relation between the <AirAvailabilityReply> Element & the <SegmentList> . The AirAvailabilityReply Contains the rates & outgoing/incoming details & the Segment list contains all the Flight details. This is a Response I get back from the booking Server. I am Using PHP5.X and PEAR->Serializer/unSerializer to send and receive this data. But since it doesn't include Attributes in the Parent Elements other than the Root and the <SEGEMENT> I am finding it impossible to group these things. Any Help? Quote Link to comment https://forums.phpfreaks.com/topic/173200-xmlxslt-grouping-problem/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.