<?xml version="1.0" encoding="UTF-8"?>

<!--Mike Straus-->
<!--CSCI 2962 - Programming XML in Java-->
<!--Homework 1-->

<!--DTD for an Address book of People and Busineses-->
<!--This is a rather simple address book.  There where many cool things I would have liked to do, but they where
too difficult or impossible to do with DTDs.  Oh well, it does hold important address book info for either a 
person or a business, all the required stuff, plus some additions I thought would make it a bit more practical.-->

<!--Root element, as many Person or Buisness elements as desired-->
<!ELEMENT AddressBook (Person | Business)* >

<!--Info about a person, some optional as you may not have it all.  Phone, email, and aim are allowed multiple times, as many people have more then 1 of these-->		
<!ELEMENT Person (Name, Age?, Gender?, Phone*, email*, HomePage?, Address?, AIM*, ICQ?)>	

<!--Attribute list for Person, Person_ID is requried, can be used to identify a person-->
<!ATTLIST Person
	Person_ID ID #REQUIRED
>

<!--Info about a business, some optional and some may be repeated-->	
<!ELEMENT Business (Name, ContactPerson?, Phone*, email*, WebSite?, Address?)>
		
<!--Name can be a persons name with First, Middle (optional), Last, or a Business Name-->
<!ELEMENT Name ((First, Middle?, Last) | BusName)>

<!--Parameter Entity pcd for #PCDATA.  Hey, its a bit quicker to type., and its one of the few things that gets repeated a lot in this dtd-->
<!ENTITY % pcd "(#PCDATA)">
		
<!--hold persons first name-->
<!ELEMENT First %pcd;>

<!--Holds persons Midde Name-->
<!ELEMENT Middle %pcd;>

<!--Holds persons Last Name-->
<!ELEMENT Last %pcd;>

<!--Holds business' Name-->
<!ELEMENT BusName %pcd;>

<!--Holds person's age-->
<!ELEMENT Age %pcd;>

<!--Holds person's gender-->
<!ELEMENT Gender %pcd;>

<!--Holds a phone number, and optionaly an extension too-->
<!ELEMENT Phone (Number, Extension?)>

<!--Attribute list for Phone element.  type holds type of phone number, voicemail indicates if there is a messaging system on this line-->
<!ATTLIST Phone
	type (fax | cell | voice | pager | data) "voice" 			
	voicemail (Y | N) "N"				
>

<!--Holds actual phone number-->
<!ELEMENT Number %pcd;>

<!--Holds phone extension-->
<!ELEMENT Extension %pcd;>

<!--holds an email address-->
<!ELEMENT email %pcd;>

<!--Holds URL to persons homepage-->
<!ELEMENT HomePage %pcd;>

<!--Holds and address, one or more lines of street address (2 is very common), city, state, and zip.  US address only here, sorry.-->
<!ELEMENT Address (Street+, City, State, Zip)>

<!--Holds a line of street address-->
<!ELEMENT Street %pcd;>

<!--Holds City-->
<!ELEMENT City %pcd;>

<!--Holds State-->
<!ELEMENT State %pcd;>

<!--Holds Zip Code-->
<!ELEMENT Zip %pcd;>

<!--holds a contact person-->
<!ELEMENT ContactPerson %pcd;>

<!--attribute list for contact person, optional title of contact person. i.e. sales rep, owner, account manager.  Also option ref to Person_ID-->
<!ATTLIST ContactPerson
	title CDATA #IMPLIED
	Person_ID IDREF #IMPLIED
>

<!--Holds an AIM screen name-->
<!ELEMENT AIM %pcd;>

<!--Holds an ICQ number-->
<!ELEMENT ICQ %pcd;>

<!--Holds URL of business website-->
<!ELEMENT WebSite %pcd;>
