XSL Grouping etc...

A place to discuss the implementation and style of computer programs.

Moderators: phlip, Moderators General, Prelates

User avatar
whitewater4562000
Posts: 66
Joined: Sat Aug 23, 2008 4:22 pm UTC
Location: Scotland
Contact:

XSL Grouping etc...

Postby whitewater4562000 » Mon Sep 07, 2015 2:21 pm UTC

I have an XML document created by loading data from a MySQL database (see below).
I am using this along with an XSL file and FOP to create a PDF invoice.

Basically all was going well until I was trying to organise the itinerary. I have 4 different itineraries merging into one (hopefully).
1 for flights, 1 for accommodation, 1 for cruises and a miscellaneous. I would like to group all itineraries by their appropriate dates and
display each entry thereafter.

i.e
25OCT Flight info
Acc Info
26OCT Cruise Info
27OCT Flight Info

I though applying templates might be the way but no joy (yet).
What is the best way to go about this?

Not sure if FOP supports 2.0 I assume so.

XML File

Code: Select all

<?xml version="1.0" encoding="UTF-8" standalone="true"?>

-<invoiceSummary>
<atolDisclaimer>true</atolDisclaimer>
+<billingInfo>
+<bookingInfo>
+<costingInformation>
+<costingInformation>

<flightDisclaimer>true</flightDisclaimer>


-<itineraryInfo>


-<flightInfo>

<flightDate>13-OCT-2015</flightDate>

<airportFrom>Glasgow International </airportFrom>

<airportTo>Philadelphia, PA - International </airportTo>

<departTime>00:10:20</departTime>

<arriveTime>00:13:00</arriveTime>

</flightInfo>


-<flightInfo>

<flightDate>13-OCT-2015</flightDate>

<airportFrom>Philadelphia, PA - International </airportFrom>

<airportTo>Tampa, FL </airportTo>

<departTime>00:15:50</departTime>

<arriveTime>00:18:30</arriveTime>

</flightInfo>


-<flightInfo>

<flightDate>22-OCT-2015</flightDate>

<airportFrom>Tampa, FL </airportFrom>

<airportTo>Philadelphia, PA - International </airportTo>

<departTime>00:14:10</departTime>

<arriveTime>00:16:42</arriveTime>

</flightInfo>


-<flightInfo>

<flightDate>22-OCT-2015</flightDate>

<airportFrom>Philadelphia, PA - International </airportFrom>

<airportTo>Glasgow International </airportTo>

<departTime>00:18:55</departTime>

<arriveTime>00:18:30</arriveTime>

</flightInfo>

-<accommodationInfo>

<accommodationDate>13-OCT-15</accommodationDate>

<accommodationName>Hotel Los Jameos</accommodationName>

<numOfDays>10</numOfDays>

</accommodationInfo>

</itineraryInfo>


-<passengerInfo>
</passengerInfo>

</invoiceSummary>


Any advise greatly received and hope it makes sense.

User avatar
whitewater4562000
Posts: 66
Joined: Sat Aug 23, 2008 4:22 pm UTC
Location: Scotland
Contact:

Re: XSL Grouping etc...

Postby whitewater4562000 » Mon Sep 07, 2015 4:36 pm UTC

Having pondered a little would it be easier to add a date id to the itinerary tag and then have the various items under there.

i.e.

Code: Select all

 <itinerary date="22OCT">
   <flightInfo></flightInfo>
   <accInfo></accInfo>
   ......
 </itinerary>
 <itinerary date="23OCT">
  ......
 </itinerary>


This to me would make the layout easier to handle but might be wrong.


Return to “Coding”

Who is online

Users browsing this forum: No registered users and 5 guests