CSC 513 Project 3: XML Document Transformation using XQuery

Announcements

Introduction

The goal of this project is use XQuery to transform/query XML file.

Description

This project is based on reconfiguring the course schedule page http://courses.ncsu.edu/csc513/lec/001/s11-sched.html This page lists the lectures and deliverable (homework, project, or assignment) due dates in the same row. However, the deliverables are due on noon the previous day so that students' work on the homeworks, projects or assignments does not interfere with the class. Several students would prefer that the deliverables are listed on a separate line with its own date.

For example, Change from:


Input snippet

to:

Output snippet

The change put an extra row for deliverable due date as indicated in the red box. It involves change of table elements from:

<tr>
<td>9</td>
<td>2/7</td>
<td>M</td>
<td>Specification languages</td>
<td>Business process case study</td>
<td> <a href="X/x1.html">X1</a> (DataPower introduction) </td>
</tr>

To:

<tr>
<td>--</td>
<td>2/6</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td> <a href="X/x1.html">X1</a> (DataPower introduction) </td>
</tr>
<tr>
<td>9</td>
<td>2/7</td>
<td>M</td>
<td>Specification languages</td>
<td>Business process case study</td>
<td>--</td>
</tr>

Requirements

  1. The input is well-formed XML; the output should be well-formed XML. The output XML should effect the change as described above.
  2. You can manually delete the parts in the input up to and including the <html> element and replace them a simple <html> element without any namespace declaration or attribute; there is no need to insert the parts you remove back into the output.
  3. The main schedule should continue to have the same structure as in the input with a centered heading and a single table sorted by date.
  4. Sometimes an deliverable cell may have two or more deliverables, in which case they are separated by a <br/>
  5. You should copy over any comments unchanged.
  6. You should not generate a separate row unless there is a deliverable in it.
  7. Empty table cells are indicated by a few variants such as
    <td></td>
    <td> </td>
    <td>--</td>
    <td> -- </td>
  8. You should not output any elements or attributes not already used in the input.

Deliverable

Links maybe useful