The purpose of this laboratory session is to help you learn about
XSLT. To do so, you will be given a source of
information in the form of an XML file, and will be asked to use XSLT
stylesheets to transform certain parts of the information into HTML.
This can be done either by using a standalone XSLT processor, such
by including an appropriate stylesheet processing instruction in
the XML file and viewing it using a browser.
The source file contains bibliographic information about papers
presented at the ACM Principles of Database Systems (PODS) conference
in 1998. Use a browser to view the XML file
pods98.xml. Take particular note
of the names and structure of the elements in the file, since you will
need to know these in order to express the following retrieval
requests as XSLT programs. Save a copy of the file
(by right-clicking on the link above) in the directory (folder) in which
you plan to work.
Below you will be asked to write four stylesheet programs. It is easiest
if you write each in a separate file (with the extension (type)
all in the directory you chose above.
xt, open a Windows Command Prompt
window and change to the directory you chose above. To use
type the following in the command prompt window:
n:\xmltools\xt pods98.xml your-xslt-file.xsl output-file.html
your-xslt-file.xsl is the name of the file you have created
containing the particular XSLT
stylesheet you want to be applied to the file
The output of the transformation will be written to
You can view this file using a browser, or a text editor if you want to see
the HTML source produced by the transformation.
Saxon instead, type
n:\SaxonHE\saxon pods98.xml your-xslt-file.xsl output-file.html
You may get a warning about using a version 1 stylesheet with a version 2 processor.
You should use a standard text editor, such as
to create the contents of your stylesheet file. A starting
skeleton for the file (just the root
element) is in
(right-click to save the file as is).
To use a stylesheet processing instruction in the XML file instead
<?xml-stylesheet href="your-xslt-file.xsl" type="text/xsl" ?>
between the XML declaration and the
proceedings root element in your
pods98.xml. Once again,
the name of the file you have created containing the stylesheet you want to apply.
Now write a stylesheet for each of the following. Use one of the methods described above to check that each transforms the XML file as expected:
nameelement which is a child of the
proceedingselement in the XML document. The output should be in HTML with the value of the
nameelement being the contents of an