<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
	<xs:element name="dat">
		<xs:complexType>
			<xs:sequence>
				<xs:element name="configuration">
					<xs:complexType>
						<xs:all>
							<xs:element name="datName" type="xs:string"/>
							<xs:element name="imFolder" type="xs:string" minOccurs="0"/>
							<xs:element name="datVersion" type="xs:integer"/>
							<xs:element name="system" type="xs:string"/>
							<xs:element name="screenshotsWidth" type="xs:short" minOccurs="0"/>
							<xs:element name="screenshotsHeight" type="xs:short" minOccurs="0"/>
							<xs:element name="infos">
								<xs:complexType>
									<xs:all>
										<xs:element name="title" minOccurs="0">
											<xs:complexType>
												<xs:attribute name="visible" type="xs:boolean" use="required"/>
												<xs:attribute name="inNamingOption" type="xs:boolean" use="required"/>
												<xs:attribute name="default" type="xs:boolean" use="required"/>
											</xs:complexType>
										</xs:element>
										<xs:element name="location" minOccurs="0">
											<xs:complexType>
												<xs:attribute name="visible" type="xs:boolean" use="required"/>
												<xs:attribute name="inNamingOption" type="xs:boolean" use="required"/>
												<xs:attribute name="default" type="xs:boolean" use="required"/>
											</xs:complexType>
										</xs:element>
										<xs:element name="publisher" minOccurs="0">
											<xs:complexType>
												<xs:attribute name="visible" type="xs:boolean" use="required"/>
												<xs:attribute name="inNamingOption" type="xs:boolean" use="required"/>
												<xs:attribute name="default" type="xs:boolean" use="required"/>
											</xs:complexType>
										</xs:element>
										<xs:element name="sourceRom" minOccurs="0">
											<xs:complexType>
												<xs:attribute name="visible" type="xs:boolean" use="required"/>
												<xs:attribute name="inNamingOption" type="xs:boolean" use="required"/>
												<xs:attribute name="default" type="xs:boolean" use="required"/>
											</xs:complexType>
										</xs:element>
										<xs:element name="saveType" minOccurs="0">
											<xs:complexType>
												<xs:attribute name="visible" type="xs:boolean" use="required"/>
												<xs:attribute name="inNamingOption" type="xs:boolean" use="required"/>
												<xs:attribute name="default" type="xs:boolean" use="required"/>
											</xs:complexType>
										</xs:element>
										<xs:element name="romSize" minOccurs="0">
											<xs:complexType>
												<xs:attribute name="visible" type="xs:boolean" use="required"/>
												<xs:attribute name="inNamingOption" type="xs:boolean" use="required"/>
												<xs:attribute name="default" type="xs:boolean" use="required"/>
											</xs:complexType>
										</xs:element>
										<xs:element name="releaseNumber" minOccurs="0">
											<xs:complexType>
												<xs:attribute name="visible" type="xs:boolean" use="required"/>
												<xs:attribute name="inNamingOption" type="xs:boolean" use="required"/>
												<xs:attribute name="default" type="xs:boolean" use="required"/>
											</xs:complexType>
										</xs:element>
										<xs:element name="imageNumber" minOccurs="0">
											<xs:complexType>
												<xs:attribute name="visible" type="xs:boolean" use="required"/>
												<xs:attribute name="inNamingOption" type="xs:boolean" use="required"/>
												<xs:attribute name="default" type="xs:boolean" use="required"/>
											</xs:complexType>
										</xs:element>
										<xs:element name="languageNumber" minOccurs="0">
											<xs:complexType>
												<xs:attribute name="visible" type="xs:boolean" use="required"/>
												<xs:attribute name="inNamingOption" type="xs:boolean" use="required"/>
												<xs:attribute name="default" type="xs:boolean" use="required"/>
											</xs:complexType>
										</xs:element>
										<xs:element name="comment" minOccurs="0">
											<xs:complexType>
												<xs:attribute name="visible" type="xs:boolean" use="required"/>
												<xs:attribute name="inNamingOption" type="xs:boolean" use="required"/>
												<xs:attribute name="default" type="xs:boolean" use="required"/>
											</xs:complexType>
										</xs:element>
										<xs:element name="romCRC" minOccurs="0">
											<xs:complexType>
												<xs:attribute name="visible" type="xs:boolean" use="required"/>
												<xs:attribute name="inNamingOption" type="xs:boolean" use="required"/>
												<xs:attribute name="default" type="xs:boolean" use="required"/>
											</xs:complexType>
										</xs:element>
										<xs:element name="im1CRC" minOccurs="0">
											<xs:complexType>
												<xs:attribute name="visible" type="xs:boolean" use="required"/>
												<xs:attribute name="inNamingOption" type="xs:boolean" use="required"/>
												<xs:attribute name="default" type="xs:boolean" use="required"/>
											</xs:complexType>
										</xs:element>
										<xs:element name="im2CRC" minOccurs="0">
											<xs:complexType>
												<xs:attribute name="visible" type="xs:boolean" use="required"/>
												<xs:attribute name="inNamingOption" type="xs:boolean" use="required"/>
												<xs:attribute name="default" type="xs:boolean" use="required"/>
											</xs:complexType>
										</xs:element>
										<xs:element name="languages" minOccurs="0">
											<xs:complexType>
												<xs:attribute name="visible" type="xs:boolean" use="required"/>
												<xs:attribute name="inNamingOption" type="xs:boolean" use="required"/>
												<xs:attribute name="default" type="xs:boolean" use="required"/>
											</xs:complexType>
										</xs:element>
									</xs:all>
								</xs:complexType>
							</xs:element>
							<xs:element name="canOpen">
								<xs:complexType>
									<xs:sequence>
										<xs:element name="extension" maxOccurs="unbounded"/>
									</xs:sequence>
								</xs:complexType>
							</xs:element>
							<xs:element name="search">
								<xs:complexType>
									<xs:choice>
										<xs:element name="to" minOccurs="0" maxOccurs="unbounded">
											<xs:complexType>
												<xs:choice>
													<xs:element name="find" minOccurs="0" maxOccurs="unbounded">
														<xs:complexType>
															<xs:simpleContent>
																<xs:extension base="xs:string">
																	<xs:attribute name="operation" use="required">
																		<xs:simpleType>
																			<xs:restriction base="xs:string">
																				<xs:enumeration value="="/>
																				<xs:enumeration value="&lt;"/>
																				<xs:enumeration value="&lt;="/>
																				<xs:enumeration value="&gt;"/>
																				<xs:enumeration value="&gt;="/>
																				<xs:enumeration value="&lt;&gt;"/>
																				<xs:enumeration value="in"/>
																				<xs:enumeration value="inNoCase"/>
																				<xs:enumeration value="equals"/>
																				<xs:enumeration value="equalsNoCase"/>
																			</xs:restriction>
																		</xs:simpleType>
																	</xs:attribute>
																	<xs:attribute name="value" type="xs:string" use="required"/>
																</xs:extension>
															</xs:simpleContent>
														</xs:complexType>
													</xs:element>
												</xs:choice>
												<xs:attribute name="value" type="xs:string" use="required"/>
												<xs:attribute name="default" type="xs:boolean" use="required"/>
												<xs:attribute name="auto" type="xs:boolean" use="required"/>
											</xs:complexType>
										</xs:element>
									</xs:choice>
								</xs:complexType>
							</xs:element>
							<xs:element name="newDat">
								<xs:complexType>
									<xs:sequence>
										<xs:element name="datVersionURL" type="xs:anyURI"/>
										<xs:element name="datURL">
											<xs:complexType>
												<xs:simpleContent>
													<xs:extension base="xs:string">
														<xs:attribute name="fileName" type="xs:string" use="required"/>
													</xs:extension>
												</xs:simpleContent>
											</xs:complexType>
										</xs:element>
										<xs:element name="imURL" type="xs:anyURI"/>
									</xs:sequence>
								</xs:complexType>
							</xs:element>
							<xs:element name="romTitle" type="xs:string"/>
						</xs:all>
					</xs:complexType>
				</xs:element>
				<xs:element name="games">
					<xs:complexType>
						<xs:sequence>
							<xs:element name="game" maxOccurs="unbounded">
								<xs:complexType>
									<xs:all>
										<xs:element name="imageNumber" type="xs:integer"/>
										<xs:element name="releaseNumber" type="xs:integer" minOccurs="0"/>
										<xs:element name="title" type="xs:string"/>
										<xs:element name="saveType" type="xs:string" minOccurs="0"/>
										<xs:element name="romSize" type="xs:int" minOccurs="0"/>
										<xs:element name="publisher" type="xs:string" minOccurs="0"/>
										<xs:element name="location" type="xs:byte" minOccurs="0"/>
										<xs:element name="sourceRom" type="xs:string" minOccurs="0"/>
										<xs:element name="language" type="xs:integer" minOccurs="0"/>
										<xs:element name="files">
											<xs:complexType>
												<xs:sequence>
													<xs:element name="romCRC">
														<xs:complexType>
															<xs:simpleContent>
																<xs:extension base="xs:hexBinary">
																	<xs:attribute name="extension" type="xs:string" use="required"/>
																</xs:extension>
															</xs:simpleContent>
														</xs:complexType>
													</xs:element>
												</xs:sequence>
											</xs:complexType>
										</xs:element>
										<xs:element name="im1CRC" type="xs:string"/>
										<xs:element name="im2CRC" type="xs:string"/>
										<xs:element name="comment" type="xs:string"/>
										<xs:element name="duplicateID" type="xs:integer" minOccurs="0"/>
									</xs:all>
								</xs:complexType>
							</xs:element>
						</xs:sequence>
					</xs:complexType>
				</xs:element>
				<xs:element name="gui" minOccurs="0">
					<xs:complexType>
						<xs:sequence>
							<xs:element name="images" minOccurs="0">
								<xs:complexType>
									<xs:sequence>
										<xs:element name="orientation" type="xs:string" minOccurs="0"/>
										<xs:element name="image" minOccurs="2" maxOccurs="2">
											<xs:complexType>
												<xs:attribute name="x" type="xs:integer" use="required"/>
												<xs:attribute name="y" type="xs:integer" use="required"/>
												<xs:attribute name="width" type="xs:integer" use="required"/>
												<xs:attribute name="height" type="xs:integer" use="required"/>
											</xs:complexType>
										</xs:element>
									</xs:sequence>
									<xs:attribute name="width" type="xs:integer" use="required"/>
									<xs:attribute name="height" type="xs:integer" use="required"/>
								</xs:complexType>
							</xs:element>
						</xs:sequence>
					</xs:complexType>
				</xs:element>
			</xs:sequence>
		</xs:complexType>
	</xs:element>
</xs:schema>
