<?xml version="1.0" ?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">

<xsd:annotation>
	<xsd:documentation xml:lang="en">
	Pro/3 Knowledge Output Schema
	Copyright (c) 2005 Holm Nett
	Compatible with Pro/3 version 3.40.
	Last updated 09Jan05.
	</xsd:documentation>
</xsd:annotation>

<!-- pro3Script -->

<xsd:element name="pro3Script" />
<xsd:complexType>
	<xsd:attribute name="version" type="xsd:integer" />
	<xsd:attribute name="release" type="xsd:integer" />
	<xsd:attribute name="build" type="xsd:integer" />
	<xsd:attribute name="createdTime" type="xsd:timeInstant" />
	<xsd:attribute name="author" type="xsd:string" />
	<xsd:attribute name="format" type="formatType" use="xsd:required" /> 
	<xsd:choice>
		<xsd:element name="databaseLocations" type="databaseLocationsType" />
		<xsd:element name="rederivation" type="rederivationType" />
	</xsd:choice>
</xsd:complexType>	

<!-- databaseLocations -->

<xsd:complexType name="databaseLocationsType">
	<xsd:sequence>
		<xsd:element name="mainDatabaseId" type="xsd:string" minOccurs="1" maxOccurs="1" />
		<xsd:element name="externalDatabase" minOccurs="0" maxOccurs="unbounded">
		<xsd:complexType> 
			<xsd:sequence>
				<xsd:element name="externalDatabaseId type="xsd:string" minOccurs="1" maxOccurs="1" />
				<xsd:element name="externalDatabaseFile type="xsd:string" minOccurs="1" maxOccurs="1" />
				<xsd:sequence minOccurs="1" maxOccurs="unbounded">
					<xsd:element name="access" type="accessType" minOccurs="1" maxOccurs="1" />
					<xsd:element name="chain" type="xsd:string /> 
				</xsd:sequence>
				</xsd:complexType>			
			</xsd:sequence>
		</xsd:complexType>
	</xsd:sequence>
</xsd:complexType>

<!-- rederivation -->

<xsd:complexType name="rederivationType">
	<xsd:element name="externalDatabaseFile type="xsd:string" minOccurs="2" maxOccurs="unbounded" />
</xsd:complexType>

<!-- BASIC TYPES -->

<xsd:simpleType name="accessType">
<xsd:restriction base="xsd:token">
	<xsd:enumeration value="READ" />
	<xsd:enumeration value="WRITE" />
</xsd:restriction>
</xsd:simpleType>	

<xsd:simpleType name="formatType">
<xsd:restriction base="xsd:token">
	<xsd:enumeration value="PR" />
	<xsd:enumeration value="NL" />
</xsd:restriction>
</xsd:simpleType>	

</xsd:schema>