Accessing XML-based APIs with XSLT

Assignment 5 — XML Foundations Fall 2010

Assigned: Thursday, October 14th, 2010
Due: Friday, October 22nd, 2010

Introduction:

Adding information from XML-based API can be easily done with XSLT, and it is equally easy to include links to external resources in the results of an XSLT transformation. In this assignment you have to do both.

Instructions:

As discussed in class, in this assignment you are asked to explore XSLT's document() function and to use it for accessing XML that helps to to produce more elaborate HTML from your XML. You can use your Flickr photostream's feed (remember to use the geofeed if you need location information to be in the feed), the Flickr API (you need the REST Response Format, and you need an API key for the Flickr API), or additional APIs such as Yahoo's API for WOEID. Most importantly, you will have to live with the XML you get through such an API. Make sure that you look for namespaces when using this XML or the XPaths will not work; some APIs use namespaced elements, others use XML without namespaces.

Feel free to search for an explore APIs that carry data that is interesting for you. The requirements for this assignment are the following, which should give you enough freedom to explore many different possibilities:

  • Your XSLT must access at least one external API that makes information available in XML. This API must be used for getting additional information that you use to improve the content of the generated HTML.
  • Your HTML must contain <img> elements for each entry with at least one image being embedded for each entry. You can use a URI given in the XML (less robust, more work), or you can use the Flickr ID to get the path to an image through Flickr's flickr.photos.getSizes API.
  • Identify at least one additional external API that you would be interested in to enhance your HTML result, and describe briefly what kind of API you would ideally like to use. If you would have the ability to tell others what they should develop as a service and as an API to it, what would you tell them?

Please send the XML, the XSLT, and the HTML result to dret@berkeley.edu. Please send plain text email with all files as attachments. HTML emails will not be accepted.


Creative Commons License Please send comments to dret@berkeley.edu
Last modification: Tuesday, 21-Dec-2010 03:22:21 CET
valid CSS! valid XHTML 1.0!