<!--
====================================================================
registry.stanford.edu/Person.dtd
version 1.0, 08/09/2002

DTD for the Stanford University Registry Person

Copyright  2002 by the Board of Trustees of Stanford University
====================================================================
08/09/02 mnguyen  Add general type to <identifier>
08/07/02 mnguyen  Changed relationship attribute to implied
08/05/02 mnguyen  Add place element to <affiliation>
08/05/02 mnguyen  Add county element; office type to <telephone>
07/18/02 lmcrae   Add visibility and housekeeing attributes to <image>
06/07/02 mnguyen  Add 'image' element
05/02/01 cjurney  Remove 'container' elements, added place, source, organization
04/03/01 cjurney  Add <locations>
12/04/01 cjurney  Add 'card' attribute to header
====================================================================
-->

<!-- +++++++++++++++++++++++++ Entity Declarations +++++++++++++++++++++++++ -->

<!ENTITY housekeeping '
	updated 		CDATA #IMPLIED
	updated_by		CDATA #IMPLIED
	update_source	CDATA #IMPLIED
	update_comment	CDATA #IMPLIED'>

<!ENTITY visibility 'visibility (none | private | stanford | world) "none"'>

<!-- +++++++++++++++++++++++++ Person +++++++++++++++++++++++++ -->

<!ELEMENT Person (name*, biodemo?, address*, telephone*, email*, url*,
	place*, organization*, identifier*, privgroup*, extension*, source*, visibility*, image?)>
	<!ATTLIST Person
		name 		CDATA #REQUIRED
		regid 		CDATA #IMPLIED
		sunetid 	CDATA #IMPLIED
		univid 	CDATA #IMPLIED
		card		CDATA #IMPLIED
		relationship	(faculty | student | staff | affiliate)  #IMPLIED
		listing 	(none | private | stanford | world) "none"
		source	CDATA #REQUIRED
		refid		CDATA #IMPLIED>

<!-- A Person document must have at least of of regid, sunetid, univid or source+refid when used
for data exchange with the Registry -->

<!-- +++++++++++++++++++++++++ Names +++++++++++++++++++++++++ -->

<!ELEMENT name (#PCDATA | first | middle | last | prefix | suffix)*>
	<!ATTLIST name
		type 	 (preferred | full | previous | other | display | registered) #REQUIRED
		source (campcomm | faculty | staff | student | hospital | registry) #IMPLIED
		visibility (none | private | stanford | world) "none"
		updated 		CDATA #IMPLIED
		updated_by		CDATA #IMPLIED
		update_source	CDATA #IMPLIED
		update_comment	CDATA #IMPLIED>

<!ELEMENT first 	(#PCDATA)>

<!ELEMENT middle 	(#PCDATA)>

<!ELEMENT last	(#PCDATA)>

<!ELEMENT prefix 	(#PCDATA)>

<!ELEMENT suffix 	(#PCDATA)>

<!-- The full, assembled name is expressed in "Last, First" form -->

<!--  +++++++++++++++++++++++++ Bio Demo data +++++++++++++++++++++++++ -->

<!ELEMENT biodemo (gender?, birthdate?, birthplace?, deceased?,
	visatype?, ethnictype?, uscitizenship?, ssn?)>
	<!ATTLIST biodemo 	
		updated 		CDATA #IMPLIED
		updated_by		CDATA #IMPLIED
		update_source	CDATA #IMPLIED
		update_comment	CDATA #IMPLIED>
	
<!ELEMENT gender 		(#PCDATA)>

<!ELEMENT birthdate 	(#PCDATA)>

<!ELEMENT birthplace 	(#PCDATA)>

<!ELEMENT deceased 	(#PCDATA)>

<!ELEMENT visatype 	(#PCDATA)>
	<!ATTLIST visatype
		code CDATA #REQUIRED>

<!ELEMENT ethnictype 	(#PCDATA)>
	<!ATTLIST ethnictype
		code CDATA #REQUIRED>

<!ELEMENT uscitizenship (#PCDATA)>
	<!ATTLIST uscitizenship
		code CDATA #REQUIRED>

<!ELEMENT ssn 		(#PCDATA)>

<!-- +++++++++++++++++++++++++ Addresses +++++++++++++++++++++++++ -->
<!-- The Registry supports up to 4 lines of address   -->

<!ELEMENT address (#PCDATA | line | city | state | county | province | country | postalcode)*>
	<!ATTLIST address
		type 		(home | homemail | office | work | workmail) #REQUIRED
		label 		CDATA #IMPLIED
		visibility (none | private | stanford | world) "none"
		updated 		CDATA #IMPLIED
		updated_by		CDATA #IMPLIED
		update_source	CDATA #IMPLIED
		update_comment	CDATA #IMPLIED>

<!ELEMENT line 		(#PCDATA)>

<!ELEMENT city 		(#PCDATA)>

<!ELEMENT state 		(#PCDATA)>
	<!ATTLIST state
		code 		CDATA #IMPLIED>

<!ELEMENT county 	(#PCDATA)>

<!ELEMENT province      (#PCDATA)>

<!ELEMENT country 		(#PCDATA)>
	<!ATTLIST country
		alpha2 	CDATA #IMPLIED
		alpha3 	CDATA #IMPLIED
		numeric	CDATA #IMPLIED>

<!ELEMENT postalcode 	(#PCDATA)>

<!-- +++++++++++++++++++++++++ Locations +++++++++++++++++++++++++ -->

<!ELEMENT location (#PCDATA)>
	<!ATTLIST location
		type			(idmail | residence) #REQUIRED
		code	 		CDATA #REQUIRED
		room			CDATA #IMPLIED
		effective		CDATA #IMPLIED
		updated 		CDATA #IMPLIED
		updated_by		CDATA #IMPLIED
		update_source	CDATA #IMPLIED
		update_comment	CDATA #IMPLIED>

<!-- +++++++++++++++++++++++++ Telephones +++++++++++++++++++++++++ -->

<!ELEMENT telephone (#PCDATA | icc | area | number | ext)*>
	<!ATTLIST telephone
		type 			(mobile | pager | home | homefax | residence | office | work | workfax) #REQUIRED
		label 			CDATA #IMPLIED
		visibility		 (none | private | stanford | world) "none"
		updated 		CDATA #IMPLIED
		updated_by		CDATA #IMPLIED
		update_source	CDATA #IMPLIED
		update_comment	CDATA #IMPLIED>

<!ELEMENT icc	 (#PCDATA)>

<!ELEMENT area	(#PCDATA)>

<!ELEMENT number 	(#PCDATA)>

<!ELEMENT ext 	(#PCDATA)>

<!-- +++++++++++++++++++++++++ Email +++++++++++++++++++++++++ -->

<!ELEMENT email (#PCDATA | user | host)*>
	<!ATTLIST email
		type 		(primary | pager) #REQUIRED
		label 		CDATA #IMPLIED
		visibility (none | private | stanford | world) "none"
		updated 		CDATA #IMPLIED
		updated_by		CDATA #IMPLIED
		update_source	CDATA #IMPLIED
		update_comment	CDATA #IMPLIED>

<!ELEMENT user (#PCDATA)>

<!ELEMENT host (#PCDATA)>

<!-- +++++++++++++++++++++++++ URLs +++++++++++++++++++++++++ -->

<!ELEMENT url (#PCDATA)>
	<!ATTLIST url
		type 		CDATA #FIXED "homepage"
		label 		CDATA #IMPLIED
		visibility (none | private | stanford | world) "none"
		updated 		CDATA #IMPLIED
		updated_by		CDATA #IMPLIED
		update_source	CDATA #IMPLIED
		update_comment	CDATA #IMPLIED>

<!-- +++++++++++++++++++++++++ Places +++++++++++++++++++++++++ -->

<!ELEMENT place (location*, address*, telephone*, email*)>
	<!ATTLIST place
		type 	(home | work | office) #REQUIRED>

<!-- +++++++++++++++++++++++++ Organizations +++++++++++++++++++++++++ -->

<!ELEMENT organization (affiliation+, address*, telephone*, email*, place*)>
	<!ATTLIST organization
		organization 	(stanford | sumc) "stanford">

<!-- +++++++++++++++++++++++++ Affiliations +++++++++++++++++++++++++ -->

<!ELEMENT affiliation (#PCDATA | department | position | description | location | place)*>
	<!ATTLIST affiliation
		organization 	(stanford | sumc) "stanford"
		type 		CDATA #REQUIRED
		visibility (none | private | stanford | world) "none"
		updated 		CDATA #IMPLIED
		updated_by		CDATA #IMPLIED
		update_source	CDATA #IMPLIED
		update_comment	CDATA #IMPLIED>
		<!-- Syntax: "affiliationcode[:qualifier]",
			e.g., "faculty:emeritus", "staff" -->

<!ELEMENT department (#PCDATA)>
	<!ATTLIST department
		regid		CDATA #IMPLIED
		code		CDATA #IMPLIED>

<!ELEMENT position (#PCDATA)>
	<!ATTLIST position
		code		CDATA #IMPLIED
		refid		CDATA #IMPLIED>

<!ELEMENT description (#PCDATA)>

<!--  +++++++++++++++++++++++++ Identifiers +++++++++++++++++++++++++ -->

<!ELEMENT identifiers (identifier+)>
	<!ATTLIST identifiers count CDATA #REQUIRED>

<!ELEMENT identifier (#PCDATA)>
	<!ATTLIST identifier
		type 	(principal | sunetid | univid | card | directory | other | refid | proximity | general) #REQUIRED
		source 	(campcomm | faculty | staff | student | hospital | registry | univid | sunetid) #IMPLIED
		visibility (none | private | stanford | world) "none"
		updated 		CDATA #IMPLIED
		updated_by		CDATA #IMPLIED
		update_source	CDATA #IMPLIED
		update_comment	CDATA #IMPLIED>

<!-- +++++++++++++++++++++++++ Privilege Groups +++++++++++++++++++++++++ -->

<!ELEMENT privgroups (privgroup+)>
	<!ATTLIST privgroups count CDATA #REQUIRED>

<!ELEMENT privgroup (#PCDATA)>
	<!ATTLIST privgroup
		source 	(registry | workgroup) #IMPLIED
		updated 		CDATA #IMPLIED
		updated_by		CDATA #IMPLIED
		update_source	CDATA #IMPLIED
		update_comment	CDATA #IMPLIED>

<!-- +++++++++++++++++++++++++ Person Extensions +++++++++++++++++++++++++ -->

<!ELEMENT extension (#PCDATA)>
	<!ATTLIST extension
		type 		CDATA #REQUIRED
		visibility (none | private | stanford | world) "none"
		updated 		CDATA #IMPLIED
		updated_by		CDATA #IMPLIED
		update_source	CDATA #IMPLIED
		update_comment	CDATA #IMPLIED>

<!-- +++++++++++++++++++++++++ Sources +++++++++++++++++++++++++ -->

<!ELEMENT source (name+, biodemo, identifier*)>
	<!ATTLIST source 
		source (campcomm | faculty | staff | student | hospital | registry) #REQUIRED
		updated 		CDATA #IMPLIED
		updated_by		CDATA #IMPLIED
		update_source	CDATA #IMPLIED
		update_comment	CDATA #IMPLIED>

<!-- +++++++++++++++++++++++++ Visibilities +++++++++++++++++++++++++ -->

<!ELEMENT visibility (#PCDATA)>
	<!ATTLIST visibility
		where 	(online | print) #REQUIRED
		what 		CDATA #REQUIRED
		updated 		CDATA #IMPLIED
		updated_by		CDATA #IMPLIED
		update_source	CDATA #IMPLIED
		update_comment	CDATA #IMPLIED>

<!-- +++++++++++++++++++++++++++ Image ++++++++++++++++++++++++++ -->

<!ELEMENT image (#PCDATA)>
	<!ATTLIST image
		type (card) #REQUIRED
		mimetype	CDATA #REQUIRED
		encoding (base64) #REQUIRED
                visibility (none | private | stanford | world) "none" 
                updated                 CDATA #IMPLIED
                updated_by              CDATA #IMPLIED
                update_source   CDATA #IMPLIED
                update_comment  CDATA #IMPLIED> 
