Search

 

Module: Editor

Version: 4.2.1 +

User: Developer

Difficulty: Difficult

Introduction

In this exercise we will display an array that is created by a formula, using XSLT.

 

Prerequisites

- The Futurama Editor must be installed.
- Futurama Runtime must be installed.
- Completing the tutorial Using XSLT to display data first, is recommended. 

 

 

Description 

This is a sequel of the Exercise Leap Year (Creating formulas with Futurama). You can download the basis for this exercise (the end-result of the Leap Year exercise, and the external files needed) by clicking here.

In this exercise we will display an overview of the leap years between 1950 and 2000. We will create a table with all the years, and indicate whether they are leap years or not.

Assignment

Create a 2-column table on your WebPage, where the left column represents the years from 1950 to 2000, and the right column indicates whether the year is a leap year or not.

As example we show a part of the table:

Leap Year  False/True 
1970  False
1971  False
1972  True
1973  False
1974  False
 
Take the following steps to do so:
  1. Start the Futurama Editor and open the file Leap Year.
  2. Create a WebPage object. You can name the WebPage likewise. (This Webpage should be the StartWebPage of your Document)
  3. Within the WebPage, create an XmlConverter. In the XSLTFileName property, refer to the XSLT-file 'Results.xml'. Open the XSLT-file to verify that the XSLT-file needs the XML elements 'Year' and 'Leap_Year'.
  4. To create the XML, add an Action object to the WebPage. In the TargetControl property, refer to the XmlConverter.
  5. Within the Action object, create an XmlBuilder. Within this XmlBuilder, the XML for the XSLT-file should be created.
  6. Somewhere in your document, create a range with the years from 1950 to 2000. Refer to this range within the XmlBuilder and name the reference 'Years'. 
  7. Create another reference within the XmlBuilder, and now refer to the formula that indicaties whether a year is a leap year or not. For the argument you should select the range created. Name this reference 'Leap Year'.
  8. Save your file and open your website in a browser.

Tips

  • You do not need a CSS file for this exercise.
  • Do not forgot to refer to your WebPage in the StartWebPage property of your Document.
  • Keep your file clean, and delete the leap year formulas you did not use.

Solutions

Download

image

You can download our solution for this assignment by clicking the image at the right. (Futurama 4.2.1.2)
Please note that you can very well have a different solution that is just as good as ours.

Variations

  • (Easy:) Exchange the columns. Display the years in the right column, and the True/False boolean in the left.
  • (Difficult:) Display a list of all the years from 1950 to 2000 that are leap years.

Updated: 2013-04-17