Jump to content

XML/XSLT GROUPING Problem


AMERLOC

Recommended Posts

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?

 

Link to comment
https://forums.phpfreaks.com/topic/173200-xmlxslt-grouping-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.