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

	<xs:element name="bank">
        <xs:complexType>
			<xs:attribute name="name" use="required" type="xs:string" />
		</xs:complexType>
    </xs:element>
	
	<xs:element name="job">
		<xs:complexType>
			<xs:sequence minOccurs="0" maxOccurs="unbounded">
				<xs:element ref="bank" />	
			</xs:sequence>
			<xs:attribute name="name" type="xs:string" use="required"/>
			<xs:attribute name="cron" type="xs:string" use="required"/>
		</xs:complexType>
		<xs:unique name="uniqueBankPerJob">
			<xs:selector xpath="bank" />
			<xs:field xpath="@name" />
		</xs:unique>
	</xs:element>
	
	<xs:element name="user">
		<xs:complexType>
			<xs:sequence minOccurs="0" maxOccurs="unbounded">
				<xs:element ref="job" />
			</xs:sequence>
			<xs:attribute name="login" type="xs:string" use="required" />
		</xs:complexType>
		<xs:unique name="uniqueJob">
			<xs:selector xpath="job" />
			<xs:field xpath="@name" />
		</xs:unique>
	</xs:element>
	
	<xs:element name="jobs">
        <xs:complexType>
			<xs:sequence minOccurs="0" maxOccurs="unbounded">
				<xs:element ref="user" />
			</xs:sequence>
		</xs:complexType>
		<xs:unique name="uniqueLogin">
			<xs:selector xpath="user" />
			<xs:field xpath="@login" />
		</xs:unique>
    </xs:element>
	
</xs:schema>
