<?xml version="1.0" encoding="UTF-8"?>
<xs:schema	xmlns:xs="http://www.w3.org/2001/XMLSchema"
				xmlns:offices="http://rets.org/xsd/Offices/2007-08"
				xmlns:commons="http://rets.org/xsd/RETSCommons/2007-08"
				xmlns:media="http://rets.org/xsd/Media/2007-08"
				xmlns:nrds="http://rets.org/xsd/NRDSCommons/2007-08"
				targetNamespace="http://rets.org/xsd/Offices/2007-08"
				elementFormDefault="qualified"
				attributeFormDefault="unqualified">

	<!--
		Tab stops
		:set ts=3

		File History
		======================
		$Header: Offices.xsd, 35, 7/26/2007 8:59:42 PM, Paul Stusiak$
	
		$Log:
		 35   055_RETS_Standard1.34        7/26/2007 8:59:42 PM   Paul Stusiak
		      Update version timestamp
		 34   055_RETS_Standard1.33        7/24/2007 1:37:51 PM   Gina Accawi
		      Modify offices to allow mulitple office elements.
		 33   055_RETS_Standard1.32        7/24/2007 11:46:09 AM  Gina Accawi
		      Removed SystemOfficeGuid.
		 32   055_RETS_Standard1.31        7/24/2007 9:52:51 AM   Gina Accawi
		      Remove ref to ShortOffice. Replace with full Office.
		 31   055_RETS_Standard1.30        7/24/2007 9:28:30 AM   Gina Accawi     Add
		       OfficeLevelLabel.
		 30   055_RETS_Standard1.29        7/9/2007 1:58:57 AM    Paul Stusiak
		      re-order language and version attributes
		 29   055_RETS_Standard1.28        7/6/2007 2:32:03 PM    Gina Accawi
		      Rename NRDS items. Remove role, since it is now handled within the
		      Listing schema.
		 28   055_RETS_Standard1.27        7/5/2007 2:19:03 PM    Gina Accawi
		      Remove addresses, as the information is now in ContactMethod.
		 27   055_RETS_Standard1.26        7/4/2007 4:08:29 PM    Paul Stusiak    Add
		       county to Office
		 26   055_RETS_Standard1.25        7/2/2007 9:45:32 AM    Gina Accawi
		      Rename ResourceKey to be the actual ResourceNameKey.
		 25   055_RETS_Standard1.24        6/29/2007 1:04:04 PM   Gina Accawi     Add
		       media.
		 24   055_RETS_Standard1.23        6/29/2007 12:34:43 PM  Gina Accawi     Add
		       a key for the resource.
		 23   055_RETS_Standard1.22        6/29/2007 9:00:59 AM   Gina Accawi
		      Remove formal name.
		 22   055_RETS_Standard1.21        6/27/2007 11:53:30 AM  Gina Accawi
		      Remove formal name.
		 21   055_RETS_Standard1.20        6/26/2007 1:05:14 PM   Gina Accawi
		      Rename ContactInformation to ContactMethod.
		 20   055_RETS_Standard1.19        6/26/2007 12:40:33 PM  Gina Accawi
		      Rename Agent to Member. This affects namespaces, element names, type
		      references, and attribute names.
		 19   055_RETS_Standard1.18        6/13/2007 11:49:33 AM  Gina Accawi     Add
		       NRDS to the element names for types coming from the NRDSCommons
		      namespace as per May payloads meeting suggestion for Agents schema.
		 18   055_RETS_Standard1.17        5/14/2007 10:32:57 AM  Gina Accawi     Add
		       xml:lang attribute to root level type definition.
		 17   055_RETS_Standard1.16        5/2/2007 1:29:19 PM    Paul Stusiak    use
		       modified complex type name
		 16   055_RETS_Standard1.15        5/1/2007 2:49:20 PM    Paul Stusiak
		      Update the version timestamp, make the schema relative again add some
		      annotation.
		 15   055_RETS_Standard1.14        4/3/2007 4:59:31 PM    Paul Stusiak    use
		       url resolution for include, import to test schema validation
		 14   055_RETS_Standard1.13        4/3/2007 1:43:58 AM    Paul Stusiak
		      change namespace to remote location (www.ftc2.com) for testing
		 13   055_RETS_Standard1.12        4/2/2007 11:26:57 AM   Paul Stusiak
		      change namespace to match responding server and to use the URI
		      versioning suggested by both HP and XFront
		 12   055_RETS_Standard1.11        3/30/2007 6:20:59 PM   Paul Stusiak
		      Update of the versionTimestamp and the namespace (namespace to
		      200704). Change formating to a standard format
		 11   055_RETS_Standard1.10        3/19/2007 9:20:12 PM   Paul Stusiak
		      Added office information, formerly in NRDSCommons. Remove elements and
		       replace with ShortOffice type.
		 10   055_RETS_Standard1.9         3/7/2007 10:57:37 PM   Paul Stusiak
		      Clean up the project information for the purposes of document
		      generation.
		 9    055_RETS_Standard1.8         3/6/2007 1:50:33 PM    Paul Stusiak
		      Added header, tab stop information, change ID to Id across files.
		 8    055_RETS_Standard1.7         2/22/2007 3:34:53 PM   Gina Accawi
		      Remove all references to the schemaLocation as being
		      http://retsserver.realtors.org:8080/xsd/.  These references have been
		      changed to be relative path (as the current directory). Now,
		      regardless of where they are published, the referential internal
		      integrity will remain. The assumption is that these will all reside as
		       neighbors on the target distribution server.
		 7    055_RETS_Standard1.6         12/20/2006 12:31:08 PM Jeff Brush
		      added retsserver location back to imports;  renamed Prospect to
		      SavedQuery; changed ListingHistory to track only select fields
		      identified by workgroup;renamed Agency to Agents and fixed references
		      in other schemas;changed TotalSqFeet references to TotalArea; per 12/7
		       MLS payload workgroup meeting
		 6    055_RETS_Standard1.5         12/2/2006 1:12:45 AM   Paul Stusiak
		      various mechanical fixes tho the schema and a re-direct from
		      retsserver.realtors.org to www.ftc2.com
		 5    055_RETS_Standard1.4         11/28/2006 1:41:32 AM  Paul Stusiak
		      updated version per meetings
		 4    055_RETS_Standard1.3         9/20/2006 12:43:27 PM  Jeff Brush
		      chgd schemaLocation to point to http://retsserver.rets.org:8080/xsd/
		 3    055_RETS_Standard1.2         4/7/2006 7:36:40 PM    Jeff Brush
		      renamed version attribute to versionTimestamp for schema versioning
		 2    055_RETS_Standard1.1         4/7/2006 1:37:39 PM    Jeff Brush
		      modified to have schema versioning as datetime, add year month to
		      namespaces, minor corrections
		 1    055_RETS_Standard1.0         4/4/2006 8:06:09 AM    Jeff Brush
		      Updated schemas.  All MLS schemas have extensibility points.  New
		      ObjectReferenceList.xsd
		$
		======================
	-->

	<xs:annotation>
		<xs:documentation>
			Elements related to Member Offices.
		</xs:documentation>
	</xs:annotation>

	<xs:import	namespace="http://rets.org/xsd/RETSCommons/2007-08"
					schemaLocation="../../../xsd/RETSCommons/2007-08/RETSCommons.xsd"/>
	<xs:import	namespace="http://rets.org/xsd/NRDSCommons/2007-08"
					schemaLocation="../../../xsd/NRDSCommons/2007-08/NRDSCommons.xsd"/>
	<xs:import	namespace="http://rets.org/xsd/Media/2007-08"
					schemaLocation="../../../xsd/Media/2007-08/Media.xsd"/>
	<xs:import	namespace="http://www.w3.org/XML/1998/namespace"
					schemaLocation="http://www.w3.org/2001/xml.xsd"/>
	

	<!-- Types -->
	<xs:complexType name="OfficeCorporateName">
		<xs:annotation>
			<xs:documentation>
				Text field containing the corporate name of the
				office, if different from the business name.
			</xs:documentation>
		</xs:annotation>
		<xs:simpleContent>
			<xs:extension base="commons:SecureString"/>
		</xs:simpleContent>
	</xs:complexType>
	<xs:complexType name="OfficeContactManager">
		<xs:annotation>
			<xs:documentation>
				The member id of  the contact person at the office location,
				when the contact person is not the same as the designated realtor.
				Used primarily in branch locations.
			</xs:documentation>
		</xs:annotation>
		<xs:simpleContent>
			<xs:extension base="commons:SecureString"/>
		</xs:simpleContent>
	</xs:complexType>
	<xs:complexType name="CorporateLicense">
		<xs:annotation>
			<xs:documentation>
				The office's corporate or business license.
			</xs:documentation>
		</xs:annotation>
		<xs:simpleContent>
			<xs:extension base="commons:SecureString"/>
		</xs:simpleContent>
	</xs:complexType>
	<xs:complexType name="NRDSFranchiseId">
		<xs:annotation>
			<xs:documentation>
				Used to indicate the franchise, if any, this office is
				affiliated with. NRDS expects a unique, valid 9 digit office id.
			</xs:documentation>
		</xs:annotation>
		<xs:simpleContent>
			<xs:extension base="commons:SecureInteger"/>
		</xs:simpleContent>
	</xs:complexType>
	<xs:complexType name="NRDSParentCompanyId">
		<xs:annotation>
			<xs:documentation>
				Used if this office is affiliated with a parent company.
				NRDS expects a unique, valid 9 digit office id.
			</xs:documentation>
		</xs:annotation>
		<xs:simpleContent>
			<xs:extension base="commons:SecureInteger"/>
		</xs:simpleContent>
	</xs:complexType>
	<xs:complexType name="NRDSMainOfficeId">
		<xs:annotation>
			<xs:documentation>
				If this office is a branch, the Main Office Id must be present.
				NRDS expects a valid, unique 9 digit office id.
			</xs:documentation>
		</xs:annotation>
		<xs:simpleContent>
			<xs:extension base="commons:SecureInteger"/>
		</xs:simpleContent>
	</xs:complexType>
	<xs:complexType name="NRDSBillingOfficeId">
		<xs:annotation>
			<xs:documentation>
				Used to track the office id of the billing office.
				NRDS expects a valid, unique 9 digit office id.
			</xs:documentation>
		</xs:annotation>
		<xs:simpleContent>
			<xs:extension base="commons:SecureInteger"/>
		</xs:simpleContent>
	</xs:complexType>

	<xs:complexType name="Office">
		<xs:sequence>
			<xs:element name="OfficeKey"
							type="commons:resource-key"
							minOccurs="1"
							maxOccurs="1">
				<xs:annotation>
					<xs:documentation>
						This the is the keyfield for the resource.
					</xs:documentation>
				</xs:annotation>				
			</xs:element>
			<xs:element	name="OfficeLevelLabel"
						type="xs:string"
						minOccurs="0">
				<xs:annotation>
					<xs:documentation>
						OfficeLevelLabel is a description of this office within the office hierarchy. 
						This will have a value such as “Main Office”, “Company”, “Franchise”, “Boutique”, “Branch”.
					</xs:documentation>
					<xs:appinfo>
						Main Office
					</xs:appinfo>
				</xs:annotation>
			</xs:element>

			<xs:element	name="SystemOfficeId"
						type="commons:OfficeId"
						minOccurs="0"/>
			<xs:element	name="AssociationOfficeId"
						type="commons:AssociationOfficeId"
						minOccurs="0">
				<xs:annotation>
					<xs:appinfo>
						123456789
					</xs:appinfo>
				</xs:annotation>
			</xs:element>
			<xs:element name="OfficeName"
						type="commons:OfficeName"
						minOccurs="0">
				<xs:annotation>
					<xs:appinfo>
						Grantsville
					</xs:appinfo>
				</xs:annotation>
			</xs:element>
			<xs:element name="BrokerId"
						type="commons:BrokerId"
						minOccurs="0">
				<xs:annotation>
					<xs:appinfo>
						789342
					</xs:appinfo>
				</xs:annotation>
			</xs:element>
			<xs:element name="BrokerName"
						type="commons:BrokerName"
						minOccurs="0">
				<xs:annotation>
					<xs:appinfo>
						Short &amp; Swan Real Estate, Inc.
					</xs:appinfo>
				</xs:annotation>
			</xs:element>
			<xs:element	name="OfficeCorporateName"
							type="offices:OfficeCorporateName"
							minOccurs="0">
				<xs:annotation>
					<xs:appinfo>
						Swan Homefinders
					</xs:appinfo>
				</xs:annotation>
			</xs:element>
			<xs:element	name="NRDSOfficeType"
							type="nrds:OfficeType"
							minOccurs="0">
				<xs:annotation>
					<xs:appinfo>
						Locally defined string for office type
					</xs:appinfo>
				</xs:annotation>
			</xs:element>
			<xs:element	name="NRDSBranchId"
							type="nrds:BranchId"
							minOccurs="0">
				<xs:annotation>
					<xs:appinfo>
						Locally defined string for branch identifier
					</xs:appinfo>
				</xs:annotation>
			</xs:element>
			<xs:element	name="NRDSBranchType"
							type="nrds:OfficeType"
							minOccurs="0">
				<xs:annotation>
					<xs:appinfo>
						Locally defined string for branch type
					</xs:appinfo>
				</xs:annotation>
			</xs:element>
			<xs:element	name="TaxId"
							type="commons:TaxId"
							minOccurs="0">
				<xs:annotation>
					<xs:appinfo>
						RE123456789
					</xs:appinfo>
				</xs:annotation>
			</xs:element>
			<xs:element	name="CorporateLicense"
							type="offices:CorporateLicense"
							minOccurs="0">
				<xs:annotation>
					<xs:appinfo>
						MD123456789
					</xs:appinfo>
				</xs:annotation>
			</xs:element>
			<xs:element	name="OfficeCounty"
							type="commons:SecureString"
							minOccurs="0"/>
			<xs:element	name="ContactManager"
							type="offices:OfficeContactManager"
							minOccurs="0">
				<xs:annotation>
					<xs:appinfo>
						Beverly Smith
					</xs:appinfo>
				</xs:annotation>
			</xs:element>
			<xs:element	name="ContactMethod"
							type="commons:ContactMethod"
							minOccurs="0"/>
			<xs:element	name="NRDSMainOfficeId"
							type="offices:NRDSMainOfficeId"
							minOccurs="0">
				<xs:annotation>
					<xs:appinfo>
						123456789
					</xs:appinfo>
				</xs:annotation>
			</xs:element>
			<xs:element	name="NRDSBillingOfficeId"
							type="offices:NRDSBillingOfficeId"
							minOccurs="0">
				<xs:annotation>
					<xs:appinfo>
						123456789
					</xs:appinfo>
				</xs:annotation>
			</xs:element>
			<xs:element	name="NRDSFranchiseId"
							type="offices:NRDSFranchiseId"
							minOccurs="0">
				<xs:annotation>
					<xs:appinfo>
						123456789
					</xs:appinfo>
				</xs:annotation>
			</xs:element>
			<xs:element	name="NRDSParentCompanyId"
							type="offices:NRDSParentCompanyId"
							minOccurs="0">
				<xs:annotation>
					<xs:appinfo>
						123456789
					</xs:appinfo>
				</xs:annotation>
			</xs:element>
			<xs:element	name="NRDSAssociationId"
							type="nrds:AssociationId"
							minOccurs="0">
				<xs:annotation>
					<xs:appinfo>
						7777
					</xs:appinfo>
				</xs:annotation>
			</xs:element>
			<xs:element	name="NRDSMLSId"
							type="nrds:MLSAssociationId"
							minOccurs="0">
				<xs:annotation>
					<xs:appinfo>
						8888
					</xs:appinfo>
				</xs:annotation>
			</xs:element>
			<xs:element	name="NRDSJoinedDate"
							type="nrds:JoinedDate"
							minOccurs="0">
				<xs:annotation>
					<xs:appinfo>
						2007-03-10T12:00:00-05:00
					</xs:appinfo>
				</xs:annotation>
			</xs:element>
			<xs:element	name="NRDSStatusDate"
							type="nrds:StatusDate"
							minOccurs="0">
				<xs:annotation>
					<xs:appinfo>
						2007-03-10T12:00:00-05:00
					</xs:appinfo>
				</xs:annotation>
			</xs:element>
			<xs:element	name="NRDSStatusCode"
							type="nrds:MemberStatus"
							minOccurs="0">
				<xs:annotation>
					<xs:appinfo>
						A
					</xs:appinfo>
				</xs:annotation>
			</xs:element>
			<xs:element	name="NRDSSalesPersonCount"
							type="nrds:SalesPersonCount"
							minOccurs="0">
				<xs:annotation>
					<xs:appinfo>
						4
					</xs:appinfo>
				</xs:annotation>
			</xs:element>
			<xs:element	name="NRDSPointOfEntry"
							type="nrds:PointOfEntry"
							minOccurs="0">
				<xs:annotation>
					<xs:appinfo>
						123456789
					</xs:appinfo>
				</xs:annotation>
			</xs:element>
			<xs:element	name="Media"
							type="media:MediaType"/>
			<xs:element	name="ModificationTimestamp"
							type="commons:ModificationTimestamp"
							minOccurs="0">
				<xs:annotation>
					<xs:appinfo>
						2007-03-10T12:00:00-05:00
					</xs:appinfo>
				</xs:annotation>
			</xs:element>
			<xs:any		namespace="##other"
							minOccurs="0"
							maxOccurs="unbounded"/>
		</xs:sequence>
		<xs:attribute	name="officeId"
							type="xs:string"
							use="required"/>
	</xs:complexType>
	<xs:complexType name="OfficesType">
		<xs:sequence>
			<xs:element	name="Office" type="offices:Office" minOccurs="0" maxOccurs="unbounded"/>
		</xs:sequence>
		<xs:attribute	ref="xml:lang"
							use="optional"/>
		<xs:attribute	name="versionTimestamp"
							type="xs:dateTime"
							use="required"
							fixed="2007-07-24T08:35:00Z"/>
	</xs:complexType>

	<!-- Elements -->
	<xs:element	name="Offices"
					type="offices:OfficesType"/>
</xs:schema>
