Version: 4.2.1 +
In this exercise we will display an array that is created by a formula, using XSLT.
- The Futurama Editor must be installed.
- Futurama Runtime must be installed.
- Completing the tutorial Using XSLT to display data first, is recommended.
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.
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 |
Take the following steps to do so:
- Start the Futurama Editor and open the file Leap Year.
- Create a WebPage object. You can name the WebPage likewise. (This Webpage should be the StartWebPage of your Document)
- 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'.
- To create the XML, add an Action object to the WebPage. In the TargetControl property, refer to the XmlConverter.
- Within the Action object, create an XmlBuilder. Within this XmlBuilder, the XML for the XSLT-file should be created.
- 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'.
- 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'.
- Save your file and open your website in a browser.
- 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.
You can download our solution for this assignment by clicking the image at the right. (Futurama 126.96.36.199)
Please note that you can very well have a different solution that is just as good as ours.
- (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.