<?xml version="1.0" encoding="UTF-8"?>
<xs:schema	xmlns:xs="http://www.w3.org/2001/XMLSchema"
				xmlns:teams="http://rets.org/xsd/Teams/2007-08"
				xmlns:members="http://rets.org/xsd/Members/2007-08"
				xmlns:offices="http://rets.org/xsd/Offices/2007-08"
				xmlns:commons="http://rets.org/xsd/RETSCommons/2007-08"
				targetNamespace="http://rets.org/xsd/Teams/2007-08"
				elementFormDefault="qualified"
				attributeFormDefault="unqualified">

	<!--
		(C)2007 National Association of REALTORS(R)

		Tab stops
		:set ts=3

		File History
		======================
		$Header: Teams.xsd, 21, 10/8/2007 1:22:16 PM, Paul Stusiak$

		$Log:
		 21   055_RETS_Standard 1.20        10/8/2007 1:22:16 PM   Paul Stusiak
		      Update version timestamp
		 20   055_RETS_Standard 1.19        10/2/2007 2:33:11 PM   Gina Accawi
		      Rename ContactMethod to ContactMethods. Add values to the
		      PhoneTypeEnum.
		 19   055_RETS_Standard 1.18        10/2/2007 2:11:09 PM   Gina Accawi
		      Put extension point on element declaration.
		 18   055_RETS_Standard 1.17        10/2/2007 12:19:35 PM  Gina Accawi
		      Create reusable type for systemId. Reference it where used. Ensure
		      there is a systemId on the primary single and optional on plural
		      version of resource payloads.
		 17   055_RETS_Standard 1.16        8/27/2007 8:35:07 AM   Gina Accawi
		      Rename TeamMemberType to TeamMateType as per August RETS meeting.
		 16   055_RETS_Standard 1.15        8/1/2007 10:14:32 AM   Gina Accawi
		      Add website, make repeatable
		 15   055_RETS_Standard 1.14        7/26/2007 9:14:12 PM   Paul Stusiak
		      update version timestamp
		 14   055_RETS_Standard 1.13        7/26/2007 2:48:14 PM   Gina Accawi
		      Attribute name case consistency.
		 13   055_RETS_Standard 1.12        7/26/2007 2:11:21 PM   Gina Accawi
		      Ensure a modification timestamp is present.
		 12   055_RETS_Standard 1.11        7/24/2007 5:09:03 PM   Paul Stusiak
		      add keys to Participant and Person, update the entities to support
		      this, make the files have a common pattern.
		 11   055_RETS_Standard 1.10        7/24/2007 12:56:55 PM  Paul Stusiak
		      move role from team to participant leve
		 10   055_RETS_Standard 1.9         7/24/2007 9:52:52 AM   Gina Accawi
		      Remove ref to ShortOffice. Replace with full Office.
		 9    055_RETS_Standard 1.8         7/9/2007 12:14:02 PM   Paul Stusiak
		      Use TeamRoleEnum instead of TeamRole
		 8    055_RETS_Standard 1.7         7/9/2007 9:55:15 AM    Gina Accawi
		      Use Role enumerated type.
		 7    055_RETS_Standard 1.6         7/9/2007 2:00:57 AM    Paul Stusiak
		      Rework of CR 80 to change the way that Role, Team, Person and Member
		      interact as Participants. Person, Member and Team now take on a Role
		      when acting as a Participant for a Listing (or Transaction)
		 6    055_RETS_Standard 1.5         7/6/2007 1:40:19 PM    Gina Accawi
		      Listing participants now have a role in the listing. Additionally,
		      team members have a team role. 
		 5    055_RETS_Standard 1.4         7/5/2007 2:14:20 PM    Gina Accawi
		      Remove addresses, since now in ContactMethod.
		 4    055_RETS_Standard 1.3         7/2/2007 9:45:35 AM    Gina Accawi
		      Rename ResourceKey to be the actual ResourceNameKey.
		 3    055_RETS_Standard 1.2         6/29/2007 12:34:45 PM  Gina Accawi
		      Add a key for the resource.
		 2    055_RETS_Standard 1.1         6/29/2007 10:06:55 AM  Gina Accawi
		      Modify to have teamRole as an attribute rather than an element.
		 1    055_RETS_Standard 1.0         6/26/2007 1:30:00 PM   Gina Accawi     
		$
		======================
	-->

	<xs:annotation>
		<xs:documentation>
			A team of Persons and Members. A team may exist for the
			life time of a listing or the team may persist beyond a
			given listing or transaction.
		</xs:documentation>
	</xs:annotation>

	<xs:import	namespace="http://www.w3.org/XML/1998/namespace"
					schemaLocation="http://www.w3.org/2001/xml.xsd"/>
	<xs:import	namespace="http://rets.org/xsd/RETSCommons/2007-08"
					schemaLocation="../../../xsd/RETSCommons/2007-08/RETSCommons.xsd"/>
	<xs:import	namespace="http://rets.org/xsd/Members/2007-08"
					schemaLocation="../../../xsd/Members/2007-08/Members.xsd"/>
	<xs:import	namespace="http://rets.org/xsd/Offices/2007-08"
					schemaLocation="../../../xsd/Offices/2007-08/Offices.xsd"/>

	<!-- Types -->
	<xs:complexType name="TeamMateType">
		<xs:annotation>
			<xs:documentation>
				A team member is a Member in a role. This
				role is for the listing and there is a role
				for the Member in a team.

				The team role persists for the life of the
				team.
			</xs:documentation>
		</xs:annotation>
		<xs:sequence>
			<xs:element	name="TeammateKey"
							type="commons:resource-key"
							minOccurs="1"
							maxOccurs="1">
				<xs:annotation>
					<xs:appinfo>
						<retsid>100247</retsid>
					</xs:appinfo>
				</xs:annotation>
			</xs:element>
			<xs:choice>
				<xs:element	name="TeamMember"
								type="members:MemberType"
								minOccurs="1"
								maxOccurs="1">
					<xs:annotation>
						<xs:documentation>
							The teammate information, either a
							person or a member, in a role.
						</xs:documentation>
						<xs:appinfo>
							<retsid>100248</retsid>
						</xs:appinfo>
					</xs:annotation>
				</xs:element>
				<xs:element	name="TeamPerson"
								type="commons:ContactablePerson"
								minOccurs="1"
								maxOccurs="1">
					<xs:annotation>
						<xs:appinfo>
							<retsid>100249</retsid>
						</xs:appinfo>
					</xs:annotation>
				</xs:element>
			</xs:choice>
			<xs:element	name="TeamRole"
							type="commons:TeamRoleEnum"
							minOccurs="1"
							maxOccurs="1">
				<xs:annotation>
					<xs:documentation>
						The role a particular member plays in a team.
						May be different from the role the member 
						plays in a transaction.
					</xs:documentation>
					<xs:appinfo>
						<retsid>100250</retsid>
						<example>Team Photographer</example>
					</xs:appinfo>
				</xs:annotation>
			</xs:element>
			<xs:element	name="ModificationTimestamp"
							type="commons:ModificationTimestamp"
							minOccurs="0"
							maxOccurs="1">
				<xs:annotation>
					<xs:documentation>
						A timestamp for the most recent
						modification of this record.
					</xs:documentation>
					<xs:appinfo>
						<retsid>100251</retsid>
						<example>2007-01-15T11:23:09Z</example>
					</xs:appinfo>
				</xs:annotation>
			</xs:element>
			</xs:sequence>
	</xs:complexType>

	<xs:complexType name="TeamType">
		<xs:sequence>
			<xs:element	name="TeamKey"
							type="commons:resource-key"
							minOccurs="1"
							maxOccurs="1">
				<xs:annotation>
					<xs:documentation>
						Unique identifier for this team.
					</xs:documentation>
					<xs:appinfo>
						<retsid>100252</retsid>
						<example>2343234</example>
					</xs:appinfo>
				</xs:annotation>
			</xs:element>
			<xs:element	name="TeamId"
							type="xs:string"
							minOccurs="0"
							maxOccurs="1">
				<xs:annotation>
					<xs:documentation>
						The local, well-known identifier for the
						team. May be the same as or different
						from the key.
					</xs:documentation>
					<xs:appinfo>
						<retsid>100253</retsid>
						<example>12345890</example>
					</xs:appinfo>
				</xs:annotation>
			</xs:element>
			<xs:element	name="TeamName"
							type="commons:SecureString"
							minOccurs="0"
							maxOccurs="1">
				<xs:annotation>
					<xs:documentation>
						A team may be given a name.
					</xs:documentation>
					<xs:appinfo>
						<retsid>100254</retsid>
						<example>Hammontree Bees</example>
					</xs:appinfo>
				</xs:annotation>
			</xs:element>
			<xs:element	name="TeamMate"
							type="teams:TeamMateType"
							minOccurs="1"
							maxOccurs="unbounded">
				<xs:annotation>
					<xs:appinfo>
						<retsid>100255</retsid>
					</xs:appinfo>
				</xs:annotation>
			</xs:element>
			<xs:element	name="TeamContactMethods"
							type="commons:ContactMethods"
							minOccurs="0"
							maxOccurs="1">
				<xs:annotation>
					<xs:appinfo>
						<retsid>100256</retsid>
					</xs:appinfo>
				</xs:annotation>
			</xs:element>
			<xs:element	name="TeamWebsite"
							type="xs:anyURI"
							minOccurs="0"
							maxOccurs="100">
				<xs:annotation>
					<xs:documentation>
						The website URI for the team.
					</xs:documentation>
					<xs:appinfo>
						<retsid>100257</retsid>
						<example>http://www.hammontreebees.com</example>
					</xs:appinfo>
				</xs:annotation>
			</xs:element> 
			<xs:element	name="TeamOffice"
							type="offices:OfficeType"
							minOccurs="0"
							maxOccurs="1">
				<xs:annotation>
					<xs:appinfo>
						<retsid>100258</retsid>
					</xs:appinfo>
				</xs:annotation>
			</xs:element>
			<xs:element	name="ModificationTimestamp"
							type="commons:ModificationTimestamp"
							minOccurs="1"
							maxOccurs="1">
				<xs:annotation>
					<xs:documentation>
						A timestamp for the most recent
						modification of this record.
					</xs:documentation>
					<xs:appinfo>
						<retsid>100259</retsid>
						<example>2007-01-15T11:23:09Z</example>
					</xs:appinfo>
				</xs:annotation>
			</xs:element>
		</xs:sequence>
		<xs:attribute	ref="xml:lang"
							use="optional">
			<xs:annotation>
				<xs:documentation>
					The preferred locale/language of this person.

					The values are formed using the language tags
					defined in RFC 3066, using the lang code and
					country code from ISO 639 and ISO 3166
					http://www.loc.gov/standards/iso639-2/php/code_list.php
					http://www.iso.org/iso/en/prods-services/iso3166ma/index.html

					This form is <!-- <ISOLangCode>[-<ISOCountryCode>] -->
					(ignore the xml comment tags)

					Note that the separator is the dash '-' and not the
					underscore character.
					
					Valid values include en, en-US and other combinations of
					the code sets.

					If omitted, the lang values is assumed to be en.

					Further note that like the xml:lang attribute, this
					element should be treated as case-insensitive. That is,
					the values en-us, en-US, En-us and any other case
					combination should be treated as identical.
				</xs:documentation>
				<xs:appinfo>
					<example>en-US</example>
					<retsid>100260</retsid>
				</xs:appinfo>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute	name="systemId"
							type="commons:system-id"
							use="required">
			<xs:annotation>
				<xs:documentation>
					An identifier of the system that a team
					'belongs' to when the event involves more than
					one system.
				</xs:documentation>
				<xs:appinfo>
					<retsid>100261</retsid>
				</xs:appinfo>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute	name="versionTimestamp"
							type="xs:dateTime"
							use="required"
							fixed="2007-10-08T16:27:23Z">
			<xs:annotation>
				<xs:documentation>
				</xs:documentation>
				<xs:appinfo>
					<retsid>100319</retsid>
				</xs:appinfo>
			</xs:annotation>
		</xs:attribute>
	</xs:complexType>

	<!-- Elements -->

	<xs:element name="Team">
		<xs:annotation>
			<xs:appinfo>
				<retsid>100263</retsid>
			</xs:appinfo>
		</xs:annotation>
		<xs:complexType>
			<xs:complexContent>
				<xs:extension base="teams:TeamType">
					<xs:sequence>
						<xs:any	namespace="##any"
									processContents="lax"
									minOccurs="0"
									maxOccurs="unbounded"/>
					</xs:sequence>
				</xs:extension>
			</xs:complexContent>
		</xs:complexType>
	</xs:element>	
</xs:schema>