﻿<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="WikiComponents_2D_XML"
    targetNamespace="http://tempuri.org/2D XML.xsd"
    elementFormDefault="qualified"
    xmlns="http://tempuri.org/2D XML.xsd"
    xmlns:mstns="http://tempuri.org/2D XML.xsd"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
>

	<xs:annotation>
		<xs:documentation xml:lang="en">
			WikiComponents 2D XML schema
			Copyright 2009 WikiComponents.com.
		</xs:documentation>
	</xs:annotation>

	<xs:element name="WikiComponents2DNeutralFile">
		<xs:complexType>
			<xs:sequence>
				<xs:element name="Parts" type="PartList" minOccurs="0" maxOccurs="1" />
				<xs:element name="Packages" type="PackageList" minOccurs="0" maxOccurs="1" />
			</xs:sequence>
			<xs:attribute name="version" type="xs:string" />
			<xs:attribute name="units" type="xs:string" fixed="nanometers" />
			<xs:attribute name="date" type="xs:string" />
		</xs:complexType>
	</xs:element>


	<xs:complexType name="PartList">
		<xs:sequence>
			<xs:element name="Part">
				<xs:complexType>
					<xs:sequence>
						<xs:element name="Attrib" type="AttribType" />
						<xs:element name="InternalPartNumber" type="xs:string" />
					</xs:sequence>
					<xs:attribute name="partManufacturer" type="xs:string" use="required" />
					<xs:attribute name="partNumber" type="xs:string" use="required" />
					<xs:attribute name="packageManufacturer" type="xs:string" use="optional" />
					<xs:attribute name="packageName" type="xs:string" use="optional" />
					<xs:attribute name="deviceName" type="xs:string" use="optional" />
				</xs:complexType>
			</xs:element>
		</xs:sequence>
		<xs:attribute name="name" type="xs:string" use="required" />
	</xs:complexType>


	<xs:complexType name="PackageList">
		<xs:sequence>
			<xs:element name="Package">
				<xs:complexType>
					<xs:sequence>
						<xs:element name="BodyDef">
							<xs:complexType>
								<xs:sequence>
									<xs:element name="Poly" type="PolyType" />
								</xs:sequence>
							</xs:complexType>
						</xs:element>
						<xs:element name="PinDef">
							<xs:complexType>
								<xs:sequence>
									<xs:element name="Poly" type="PolyType" />
								</xs:sequence>
							</xs:complexType>
						</xs:element>
						<xs:element name="Pin">
							<xs:complexType>
								<xs:attribute name="name" type="xs:string" use="required" />
								<xs:attribute name="defName" type="xs:string" use="required" />
								<xs:attribute name="x" type="xs:string" use="required" />
								<xs:attribute name="y" type="xs:string" use="required" />
								<xs:attribute name="angle" type="xs:string" use="optional" />
								<xs:attribute name="nulled" type="xs:boolean" use="optional" />
							</xs:complexType>
						</xs:element>
						<xs:element name="Attrib" type="AttribType" />
						<xs:element name="Alias">
							<xs:complexType>
								<xs:attribute name="alias" type="xs:string" use="required" />
							</xs:complexType>
						</xs:element>
					</xs:sequence>
					<xs:attribute name="name" type="xs:string" use="required" />
					<xs:attribute name="manufacturer" type="xs:string" use="required" />
					<xs:attribute name="type" type="xs:string" use="required" />
					<xs:attribute name="pinCount" type="xs:int" use="required" />
				</xs:complexType>
			</xs:element>
		</xs:sequence>
	</xs:complexType>


	<xs:complexType name="AttribType">
		<xs:attribute name="keyword" type="xs:string" use="required" />
		<xs:attribute name="value" type="xs:string" use="required" />
	</xs:complexType>


	<xs:complexType name="PolyType">
		<xs:sequence>
			<xs:element name="Vertex">
				<xs:complexType>
					<xs:attribute name="x" type="xs:int" use="required" />
					<xs:attribute name="y" type="xs:int" use="required" />
					<xs:attribute name="bulge" type="xs:int" use="optional" />
				</xs:complexType>
			</xs:element>
		</xs:sequence>
		<xs:attribute name="class" type="xs:string" use="optional" />
		<xs:attribute name="top" type="xs:int" use="required" />
		<xs:attribute name="bottom" type="xs:int" use="required" />
		<xs:attribute name="closed" type="xs:string" use="optional" />
		<xs:attribute name="shape" type="xs:string" use="optional" />
		<xs:attribute name="centerX" type="xs:int" use="optional" />
		<xs:attribute name="centerY" type="xs:int" use="optional" />
		<xs:attribute name="radius" type="xs:int" use="optional" />
	</xs:complexType>
	
</xs:schema>

