Homework Assignment 1 (XML Document Processing) You must prepare your homework as plain text files, and send them to evirt@iis.sinica.edu.tw by 14:20 pm, October 8, 2008, Taipei Time. Your e-mail has a title XML Homework 1, student ID: num, where num is your student number. Your e-mail has four plain text attachments: ticketing.dtd, fare.xml, timetable.xml, and homework.html. No late homework will be accepted. 1. (50 points) Study the following two pages from the Taiwan High Speed Rail (THSR) web site: Ticket fair tables (Standard Class and Business Class): http://www.thsrc.com.tw/en/ticketing/fare.asp. Train timetables (Northbound and Southbound): http://www.thsrc.com.tw/en/ticketing/timetable.asp. Design an XML document type definition (DTD) (put it in file ticketing.dtd), so that it will allow you to markup ticket fair tables and train timetables. Note that you need only concern yourself about the structure of, and the information in, the tables. You shall not care about their presentations or how they are to be used with other XML documents. You may assume there are only 8 stations: Taipei, Banciao, Taoyuan, Hsinchu, Taichung, Chiayi, Tainan, and Zuoying. Note that the southbound trains run from Taipei to Zuoying (in that order), and northbound trains run from Zuoying to Taipei. Note also that the ticket fair table is symmetric. Explain the design rationale of your DTD as comments in file ticketing.dtd. Markup the current THSR fair table as fare.xml, and the current THSR train timetable as timetable.xml. Validate your XML documents using xmllint with your DTD in ticketing.dtd. 2. (50 points) Write a valid XHTML document that produces this homework assignment. This XHTML document will has the following document template: Homework Assignment 1 (XML Document Processing)

Homework Assignment 1 (XML Document Processing)

... You must fill in the ... part using only the following elements:

, , ,

    ,
  1. , , ,
      , and
      .
      
            You may use CDATA section:
      
            
      
            Put your XHTML document in file homework.html, and validate it at the following site: http://validator.w3.org/.