This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Converting Single XML into multiple XML Documents


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]