Advertisement
tnngo2

PHP - Theory 3 - Demo XML

Mar 13th, 2012
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 1.54 KB | None | 0 0
  1. <recipe version="1.0" encoding="ISO-8859-1">
  2.     Here's the root element. It's not called html, it's called
  3.       recipe, since this is the XML for a recipe. Notice it has some extra
  4.         attributes in it, which you've never seen on an html element in HTML.
  5.       <name>Head First Lounge Iced Tea</name>
  6.         Wow, look at these tags. The h1 and p  are all gone, and instead we've got
  7.         recipe, name, description, ingredients,
  8.         preparation, and so on.
  9.         Just by looking at the element names you can tell this is a recipe.
  10.       <description>A brisk iced tea with a bit of a kick. We
  11.            serve this all day long.
  12.       </description>
  13.       <ingredients>
  14.         <ingredient measurement="6 cups">water</ingredient>
  15.         <ingredient measurement="2 bags">black tea</ingredient>
  16.         <ingredient measurement="2 bags">earl grey tea</ingredient>
  17.         <ingredient measurement="6 cups">ice</ingredient>
  18.       </ingredients>
  19.       <preparation>
  20.         <time duration="10 minutes" /> This empty element
  21.  looks a little strange. We'll come back to that in a bit.
  22.         <step>Boil one cup of water in a pan, remove pan, and
  23.             add tea. Let steep for five minutes.</step>
  24.         <step>Add ice to a pitcher, then add tea,
  25. then 5 cups cold water.</step>
  26.         <step>Mix well and serve. Give tea a
  27.                   quick shake in a shaker for an
  28.                   extra touch.</step> Other
  29. than the element names, the way the elements look and are used is just like HTML (opening
  30.  tags, closing tags, and so on).
  31.       </preparation>
  32. </recipe>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement