<?xml version="1.0" encoding="UTF-8"?>

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            targetNamespace="http://electric.sun.com/Technology"
            xmlns:tns="http://electric.sun.com/Technology"
            elementFormDefault="qualified">

    <xsd:simpleType name="ColorComponent">
        <xsd:restriction base="xsd:unsignedByte"/>
    </xsd:simpleType>

    <xsd:group name="Color">
        <xsd:sequence>
            <xsd:element name="r" type="tns:ColorComponent"></xsd:element>
            <xsd:element name="g" type="tns:ColorComponent"></xsd:element>
            <xsd:element name="b" type="tns:ColorComponent"></xsd:element>
        </xsd:sequence>
    </xsd:group>

    <xsd:group name="Distance">
        <xsd:sequence>
            <xsd:element name="rule" minOccurs="0" maxOccurs="unbounded">
                <xsd:complexType>
                    <xsd:attribute name="ruleName" type="tns:RuleName" use="required"/>
                    <xsd:attribute name="layer" type="tns:LayerName"/>
                    <xsd:attribute name="layer2" type="tns:LayerName"/>
                    <xsd:attribute name="k" type="xsd:double"/>
                </xsd:complexType>
            </xsd:element>
            <xsd:element name="lambda" type="xsd:double" minOccurs="0"></xsd:element>
        </xsd:sequence>
    </xsd:group>

    <xsd:group name="LayerToDouble">
        <xsd:sequence>
            <xsd:element name="layer" minOccurs="0" maxOccurs="unbounded">
                <xsd:complexType>
                    <xsd:attribute name="name" type="tns:LayerName" use="required"/>
                    <xsd:attribute name="value" type="xsd:double"/>
                </xsd:complexType>
            </xsd:element>
        </xsd:sequence>
    </xsd:group>

    <xsd:group name="LayerToDistance">
        <xsd:sequence>
            <xsd:element name="layer" minOccurs="0" maxOccurs="unbounded">
                <xsd:complexType>
                   <xsd:group ref="tns:Distance"/>
                   <xsd:attribute name="name" type="tns:LayerName" use="required"/>
                </xsd:complexType>
            </xsd:element>
        </xsd:sequence>
    </xsd:group>

    <xsd:group name="MenuItem">
        <xsd:sequence>
            <xsd:choice>
                <xsd:element name="menuArc" type="tns:ArcProtoName"></xsd:element>
                <xsd:element name="menuNode" type="tns:PrimitiveNodeName"></xsd:element>
                <xsd:element name="menuText" type="xsd:string"></xsd:element>
                <xsd:element name="menuNodeInst">
                    <xsd:complexType>
                        <xsd:sequence>
                            <xsd:element name="menuNodeText" minOccurs="0">
                                <xsd:complexType>
                                    <xsd:attribute name="text" type="xsd:string" use="required"/>
                                    <xsd:attribute name="size" type="xsd:double" use="required"/>
                                </xsd:complexType>
                            </xsd:element>
                        </xsd:sequence>
                        <xsd:attribute name="protoName" type="tns:PrimitiveNodeName" use="required"/>
                        <xsd:attribute name="function" type="tns:PrimitiveNodeFun" use="required"/>
                        <xsd:attribute name="rotation" type="xsd:integer"/>
                    </xsd:complexType>
                </xsd:element>
                <xsd:element name="menuCell">
                    <xsd:complexType>
                        <xsd:attribute name="cellName" type="tns:CellName" use="required"/>
                    </xsd:complexType>
                </xsd:element>
            </xsd:choice>
        </xsd:sequence>
    </xsd:group>

    <xsd:complexType name="ColorRGB">
        <xsd:attribute name="r" type="tns:ColorComponent" use="required"/>
        <xsd:attribute name="g" type="tns:ColorComponent" use="required"/>
        <xsd:attribute name="b" type="tns:ColorComponent" use="required"/>
    </xsd:complexType>

    <xsd:simpleType name="ClassName">
        <xsd:restriction base="xsd:NCName"/>
    </xsd:simpleType>

    <xsd:simpleType name="TechVersion">
        <xsd:restriction base="xsd:int"/>
    </xsd:simpleType>

    <xsd:simpleType name="NumMetals">
        <xsd:restriction base="xsd:int">
            <xsd:minInclusive value="0"/>
            <xsd:maxInclusive value="12"/>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="Foundry">
        <xsd:restriction base="xsd:string">
            <xsd:enumeration value="NONE"/>
            <xsd:enumeration value="MOSIS"/>
            <xsd:enumeration value="TSMC"/>
            <xsd:enumeration value="ST"/>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="TransparentLayer">
        <xsd:restriction base="xsd:positiveInteger">
            <xsd:maxInclusive value="12"/>
            <xsd:whiteSpace value="collapse"/>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="LayerName">
        <xsd:restriction base="xsd:NCName"/>
    </xsd:simpleType>

    <xsd:simpleType name="LayerFun">
        <xsd:restriction base="xsd:string">
            <xsd:enumeration value="UNKNOWN"/>
            <xsd:enumeration value="METAL1"/>
            <xsd:enumeration value="METAL2"/>
            <xsd:enumeration value="METAL3"/>
            <xsd:enumeration value="METAL4"/>
            <xsd:enumeration value="METAL5"/>
            <xsd:enumeration value="METAL6"/>
            <xsd:enumeration value="METAL7"/>
            <xsd:enumeration value="METAL8"/>
            <xsd:enumeration value="METAL9"/>
            <xsd:enumeration value="METAL10"/>
            <xsd:enumeration value="METAL11"/>
            <xsd:enumeration value="METAL12"/>
            <xsd:enumeration value="POLY1"/>
            <xsd:enumeration value="POLY2"/>
            <xsd:enumeration value="POLY3"/>
            <xsd:enumeration value="GATE"/>
            <xsd:enumeration value="DIFF"/>
            <xsd:enumeration value="DIFFP"/>
            <xsd:enumeration value="DIFFN"/>
            <xsd:enumeration value="IMPLANT"/>
            <xsd:enumeration value="IMPLANTP"/>
            <xsd:enumeration value="IMPLANTN"/>
            <xsd:enumeration value="CONTACT1"/>
            <xsd:enumeration value="CONTACT2"/>
            <xsd:enumeration value="CONTACT3"/>
            <xsd:enumeration value="CONTACT4"/>
            <xsd:enumeration value="CONTACT5"/>
            <xsd:enumeration value="CONTACT6"/>
            <xsd:enumeration value="CONTACT7"/>
            <xsd:enumeration value="CONTACT8"/>
            <xsd:enumeration value="CONTACT9"/>
            <xsd:enumeration value="CONTACT10"/>
            <xsd:enumeration value="CONTACT11"/>
            <xsd:enumeration value="CONTACT12"/>
            <xsd:enumeration value="PLUG"/>
            <xsd:enumeration value="OVERGLASS"/>
            <xsd:enumeration value="RESISTOR"/>
            <xsd:enumeration value="CAP"/>
            <xsd:enumeration value="TRANSISTOR"/>
            <xsd:enumeration value="EMITTER"/>
            <xsd:enumeration value="BASE"/>
            <xsd:enumeration value="COLLECTOR"/>
            <xsd:enumeration value="SUBSTRATE"/>
            <xsd:enumeration value="WELL"/>
            <xsd:enumeration value="WELLP"/>
            <xsd:enumeration value="WELLN"/>
            <xsd:enumeration value="GUARD"/>
            <xsd:enumeration value="ISOLATION"/>
            <xsd:enumeration value="BUS"/>
            <xsd:enumeration value="ART"/>
            <xsd:enumeration value="CONTROL"/>
            <xsd:enumeration value="TILENOT"/>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="LayerExtraFun">
        <xsd:restriction base="xsd:string">
            <xsd:enumeration value="nonelectrical"/>
            <xsd:enumeration value="connects-metal"/>
            <xsd:enumeration value="connects-poly"/>
            <xsd:enumeration value="connects-diff"/>
            <xsd:enumeration value="heavy"/>
            <xsd:enumeration value="light"/>
            <xsd:enumeration value="depletion_heavy"/>
            <xsd:enumeration value="depletion_light"/>
            <xsd:enumeration value="enhancement_heavy"/>
            <xsd:enumeration value="enhancement_light"/>
            <xsd:enumeration value="vt"/>
            <xsd:enumeration value="thick"/>
            <xsd:enumeration value="native"/>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="LayerOutline">
        <xsd:restriction base="xsd:string">
            <xsd:enumeration value="NOPAT"/>
            <xsd:enumeration value="PAT_S"/>
            <xsd:enumeration value="PAT_T1"/>
            <xsd:enumeration value="PAT_T2"/>
            <xsd:enumeration value="PAT_DO1"/>
            <xsd:enumeration value="PAT_DO2"/>
            <xsd:enumeration value="PAT_DA1"/>
            <xsd:enumeration value="PAT_DA2"/>
            <xsd:enumeration value="PAT_DD1"/>
            <xsd:enumeration value="PAT_DD2"/>
            <xsd:enumeration value="PAT_DO1_T1"/>
            <xsd:enumeration value="PAT_DO2_T1"/>
            <xsd:enumeration value="PAT_DA1_T1"/>
            <xsd:enumeration value="PAT_DO1_T2"/>
            <xsd:enumeration value="PAT_DO2_T2"/>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="Opacity">
        <xsd:restriction base="xsd:double">
            <xsd:minInclusive value="0"/>
            <xsd:maxInclusive value="1"/>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="ArcProtoName">
        <xsd:restriction base="xsd:NCName"/>
    </xsd:simpleType>

    <xsd:simpleType name="ArcProtoFun">
        <xsd:restriction base="xsd:string">
            <xsd:enumeration value="UNKNOWN"/>
            <xsd:enumeration value="METAL1"/>
            <xsd:enumeration value="METAL2"/>
            <xsd:enumeration value="METAL3"/>
            <xsd:enumeration value="METAL4"/>
            <xsd:enumeration value="METAL5"/>
            <xsd:enumeration value="METAL6"/>
            <xsd:enumeration value="METAL7"/>
            <xsd:enumeration value="METAL8"/>
            <xsd:enumeration value="METAL9"/>
            <xsd:enumeration value="METAL10"/>
            <xsd:enumeration value="METAL11"/>
            <xsd:enumeration value="METAL12"/>
            <xsd:enumeration value="POLY1"/>
            <xsd:enumeration value="POLY2"/>
            <xsd:enumeration value="POLY3"/>
            <xsd:enumeration value="DIFF"/>
            <xsd:enumeration value="DIFFP"/>
            <xsd:enumeration value="DIFFN"/>
            <xsd:enumeration value="DIFFS"/>
            <xsd:enumeration value="DIFFW"/>
            <xsd:enumeration value="BUS"/>
            <xsd:enumeration value="UNROUTED"/>
            <xsd:enumeration value="NONELEC"/>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="ArcLayerStyle">
        <xsd:restriction base="xsd:string">
            <xsd:enumeration value="FILLED"/>
            <xsd:enumeration value="CLOSED"/>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="PrimitiveNodeName">
        <xsd:restriction base="xsd:NCName"/>
    </xsd:simpleType>

    <xsd:simpleType name="CellName">
        <xsd:restriction base="xsd:Name"/>
    </xsd:simpleType>

    <xsd:simpleType name="PrimitiveNodeFun">
        <xsd:restriction base="xsd:string">
            <xsd:enumeration value="UNKNOWN"/>
            <xsd:enumeration value="PIN"/>
            <xsd:enumeration value="CONTACT"/>
            <xsd:enumeration value="NODE"/>
            <xsd:enumeration value="CONNECT"/>
            <xsd:enumeration value="TRANMOS"/>
            <xsd:enumeration value="TRAPMOS"/>
            <xsd:enumeration value="TRADMOS"/>
            <xsd:enumeration value="TRAPMOSD"/>
            <xsd:enumeration value="TRANMOSNT"/>
            <xsd:enumeration value="TRAPMOSNT"/>
            <xsd:enumeration value="TRANMOSFG"/>
            <xsd:enumeration value="TRAPMOSFG"/>
            <xsd:enumeration value="TRANMOSVTL"/>
            <xsd:enumeration value="TRAPMOSVTL"/>
            <xsd:enumeration value="TRANMOSVTH"/>
            <xsd:enumeration value="TRAPMOSVTH"/>
            <xsd:enumeration value="TRANMOSHV1"/>
            <xsd:enumeration value="TRAPMOSHV1"/>
            <xsd:enumeration value="TRANMOSHV2"/>
            <xsd:enumeration value="TRAPMOSHV2"/>
            <xsd:enumeration value="TRANMOSHV3"/>
            <xsd:enumeration value="TRAPMOSHV3"/>
            <xsd:enumeration value="TRANMOSNTHV1"/>
            <xsd:enumeration value="TRAPMOSNTHV1"/>
            <xsd:enumeration value="TRANMOSNTHV2"/>
            <xsd:enumeration value="TRAPMOSNTHV2"/>
            <xsd:enumeration value="TRANMOSNTHV3"/>
            <xsd:enumeration value="TRAPMOSNTHV3"/>
            <xsd:enumeration value="TRANPN"/>
            <xsd:enumeration value="TRAPNP"/>
            <xsd:enumeration value="TRANJFET"/>
            <xsd:enumeration value="TRAPJFET"/>
            <xsd:enumeration value="TRADMES"/>
            <xsd:enumeration value="TRAEMES"/>
            <xsd:enumeration value="TRANSREF"/>
            <xsd:enumeration value="TRANS"/>
            <xsd:enumeration value="TRA4NMOS"/>
            <xsd:enumeration value="TRA4PMOS"/>
            <xsd:enumeration value="TRA4DMOS"/>
            <xsd:enumeration value="TRA4PMOSD"/>
            <xsd:enumeration value="TRA4NMOSNT"/>
            <xsd:enumeration value="TRA4PMOSNT"/>
            <xsd:enumeration value="TRA4NMOSFG"/>
            <xsd:enumeration value="TRA4PMOSFG"/>
            <xsd:enumeration value="TRA4NMOSVTL"/>
            <xsd:enumeration value="TRA4PMOSVTL"/>
            <xsd:enumeration value="TRA4NMOSVTH"/>
            <xsd:enumeration value="TRA4PMOSVTH"/>
            <xsd:enumeration value="TRA4NMOSHV1"/>
            <xsd:enumeration value="TRA4PMOSHV1"/>
            <xsd:enumeration value="TRA4NMOSHV2"/>
            <xsd:enumeration value="TRA4PMOSHV2"/>
            <xsd:enumeration value="TRA4NMOSHV3"/>
            <xsd:enumeration value="TRA4PMOSHV3"/>
            <xsd:enumeration value="TRA4NMOSNTHV1"/>
            <xsd:enumeration value="TRA4PMOSNTHV1"/>
            <xsd:enumeration value="TRA4NMOSNTHV2"/>
            <xsd:enumeration value="TRA4PMOSNTHV2"/>
            <xsd:enumeration value="TRA4NMOSNTHV3"/>
            <xsd:enumeration value="TRA4PMOSNTHV3"/>
            <xsd:enumeration value="TRA4NPN"/>
            <xsd:enumeration value="TRA4PNP"/>
            <xsd:enumeration value="TRA4NJFET"/>
            <xsd:enumeration value="TRA4PJFET"/>
            <xsd:enumeration value="TRA4DMES"/>
            <xsd:enumeration value="TRA4EMES"/>
            <xsd:enumeration value="TRANS4"/>
            <xsd:enumeration value="RESIST"/>
            <xsd:enumeration value="PRESIST"/>
            <xsd:enumeration value="WRESIST"/>
            <xsd:enumeration value="ESDDEVICE"/>
            <xsd:enumeration value="CAPAC"/>
            <xsd:enumeration value="ECAPAC"/>
            <xsd:enumeration value="DIODE"/>
            <xsd:enumeration value="DIODEZ"/>
            <xsd:enumeration value="INDUCT"/>
            <xsd:enumeration value="METER"/>
            <xsd:enumeration value="BASE"/>
            <xsd:enumeration value="EMIT"/>
            <xsd:enumeration value="COLLECT"/>
            <xsd:enumeration value="BUFFER"/>
            <xsd:enumeration value="GATEAND"/>
            <xsd:enumeration value="GATEOR"/>
            <xsd:enumeration value="GATEXOR"/>
            <xsd:enumeration value="FLIPFLOPRSMS"/>
            <xsd:enumeration value="FLIPFLOPRSP"/>
            <xsd:enumeration value="FLIPFLOPRSN"/>
            <xsd:enumeration value="FLIPFLOPJKMS"/>
            <xsd:enumeration value="FLIPFLOPJKP"/>
            <xsd:enumeration value="FLIPFLOPJKN"/>
            <xsd:enumeration value="FLIPFLOPDMS"/>
            <xsd:enumeration value="FLIPFLOPDP"/>
            <xsd:enumeration value="FLIPFLOPDN"/>
            <xsd:enumeration value="FLIPFLOPTMS"/>
            <xsd:enumeration value="FLIPFLOPTP"/>
            <xsd:enumeration value="FLIPFLOPTN"/>
            <xsd:enumeration value="MUX"/>
            <xsd:enumeration value="CONPOWER"/>
            <xsd:enumeration value="CONGROUND"/>
            <xsd:enumeration value="SOURCE"/>
            <xsd:enumeration value="SUBSTRATE"/>
            <xsd:enumeration value="WELL"/>
            <xsd:enumeration value="ART"/>
            <xsd:enumeration value="ARRAY"/>
            <xsd:enumeration value="ALIGN"/>
            <xsd:enumeration value="CCVS"/>
            <xsd:enumeration value="CCCS"/>
            <xsd:enumeration value="VCVS"/>
            <xsd:enumeration value="VCCS"/>
            <xsd:enumeration value="TLINE"/>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="NodeLayerStyle">
        <xsd:restriction base="xsd:string">
            <xsd:enumeration value="FILLED"/>
            <xsd:enumeration value="CLOSED"/>
            <xsd:enumeration value="CROSSED"/>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="PrimitivePortName">
        <xsd:restriction base="xsd:NCName"/>
    </xsd:simpleType>

    <xsd:simpleType name="SpiceLevel">
        <xsd:restriction base="xsd:int">
            <xsd:minInclusive value="1"/>
            <xsd:maxInclusive value="3"/>
            <xsd:whiteSpace value="collapse"/>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="DisplayStyleName">
        <xsd:restriction base="xsd:NCName"/>
    </xsd:simpleType>

    <xsd:simpleType name="RuleName">
        <xsd:restriction base="xsd:string"/>
    </xsd:simpleType>

    <xsd:simpleType name="RuleSetName">
        <xsd:restriction base="xsd:NCName"/>
    </xsd:simpleType>

    <xsd:simpleType name="LayerRuleType">
        <xsd:restriction base="xsd:string">
            <xsd:enumeration value="MINWID"/>
            <xsd:enumeration value="MINWIDCOND"/>
            <xsd:enumeration value="MINAREA"/>
            <xsd:enumeration value="MINENCLOSEDAREA"/>
            <xsd:enumeration value="SURROUND"/>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="LayersRuleType">
        <xsd:restriction base="xsd:string">
            <xsd:enumeration value="CONSPA"/>
            <xsd:enumeration value="UCONSPA"/>
            <xsd:enumeration value="UCONSPA2D"/>
            <xsd:enumeration value="SPACING"/>
            <xsd:enumeration value="SPACINGE"/>
            <xsd:enumeration value="FORBIDDEN"/>
            <xsd:enumeration value="EXTENSION"/>
            <xsd:enumeration value="EXTENSIONGATE"/>
            <xsd:enumeration value="SURROUND"/>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="NodeLayersRuleType">
        <xsd:restriction base="xsd:string">
            <xsd:enumeration value="SURROUND"/>
            <xsd:enumeration value="ASURROUND"/>
            <xsd:enumeration value="UCONSPA2D"/>
            <xsd:enumeration value="SPACING"/>
            <xsd:enumeration value="SPACINGE"/>
            <xsd:enumeration value="FORBIDDEN"/>
            <xsd:enumeration value="EXTENSION"/>
            <xsd:enumeration value="EXTENSIONGATE"/>
            <xsd:enumeration value="SURROUND"/>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="NodeRuleType">
        <xsd:restriction base="xsd:string">
            <xsd:enumeration value="NODSIZ"/>
            <xsd:enumeration value="FORBIDDEN"/>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="DesignRuleWhen">
        <xsd:restriction base="xsd:string"/>
    </xsd:simpleType>

    <xsd:simpleType name="DesignRuleCondition">
        <xsd:restriction base="xsd:string"/>
    </xsd:simpleType>

    <xsd:complexType name="TechPoint">
        <xsd:attribute name="xm" type="xsd:double" use="required"/>
        <xsd:attribute name="xa" type="xsd:double" use="required"/>
        <xsd:attribute name="ym" type="xsd:double" use="required"/>
        <xsd:attribute name="ya" type="xsd:double" use="required"/>
    </xsd:complexType>

    <xsd:element name="technology">
        <xsd:complexType>
            <xsd:sequence>
                <xsd:element name="shortName" type="xsd:string" minOccurs="0"/>
                <xsd:element name="description" type="xsd:string"/>
                <xsd:element name="numMetals">
                    <xsd:complexType>
                        <xsd:attribute name="min" type="tns:NumMetals" use="required"/>
                        <xsd:attribute name="max" type="tns:NumMetals" use="required"/>
                        <xsd:attribute name="default" type="tns:NumMetals" use="required"/>
                    </xsd:complexType>
                </xsd:element>
                <xsd:element name="scale">
                    <xsd:complexType>
                        <xsd:attribute name="value" type="xsd:double" use="required"/>
                        <xsd:attribute name="relevant" type="xsd:boolean" use="required"/>
                    </xsd:complexType>
                </xsd:element>
                <xsd:element name="defaultFoundry">
                    <xsd:complexType>
                        <xsd:attribute name="value" type="tns:Foundry" use="required"/>
                    </xsd:complexType>
                </xsd:element>
                <xsd:element name="minResistance">
                    <xsd:complexType>
                        <xsd:attribute name="value" type="xsd:double" use="required"/>
                    </xsd:complexType>
                </xsd:element>
                <xsd:element name="minCapacitance">
                    <xsd:complexType>
                        <xsd:attribute name="value" type="xsd:double" use="required"/>
                    </xsd:complexType>
                </xsd:element>
                <xsd:element name="layer" maxOccurs="unbounded" minOccurs="0">
                    <xsd:complexType>
                        <xsd:sequence>
                            <xsd:element name="cifLayer" minOccurs="0">
                                <xsd:complexType>
                                    <xsd:attribute name="cif" type="xsd:string" use="required"/>
                                </xsd:complexType>
                            </xsd:element>
                            <xsd:element name="skillLayer" minOccurs="0">
                                <xsd:complexType>
                                    <xsd:attribute name="skill" type="xsd:string" use="required"/>
                                </xsd:complexType>
                            </xsd:element>
                            <xsd:element name="parasitics" minOccurs="0">
                                <xsd:complexType>
                                    <xsd:attribute name="resistance" type="xsd:double" use="required"/>
                                    <xsd:attribute name="capacitance" type="xsd:double" use="required"/>
                                    <xsd:attribute name="edgeCapacitance" type="xsd:double" use="required"/>
                                </xsd:complexType>
                            </xsd:element>
                            <xsd:element name="pureLayerNode" minOccurs="0">
                                <xsd:complexType>
                                    <xsd:sequence>
                                        <xsd:element name="oldName" type="xsd:string" minOccurs="0"></xsd:element>
                                        <xsd:element name="portArc" type="tns:ArcProtoName" minOccurs="0" maxOccurs="unbounded"></xsd:element>
                                    </xsd:sequence>
                                    <xsd:attribute name="name" type="tns:PrimitiveNodeName" use="required"/>
                                    <xsd:attribute name="style" type="tns:NodeLayerStyle"/>
                                    <xsd:attribute name="port" type="tns:PrimitivePortName" use="required"/>
                                </xsd:complexType>
                            </xsd:element>
                        </xsd:sequence>
                        <xsd:attribute name="name" type="tns:LayerName" use="required"/>
                        <xsd:attribute name="fun" type="tns:LayerFun" use="required"/>
                        <xsd:attribute name="extraFun" type="tns:LayerExtraFun"/>
                    </xsd:complexType>
                </xsd:element>
                <xsd:element name="arcProto" minOccurs="0" maxOccurs="unbounded">
                    <xsd:complexType>
                        <xsd:sequence>
                            <xsd:element name="oldName" type="xsd:string" minOccurs="0"></xsd:element>
                            <xsd:element name="wipable" minOccurs="0"> <xsd:complexType/> </xsd:element>
                            <xsd:element name="curvable" minOccurs="0"> <xsd:complexType/> </xsd:element>
                            <xsd:element name="special" minOccurs="0"> <xsd:complexType/> </xsd:element>
                            <xsd:element name="notUsed" minOccurs="0"> <xsd:complexType/> </xsd:element>
                            <xsd:element name="skipSizeInPalette" minOccurs="0"> <xsd:complexType/> </xsd:element>
                            <xsd:element name="extended" type="xsd:boolean"/>
                            <xsd:element name="fixedAngle" type="xsd:boolean"/>
                            <xsd:element name="angleIncrement" type="xsd:integer"/>
                            <xsd:element name="antennaRatio" minOccurs="0" type="xsd:double"/>
                            <xsd:element name="elibWidthOffset" minOccurs="0" type="xsd:double"/>
                            <xsd:element name="arcLayer" maxOccurs="unbounded">
                                <xsd:complexType>
                                    <xsd:group ref="tns:Distance"/>
                                    <xsd:attribute name="layer" type="tns:LayerName" use="required"/>
                                    <xsd:attribute name="style" type="tns:ArcLayerStyle" use="required"/>
                                </xsd:complexType>
                            </xsd:element>
                            <xsd:element name="arcPin" minOccurs="0">
                                <xsd:complexType>
                                    <xsd:sequence>
                                        <xsd:element name="portArc" type="tns:ArcProtoName" minOccurs="0" maxOccurs="unbounded"></xsd:element>
                                    </xsd:sequence>
                                    <xsd:attribute name="name" type="tns:PrimitiveNodeName" use="required"/>
                                    <xsd:attribute name="port" type="tns:PrimitivePortName" use="required"/>
                                    <xsd:attribute name="elibSize" type="xsd:double" use="required"/>
                                </xsd:complexType>
                            </xsd:element>
                        </xsd:sequence>
                        <xsd:attribute name="name" type="tns:ArcProtoName" use="required"/>
                        <xsd:attribute name="fun" type="tns:ArcProtoFun" use="required"/>
                    </xsd:complexType>
                </xsd:element>
                <xsd:element name="primitiveNode" minOccurs="0" maxOccurs="unbounded">
                    <xsd:complexType>
                        <xsd:sequence>
                            <xsd:element name="oldName" type="xsd:string" minOccurs="0"></xsd:element>
                            <xsd:element name="shrinkArcs" minOccurs="0"/>
                            <xsd:element name="square" minOccurs="0"/>
                            <xsd:element name="canBeZeroSize" minOccurs="0"/>
                            <xsd:element name="wipes" minOccurs="0"/>
                            <xsd:element name="lockable" minOccurs="0"/>
                            <xsd:element name="edgeSelect" minOccurs="0"/>
                            <xsd:element name="skipSizeInPalette" minOccurs="0"/>
                            <xsd:element name="notUsed" minOccurs="0"/>
                            <xsd:element name="lowVt" minOccurs="0"/>
                            <xsd:element name="highVt" minOccurs="0"/>
                            <xsd:element name="nativeBit" minOccurs="0"/>
                            <xsd:element name="od18" minOccurs="0"/>
                            <xsd:element name="od25" minOccurs="0"/>
                            <xsd:element name="od33" minOccurs="0"/>
                            <xsd:element name="diskOffset" minOccurs="0">
                                <xsd:complexType>
                                    <xsd:attribute name="x" type="xsd:double" use="required"/>
                                    <xsd:attribute name="y" type="xsd:double" use="required"/>
                                </xsd:complexType>
                            </xsd:element>
                            <xsd:element name="defaultWidth" minOccurs="0">
                                <xsd:complexType>
                                    <xsd:sequence>
                                        <xsd:group ref="tns:Distance"/>
                                    </xsd:sequence>
                                </xsd:complexType>
                            </xsd:element>
                            <xsd:element name="defaultHeight" minOccurs="0">
                                <xsd:complexType>
                                    <xsd:sequence>
                                        <xsd:group ref="tns:Distance"/>
                                    </xsd:sequence>
                                </xsd:complexType>
                            </xsd:element>
                            <xsd:element name="nodeBase" minOccurs="0">
                                <xsd:complexType>
                                    <xsd:attribute name="lx" type="xsd:double" use="required"/>
                                    <xsd:attribute name="hx" type="xsd:double" use="required"/>
                                    <xsd:attribute name="ly" type="xsd:double" use="required"/>
                                    <xsd:attribute name="hy" type="xsd:double" use="required"/>
                                </xsd:complexType>
                            </xsd:element>
                            <xsd:element name="nodeLayer" maxOccurs="unbounded">
                                <xsd:complexType>
                                    <xsd:sequence>
                                        <xsd:choice>
                                            <xsd:element name="box">
                                                <xsd:complexType>
                                                    <xsd:sequence>
                                                        <xsd:element name="lambdaBox" minOccurs="0">
                                                            <xsd:complexType>
                                                                <xsd:attribute name="klx" type="xsd:double" use="required"/>
                                                                <xsd:attribute name="khx" type="xsd:double" use="required"/>
                                                                <xsd:attribute name="kly" type="xsd:double" use="required"/>
                                                                <xsd:attribute name="khy" type="xsd:double" use="required"/>
                                                            </xsd:complexType>
                                                        </xsd:element>
                                                    </xsd:sequence>
                                                    <xsd:attribute name="klx" type="xsd:double"/>
                                                    <xsd:attribute name="khx" type="xsd:double"/>
                                                    <xsd:attribute name="kly" type="xsd:double"/>
                                                    <xsd:attribute name="khy" type="xsd:double"/>
                                                </xsd:complexType>
                                            </xsd:element>
                                            <xsd:element name="points">
                                                <xsd:complexType></xsd:complexType>
                                            </xsd:element>
                                            <xsd:element name="multicutbox">
                                                <xsd:complexType>
                                                    <xsd:sequence>
                                                        <xsd:element name="lambdaBox" minOccurs="0">
                                                            <xsd:complexType>
                                                                <xsd:attribute name="klx" type="xsd:double" use="required"/>
                                                                <xsd:attribute name="khx" type="xsd:double" use="required"/>
                                                                <xsd:attribute name="kly" type="xsd:double" use="required"/>
                                                                <xsd:attribute name="khy" type="xsd:double" use="required"/>
                                                            </xsd:complexType>
                                                        </xsd:element>
                                                    </xsd:sequence>
                                                    <xsd:attribute name="klx" type="xsd:double"/>
                                                    <xsd:attribute name="khx" type="xsd:double"/>
                                                    <xsd:attribute name="kly" type="xsd:double"/>
                                                    <xsd:attribute name="khy" type="xsd:double"/>
                                                    <xsd:attribute name="sizeRule" type="tns:RuleName" use="required"/>
                                                    <xsd:attribute name="sepRule" type="tns:RuleName" use="required"/>
                                                    <xsd:attribute name="sepRule2D" type="tns:RuleName"/>
                                                </xsd:complexType>
                                            </xsd:element>
                                            <xsd:element name="serpbox">
                                                <xsd:complexType>
                                                    <xsd:sequence>
                                                        <xsd:element name="lambdaBox" minOccurs="0">
                                                            <xsd:complexType>
                                                                <xsd:attribute name="klx" type="xsd:double" use="required"/>
                                                                <xsd:attribute name="khx" type="xsd:double" use="required"/>
                                                                <xsd:attribute name="kly" type="xsd:double" use="required"/>
                                                                <xsd:attribute name="khy" type="xsd:double" use="required"/>
                                                            </xsd:complexType>
                                                        </xsd:element>
                                                    </xsd:sequence>
                                                    <xsd:attribute name="klx" type="xsd:double"/>
                                                    <xsd:attribute name="khx" type="xsd:double"/>
                                                    <xsd:attribute name="kly" type="xsd:double"/>
                                                    <xsd:attribute name="khy" type="xsd:double"/>
                                                    <xsd:attribute name="lWidth" type="xsd:double" use="required"/>
                                                    <xsd:attribute name="rWidth" type="xsd:double" use="required"/>
                                                    <xsd:attribute name="tExtent" type="xsd:double" use="required"/>
                                                    <xsd:attribute name="bExtent" type="xsd:double" use="required"/>
                                                </xsd:complexType>
                                            </xsd:element>
                                        </xsd:choice>
                                        <xsd:element name="techPoint" minOccurs="0" maxOccurs="unbounded" type="tns:TechPoint"></xsd:element>
                                    </xsd:sequence>
                                    <xsd:attribute name="layer" type="tns:LayerName" use="required"/>
                                    <xsd:attribute name="style" type="tns:NodeLayerStyle" use="required"/>
                                    <xsd:attribute name="portNum" type="xsd:integer"/>
                                    <xsd:attribute name="electrical" type="xsd:boolean"/>
                                </xsd:complexType>
                            </xsd:element>
                            <xsd:element name="primitivePort" minOccurs="0" maxOccurs="unbounded">
                                <xsd:complexType>
                                    <xsd:sequence>
                                        <xsd:element name="portAngle">
                                            <xsd:complexType>
                                                <xsd:attribute name="primary" type="xsd:int" use="required"/>
                                                <xsd:attribute name="range" type="xsd:int" use="required"/>
                                            </xsd:complexType>
                                        </xsd:element>
                                        <xsd:element name="portTopology" type="xsd:integer"></xsd:element>
                                        <xsd:element name="box">
                                            <xsd:complexType>
                                                <xsd:sequence>
                                                    <xsd:element name="lambdaBox" minOccurs="0">
                                                        <xsd:complexType>
                                                            <xsd:attribute name="klx" type="xsd:double" use="required"/>
                                                            <xsd:attribute name="khx" type="xsd:double" use="required"/>
                                                            <xsd:attribute name="kly" type="xsd:double" use="required"/>
                                                            <xsd:attribute name="khy" type="xsd:double" use="required"/>
                                                        </xsd:complexType>
                                                    </xsd:element>
                                                </xsd:sequence>
                                                <xsd:attribute name="klx" type="xsd:double"/>
                                                <xsd:attribute name="khx" type="xsd:double"/>
                                                <xsd:attribute name="kly" type="xsd:double"/>
                                                <xsd:attribute name="khy" type="xsd:double"/>
                                            </xsd:complexType>
                                        </xsd:element>
                                        <xsd:element name="portArc" type="tns:ArcProtoName" minOccurs="0" maxOccurs="unbounded"></xsd:element>
                                    </xsd:sequence>
                                    <xsd:attribute name="name" type="xsd:NCName" use="required"/>
                                </xsd:complexType>
                            </xsd:element>
                            <xsd:choice minOccurs="0">
                                <xsd:element name="serpTrans">
                                    <xsd:complexType>
                                        <xsd:sequence>
                                            <xsd:element name="specialValue" type="xsd:double" maxOccurs="6" minOccurs="6"></xsd:element>
                                        </xsd:sequence>
                                    </xsd:complexType>
                                </xsd:element>
                                <xsd:element name="polygonal"></xsd:element>
                            </xsd:choice>
                            <xsd:element name="minSizeRule" minOccurs="0">
                                <xsd:complexType>
                                    <xsd:attribute name="width" type="xsd:double" use="required"/>
                                    <xsd:attribute name="height" type="xsd:double" use="required"/>
                                    <xsd:attribute name="rule" type="xsd:string" use="required"/>
                                </xsd:complexType>
                            </xsd:element>
                            <xsd:element name="spiceTemplate" minOccurs="0">
                                <xsd:complexType>
                                    <xsd:attribute name="value" type="xsd:string" use="required"/>
                                </xsd:complexType>
                            </xsd:element>
                        </xsd:sequence>
                        <xsd:attribute name="name" type="tns:PrimitiveNodeName" use="required"/>
                        <xsd:attribute name="fun" type="tns:PrimitiveNodeFun" use="required"/>
                    </xsd:complexType>
                </xsd:element>
                <xsd:element name="spiceHeader" minOccurs="0" maxOccurs="unbounded">
                    <xsd:complexType>
                        <xsd:sequence>
                            <xsd:element name="spiceLine" maxOccurs="unbounded">
                                <xsd:complexType>
                                    <xsd:attribute name="line" type="xsd:string" use="required"/>
                                </xsd:complexType>
                            </xsd:element>
                        </xsd:sequence>
                        <xsd:attribute name="level" type="tns:SpiceLevel"/>
                    </xsd:complexType>
                </xsd:element>
                <xsd:element name="displayStyle" maxOccurs="unbounded">
                    <xsd:complexType>
                        <xsd:sequence>
                            <xsd:element name="transparentLayer" minOccurs="0" maxOccurs="12">
                                <xsd:complexType>
                                    <xsd:sequence>
                                        <xsd:group ref="tns:Color"/>
                                    </xsd:sequence>
                                    <xsd:attribute name="transparent" type="tns:TransparentLayer"/>
                                </xsd:complexType>
                            </xsd:element>
                            <xsd:element name="layer" maxOccurs="unbounded" minOccurs="0">
                                <xsd:complexType>
                                    <xsd:sequence>
                                        <xsd:choice>
                                            <xsd:element name="transparentColor">
                                                <xsd:complexType>
                                                    <xsd:attribute name="transparent" type="tns:TransparentLayer"/>
                                                </xsd:complexType>
                                            </xsd:element>
                                            <xsd:element name="opaqueColor" type="tns:ColorRGB"></xsd:element>
                                        </xsd:choice>
                                        <xsd:element name="patternedOnDisplay" type="xsd:boolean"></xsd:element>
                                        <xsd:element name="patternedOnPrinter" type="xsd:boolean"></xsd:element>
                                        <xsd:element name="pattern" minOccurs="16" maxOccurs="16">
                                            <xsd:simpleType>
                                                <xsd:restriction base="xsd:string">
                                                    <xsd:pattern value="[X ]{16}"/>
                                                </xsd:restriction>
                                            </xsd:simpleType>
                                        </xsd:element>
                                        <xsd:element name="outlined" type="tns:LayerOutline"></xsd:element>
                                        <xsd:element name="opacity" type="tns:Opacity"></xsd:element>
                                        <xsd:element name="foreground" type="xsd:boolean"></xsd:element>
                                        <xsd:element name="display3D" minOccurs="0">
                                            <xsd:complexType>
                                                <xsd:attribute name="mode" type="xsd:string" use="required"/>
                                                <xsd:attribute name="factor" type="xsd:double" use="required"/>
                                            </xsd:complexType>
                                        </xsd:element>
                                    </xsd:sequence>
                                    <xsd:attribute name="name" type="tns:LayerName" use="required"/>
                                </xsd:complexType>
                            </xsd:element>
                        </xsd:sequence>
                        <xsd:attribute name="name" type="tns:DisplayStyleName" use="required"/>
                    </xsd:complexType>

                    <xsd:key name="transparent">
                        <xsd:selector xpath="./tns:transparentLayer"/>
                        <xsd:field xpath="@transparent"/>
                    </xsd:key>

                    <xsd:keyref name="transparentRef" refer="tns:transparent">
                        <xsd:selector xpath=".//tns:transparentColor"/>
                        <xsd:field xpath="@transparent"/>
                    </xsd:keyref>
                </xsd:element>
                <xsd:element name="menuPalette" minOccurs="0">
                    <xsd:complexType>
                        <xsd:sequence>
                            <xsd:element name="menuBox" maxOccurs="unbounded" minOccurs="0">
                                <xsd:complexType>
                                    <xsd:sequence>
                                        <xsd:group ref="tns:MenuItem" minOccurs="0" maxOccurs="unbounded"/>
                                    </xsd:sequence>
                                </xsd:complexType>
                            </xsd:element>
                        </xsd:sequence>
                        <xsd:attribute name="numColumns" type="xsd:int"/>
                    </xsd:complexType>
                </xsd:element>
                <xsd:element name="ruleSet" minOccurs="0" maxOccurs="unbounded">
                    <xsd:complexType>
                        <xsd:sequence>
                            <xsd:element name="layerRule" minOccurs="0" maxOccurs="unbounded">
                                <xsd:complexType>
                                    <xsd:group ref="tns:LayerToDistance"/>
                                    <xsd:attribute name="ruleName" type="tns:RuleName" use="required"/>
                                </xsd:complexType>
                            </xsd:element>
                        </xsd:sequence>
                        <xsd:attribute name="name" type="tns:RuleSetName" use="required"/>
                    </xsd:complexType>
                </xsd:element>
                <xsd:element name="Foundry" maxOccurs="unbounded">
                    <xsd:complexType>
                        <xsd:sequence>
                            <xsd:element name="layerGds" minOccurs="0" maxOccurs="unbounded">
                                <xsd:complexType>
                                    <xsd:sequence/>
                                    <xsd:attribute name="layer" type="tns:LayerName" use="required"/>
                                    <xsd:attribute name="gds" type="xsd:string" use="required"/>
                                </xsd:complexType>
                            </xsd:element>
                            <xsd:choice minOccurs="0" maxOccurs="unbounded">
                                <xsd:element name="LayerRule">
                                    <xsd:complexType>
                                        <xsd:attribute name="ruleName" type="tns:RuleName" use="required"/>
                                        <xsd:attribute name="layerName" type="tns:LayerName" use="required"/>
                                        <xsd:attribute name="type" type="tns:LayerRuleType" use="required"/>
                                        <xsd:attribute name="when" type="tns:DesignRuleWhen" use="required"/>
                                        <xsd:attribute name="condition" type="tns:DesignRuleCondition"/>
                                        <xsd:attribute name="value" type="xsd:double" use="required"/>
                                    </xsd:complexType>
                                </xsd:element>
                                <xsd:element name="LayersRule">
                                    <xsd:complexType>
                                        <xsd:attribute name="ruleName" type="tns:RuleName" use="required"/>
                                        <xsd:attribute name="layerNames" type="xsd:string" use="required"/>
                                        <xsd:attribute name="type" type="tns:LayersRuleType" use="required"/>
                                        <xsd:attribute name="when" type="tns:DesignRuleWhen" use="required"/>
                                        <xsd:attribute name="valueX" type="xsd:double"/>
                                        <xsd:attribute name="valueY" type="xsd:double"/>
                                        <xsd:attribute name="value" type="xsd:double"/>
                                        <xsd:attribute name="maxW" type="xsd:double"/>
                                        <xsd:attribute name="minLen" type="xsd:double"/>
                                        <xsd:attribute name="nodeName" type="tns:PrimitiveNodeName"/>
                                        <xsd:attribute name="condition" type="tns:DesignRuleCondition"/>
                                    </xsd:complexType>
                                </xsd:element>
                                <xsd:element name="NodeLayersRule">
                                    <xsd:complexType>
                                        <xsd:attribute name="ruleName" type="tns:RuleName" use="required"/>
                                        <xsd:attribute name="layerNames" type="xsd:string" use="required"/>
                                        <xsd:attribute name="nodeName" type="tns:PrimitiveNodeName" use="required"/>
                                        <xsd:attribute name="type" type="tns:NodeLayersRuleType" use="required"/>
                                        <xsd:attribute name="when" type="tns:DesignRuleWhen" use="required"/>
                                        <xsd:attribute name="value" type="xsd:double"/>
                                        <xsd:attribute name="valueX" type="xsd:double"/>
                                        <xsd:attribute name="valueY" type="xsd:double"/>
                                    </xsd:complexType>
                                </xsd:element>
                                <xsd:element name="NodeRule">
                                    <xsd:complexType>
                                        <xsd:attribute name="ruleName" type="tns:RuleName" use="required"/>
                                        <xsd:attribute name="type" type="tns:NodeRuleType" use="required"/>
                                        <xsd:attribute name="when" type="tns:DesignRuleWhen" use="required"/>
                                        <xsd:attribute name="value" type="xsd:double"/>
                                        <xsd:attribute name="valueX" type="xsd:double"/>
                                        <xsd:attribute name="valueY" type="xsd:double"/>
                                        <xsd:attribute name="nodeName" type="tns:PrimitiveNodeName" use="required"/>
                                    </xsd:complexType>
                                </xsd:element>
                            </xsd:choice>
                        </xsd:sequence>
                        <xsd:attribute name="name" type="tns:Foundry" use="required"/>
                    </xsd:complexType>
                </xsd:element>
            </xsd:sequence>
            <xsd:attribute name="name" type="xsd:NCName" use="required"/>
            <xsd:attribute name="class" type="tns:ClassName"/>
        </xsd:complexType>
        
        <xsd:key name="layer">
            <xsd:selector xpath="./tns:layer"/>
            <xsd:field xpath="@name"/>
        </xsd:key>

        <xsd:keyref name="layerRef" refer="tns:layer">
            <xsd:selector xpath=".//tns:layer"/>
            <xsd:field xpath="@name"/>
        </xsd:keyref>
    </xsd:element>
</xsd:schema>
