Assignment 3 for CSCI 431
Working with XML
Background Information:
- Name the file created for this assignment pizza.xml
and put it in your ftp directory for this class.
- Sources of information on XML:
- You will need to download or copy this DTD to the directory where you
will write your XML page.
Assignment
- I've given you a DTD (see above) that describes the
information that your XML page will contain. This is a DTD
that would be appropriate for a hypothetical on-line pizza
shop. You must write an XML page that conforms to this
DTD. The page must contain the description of at least 2
pizzas, one pizza containing the minimum number of elements
and their attributes and the other containing two or more
instances of all elements if allowed. You can, of course,
include more than 2 pizzas.
- To link your XML to the DTD, you will need the start of your
XML file to contain the lines:
<?xml version="1.0" ?>
<!DOCTYPE pizzas SYSTEM "pizza.dtd">
- Here is a small selection of pizza images.
- Check the syntax of your XML using the xmlint utility
from Microsoft. It's just a DOS command-line utility, which
you can download yourself from the Microsoft site (above) or
copy as a zipped file from this link. Xmlint checks for
valid XML against the DTD, as well as
well-formed XML (which IE5 does also). In order to get
full credit for this assignment your XML document must be
valid. This part of the assignment is not concerned
with the display of your document.
Extra Credit: (10 additional pts)
- Write a XSL (or CSS) file to generate the display of your XML
document. Try looking at this link
to get started with XSL, or use the Shurtleff & Stair
presentation (Examples, Slides)
for CSS.
Helpful hints
- You should start with very small XML and XSL examples, then
build larger pages as you gain confidence with the structures.
- Remember that XML and XSL are case sensitive, unlike HTML.
- All XML/XSL tags require a matching close tag or closing "/" --
even single tags like <BR/>.
- No overlapping tags are allowed -- this includes the HTML that is contained
in your style sheet.
- The XML/XSL namespace is tree-structured, and always referenced to the current
context (for example, in for-each and value-of tags). The path name separator
is "/" -- attribute names are preceeded by "@".