Before beginning this assignment, you should prepare your workspace: Where do you want to do your coding homework this semester? You will be doing most of your coding work for this course in the <oXygen/> XML Editor. This is installed in the campus computer labs, and you may also install it on any other computer(s) you plan to work with this semester. Also, before beginning homework assignments, you need to read the related tutorials we have posted (plus notes you took in class) and keep these open and handy to consult as you are working. For the very first assignment, here is what you will need:
Introduction to XML
File Conventions for Canvas Assignments, so you will know how to name this and most other homework files you submit on Canvas.
This assignment should give you experience with:
First, read this recipe for Shrewsbury cakes from the History Cookbook, and pretend you are filing it with hundreds of other recipes that you need to fit a set purpose, such as running an authentic historical tavern at a place like Colonial Williamsburg. You will need to keep track of kinds and quantities of ingredients required. XML is written to store information, and when we apply it to a situation with numbers and units, like with coding recipes, the code we write can help make computerized calculations, and help optimize searching across a collection for particular kinds of ingredients. Your code might be designed to help categorize ingredients by what part of the grocery store they can be found in. The challenge of the assignment is to write code that helps categorize ingredients, mark necessary equipment, and stages for processing, but the system you develop is up to you.
XML
in the filter window, and click the Create
button to launch a new XML document.angry red, you will know there is an error, perhaps tangled tags or a missing angle bracket, or a missing root element. Notice how <oXygen/> generates a closing tag every time you type your own start tag. One handy trick is to you use your mouse to highlight text you want to wrap in an element, and use Control+E in Windows (or Command+E on a Mac) to bring up a window to enter an element name. (You have to add the attributes after you set an element name.)
Frequently the XML code we write is designed for digital curation, for
preserving and collecting resources. Usually we would not rewrite the base
text of a recipe like this, but we would apply markup around passages, so
that our markup supplies some information in a more systematic way. For example,
spaces and formatting on the page tell our human eyes something about the document,
like how to distinguish each item on a list. That formatting information is
not preserved in XML, and so one of the first things we mark
are the structural pieces
. What are the important parts of this recipe that
you need to distinguish from other parts? Use XML markup to tag
those. Then,
what is the important information that you can label with markup? Try not to write
markup that copies the same words and phrases in the text: think of categories and
standard units you can supply so that your markup adds new value to the
text.
There is no single way to do this exercise, but we want you to think about how you nest levels of information (elements within elements), and the relationship between elements and attributes in XML.
Check and make sure you saved your file following our
homework file naming rules, including giving it a .xml
file
extension. Submit your XML file on Canvas on Assignments (for XML Exercise 1) before our next class.