<?xml version="1.0"?>
<xs:schema	xmlns:xs="http://www.w3.org/2001/XMLSchema"
				xmlns:commons="http://rets.org/xsd/RETSCommons/2007-08"
				targetNamespace="http://rets.org/xsd/RETSCommons/2007-08"
				elementFormDefault="qualified"
				attributeFormDefault="unqualified">

	<!--
		Tab stops
		:set ts=3

		File History
		======================
		$Header: Address.xsd, 14, 7/6/2007 9:30:50 AM, Paul Stusiak$
		
		$Log:
		 14   055_RETS_Standard 1.13        7/6/2007 9:30:50 AM    Paul Stusiak
		      Change enumerations to use common format of
		      OtherEnumerationDescriptionString for Rooms change CR 29
		 13   055_RETS_Standard 1.12        7/5/2007 2:05:50 PM    Gina Accawi
		      Add address category enumeration. Add preference order information.
		 12   055_RETS_Standard 1.11        7/4/2007 11:18:30 AM   Paul Stusiak
		      Change example for PostalCode
		 11   055_RETS_Standard 1.10        5/2/2007 1:08:57 PM    Paul Stusiak
		      change namespace location
		 10   055_RETS_Standard 1.9         5/1/2007 2:36:59 PM    Paul Stusiak
		      Update the version timestamp, make the schema relative again,
		      normalize the date related typing to use SecureDateTime and naming to
		      be of the form XXXDateTime
		 9    055_RETS_Standard 1.8         4/13/2007 11:54:30 AM  Paul Stusiak
		      Pretty-print update to limit body width to less than 70 characters for
		       review purposes.
		 8    055_RETS_Standard 1.7         4/3/2007 1:43:54 AM    Paul Stusiak
		      change namespace to remote location (www.ftc2.com) for testing
		 7    055_RETS_Standard 1.6         4/2/2007 11:26:52 AM   Paul Stusiak
		      change namespace to match responding server and to use the URI
		      versioning suggested by both HP and XFront
		 6    055_RETS_Standard 1.5         3/30/2007 6:20:18 PM   Paul Stusiak
		      Update of the versionTimestamp and the namespace (namespace to
		      200704). Change formating to a standard format
		 5    055_RETS_Standard 1.4         3/26/2007 6:43:42 PM   Paul Stusiak
		      additional annotations added and some minor corrections
		 4    055_RETS_Standard 1.3         3/12/2007 9:39:15 PM   Paul Stusiak
		      reformat the layout, add some more documentation, make sequence
		      correction per Joshua Vosper for the order of the Country/Postal code.
		       Add new choice constraint between civic address and PO Box.
		 3    055_RETS_Standard 1.2         3/7/2007 10:44:46 PM   Paul Stusiak
		      Clean up the project information for the purposes of document
		      generation.
		 2    055_RETS_Standard 1.1         2/28/2007 12:26:38 AM  Paul Stusiak
		      completion of first cut at refactoring out from RETSCommons.xsd
		 1    055_RETS_Standard 1.0         2/27/2007 7:14:31 PM   Paul Stusiak    
		$
		======================
	-->
	<xs:include schemaLocation="Primitives.xsd"/>
	
	<xs:annotation>
		<xs:documentation>
			A generalized type description of an Address
		</xs:documentation>
	</xs:annotation>

	<!-- simple Types -->
	<xs:complexType name="AddressCategoryEnum">
		<xs:simpleContent>
			<xs:restriction base="commons:OtherEnumerationDescriptionString">
				<xs:enumeration value="Physical"/>
				<xs:enumeration value="Display"/>
				<xs:enumeration value="Mailing"/>
				<xs:enumeration value="Shipping"/>
				<xs:enumeration value="Billing"/>
				<xs:enumeration value="Legal"/>
				<xs:enumeration value="Tax"/>
				<xs:enumeration value="Other"/>
			</xs:restriction>
		</xs:simpleContent>
	</xs:complexType>

	<!-- complex Types -->


	<xs:complexType name="StreetNumber">
		<xs:annotation>
			<xs:documentation>
				Text field that uniquely locates a building on a given
				street. House numbers may have fractional or alphabetic
				modifiers. This is the first component in a street
				address.
			</xs:documentation>
		</xs:annotation>
		<xs:simpleContent>
			<xs:extension base="xs:string" />
		</xs:simpleContent>
	</xs:complexType>
	<xs:complexType name="StreetDirPrefix">
		<xs:annotation>
			<xs:documentation>
				Text field containing the direction that follows the
				house number and precedes the street name in an address.  
				The format may be either an abbreviation, such as "NE" or
				"N.E" or the full direction, "Northeast".
			</xs:documentation>
		</xs:annotation>
		<xs:simpleContent>
			<xs:extension base="xs:string" />
		</xs:simpleContent>
	</xs:complexType>
	<xs:complexType name="StreetName">
		<xs:annotation>
			<xs:documentation>
				Text field containing the name of the street in an
				address.  This may follow the house number or, if
				applicable, the street direction prefix. It precedes the
				street suffix. for example, in the address
				"123 Main St.", "Main" is the street name.
			</xs:documentation>
		</xs:annotation>
		<xs:simpleContent>
			<xs:extension base="xs:string" />
		</xs:simpleContent>
	</xs:complexType>
	<xs:complexType name="StreetSuffix">
		<xs:annotation>
			<xs:documentation>
				Text field describing the street type in an address. This
				field follows the street name and precedes the street
				direction suffix. A street suffix may be formatted as
				either an  abbreviation or full name. Examples include:
				Road, Rd., Avenue, Ave., etc.
			</xs:documentation>
		</xs:annotation>
		<xs:simpleContent>
			<xs:extension base="xs:string" />
		</xs:simpleContent>
	</xs:complexType>
	<xs:complexType name="StreetDirSuffix">
		<xs:annotation>
			<xs:documentation>
				Text field containing the direction that follows the
				street suffix in an address. The format may be either an
				abbreviation, such as "NE" or "N.E" or the full
				direction, "Northeast".
			</xs:documentation>
		</xs:annotation>
		<xs:simpleContent>
			<xs:extension base="xs:string" />
		</xs:simpleContent>
	</xs:complexType>
	<xs:complexType name="StreetAdditionalInfo">
		<xs:simpleContent>
			<xs:extension base="xs:string" />
		</xs:simpleContent>
	</xs:complexType>
	<xs:complexType name="BoxNumber">
		<xs:annotation>
			<xs:documentation>
				A container at a central mailing location, where the
				incoming mail of a person or legal entity is held until
				picked up by the person or legal entity. Also known as
				a post office box.
			</xs:documentation>
		</xs:annotation>
		<xs:simpleContent>
			<xs:extension base="xs:string" />
		</xs:simpleContent>
	</xs:complexType>
	<xs:complexType name="UnitNumber">
		<xs:annotation>
			<xs:documentation>
				Text field containing the number or portion of a larger
				building or complex. Unit Number should appear following
				the street suffix or, if it exists, the street suffix
				direction, in the street address. Examples are:
				"APT G", "55", etc.
			</xs:documentation>
		</xs:annotation>
		<xs:simpleContent>
			<xs:extension base="xs:string" />
		</xs:simpleContent>
	</xs:complexType>
	<xs:complexType name="City">
		<xs:annotation>
			<xs:documentation>
				The city, township, municipality, etc. portion of the
				physical, legal or mailing address for a property,
				person, etc.
			</xs:documentation>
		</xs:annotation>
		<xs:simpleContent>
			<xs:extension base="xs:string" />
		</xs:simpleContent>
	</xs:complexType>
	<xs:complexType name="StateOrProvince">
		<xs:annotation>
			<xs:documentation>
				Text field containing either the accepted postal
				abbreviation or the full name for one of the 50 U.S.
				states or 13 Canadian provinces/territories.
			</xs:documentation>
		</xs:annotation>
		<xs:simpleContent>
			<xs:extension base="xs:string" />
		</xs:simpleContent>
	</xs:complexType>
	<xs:complexType name="Country">
		<xs:annotation>
			<xs:documentation>
				The territory of nation or state included in a person or 
				property's legal or mailing address.
			</xs:documentation>
		</xs:annotation>
		<xs:simpleContent>
			<xs:extension base="xs:string"/>
		</xs:simpleContent>
	</xs:complexType>
	<xs:complexType name="PostalCode">
		<xs:annotation>
			<xs:documentation>
				In the United states, the postal code (ZIP code) the
				basic postal code format consists of five numerical
				digits and may include a five digit ZIP+4 code that
				allows delivery of a piece of mail to be even more
				accurately defined. In Canada, the postal code is a six
				character alpha-numerical code defined and maintained by
				Canada Post Corporation for mail processing
				(sorting and delivery).
			</xs:documentation>
		</xs:annotation>
		<xs:simpleContent>
			<xs:extension base="xs:string" />
		</xs:simpleContent>
	</xs:complexType>
	<xs:complexType name="CarrierRoute">
		<xs:annotation>
			<xs:documentation>
				The group of addresses to which the USPS assigns the
				same code to aid in mail delivery. For the USPS, these
				codes are 9 digits: 5 numbers for the ZIP Code, one
				letter for the carrier route type, and 3 numbers for the
				carrier route number.
			</xs:documentation>
		</xs:annotation>
		<xs:simpleContent>
			<xs:extension base="xs:string" />
		</xs:simpleContent>
	</xs:complexType>
	<xs:complexType name="Address">
		<xs:sequence>
			<xs:element name="preference-order"
				type="commons:preferenceOrderType">
				<xs:annotation>
					<xs:documentation>
						Indicates the preference order within all the ContactMethods.
						Highest preference is 0.
					</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="address-preference-order"
				type="commons:preferenceOrderType">
				<xs:annotation>
					<xs:documentation>
						Indicates the preference order within all the Phones.
						Highest preference is 0. 
					</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="category"
							type="commons:AddressCategoryEnum"
							minOccurs="0"
							maxOccurs="1">
				<xs:annotation>
					<xs:documentation>
						Provide a category for the address: shipping, billing, physical, etc.
					</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element	name="FullStreetAddress"
							type="xs:string"
							minOccurs="0"
							maxOccurs="1">
				<xs:annotation>
					<xs:documentation>
						The FullStreetAddress is a text representation of
						the address with the full Civic, City,
						StateOrProvince, PostalCode and, optionally, the
						Country as a single entity.
					</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:choice>
				<xs:annotation>
					<xs:documentation>
						By definition, only one of the civic address, Box
						number or General Delivery information can be
						displayed.
					</xs:documentation>
				</xs:annotation>
				<xs:sequence>
					<xs:element	name="StreetNumber"
									type="commons:StreetNumber"
									minOccurs="0"
									maxOccurs="1">
						<xs:annotation>
							<xs:appinfo>
								5323
							</xs:appinfo>
						</xs:annotation>
					</xs:element>
					<xs:element	name="StreetDirPrefix"
									type="commons:StreetDirPrefix"
									minOccurs="0"
									maxOccurs="1">
						<xs:annotation>
							<xs:appinfo>
								W
							</xs:appinfo>
						</xs:annotation>
					</xs:element>
					<xs:element	name="StreetName"
									type="commons:StreetName"
									minOccurs="0"
									maxOccurs="1">
						<xs:annotation>
							<xs:appinfo>
								Broadway
							</xs:appinfo>
						</xs:annotation>
					</xs:element>
					<xs:element	name="StreetSuffix"
									type="commons:StreetSuffix"
									minOccurs="0"
									maxOccurs="1"/>
					<xs:element	name="StreetDirSuffix"
									type="commons:StreetDirSuffix"
									minOccurs="0"
									maxOccurs="1"/>
					<xs:element name="StreetAdditionalInfo"
									type="commons:StreetAdditionalInfo"
									minOccurs="0"
									maxOccurs="1"/>
					<xs:element name="UnitNumber"
									type="commons:UnitNumber"
									minOccurs="0"
									maxOccurs="1">
						<xs:annotation>
							<xs:appinfo>
								12
							</xs:appinfo>
						</xs:annotation>
					</xs:element>
				</xs:sequence>
				<xs:element		name="BoxNumber"
									type="commons:BoxNumber"
									minOccurs="0"
									maxOccurs="1">
					<xs:annotation>
						<xs:documentation>
							Use the BoxNumber element to contain address
							location information not covered by the Civic
							Address.
						</xs:documentation>
					</xs:annotation>
				</xs:element>
			</xs:choice>
			<xs:element	name="City"
							type="commons:City"
							minOccurs="1"
							maxOccurs="1">
				<xs:annotation>
					<xs:appinfo>
						Anytown
					</xs:appinfo>
				</xs:annotation>
			</xs:element>
			<xs:element	name="StateOrProvince"
							type="commons:StateOrProvince"
							minOccurs="0"
							maxOccurs="1">
				<xs:annotation>
					<xs:appinfo>
						DC
					</xs:appinfo>
				</xs:annotation>
			</xs:element>
			<xs:element	name="PostalCode"
							type="commons:PostalCode"
							minOccurs="0"
							maxOccurs="1">
				<xs:annotation>
					<xs:appinfo>
						90281-1374
					</xs:appinfo>
				</xs:annotation>
			</xs:element>
			<xs:element	name="CarrierRoute"
							type="commons:CarrierRoute"
							minOccurs="0"
							maxOccurs="1"/>
			<xs:element	name="Country"
							type="commons:Country"
							minOccurs="0"
							maxOccurs="1">
				<xs:annotation>
					<xs:appinfo>
						US
					</xs:appinfo>
				</xs:annotation>
			</xs:element>
			<xs:any	namespace="##other"
						minOccurs="0"
						maxOccurs="15"/>
		</xs:sequence>
		<xs:attribute ref="commons:privacyType"
			use="optional">
			<xs:annotation>
				<xs:documentation>
					Provide a level of privacy for this address. 
				</xs:documentation>
			</xs:annotation>
		</xs:attribute>
	</xs:complexType>
</xs:schema>