Quick Example: Data and Presentation

Data

Contacts in and Address Book in XML:

<addressbook>
  <contact>
    <name>David Heitmeyer</name>
    <address>8 Story Street</address>
    <city>Cambridge</city>
    <state>Massachusetts</state>
    <zip>02138</zip>
    <phone type="office">617-999-5870</phone>
    <email>david_heitmeyer@harvard.edu</email>
  </contact>
  <contact>
    <name>Drew Gilpin Faust</name>
    <address>Massachusetts Hall</address>
    <city>Cambridge</city>
    <state>Massachusetts</state>
    <zip>02138</zip>
    <email>president@harvard.edu</email>
  </contact>
</addressbook>

Presentation

XHTML for presentation:

<table class="addressbook">
	<tr>
		<th>Name</th>
		<td>David Heitmeyer</td>
	</tr>
	<tr>
		<th>Address</th>
		<td>8 Story Street<br/>Cambridge, Massachusetts 02138
		</td>
	</tr>
	<tr>
		<th>Phone</th>
		<td>617-999-5870</td>
	</tr>
	<tr>
		<th>Email</th>
		<td><a href="mailto:david_heitmeyer@harvard.edu">david_heitmeyer@harvard.edu</a></td>
	</tr>
	<tr>
		<th>Name</th>
		<td>Drew Gilpin Faust</td>
	</tr>
	<tr>
		<th>Address</th>
		<td>Massachusetts Hall<br/>Cambridge, Massachusetts 02138
		</td>
	</tr>
	<tr>
		<th>Email</th>
		<td><a href="mailto:president@harvard.edu">president@harvard.edu</a></td>
	</tr>			
</table>

Displayed in a browser:

NameDavid Heitmeyer
Address8 Story Street
Cambridge, Massachusetts 02138
Phone617-999-5870
Email david_heitmeyer@harvard.edu
NameDrew Gilpin Faust
AddressMassachusetts Hall
Cambridge, Massachusetts 02138
Emailpresident@harvard.edu

Copyright © 2002-2009 David P. Heitmeyer

Bookmark and Share