CSCI.4220 Network Programming
Lab 2 - XML and DTDs

A plant nursery has a number of on-line suppliers. Periodically, these suppliers post an XML file describing their stock. This file consists of a number of batches. Each batch contains a single species, with the following information about each one.

Name (required)
number available (optional)
price (required)
Volume discount (optional) The volume discount has two required fields
Order size which triggers the discount
Percentage

For example, the ABC Grower could have the following stock

You should do the following:

  1. Write an xml file which conforms to this spec and contains the information for the ABC Grower.

  2. Confirm that your xml file is well formed by invoking it with a browser.

  3. Write a dtd which the nursery could send to all of its suppliers which conforms to this information. This dtd file should be in a separate file.

  4. Confirm that your xml file is valid by going to the W3School XML Validation page http://www.w3schools.com/xml/xml_validator.asp and entering the URL of your file in the box. Note that this only works if your browser is Microsoft Internet Explorer.