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 CourseWeb Assignments, so you will know how to name this and most other homework files you submit on Courseweb.
This assignment should give you experience with:
First, read this recipe for homemade bread, and pretend you are filing it with hundreds of other recipes that you need to fit a set purpose, such as running a restaurant, in which you 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.
Sidenote: If you are looking for some ideas for your code, you might take a look at Fork the Cookbook, a GitHub-based recipe center that has worked out a system for contributors to store volumes and measures, and tracking instructions. (We will be learning how to work with GitHub in this class, too.)
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 Courseweb, in the folder labelled “Upload
Assignments Here”, before our next class.