The homework is due 9:30 am, April 17, 2007, Taipei Time. Please prepare and hand in the homework in the specific way that is requested below. Your homework will be rejected immediately if it is not prepared accordingly. No late homework will be accepted.
QAML is a "Question and Answer Markup Language," for FAQs.
Please consult website
http://xml.ascc.net/en/utf-8/qaml-index.html for detailed information,
especially about its DTD (
qaml-faq.xml is a QAML document about QAML itself;
is an XSLT program that converts a QAML document to an XHTML document.
Study the two documents, as well as the QAML DTD, to get an understanding
of QAML and the sample QAML-to-XHTML transformation. (Note: I have modified both
faq-xt.xsl for the purpose of this exercise.
Do NOT use the original versions at the QAML website, use my modifications.)
qaml-faq.xml uses stylesheet
the generated XHTML file uses stylesheet
Ignore the two stylesheets for now.
xml10points.xml is a QAML re-markup of
(most of) the data in webpage
http://www.w3.org/XML/1999/XML-in-10-points. Study these two documents as well.
Your task is to write an XSLT program
It accepts any valid QAML document and generates only valid XHTML document (precisely, XHTML-1.0-Strict);
The generated XHTML documents must, in their structure and information content,
be as close as to those exemplified by the two files
(which are transformed from
Please note that your program will be quite different from
In particular, the XHTML documents produced by your program are structured differently
from those by
faq-xt.xsl, your program adds back links (to the table of contents),
and your program implements auto-numbering if the
autonum attributes (for
section elements) are set to
The generated XHTML documents also use a new stylesheet
which you need to create by yourself.
Your program must be able to process every QAML element types. But to simplify your task, your program need only to take care of these attributes: archive (href), div (class), body (xml_lang, autonum), faq (date), link (href), logo (class, alt, href), p (class), qna (id) section (id, autonum), span (class, title). Note that the class attribute of element span can have these values: tt, em, i, b, strong, definition, keyword, literal, abbr, acronym, sup. You can assume the input QAML documents contain at most two-level section elements (i.e., section inside section, but no deeper). Remember to validate the generated XHTML documents at http://validator.w3.org.
Write a stylesheet
qaml2html.css for the generated XHTML documents.
The stylesheet shall present your XHTML documents as similar as possible to
these screenshots and printouts:
Write a new stylesheet
my-qaml.css for QAML documents,
and new stylesheet
my-qaml2html.css for the generated XHTML documents.
You are free in your design of these two stylesheets. The stylesheets must be
interesting in their own ways, and give out pleasant presentations of QAML
and generated XHTML documents.
You must hand in your homework in the following ways (both):
Send to email@example.com a zipped archive of the following files (exact file names):
xml10points.xml, except they now reference to your own stylesheet
xml10points.html, except they now reference to your own stylesheet
Print out the above 9 files. Staple them together in the exact order mentioned above. The last 4 files must be the printouts from a Firefox browser (version 1.0 or above).