Scenario

Rent-a-Car is a small family owned company that rents out cars, mainly to holiday makers. As Australia is a such a vast country it is often necessary to fly to holiday destinations, but families and holiday groups still often wish to have a vehicle available during their holiday. It is this market "Family Rent-a-Car is aiming their business at.

You have been hired by Rent-a-Car to produce an XML based trial solution for their customer record and rental record system. The system is to be used by Rent-a-Car's staff only. The first stage of this system involves the creation of data storage and the construction of Rental booking display for past, current and future bookings. For this you have been given some old samples of how the data was stored in excel files. These excel files allowed inconsistent entry of the data, and it was sometimes hard to quickly find particular pieces of data. All customers are assigned a customer number. A customer can book car to rent for some date in the future. The charge per day is dependent on how long the car is being rented, and what type of car it is. Sometimes the company has special deals on, however management of special campaign and pricing is not part of this trial.

The project will require one xml file for customer records (customers.xml), one xml file containing vehicle information (vehicles.xml) and one xml file that hold the rental information for each rental booking made (rentalRecords.xml). The contents of each of these files will be discussed later in this document. Each of the xml files will be linked to a W3C XML Schema file (customers.xsd, vehicles.xsd and rentalRecrods.xsd) that will describe the allowable structure and content for the XML files. The content and business rules for these schema files will be discussed in more detail later in this document. For this first stage of the project you will be required to create a rentals page that will display past, current and future rentals. This will be done by linking the rentalRecords.xml to an xslt file (rentals.xsl). The structure for displaying the rentals will be discussed in more detail later in this document

Coding standard:

You are expected to write code that is easy to read and for the viewer to quickly get an understanding of what has been done. This includes:

  • using descriptive variable, element and attribute names
  • indenting code appropriately so it is easy to see the nesting structure used
  • documenting your code with comments where appropriate
  • when creating links, only relative paths must be used.

Deliverables:

customers.xml

This file must be linked to customers.xsd (described later).

The customers.xml file will contain customer records. Each customer record contains:

  • customer number
  • name: for a particular customer title and middle name is optional (so may or may not need to be stored), however first name and last name are required.
  • address - all components are required (street, suburb, postcode, state)
  • telephone - a customer must have at least one phone number, but may have up to three phone numbers
  • drivers licence
  • customer email address (not present in the sample data)
  • Nominated drivers (there can be several - if there are none nominated, the customer is assumed to be the driver). For each nominated driver, the following must be collected (note: logically this would make more sense to store in the rental record as it might change each time the customer rents a car, however having it here gives you a chance to demonstrate some of the concepts we discussed in lectures when creating the schema):
    • Licence number
    • name: title and middle name is optional (so may or may not need to be stored), however first name and last name are required.
    • address - all components are required (street, suburb, postcode, state)
    • Phone number (just one - a mobile number, is required)

No other information is to be stored in this file.

vehicles.xml

This file must be linked to vehicles.xsd (described later).

The vehicles.xml file will contain details of the rental vehicles the company owns. Each vehicle record must contain:

  • Rego number
  • Make
  • Model
  • Year of manufacture
  • Current odometer reading
  • Description

No other information is to be stored in this file.

rentalRecords.xml

This file must be linked to rentalRecords.xsd (described later) and rentals.xsl (described later).

The rentalRecords.xml file will contain car rental bookings that have been made, as well as past car rental records. Each record contains:

  • rental record number
  • customer number (would match to one of the existing customers already in the customer file)
  • rego number (would match one of the rego numbers in the vehicles file)
  • date the booking was made
  • date the booking is for (when the car will be or was picked up)
  • Number of days the rental is for.
  • Charge per day (this would vary depending on length of time the car is hired for, any special campaigns that are running, etc so is entered at the time of booking).
  • Fuel tank full on return (yes, or no, (or true/false) or nothing if the rental has not yet started or not yet returned). If no, which would only happen if the car was returned with less than a full tank, the amount that was charged for refilling will need to be stored.

No other information is to be stored in this file.

You must demonstrate the use of attributes in all three (3) xml files.

NOTE: the sample data for customers, vehicles, and rental records (provided in a separate document) must be present in the XML files for marking purposes. No other data should be stored in the xml files, except for customer email address which needs to be added.

Dates: you can decide on the format of the dates. Either use the built-in date data type, or create your own custom data type. The date format does not need to be in the same format as the sample data.

3 W3C Schema files:

The Schema files will specify the allowable structure, allowable values, restrictions and so on for the xml files. Each .xml file must have a link to the appropriate .xsd file for proper validation. Use this as an opportunity to demonstrate your skills in using the various schema concepts discussed in lecture and in the textbook. In addition, make sure all business rules (listed later in this document) are implemented. There will be additional rules that you are expected to implement in your schemas. These will be evident from the data that is to be stored. For example, post code should be 4 digits only, states/territories are from a limited pre-defined list, and so on. Some of these will depend on the design of your xml files. It is expected that you critically review the content that your xml files should contain, the structure you have created in your xml, and implement suitable constraints within your schema files. You are required to demonstrate that you can create and use user defined data types, as well as using ref.

Your schemas should not be the 'Russian doll' style.

1 XSLT file: (rentals.xsl)

This will generate rental records as described in the "Rentals" section below, producing and displaying a record for each rental present in the rentalRecords.xml file. The rentals.xsl must get the correct customer information from the customers.xml file and the correct vehicle information from the vehicles.xml for each rental record listed. You will need to use the document() function to access data from customers.xml and vehicles.xml, and you will need to use the customer number and rego for each record in the rentalRecords.xml file to locate the correct customer and vehicle details in the respective xml files.

All data displayed must be generated from the content in the XML files, making calculations where necessary. You are expected to demonstrate understanding and skills in XPath and XSLT, including the use of templates and apply-templates instructions.

1 HTML page: (default.htm)

The default page will be the entry point to the system and will provide a menu of available functions as described in the "Expected Functionality and Implementation" section below.

Expected Functionality and Implementation:

The user will be presented with a web based user interface (default.htm) displaying the available menu items for the Rent-a-Car application:

  • View Rental Records (active link, must link to rentalRecords.xml)
  • Manage Customers (disabled, will be implemented in the server side assignment)
  • Manage Vehicles (disabled, will be implemented in the server side assignment)
  • Create new rental (disabled, will be implemented in the server side assignment)

Default page:

The design of the default page is left open to your decision; however, the design must be appropriate for the users and the application's intended use and must have a professional look and feel.

View Rental Records:

If a user selects "View Rental Records" from the menu, they should be presented with the result of the transformation created by linking rentalRecords.xml to rentals.xsl; this should create a display of first all current and future rentals, and second all past rentals.

The records should be displayed in order of when the rental car was/is being picked up. Each record should show the rental record number, customer details (customer number, name, address, email and phone number(s). The details and cost of the booking must be displayed, including the date the booking was made, when the booking is for (date of pick up), how many days the booking is for, the charge per day, total charge, and in the case of when a fuel charge is made, this must be noted and added to the total. The car rego, make and model and year must also be displayed.

How you design the layout of the display of this information is open to your decision, however the design must be appropriate for the users and the application's intended use, and must have a professional look and feel.

There must be a navigation link back to the default.htm page.

You may use a CSS framework, such a Bootstrap, to help with designing, but you may not use a template or theme of any kind. This means all code must be your own work, and that you have only applied a CSS framework to help with the look of 'your' design.

Business Rules your solution must implement:

  • A customer account number consist of two letters followed by 6 digits.
  • Drivers licence consist of 4 digits and 2 upper case letters.
  • A customer must supply first and last name. Title and middle name is optional.
  • A customer may only supply one phone number, but can supply up to 3 phone numbers.
  • A customer may not have any other nominated drivers, but could have many listed.
  • A number plate is up to 6 characters, including numbers and uppercase letters.
  • Odometer reading is a positive number with no decimal places.
  • In addition to implementing the business rules listed above as appropriate in the xml, xsl and xsd files, you are expected to put in place appropriate restrictions in the Schema files for the allowable content of the xml files.

Sample Data

Customers:

Customer Number Name Address Drivers licence Phone Nominated Driver Name drivers licence Address Phone
BL343456 Bart Simpson 45 Olive dr. Sydney 2000, NSW 1234AB 0298576433
0413335678
0296784455
Marge Simpson 6789U 45 Olive dr. Sydney 2000, NSW 0453876590
Homer Simpson 7890KL 45 Olive dr. Sydney 2000, NSW 0453876577
TR567903 Donald Duck 12 Grey place Sometown 9876, NSW 3456CD 0432226677
VL305888 Ms Minni Mouse 368 King st, Bankstown, NSW 2200 4567EF 0445566543
0688763344
Bugs Bunny 4444AB 36 Northon street, Cooma 2630 NSW 0483339999
AG123456 Mr Michael Theodore Mouse 56 Rock road, Marrickville, NSW 2204 5678GH 0411234444

Vehicles:

Rego Make Model Year Description Current Odometer reading (km)
ABC123 Toyota Tarago Gli 2018 Auto, 8 seat people mover 32716
XYZ987 Toyota Corolla Ascent 2014 Manual, Hatch back 97500
BBB33 Holden Commodore 2019 Auto, Hatch 11593
DWR654 Ford Escape 2017 Auto, SUV 56000

Rentals:

Rental record # Customer number Rego number Date of booking made Pick-up date # days charge per day Fuel tank full on return? Fuel charge
4698 BL343456 DWR654 10/10/20 9/12/20 6 85.00 no 45
4732 TR567903 ABC123 24/11/20 1/1/21 4 80.00 yes
4825 VL305888 XYZ987 10/5/21 15/5/21 8 48.00 yes
4920 AG123456 XYZ987 20/8/21 21/9/21 30 37.00
4973 BL343456 BBB333 23/8/21 12/12/21 10 60.00

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.