<?xml version="1.0" encoding="utf-8" ?>
<xs:schema targetNamespace="http://ar.masstech-pts.org/PTS-AR" 
xmlns="http://ar.masstech-pts.org/PTS-AR" 
xmlns:tns="http://ar.masstech-pts.org/PTS-AR" 
xmlns:xs="http://www.w3.org/2001/XMLSchema" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:noNamespaceSchemaLocation="http://ar.masstech-pts.org/PTS-AR.xsd" 
attributeFormDefault="qualified" elementFormDefault="qualified">
	<xs:element name="ARData">
		<xs:annotation>
			<xs:documentation>
            This schema is in support of the MTC's PTS (http://www.masstech-pts.org). 
            Some basics before you begin. The schema is laid out to be sequence specific. There are choices 
            to be made as to whether or not interval data will be provided. From there you are required to provide
            certain other supporting information while some supporting data is optional. Realize that providing
            certain optional data may mean other supporting data becomes required (ie; conditionally required).             
        </xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:sequence>
				<xs:element name="ptsSystem" maxOccurs="unbounded"> <!--Required-->
					<xs:complexType>
						<xs:annotation>
							<xs:documentation>
                            This is the node for providing monthly production data on a particular system. 
                            Note the attributes of sysID and sysType are required. So are the elements 
                            kwhRegistry and regDateTime. The regDateTime is of the format 2003-08-23T10:24:00 
                            or YYYY-MM-DDTHH:MM:SS. This is based on a subset of XML and that format 
                            can be extended with timezone information but we require at least full date 
                            and time to the second. The serviceCostInDollars is optional since there is a
                            default value associated in the PTS for each system. Any monthly change 
                            should be included and the reported value will overwrite the default. The field
                            kwhRegistry is a value that comprises a current snapshot of the meter kWh reading 
                            at the time referenced by regDateTime.
                        </xs:documentation>
						</xs:annotation>
						<xs:sequence>
							<xs:element name="sysID" type="xs:string" /> <!--Required-->
							<xs:element name="MonthlyData" minOccurs="1" maxOccurs="1"> <!--Required-->
								<xs:complexType>
									<xs:choice>
										<xs:annotation>
											<xs:documentation>
        		                            Based on the type of system referenced in this node, you will need to follow the
    		                                group definitions below for what system type specific monthly production data
		                                    needs to be added in to this node.
                                            </xs:documentation>
										</xs:annotation>
										<xs:element name="PVmonthlyData" maxOccurs="1" type="pvSpecificMonthlyData" /> <!--Conditionally Required-->
										<xs:element name="FCmonthlyData" maxOccurs="1" type="fcSpecificMonthlyData" /> <!--Conditionally Required-->
										<xs:element name="STmonthlyData" maxOccurs="1" type="stSpecificMonthlyData" /> <!--Conditionally Required-->
										<xs:element name="BMmonthlyData" maxOccurs="1" type="bmSpecificMonthlyData" /> <!--Conditionally Required-->
										<xs:element name="HEmonthlyData" maxOccurs="1" type="heSpecificMonthlyData" /> <!--Conditionally Required-->
										<xs:element name="LFmonthlyData" maxOccurs="1" type="lfSpecificMonthlyData" /> <!--Conditionally Required-->
										<xs:element name="WEmonthlyData" maxOccurs="1" type="weSpecificMonthlyData" /> <!--Conditionally Required-->
										<xs:element name="OEmonthlyData" maxOccurs="1" type="oeSpecificMonthlyData" /> <!--Conditionally Required-->
									</xs:choice>
								</xs:complexType>
							</xs:element>
							<xs:element name="intervalData" minOccurs="0" maxOccurs="1"> <!--Optional-->
								<xs:complexType>
									<xs:choice>
										<xs:annotation>
											<xs:documentation>
                                            Based on the type of system referenced in the parent node, you will need 
                                            to follow the group definitions below for what system type specific 
                                            interval production data needs to be added in to this node. Any of these 
                                            element choices are extensions of the base type entryType.
                                            </xs:documentation>
										</xs:annotation>
										<xs:element name="PVdata" maxOccurs="unbounded" type="PVType" /> <!--Conditionally Required-->
										<xs:element name="FCdata" maxOccurs="unbounded" type="FCType" /> <!--Conditionally Required-->
										<xs:element name="STdata" maxOccurs="unbounded" type="STType" /> <!--Conditionally Required-->
										<xs:element name="BMdata" maxOccurs="unbounded" type="BMType" /> <!--Conditionally Required-->
										<xs:element name="HEdata" maxOccurs="unbounded" type="HEType" /> <!--Conditionally Required-->
										<xs:element name="LFdata" maxOccurs="unbounded" type="LFType" /> <!--Conditionally Required-->
										<xs:element name="WEdata" maxOccurs="unbounded" type="WEType" /> <!--Conditionally Required-->
										<xs:element name="OEdata" maxOccurs="unbounded" type="OEType" /> <!--Conditionally Required-->
									</xs:choice>
								</xs:complexType>
							</xs:element>
						</xs:sequence>
						<xs:attribute name="sysType" form="unqualified" type="xs:string" use="required" /> <!--Required-->
					</xs:complexType>
				</xs:element>
			</xs:sequence>
		</xs:complexType>
	</xs:element>
	<!-- ================================== Base Types ===================================-->
	<xs:complexType name="entryType">
		<xs:sequence>
			<xs:annotation>
				<xs:documentation>
                This is the base named type for all systems interval data. All fields are required except 
                for system efficiency and average temperature. The field intervalRegistry is a value that 
                comprises a current snapshot of the meter kWh reading at the time referenced by entryDateTime.
                The field entryDateTime takes the same format (and restrictions) as above. The field kwAcOutput 
                is *NOT* the average kW being produced over the time from current interval -1 through 
                current interval. Note that for certain types of systems there is other data being collected. See
                The documentation below for those. System efficiency is in the units fraction of 1 (percentage). 
                </xs:documentation>
			</xs:annotation>
			<xs:element name="kwAcOutput" type="xs:decimal" />  <!--Conditionally Required-->
			<xs:element name="entryDateTime" type="xs:dateTime" /> <!--Conditionally Required-->
			<xs:element name="intervalKwhRegistry" type="xs:decimal" minOccurs="0" /> <!--Conditionally Required-->
			<xs:element name="sysEff" type="xs:decimal" minOccurs="0" /> <!--Optional-->
			<xs:element name="avgTempInF" type="xs:decimal" minOccurs="0" /> <!--Optional-->
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="monthlyType">
		<xs:sequence>
			<xs:annotation>
				<xs:documentation>
                This is the base named type for all systems interval data. All fields are required except 
                for system efficiency and average temperature. The field intervalRegistry is a value that 
                comprises a current snapshot of the meter kWh reading at the time referenced by entryDateTime.
                The field entryDateTime takes the same format (and restrictions) as above. The field kwAcOutput 
                is *NOT* the average kW being produced over the time from current interval -1 through 
                current interval. Note that for certain types of systems there is other data being collected. See
                The documentation below for those.
                </xs:documentation>
			</xs:annotation>
			<xs:element name="kwhRegistry" type="xs:decimal" /> <!--Required-->
			<xs:element name="regDateTime" type="xs:dateTime" /> <!-- Required-->
			<xs:element name="serviceCostsInDollars" type="xs:decimal" minOccurs="0" /> <!--Optional-->
		</xs:sequence>
	</xs:complexType>
	<!-- ================================== PV Extensions ===================================-->
	<xs:complexType name="pvSpecificMonthlyData"> <!-- Extends monthlyType -->
		<xs:complexContent>
			<xs:extension base="tns:monthlyType">
				<xs:sequence>
					<xs:annotation>
						<xs:documentation>
            		    This is the named group for all PV systems for their monthly data. There is currently
						only an empty element attached to this for the purposes of validating. Please ignore 
						that and do not include the element emptyElement in your XML.
						</xs:documentation>
					</xs:annotation>
					<xs:element name="emptyElement" minOccurs="0" /> <!-- This is to get validation of the PV systems -->
				</xs:sequence>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	<xs:complexType name="PVType"> <!-- Extends entryType -->
		<xs:complexContent>
			<xs:extension base="tns:entryType">
				<xs:sequence>
					<xs:annotation>
						<xs:documentation>
                        These four elements extend the base entryType class to handle Photo Voltaic data. The 
                        fields are optional. Note that the current inclination and azimuth fields are only 
                        available from tracking PV. Average Irradiance is in Watts / Meter squared. 
                        Inclination and Azimuth is in degrees.
                        </xs:documentation>
					</xs:annotation>
					<xs:element name="avgIrradiance" type="xs:decimal" minOccurs="0" /> <!--Optional-->
					<xs:element name="avgWindSpeedInMPH" type="xs:decimal" minOccurs="0" /> <!--Optional-->
					<xs:element name="CurrentInclination" type="xs:decimal" minOccurs="0" /> <!--Optional-->
					<xs:element name="CurrentAzimuth" type="xs:decimal" minOccurs="0" /> <!--Optional-->
				</xs:sequence>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	<!-- ================================== Fuel Cell Extensions ===================================-->
	<xs:complexType name="fcSpecificMonthlyData"> <!-- Extends monthlyType -->
		<xs:complexContent>
			<xs:extension base="tns:monthlyType">
				<xs:sequence>
					<xs:annotation>
						<xs:documentation>
						This is the named group for all fuel cell systems for their monthly data. All fields 
						are required and the field operatingHours needs to be a positive integer. The remaing 
						are decimal format. Need units for cost and consumption.
						</xs:documentation>
					</xs:annotation>
					<xs:element name="operatingHours" type="xs:decimal" /> <!--Required-->
					<xs:element name="fuelConsumption" type="xs:decimal" /> <!--Required-->
					<xs:element name="fuelCostPerTherm" type="xs:decimal" /> <!--Required-->
				</xs:sequence>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	<xs:complexType name="FCType"> <!-- Extends entryType -->
		<xs:complexContent>
			<xs:extension base="tns:entryType">
				<xs:sequence>
					<xs:annotation>
						<xs:documentation>
                        These elements extend the base entryType class to handle Fuel Cell data. The fields 
                        are optional.
                        </xs:documentation>
					</xs:annotation>
					<xs:element name="TotalHeatProd" type="xs:decimal" minOccurs="0" /> <!--Optional-->
				</xs:sequence>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	<!-- ================================== Solar Thermal Electric Extensions ===================================-->
	<xs:complexType name="stSpecificMonthlyData"> <!-- Extends monthlyType -->
		<xs:complexContent>
			<xs:extension base="tns:monthlyType">
				<xs:sequence>
					<xs:annotation>
						<xs:documentation>
            		    This is the named group for all Solar Thermal Electric systems for their monthly data. There is currently
						only an empty element attached to this for the purposes of validating. Please ignore 
						that and do not include the element emptyElement in your XML.
						</xs:documentation>
					</xs:annotation>
					<xs:element name="emptyElement" minOccurs="0" /> <!-- This is to get validation of the PV systems -->
				</xs:sequence>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	<xs:complexType name="STType"> <!-- Extends entryType -->
		<xs:complexContent>
			<xs:extension base="tns:entryType">
				<xs:sequence>
					<xs:annotation>
						<xs:documentation>
            		    This is the named group for all Solar Thermal Electric systems for their interval data. There is currently
						only an empty element attached to this for the purposes of validating. Please ignore 
						that and do not include the element emptyElement in your XML.
                        </xs:documentation>
					</xs:annotation>
					<xs:element name="emptyElement" minOccurs="0" /> <!-- This is to get validation of the PV systems -->
				</xs:sequence>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	<!-- ================================== Advanced Biomass Power Conversion Extensions ===================================-->
	<xs:complexType name="bmSpecificMonthlyData"> <!-- Extends monthlyType -->
		<xs:complexContent>
			<xs:extension base="tns:monthlyType">
				<xs:sequence>
					<xs:annotation>
						<xs:documentation>
            		    This is the named group for all Advanced Biomass Power Conversion systems for their monthly data. There is currently
						only an empty element attached to this for the purposes of validating. Please ignore 
						that and do not include the element emptyElement in your XML.
						</xs:documentation>
					</xs:annotation>
					<xs:element name="emptyElement" minOccurs="0" /> <!-- This is to get validation of the PV systems -->
				</xs:sequence>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	<xs:complexType name="BMType"> <!-- Extends entryType -->
		<xs:complexContent>
			<xs:extension base="tns:entryType">
				<xs:sequence>
					<xs:annotation>
						<xs:documentation>
            		    This is the named group for all Advanced Biomass systems for their interval data. There is currently
						only an empty element attached to this for the purposes of validating. Please ignore 
						that and do not include the element emptyElement in your XML.
                        </xs:documentation>
					</xs:annotation>
					<xs:element name="emptyElement" minOccurs="0" /> <!-- This is to get validation of the PV systems -->
				</xs:sequence>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	<!-- ================================== Hydroelectric Extensions ===================================-->
	<xs:complexType name="heSpecificMonthlyData"> <!-- Extends monthlyType -->
		<xs:complexContent>
			<xs:extension base="tns:monthlyType">
				<xs:sequence>
					<xs:annotation>
						<xs:documentation>
            		    This is the named group for all Hydro Electric systems for their monthly data. There is currently
						only an empty element attached to this for the purposes of validating. Please ignore 
						that and do not include the element emptyElement in your XML.
						</xs:documentation>
					</xs:annotation>
					<xs:element name="emptyElement" minOccurs="0" /> <!-- This is to get validation of the PV systems -->
				</xs:sequence>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	<xs:complexType name="HEType"> <!-- Extends entryType -->
		<xs:complexContent>
			<xs:extension base="tns:entryType">
				<xs:sequence>
					<xs:annotation>
						<xs:documentation>
            		    This is the named group for all Hydro Electric systems for their interval data. There is currently
						only an empty element attached to this for the purposes of validating. Please ignore 
						that and do not include the element emptyElement in your XML.
                        </xs:documentation>
					</xs:annotation>
					<xs:element name="emptyElement" minOccurs="0" /> <!-- This is to get validation of the PV systems -->
				</xs:sequence>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	<!-- ================================== Landfill Gas Extensions ===================================-->
	<xs:complexType name="lfSpecificMonthlyData"> <!-- Extends monthlyType -->
		<xs:complexContent>
			<xs:extension base="tns:monthlyType">
				<xs:sequence>
					<xs:annotation>
						<xs:documentation>
            		    This is the named group for all Landfill Gas systems for their monthly data. There is currently
						only an empty element attached to this for the purposes of validating. Please ignore 
						that and do not include the element emptyElement in your XML.
						</xs:documentation>
					</xs:annotation>
					<xs:element name="emptyElement" minOccurs="0" /> <!-- This is to get validation of the PV systems -->
				</xs:sequence>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	<xs:complexType name="LFType"> <!-- Extends entryType -->
		<xs:complexContent>
			<xs:extension base="tns:entryType">
				<xs:sequence>
					<xs:annotation>
						<xs:documentation>
            		    This is the named group for all Landfill Gas systems for their interval data. There is currently
						only an empty element attached to this for the purposes of validating. Please ignore 
						that and do not include the element emptyElement in your XML.
                        </xs:documentation>
					</xs:annotation>
					<xs:element name="emptyElement" minOccurs="0" /> <!-- This is to get validation of the PV systems -->
				</xs:sequence>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	<!-- ================================== Wind Energy Extensions ===================================-->
	<xs:complexType name="weSpecificMonthlyData"> <!-- Extends monthlyType -->
		<xs:complexContent>
			<xs:extension base="tns:monthlyType">
				<xs:sequence>
					<xs:annotation>
						<xs:documentation>
            		    This is the named group for all Wind Energy systems for their monthly data. There is currently
						only an empty element attached to this for the purposes of validating. Please ignore 
						that and do not include the element emptyElement in your XML.
						</xs:documentation>
					</xs:annotation>
					<xs:element name="emptyElement" minOccurs="0" /> <!-- This is to get validation of the PV systems -->
				</xs:sequence>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	<xs:complexType name="WEType"> <!-- Extends entryType -->
		<xs:complexContent>
			<xs:extension base="tns:entryType">
				<xs:sequence>
					<xs:annotation>
						<xs:documentation>
            		    This is the named group for all Wind Energy systems for their interval data. There is currently
						only an empty element attached to this for the purposes of validating. Please ignore 
						that and do not include the element emptyElement in your XML.
                        </xs:documentation>
					</xs:annotation>
					<xs:element name="emptyElement" minOccurs="0" /> <!-- This is to get validation of the PV systems -->
				</xs:sequence>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	<!-- ================================== Ocean Thermal, Wave or Tidal Energy Extensions ===================================-->
	<xs:complexType name="oeSpecificMonthlyData"> <!-- Extends monthlyType -->
		<xs:complexContent>
			<xs:extension base="tns:monthlyType">
				<xs:sequence>
					<xs:annotation>
						<xs:documentation>
            		    This is the named group for all Ocean Thermal, Wave or Tidal Energy systems for their monthly data. There is currently
						only an empty element attached to this for the purposes of validating. Please ignore 
						that and do not include the element emptyElement in your XML.
						</xs:documentation>
					</xs:annotation>
					<xs:element name="emptyElement" minOccurs="0" /> <!-- This is to get validation of the PV systems -->
				</xs:sequence>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	<xs:complexType name="OEType"> <!-- Extends entryType -->
		<xs:complexContent>
			<xs:extension base="tns:entryType">
				<xs:sequence>
					<xs:annotation>
						<xs:documentation>
            		    This is the named group for all Ocean Thermal, Wave or Tidal Energy systems for their interval data. There is currently
						only an empty element attached to this for the purposes of validating. Please ignore 
						that and do not include the element emptyElement in your XML.
                        </xs:documentation>
					</xs:annotation>
					<xs:element name="emptyElement" minOccurs="0" /> <!-- This is to get validation of the PV systems -->
				</xs:sequence>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
</xs:schema>