Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.