Showing posts with label Extensible Markup Language XML Tutorial. Show all posts
Showing posts with label Extensible Markup Language XML Tutorial. Show all posts

Tuesday, September 24, 2013

Extensible Markup Language XML Tutorial

The basic syntax for one element in XML is

<name attribute="value">content</name>

Here is an example of a simple recipe expressed using XML:

<?xml version="1.0" encoding="UTF-8"?>
<recipe name="bread" prep_time="5 mins" cook_time="3 hours">
<title>Basic bread</title>
<ingredient amount="3" unit="cups">Flour</ingredient>
<ingredient amount="0.25" unit="ounce">Yeast</ingredient>
<ingredient amount="1.5" unit="cups" state="warm">Water</ingredient>
<ingredient amount="1" unit="teaspoon">Salt</ingredient>
<instructions>
<step>Mix all ingredients together, and knead thoroughly.</step>
<step>Cover with a cloth, and leave for one hour in warm room.</step>
<step>Knead again, place in a tin, and then bake in the oven.</step>
</instructions>
</recipe>