Department of Computing

Local Navigation

COMP249 Web Technology

Practical - Week 10

In this week's practical session it is recommended that you work first through the XSLT tutorial that is available at W3.schools.com.

The Python Package Index provides an RSS feed of the latest packages that have been submitted: http://pypi.python.org/pypi?:action=rss It's nice because it only contains simple text descriptions of each package and a link - not too complicated. Download a copy of this feed and use it as the basis for some experimentation with XML and stylesheets. You may want to save it with a .xml extension to make sure your browser knows what kind of file it is.

  1. Write a CSS stylesheet to display the file nicely in your browser. Note that modern browsers already understand RSS and will show a nice page offering to allow you to subscribe to the feed. You want to write a CSS stylesheet that defines your own look to the page.
  2. Note that with CSS you can't make the titles link to the packages since CSS can't create links. So, we need to write an XSLT stylesheet that will turn the items in the RSS feed into appropriate XHTML with links to the packages. I've written rss.xsl as a starting point, link it to your XML file and view it in XRay and/or your browser. Then extend it to include the item description in the output HTML.
  3. The output HTML from the XSLT stylesheet references rsshtml.css which is a CSS stylesheet to define the layout of the HTML generated by the XSLT stylesheet (confused?). This file will contain rules for the HTML generated by the XSLT: ul, li, h1 etc. Write some rules for this stylesheet and see how it changes the appearance of the page when you view the XML file in your browser.

Portfolio

If you want to learn more about XSLT you could try a more complex XSLT example in your portfolio. You could try extending the example above by adding some javascript to the final page.

Comments to: comp249-admin@ics.mq.edu.au

Copyright & Site information