Converting Single XML into multiple XML Documents

Subject: Converting Single XML into multiple XML Documents
From: "sanjeev ramachandra" <sanjeev_scifi@xxxxxxxxxxx>
Date: Tue, 28 Mar 2000 10:24:47 CST
Hi,

I have a xml structure which has to be seperated into 2 or more xml documents.

The original xml structure looks like this,


<FlightAvailability> <RequestedSegment> <OriginTravelServiceLocation> <Code stringValue="Austin"/> </OriginTravelServiceLocation> <DestinationTravelServiceLocation> <Code stringValue="Florida"/> </DestinationTravelServiceLocation> </RequestedSegment> <RequestedSegment> <OriginTravelServiceLocation> <Code stringValue="Florida"/> </OriginTravelServiceLocation> <DestinationTravelServiceLocation> <Code stringValue="Austin"/> </DestinationTravelServiceLocation> </RequestedSegment> <SpecialRequests> <Meals stringValue="Veg"/> <Seat Preference stringValue="window"/> </TripConstraints> </FlightAvailability>

Now, the above request(xml) contains two requests

1. one from Austin to Florida
2. second from Florida to Austin
3. The third child <SpecialRequests> actually, applies to both the trips.

I want the output to be like this,

first, xml structure for Austin to Florida trip including special requests, like this...

<FlightAvailability>
	<RequestedSegment>
		<OriginTravelServiceLocation>
			<Code stringValue="Austin"/>
		</OriginTravelServiceLocation>
		<DestinationTravelServiceLocation>
			<Code stringValue="Florida"/>
		</DestinationTravelServiceLocation>
	</RequestedSegment>
	<SpecialRequests>
		<Meals stringValue="VEG"/>
		<Seat Preference stringValue="window"/>
	</TripConstraints>
</FlightAvailability>

second, xml structure for Florida to Austin trip including special requests, like this...

<FlightAvailability>
	<RequestedSegment>
		<OriginTravelServiceLocation>
			<Code stringValue="Florida"/>
		</OriginTravelServiceLocation>
		<DestinationTravelServiceLocation>
			<Code stringValue="Austin"/>
		</DestinationTravelServiceLocation>
	</RequestedSegment>
	<SpecialRequests>
		<Meals stringValue="VEG"/>
		<Seat Preference stringValue="window"/>
	</TripConstraints>
</FlightAvailability>

How do I do this, any help will be really appreciated.

Thanks

Sanjeev


______________________________________________________ Get Your Private, Free Email at http://www.hotmail.com


XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list



Current Thread