The purpose of this assignment is to:
(a) learn to use XSL
transformations to generate HTML from an XML document
(b) practice using basic
elements of XSL transformations
0. Read Chapter 4 of your textbook on "XSLT". You may also want
to refer to the textbook’s Appendices B (XPath
Reference) and C (XSLT Reference), as well as other books and websites on XSLT
and XPath.
1. Pick some title or office and period of time, and create an XML
document that lists all of the people who held the office or title during the
period of time, including the terms for which they held the office or title and
some items of personal information. For example, you might choose Mayors of San
Francisco from 1880 to 1950, world chess champions during the twentieth
century, or reigning British monarchs since 1700. The document should meet the
following criteria:
a. At least ten and no more than one hundred persons
should be listed in chronological order. (If a person held the title or office
more than once, they should be listed once for each time holding the office or
title.)
b. There should be at least two and no more than ten
items of personal information on each person, and at least one of those items
should be available for all of the persons listed. For example, you might
include the dates of birth and death, nationality, and occupation of the world
chess champions, but only have the years of birth and nationalities available
for some of the champions.
c. In addition to the lists of people and information
about them, the document should include a list of sources for the information
provided, with URLs for those sources on the Internet and bibliographic
information for print sources. You do not need to document each item of information
individually, just list the major sources for your information as a whole.
2. Create an XSL transformation that turns your XML document into a web
page displaying the information that the document contains.
a. The page should have a title and identical main
heading that identify the office or title and period of time that the persons
listed collectively hold.
b. The persons listed should appear in an HTML
definition list in alphabetical order by name. The individual items should use
the person's name and the period he or she held the title or office as the
term, and the other informational items in some visually consistent format of
your choice as the definition.
c. The sources of information should be listed at the
end of the web page, after the list of persons, with links to Internet sources.
3. Use an XSLT engine to create an HTML file “[filename].html” that is the result of applying the XSLT transformation to the XML document.
4. Include an "<?xml-stylesheet type="text/xsl" href="[filename].xsl"?>" declaration in the prolog of your XML document so that XSL aware
browsers will use the transformation to display the document.
5. Create a web page consisting of two frames. The left frame (with
between 10% and 20% of the width of the browser window, choose the width that
you think looks best) should be a list of three links, one to your XML document
(which should be displayed as HTML using the XSLT transformation), one to your
XSLT stylesheet (which should be displayed as XML),
and one to the HTML file you generated in part 3 of this assignment. Each of
these views should be displayed in the right frame when the link in the left
frame is followed.
6. Use an ftp client to upload your web pages to the subdirectory cs94 of the home directory of your account
on Chabot's csweb server.
a. Modify the file index.html to add a link to the location where the main page for this assignment
will go, then upload it to your cs94 directory on csweb.
b. Upload the web page created in part 5, the XML
document, the XSL transformation and the HTML result for this assignment. It is
up to you to decide whether to put them in the main cs94 directory or to create a subdirectory
for this assignment.
7. When your web page is up on the server, to complete the assignment
send me an e-mail message with the URL of your main web page for this
assignment and information about how you created the HTML file.
*****This must be done to receive credit for
this lab.*****
a. Send the message to dkadlece@ed.clpccd.cc.ca.us with a Cc: to yourself.
b. The Subject of your message should be: "CS 94-071: HW#3"
c. The message should include the URL of the main page
for the assignment (the one with the two frames).
d. The message should include a description of how you created
the HTML file in part 3 of the assignment, including the XML parser/XSLT engine
that was used to do the transformation (including the version number) and how
you used what other software to call the XSLT engine.