RU beehive logo ITEC dept promo banner
ITEC 325
2014spring
ibarland

homelectshws
D2Lbreeze (snow day)

hw08-reviews
XSLT and DTDs
a videogame encyclopedia

Due: 2014.May.02 (Fri) 23:59; accepted up to May.0908 (Thu) 17:0022:00

We will work with an XML-encoded database of information about videogames, reviews.xml. (And, here is a sample/starter reviews.xsl.)

  1. (5pts) Add one more game to the file.
  2. (20pts) Create an XSLT template which generates a page with a summary of each game, looking similar to reviews-goal.html (you are encouraged to view-source).

  3. (5pts) Have your list sorted by release-year, in reverse order (most recent first).
    (To test that this is working, have the game which you entered be in a different spot than it appears the output.)

    (2pts extra-credit: If you want, you can use nested xsl:sort tags to sort by year-month-day1. Re-arrange the games in the source-file in such an order as to confirm that this sorting works.)

  4. (15pts) Generate a DTD for the grammar (You can have the DTD either in-line in your xml file, or as an external file.) Validate the file, using the validator such as the one at http://www.xmlvalidation.com/.

    If you include the DTD in-line, enclose all your <!ELEMENT> and <!ATTLIST> information inside a single, enclosing <!DOCTYPE games [ ]>: .

    <?xml  ?>
    <!DOCTYPE games [
      <!ELEMENT wonders (wonder*)>
      <!ELEMENT wonder >
      <!ATTLIST name
        lang >
      ⋮
    ]>
    

  5. (5pts) Define entities2 &ps3;, &wiiU;, &xbox1;, etc.

Please have your page (a) at https://php.radford.edu/~yourUserId/itec325/hw08/hw08.xml, with your other file(s) named hw08.xsl and (if in a separate file) hw08.dtd; and (b) those same files submitted on D2L.

Tips:


1This is actually following a standard CS trick: If you first sort by month and then by year, you'll get what you want as long as the sorting algorithm is “stable” — that is, it leaves tied elements in the same relative order they started in. It makes sense: after the first sort on months, all the Januaries come before all the Februaries. When you now sort by year, and two games are tied for year, the January one will stay ahead of the February one, in a stable sort.      

2Okay okay, if you get technical, the “&” and “;” aren't part of the entity. Still, you know what I mean. The ampersand and semicolon are part of how you denote an entity-literal. Similarly, in programming languages, quotes aren't part of the string but just how you denote what the string-literal is.      

homelectshws
D2Lbreeze (snow day)


©2014, Ian Barland, Radford University
Last modified 2014.May.08 (Thu)
Please mail any suggestions
(incl. typos, broken links)
to ibarlandradford.edu
Powered by PLT Scheme