<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">

	<xs:annotation>
		<xs:documentation>
			Schema for Syndication Response Reporting data. This represents the smallest
			feature-complete set of data for reporting status of provider listings.
		</xs:documentation>
	</xs:annotation>

	<xs:complexType name="Payload_Report">
		<xs:annotation>
			<xs:documentation>
				Reports processing results for listings contained in a specific feed
				"payload" -- that is, a specific feed file delivered under a specific
				payload number.
			</xs:documentation>
		</xs:annotation>					
		<xs:sequence>
			<xs:element name="File_Name" type="xs:string" minOccurs="0" maxOccurs="1"/>
				<xs:annotation>
					<xs:documentation>
						Unique file name for the feed being reported (some
						sites may deliver multiple feeds).	

						Example: "feedfile_1.xml"
					</xs:documentation>
				</xs:annotation>
			<xs:element name="Payload_Number" type="xs:string" minOccurs="1" maxOccurs="1">
				<xs:annotation>
					<xs:documentation>
						Unique, use-once serial number "token" generated and
						enclosed by provider in the specific feed delivery for
						which these results are reported.

						Example: "000345"
					</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="Notice_to_Providers" type="xs:string" minOccurs="0" maxOccurs="unbounded">
				<xs:annotation>
					<xs:documentation>
						Any significant notice to providers (announcements of change of
						procedure, etc.); preferably a brief recap with a URL to retrieve
						full details.

						Example: "See new fields added to schema at
						http://www.bigsite.com/schemas/current_schema.html"
					</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="Date_Uploaded" type="xs:string" minOccurs="0" maxOccurs="1"/>
			<xs:element name="Date_Processed" type="xs:string" minOccurs="0" maxOccurs="1"/>
			<xs:element name="Document_Failure" type="xs:string" minOccurs="0" maxOccurs="1">
				<xs:annotation>
					<xs:documentation>
						Needs to explain cause of file upload or processing failure
						(perhaps numerical codes with explanations): 
						01	dld	4xx error while downloading feed
						02	fmt	unrecognized format
						03	esc	unescaped characters
						04	xml	not a well-formed xml file
						99	oth	other cause not specified -- contact support
					</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="Listings_Imported" type="xs:integer" minOccurs="0" maxOccurs="1"/>
			<xs:element name="Listings_Processed" type="xs:integer" minOccurs="0" maxOccurs="1"/>
			<xs:element name="Listings_Succeeded" type="xs:integer" minOccurs="0" maxOccurs="1"/>
			<xs:element name="Listings_Failed" type="xs:integer" minOccurs="0" maxOccurs="1"/>
			<xs:element name="Listings_Attributed" type="xs:integer" minOccurs="0" maxOccurs="1"/>
				<xs:annotation>
					<xs:documentation>
						Gross total of all listings currently active which have
						ever been delivered by this provider, whether or not
						trumped by other providers.
					</xs:documentation>
				</xs:annotation>					
			<xs:element name="Listing_Status" minOccurs="0" maxOccurs="unbounded">
				<xs:complexType>
					<xs:sequence>
						<xs:element name="Business_Listing_ID" type="xs:string" minOccurs="0" maxOccurs="1"/>
						<xs:element name="Provider_Listing_ID" type="xs:string" minOccurs="0" maxOccurs="1"/>
						<xs:element name="Import_Status_Message" minOccurs="0" maxOccurs="1">
							<xs:annotation>
								<xs:documentation>
									Provides all expressions of listing and image
									status. Only a failed listing is supplemented
									with an explanatory failure code.

									The maximum possible number of numeric codes
									may not exceed 255.
								</xs:documentation>
							</xs:annotation>					
							<xs:complexType>
								<xs:sequence>
									<xs:element name="Listing_Status" type="xs:string" minOccurs="1" maxOccurs="1">
										<xs:annotation>
											<xs:documentation>
												Needs to define processing results for listing text (perhaps numeric codes with explanations): 
												000	d	delivered	Listing delivered to destination
												005	f	failed	Listing failed to post -- Reason Code gives details
												010	s	success	Listing text successfully posted
												020	t	trumped	Listing trumped by prior posting of others
											</xs:documentation>
										</xs:annotation>					
									</xs:element>
									<xs:element name="Image_Status" type="xs:string" minOccurs="0" maxOccurs="1">
										<xs:annotation>
											<xs:documentation>
												Needs to define status for main listing image (perhaps numeric codes with explanations): 
												050	l	no_image_loc	No images deliverable to this location
												060	n	no_image_stat	No image status report available
												070	x	no_image_xfer	No image transfer required
												075	u	no_image_url	No image url provided
												080	p	pending_image	Image fetch pending
												085	m	missing_image	Image missing (assume fetch failed)
												090	i	found_image	Image found
											</xs:documentation>
										</xs:annotation>					
									</xs:element>
									<xs:element name="Failure_Reason" type="xs:string" minOccurs="0" maxOccurs="1">
										<xs:annotation>
											<xs:documentation>
												Needs to enumerate alternative listing failure (005) causes (perhaps numeric codes with explanations): 
												100	ne	no_error	No error reported
												102	mp	missing_price	Price missing or wrong format
												103	up	unlikely_price	Unlikely price
												105	ps	property_status	Listing sales status missing or in error
												107	ar	agency_ref	Agency property reference (MLS or other) missing or in error
												109	vt	virtual_tour	Virtual tour info missing or not found
												111	nf	num_floors	Number of floors missing or format error
												112	fa	floor_area	Floor area measurement missing or format error
												114	la	land_area	Land area measurement missing or format error
												116	bb	beds_baths	Number of bedrooms or bathrooms missing or format error
												117	rr	recep_rooms	Number of reception rooms missing or wrong format
												119	tr	total_rooms	Total number of rooms missing or wrong format
												131	sa	street_addr	Street address missing or in error
												132	cs	cross_street	Cross street missing or in error
												133	di	district	District or neighborhood info missing or in error
												134	cy	city	City name missing or in error
												135	sp	state_prov	State or province name missing or in error
												136	pc	postal_code	Postal code missing or in error
												137	cc	country_code	ISO country code missing or in error
												139	gm	geo_match	No geo-map location matched on physical address provided
												141	bi	broker_id	Broker id missing
												142	bn	broker_name	Broker name missing
												143	ba	broker_addr	Broker office address missing
												144	be	broker_email	Broker email address missing
												145	bf	broker_fone	Broker telephone number missing
												147	ma	mktg_assoc	Marketing association membership ID (MLS or other) missing or in error
												148	bl	broker_license	Broker license number missing
												149	bw	broker_url	Broker website url missing or invalid
												151	ai	agent_id	Agent or auctioneer ID missing
												152	an	agent_name	Agent or auctioneer name missing
												154	ae	agent_email	Agent or auctioneer email address missing
												155	af	agent_fone	Agent or auctioneer telephone number missing
												158	al	agent_license	Agent or auctioneer license number missing
												159	aw	agent_url	Agent or auctioneer website url missing or invalid
												162	cn	contact_name	Contact name missing
												164	ce	contact_email	Contact email missing
												165	cf	contact_fone	Contact telephone number missing
												171	cr	cap_rate	Capitalization rate missing or format error
												173	lt	lease_terms	Lease terms missing or in error
												175	fc	foreclosure	Foreclosure info missing or in error
												176	au	auction	Auction info missing or in error
												181	lp	landing_page	Landing page url missing or invalid
												183	cp	caption	Caption (headline) missing
												184	de	description	Description missing

												185	dt	dirty_text	"Dirty" (unescaped) characters in caption, description, or other text
												186	ac	all_caps	Excessive use of upper-case phrases in text
												187	sd	status_date	Status date missing or wrong format
												188	ed	expire_date	Expire date missing or wrong format
												189	ld	listing_date	Listing date missing or wrong format
												193	lg	language	ISO language code missing or in error
												194	cu	currency	ISO currency code missing or in error
												195	um	unit_measure	Unit of measure missing or not supported at this location
												197	rc	rental_code	Rental code missing or in error
												201	tt	trans_type	Transaction type (sale, rent, or lease) missing or in error
												205	li	listing_id	Provider listing id missing or duplicate
												207	pt	property_type	Listing type missing or in error
												209	px	property_exclude	Listing type excluded at this location
												211	tx	trans_exclude	Transaction type (sale, rent, or lease) excluded at this location
												212	gc	geo_coord	Geographic coordinates error
												213	gx	geo_exclude	Geographically excluded at this location
												214	ni	num_images	Number of images exceeds allowed maximum
												229	uf	unk_field	Unknown field in listing record
												255	ue	unknown	Unknown or unspecified error -- contact support for assistance

												In the event multiple conditions fail a listing, report the highest-numbered reason (the one most serious).
											</xs:documentation>
										</xs:annotation>
									</xs:element>
								</xs:sequence>
							</xs:complexType>
						</xs:element>
						<xs:element name="Business_Listing_URL" type="xs:anyURI" minOccurs="1" maxOccurs="1"/>
						<xs:element name="Cumulative_Views" type="xs:integer" minOccurs="0" maxOccurs="1">
							<xs:annotation>
								<xs:documentation>
									Number of times this listing was locally presented for review along with others being reviewed.
								</xs:documentation>
							</xs:annotation>					
						</xs:element>
						<xs:element name="Cumulative_Hits" type="xs:integer" minOccurs="0" maxOccurs="1">
							<xs:annotation>
								<xs:documentation>
									Number of times locally available details were requested for this listing.
								</xs:documentation>
							</xs:annotation>					
						</xs:element>
						<xs:element name="Cumulative_Contacts" type="xs:integer" minOccurs="0" maxOccurs="1">
							<xs:annotation>
								<xs:documentation>
									Number of times a local contact action for more information was recorded for this listing.
								</xs:documentation>
							</xs:annotation>					
						</xs:element>
					</xs:sequence>
				</xs:complexType>
			</xs:element>
		</xs:sequence>
	</xs:complexType>

</xs:schema>
