Example 4: Recipes - Page 6
December 19, 2002
This example (recipes01.xml) defines a document that will contain one or more recipes. This sample
document shows one recipe:
<?xml version="1.0" ?>
<content type="nonfiction" subtype="recipes">
<title>Guide to Spicy Cooking - Online Edition</title>
<authors>
<author>
<fname>mookie</fname>
<mname/>
<lname>mouse</lname>
</author>
</authors>
<page/>
<body>
<recipes>
<recipe title="Savoury Curry Minced Lamb" categ="">
<ingredients>
<item num="1">
<ingred>Olive oil</ingred>
<quantity units="tbsp">2</quantity>
<notes></notes>
</item>
<item num="2">
<ingred>Curry powder</ingred>
<quantity units="tbsp">2-3</quantity>
<notes></notes>
</item>
<item num="3">
<ingred>Haldi (turmeric)</ingred>
<quantity units="tbsp">2</quantity>
<notes></notes>
</item>
<item num="4">
<ingred>Ginger powder</ingred>
<quantity units="tbsp">1</quantity>
<notes></notes>
</item>
<item num="5">
<ingred>Ground lamb, thawed</ingred>
<quantity units="oz">16</quantity>
<notes>(or subst. beef, chicken or turkey)</notes>
</item>
<item num="6">
<ingred>Mushrooms, sliced</ingred>
<quantity units="">3 med</quantity>
<notes></notes>
</item>
<item num="7">
<ingred>Large calamata olives, quartered</ingred>
<quantity units="">4-6</quantity>
<notes>optional</notes>
</item>
<item num="8">
<ingred>Scallions (green onion)</ingred>
<quantity units="">5-6</quantity>
<notes>sliced - white portion only</notes>
</item>
<item num="9">
<ingred>Tomato sauce</ingred>
<quantity units="cups">1/2</quantity>
<notes>Dilute with 1/2 cup water or substitute with
1 cup of tomato or vegetable juice.</notes>
</item>
<item num="10">
<ingred>Cooked rice</ingred>
<quantity units="cups">4</quantity>
<notes>or one cup per person</notes>
</item>
</ingredients>
<instructions>
<step num="1">Heat olive oil in skillet at med-high (8)
heat.</step>
<step num="2">Add dry spices (curry powder, turmeric, ginger
powder) and roast for less than 30 seconds. Keep
an eye out, as these spices will burn fairly
quickly.</step>
<step num="3">Add thawed or fresh ground meat and break up with
spatula or chopsticks.</step>
<step num="4">When meat has nearly browned, add sliced
mushrooms. Toss with a spatula.</step>
<step num="5">If desired, add quartered olives now.</step>
<step num="6">Add tomato sauce and water, or tomato juice or
vegetable juice. Simmer for 10 minutes.</step>
<step num="7">Remove from stove; add sliced scallions.</step>
</instructions>
<serving>
<suggestion>
Serve on steamed rice, with slices of mango or watermelon.
</suggestion>
<serves>Serves 4-6 as a main dish, 8-10 as an appetizer.
</serves>
</serving>
</recipe>
</recipes>
</body>
</content>
More recipes can be added later using something like the following:
<?selectdoc type="nonfiction" subtype="recipes"
title="Guide to Spicy Cooking - Online Edition" ?>
<recipe title="Peace and Harmony">
...
</recipe>
The application component that handles recipes would have some scheme for adding <recipe>...</recipe>
blocks to the current document, for example, alphabetically by title or by category of the dish, if such information is
included in each recipe. However, at this point, we could order the output in any way we want.
Example 2: Online Manual - Page 5
Professional PHP4 Web Development Solutions
Example 5: Fiction Short Story Fragment - Page 7
|