<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema elementFormDefault="qualified" xmlns:xsd="http://www.w3.org/2001/XMLSchema">

    <xsd:include schemaLocation="baseTypes.xsd" />

    <xsd:element name="connections" type="connectionsType"></xsd:element>

    <xsd:complexType name="connectionsType">
        <xsd:choice minOccurs="0" maxOccurs="unbounded">
            <xsd:element name="connection" type="connectionType"></xsd:element>
            <xsd:element name="prohibition" type="prohibitionType"></xsd:element>
            <xsd:element name="delete" type="deleteType"></xsd:element>
        </xsd:choice>
        <xsd:attribute name="version" use="optional">
            <xsd:simpleType>
                <xsd:restriction base="xsd:string">
                    <xsd:pattern value="\d+.\d+"></xsd:pattern>
                </xsd:restriction>
            </xsd:simpleType>
        </xsd:attribute>
    </xsd:complexType>

    <xsd:complexType name="connectionType">
        <xsd:attribute name="from" type="xsd:string" use="required"/>
        <xsd:attribute name="to" type="xsd:string" use="optional"/>
        <xsd:attribute name="fromLane" type="xsd:nonNegativeInteger" use="optional"/>
        <xsd:attribute name="toLane" type="xsd:nonNegativeInteger" use="optional"/>
        <xsd:attribute name="uncontrolled" type="boolType" use="optional"/>
    </xsd:complexType>

    <xsd:complexType name="prohibitionType">
        <xsd:attribute name="prohibitor" use="required">
            <xsd:simpleType>
                <xsd:restriction base="xsd:string">
                    <xsd:pattern value=".+-&gt;.+"></xsd:pattern>
                </xsd:restriction>
            </xsd:simpleType>
        </xsd:attribute>
        <xsd:attribute name="prohibited" use="required">
            <xsd:simpleType>
                <xsd:restriction base="xsd:string">
                    <xsd:pattern value=".+-&gt;.+"></xsd:pattern>
                </xsd:restriction>
            </xsd:simpleType>
        </xsd:attribute>
    </xsd:complexType>

    <xsd:complexType name="deleteType">
        <xsd:attribute name="from" type="xsd:string" use="required"/>
        <xsd:attribute name="to" type="xsd:string" use="optional"/>
        <xsd:attribute name="fromLane" type="xsd:nonNegativeInteger" use="optional"/>
        <xsd:attribute name="toLane" type="xsd:nonNegativeInteger" use="optional"/>
    </xsd:complexType>

</xsd:schema>