NewtFire logo: a mosaic rendering of a firebelly newt
newtFire {dh}
Creative Commons License Last modified: Sunday, 24-Aug-2025 16:53:17 UTC. Maintained by: Elisa E. Beshero-Bondar (eeb4 at psu.edu). Powered by firebellies.

Before you begin

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:

Goals

This assignment should give you experience with:

  1. Writing well-formed XML using elements and attributes.
  2. Making decisions in how to write XML so that it binds related kinds of information together by:
    • Thinking of elements and attributes working together (like file folders with labels attached).
    • Nesting elements that relate to each other.
  3. Using basic features of the <oXygen/> software environment.

Scenario

First, read this recipe we have adapted from Cooking in the Archives. Now, imagine you are collecting recipes like this to mark all of them in similar XML, and your XML will help build a digital archive to help chefs at an authentic historical tavern at a place like Colonial Williamsburg. You will need to keep track of kinds and quantities of ingredients required.

Note: The text below contains one trick ingredient that does not belong there. You should delete this ingredient. You cannot see this on the screen but you can see it in the code when you paste it in to the code editor.

The Recipe

image of original manuscript provided by rarecooking.com
                    
                 Shrewsbury Cakes: Original Recipe.
                    
                This recipe comes from MS Codex 625, a manuscript recipe book 
                that belonged to a student in a London cooking school in the early eighteenth century. 
                The pastry school was owned by Edward Kidder, who taught at a few locations 
                in London between around 1720 and 1734. Blank books with printed title pages 
                seem to have been used by students to write down recipes they learned.
                Kidder also published his recipes in the printed volume, 
                Receipts for Pastry and Cookery, in 1720.
                
                Take a pound of fresh butter a pound of double
                refind sugar sifted fine a little beaten
                mace & 4 eggs beat them all together with.
                your hands till tis very leight & looks
                curdling you put thereto a pound & 1/2 of
                flower roul them out into little cakes
                
                Our recipe (halved from the original)
                
                1/2 lb. (2 sticks) butter, softened
                1/2 lb. sugar
                1/4 tsp. mace
                1/2 tsp. cinnamon 
                2 eggs
                3/4 lb. flour
                
                Using an electric mixer, cream together the butter and sugar. 
                Then add the eggs and mix at medium speed until the mixture looks curdled. 
                Sift together dry ingredients and add at low speed until just combined. 
                Scoop and roll the dough by hand into 1-tbsp. balls, then pat flat.
                [You could also refrigerate the dough until it’s firm enough to roll out 
                on a flat surface and cut out into rounds.]
                
                Bake at 350F for 15-18 minutes (ours were about 1/3″ thick, so you could roll them thinner 
                and have a slightly shorter cooking time). They’re done once they turn the 
                slightest bit brown around the edges. This halved recipe yielded about two dozen cookies.
                
                The Results
                
                If you like snickerdoodles (and who doesn’t?), you’d like these. 
                We added the cinnamon because we like it and couldn’t resist, and we thought it rounded out the mace nicely. 
                These are mild, fairly soft cookies that are great with tea. We rolled and patted 
                the dough into individual cookies because it was too soft and stick to roll out, 
                but a little bit more flour and a stint in the fridge might make the dough easier 
                to work with a rolling pin.
                

Big-picture Guidance

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 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. And it might help food historians to translate the historic language of food preparation into modern terms. The challenge of the assignment is to write code that helps categorize ingredients, mark necessary equipment, and stages in making the cakes in historic and contemporary terms. The way you approach this with XML is up to you.

Coding the document in <oXygen/>

Curating the document: Suggestions for XML markup

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. Your markup could organize into categories and steps, quantities and units. Can you write code that traces ingredients and how they are mentioned in the historic and modern recipes?

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.

When, where, and how to submit the assignment

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.